@1claw/sdk 0.53.2 → 0.54.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.
@@ -4488,6 +4488,28 @@ export interface paths {
4488
4488
  patch?: never;
4489
4489
  trace?: never;
4490
4490
  };
4491
+ "/v1/approvals/{approval_id}/status": {
4492
+ parameters: {
4493
+ query?: never;
4494
+ header?: never;
4495
+ path?: never;
4496
+ cookie?: never;
4497
+ };
4498
+ /**
4499
+ * Poll approval status (agent-only)
4500
+ * @description Lightweight status poll for agents waiting on human approval.
4501
+ * Returns `status` and `expires_at` only. Agents may only poll
4502
+ * approvals they created (`agent_id` must match the caller).
4503
+ */
4504
+ get: operations["getApprovalStatus"];
4505
+ put?: never;
4506
+ post?: never;
4507
+ delete?: never;
4508
+ options?: never;
4509
+ head?: never;
4510
+ patch?: never;
4511
+ trace?: never;
4512
+ };
4491
4513
  "/v1/approvals/{approval_id}/decide": {
4492
4514
  parameters: {
4493
4515
  query?: never;
@@ -7619,6 +7641,20 @@ export interface components {
7619
7641
  * @default true
7620
7642
  */
7621
7643
  card_require_approval: boolean;
7644
+ /** @description Graduated transaction approval policy (HITL thresholds). Separate from hard guardrails. */
7645
+ tx_approval_policy?: {
7646
+ [key: string]: unknown;
7647
+ } | null;
7648
+ /**
7649
+ * @description EIP-712 escalation when typed_data matches no allowlist — deny (403) or route to HITL (approve).
7650
+ * @enum {string}
7651
+ */
7652
+ typed_data_policy?: "deny" | "approve";
7653
+ /**
7654
+ * @description Simulation failure escalation — deny (422) or route to HITL (approve).
7655
+ * @enum {string}
7656
+ */
7657
+ simulation_failure_policy?: "deny" | "approve";
7622
7658
  /**
7623
7659
  * Format: date-time
7624
7660
  * @description Optional expiration time for the agent's API key.
@@ -7700,6 +7736,22 @@ export interface components {
7700
7736
  card_reveal_enabled?: boolean;
7701
7737
  /** @description When true, card orders route through the human approval queue before x402 payment. */
7702
7738
  card_require_approval?: boolean;
7739
+ /** @description Graduated transaction approval policy (HITL thresholds). */
7740
+ tx_approval_policy?: {
7741
+ [key: string]: unknown;
7742
+ } | null;
7743
+ /**
7744
+ * @description EIP-712 escalation policy.
7745
+ * @enum {string|null}
7746
+ */
7747
+ typed_data_policy?: "deny" | "approve" | null;
7748
+ /**
7749
+ * @description Simulation failure escalation policy.
7750
+ * @enum {string|null}
7751
+ */
7752
+ simulation_failure_policy?: "deny" | "approve" | null;
7753
+ /** @description When true, clears circuit-breaker auto-suspension (human owner/admin only). */
7754
+ clear_auto_suspended?: boolean;
7703
7755
  /**
7704
7756
  * @description Enable OIDC federation (RFC 8693 token-exchange) for this agent.
7705
7757
  * When true, the agent may call POST /v1/auth/federated-token to mint
@@ -7829,6 +7881,16 @@ export interface components {
7829
7881
  card_reveal_enabled?: boolean;
7830
7882
  /** @description When true, card orders route through the human approval queue before x402 payment. */
7831
7883
  card_require_approval?: boolean;
7884
+ /** @description Graduated transaction approval policy (HITL thresholds). */
7885
+ tx_approval_policy?: {
7886
+ [key: string]: unknown;
7887
+ } | null;
7888
+ /** @enum {string|null} */
7889
+ typed_data_policy?: "deny" | "approve" | null;
7890
+ /** @enum {string|null} */
7891
+ simulation_failure_policy?: "deny" | "approve" | null;
7892
+ /** @description True when circuit breaker auto-suspended the agent after repeated guardrail denials. */
7893
+ auto_suspended?: boolean;
7832
7894
  /** @description Today's transaction count (UTC calendar day). Present when intents_api_enabled. */
7833
7895
  tx_count_today?: number;
7834
7896
  /** @description Today's overhead spend by chain in native units. */
@@ -9978,6 +10040,25 @@ export interface components {
9978
10040
  /** Format: date-time */
9979
10041
  created_at: string;
9980
10042
  };
10043
+ ApprovalStatusResponse: {
10044
+ /** @enum {string} */
10045
+ status: "pending" | "approved" | "rejected" | "expired";
10046
+ /** Format: date-time */
10047
+ expires_at?: string | null;
10048
+ };
10049
+ GuardrailViolation: {
10050
+ /** @enum {string} */
10051
+ error: "guardrail_violation";
10052
+ /** @enum {string} */
10053
+ reason_code: "binding_rpm_exceeded" | "agent_rpm_exceeded" | "graphql_mutation_blocked" | "graphql_depth_exceeded" | "graphql_parse_failed" | "graphql_introspection_blocked" | "response_too_large" | "request_too_large" | "method_not_allowed" | "header_not_allowed" | "dns_private_ip_blocked" | "agent_suspended" | "outside_time_window" | "secret_in_request" | "concurrency_exceeded" | "org_frozen";
10054
+ limit?: string | null;
10055
+ current?: string | null;
10056
+ attempted?: string | null;
10057
+ /** @default false */
10058
+ approval_available: boolean;
10059
+ retry_after_seconds?: number | null;
10060
+ detail?: string | null;
10061
+ };
9981
10062
  EmailOtpVerifyResponse: {
9982
10063
  /** @description JWT access token */
9983
10064
  token: string;
@@ -10170,9 +10251,7 @@ export interface components {
10170
10251
  config?: {
10171
10252
  [key: string]: unknown;
10172
10253
  };
10173
- guardrails?: {
10174
- [key: string]: unknown;
10175
- };
10254
+ guardrails?: components["schemas"]["BindingGuardrails"];
10176
10255
  /** @description Legacy: inline credential value. Use credential_source for new integrations. */
10177
10256
  credential?: {
10178
10257
  [key: string]: unknown;
@@ -10183,9 +10262,7 @@ export interface components {
10183
10262
  config?: {
10184
10263
  [key: string]: unknown;
10185
10264
  };
10186
- guardrails?: {
10187
- [key: string]: unknown;
10188
- };
10265
+ guardrails?: components["schemas"]["BindingGuardrails"];
10189
10266
  is_active?: boolean;
10190
10267
  /** @description Legacy: inline credential value. */
10191
10268
  credential?: {
@@ -10193,6 +10270,48 @@ export interface components {
10193
10270
  };
10194
10271
  credential_source?: components["schemas"]["CredentialSource"];
10195
10272
  };
10273
+ /** @description Per-binding execution guardrails enforced at execute time. */
10274
+ BindingGuardrails: {
10275
+ /** @description Host allowlist (trailing * wildcard supported). Empty = unrestricted at binding level. */
10276
+ allowed_hosts?: string[];
10277
+ /** @description Path allowlist for HTTP/GraphQL bindings. */
10278
+ allowed_paths?: string[];
10279
+ /** @description Per-binding RPM; strictest of binding and agent limits wins. Denied executions do not count. */
10280
+ max_requests_per_minute?: number;
10281
+ /** @description Upstream timeout cap for this binding. */
10282
+ max_duration_ms?: number;
10283
+ /**
10284
+ * @description Max serialized execute `params` size in bytes (default 256 KiB).
10285
+ * @default 262144
10286
+ */
10287
+ max_request_bytes: number;
10288
+ /** @description Max upstream response body bytes (default 1 MiB, hard cap 4 MiB). */
10289
+ max_response_bytes?: number;
10290
+ /** @description Agent-supplied headers permitted in execute params. Defaults to content-type, accept, user-agent, idempotency-key. */
10291
+ allowed_request_headers?: string[];
10292
+ /**
10293
+ * @description GraphQL only — when false, mutation operations return 403 guardrail_violation.
10294
+ * @default true
10295
+ */
10296
+ allow_mutations: boolean;
10297
+ /**
10298
+ * @description GraphQL only — when false, __schema/__type introspection is blocked.
10299
+ * @default false
10300
+ */
10301
+ allow_introspection: boolean;
10302
+ /**
10303
+ * @description GraphQL max selection depth.
10304
+ * @default 10
10305
+ */
10306
+ max_query_depth: number;
10307
+ /**
10308
+ * @description GraphQL max alias count.
10309
+ * @default 30
10310
+ */
10311
+ max_aliases: number;
10312
+ /** @description GraphQL operation kinds allowed (query, mutation, subscription). */
10313
+ allowed_operations?: string[];
10314
+ };
10196
10315
  BindingResponse: {
10197
10316
  /** Format: uuid */
10198
10317
  id: string;
@@ -10204,9 +10323,7 @@ export interface components {
10204
10323
  config?: {
10205
10324
  [key: string]: unknown;
10206
10325
  };
10207
- guardrails?: {
10208
- [key: string]: unknown;
10209
- };
10326
+ guardrails?: components["schemas"]["BindingGuardrails"];
10210
10327
  is_active: boolean;
10211
10328
  /** @description Whether a credential is stored for this binding. The value itself is never returned. */
10212
10329
  credential_set?: boolean;
@@ -10247,6 +10364,36 @@ export interface components {
10247
10364
  params: {
10248
10365
  [key: string]: unknown;
10249
10366
  };
10367
+ /**
10368
+ * @description When true, validate guardrails and approval policy without executing or persisting side effects.
10369
+ * @default false
10370
+ */
10371
+ dry_run: boolean;
10372
+ /**
10373
+ * Format: uuid
10374
+ * @description Internal — resume execution after human approval (server-injected).
10375
+ */
10376
+ resume_after_approval_id?: string;
10377
+ };
10378
+ ExecutionApprovalRequired: {
10379
+ /** @enum {string} */
10380
+ error: "approval_required";
10381
+ /** Format: uuid */
10382
+ approval_id: string;
10383
+ /** @enum {string} */
10384
+ status: "pending";
10385
+ /** Format: date-time */
10386
+ expires_at?: string | null;
10387
+ };
10388
+ TxAwaitingApproval: {
10389
+ /** @enum {string} */
10390
+ status: "awaiting_approval";
10391
+ /** Format: uuid */
10392
+ approval_id: string;
10393
+ /** Format: uuid */
10394
+ tx_id?: string | null;
10395
+ /** Format: date-time */
10396
+ expires_at?: string | null;
10250
10397
  };
10251
10398
  ExecuteResponse: {
10252
10399
  /** Format: uuid */
@@ -14233,6 +14380,15 @@ export interface operations {
14233
14380
  "application/json": components["schemas"]["TransactionResponse"];
14234
14381
  };
14235
14382
  };
14383
+ /** @description Transaction held for human approval (graduated tx_approval_policy) */
14384
+ 202: {
14385
+ headers: {
14386
+ [name: string]: unknown;
14387
+ };
14388
+ content: {
14389
+ "application/json": components["schemas"]["TxAwaitingApproval"];
14390
+ };
14391
+ };
14236
14392
  402: components["responses"]["PaymentRequired"];
14237
14393
  403: components["responses"]["Forbidden"];
14238
14394
  /** @description Idempotency-Key in use by another in-flight request; retry later. */
@@ -15031,8 +15187,43 @@ export interface operations {
15031
15187
  "application/json": components["schemas"]["ExecuteResponse"];
15032
15188
  };
15033
15189
  };
15190
+ /** @description Execution requires human approval before running */
15191
+ 202: {
15192
+ headers: {
15193
+ [name: string]: unknown;
15194
+ };
15195
+ content: {
15196
+ "application/json": components["schemas"]["ExecutionApprovalRequired"];
15197
+ };
15198
+ };
15034
15199
  400: components["responses"]["BadRequest"];
15035
- 403: components["responses"]["Forbidden"];
15200
+ /** @description Guardrail violation or permission denied */
15201
+ 403: {
15202
+ headers: {
15203
+ [name: string]: unknown;
15204
+ };
15205
+ content: {
15206
+ "application/json": components["schemas"]["GuardrailViolation"] | components["schemas"]["ProblemDetails"];
15207
+ };
15208
+ };
15209
+ /** @description Request params exceed binding max_request_bytes */
15210
+ 413: {
15211
+ headers: {
15212
+ [name: string]: unknown;
15213
+ };
15214
+ content: {
15215
+ "application/json": components["schemas"]["GuardrailViolation"];
15216
+ };
15217
+ };
15218
+ /** @description Binding or agent execution rate limit exceeded */
15219
+ 429: {
15220
+ headers: {
15221
+ [name: string]: unknown;
15222
+ };
15223
+ content: {
15224
+ "application/json": components["schemas"]["GuardrailViolation"];
15225
+ };
15226
+ };
15036
15227
  };
15037
15228
  };
15038
15229
  listExecutions: {
@@ -17601,6 +17792,30 @@ export interface operations {
17601
17792
  404: components["responses"]["NotFound"];
17602
17793
  };
17603
17794
  };
17795
+ getApprovalStatus: {
17796
+ parameters: {
17797
+ query?: never;
17798
+ header?: never;
17799
+ path: {
17800
+ approval_id: string;
17801
+ };
17802
+ cookie?: never;
17803
+ };
17804
+ requestBody?: never;
17805
+ responses: {
17806
+ /** @description Approval status */
17807
+ 200: {
17808
+ headers: {
17809
+ [name: string]: unknown;
17810
+ };
17811
+ content: {
17812
+ "application/json": components["schemas"]["ApprovalStatusResponse"];
17813
+ };
17814
+ };
17815
+ 403: components["responses"]["Forbidden"];
17816
+ 404: components["responses"]["NotFound"];
17817
+ };
17818
+ };
17604
17819
  decideApproval: {
17605
17820
  parameters: {
17606
17821
  query?: never;