@1claw/sdk 0.61.17 → 0.61.19
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 +28 -0
- package/dist/generated/api-types.d.ts +82 -6
- package/dist/generated/api-types.d.ts.map +1 -1
- package/dist/resources/approvals.d.ts +6 -0
- package/dist/resources/approvals.d.ts.map +1 -1
- package/dist/resources/approvals.js +8 -0
- package/dist/resources/approvals.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -438,6 +438,34 @@ When `execution_require_tee` is true:
|
|
|
438
438
|
|
|
439
439
|
Both require `intents_api_enabled` / `execution_intents_enabled` to be on first.
|
|
440
440
|
|
|
441
|
+
### Agent pairing with a fingerprint
|
|
442
|
+
|
|
443
|
+
An agent can enrol itself with its own Ed25519 public key. The vault returns an SSH-style `SHA256:` fingerprint the human compares on the approval page, and the agent collects its API key itself once approved — nothing travels by email.
|
|
444
|
+
|
|
445
|
+
```typescript
|
|
446
|
+
import { AgentsResource } from "@1claw/sdk";
|
|
447
|
+
|
|
448
|
+
const result = await AgentsResource.pair(
|
|
449
|
+
"https://api.1claw.co",
|
|
450
|
+
{ name: "my-agent", public_key: "ssh-ed25519 AAAA…" },
|
|
451
|
+
(fingerprint, approvalUrl) => console.log(`Show the human: ${fingerprint}\n${approvalUrl}`),
|
|
452
|
+
);
|
|
453
|
+
// result.status === "approved" → result.api_key (shown once)
|
|
454
|
+
```
|
|
455
|
+
|
|
456
|
+
### Passkey-owned Safes: spend under a grant
|
|
457
|
+
|
|
458
|
+
When a human owns an EVM Safe with a passkey (`custody: passkey_owner`) and has granted this agent an on-chain allowance (Safe Allowance Module), the agent spends within it without a touch; the module enforces the cap.
|
|
459
|
+
|
|
460
|
+
```typescript
|
|
461
|
+
const spend = await client.agents.spendFromPasskeySafe(agentId, safeId, {
|
|
462
|
+
to: "0xRecipient…",
|
|
463
|
+
amount: "10000000000000000", // base units (0.01 ETH)
|
|
464
|
+
// token: "0xUSDC…" // omit for the native token
|
|
465
|
+
});
|
|
466
|
+
console.log(spend.data.tx_hash, spend.data.remaining_after);
|
|
467
|
+
```
|
|
468
|
+
|
|
441
469
|
### Agent-to-Agent Delegation
|
|
442
470
|
|
|
443
471
|
Human-controlled authorization for inter-agent task delegation. Agents cannot delegate to other agents without an explicit delegation record created by a human.
|
|
@@ -6542,9 +6542,11 @@ export interface paths {
|
|
|
6542
6542
|
cookie?: never;
|
|
6543
6543
|
};
|
|
6544
6544
|
/**
|
|
6545
|
-
* List
|
|
6546
|
-
* @description
|
|
6547
|
-
*
|
|
6545
|
+
* List approvals
|
|
6546
|
+
* @description Humans get their own approval queue. An agent caller gets only the
|
|
6547
|
+
* approvals it created (`agent_id` = caller) — enough to recover one whose
|
|
6548
|
+
* id was lost across a restart, never the organization's queue. Supports
|
|
6549
|
+
* filtering by status and pagination.
|
|
6548
6550
|
*/
|
|
6549
6551
|
get: operations["listApprovals"];
|
|
6550
6552
|
put?: never;
|
|
@@ -6575,6 +6577,32 @@ export interface paths {
|
|
|
6575
6577
|
patch?: never;
|
|
6576
6578
|
trace?: never;
|
|
6577
6579
|
};
|
|
6580
|
+
"/v1/approvals/{approval_id}/cancel": {
|
|
6581
|
+
parameters: {
|
|
6582
|
+
query?: never;
|
|
6583
|
+
header?: never;
|
|
6584
|
+
path?: never;
|
|
6585
|
+
cookie?: never;
|
|
6586
|
+
};
|
|
6587
|
+
get?: never;
|
|
6588
|
+
put?: never;
|
|
6589
|
+
/**
|
|
6590
|
+
* Cancel a pending approval (requester)
|
|
6591
|
+
* @description Withdraws a pending approval. Callable by the agent that requested it or
|
|
6592
|
+
* the human it was addressed to. First answer wins: if the approval was
|
|
6593
|
+
* already decided or expired, the existing record is returned unchanged
|
|
6594
|
+
* (200) rather than an error — the caller's next question is what the
|
|
6595
|
+
* answer was. A cancellation is delivered to webhook subscribers as
|
|
6596
|
+
* `approval.decided` with `decision: "cancelled"`, and audited as
|
|
6597
|
+
* `approval.cancelled`.
|
|
6598
|
+
*/
|
|
6599
|
+
post: operations["cancelApproval"];
|
|
6600
|
+
delete?: never;
|
|
6601
|
+
options?: never;
|
|
6602
|
+
head?: never;
|
|
6603
|
+
patch?: never;
|
|
6604
|
+
trace?: never;
|
|
6605
|
+
};
|
|
6578
6606
|
"/v1/approvals/{approval_id}/status": {
|
|
6579
6607
|
parameters: {
|
|
6580
6608
|
query?: never;
|
|
@@ -15702,7 +15730,7 @@ export interface components {
|
|
|
15702
15730
|
/** @description What the action will do, as submitted. */
|
|
15703
15731
|
payload?: Record<string, never>;
|
|
15704
15732
|
/** @enum {string} */
|
|
15705
|
-
status: "pending" | "approved" | "rejected" | "expired";
|
|
15733
|
+
status: "pending" | "approved" | "rejected" | "expired" | "cancelled";
|
|
15706
15734
|
/** @description Structured summary of the action requiring approval */
|
|
15707
15735
|
summary: Record<string, never>;
|
|
15708
15736
|
reason?: string | null;
|
|
@@ -15722,7 +15750,7 @@ export interface components {
|
|
|
15722
15750
|
};
|
|
15723
15751
|
ApprovalStatusResponse: {
|
|
15724
15752
|
/** @enum {string} */
|
|
15725
|
-
status: "pending" | "approved" | "rejected" | "expired";
|
|
15753
|
+
status: "pending" | "approved" | "rejected" | "expired" | "cancelled";
|
|
15726
15754
|
/** Format: date-time */
|
|
15727
15755
|
expires_at?: string | null;
|
|
15728
15756
|
};
|
|
@@ -16785,6 +16813,15 @@ export interface components {
|
|
|
16785
16813
|
shell_auth_policy?: string;
|
|
16786
16814
|
shell_max_session_minutes?: number;
|
|
16787
16815
|
monthly_hours_used?: number | null;
|
|
16816
|
+
/** @description Whether this runtime has a paid Stripe add-on (unlimited hours). */
|
|
16817
|
+
has_paid_addon?: boolean;
|
|
16818
|
+
/**
|
|
16819
|
+
* @description `pool` — counts against the plan's monthly runtime hours. `included` — the plan's
|
|
16820
|
+
* free runtime (every plan from Pro up includes one small or medium runtime, no hour
|
|
16821
|
+
* cap, no charge). `addon` — paid Stripe subscription item (no hour cap).
|
|
16822
|
+
* @enum {string}
|
|
16823
|
+
*/
|
|
16824
|
+
billing_kind?: "pool" | "included" | "addon";
|
|
16788
16825
|
/** Format: date-time */
|
|
16789
16826
|
created_at: string;
|
|
16790
16827
|
/** Format: date-time */
|
|
@@ -16792,6 +16829,15 @@ export interface components {
|
|
|
16792
16829
|
};
|
|
16793
16830
|
RuntimeListResponse: {
|
|
16794
16831
|
runtimes: components["schemas"]["RuntimeResponse"][];
|
|
16832
|
+
/** @description The plan's included-runtime allowance (human callers only). */
|
|
16833
|
+
included_runtime?: {
|
|
16834
|
+
/** @description Runtimes the plan includes at no charge. */
|
|
16835
|
+
allowance?: number;
|
|
16836
|
+
/** @description Included slots currently in use. */
|
|
16837
|
+
used?: number;
|
|
16838
|
+
/** @description Presets an included runtime may use (up to 1 vCPU / 2 GB). */
|
|
16839
|
+
presets?: string[];
|
|
16840
|
+
};
|
|
16795
16841
|
};
|
|
16796
16842
|
SlugCheckResponse: {
|
|
16797
16843
|
available: boolean;
|
|
@@ -27142,7 +27188,7 @@ export interface operations {
|
|
|
27142
27188
|
parameters: {
|
|
27143
27189
|
query?: {
|
|
27144
27190
|
/** @description Filter by approval status */
|
|
27145
|
-
status?: "pending" | "approved" | "rejected" | "expired";
|
|
27191
|
+
status?: "pending" | "approved" | "rejected" | "expired" | "cancelled";
|
|
27146
27192
|
limit?: number;
|
|
27147
27193
|
offset?: number;
|
|
27148
27194
|
};
|
|
@@ -27188,6 +27234,36 @@ export interface operations {
|
|
|
27188
27234
|
404: components["responses"]["NotFound"];
|
|
27189
27235
|
};
|
|
27190
27236
|
};
|
|
27237
|
+
cancelApproval: {
|
|
27238
|
+
parameters: {
|
|
27239
|
+
query?: never;
|
|
27240
|
+
header?: never;
|
|
27241
|
+
path: {
|
|
27242
|
+
approval_id: string;
|
|
27243
|
+
};
|
|
27244
|
+
cookie?: never;
|
|
27245
|
+
};
|
|
27246
|
+
requestBody?: {
|
|
27247
|
+
content: {
|
|
27248
|
+
"application/json": {
|
|
27249
|
+
reason?: string;
|
|
27250
|
+
};
|
|
27251
|
+
};
|
|
27252
|
+
};
|
|
27253
|
+
responses: {
|
|
27254
|
+
/** @description The approval — `cancelled`, or the decision that landed first */
|
|
27255
|
+
200: {
|
|
27256
|
+
headers: {
|
|
27257
|
+
[name: string]: unknown;
|
|
27258
|
+
};
|
|
27259
|
+
content: {
|
|
27260
|
+
"application/json": components["schemas"]["ApprovalResponse"];
|
|
27261
|
+
};
|
|
27262
|
+
};
|
|
27263
|
+
403: components["responses"]["Forbidden"];
|
|
27264
|
+
404: components["responses"]["NotFound"];
|
|
27265
|
+
};
|
|
27266
|
+
};
|
|
27191
27267
|
getApprovalStatus: {
|
|
27192
27268
|
parameters: {
|
|
27193
27269
|
query?: never;
|