@1claw/sdk 0.57.0 → 0.58.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 +17 -0
- package/dist/generated/api-types.d.ts +304 -8
- package/dist/generated/api-types.d.ts.map +1 -1
- package/dist/resources/platform.d.ts +56 -4
- package/dist/resources/platform.d.ts.map +1 -1
- package/dist/resources/platform.js +37 -3
- package/dist/resources/platform.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1000,6 +1000,23 @@ const begin = await client.auth.beginPasskeyTxAssert({ tx_digest: "abc123...", a
|
|
|
1000
1000
|
// ... complete ceremony, then send with X-Passkey-Token header
|
|
1001
1001
|
```
|
|
1002
1002
|
|
|
1003
|
+
## v0.57 — Platform API expansion
|
|
1004
|
+
|
|
1005
|
+
SIWE wallet login, parameterized bootstrap, connection polling, entitlements, and inference budgets:
|
|
1006
|
+
|
|
1007
|
+
```typescript
|
|
1008
|
+
// SIWE challenge + upsert (plt_ auth)
|
|
1009
|
+
const challenge = await client.platform.siweChallenge();
|
|
1010
|
+
// ... sign SIWE message, upsert with subject_token_type urn:1claw:params:oauth:token-type:siwe
|
|
1011
|
+
|
|
1012
|
+
await client.platform.getConnection(connectionId);
|
|
1013
|
+
await client.platform.getConnectionUsage(connectionId);
|
|
1014
|
+
await client.platform.listEntitlements(connectionId);
|
|
1015
|
+
await client.platform.previewTemplate(appId, templateId, { parameters: { agent_name: "demo" } });
|
|
1016
|
+
|
|
1017
|
+
await client.treasuryWallets.getInferenceBudget();
|
|
1018
|
+
```
|
|
1019
|
+
|
|
1003
1020
|
## OpenAPI Types
|
|
1004
1021
|
|
|
1005
1022
|
The SDK's request types are generated from the **OpenAPI 3.1** spec, published as [@1claw/openapi-spec](https://www.npmjs.com/package/@1claw/openapi-spec). Advanced users can access the raw generated types:
|
|
@@ -3897,12 +3897,14 @@ export interface paths {
|
|
|
3897
3897
|
};
|
|
3898
3898
|
requestBody?: never;
|
|
3899
3899
|
responses: {
|
|
3900
|
-
/** @description
|
|
3901
|
-
|
|
3900
|
+
/** @description Soft-deleted; slug released for reuse within the org */
|
|
3901
|
+
200: {
|
|
3902
3902
|
headers: {
|
|
3903
3903
|
[name: string]: unknown;
|
|
3904
3904
|
};
|
|
3905
|
-
content
|
|
3905
|
+
content: {
|
|
3906
|
+
"application/json": components["schemas"]["PlatformAppDeleteResponse"];
|
|
3907
|
+
};
|
|
3906
3908
|
};
|
|
3907
3909
|
/** @description Only human users can delete platform apps */
|
|
3908
3910
|
403: {
|
|
@@ -3944,6 +3946,29 @@ export interface paths {
|
|
|
3944
3946
|
};
|
|
3945
3947
|
trace?: never;
|
|
3946
3948
|
};
|
|
3949
|
+
"/v1/platform/apps/{appId}/transfer-ownership": {
|
|
3950
|
+
parameters: {
|
|
3951
|
+
query?: never;
|
|
3952
|
+
header?: never;
|
|
3953
|
+
path?: never;
|
|
3954
|
+
cookie?: never;
|
|
3955
|
+
};
|
|
3956
|
+
get?: never;
|
|
3957
|
+
put?: never;
|
|
3958
|
+
/**
|
|
3959
|
+
* Transfer platform app to another organization
|
|
3960
|
+
* @description Moves the platform app record to another organization. Requires org
|
|
3961
|
+
* owner/admin in the source org and step-up auth (`X-Auth-Confirm`,
|
|
3962
|
+
* purpose `platform.app.transfer`). End-user connections and provisioned
|
|
3963
|
+
* resources remain in their original organizations.
|
|
3964
|
+
*/
|
|
3965
|
+
post: operations["transferPlatformAppOwnership"];
|
|
3966
|
+
delete?: never;
|
|
3967
|
+
options?: never;
|
|
3968
|
+
head?: never;
|
|
3969
|
+
patch?: never;
|
|
3970
|
+
trace?: never;
|
|
3971
|
+
};
|
|
3947
3972
|
"/v1/platform/apps/{appId}/rotate-key": {
|
|
3948
3973
|
parameters: {
|
|
3949
3974
|
query?: never;
|
|
@@ -5069,7 +5094,8 @@ export interface paths {
|
|
|
5069
5094
|
path?: never;
|
|
5070
5095
|
cookie?: never;
|
|
5071
5096
|
};
|
|
5072
|
-
|
|
5097
|
+
/** Get a spend policy by ID */
|
|
5098
|
+
get: operations["getSpendPolicy"];
|
|
5073
5099
|
put?: never;
|
|
5074
5100
|
post?: never;
|
|
5075
5101
|
/** Delete a spend policy */
|
|
@@ -5086,7 +5112,12 @@ export interface paths {
|
|
|
5086
5112
|
path?: never;
|
|
5087
5113
|
cookie?: never;
|
|
5088
5114
|
};
|
|
5089
|
-
|
|
5115
|
+
/**
|
|
5116
|
+
* Get effective spend policy for a connection
|
|
5117
|
+
* @description Returns the effective spend policy for the connected user, resolving
|
|
5118
|
+
* per-user overrides before app-level defaults. Requires plt_ platform auth.
|
|
5119
|
+
*/
|
|
5120
|
+
get: operations["getConnectionSpendPolicy"];
|
|
5090
5121
|
/**
|
|
5091
5122
|
* Set per-user spend policy override
|
|
5092
5123
|
* @description Override the app-wide spend policy for a specific connected user. This
|
|
@@ -5101,6 +5132,66 @@ export interface paths {
|
|
|
5101
5132
|
patch?: never;
|
|
5102
5133
|
trace?: never;
|
|
5103
5134
|
};
|
|
5135
|
+
"/v1/platform/connections/{connectionId}/approvals": {
|
|
5136
|
+
parameters: {
|
|
5137
|
+
query?: never;
|
|
5138
|
+
header?: never;
|
|
5139
|
+
path?: never;
|
|
5140
|
+
cookie?: never;
|
|
5141
|
+
};
|
|
5142
|
+
/**
|
|
5143
|
+
* List approvals for a platform connection
|
|
5144
|
+
* @description Returns approvals assigned to the connection's user, filtered to agents
|
|
5145
|
+
* provisioned on the connection. Requires plt_ platform auth.
|
|
5146
|
+
*/
|
|
5147
|
+
get: operations["listConnectionApprovals"];
|
|
5148
|
+
put?: never;
|
|
5149
|
+
post?: never;
|
|
5150
|
+
delete?: never;
|
|
5151
|
+
options?: never;
|
|
5152
|
+
head?: never;
|
|
5153
|
+
patch?: never;
|
|
5154
|
+
trace?: never;
|
|
5155
|
+
};
|
|
5156
|
+
"/v1/platform/connections/{connectionId}/approvals/{approvalId}": {
|
|
5157
|
+
parameters: {
|
|
5158
|
+
query?: never;
|
|
5159
|
+
header?: never;
|
|
5160
|
+
path?: never;
|
|
5161
|
+
cookie?: never;
|
|
5162
|
+
};
|
|
5163
|
+
/** Get a connection-scoped approval */
|
|
5164
|
+
get: operations["getConnectionApproval"];
|
|
5165
|
+
put?: never;
|
|
5166
|
+
post?: never;
|
|
5167
|
+
delete?: never;
|
|
5168
|
+
options?: never;
|
|
5169
|
+
head?: never;
|
|
5170
|
+
patch?: never;
|
|
5171
|
+
trace?: never;
|
|
5172
|
+
};
|
|
5173
|
+
"/v1/platform/connections/{connectionId}/pending-approvals": {
|
|
5174
|
+
parameters: {
|
|
5175
|
+
query?: never;
|
|
5176
|
+
header?: never;
|
|
5177
|
+
path?: never;
|
|
5178
|
+
cookie?: never;
|
|
5179
|
+
};
|
|
5180
|
+
/**
|
|
5181
|
+
* List pending consensus approvals for a connection
|
|
5182
|
+
* @description Returns pending approvals for agents provisioned on the connection,
|
|
5183
|
+
* including `action_payload` and `payload_hash` for consensus UX.
|
|
5184
|
+
* Requires plt_ platform auth.
|
|
5185
|
+
*/
|
|
5186
|
+
get: operations["listConnectionPendingApprovals"];
|
|
5187
|
+
put?: never;
|
|
5188
|
+
post?: never;
|
|
5189
|
+
delete?: never;
|
|
5190
|
+
options?: never;
|
|
5191
|
+
head?: never;
|
|
5192
|
+
patch?: never;
|
|
5193
|
+
trace?: never;
|
|
5194
|
+
};
|
|
5104
5195
|
"/v1/approvals": {
|
|
5105
5196
|
parameters: {
|
|
5106
5197
|
query?: never;
|
|
@@ -6263,7 +6354,7 @@ export interface paths {
|
|
|
6263
6354
|
/**
|
|
6264
6355
|
* Chat with a running runtime agent
|
|
6265
6356
|
* @description Human-only. Proxies to the runtime container's OpenAI-compatible
|
|
6266
|
-
* `POST /v1/chat/completions` (hermes / openclaw / openclaude chat bridge).
|
|
6357
|
+
* `POST /v1/chat/completions` (hermes / openclaw / openclaude / opencode chat bridge).
|
|
6267
6358
|
* Starts the runtime if stopped. Streams SSE when `Accept: text/event-stream`
|
|
6268
6359
|
* or `stream: true`. Conversation history is ephemeral (pass `messages`).
|
|
6269
6360
|
* Requires a public URL (shell access, Shroud sidecar, or HTTP hosting).
|
|
@@ -10469,6 +10560,28 @@ export interface components {
|
|
|
10469
10560
|
*/
|
|
10470
10561
|
api_key_expires_at?: string | null;
|
|
10471
10562
|
};
|
|
10563
|
+
PlatformAppDeleteResponse: {
|
|
10564
|
+
deleted: boolean;
|
|
10565
|
+
soft_delete: boolean;
|
|
10566
|
+
slug_released: boolean;
|
|
10567
|
+
former_slug: string;
|
|
10568
|
+
};
|
|
10569
|
+
/** @description Provide `target_org_id` or `target_user_email` (owner/admin in destination org). */
|
|
10570
|
+
TransferPlatformAppOwnershipRequest: {
|
|
10571
|
+
/** Format: uuid */
|
|
10572
|
+
target_org_id?: string;
|
|
10573
|
+
/** Format: email */
|
|
10574
|
+
target_user_email?: string;
|
|
10575
|
+
};
|
|
10576
|
+
TransferPlatformAppOwnershipResponse: {
|
|
10577
|
+
/** Format: uuid */
|
|
10578
|
+
app_id: string;
|
|
10579
|
+
/** Format: uuid */
|
|
10580
|
+
former_org_id: string;
|
|
10581
|
+
/** Format: uuid */
|
|
10582
|
+
new_org_id: string;
|
|
10583
|
+
message: string;
|
|
10584
|
+
};
|
|
10472
10585
|
PlatformAppResponse: {
|
|
10473
10586
|
/** Format: uuid */
|
|
10474
10587
|
id?: string;
|
|
@@ -10863,6 +10976,10 @@ export interface components {
|
|
|
10863
10976
|
/** Format: date-time */
|
|
10864
10977
|
created_at: string;
|
|
10865
10978
|
};
|
|
10979
|
+
ApprovalListResponse: {
|
|
10980
|
+
approvals: components["schemas"]["ApprovalResponse"][];
|
|
10981
|
+
total: number;
|
|
10982
|
+
};
|
|
10866
10983
|
ApprovalStatusResponse: {
|
|
10867
10984
|
/** @enum {string} */
|
|
10868
10985
|
status: "pending" | "approved" | "rejected" | "expired";
|
|
@@ -19201,6 +19318,37 @@ export interface operations {
|
|
|
19201
19318
|
};
|
|
19202
19319
|
};
|
|
19203
19320
|
};
|
|
19321
|
+
transferPlatformAppOwnership: {
|
|
19322
|
+
parameters: {
|
|
19323
|
+
query?: never;
|
|
19324
|
+
header: {
|
|
19325
|
+
"X-Auth-Confirm": string;
|
|
19326
|
+
};
|
|
19327
|
+
path: {
|
|
19328
|
+
appId: string;
|
|
19329
|
+
};
|
|
19330
|
+
cookie?: never;
|
|
19331
|
+
};
|
|
19332
|
+
requestBody: {
|
|
19333
|
+
content: {
|
|
19334
|
+
"application/json": components["schemas"]["TransferPlatformAppOwnershipRequest"];
|
|
19335
|
+
};
|
|
19336
|
+
};
|
|
19337
|
+
responses: {
|
|
19338
|
+
/** @description Ownership transferred */
|
|
19339
|
+
200: {
|
|
19340
|
+
headers: {
|
|
19341
|
+
[name: string]: unknown;
|
|
19342
|
+
};
|
|
19343
|
+
content: {
|
|
19344
|
+
"application/json": components["schemas"]["TransferPlatformAppOwnershipResponse"];
|
|
19345
|
+
};
|
|
19346
|
+
};
|
|
19347
|
+
400: components["responses"]["BadRequest"];
|
|
19348
|
+
403: components["responses"]["Forbidden"];
|
|
19349
|
+
404: components["responses"]["NotFound"];
|
|
19350
|
+
};
|
|
19351
|
+
};
|
|
19204
19352
|
getPlatformAppStats: {
|
|
19205
19353
|
parameters: {
|
|
19206
19354
|
query?: never;
|
|
@@ -19440,6 +19588,30 @@ export interface operations {
|
|
|
19440
19588
|
403: components["responses"]["Forbidden"];
|
|
19441
19589
|
};
|
|
19442
19590
|
};
|
|
19591
|
+
getSpendPolicy: {
|
|
19592
|
+
parameters: {
|
|
19593
|
+
query?: never;
|
|
19594
|
+
header?: never;
|
|
19595
|
+
path: {
|
|
19596
|
+
appId: string;
|
|
19597
|
+
policyId: string;
|
|
19598
|
+
};
|
|
19599
|
+
cookie?: never;
|
|
19600
|
+
};
|
|
19601
|
+
requestBody?: never;
|
|
19602
|
+
responses: {
|
|
19603
|
+
/** @description Spend policy */
|
|
19604
|
+
200: {
|
|
19605
|
+
headers: {
|
|
19606
|
+
[name: string]: unknown;
|
|
19607
|
+
};
|
|
19608
|
+
content: {
|
|
19609
|
+
"application/json": components["schemas"]["SpendPolicyResponse"];
|
|
19610
|
+
};
|
|
19611
|
+
};
|
|
19612
|
+
404: components["responses"]["NotFound"];
|
|
19613
|
+
};
|
|
19614
|
+
};
|
|
19443
19615
|
deleteSpendPolicy: {
|
|
19444
19616
|
parameters: {
|
|
19445
19617
|
query?: never;
|
|
@@ -19462,7 +19634,7 @@ export interface operations {
|
|
|
19462
19634
|
404: components["responses"]["NotFound"];
|
|
19463
19635
|
};
|
|
19464
19636
|
};
|
|
19465
|
-
|
|
19637
|
+
getConnectionSpendPolicy: {
|
|
19466
19638
|
parameters: {
|
|
19467
19639
|
query?: never;
|
|
19468
19640
|
header?: never;
|
|
@@ -19471,13 +19643,41 @@ export interface operations {
|
|
|
19471
19643
|
};
|
|
19472
19644
|
cookie?: never;
|
|
19473
19645
|
};
|
|
19646
|
+
requestBody?: never;
|
|
19647
|
+
responses: {
|
|
19648
|
+
/** @description Effective spend policy (or null) */
|
|
19649
|
+
200: {
|
|
19650
|
+
headers: {
|
|
19651
|
+
[name: string]: unknown;
|
|
19652
|
+
};
|
|
19653
|
+
content: {
|
|
19654
|
+
"application/json": {
|
|
19655
|
+
policy?: components["schemas"]["SpendPolicyResponse"] | null;
|
|
19656
|
+
};
|
|
19657
|
+
};
|
|
19658
|
+
};
|
|
19659
|
+
404: components["responses"]["NotFound"];
|
|
19660
|
+
};
|
|
19661
|
+
};
|
|
19662
|
+
setUserSpendPolicy: {
|
|
19663
|
+
parameters: {
|
|
19664
|
+
query?: never;
|
|
19665
|
+
header?: {
|
|
19666
|
+
/** @description Optional replay protection; same key + body returns cached response (409 on body mismatch). */
|
|
19667
|
+
"Idempotency-Key"?: string;
|
|
19668
|
+
};
|
|
19669
|
+
path: {
|
|
19670
|
+
connectionId: string;
|
|
19671
|
+
};
|
|
19672
|
+
cookie?: never;
|
|
19673
|
+
};
|
|
19474
19674
|
requestBody: {
|
|
19475
19675
|
content: {
|
|
19476
19676
|
"application/json": components["schemas"]["CreateSpendPolicyRequest"];
|
|
19477
19677
|
};
|
|
19478
19678
|
};
|
|
19479
19679
|
responses: {
|
|
19480
|
-
/** @description Spend policy set */
|
|
19680
|
+
/** @description Spend policy set (or idempotent replay) */
|
|
19481
19681
|
200: {
|
|
19482
19682
|
headers: {
|
|
19483
19683
|
[name: string]: unknown;
|
|
@@ -19486,8 +19686,104 @@ export interface operations {
|
|
|
19486
19686
|
"application/json": components["schemas"]["SpendPolicyResponse"];
|
|
19487
19687
|
};
|
|
19488
19688
|
};
|
|
19689
|
+
/** @description Spend policy created */
|
|
19690
|
+
201: {
|
|
19691
|
+
headers: {
|
|
19692
|
+
[name: string]: unknown;
|
|
19693
|
+
};
|
|
19694
|
+
content: {
|
|
19695
|
+
"application/json": components["schemas"]["SpendPolicyResponse"];
|
|
19696
|
+
};
|
|
19697
|
+
};
|
|
19489
19698
|
400: components["responses"]["BadRequest"];
|
|
19490
19699
|
403: components["responses"]["Forbidden"];
|
|
19700
|
+
404: components["responses"]["NotFound"];
|
|
19701
|
+
/** @description Idempotency-Key reused with different body */
|
|
19702
|
+
409: {
|
|
19703
|
+
headers: {
|
|
19704
|
+
[name: string]: unknown;
|
|
19705
|
+
};
|
|
19706
|
+
content?: never;
|
|
19707
|
+
};
|
|
19708
|
+
};
|
|
19709
|
+
};
|
|
19710
|
+
listConnectionApprovals: {
|
|
19711
|
+
parameters: {
|
|
19712
|
+
query?: {
|
|
19713
|
+
status?: string;
|
|
19714
|
+
risk_tier?: number;
|
|
19715
|
+
limit?: number;
|
|
19716
|
+
offset?: number;
|
|
19717
|
+
};
|
|
19718
|
+
header?: never;
|
|
19719
|
+
path: {
|
|
19720
|
+
connectionId: string;
|
|
19721
|
+
};
|
|
19722
|
+
cookie?: never;
|
|
19723
|
+
};
|
|
19724
|
+
requestBody?: never;
|
|
19725
|
+
responses: {
|
|
19726
|
+
/** @description Connection-scoped approvals */
|
|
19727
|
+
200: {
|
|
19728
|
+
headers: {
|
|
19729
|
+
[name: string]: unknown;
|
|
19730
|
+
};
|
|
19731
|
+
content: {
|
|
19732
|
+
"application/json": components["schemas"]["ApprovalListResponse"];
|
|
19733
|
+
};
|
|
19734
|
+
};
|
|
19735
|
+
404: components["responses"]["NotFound"];
|
|
19736
|
+
};
|
|
19737
|
+
};
|
|
19738
|
+
getConnectionApproval: {
|
|
19739
|
+
parameters: {
|
|
19740
|
+
query?: never;
|
|
19741
|
+
header?: never;
|
|
19742
|
+
path: {
|
|
19743
|
+
connectionId: string;
|
|
19744
|
+
approvalId: string;
|
|
19745
|
+
};
|
|
19746
|
+
cookie?: never;
|
|
19747
|
+
};
|
|
19748
|
+
requestBody?: never;
|
|
19749
|
+
responses: {
|
|
19750
|
+
/** @description Approval detail */
|
|
19751
|
+
200: {
|
|
19752
|
+
headers: {
|
|
19753
|
+
[name: string]: unknown;
|
|
19754
|
+
};
|
|
19755
|
+
content: {
|
|
19756
|
+
"application/json": components["schemas"]["ApprovalResponse"];
|
|
19757
|
+
};
|
|
19758
|
+
};
|
|
19759
|
+
404: components["responses"]["NotFound"];
|
|
19760
|
+
};
|
|
19761
|
+
};
|
|
19762
|
+
listConnectionPendingApprovals: {
|
|
19763
|
+
parameters: {
|
|
19764
|
+
query?: {
|
|
19765
|
+
status?: string;
|
|
19766
|
+
limit?: number;
|
|
19767
|
+
offset?: number;
|
|
19768
|
+
};
|
|
19769
|
+
header?: never;
|
|
19770
|
+
path: {
|
|
19771
|
+
connectionId: string;
|
|
19772
|
+
};
|
|
19773
|
+
cookie?: never;
|
|
19774
|
+
};
|
|
19775
|
+
requestBody?: never;
|
|
19776
|
+
responses: {
|
|
19777
|
+
/** @description Pending approvals list */
|
|
19778
|
+
200: {
|
|
19779
|
+
headers: {
|
|
19780
|
+
[name: string]: unknown;
|
|
19781
|
+
};
|
|
19782
|
+
content: {
|
|
19783
|
+
"application/json": components["schemas"]["PendingApprovalListResponse"];
|
|
19784
|
+
};
|
|
19785
|
+
};
|
|
19786
|
+
404: components["responses"]["NotFound"];
|
|
19491
19787
|
};
|
|
19492
19788
|
};
|
|
19493
19789
|
listApprovals: {
|