@zuora/agent-toolkit 0.0.1-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.
@@ -1,6 +1,6 @@
1
1
  import { ChatCompletionTool } from 'openai/resources/chat/completions';
2
2
  import { ToolkitCore } from './shared/toolkit-core.js';
3
- import { Z as ZuoraToolDefinition, a as ZuoraAgentToolkitConfigInput } from './async-jobs-Dd8Jafv0.js';
3
+ import { Z as ZuoraToolDefinition, a as ZuoraAgentToolkitConfigInput } from './async-jobs-DJ_GygII.js';
4
4
 
5
5
  declare class ZuoraOpenAIAgentToolkit extends ToolkitCore<ChatCompletionTool> {
6
6
  private toolIndex;
@@ -1,2 +1,65 @@
1
+ import { Tool, ToolSet } from 'ai';
2
+ import { ToolkitCore } from '../shared/toolkit-core.js';
3
+ import { Z as ZuoraToolDefinition, T as ToolSelection, a as ZuoraAgentToolkitConfigInput } from '../async-jobs-DJ_GygII.js';
1
4
 
2
- export { }
5
+ /**
6
+ * Vercel AI SDK adapter for the Zuora Agent Toolkit.
7
+ *
8
+ * Extends {@link ToolkitCore} to produce Vercel AI SDK `Tool` objects whose
9
+ * `execute` functions are wired directly to the Zuora MCP server.
10
+ *
11
+ * Use {@link getToolSet} to obtain a `ToolSet` (Record<string, Tool>) for
12
+ * passing directly to `streamText` or `generateText`.
13
+ *
14
+ * @example
15
+ * ```typescript
16
+ * const toolkit = await createZuoraVercelAIToolkit({
17
+ * env: true,
18
+ * configuration: { mode: SafetyMode.ReadOnly },
19
+ * });
20
+ * const tools = await toolkit.getToolSet({ bundles: ["query"] });
21
+ * // pass tools to streamText or generateText
22
+ * ```
23
+ */
24
+ declare class ZuoraVercelAIToolkit extends ToolkitCore<Tool> {
25
+ /**
26
+ * Maps each `ZuoraToolDefinition` to a Vercel AI SDK `Tool` with an
27
+ * `execute` function that calls through to the Zuora MCP server.
28
+ *
29
+ * The `execute` function routes by `def.name` (the normalized MCP name),
30
+ * not by the sanitized adapter name. The sanitized name is only used as
31
+ * the key in the `ToolSet` returned by {@link getToolSet}.
32
+ */
33
+ protected convertTools(tools: ZuoraToolDefinition[]): Tool[];
34
+ /**
35
+ * Returns a `ToolSet` (Record<string, Tool>) for direct use with
36
+ * `streamText` or `generateText` from the Vercel AI SDK.
37
+ *
38
+ * Keys are sanitized tool names (≤ 64 chars, `[A-Za-z0-9_-]` only).
39
+ * Values are `Tool` objects with `execute` functions wired to Zuora MCP.
40
+ *
41
+ * @param selection - Optional bundle/mode filter, same as {@link getTools}.
42
+ * @param maxTools - Optional cap on the number of tools returned.
43
+ *
44
+ * @example
45
+ * ```typescript
46
+ * const tools = await toolkit.getToolSet(
47
+ * { bundles: ["accounts", "query"], mode: SafetyMode.ReadOnly },
48
+ * 50,
49
+ * );
50
+ * const { textStream } = streamText({ model, tools, maxSteps: 20, ... });
51
+ * ```
52
+ */
53
+ getToolSet(selection?: ToolSelection, maxTools?: number): Promise<ToolSet>;
54
+ close(): Promise<void>;
55
+ }
56
+ /**
57
+ * Creates and initializes a {@link ZuoraVercelAIToolkit}.
58
+ *
59
+ * Always use this factory instead of constructing the class directly —
60
+ * `initialize()` fetches the tool catalog from the Zuora MCP server and
61
+ * must complete before any tool operations are called.
62
+ */
63
+ declare const createZuoraVercelAIToolkit: (config: ZuoraAgentToolkitConfigInput) => Promise<ZuoraVercelAIToolkit>;
64
+
65
+ export { ZuoraVercelAIToolkit, createZuoraVercelAIToolkit };