@zuora/agent-toolkit 0.0.1-alpha.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 +298 -0
- package/dist/async-jobs-Dd8Jafv0.d.ts +532 -0
- package/dist/bundle-catalog-3V6EICKE.json +289 -0
- package/dist/index.d.ts +42 -0
- package/dist/index.js +496 -0
- package/dist/index.js.map +1 -0
- package/dist/langchain/index.d.ts +2 -0
- package/dist/langchain/index.js +1 -0
- package/dist/langchain/index.js.map +1 -0
- package/dist/mcp/index.d.ts +2 -0
- package/dist/mcp/index.js +1 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/openai/index.d.ts +165 -0
- package/dist/openai/index.js +5257 -0
- package/dist/openai/index.js.map +1 -0
- package/dist/openai-agents/index.d.ts +94 -0
- package/dist/openai-agents/index.js +5203 -0
- package/dist/openai-agents/index.js.map +1 -0
- package/dist/shared/resources/bundle-catalog.json +289 -0
- package/dist/shared/toolkit-core.d.ts +73 -0
- package/dist/shared/toolkit-core.js +4686 -0
- package/dist/shared/toolkit-core.js.map +1 -0
- package/dist/toolkit-CafRZuAV.d.ts +31 -0
- package/dist/vercel-ai/index.d.ts +2 -0
- package/dist/vercel-ai/index.js +1 -0
- package/dist/vercel-ai/index.js.map +1 -0
- package/package.json +95 -0
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 1,
|
|
3
|
+
"bundles": {
|
|
4
|
+
"accounts": {
|
|
5
|
+
"description": "Customer accounts, contacts, billing profiles, and account summaries.",
|
|
6
|
+
"examples": [
|
|
7
|
+
"show account summary",
|
|
8
|
+
"find account by account number",
|
|
9
|
+
"update account contact",
|
|
10
|
+
"cancel customer account"
|
|
11
|
+
],
|
|
12
|
+
"commonObjects": [
|
|
13
|
+
"Account",
|
|
14
|
+
"Contact",
|
|
15
|
+
"BillingProfile"
|
|
16
|
+
],
|
|
17
|
+
"keywords": [
|
|
18
|
+
"account",
|
|
19
|
+
"customer",
|
|
20
|
+
"contact",
|
|
21
|
+
"billing profile",
|
|
22
|
+
"summary"
|
|
23
|
+
]
|
|
24
|
+
},
|
|
25
|
+
"catalog": {
|
|
26
|
+
"description": "Products, plans, charges, tiers, pricing context, and commerce catalog setup.",
|
|
27
|
+
"examples": [
|
|
28
|
+
"show latest product",
|
|
29
|
+
"create product",
|
|
30
|
+
"update product charge",
|
|
31
|
+
"inspect pricing tiers"
|
|
32
|
+
],
|
|
33
|
+
"commonObjects": [
|
|
34
|
+
"Product",
|
|
35
|
+
"Plan",
|
|
36
|
+
"Charge",
|
|
37
|
+
"Tier"
|
|
38
|
+
],
|
|
39
|
+
"keywords": [
|
|
40
|
+
"product",
|
|
41
|
+
"catalog",
|
|
42
|
+
"plan",
|
|
43
|
+
"charge",
|
|
44
|
+
"price",
|
|
45
|
+
"tier"
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
"subscriptions": {
|
|
49
|
+
"description": "Subscription lookup, previews, creation, changes, renewal, and cancellation.",
|
|
50
|
+
"examples": [
|
|
51
|
+
"show subscription",
|
|
52
|
+
"preview subscription change",
|
|
53
|
+
"create subscription",
|
|
54
|
+
"cancel subscription"
|
|
55
|
+
],
|
|
56
|
+
"commonObjects": [
|
|
57
|
+
"Subscription",
|
|
58
|
+
"RatePlan",
|
|
59
|
+
"OrderAction"
|
|
60
|
+
],
|
|
61
|
+
"keywords": [
|
|
62
|
+
"subscription",
|
|
63
|
+
"renewal",
|
|
64
|
+
"preview",
|
|
65
|
+
"amendment",
|
|
66
|
+
"cancel"
|
|
67
|
+
]
|
|
68
|
+
},
|
|
69
|
+
"orders": {
|
|
70
|
+
"description": "Order preview and order lifecycle operations for subscription commerce changes.",
|
|
71
|
+
"examples": [
|
|
72
|
+
"preview order",
|
|
73
|
+
"create order",
|
|
74
|
+
"show order",
|
|
75
|
+
"cancel order"
|
|
76
|
+
],
|
|
77
|
+
"commonObjects": [
|
|
78
|
+
"Order",
|
|
79
|
+
"OrderAction",
|
|
80
|
+
"OrderLineItem"
|
|
81
|
+
],
|
|
82
|
+
"keywords": [
|
|
83
|
+
"order",
|
|
84
|
+
"order action",
|
|
85
|
+
"preview",
|
|
86
|
+
"subscription change"
|
|
87
|
+
]
|
|
88
|
+
},
|
|
89
|
+
"billing": {
|
|
90
|
+
"description": "Invoices, bill runs, billing documents, credit memos, debit memos, and billing previews.",
|
|
91
|
+
"examples": [
|
|
92
|
+
"create bill run",
|
|
93
|
+
"check bill run status",
|
|
94
|
+
"show latest invoice",
|
|
95
|
+
"post bill run",
|
|
96
|
+
"generate billing documents"
|
|
97
|
+
],
|
|
98
|
+
"commonObjects": [
|
|
99
|
+
"Invoice",
|
|
100
|
+
"BillRun",
|
|
101
|
+
"CreditMemo",
|
|
102
|
+
"DebitMemo",
|
|
103
|
+
"BillingPreview"
|
|
104
|
+
],
|
|
105
|
+
"keywords": [
|
|
106
|
+
"invoice",
|
|
107
|
+
"bill run",
|
|
108
|
+
"billing",
|
|
109
|
+
"credit memo",
|
|
110
|
+
"debit memo",
|
|
111
|
+
"billing preview",
|
|
112
|
+
"pdf"
|
|
113
|
+
]
|
|
114
|
+
},
|
|
115
|
+
"payments": {
|
|
116
|
+
"description": "Payments, payment runs, refunds, payment methods, and payment schedules.",
|
|
117
|
+
"examples": [
|
|
118
|
+
"show payment",
|
|
119
|
+
"refund payment",
|
|
120
|
+
"create payment run",
|
|
121
|
+
"inspect payment method"
|
|
122
|
+
],
|
|
123
|
+
"commonObjects": [
|
|
124
|
+
"Payment",
|
|
125
|
+
"PaymentRun",
|
|
126
|
+
"Refund",
|
|
127
|
+
"PaymentMethod"
|
|
128
|
+
],
|
|
129
|
+
"keywords": [
|
|
130
|
+
"payment",
|
|
131
|
+
"refund",
|
|
132
|
+
"payment method",
|
|
133
|
+
"payment run",
|
|
134
|
+
"settlement"
|
|
135
|
+
]
|
|
136
|
+
},
|
|
137
|
+
"usage": {
|
|
138
|
+
"description": "Usage upload, usage query, chargeable events, and metered consumption operations.",
|
|
139
|
+
"examples": [
|
|
140
|
+
"upload usage",
|
|
141
|
+
"query usage records",
|
|
142
|
+
"inspect chargeable events"
|
|
143
|
+
],
|
|
144
|
+
"commonObjects": [
|
|
145
|
+
"Usage",
|
|
146
|
+
"ChargeableEvent"
|
|
147
|
+
],
|
|
148
|
+
"keywords": [
|
|
149
|
+
"usage",
|
|
150
|
+
"meter",
|
|
151
|
+
"consumption",
|
|
152
|
+
"chargeable event",
|
|
153
|
+
"upload"
|
|
154
|
+
]
|
|
155
|
+
},
|
|
156
|
+
"revenue": {
|
|
157
|
+
"description": "Revenue reporting, journal runs, revenue schedules, and accounting recognition workflows.",
|
|
158
|
+
"examples": [
|
|
159
|
+
"show revenue schedule",
|
|
160
|
+
"run revenue report",
|
|
161
|
+
"check journal run status"
|
|
162
|
+
],
|
|
163
|
+
"commonObjects": [
|
|
164
|
+
"RevenueSchedule",
|
|
165
|
+
"JournalRun",
|
|
166
|
+
"RevenueContract"
|
|
167
|
+
],
|
|
168
|
+
"keywords": [
|
|
169
|
+
"revenue",
|
|
170
|
+
"journal",
|
|
171
|
+
"recognition",
|
|
172
|
+
"revenue schedule"
|
|
173
|
+
]
|
|
174
|
+
},
|
|
175
|
+
"finance": {
|
|
176
|
+
"description": "Accounting periods, accounting codes, sequence sets, and finance configuration.",
|
|
177
|
+
"examples": [
|
|
178
|
+
"list accounting periods",
|
|
179
|
+
"close accounting period",
|
|
180
|
+
"show accounting code settings",
|
|
181
|
+
"update sequence set"
|
|
182
|
+
],
|
|
183
|
+
"commonObjects": [
|
|
184
|
+
"AccountingPeriod",
|
|
185
|
+
"AccountingCode",
|
|
186
|
+
"SequenceSet"
|
|
187
|
+
],
|
|
188
|
+
"keywords": [
|
|
189
|
+
"accounting",
|
|
190
|
+
"finance",
|
|
191
|
+
"period",
|
|
192
|
+
"sequence",
|
|
193
|
+
"trial balance"
|
|
194
|
+
]
|
|
195
|
+
},
|
|
196
|
+
"workflows": {
|
|
197
|
+
"description": "Workflow discovery, execution, task status, and workflow monitoring.",
|
|
198
|
+
"examples": [
|
|
199
|
+
"list workflows",
|
|
200
|
+
"run workflow",
|
|
201
|
+
"check workflow task status"
|
|
202
|
+
],
|
|
203
|
+
"commonObjects": [
|
|
204
|
+
"Workflow",
|
|
205
|
+
"WorkflowRun",
|
|
206
|
+
"WorkflowTask"
|
|
207
|
+
],
|
|
208
|
+
"keywords": [
|
|
209
|
+
"workflow",
|
|
210
|
+
"task",
|
|
211
|
+
"automation",
|
|
212
|
+
"run",
|
|
213
|
+
"monitor"
|
|
214
|
+
]
|
|
215
|
+
},
|
|
216
|
+
"query": {
|
|
217
|
+
"description": "Object Query, GraphQL Query, Data Query, metadata discovery, query jobs, and result retrieval.",
|
|
218
|
+
"examples": [
|
|
219
|
+
"manage_data_queries: query aggregations result like: how many active billing accounts",
|
|
220
|
+
"zuora_graphql__query: describe product object fields",
|
|
221
|
+
"zuora_graphql__query in sync mode: query nested subscription details",
|
|
222
|
+
"use query_objects for Object Query: simple object lookups, one primary object, small result sets, or object metadata and field discovery",
|
|
223
|
+
"use manage_data_queries: SQL-style reporting, joins, aggregations, or large read-only exports",
|
|
224
|
+
"use manage_data_queries for Data Query job status and result metadata",
|
|
225
|
+
"use download_query_result for completed Data Query result file downloads when a jobId is available",
|
|
226
|
+
"use zuora_graphql__query for nested related records in one response when the tenant exposes the needed graph schema",
|
|
227
|
+
"manage_data_queries: submit data query",
|
|
228
|
+
"manage_data_queries: check query job status"
|
|
229
|
+
],
|
|
230
|
+
"commonObjects": [
|
|
231
|
+
"DataQueryJob",
|
|
232
|
+
"ObjectMetadata",
|
|
233
|
+
"QueryResult"
|
|
234
|
+
],
|
|
235
|
+
"keywords": [
|
|
236
|
+
"query",
|
|
237
|
+
"data query",
|
|
238
|
+
"object",
|
|
239
|
+
"graphql",
|
|
240
|
+
"metadata",
|
|
241
|
+
"sql",
|
|
242
|
+
"job",
|
|
243
|
+
"result"
|
|
244
|
+
]
|
|
245
|
+
},
|
|
246
|
+
"admin": {
|
|
247
|
+
"description": "Settings, custom fields, custom objects, feature configuration, and system health.",
|
|
248
|
+
"examples": [
|
|
249
|
+
"list custom fields",
|
|
250
|
+
"create custom object record",
|
|
251
|
+
"show tenant settings",
|
|
252
|
+
"check system health"
|
|
253
|
+
],
|
|
254
|
+
"commonObjects": [
|
|
255
|
+
"CustomField",
|
|
256
|
+
"CustomObject",
|
|
257
|
+
"TenantSetting"
|
|
258
|
+
],
|
|
259
|
+
"keywords": [
|
|
260
|
+
"admin",
|
|
261
|
+
"settings",
|
|
262
|
+
"custom field",
|
|
263
|
+
"custom object",
|
|
264
|
+
"tenant",
|
|
265
|
+
"health"
|
|
266
|
+
]
|
|
267
|
+
},
|
|
268
|
+
"files": {
|
|
269
|
+
"description": "SDK-native file artifact downloads and bounded local artifact reads.",
|
|
270
|
+
"examples": [
|
|
271
|
+
"download data query result file",
|
|
272
|
+
"read downloaded file preview",
|
|
273
|
+
"inspect exported jsonl result"
|
|
274
|
+
],
|
|
275
|
+
"commonObjects": [
|
|
276
|
+
"FileArtifact",
|
|
277
|
+
"DownloadedFile"
|
|
278
|
+
],
|
|
279
|
+
"keywords": [
|
|
280
|
+
"file",
|
|
281
|
+
"download",
|
|
282
|
+
"artifact",
|
|
283
|
+
"jsonl",
|
|
284
|
+
"csv",
|
|
285
|
+
"result url"
|
|
286
|
+
]
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { d as ZuoraToolkitEvent, e as ZuoraAgentToolkitConfig, f as ZuoraMcpClient, T as ToolSelection, Z as ZuoraToolDefinition, g as ZuoraBundleDefinition, h as ZuoraBundleName, b as ZuoraToolExecutionResult, c as ZuoraAsyncJobResult, i as ZuoraWaitForJobOptions } from '../async-jobs-Dd8Jafv0.js';
|
|
2
|
+
|
|
3
|
+
type InternalToolkitEvent = Omit<ZuoraToolkitEvent, "type" | "timestamp"> & Partial<Pick<ZuoraToolkitEvent, "type" | "timestamp">>;
|
|
4
|
+
|
|
5
|
+
declare abstract class ToolkitCore<T> {
|
|
6
|
+
protected readonly config: ZuoraAgentToolkitConfig;
|
|
7
|
+
protected mcpClient: ZuoraMcpClient;
|
|
8
|
+
private catalogTools;
|
|
9
|
+
private _initialized;
|
|
10
|
+
private readonly sanitizerLimits;
|
|
11
|
+
private readonly nativeFileArtifactTools;
|
|
12
|
+
private readonly nativeQueryResultDownloadTools;
|
|
13
|
+
private readonly nativeZuoraFileDownloadTools;
|
|
14
|
+
private readonly restClient;
|
|
15
|
+
private nativeToolRegistry;
|
|
16
|
+
constructor(config: ZuoraAgentToolkitConfig);
|
|
17
|
+
initialize(): Promise<void>;
|
|
18
|
+
close(): Promise<void>;
|
|
19
|
+
listTools(selection?: ToolSelection): Promise<ZuoraToolDefinition[]>;
|
|
20
|
+
/**
|
|
21
|
+
* Returns framework-native tool objects for the given selection.
|
|
22
|
+
*
|
|
23
|
+
* @param selection - Optional filter (bundles, mode) to narrow the catalog.
|
|
24
|
+
* @param maxTools - When provided and greater than zero, limits the result to
|
|
25
|
+
* the first `maxTools` entries after filtering. Values ≤ 0 are treated as
|
|
26
|
+
* no-limit. Does not affect `loadFollowUpTools()`, which always searches
|
|
27
|
+
* the full catalog.
|
|
28
|
+
*/
|
|
29
|
+
getTools(selection?: ToolSelection, maxTools?: number): Promise<T[]>;
|
|
30
|
+
listBundles(): Promise<ZuoraBundleDefinition[]>;
|
|
31
|
+
describeBundle(name: ZuoraBundleName): Promise<ZuoraBundleDefinition>;
|
|
32
|
+
describeTool(name: string): Promise<ZuoraToolDefinition | undefined>;
|
|
33
|
+
callTool(operationName: string, input: Record<string, unknown>): Promise<ZuoraToolExecutionResult>;
|
|
34
|
+
/**
|
|
35
|
+
* Polls an async job to completion using the polling operation specified in
|
|
36
|
+
* the async job result. Returns the final polling tool execution result when
|
|
37
|
+
* the job reaches a terminal state.
|
|
38
|
+
*
|
|
39
|
+
* Polling stops when:
|
|
40
|
+
* - A terminal status is matched (success, failure, or canceled)
|
|
41
|
+
* - The maximum number of poll attempts is exhausted
|
|
42
|
+
* - The absolute timeout is exceeded
|
|
43
|
+
*
|
|
44
|
+
* @param toolName - The name of the tool that started the async job. Used for
|
|
45
|
+
* observability context only.
|
|
46
|
+
* @param asyncResult - The pending async job result from an initial tool call.
|
|
47
|
+
* @param options - Optional overrides for polling behavior.
|
|
48
|
+
* @throws ZuoraAgentToolkitError with ASYNC_JOB_TIMEOUT if the job does not
|
|
49
|
+
* reach a terminal state within the configured limits.
|
|
50
|
+
*/
|
|
51
|
+
waitForJob(toolName: string, asyncResult: ZuoraAsyncJobResult, options?: ZuoraWaitForJobOptions): Promise<ZuoraToolExecutionResult>;
|
|
52
|
+
protected abstract convertTools(tools: ZuoraToolDefinition[]): T[];
|
|
53
|
+
/**
|
|
54
|
+
* Returns the full normalized tool catalog after initialization.
|
|
55
|
+
*
|
|
56
|
+
* @internal For use by adapter subclasses only (e.g. to implement
|
|
57
|
+
* follow-up tool resolution against the full catalog). Do not call
|
|
58
|
+
* from outside the class hierarchy.
|
|
59
|
+
*/
|
|
60
|
+
protected getNormalizedTools(): ZuoraToolDefinition[];
|
|
61
|
+
private resolveSplitOperations;
|
|
62
|
+
private warnIfNotInitialized;
|
|
63
|
+
protected emit(event: InternalToolkitEvent): void;
|
|
64
|
+
/**
|
|
65
|
+
* Fetches a Data Query job result to extract the dataFile download URL.
|
|
66
|
+
* Called by NativeQueryResultDownloadTools to resolve the presigned S3 URL
|
|
67
|
+
* for a completed query job before handing off to downloadFile.
|
|
68
|
+
*/
|
|
69
|
+
private fetchQueryResultForDownload;
|
|
70
|
+
private createEventContext;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export { ToolkitCore };
|