@1claw/sdk 0.52.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"][];
@@ -7309,6 +7375,11 @@ export interface components {
7309
7375
  * @default false
7310
7376
  */
7311
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;
7312
7383
  };
7313
7384
  UpdateAgentRequest: {
7314
7385
  name?: string;
@@ -8641,6 +8712,45 @@ export interface components {
8641
8712
  events?: components["schemas"]["AuditEvent"][];
8642
8713
  count?: number;
8643
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
+ };
8644
8754
  AuditEvent: {
8645
8755
  /** Format: uuid */
8646
8756
  id?: string;
@@ -10755,6 +10865,13 @@ export interface components {
10755
10865
  * @default false
10756
10866
  */
10757
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;
10758
10875
  } & {
10759
10876
  [key: string]: unknown;
10760
10877
  };
@@ -10802,6 +10919,10 @@ export interface components {
10802
10919
  intent_type_in?: string[];
10803
10920
  /** @description When true, this entry always matches regardless of other fields */
10804
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[];
10805
10926
  };
10806
10927
  /**
10807
10928
  * @description Time window condition for policy evaluation. Used inside the policy
@@ -10859,6 +10980,11 @@ export interface components {
10859
10980
  * policy.delete, signing_key.export, member.role_change, member.remove
10860
10981
  */
10861
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[];
10862
10988
  };
10863
10989
  ApprovalRequirement: {
10864
10990
  min_approvals: number;
@@ -13145,8 +13271,10 @@ export interface operations {
13145
13271
  };
13146
13272
  resolveEnvVars: {
13147
13273
  parameters: {
13148
- query: {
13149
- 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 */
13150
13278
  git_branch?: string;
13151
13279
  };
13152
13280
  header?: never;
@@ -15392,6 +15520,30 @@ export interface operations {
15392
15520
  402: components["responses"]["PaymentRequired"];
15393
15521
  };
15394
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
+ };
15395
15547
  listIpRules: {
15396
15548
  parameters: {
15397
15549
  query?: never;
@@ -16609,6 +16761,26 @@ export interface operations {
16609
16761
  };
16610
16762
  };
16611
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
+ };
16612
16784
  getPlatformAppStats: {
16613
16785
  parameters: {
16614
16786
  query?: never;