@terminal3/t3n-sdk 5.26.0 → 5.28.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
@@ -1124,8 +1124,8 @@ declare function parseContractResponse<T = unknown>(raw: string, schema?: Contra
1124
1124
 
1125
1125
  /**
1126
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.
1127
+ * and strict decoders for the functions the `T3nClient` wrappers dispatch:
1128
+ * agents on `tee:organisation`, OAuth connections on `tee:session`.
1129
1129
  */
1130
1130
 
1131
1131
  /**
@@ -2533,8 +2533,20 @@ interface AuditBatch {
2533
2533
  * commit? `false` means the call rolled back or trapped, so an event's
2534
2534
  * `outcome: "success"` in this batch is the contract's *claim*, not a
2535
2535
  * committed fact — filter on this when you need only durable events.
2536
+ * This holds for approval events too (`details.event_type` is
2537
+ * `action.escalated`, `action.reviewed` or `action.executed`): a
2538
+ * rolled-back approver batch can list `action.reviewed` as `success` next
2539
+ * to a failed `action.executed`, so always check `committed`. Events in a
2540
+ * batch share one timestamp and are ordered by their position in `events`.
2536
2541
  */
2537
2542
  committed: boolean;
2543
+ /**
2544
+ * Present when the platform, not a client, started this dispatch, for
2545
+ * example `"hitl-resume:<run id>"` for a call resumed after a human
2546
+ * approval. Absent for a client call. The id after the prefix may itself
2547
+ * contain colons, so do not split on them.
2548
+ */
2549
+ origin?: string;
2538
2550
  events: AuditEvent[];
2539
2551
  }
2540
2552
  /**
@@ -2634,6 +2646,14 @@ interface ActivityEntry {
2634
2646
  * validated one.
2635
2647
  */
2636
2648
  roles?: string[];
2649
+ /**
2650
+ * Present when the node, not the caller, started the call, for example
2651
+ * `"hitl-resume:<run id>"` for the call the node ran as the requester
2652
+ * once an approval was granted. Stamped by the node, never by a contract.
2653
+ * Absent when the caller started the call. The id after the prefix may
2654
+ * itself contain colons, so do not split on them.
2655
+ */
2656
+ origin?: string;
2637
2657
  /**
2638
2658
  * Labels the contract chose for this call — the `custom` object it returned
2639
2659
  * in its response, which the node removes from the response and stores on
@@ -3498,7 +3518,7 @@ declare class T3nClient {
3498
3518
  * What the consent page shows about an OAuth client, before any
3499
3519
  * authorisation. Read only.
3500
3520
  *
3501
- * Dispatches `oauth-describe-client` on `tee:organisation/contracts`. The
3521
+ * Dispatches `oauth-describe-client` on `tee:session/contracts`. The
3502
3522
  * enclave fetches a CIMD client's metadata document itself and checks
3503
3523
  * `redirectUri` against the client's registration and the operator's
3504
3524
  * policy. On a refusal the page shows the error and does not redirect.
@@ -3512,7 +3532,7 @@ declare class T3nClient {
3512
3532
  * Let an OAuth client act as one of the caller's own T3N agents, and get the
3513
3533
  * one-time code to send back to it.
3514
3534
  *
3515
- * Dispatches `oauth-authorise` on `tee:organisation/contracts`. The session
3535
+ * Dispatches `oauth-authorise` on `tee:session/contracts`. The session
3516
3536
  * must be a person acting for themselves. The code is bound to the client,
3517
3537
  * the redirect URI, the resource and the PKCE challenge; the client redeems
3518
3538
  * it at the node's token endpoint.
@@ -3527,7 +3547,7 @@ declare class T3nClient {
3527
3547
  * The caller's own OAuth connections, including revoked and expired ones
3528
3548
  * not yet swept. Self only.
3529
3549
  *
3530
- * Dispatches `list-oauth-connections` on `tee:organisation/contracts`.
3550
+ * Dispatches `list-oauth-connections` on `tee:session/contracts`.
3531
3551
  *
3532
3552
  * @throws {RpcError} when the contract refuses
3533
3553
  * @throws {ContractResponseError} when the response does not match its shape
@@ -3538,7 +3558,7 @@ declare class T3nClient {
3538
3558
  * working at once; an access token already issued runs to its expiry. The
3539
3559
  * agent is untouched. Idempotent.
3540
3560
  *
3541
- * Dispatches `revoke-oauth-connection` on `tee:organisation/contracts`.
3561
+ * Dispatches `revoke-oauth-connection` on `tee:session/contracts`.
3542
3562
  *
3543
3563
  * @throws {RpcError} when the caller owns no connection with that id
3544
3564
  * @throws {ContractResponseError} when the response does not name the connection