@1claw/sdk 0.51.0 → 0.53.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/README.md CHANGED
@@ -151,6 +151,35 @@ const { vars, sources } = await client.envVars.resolve(vaultId, "production");
151
151
  await client.envVars.delete(vaultId, "DATABASE_URL");
152
152
  ```
153
153
 
154
+ ### Agent Environment Tagging (v0.52)
155
+
156
+ Tag agents with a named environment for policy scoping and env var resolution:
157
+
158
+ ```typescript
159
+ // Create an agent tagged for preview deployments
160
+ await client.agents.create({
161
+ name: "preview-bot",
162
+ environment: "preview",
163
+ env_auto_resolve: true,
164
+ });
165
+
166
+ // Update environment and per-environment guardrails
167
+ await client.agents.update(agentId, {
168
+ environment: "production",
169
+ environment_locked: true,
170
+ per_environment_guardrails: {
171
+ production: { max_value: "1.0", daily_limit: "10.0" },
172
+ preview: { max_value: "0.1", daily_limit: "1.0" },
173
+ },
174
+ });
175
+
176
+ // Resolve env vars — when env_auto_resolve is true on the agent JWT,
177
+ // omit environment and the server uses the agent's tag
178
+ const { vars } = await client.envVars.resolve(vaultId);
179
+ ```
180
+
181
+ Agent JWTs include an `environment` claim when set. Policy conditions support `environment_in` for environment-scoped access.
182
+
154
183
  **Agent create response:** `agents.create()` returns `{ agent: AgentResponse, api_key?: string }`. The `api_key` is only present for `auth_method: "api_key"` and is shown once — use `data.agent.id` and `data.api_key` from the response.
155
184
 
156
185
  **Access grants:** `grantAgent(vaultId, agentId, permissions, options?)` — positional args; options include `secretPathPattern`, `conditions`, `expires_at`.
@@ -1185,6 +1185,9 @@ export interface paths {
1185
1185
  /**
1186
1186
  * Resolve environment variables
1187
1187
  * @description Resolve the final KEY=VALUE set for an environment with full precedence (shared < vault < branch override).
1188
+ * When the caller is an agent with `env_auto_resolve: true`, the `environment` query parameter may be omitted —
1189
+ * the server uses the agent's tagged environment from the JWT. Org setting `env.enforce_agent_environment_scope`
1190
+ * blocks agents from resolving vars outside their tagged environment.
1188
1191
  */
1189
1192
  get: operations["resolveEnvVars"];
1190
1193
  put?: never;
@@ -2490,6 +2493,28 @@ export interface paths {
2490
2493
  patch?: never;
2491
2494
  trace?: never;
2492
2495
  };
2496
+ "/v1/audit/verify": {
2497
+ parameters: {
2498
+ query?: never;
2499
+ header?: never;
2500
+ path?: never;
2501
+ cookie?: never;
2502
+ };
2503
+ /**
2504
+ * Verify audit hash chain integrity
2505
+ * @description Verifies the HMAC-SHA256 integrity hash chain for audit events in the
2506
+ * calling organization. Returns whether the chain is valid, how many
2507
+ * events were verified, and the point of first break (if any).
2508
+ */
2509
+ get: operations["verifyAuditChain"];
2510
+ put?: never;
2511
+ post?: never;
2512
+ delete?: never;
2513
+ options?: never;
2514
+ head?: never;
2515
+ patch?: never;
2516
+ trace?: never;
2517
+ };
2493
2518
  "/v1/security/ip-rules": {
2494
2519
  parameters: {
2495
2520
  query?: never;
@@ -3184,6 +3209,29 @@ export interface paths {
3184
3209
  patch?: never;
3185
3210
  trace?: never;
3186
3211
  };
3212
+ "/v1/shroud/attestation": {
3213
+ parameters: {
3214
+ query?: never;
3215
+ header?: never;
3216
+ path?: never;
3217
+ cookie?: never;
3218
+ };
3219
+ /**
3220
+ * TEE attestation proof (public)
3221
+ * @description Public endpoint returning the TEE attestation proof for Shroud.
3222
+ * Returns the GCE Confidential VM identity token and image hash so
3223
+ * customers can verify Shroud is running inside a Confidential VM
3224
+ * before signing contracts. Served from shroud.1claw.xyz.
3225
+ */
3226
+ get: operations["getShroudAttestation"];
3227
+ put?: never;
3228
+ post?: never;
3229
+ delete?: never;
3230
+ options?: never;
3231
+ head?: never;
3232
+ patch?: never;
3233
+ trace?: never;
3234
+ };
3187
3235
  "/v1/shroud/activity": {
3188
3236
  parameters: {
3189
3237
  query?: never;
@@ -7104,6 +7152,17 @@ export interface components {
7104
7152
  };
7105
7153
  consensus_trigger?: components["schemas"]["ConsensusTrigger"];
7106
7154
  tx_conditions?: components["schemas"]["TxConditions"];
7155
+ /**
7156
+ * Format: uuid
7157
+ * @description Optional completed approval ID for control-plane consensus bypass. When control-plane consensus policies match, resubmit with this field after the approval has been executed.
7158
+ */
7159
+ approval_id?: string;
7160
+ /**
7161
+ * @description Policy schema version. Version 1 = legacy field-matching only.
7162
+ * Version 2 = expression engine support in tx_conditions.
7163
+ * @default 2
7164
+ */
7165
+ policy_schema_version: number;
7107
7166
  };
7108
7167
  UpdatePolicyRequest: {
7109
7168
  permissions?: string[];
@@ -7124,6 +7183,11 @@ export interface components {
7124
7183
  };
7125
7184
  consensus_trigger?: components["schemas"]["ConsensusTrigger"];
7126
7185
  tx_conditions?: components["schemas"]["TxConditions"];
7186
+ /**
7187
+ * Format: uuid
7188
+ * @description Optional completed approval ID for control-plane consensus bypass.
7189
+ */
7190
+ approval_id?: string;
7127
7191
  };
7128
7192
  PolicyResponse: {
7129
7193
  /** Format: uuid */
@@ -7155,6 +7219,8 @@ export interface components {
7155
7219
  };
7156
7220
  consensus_trigger?: components["schemas"]["ConsensusTrigger"];
7157
7221
  tx_conditions?: components["schemas"]["TxConditions"];
7222
+ /** @description Policy schema version (1 = legacy, 2 = expression engine) */
7223
+ policy_schema_version?: number;
7158
7224
  };
7159
7225
  PolicyListResponse: {
7160
7226
  policies?: components["schemas"]["PolicyResponse"][];
@@ -7297,6 +7363,23 @@ export interface components {
7297
7363
  * @description Optional expiration time for the agent's API key.
7298
7364
  */
7299
7365
  api_key_expires_at?: string | null;
7366
+ /** @description Named environment for this agent (production, preview, development, or custom). */
7367
+ environment?: string;
7368
+ /**
7369
+ * @description When true, the environment tag cannot be changed after creation.
7370
+ * @default false
7371
+ */
7372
+ environment_locked: boolean;
7373
+ /**
7374
+ * @description When true, env var resolve endpoints auto-fill environment from this agent's tag.
7375
+ * @default false
7376
+ */
7377
+ env_auto_resolve: boolean;
7378
+ /**
7379
+ * Format: uuid
7380
+ * @description Optional completed approval ID for control-plane consensus bypass when creating an agent under a control-plane governance policy.
7381
+ */
7382
+ approval_id?: string;
7300
7383
  };
7301
7384
  UpdateAgentRequest: {
7302
7385
  name?: string;
@@ -7396,6 +7479,16 @@ export interface components {
7396
7479
  * @description Optional expiration time for the agent's API key. Set to null to clear.
7397
7480
  */
7398
7481
  api_key_expires_at?: string | null;
7482
+ /** @description Named environment for this agent (production, preview, development, or custom). */
7483
+ environment?: string | null;
7484
+ /** @description When true, the environment tag cannot be changed after creation. */
7485
+ environment_locked?: boolean;
7486
+ /** @description When true, env var resolve endpoints auto-fill environment from this agent's tag. */
7487
+ env_auto_resolve?: boolean;
7488
+ /** @description Per-environment guardrail overrides keyed by environment slug. */
7489
+ per_environment_guardrails?: {
7490
+ [key: string]: unknown;
7491
+ };
7399
7492
  };
7400
7493
  AgentResponse: {
7401
7494
  /** Format: uuid */
@@ -7532,6 +7625,16 @@ export interface components {
7532
7625
  last_active_at?: string;
7533
7626
  /** @description Multi-chain; one Safe per chain */
7534
7627
  smart_accounts?: components["schemas"]["AgentSmartAccountResponse"][];
7628
+ /** @description Named environment this agent belongs to (production, preview, development, or custom). */
7629
+ environment?: string | null;
7630
+ /** @description When true, the environment tag is locked and cannot be changed. */
7631
+ environment_locked?: boolean;
7632
+ /** @description When true, env var resolve endpoints auto-fill environment from this agent's tag. */
7633
+ env_auto_resolve?: boolean;
7634
+ /** @description Per-environment guardrail overrides keyed by environment slug. */
7635
+ per_environment_guardrails?: {
7636
+ [key: string]: unknown;
7637
+ };
7535
7638
  };
7536
7639
  KnownToken: {
7537
7640
  /** Format: uuid */
@@ -8609,6 +8712,45 @@ export interface components {
8609
8712
  events?: components["schemas"]["AuditEvent"][];
8610
8713
  count?: number;
8611
8714
  };
8715
+ AuditVerifyResponse: {
8716
+ /** @description Whether the integrity hash chain is unbroken */
8717
+ chain_valid: boolean;
8718
+ /**
8719
+ * Format: int64
8720
+ * @description Number of events with valid integrity hashes
8721
+ */
8722
+ events_verified: number;
8723
+ /** @description Total events examined */
8724
+ events_checked: number;
8725
+ /**
8726
+ * Format: uuid
8727
+ * @description First event where chain integrity broke (null if valid)
8728
+ */
8729
+ broken_at_event_id?: string | null;
8730
+ scheme: {
8731
+ /** @example HMAC-SHA256 */
8732
+ algorithm?: string;
8733
+ chain_structure?: string;
8734
+ hash_field?: string;
8735
+ link_field?: string;
8736
+ /** Format: uri */
8737
+ documentation?: string;
8738
+ };
8739
+ };
8740
+ ShroudAttestationResponse: {
8741
+ /** @description Whether TEE attestation was successfully fetched */
8742
+ attested: boolean;
8743
+ /** @description Confidential VM image hash (compare against published Docker digest) */
8744
+ image_hash: string;
8745
+ /** @description GCE metadata identity JWT (verify against Google public keys) */
8746
+ identity_token: string;
8747
+ verification: {
8748
+ steps?: string[];
8749
+ /** Format: uri */
8750
+ google_certs_url?: string;
8751
+ expected_audience?: string;
8752
+ };
8753
+ };
8612
8754
  AuditEvent: {
8613
8755
  /** Format: uuid */
8614
8756
  id?: string;
@@ -10723,6 +10865,13 @@ export interface components {
10723
10865
  * @default false
10724
10866
  */
10725
10867
  deep_inspect: boolean;
10868
+ /**
10869
+ * @description Mini expression DSL for policy conditions (schema version 2+).
10870
+ * References transaction context fields (chain, value_wei, to_address,
10871
+ * function_selector, etc.) with boolean operators. Fail-closed on parse
10872
+ * or evaluation errors. Example: `chain == 'ethereum' && value_wei > 1000000000000000000`
10873
+ */
10874
+ expression?: string;
10726
10875
  } & {
10727
10876
  [key: string]: unknown;
10728
10877
  };
@@ -10770,6 +10919,10 @@ export interface components {
10770
10919
  intent_type_in?: string[];
10771
10920
  /** @description When true, this entry always matches regardless of other fields */
10772
10921
  always?: boolean;
10922
+ /** @description Control-plane actions to match (e.g. policy.create, signing_key.export) */
10923
+ action_in?: string[];
10924
+ /** @description Version-agnostic action kind groups (e.g. signing_key.*, policy.*, member.*) */
10925
+ action_kind_in?: string[];
10773
10926
  };
10774
10927
  /**
10775
10928
  * @description Time window condition for policy evaluation. Used inside the policy
@@ -10827,6 +10980,11 @@ export interface components {
10827
10980
  * policy.delete, signing_key.export, member.role_change, member.remove
10828
10981
  */
10829
10982
  actions: string[];
10983
+ } | {
10984
+ /** @enum {string} */
10985
+ type: "action_kind_in";
10986
+ /** @description Version-agnostic action kind groups, e.g. signing_key.*, policy.*, member.* */
10987
+ action_kinds: string[];
10830
10988
  };
10831
10989
  ApprovalRequirement: {
10832
10990
  min_approvals: number;
@@ -13113,8 +13271,10 @@ export interface operations {
13113
13271
  };
13114
13272
  resolveEnvVars: {
13115
13273
  parameters: {
13116
- query: {
13117
- environment: string;
13274
+ query?: {
13275
+ /** @description Target environment (production, preview, development, or custom). Required for human callers; optional for agents with env_auto_resolve when the agent has an environment tag. */
13276
+ environment?: string;
13277
+ /** @description Optional git branch for preview branch overrides */
13118
13278
  git_branch?: string;
13119
13279
  };
13120
13280
  header?: never;
@@ -15360,6 +15520,30 @@ export interface operations {
15360
15520
  402: components["responses"]["PaymentRequired"];
15361
15521
  };
15362
15522
  };
15523
+ verifyAuditChain: {
15524
+ parameters: {
15525
+ query?: {
15526
+ from?: string;
15527
+ to?: string;
15528
+ limit?: number;
15529
+ };
15530
+ header?: never;
15531
+ path?: never;
15532
+ cookie?: never;
15533
+ };
15534
+ requestBody?: never;
15535
+ responses: {
15536
+ /** @description Chain verification result */
15537
+ 200: {
15538
+ headers: {
15539
+ [name: string]: unknown;
15540
+ };
15541
+ content: {
15542
+ "application/json": components["schemas"]["AuditVerifyResponse"];
15543
+ };
15544
+ };
15545
+ };
15546
+ };
15363
15547
  listIpRules: {
15364
15548
  parameters: {
15365
15549
  query?: never;
@@ -16577,6 +16761,26 @@ export interface operations {
16577
16761
  };
16578
16762
  };
16579
16763
  };
16764
+ getShroudAttestation: {
16765
+ parameters: {
16766
+ query?: never;
16767
+ header?: never;
16768
+ path?: never;
16769
+ cookie?: never;
16770
+ };
16771
+ requestBody?: never;
16772
+ responses: {
16773
+ /** @description Attestation proof */
16774
+ 200: {
16775
+ headers: {
16776
+ [name: string]: unknown;
16777
+ };
16778
+ content: {
16779
+ "application/json": components["schemas"]["ShroudAttestationResponse"];
16780
+ };
16781
+ };
16782
+ };
16783
+ };
16580
16784
  getPlatformAppStats: {
16581
16785
  parameters: {
16582
16786
  query?: never;