@1claw/sdk 0.52.0 → 0.53.1
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 +29 -0
- package/dist/generated/api-types.d.ts +994 -8
- package/dist/generated/api-types.d.ts.map +1 -1
- package/dist/resources/access.d.ts +2 -0
- package/dist/resources/access.d.ts.map +1 -1
- package/dist/resources/access.js +2 -0
- package/dist/resources/access.js.map +1 -1
- package/dist/resources/audit.d.ts +11 -1
- package/dist/resources/audit.d.ts.map +1 -1
- package/dist/resources/audit.js +19 -0
- package/dist/resources/audit.js.map +1 -1
- package/dist/types.d.ts +114 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -1
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`.
|