@1claw/sdk 0.20.2 → 0.21.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 +26 -2
- package/dist/core/client.d.ts +3 -0
- package/dist/core/client.d.ts.map +1 -1
- package/dist/core/client.js +2 -0
- package/dist/core/client.js.map +1 -1
- package/dist/generated/api-types.d.ts +519 -0
- package/dist/generated/api-types.d.ts.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/resources/agents.d.ts +7 -1
- package/dist/resources/agents.d.ts.map +1 -1
- package/dist/resources/agents.js +9 -0
- package/dist/resources/agents.js.map +1 -1
- package/dist/resources/auth.d.ts +12 -1
- package/dist/resources/auth.d.ts.map +1 -1
- package/dist/resources/auth.js +36 -0
- package/dist/resources/auth.js.map +1 -1
- package/dist/resources/signing-keys.d.ts +26 -0
- package/dist/resources/signing-keys.d.ts.map +1 -0
- package/dist/resources/signing-keys.js +33 -0
- package/dist/resources/signing-keys.js.map +1 -0
- package/dist/types.d.ts +101 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -79,16 +79,17 @@ await client.auth.resetPassword({ token: "...", new_password: "..." });
|
|
|
79
79
|
| `client.vault` | `create`, `get`, `list`, `delete`, `enableMpc`, `disableMpc` |
|
|
80
80
|
| `client.secrets` | `set`, `get`, `delete`, `list`, `rotate` |
|
|
81
81
|
| `client.access` | `grantHuman`, `grantAgent`, `update`, `revoke`, `listGrants` |
|
|
82
|
-
| `client.agents` | `create`, `getSelf`, `get`, `list`, `update`, `delete`, `rotateKey`, `submitTransaction`, `signTransaction`, `getTransaction`, `listTransactions`, `simulateTransaction`, `simulateBundle` |
|
|
82
|
+
| `client.agents` | `enroll` (also `AgentsResource.enroll(baseUrl, …)` static), `create`, `getSelf`, `get`, `list`, `update`, `delete`, `rotateKey`, `rotateIdentityKeys`, `submitTransaction`, `signTransaction`, `getTransaction`, `listTransactions`, `simulateTransaction`, `simulateBundle`, `sign` |
|
|
83
83
|
| `client.chains` | `list`, `get`, `adminList`, `create`, `update`, `delete` |
|
|
84
84
|
| `client.sharing` | `create`, `access`, `listOutbound`, `listInbound`, `accept`, `decline`, `revoke` |
|
|
85
85
|
| `client.approvals` | `request`, `list`, `approve`, `deny`, `check`, `subscribe` |
|
|
86
86
|
| `client.billing` | `usage`, `history`, `llmTokenBilling`, `subscribeLlmTokenBilling`, `disableLlmTokenBilling` (LLM token billing / Stripe AI Gateway) |
|
|
87
87
|
| `client.audit` | `query` |
|
|
88
88
|
| `client.org` | `listMembers`, `getAgentKeysVault`, `updateMemberRole`, `removeMember` |
|
|
89
|
-
| `client.auth` | `login`, `signup`, `agentToken`, `apiKeyToken`, `google`, `changePassword`, `logout`, `getMe`, `updateMe`, `deleteMe` |
|
|
89
|
+
| `client.auth` | `login`, `signup`, `agentToken`, `apiKeyToken`, `google`, `changePassword`, `forgotPassword`, `resetPassword`, `exportData`, `exchangeFederatedToken`, `logout`, `getMe`, `updateMe`, `deleteMe` |
|
|
90
90
|
| `client.apiKeys` | `create`, `list`, `revoke` |
|
|
91
91
|
| `client.treasury` | `create`, `list`, `get`, `update`, `delete`, `addSigner`, `removeSigner`, `requestAccess`, `listAccessRequests`, `approveAccess`, `denyAccess` |
|
|
92
|
+
| `client.signingKeys` | `create`, `list`, `rotate`, `deactivate` |
|
|
92
93
|
| `client.x402` | `getPaymentRequirement`, `pay`, `verifyReceipt`, `withPayment` |
|
|
93
94
|
|
|
94
95
|
**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.
|
|
@@ -225,6 +226,29 @@ Key properties:
|
|
|
225
226
|
- **Every transaction is audit-logged** with full calldata
|
|
226
227
|
- **Revocable instantly** — set `intents_api_enabled: false` to cut off access
|
|
227
228
|
|
|
229
|
+
## OIDC Federation (Anthropic WIF, GCP STS, AWS STS)
|
|
230
|
+
|
|
231
|
+
`https://api.1claw.xyz` is a fully OpenID Connect–compliant issuer. External relying parties — Anthropic Workload Identity Federation, GCP STS, AWS STS, Stytch, etc. — can validate 1claw-issued JWTs by fetching:
|
|
232
|
+
|
|
233
|
+
- `GET https://api.1claw.xyz/.well-known/openid-configuration`
|
|
234
|
+
- `GET https://api.1claw.xyz/.well-known/jwks.json`
|
|
235
|
+
|
|
236
|
+
The SDK exposes one method to mint a federation token:
|
|
237
|
+
|
|
238
|
+
```typescript
|
|
239
|
+
const tokenRes = await client.auth.exchangeFederatedToken({
|
|
240
|
+
audience: "https://api.anthropic.com",
|
|
241
|
+
// subjectToken? — defaults to the client's current login or apiKey
|
|
242
|
+
// scope? — optional space-separated subset of agent's scopes
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
const oidcJwt = tokenRes.data?.access_token; // RS256-signed; ~15 min default TTL, hard cap 1h
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
The acting agent must have `federation_enabled: true` and the `audience` must be on its `federation_audiences` allowlist (set via dashboard or `client.agents.update`). Every active KMS key version is published in JWKS, so verifiers reject unknown `kid`s automatically when 1claw rotates keys.
|
|
249
|
+
|
|
250
|
+
End-to-end Anthropic WIF demo: [`examples/anthropic-wif`](https://github.com/1clawAI/1claw-examples/tree/main/anthropic-wif).
|
|
251
|
+
|
|
228
252
|
## Customer-Managed Encryption Keys (CMEK)
|
|
229
253
|
|
|
230
254
|
For enterprises that require cryptographic proof that 1claw cannot access their secrets unilaterally, the SDK provides client-side CMEK utilities. Keys are generated and managed entirely on your side — only the SHA-256 fingerprint is stored on the server.
|
package/dist/core/client.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ import { ApiKeysResource } from "../resources/api-keys";
|
|
|
13
13
|
import { ChainsResource } from "../resources/chains";
|
|
14
14
|
import { X402Resource } from "../resources/x402";
|
|
15
15
|
import { TreasuryResource } from "../resources/treasury";
|
|
16
|
+
import { SigningKeysResource } from "../resources/signing-keys";
|
|
16
17
|
/**
|
|
17
18
|
* The main 1Claw SDK client. All API resources are exposed as
|
|
18
19
|
* namespaced properties for discoverability and tree-shaking.
|
|
@@ -64,6 +65,8 @@ export declare class OneclawClient {
|
|
|
64
65
|
readonly x402: X402Resource;
|
|
65
66
|
/** Safe multisig treasuries — CRUD, signers, agent access requests. */
|
|
66
67
|
readonly treasury: TreasuryResource;
|
|
68
|
+
/** Multi-chain signing keys — create, list, rotate, deactivate per-agent keys. */
|
|
69
|
+
readonly signingKeys: SigningKeysResource;
|
|
67
70
|
constructor(config: OneclawClientConfig);
|
|
68
71
|
private autoAuthenticateUserKey;
|
|
69
72
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/core/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAEpD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,Y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AAC,MAAM,EAAE,cAAc,CAAC;IAChC,0EAA0E;IAC1E,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC;IAChC,mEAAmE;IACnE,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAC;IAClC,mEAAmE;IACnE,QAAQ,CAAC,SAAS,EAAE,iBAAiB,CAAC;IACtC,wEAAwE;IACxE,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAC;IAClC,mDAAmD;IACnD,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC;IAC9B,+CAA+C;IAC/C,QAAQ,CAAC,GAAG,EAAE,WAAW,CAAC;IAC1B,sEAAsE;IACtE,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAC5B,6DAA6D;IAC7D,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAC;IAClC,wEAAwE;IACxE,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC;IAChC,sEAAsE;IACtE,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAC5B,uEAAuE;IACvE,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,CAAC;IACpC,kFAAkF;IAClF,QAAQ,CAAC,WAAW,EAAE,mBAAmB,CAAC;gBAE9B,MAAM,EAAE,mBAAmB;IA4BvC,OAAO,CAAC,uBAAuB;CAclC;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,mBAAmB,GAAG,aAAa,CAEvE"}
|
package/dist/core/client.js
CHANGED
|
@@ -13,6 +13,7 @@ import { ApiKeysResource } from "../resources/api-keys";
|
|
|
13
13
|
import { ChainsResource } from "../resources/chains";
|
|
14
14
|
import { X402Resource } from "../resources/x402";
|
|
15
15
|
import { TreasuryResource } from "../resources/treasury";
|
|
16
|
+
import { SigningKeysResource } from "../resources/signing-keys";
|
|
16
17
|
/**
|
|
17
18
|
* The main 1Claw SDK client. All API resources are exposed as
|
|
18
19
|
* namespaced properties for discoverability and tree-shaking.
|
|
@@ -58,6 +59,7 @@ export class OneclawClient {
|
|
|
58
59
|
this.chains = new ChainsResource(this.http);
|
|
59
60
|
this.x402 = new X402Resource(this.http, config.x402Signer);
|
|
60
61
|
this.treasury = new TreasuryResource(this.http);
|
|
62
|
+
this.signingKeys = new SigningKeysResource(this.http);
|
|
61
63
|
}
|
|
62
64
|
autoAuthenticateUserKey(config) {
|
|
63
65
|
const authPromise = this.http
|
package/dist/core/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/core/client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/core/client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EA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