@zuora/agent-toolkit 0.1.0-alpha.1 → 0.1.0-beta.1
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 +47 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,10 +1,21 @@
|
|
|
1
1
|
# @zuora/agent-toolkit
|
|
2
2
|
|
|
3
|
-
> **
|
|
3
|
+
> **Beta release — not intended for production use yet.** Customers are welcome to try the kit in sandbox or other non-production environments for evaluation and feedback. APIs may change before the 1.0 stable release.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Introduction
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Zuora Agent Kit is an SDK that turns Zuora billing operations into tools an AI agent can call. This package, `@zuora/agent-toolkit`, provides the TypeScript SDK; the Python package, `zuora-agent-toolkit`, is planned.
|
|
8
|
+
|
|
9
|
+
Instead of wiring each Zuora REST API by hand for an LLM, the kit:
|
|
10
|
+
|
|
11
|
+
1. Connects to your tenant's [Zuora MCP server](https://developer.zuora.com) using OAuth.
|
|
12
|
+
2. Discovers available operations at runtime — the tool inventory is not hardcoded.
|
|
13
|
+
3. Normalizes them into a shared tool shape, `ZuoraToolDefinition`.
|
|
14
|
+
4. Exposes them in the format your agent framework expects: OpenAI Chat Completions, OpenAI Agents SDK, LangChain, or Vercel AI SDK.
|
|
15
|
+
|
|
16
|
+
Your agent can then do things like "list accounts" or "run a query" through tool calls, while the kit handles authentication, filtering (read-only vs. writes and tool bundles), approval rules, and observability.
|
|
17
|
+
|
|
18
|
+
To discover the bundles and tools available for your tenant, see [Discovery and execution](#discovery-and-execution) below.
|
|
8
19
|
|
|
9
20
|
## Quick start
|
|
10
21
|
|
|
@@ -36,6 +47,11 @@ Set `ZUORA_BASE_URL`, `ZUORA_CLIENT_ID`, and `ZUORA_CLIENT_SECRET` in your envir
|
|
|
36
47
|
|
|
37
48
|
## Changelog
|
|
38
49
|
|
|
50
|
+
### [0.1.0-beta.1]
|
|
51
|
+
|
|
52
|
+
- First beta release — customers are welcome to evaluate it in sandbox or other non-production environments; it is **not intended for production use yet**.
|
|
53
|
+
- Added an introduction explaining runtime tool discovery, the shared tool definition, framework adapters, and built-in safety and observability controls.
|
|
54
|
+
|
|
39
55
|
### [0.1.0-alpha.1]
|
|
40
56
|
|
|
41
57
|
- Fixed HITL approval policy handling with correct `request.environment` usage
|
|
@@ -52,7 +68,7 @@ Initial alpha release.
|
|
|
52
68
|
Requires **Node.js 18** or later.
|
|
53
69
|
|
|
54
70
|
```bash
|
|
55
|
-
npm install @zuora/agent-toolkit
|
|
71
|
+
npm install @zuora/agent-toolkit@beta
|
|
56
72
|
```
|
|
57
73
|
|
|
58
74
|
Framework packages are peer dependencies — install only what you use:
|
|
@@ -361,7 +377,11 @@ configuration: {
|
|
|
361
377
|
|
|
362
378
|
### Approval policy
|
|
363
379
|
|
|
364
|
-
|
|
380
|
+
Approval policies are checked before a tool executes. An `"allow"` decision lets execution proceed; `"deny"` blocks it with an `APPROVAL_REJECTED` error. If no policy is configured, no additional approval check is performed.
|
|
381
|
+
|
|
382
|
+
Approval policies are an additional guardrail, not a way to enable writes: write operations must also be enabled through `configuration.mode: SafetyMode.WriteEnabled`. The read-only execution guard runs before the approval policy.
|
|
383
|
+
|
|
384
|
+
`approvalPolicy` is a **top-level** config field (not inside `configuration`):
|
|
365
385
|
|
|
366
386
|
```ts
|
|
367
387
|
import { ApprovalPolicyPreset, SafetyMode } from "@zuora/agent-toolkit";
|
|
@@ -378,9 +398,29 @@ const toolkit = await createZuoraOpenAIAgentToolkit({
|
|
|
378
398
|
});
|
|
379
399
|
```
|
|
380
400
|
|
|
381
|
-
|
|
401
|
+
Built-in presets automatically allow or deny operations; they do **not** display an approval prompt. Operations that do not match a preset's denial condition are allowed by that policy.
|
|
402
|
+
|
|
403
|
+
| Preset | Behavior |
|
|
404
|
+
|---|---|
|
|
405
|
+
| `Off` | No additional approval restriction |
|
|
406
|
+
| `AllWrites` | Denies all write operations |
|
|
407
|
+
| `HighRisk` | Denies all high-risk operations, including reads |
|
|
408
|
+
| `ProductionWrites` | Denies writes when the detected environment is production |
|
|
409
|
+
| `ProductionHighRisk` | Denies high-risk operations when the detected environment is production |
|
|
410
|
+
|
|
411
|
+
Custom handlers can be synchronous or async and receive:
|
|
412
|
+
|
|
413
|
+
| Field | Contents |
|
|
414
|
+
|---|---|
|
|
415
|
+
| `request.tool` | Tool definition, including access and risk metadata for the invoked operation |
|
|
416
|
+
| `request.input` | Arguments supplied to the tool |
|
|
417
|
+
| `request.environment` | `"production"` or `"sandbox"`, inferred from `baseUrl` |
|
|
418
|
+
|
|
419
|
+
**Environment detection:** unrecognized URLs currently default to `"sandbox"`. Production-only presets therefore do not block operations on unrecognized URLs; use a custom policy if your endpoint is not recognized as production.
|
|
420
|
+
|
|
421
|
+
Custom handler return values: `"allow"` (proceed) · `"deny"` (block) · `{ decision: "allow" | "deny", reason?: string }`. Only `decision` is used; `reason` is not currently included in the rejection error.
|
|
382
422
|
|
|
383
|
-
|
|
423
|
+
A custom async `approvalPolicy` can integrate your own approval workflow. For an example combining interactive approval through the OpenAI `shouldExecute` hook with an automated toolkit policy, see [`examples/openai/hitl.ts`](examples/openai/hitl.ts). In that example, the hook prompts before writes and returns a declined result to the model if the user refuses. The toolkit policy separately denies high-risk operations in production, even if the user approved them.
|
|
384
424
|
|
|
385
425
|
### Context
|
|
386
426
|
|