@omnixhq/ucp-client 2.3.0 → 2.4.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
@@ -16,10 +16,26 @@ Every AI agent that wants to buy something from a UCP store needs to discover ca
16
16
 
17
17
  ## Install
18
18
 
19
+ Two release channels track the two UCP spec tracks:
20
+
21
+ ### Stable (recommended)
22
+
23
+ Based on the stable UCP spec (`@omnixhq/ucp-js-sdk@latest`). Supports checkout, fulfillment, discount, order, and identity linking.
24
+
19
25
  ```bash
20
26
  npm install @omnixhq/ucp-client
21
27
  ```
22
28
 
29
+ ### Draft
30
+
31
+ Based on the draft UCP spec (`@omnixhq/ucp-js-sdk@next`). Includes everything in stable plus capabilities still being finalized in the spec (catalog, cart, and others as they land).
32
+
33
+ ```bash
34
+ npm install @omnixhq/ucp-client@next
35
+ ```
36
+
37
+ > **Note:** Draft builds track the spec draft and may have breaking changes between releases. Use stable in production.
38
+
23
39
  ## Quick Start
24
40
 
25
41
  ```typescript
@@ -137,13 +153,13 @@ All five adapters (`openai`, `anthropic`, `mcp`, `vercel-ai`, `langchain`) suppo
137
153
 
138
154
  The tools you get depend on what the server declares:
139
155
 
140
- | Server declares | Tools you get |
141
- | --------------------------------- | -------------------------------------------------------------------------------------------- |
142
- | `dev.ucp.shopping.checkout` | `create_checkout`, `get_checkout`, `update_checkout`, `complete_checkout`, `cancel_checkout` |
143
- | `dev.ucp.shopping.fulfillment` | + `set_fulfillment`, `select_destination`, `select_fulfillment_option` |
144
- | `dev.ucp.shopping.discount` | + `apply_discount_codes` |
145
- | `dev.ucp.shopping.order` | + `get_order`, `update_order` |
146
- | `dev.ucp.common.identity_linking` | + `get_authorization_url`, `exchange_auth_code`, `refresh_access_token`, `revoke_token` |
156
+ | Server declares | Tools you get |
157
+ | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
158
+ | `dev.ucp.shopping.checkout` | `create_checkout`, `get_checkout`, `update_checkout`, `complete_checkout`, `cancel_checkout` |
159
+ | `dev.ucp.shopping.fulfillment` | + `set_fulfillment`, `select_destination`, `select_fulfillment_option`, `create_fulfillment_method`, `update_fulfillment_method`, `update_fulfillment_group` |
160
+ | `dev.ucp.shopping.discount` | + `apply_discount_codes` |
161
+ | `dev.ucp.shopping.order` | + `get_order`, `update_order`, `update_order_line_item` |
162
+ | `dev.ucp.common.identity_linking` | + `get_authorization_url`, `exchange_auth_code`, `refresh_access_token`, `revoke_token` |
147
163
 
148
164
  Connect to a different server → get different tools. Your agent code stays the same.
149
165
 
@@ -200,7 +216,23 @@ const client = await UCPClient.connect(config);
200
216
  const valid = await verifyRequestSignature(rawBody, signature, client.signingKeys);
201
217
  ```
202
218
 
203
- See [examples/webhook-verification.ts](./examples/webhook-verification.ts) for a complete HTTP server example.
219
+ ### Parsing webhook payloads
220
+
221
+ After verifying the signature, parse the raw body into a typed `WebhookEvent` with `parseWebhookEvent`. Throws `UCPError` with code `INVALID_WEBHOOK_PAYLOAD` if the body is not valid JSON or doesn't match the UCP order event schema.
222
+
223
+ ```typescript
224
+ import { createWebhookVerifier, parseWebhookEvent } from '@omnixhq/ucp-client';
225
+
226
+ const verifier = createWebhookVerifier('https://store.example.com');
227
+
228
+ // In your webhook handler:
229
+ const valid = await verifier.verify(rawBody, req.headers['request-signature']);
230
+ if (!valid) return res.status(401).send('Invalid signature');
231
+
232
+ const event = parseWebhookEvent(rawBody);
233
+ // event.event_id, event.created_time, event.order
234
+ console.log(event.order.id);
235
+ ```
204
236
 
205
237
  ## Framework adapters
206
238
 
@@ -1,4 +1,4 @@
1
- import { AdapterOptions, AgentTool, JsonSchema } from "../catch-errors-B2FSGjMS.cjs";
1
+ import { AdapterOptions, AgentTool, JsonSchema } from "../catch-errors-CO8dAo6Q.cjs";
2
2
 
3
3
  //#region src/adapters/anthropic.d.ts
4
4
  interface AnthropicInputSchema {
@@ -1,4 +1,4 @@
1
- import { AdapterOptions, AgentTool, JsonSchema } from "../catch-errors-dZ2dwGey.js";
1
+ import { AdapterOptions, AgentTool, JsonSchema } from "../catch-errors-C8MBfxB5.js";
2
2
 
3
3
  //#region src/adapters/anthropic.d.ts
4
4
  interface AnthropicInputSchema {
@@ -1,4 +1,4 @@
1
- import { AdapterOptions, AgentTool, JsonSchema } from "../catch-errors-B2FSGjMS.cjs";
1
+ import { AdapterOptions, AgentTool, JsonSchema } from "../catch-errors-CO8dAo6Q.cjs";
2
2
 
3
3
  //#region src/adapters/langchain.d.ts
4
4
  interface LangChainTool {
@@ -1,4 +1,4 @@
1
- import { AdapterOptions, AgentTool, JsonSchema } from "../catch-errors-dZ2dwGey.js";
1
+ import { AdapterOptions, AgentTool, JsonSchema } from "../catch-errors-C8MBfxB5.js";
2
2
 
3
3
  //#region src/adapters/langchain.d.ts
4
4
  interface LangChainTool {
@@ -1,4 +1,4 @@
1
- import { AdapterOptions, AgentTool, JsonSchema } from "../catch-errors-B2FSGjMS.cjs";
1
+ import { AdapterOptions, AgentTool, JsonSchema } from "../catch-errors-CO8dAo6Q.cjs";
2
2
 
3
3
  //#region src/adapters/mcp.d.ts
4
4
  interface MCPInputSchema {
@@ -1,4 +1,4 @@
1
- import { AdapterOptions, AgentTool, JsonSchema } from "../catch-errors-dZ2dwGey.js";
1
+ import { AdapterOptions, AgentTool, JsonSchema } from "../catch-errors-C8MBfxB5.js";
2
2
 
3
3
  //#region src/adapters/mcp.d.ts
4
4
  interface MCPInputSchema {
@@ -1,4 +1,4 @@
1
- import { AdapterOptions, AgentTool, JsonSchema } from "../catch-errors-B2FSGjMS.cjs";
1
+ import { AdapterOptions, AgentTool, JsonSchema } from "../catch-errors-CO8dAo6Q.cjs";
2
2
 
3
3
  //#region src/adapters/openai.d.ts
4
4
  interface OpenAIFunction {
@@ -1,4 +1,4 @@
1
- import { AdapterOptions, AgentTool, JsonSchema } from "../catch-errors-dZ2dwGey.js";
1
+ import { AdapterOptions, AgentTool, JsonSchema } from "../catch-errors-C8MBfxB5.js";
2
2
 
3
3
  //#region src/adapters/openai.d.ts
4
4
  interface OpenAIFunction {
@@ -1,4 +1,4 @@
1
- import { AdapterOptions, AgentTool, JsonSchema } from "../catch-errors-B2FSGjMS.cjs";
1
+ import { AdapterOptions, AgentTool, JsonSchema } from "../catch-errors-CO8dAo6Q.cjs";
2
2
 
3
3
  //#region src/adapters/vercel-ai.d.ts
4
4
  interface VercelAISchema {
@@ -1,4 +1,4 @@
1
- import { AdapterOptions, AgentTool, JsonSchema } from "../catch-errors-dZ2dwGey.js";
1
+ import { AdapterOptions, AgentTool, JsonSchema } from "../catch-errors-C8MBfxB5.js";
2
2
 
3
3
  //#region src/adapters/vercel-ai.d.ts
4
4
  interface VercelAISchema {