@zuora/agent-toolkit 0.1.0-alpha.0 → 0.1.0-alpha.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 +15 -1
- package/dist/langchain/index.js +18 -9
- package/dist/langchain/index.js.map +1 -1
- package/dist/openai/index.js +18 -9
- package/dist/openai/index.js.map +1 -1
- package/dist/openai-agents/index.d.ts +30 -1
- package/dist/openai-agents/index.js +92 -9
- package/dist/openai-agents/index.js.map +1 -1
- package/dist/shared/toolkit-core.js +18 -9
- package/dist/shared/toolkit-core.js.map +1 -1
- package/dist/vercel-ai/index.js +18 -9
- package/dist/vercel-ai/index.js.map +1 -1
- package/package.json +15 -10
package/README.md
CHANGED
|
@@ -34,6 +34,19 @@ Set `ZUORA_BASE_URL`, `ZUORA_CLIENT_ID`, and `ZUORA_CLIENT_SECRET` in your envir
|
|
|
34
34
|
| `@zuora/agent-toolkit/vercel-ai` | `createZuoraVercelAIToolkit` | ✅ Implemented |
|
|
35
35
|
| `@zuora/agent-toolkit/mcp` | — | 🚧 Coming soon |
|
|
36
36
|
|
|
37
|
+
## Changelog
|
|
38
|
+
|
|
39
|
+
### [0.1.0-alpha.1]
|
|
40
|
+
|
|
41
|
+
- Fixed HITL approval policy handling with correct `request.environment` usage
|
|
42
|
+
- Improved tool name resolution
|
|
43
|
+
- Removed deprecated `CLI_AGENT_SPLIT_OPERATIONS` references
|
|
44
|
+
- Test and documentation updates
|
|
45
|
+
|
|
46
|
+
### [0.1.0-alpha.0]
|
|
47
|
+
|
|
48
|
+
Initial alpha release.
|
|
49
|
+
|
|
37
50
|
## Installation
|
|
38
51
|
|
|
39
52
|
Requires **Node.js 18** or later.
|
|
@@ -495,6 +508,7 @@ Working examples are available in the source repository:
|
|
|
495
508
|
| `examples/openai/advanced.ts` | Observability, hooks, async jobs, discovery |
|
|
496
509
|
| `examples/openai/hitl.ts` | Human-in-the-loop (HITL) approval |
|
|
497
510
|
| `examples/openai-agents/index.ts` | OpenAI Agents SDK agent |
|
|
498
|
-
| `examples/openai-agents-cli/` | Interactive CLI agent + planner |
|
|
511
|
+
| `examples/openai-agents-cli/` | Interactive CLI agent + planner + dual-layer approval (HITL + toolkit) |
|
|
512
|
+
| `examples/langchain-agents-cli/` | Interactive LangChain CLI agent + planner + dual-layer approval (HITL + toolkit) |
|
|
499
513
|
| `examples/langchain/index.ts` | LangChain ReactAgent with Zuora tools |
|
|
500
514
|
| `examples/vercel-ai/index.ts` | Vercel AI SDK `streamText` agent |
|
package/dist/langchain/index.js
CHANGED
|
@@ -4175,8 +4175,17 @@ var createHttpMcpClientConfig = (config) => {
|
|
|
4175
4175
|
};
|
|
4176
4176
|
var isTenantAuthConnection = (connection) => connection?.tenantAuth?.enabled === true;
|
|
4177
4177
|
var filterCatalogTools = (tools, policy) => tools.filter((tool2) => {
|
|
4178
|
-
if (policy.mode === SafetyMode.ReadOnly
|
|
4179
|
-
|
|
4178
|
+
if (policy.mode === SafetyMode.ReadOnly) {
|
|
4179
|
+
if (tool2.meta.operationAccess) {
|
|
4180
|
+
const hasReadOperation = Object.values(tool2.meta.operationAccess).some(
|
|
4181
|
+
(access) => access === "read"
|
|
4182
|
+
);
|
|
4183
|
+
if (!hasReadOperation) {
|
|
4184
|
+
return false;
|
|
4185
|
+
}
|
|
4186
|
+
} else if (tool2.meta.access === "write") {
|
|
4187
|
+
return false;
|
|
4188
|
+
}
|
|
4180
4189
|
}
|
|
4181
4190
|
if (policy.bundles.size > 0 && !policy.bundles.has(tool2.meta.bundle)) {
|
|
4182
4191
|
return false;
|
|
@@ -4338,18 +4347,18 @@ var ToolkitCore = class {
|
|
|
4338
4347
|
});
|
|
4339
4348
|
}
|
|
4340
4349
|
const mode = this.config.configuration?.mode ?? SafetyMode.ReadOnly;
|
|
4341
|
-
if (mode === SafetyMode.ReadOnly && tool2.meta.access === "write") {
|
|
4342
|
-
throw new ZuoraAgentToolkitError({
|
|
4343
|
-
code: "TOOL_EXECUTION_ERROR",
|
|
4344
|
-
message: `Write tool "${operationName}" is disabled in readOnly mode.`,
|
|
4345
|
-
category: "tool_execution"
|
|
4346
|
-
});
|
|
4347
|
-
}
|
|
4348
4350
|
const nativeRuntimeTool = this.nativeToolRegistry?.get(operationName);
|
|
4349
4351
|
const nativeApprovalMetadata = nativeRuntimeTool?.approvalMetadata(input);
|
|
4350
4352
|
const invokedOperation = tool2.meta.operationSelector ? String(input[tool2.meta.operationSelector] ?? "") : void 0;
|
|
4351
4353
|
const effectiveAccess = (invokedOperation ? tool2.meta.operationAccess?.[invokedOperation] : void 0) ?? tool2.meta.access;
|
|
4352
4354
|
const effectiveRiskLevel = (invokedOperation ? tool2.meta.operationRiskLevel?.[invokedOperation] : void 0) ?? tool2.meta.riskLevel;
|
|
4355
|
+
if (mode === SafetyMode.ReadOnly && effectiveAccess === "write") {
|
|
4356
|
+
throw new ZuoraAgentToolkitError({
|
|
4357
|
+
code: "TOOL_EXECUTION_ERROR",
|
|
4358
|
+
message: `Write operation "${invokedOperation ?? operationName}" is disabled in readOnly mode.`,
|
|
4359
|
+
category: "tool_execution"
|
|
4360
|
+
});
|
|
4361
|
+
}
|
|
4353
4362
|
const effectiveTool = effectiveAccess === tool2.meta.access && effectiveRiskLevel === tool2.meta.riskLevel ? tool2 : { ...tool2, meta: { ...tool2.meta, access: effectiveAccess, riskLevel: effectiveRiskLevel } };
|
|
4354
4363
|
await enforceApproval(
|
|
4355
4364
|
effectiveTool,
|