@1claw/sdk 0.45.0 → 0.46.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
@@ -90,7 +90,7 @@ await client.auth.verifyEmailChange({ code: "123456" });
90
90
  | `client.vault` | `create`, `get`, `list`, `delete`, `enableMpc`, `disableMpc` |
91
91
  | `client.secrets` | `set`, `get`, `delete`, `list`, `rotate` |
92
92
  | `client.access` | `grantHuman`, `grantAgent`, `update`, `revoke`, `listGrants` |
93
- | `client.agents` | `enroll` (also `AgentsResource.enroll(baseUrl, …)` static), `create`, `getSelf`, `get`, `list`, `update`, `delete`, `rotateKey`, `generateEoa`, `createSmartAccount`, `deleteSmartAccount`, `rotateSigner`, `submitTransaction`, `signTransaction`, `getTransaction`, `listTransactions`, `simulateTransaction`, `simulateBundle`, `sign` |
93
+ | `client.agents` | `enroll` (also `AgentsResource.enroll(baseUrl, …)` static), `create`, `getSelf`, `get`, `list`, `update`, `delete`, `rotateKey`, `generateEoa`, `createSmartAccount`, `deleteSmartAccount`, `rotateSigner`, `submitTransaction`, `signTransaction`, `getTransaction`, `listTransactions`, `simulateTransaction`, `simulateBundle`, `sign`, `createDelegation`, `listDelegations`, `getDelegation`, `updateDelegation`, `revokeDelegation`, `getEffectiveDelegations` |
94
94
  | `client.chains` | `list`, `get`, `adminList`, `create`, `update`, `delete` |
95
95
  | `client.sharing` | `create`, `access`, `listOutbound`, `listInbound`, `accept`, `decline`, `revoke` |
96
96
  | `client.approvals` | `request`, `list`, `approve`, `deny`, `check`, `subscribe` |
@@ -330,6 +330,39 @@ When `execution_require_tee` is true:
330
330
 
331
331
  Both require `intents_api_enabled` / `execution_intents_enabled` to be on first.
332
332
 
333
+ ### Agent-to-Agent Delegation
334
+
335
+ Human-controlled authorization for inter-agent task delegation. Agents cannot delegate to other agents without an explicit delegation record created by a human.
336
+
337
+ ```typescript
338
+ // Create a delegation (human-only)
339
+ await client.agents.createDelegation(orchestratorId, {
340
+ delegate_id: subAgentId,
341
+ allowed_tools: ["delegate_task", "search_memory"],
342
+ max_daily_delegations: 100,
343
+ max_depth: 2,
344
+ delegation_mode: "caller",
345
+ expires_at: "2026-12-31T23:59:59Z",
346
+ });
347
+
348
+ // List delegations for an agent
349
+ const delegations = await client.agents.listDelegations(agentId);
350
+
351
+ // Get effective delegations (agent-callable — for runtime tool discovery)
352
+ const effective = await client.agents.getEffectiveDelegations(agentId);
353
+
354
+ // Update a delegation (human-only)
355
+ await client.agents.updateDelegation(agentId, delegationId, {
356
+ max_daily_delegations: 200,
357
+ is_active: false,
358
+ });
359
+
360
+ // Revoke a delegation (human-only)
361
+ await client.agents.revokeDelegation(agentId, delegationId);
362
+ ```
363
+
364
+ Delegation modes: `caller` (delegate uses its own credentials), `target` (delegate uses target's config), `both` (either mode per invocation).
365
+
333
366
  ### Overhead Budget and Transaction Count Limits
334
367
 
335
368
  Protect against non-value drain attacks (ATA rent drain, XRP reserve exhaustion, Tron energy drain):
@@ -1515,6 +1515,74 @@ export interface paths {
1515
1515
  patch?: never;
1516
1516
  trace?: never;
1517
1517
  };
1518
+ "/v1/agents/{agent_id}/delegations": {
1519
+ parameters: {
1520
+ query?: never;
1521
+ header?: never;
1522
+ path?: never;
1523
+ cookie?: never;
1524
+ };
1525
+ /**
1526
+ * List delegations for an agent
1527
+ * @description List all delegations where this agent is the delegator.
1528
+ */
1529
+ get: operations["listDelegations"];
1530
+ put?: never;
1531
+ /**
1532
+ * Create a delegation
1533
+ * @description Grant an agent (delegator) permission to delegate tasks to another agent (delegate).
1534
+ * Human-only — agents cannot create their own delegations.
1535
+ */
1536
+ post: operations["createDelegation"];
1537
+ delete?: never;
1538
+ options?: never;
1539
+ head?: never;
1540
+ patch?: never;
1541
+ trace?: never;
1542
+ };
1543
+ "/v1/agents/{agent_id}/delegations/effective": {
1544
+ parameters: {
1545
+ query?: never;
1546
+ header?: never;
1547
+ path?: never;
1548
+ cookie?: never;
1549
+ };
1550
+ /**
1551
+ * Get effective delegations
1552
+ * @description Get the effective delegations for an agent, including daily usage statistics.
1553
+ * Agents can call this on their own ID to discover what they are authorized to delegate to.
1554
+ */
1555
+ get: operations["getEffectiveDelegations"];
1556
+ put?: never;
1557
+ post?: never;
1558
+ delete?: never;
1559
+ options?: never;
1560
+ head?: never;
1561
+ patch?: never;
1562
+ trace?: never;
1563
+ };
1564
+ "/v1/agents/{agent_id}/delegations/{delegation_id}": {
1565
+ parameters: {
1566
+ query?: never;
1567
+ header?: never;
1568
+ path?: never;
1569
+ cookie?: never;
1570
+ };
1571
+ /** Get a specific delegation */
1572
+ get: operations["getDelegation"];
1573
+ put?: never;
1574
+ post?: never;
1575
+ /** Revoke a delegation */
1576
+ delete: operations["revokeDelegation"];
1577
+ options?: never;
1578
+ head?: never;
1579
+ /**
1580
+ * Update a delegation
1581
+ * @description Update delegation tools, limits, mode, or active status. Human-only.
1582
+ */
1583
+ patch: operations["updateDelegation"];
1584
+ trace?: never;
1585
+ };
1518
1586
  "/v1/agents/{agent_id}/sign": {
1519
1587
  parameters: {
1520
1588
  query?: never;
@@ -7232,6 +7300,82 @@ export interface components {
7232
7300
  BankrKeyLeaseListResponse: {
7233
7301
  leases?: components["schemas"]["BankrKeyLeaseResponse"][];
7234
7302
  };
7303
+ CreateDelegationRequest: {
7304
+ /**
7305
+ * Format: uuid
7306
+ * @description The agent ID to delegate to.
7307
+ */
7308
+ delegate_id: string;
7309
+ /** @description Tool names the delegate may use. Empty means all tools allowed. */
7310
+ allowed_tools?: string[];
7311
+ /** @description Tool names the delegate may NOT use. */
7312
+ blocked_tools?: string[];
7313
+ /** @description Maximum delegation calls per UTC day. NULL means unlimited. */
7314
+ max_daily_delegations?: number;
7315
+ /**
7316
+ * @description Maximum delegation chain depth (default 3).
7317
+ * @default 3
7318
+ */
7319
+ max_depth: number;
7320
+ /** @description Additional guardrail constraints for this delegation. */
7321
+ guardrails?: Record<string, never>;
7322
+ /**
7323
+ * @description Execution mode: caller (use delegator's creds), target (use delegate's config), or both.
7324
+ * @default caller
7325
+ * @enum {string}
7326
+ */
7327
+ delegation_mode: "caller" | "target" | "both";
7328
+ /**
7329
+ * Format: date-time
7330
+ * @description Optional expiration timestamp.
7331
+ */
7332
+ expires_at?: string;
7333
+ };
7334
+ UpdateDelegationRequest: {
7335
+ allowed_tools?: string[];
7336
+ blocked_tools?: string[];
7337
+ max_daily_delegations?: number;
7338
+ max_depth?: number;
7339
+ guardrails?: Record<string, never>;
7340
+ /** @enum {string} */
7341
+ delegation_mode?: "caller" | "target" | "both";
7342
+ is_active?: boolean;
7343
+ /** Format: date-time */
7344
+ expires_at?: string | null;
7345
+ };
7346
+ DelegationResponse: {
7347
+ /** Format: uuid */
7348
+ id?: string;
7349
+ /** Format: uuid */
7350
+ org_id?: string;
7351
+ /** Format: uuid */
7352
+ delegator_id?: string;
7353
+ /** Format: uuid */
7354
+ delegate_id?: string;
7355
+ delegator_name?: string;
7356
+ delegate_name?: string;
7357
+ allowed_tools?: string[];
7358
+ blocked_tools?: string[];
7359
+ max_daily_delegations?: number | null;
7360
+ max_depth?: number;
7361
+ guardrails?: Record<string, never>;
7362
+ /** @enum {string} */
7363
+ delegation_mode?: "caller" | "target" | "both";
7364
+ is_active?: boolean;
7365
+ /** Format: uuid */
7366
+ created_by?: string;
7367
+ /** Format: date-time */
7368
+ expires_at?: string | null;
7369
+ /** Format: date-time */
7370
+ created_at?: string;
7371
+ /** Format: date-time */
7372
+ updated_at?: string;
7373
+ /** @description Number of delegations used today (present in effective endpoint). */
7374
+ delegations_today?: number;
7375
+ };
7376
+ DelegationListResponse: {
7377
+ delegations?: components["schemas"]["DelegationResponse"][];
7378
+ };
7235
7379
  SignIntentRequest: {
7236
7380
  /** @enum {string} */
7237
7381
  intent_type: "personal_sign" | "typed_data" | "eip712_digest" | "transaction";
@@ -9283,7 +9427,12 @@ export interface components {
9283
9427
  config: {
9284
9428
  [key: string]: string;
9285
9429
  };
9286
- /** @description Enable slash commands on this channel */
9430
+ /**
9431
+ * @description Enable Hermes-compatible slash commands on this channel. When true,
9432
+ * messages starting with `/` are handled before the LLM. Commands:
9433
+ * /help, /new, /reset, /clear, /model, /mode, /personality, /retry,
9434
+ * /undo, /compress, /summarize, /stop, /status, /skills, /usage, /sethome.
9435
+ */
9287
9436
  slash_commands_enabled?: boolean;
9288
9437
  /** @description Enable voice message transcription */
9289
9438
  voice_transcription_enabled?: boolean;
@@ -9324,7 +9473,11 @@ export interface components {
9324
9473
  config?: {
9325
9474
  [key: string]: unknown;
9326
9475
  } | null;
9327
- /** @description Whether slash commands are enabled for this channel */
9476
+ /**
9477
+ * @description Whether Hermes-compatible slash commands are enabled for this channel.
9478
+ * Commands: /help, /new, /reset, /clear, /model, /mode, /personality, /retry,
9479
+ * /undo, /compress, /summarize, /stop, /status, /skills, /usage, /sethome.
9480
+ */
9328
9481
  slash_commands_enabled?: boolean;
9329
9482
  /** @description Whether voice message transcription is enabled */
9330
9483
  voice_transcription_enabled?: boolean;
@@ -12028,6 +12181,165 @@ export interface operations {
12028
12181
  404: components["responses"]["NotFound"];
12029
12182
  };
12030
12183
  };
12184
+ listDelegations: {
12185
+ parameters: {
12186
+ query?: never;
12187
+ header?: never;
12188
+ path: {
12189
+ agent_id: components["parameters"]["AgentId"];
12190
+ };
12191
+ cookie?: never;
12192
+ };
12193
+ requestBody?: never;
12194
+ responses: {
12195
+ /** @description List of delegations */
12196
+ 200: {
12197
+ headers: {
12198
+ [name: string]: unknown;
12199
+ };
12200
+ content: {
12201
+ "application/json": components["schemas"]["DelegationListResponse"];
12202
+ };
12203
+ };
12204
+ 404: components["responses"]["NotFound"];
12205
+ };
12206
+ };
12207
+ createDelegation: {
12208
+ parameters: {
12209
+ query?: never;
12210
+ header?: never;
12211
+ path: {
12212
+ agent_id: components["parameters"]["AgentId"];
12213
+ };
12214
+ cookie?: never;
12215
+ };
12216
+ requestBody: {
12217
+ content: {
12218
+ "application/json": components["schemas"]["CreateDelegationRequest"];
12219
+ };
12220
+ };
12221
+ responses: {
12222
+ /** @description Delegation created */
12223
+ 201: {
12224
+ headers: {
12225
+ [name: string]: unknown;
12226
+ };
12227
+ content: {
12228
+ "application/json": components["schemas"]["DelegationResponse"];
12229
+ };
12230
+ };
12231
+ 400: components["responses"]["BadRequest"];
12232
+ 403: components["responses"]["Forbidden"];
12233
+ /** @description Delegation already exists for this delegator/delegate pair */
12234
+ 409: {
12235
+ headers: {
12236
+ [name: string]: unknown;
12237
+ };
12238
+ content: {
12239
+ "application/json": components["schemas"]["ProblemDetails"];
12240
+ };
12241
+ };
12242
+ };
12243
+ };
12244
+ getEffectiveDelegations: {
12245
+ parameters: {
12246
+ query?: never;
12247
+ header?: never;
12248
+ path: {
12249
+ agent_id: components["parameters"]["AgentId"];
12250
+ };
12251
+ cookie?: never;
12252
+ };
12253
+ requestBody?: never;
12254
+ responses: {
12255
+ /** @description Effective delegations with usage stats */
12256
+ 200: {
12257
+ headers: {
12258
+ [name: string]: unknown;
12259
+ };
12260
+ content: {
12261
+ "application/json": components["schemas"]["DelegationListResponse"];
12262
+ };
12263
+ };
12264
+ 404: components["responses"]["NotFound"];
12265
+ };
12266
+ };
12267
+ getDelegation: {
12268
+ parameters: {
12269
+ query?: never;
12270
+ header?: never;
12271
+ path: {
12272
+ agent_id: components["parameters"]["AgentId"];
12273
+ delegation_id: string;
12274
+ };
12275
+ cookie?: never;
12276
+ };
12277
+ requestBody?: never;
12278
+ responses: {
12279
+ /** @description Delegation details */
12280
+ 200: {
12281
+ headers: {
12282
+ [name: string]: unknown;
12283
+ };
12284
+ content: {
12285
+ "application/json": components["schemas"]["DelegationResponse"];
12286
+ };
12287
+ };
12288
+ 404: components["responses"]["NotFound"];
12289
+ };
12290
+ };
12291
+ revokeDelegation: {
12292
+ parameters: {
12293
+ query?: never;
12294
+ header?: never;
12295
+ path: {
12296
+ agent_id: components["parameters"]["AgentId"];
12297
+ delegation_id: string;
12298
+ };
12299
+ cookie?: never;
12300
+ };
12301
+ requestBody?: never;
12302
+ responses: {
12303
+ /** @description Delegation revoked */
12304
+ 204: {
12305
+ headers: {
12306
+ [name: string]: unknown;
12307
+ };
12308
+ content?: never;
12309
+ };
12310
+ 404: components["responses"]["NotFound"];
12311
+ };
12312
+ };
12313
+ updateDelegation: {
12314
+ parameters: {
12315
+ query?: never;
12316
+ header?: never;
12317
+ path: {
12318
+ agent_id: components["parameters"]["AgentId"];
12319
+ delegation_id: string;
12320
+ };
12321
+ cookie?: never;
12322
+ };
12323
+ requestBody: {
12324
+ content: {
12325
+ "application/json": components["schemas"]["UpdateDelegationRequest"];
12326
+ };
12327
+ };
12328
+ responses: {
12329
+ /** @description Delegation updated */
12330
+ 200: {
12331
+ headers: {
12332
+ [name: string]: unknown;
12333
+ };
12334
+ content: {
12335
+ "application/json": components["schemas"]["DelegationResponse"];
12336
+ };
12337
+ };
12338
+ 400: components["responses"]["BadRequest"];
12339
+ 403: components["responses"]["Forbidden"];
12340
+ 404: components["responses"]["NotFound"];
12341
+ };
12342
+ };
12031
12343
  signIntent: {
12032
12344
  parameters: {
12033
12345
  query?: never;