@abhishek944/pi-classifier 0.3.0 → 0.5.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/CHANGELOG.md +48 -0
- package/COMPUTER_USE.md +117 -0
- package/README.md +344 -30
- package/dist/auth.d.ts +4 -2
- package/dist/auth.js +18 -2
- package/dist/box-tool.d.ts +4 -0
- package/dist/box-tool.js +79 -0
- package/dist/box.d.ts +32 -0
- package/dist/box.js +148 -0
- package/dist/choices.js +35 -1
- package/dist/classify.d.ts +6 -0
- package/dist/classify.js +4 -4
- package/dist/computer-use-state.d.ts +9 -0
- package/dist/computer-use-state.js +160 -0
- package/dist/computer-use-tool.d.ts +52 -0
- package/dist/computer-use-tool.js +78 -0
- package/dist/computer-use-types.d.ts +132 -0
- package/dist/computer-use-types.js +1 -0
- package/dist/computer-use.d.ts +22 -0
- package/dist/computer-use.js +223 -0
- package/dist/config.d.ts +140 -3
- package/dist/config.js +405 -20
- package/dist/cost.js +42 -4
- package/dist/durable.d.ts +34 -0
- package/dist/durable.js +237 -0
- package/dist/extension.d.ts +2 -247
- package/dist/extension.js +53 -190
- package/dist/extract.d.ts +11 -0
- package/dist/extract.js +191 -0
- package/dist/http.d.ts +6 -1
- package/dist/http.js +64 -28
- package/dist/image-content.d.ts +12 -0
- package/dist/image-content.js +90 -0
- package/dist/index.d.ts +10 -1
- package/dist/index.js +3 -0
- package/dist/inputs.d.ts +24 -2
- package/dist/inputs.js +565 -134
- package/dist/mcp-cli.d.ts +2 -0
- package/dist/mcp-cli.js +39 -0
- package/dist/mcp-server.d.ts +28 -0
- package/dist/mcp-server.js +121 -0
- package/dist/mcp-tool-definitions.d.ts +19 -0
- package/dist/mcp-tool-definitions.js +64 -0
- package/dist/providers.d.ts +1 -0
- package/dist/providers.js +1218 -124
- package/dist/tool-contracts.d.ts +785 -0
- package/dist/tool-contracts.js +530 -0
- package/dist/tree.js +1 -1
- package/dist/types.d.ts +314 -20
- package/dist/validation.js +181 -44
- package/package.json +33 -5
- package/src/auth.ts +26 -2
- package/src/box-tool.ts +110 -0
- package/src/box.ts +253 -0
- package/src/choices.ts +44 -2
- package/src/classify.ts +10 -6
- package/src/computer-use-state.ts +145 -0
- package/src/computer-use-tool.ts +76 -0
- package/src/computer-use-types.ts +127 -0
- package/src/computer-use.ts +216 -0
- package/src/config.ts +454 -23
- package/src/cost.ts +42 -4
- package/src/durable.ts +298 -0
- package/src/extension.ts +79 -265
- package/src/extract.ts +228 -0
- package/src/http.ts +63 -32
- package/src/image-content.ts +77 -0
- package/src/index.ts +25 -0
- package/src/inputs.ts +603 -184
- package/src/mcp-cli.ts +44 -0
- package/src/mcp-server.ts +179 -0
- package/src/mcp-tool-definitions.ts +104 -0
- package/src/providers.ts +1398 -144
- package/src/tool-contracts.ts +785 -0
- package/src/tree.ts +1 -1
- package/src/types.ts +248 -11
- package/src/validation.ts +169 -96
|
@@ -0,0 +1,785 @@
|
|
|
1
|
+
import { Type } from "typebox";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Tool names, descriptions and argument/result schemas shared by the Pi desktop extension and the
|
|
5
|
+
* native Durable factory. Both surfaces must accept and report exactly the same contract, so these
|
|
6
|
+
* live here rather than in either adapter. Pi-only registration fields (label, prompt guidance,
|
|
7
|
+
* annotations, outputSchema) stay with the desktop registrations.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
export const CLASSIFY_TOOL = "classify";
|
|
11
|
+
export const CLASSIFY_COMPARE_TOOL = "classify_compare";
|
|
12
|
+
export const CLASSIFY_TREE_TOOL = "classify_tree";
|
|
13
|
+
export const CLASSIFIER_BOX_TOOL = "classifier_box_image";
|
|
14
|
+
|
|
15
|
+
export const CLASSIFY_TOOL_DESCRIPTION =
|
|
16
|
+
"Ask a decision model typed questions about text, JSON, images and supported audio/video. Legacy image paths are shared; named path/url descriptors require explicit {$image:id} references. Jev supports images in instructions/criteria; OpenAI supports instruction images and hosted URLs. Unsupported placements fail locally. Returns bool probabilities, choices, scores, Perplexity locate spans, Liquid reads/estimates/multi-select answers and boxes, plus reported token usage and estimated USD cost (or an explicit unavailable reason). mode: web_grounding is an explicit Perplexity opt-in that sends question text and the start of state to web search and adds billed searches/fetches; cost.nonToken reports the documented fees. Experimental Jev box answers require explicit configuration. Provider/model are fixed by pi-classifier.default (or legacy defaultProvider/defaultModel); this tool cannot override them. API-key authentication is independent of Codex chat login. Only explicitly configured fallback routes may be used after a missing key or HTTP 401/404/429 before any batch has completed; never after uncertainty, refusals, timeouts or network failures. Use /classifier list or status to inspect configuration.";
|
|
17
|
+
|
|
18
|
+
export const CLASSIFY_COMPARE_TOOL_DESCRIPTION =
|
|
19
|
+
"Explicitly compare the same typed questions and state using exactly pi-classifier.compare provider/model pairs. Each entry makes potentially billable requests, including multiple requests when choice batching is configured. No fallback, default substitution, provider/model overrides, or default changes. Returns labeled results, duration, usage, estimated USD costs (or unavailable reasons) and safe per-entry failures; cancellation retains completed results and prevents later requests.";
|
|
20
|
+
|
|
21
|
+
export const CLASSIFY_TREE_TOOL_DESCRIPTION =
|
|
22
|
+
"Classify text, JSON or supported images through a nested classification tree. tree is an inline roots/id/description/children object or a local JSON file inside cwd. Choose among siblings, automatically follow sole children without model calls, and return Level1/Level2/etc under levels with per-step provenance, total providerCalls, reported usage and estimated USD cost. NONE, batching and initial fallback follow configured settings; after a successful decision the route is pinned. no_match, ambiguous and refusal retain only the selected prefix. Automatic steps are structural, not model confirmation; greedy traversal is not a global best-path guarantee. No provider/model override or comparison.";
|
|
23
|
+
|
|
24
|
+
export const CLASSIFIER_BOX_TOOL_DESCRIPTION =
|
|
25
|
+
"Render a normalized bounding box on a local image, or crop to it, entirely locally. Use to inspect a box answer from classify. overlay keeps the image and draws a rectangle; crop returns only the clamped region. Returns a PNG plus exact source-pixel box metadata. No provider request, upload, resizing or disk write. A box is a localization hint, not proof that the object exists.";
|
|
26
|
+
|
|
27
|
+
const imageReference = Type.Object(
|
|
28
|
+
{ $image: Type.String({ pattern: "^[a-zA-Z0-9_-]{1,64}$" }) },
|
|
29
|
+
{ additionalProperties: false },
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
function imageContent(maxLength: number, nonempty = false) {
|
|
33
|
+
return Type.Union([
|
|
34
|
+
Type.String({ maxLength, ...(nonempty ? { minLength: 1 } : {}) }),
|
|
35
|
+
Type.Array(Type.Union([Type.String({ maxLength }), imageReference]), {
|
|
36
|
+
minItems: 1,
|
|
37
|
+
maxItems: 128,
|
|
38
|
+
description:
|
|
39
|
+
"Ordered text and explicit {$image:id} references. References require named images; supported placements depend on the route.",
|
|
40
|
+
}),
|
|
41
|
+
]);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const shortText = imageContent(4096);
|
|
45
|
+
const instructionContent = imageContent(16384, true);
|
|
46
|
+
|
|
47
|
+
const charSpan = Type.Tuple([
|
|
48
|
+
Type.Integer({ minimum: 0 }),
|
|
49
|
+
Type.Integer({ minimum: 0 }),
|
|
50
|
+
]);
|
|
51
|
+
|
|
52
|
+
// Numeric estimation ranges may be negative or fractional; they are not text offsets.
|
|
53
|
+
const numericRange = Type.Tuple([Type.Number(), Type.Number()]);
|
|
54
|
+
|
|
55
|
+
const boxEdges = Type.Object(
|
|
56
|
+
{
|
|
57
|
+
top: Type.Number(),
|
|
58
|
+
bottom: Type.Number(),
|
|
59
|
+
left: Type.Number(),
|
|
60
|
+
right: Type.Number(),
|
|
61
|
+
},
|
|
62
|
+
{ additionalProperties: false },
|
|
63
|
+
);
|
|
64
|
+
|
|
65
|
+
const textSpan = Type.Object(
|
|
66
|
+
{
|
|
67
|
+
start: Type.Integer({ minimum: 0 }),
|
|
68
|
+
end: Type.Integer({ minimum: 0 }),
|
|
69
|
+
text: Type.String(),
|
|
70
|
+
score: Type.Number({ minimum: 0, maximum: 1 }),
|
|
71
|
+
searchResult: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
72
|
+
},
|
|
73
|
+
{ additionalProperties: false },
|
|
74
|
+
);
|
|
75
|
+
|
|
76
|
+
const webSearchResult = Type.Object(
|
|
77
|
+
{
|
|
78
|
+
title: Type.String(),
|
|
79
|
+
url: Type.String(),
|
|
80
|
+
snippet: Type.String(),
|
|
81
|
+
date: Type.Optional(Type.String({ pattern: "^\\d{4}-\\d{2}-\\d{2}$" })),
|
|
82
|
+
lastUpdated: Type.Optional(Type.String({ pattern: "^\\d{4}-\\d{2}-\\d{2}$" })),
|
|
83
|
+
},
|
|
84
|
+
{ additionalProperties: false },
|
|
85
|
+
);
|
|
86
|
+
|
|
87
|
+
const webFetchedResult = Type.Object(
|
|
88
|
+
{ title: Type.String(), url: Type.String(), snippet: Type.String() },
|
|
89
|
+
{ additionalProperties: false },
|
|
90
|
+
);
|
|
91
|
+
|
|
92
|
+
const nonTokenCost = Type.Object(
|
|
93
|
+
{
|
|
94
|
+
currency: Type.Literal("USD"),
|
|
95
|
+
webGrounding: Type.Object(
|
|
96
|
+
{
|
|
97
|
+
status: Type.Literal("estimated_maximum"),
|
|
98
|
+
searchesRequested: Type.Integer({ minimum: 0 }),
|
|
99
|
+
searchFeeMaximum: Type.Number({ minimum: 0 }),
|
|
100
|
+
successfulFetches: Type.Integer({ minimum: 0 }),
|
|
101
|
+
fetchFee: Type.Number({ minimum: 0 }),
|
|
102
|
+
totalMaximum: Type.Number({ minimum: 0 }),
|
|
103
|
+
note: Type.String(),
|
|
104
|
+
},
|
|
105
|
+
{ additionalProperties: false },
|
|
106
|
+
),
|
|
107
|
+
},
|
|
108
|
+
{ additionalProperties: false },
|
|
109
|
+
);
|
|
110
|
+
|
|
111
|
+
const question = Type.Union([
|
|
112
|
+
Type.Object(
|
|
113
|
+
{
|
|
114
|
+
type: Type.Literal("bool"),
|
|
115
|
+
instructions: instructionContent,
|
|
116
|
+
criteria: Type.Optional(
|
|
117
|
+
Type.Object(
|
|
118
|
+
{ true: Type.Optional(shortText), false: Type.Optional(shortText) },
|
|
119
|
+
{ additionalProperties: false },
|
|
120
|
+
),
|
|
121
|
+
),
|
|
122
|
+
},
|
|
123
|
+
{ additionalProperties: false },
|
|
124
|
+
),
|
|
125
|
+
Type.Object(
|
|
126
|
+
{
|
|
127
|
+
type: Type.Literal("choice"),
|
|
128
|
+
instructions: instructionContent,
|
|
129
|
+
criteria: Type.Record(
|
|
130
|
+
Type.String({ minLength: 1, maxLength: 128 }),
|
|
131
|
+
shortText,
|
|
132
|
+
{ minProperties: 1 },
|
|
133
|
+
),
|
|
134
|
+
booleanValues: Type.Optional(Type.Boolean()),
|
|
135
|
+
},
|
|
136
|
+
{ additionalProperties: false },
|
|
137
|
+
),
|
|
138
|
+
Type.Object(
|
|
139
|
+
{
|
|
140
|
+
type: Type.Literal("score"),
|
|
141
|
+
instructions: instructionContent,
|
|
142
|
+
criteria: Type.Array(imageContent(4096, true), {
|
|
143
|
+
minItems: 2,
|
|
144
|
+
maxItems: 10,
|
|
145
|
+
}),
|
|
146
|
+
descriptions: Type.Optional(Type.Array(Type.String({ maxLength: 4096 }))),
|
|
147
|
+
},
|
|
148
|
+
{ additionalProperties: false },
|
|
149
|
+
),
|
|
150
|
+
Type.Object(
|
|
151
|
+
{
|
|
152
|
+
type: Type.Literal("box"),
|
|
153
|
+
instructions: instructionContent,
|
|
154
|
+
},
|
|
155
|
+
{ additionalProperties: false },
|
|
156
|
+
),
|
|
157
|
+
Type.Object(
|
|
158
|
+
{
|
|
159
|
+
type: Type.Literal("extract"),
|
|
160
|
+
instructions: Type.Optional(instructionContent),
|
|
161
|
+
criteria: Type.Record(Type.String({ minLength: 1, maxLength: 128 }), shortText, { minProperties: 1, maxProperties: 26 }),
|
|
162
|
+
source: Type.Optional(Type.String({ minLength: 1, maxLength: 4096 })),
|
|
163
|
+
threshold: Type.Optional(Type.Number({ minimum: 0, maximum: 1 })),
|
|
164
|
+
snapToWords: Type.Optional(Type.Boolean()),
|
|
165
|
+
debug: Type.Optional(Type.Boolean()),
|
|
166
|
+
},
|
|
167
|
+
{ additionalProperties: false },
|
|
168
|
+
),
|
|
169
|
+
Type.Object(
|
|
170
|
+
{
|
|
171
|
+
type: Type.Literal("locate"),
|
|
172
|
+
instructions: instructionContent,
|
|
173
|
+
},
|
|
174
|
+
{ additionalProperties: false },
|
|
175
|
+
),
|
|
176
|
+
Type.Object(
|
|
177
|
+
{ type: Type.Literal("text"), instructions: instructionContent },
|
|
178
|
+
{ additionalProperties: false },
|
|
179
|
+
),
|
|
180
|
+
Type.Object(
|
|
181
|
+
{
|
|
182
|
+
type: Type.Literal("number"),
|
|
183
|
+
instructions: instructionContent,
|
|
184
|
+
unit: Type.Optional(Type.String({ maxLength: 128 })),
|
|
185
|
+
range: Type.Optional(numericRange),
|
|
186
|
+
step: Type.Optional(Type.Number({ exclusiveMinimum: 0 })),
|
|
187
|
+
},
|
|
188
|
+
{ additionalProperties: false },
|
|
189
|
+
),
|
|
190
|
+
Type.Object(
|
|
191
|
+
{ type: Type.Literal("date"), instructions: instructionContent },
|
|
192
|
+
{ additionalProperties: false },
|
|
193
|
+
),
|
|
194
|
+
Type.Object(
|
|
195
|
+
{
|
|
196
|
+
type: Type.Literal("spans"),
|
|
197
|
+
instructions: instructionContent,
|
|
198
|
+
max: Type.Optional(Type.Integer({ minimum: 1, maximum: 64 })),
|
|
199
|
+
},
|
|
200
|
+
{ additionalProperties: false },
|
|
201
|
+
),
|
|
202
|
+
Type.Object(
|
|
203
|
+
{
|
|
204
|
+
type: Type.Literal("boxes"),
|
|
205
|
+
instructions: instructionContent,
|
|
206
|
+
max: Type.Optional(Type.Integer({ minimum: 1, maximum: 64 })),
|
|
207
|
+
},
|
|
208
|
+
{ additionalProperties: false },
|
|
209
|
+
),
|
|
210
|
+
Type.Object(
|
|
211
|
+
{
|
|
212
|
+
type: Type.Literal("estimate"),
|
|
213
|
+
instructions: instructionContent,
|
|
214
|
+
range: numericRange,
|
|
215
|
+
step: Type.Optional(Type.Number({ exclusiveMinimum: 0 })),
|
|
216
|
+
unit: Type.Optional(Type.String({ maxLength: 128 })),
|
|
217
|
+
},
|
|
218
|
+
{ additionalProperties: false },
|
|
219
|
+
),
|
|
220
|
+
Type.Object(
|
|
221
|
+
{
|
|
222
|
+
type: Type.Literal("multi_choice"),
|
|
223
|
+
instructions: instructionContent,
|
|
224
|
+
criteria: Type.Record(Type.String({ minLength: 1, maxLength: 128 }), shortText, { minProperties: 2 }),
|
|
225
|
+
},
|
|
226
|
+
{ additionalProperties: false },
|
|
227
|
+
),
|
|
228
|
+
]);
|
|
229
|
+
|
|
230
|
+
export const classifyParameters = Type.Object(
|
|
231
|
+
{
|
|
232
|
+
state: Type.Union(
|
|
233
|
+
[
|
|
234
|
+
Type.String(),
|
|
235
|
+
Type.Record(Type.String(), Type.Unknown()),
|
|
236
|
+
Type.Array(Type.Unknown()),
|
|
237
|
+
],
|
|
238
|
+
{
|
|
239
|
+
description:
|
|
240
|
+
"Text or JSON data to classify. Use explicit {$image:id} objects to place named images in state on Jev, OpenAI or Perplexity. Other JSON remains data. All questions refer to this same state.",
|
|
241
|
+
},
|
|
242
|
+
),
|
|
243
|
+
questions: Type.Record(
|
|
244
|
+
Type.String({ pattern: "^[a-zA-Z0-9_-]{1,64}$" }),
|
|
245
|
+
question,
|
|
246
|
+
{ minProperties: 1, maxProperties: 1000 },
|
|
247
|
+
),
|
|
248
|
+
mode: Type.Optional(
|
|
249
|
+
Type.Literal("web_grounding"),
|
|
250
|
+
),
|
|
251
|
+
conversation: Type.Optional(
|
|
252
|
+
Type.Array(Type.Unknown({
|
|
253
|
+
description: "An OpenAI Decisions input item: message, function_call, function_call_output, custom_tool_call or custom_tool_call_output.",
|
|
254
|
+
})),
|
|
255
|
+
),
|
|
256
|
+
imageDetail: Type.Optional(
|
|
257
|
+
Type.Union([
|
|
258
|
+
Type.Literal("auto"),
|
|
259
|
+
Type.Literal("low"),
|
|
260
|
+
Type.Literal("high"),
|
|
261
|
+
Type.Literal("original"),
|
|
262
|
+
]),
|
|
263
|
+
),
|
|
264
|
+
promptCache: Type.Optional(
|
|
265
|
+
Type.Object(
|
|
266
|
+
{
|
|
267
|
+
key: Type.Optional(Type.String({ minLength: 1, maxLength: 64 })),
|
|
268
|
+
mode: Type.Optional(Type.Union([Type.Literal("implicit"), Type.Literal("explicit")])),
|
|
269
|
+
ttl: Type.Optional(Type.Literal("30m")),
|
|
270
|
+
breakpoints: Type.Optional(Type.Boolean()),
|
|
271
|
+
},
|
|
272
|
+
{ additionalProperties: false },
|
|
273
|
+
),
|
|
274
|
+
),
|
|
275
|
+
media: Type.Optional(
|
|
276
|
+
Type.Array(
|
|
277
|
+
Type.Object(
|
|
278
|
+
{
|
|
279
|
+
type: Type.Union([Type.Literal("audio"), Type.Literal("video")]),
|
|
280
|
+
path: Type.String({ minLength: 1, maxLength: 4096 }),
|
|
281
|
+
},
|
|
282
|
+
{ additionalProperties: false },
|
|
283
|
+
),
|
|
284
|
+
),
|
|
285
|
+
),
|
|
286
|
+
images: Type.Optional(
|
|
287
|
+
Type.Array(
|
|
288
|
+
Type.Union([
|
|
289
|
+
Type.String({ minLength: 1, maxLength: 4096 }),
|
|
290
|
+
Type.Object(
|
|
291
|
+
{
|
|
292
|
+
id: Type.String({ pattern: "^[a-zA-Z0-9_-]{1,64}$" }),
|
|
293
|
+
path: Type.String({ minLength: 1, maxLength: 4096 }),
|
|
294
|
+
},
|
|
295
|
+
{ additionalProperties: false },
|
|
296
|
+
),
|
|
297
|
+
Type.Object(
|
|
298
|
+
{
|
|
299
|
+
id: Type.String({ pattern: "^[a-zA-Z0-9_-]{1,64}$" }),
|
|
300
|
+
url: Type.String({ minLength: 1, maxLength: 4096 }),
|
|
301
|
+
},
|
|
302
|
+
{ additionalProperties: false },
|
|
303
|
+
),
|
|
304
|
+
]),
|
|
305
|
+
{
|
|
306
|
+
maxItems: 128,
|
|
307
|
+
description:
|
|
308
|
+
"Legacy local paths are shared in order. Named {id,path} or {id,url} images must be referenced using {$image:id} in state or supported question content. URLs are OpenAI-only and sent to the provider, never fetched locally. No inline base64 or symlinks. The selected route enforces its documented image limit; this envelope accepts 128.",
|
|
309
|
+
},
|
|
310
|
+
),
|
|
311
|
+
),
|
|
312
|
+
},
|
|
313
|
+
{ additionalProperties: false },
|
|
314
|
+
);
|
|
315
|
+
|
|
316
|
+
const tokenPricing = Type.Object({
|
|
317
|
+
inputPerMillion: Type.Number({ minimum: 0 }),
|
|
318
|
+
outputPerMillion: Type.Number({ minimum: 0 }),
|
|
319
|
+
cachedInputPerMillion: Type.Optional(Type.Number({ minimum: 0 })),
|
|
320
|
+
cacheWritePerMillion: Type.Optional(Type.Number({ minimum: 0 })),
|
|
321
|
+
});
|
|
322
|
+
|
|
323
|
+
export const classifyOutput = Type.Object({
|
|
324
|
+
provider: Type.String(),
|
|
325
|
+
model: Type.String(),
|
|
326
|
+
answers: Type.Record(
|
|
327
|
+
Type.String(),
|
|
328
|
+
Type.Union([
|
|
329
|
+
Type.Object({
|
|
330
|
+
type: Type.Literal("bool"),
|
|
331
|
+
probability: Type.Number({ minimum: 0, maximum: 1 }),
|
|
332
|
+
}),
|
|
333
|
+
Type.Object({
|
|
334
|
+
type: Type.Literal("choice"),
|
|
335
|
+
choice: Type.String(),
|
|
336
|
+
probabilities: Type.Record(
|
|
337
|
+
Type.String(),
|
|
338
|
+
Type.Number({ minimum: 0, maximum: 1 }),
|
|
339
|
+
),
|
|
340
|
+
confidence: Type.Number({ minimum: 0, maximum: 1 }),
|
|
341
|
+
probabilityScope: Type.Optional(Type.Literal("batch")),
|
|
342
|
+
noneOfAboveProbability: Type.Optional(
|
|
343
|
+
Type.Number({ minimum: 0, maximum: 1 }),
|
|
344
|
+
),
|
|
345
|
+
}),
|
|
346
|
+
Type.Object({
|
|
347
|
+
type: Type.Literal("score"),
|
|
348
|
+
score: Type.Number(),
|
|
349
|
+
confidence: Type.Number({ minimum: 0, maximum: 1 }),
|
|
350
|
+
probabilities: Type.Optional(
|
|
351
|
+
Type.Record(Type.String(), Type.Number({ minimum: 0, maximum: 1 })),
|
|
352
|
+
),
|
|
353
|
+
}),
|
|
354
|
+
Type.Object({
|
|
355
|
+
type: Type.Literal("box"),
|
|
356
|
+
box: Type.Object({
|
|
357
|
+
top: Type.Number(),
|
|
358
|
+
bottom: Type.Number(),
|
|
359
|
+
left: Type.Number(),
|
|
360
|
+
right: Type.Number(),
|
|
361
|
+
}),
|
|
362
|
+
confidence: Type.Number({ minimum: 0, maximum: 1 }),
|
|
363
|
+
found: Type.Optional(Type.Number({ minimum: 0, maximum: 1 })),
|
|
364
|
+
}),
|
|
365
|
+
Type.Object({ type: Type.Literal("locate"), spans: Type.Array(textSpan) }),
|
|
366
|
+
Type.Object({
|
|
367
|
+
type: Type.Literal("extract"),
|
|
368
|
+
spans: Type.Record(Type.String(), Type.Array(textSpan)),
|
|
369
|
+
notStated: Type.Record(Type.String(), Type.Number({ minimum: 0, maximum: 1 })),
|
|
370
|
+
}),
|
|
371
|
+
Type.Object({
|
|
372
|
+
type: Type.Literal("text"),
|
|
373
|
+
text: Type.String(),
|
|
374
|
+
span: Type.Optional(Type.Union([charSpan, Type.Null()])),
|
|
375
|
+
found: Type.Optional(Type.Number({ minimum: 0, maximum: 1 })),
|
|
376
|
+
path: Type.Optional(Type.String()),
|
|
377
|
+
}),
|
|
378
|
+
Type.Object({
|
|
379
|
+
type: Type.Literal("number"),
|
|
380
|
+
value: Type.Union([Type.Number(), Type.Null()]),
|
|
381
|
+
unit: Type.Optional(Type.Union([Type.String(), Type.Null()])),
|
|
382
|
+
text: Type.Optional(Type.Union([Type.String(), Type.Null()])),
|
|
383
|
+
span: Type.Optional(Type.Union([charSpan, Type.Null()])),
|
|
384
|
+
found: Type.Optional(Type.Number({ minimum: 0, maximum: 1 })),
|
|
385
|
+
path: Type.Optional(Type.String()),
|
|
386
|
+
}),
|
|
387
|
+
Type.Object({
|
|
388
|
+
type: Type.Literal("date"),
|
|
389
|
+
date: Type.Union([Type.String(), Type.Null()]),
|
|
390
|
+
text: Type.Optional(Type.Union([Type.String(), Type.Null()])),
|
|
391
|
+
span: Type.Optional(Type.Union([charSpan, Type.Null()])),
|
|
392
|
+
found: Type.Optional(Type.Number({ minimum: 0, maximum: 1 })),
|
|
393
|
+
path: Type.Optional(Type.String()),
|
|
394
|
+
}),
|
|
395
|
+
Type.Object({
|
|
396
|
+
type: Type.Literal("spans"),
|
|
397
|
+
spans: Type.Array(Type.Object({
|
|
398
|
+
text: Type.String(),
|
|
399
|
+
span: charSpan,
|
|
400
|
+
found: Type.Number({ minimum: 0, maximum: 1 }),
|
|
401
|
+
}, { additionalProperties: false })),
|
|
402
|
+
count: Type.Integer({ minimum: 0 }),
|
|
403
|
+
atLeast: Type.Boolean(),
|
|
404
|
+
presence: Type.Array(Type.Number({ minimum: 0, maximum: 1 })),
|
|
405
|
+
}),
|
|
406
|
+
Type.Object({
|
|
407
|
+
type: Type.Literal("boxes"),
|
|
408
|
+
boxes: Type.Array(Type.Object({
|
|
409
|
+
box: boxEdges,
|
|
410
|
+
found: Type.Number({ minimum: 0, maximum: 1 }),
|
|
411
|
+
confidence: Type.Number({ minimum: 0, maximum: 1 }),
|
|
412
|
+
}, { additionalProperties: false })),
|
|
413
|
+
count: Type.Integer({ minimum: 0 }),
|
|
414
|
+
atLeast: Type.Boolean(),
|
|
415
|
+
presence: Type.Array(Type.Number({ minimum: 0, maximum: 1 })),
|
|
416
|
+
}),
|
|
417
|
+
Type.Object({
|
|
418
|
+
type: Type.Literal("estimate"),
|
|
419
|
+
value: Type.Number(),
|
|
420
|
+
interval: numericRange,
|
|
421
|
+
unit: Type.Optional(Type.Union([Type.String(), Type.Null()])),
|
|
422
|
+
}),
|
|
423
|
+
Type.Object({
|
|
424
|
+
type: Type.Literal("multi_choice"),
|
|
425
|
+
choices: Type.Array(Type.String()),
|
|
426
|
+
probabilities: Type.Record(Type.String(), Type.Number({ minimum: 0, maximum: 1 })),
|
|
427
|
+
}),
|
|
428
|
+
Type.Object({ type: Type.Literal("refusal") }),
|
|
429
|
+
Type.Object({ type: Type.Literal("no_match") }),
|
|
430
|
+
Type.Object({ type: Type.Literal("ambiguous") }),
|
|
431
|
+
]),
|
|
432
|
+
),
|
|
433
|
+
providerCalls: Type.Optional(Type.Integer({ minimum: 1 })),
|
|
434
|
+
usage: Type.Optional(
|
|
435
|
+
Type.Object({
|
|
436
|
+
inputTokens: Type.Number(),
|
|
437
|
+
outputTokens: Type.Number(),
|
|
438
|
+
totalTokens: Type.Number(),
|
|
439
|
+
cachedInputTokens: Type.Optional(Type.Number()),
|
|
440
|
+
cacheWriteTokens: Type.Optional(Type.Number()),
|
|
441
|
+
}),
|
|
442
|
+
),
|
|
443
|
+
cost: Type.Union([
|
|
444
|
+
Type.Object({
|
|
445
|
+
status: Type.Literal("estimated"),
|
|
446
|
+
currency: Type.Literal("USD"),
|
|
447
|
+
input: Type.Number({ minimum: 0 }),
|
|
448
|
+
output: Type.Number({ minimum: 0 }),
|
|
449
|
+
total: Type.Number({ minimum: 0 }),
|
|
450
|
+
source: Type.Union([Type.Literal("builtin"), Type.Literal("configured")]),
|
|
451
|
+
rates: tokenPricing,
|
|
452
|
+
nonToken: Type.Optional(nonTokenCost),
|
|
453
|
+
}),
|
|
454
|
+
Type.Object({
|
|
455
|
+
status: Type.Literal("estimated"),
|
|
456
|
+
currency: Type.Literal("USD"),
|
|
457
|
+
input: Type.Number({ minimum: 0 }),
|
|
458
|
+
output: Type.Number({ minimum: 0 }),
|
|
459
|
+
total: Type.Number({ minimum: 0 }),
|
|
460
|
+
source: Type.Literal("aggregated"),
|
|
461
|
+
nonToken: Type.Optional(nonTokenCost),
|
|
462
|
+
}),
|
|
463
|
+
Type.Object({
|
|
464
|
+
status: Type.Literal("unavailable"),
|
|
465
|
+
currency: Type.Literal("USD"),
|
|
466
|
+
reason: Type.Union([
|
|
467
|
+
Type.Literal("unknown_pricing"),
|
|
468
|
+
Type.Literal("missing_usage"),
|
|
469
|
+
Type.Literal("invalid_usage"),
|
|
470
|
+
Type.Literal("missing_cache_pricing"),
|
|
471
|
+
Type.Literal("calculation_overflow"),
|
|
472
|
+
]),
|
|
473
|
+
}),
|
|
474
|
+
]),
|
|
475
|
+
providerCost: Type.Optional(
|
|
476
|
+
Type.Object(
|
|
477
|
+
{
|
|
478
|
+
currency: Type.Literal("USD"),
|
|
479
|
+
total: Type.Number({ minimum: 0 }),
|
|
480
|
+
source: Type.Union([Type.Literal("provider"), Type.Literal("gateway")]),
|
|
481
|
+
note: Type.Optional(Type.String()),
|
|
482
|
+
},
|
|
483
|
+
{ additionalProperties: false },
|
|
484
|
+
),
|
|
485
|
+
),
|
|
486
|
+
citations: Type.Optional(
|
|
487
|
+
Type.Array(
|
|
488
|
+
Type.Object(
|
|
489
|
+
{
|
|
490
|
+
url: Type.String(),
|
|
491
|
+
title: Type.Optional(Type.String()),
|
|
492
|
+
excerpts: Type.Optional(Type.Array(Type.String())),
|
|
493
|
+
},
|
|
494
|
+
{ additionalProperties: false },
|
|
495
|
+
),
|
|
496
|
+
),
|
|
497
|
+
),
|
|
498
|
+
requestId: Type.Optional(Type.String()),
|
|
499
|
+
webGrounding: Type.Optional(
|
|
500
|
+
Type.Object(
|
|
501
|
+
{
|
|
502
|
+
searchResults: Type.Array(webSearchResult),
|
|
503
|
+
fetchedResults: Type.Optional(Type.Array(webFetchedResult)),
|
|
504
|
+
},
|
|
505
|
+
{ additionalProperties: false },
|
|
506
|
+
),
|
|
507
|
+
),
|
|
508
|
+
attemptedRoutes: Type.Optional(
|
|
509
|
+
Type.Array(Type.Object({ provider: Type.String(), model: Type.String() })),
|
|
510
|
+
),
|
|
511
|
+
});
|
|
512
|
+
|
|
513
|
+
export const classifyCompareOutput = Type.Object({
|
|
514
|
+
cancelled: Type.Boolean(),
|
|
515
|
+
results: Type.Array(
|
|
516
|
+
Type.Union([
|
|
517
|
+
Type.Object({
|
|
518
|
+
provider: Type.String(),
|
|
519
|
+
model: Type.String(),
|
|
520
|
+
durationMs: Type.Number(),
|
|
521
|
+
status: Type.Literal("success"),
|
|
522
|
+
result: classifyOutput,
|
|
523
|
+
}),
|
|
524
|
+
Type.Object({
|
|
525
|
+
provider: Type.String(),
|
|
526
|
+
model: Type.String(),
|
|
527
|
+
durationMs: Type.Number(),
|
|
528
|
+
status: Type.Literal("error"),
|
|
529
|
+
error: Type.Object({ code: Type.String(), message: Type.String() }),
|
|
530
|
+
}),
|
|
531
|
+
]),
|
|
532
|
+
),
|
|
533
|
+
});
|
|
534
|
+
|
|
535
|
+
// The model-facing JSON schema avoids $ref: recursive validation stays in loadTreeInput.
|
|
536
|
+
const classificationTreeNode = Type.Object(
|
|
537
|
+
{
|
|
538
|
+
id: Type.String({ minLength: 1, maxLength: 128 }),
|
|
539
|
+
description: Type.Optional(Type.String({ maxLength: 4096 })),
|
|
540
|
+
children: Type.Optional(
|
|
541
|
+
Type.Array(
|
|
542
|
+
Type.Unknown({
|
|
543
|
+
description: "A nested tree node with the same id, description and children shape.",
|
|
544
|
+
}),
|
|
545
|
+
{ minItems: 1 },
|
|
546
|
+
),
|
|
547
|
+
),
|
|
548
|
+
},
|
|
549
|
+
{ additionalProperties: false },
|
|
550
|
+
);
|
|
551
|
+
|
|
552
|
+
export const classifyTreeParameters = Type.Object(
|
|
553
|
+
{
|
|
554
|
+
state: classifyParameters.properties.state,
|
|
555
|
+
tree: Type.Union([
|
|
556
|
+
Type.String({
|
|
557
|
+
minLength: 1,
|
|
558
|
+
maxLength: 4096,
|
|
559
|
+
description: "Local UTF-8 JSON file inside cwd; no URLs or symlinks.",
|
|
560
|
+
}),
|
|
561
|
+
Type.Object(
|
|
562
|
+
{
|
|
563
|
+
roots: Type.Array(classificationTreeNode, {
|
|
564
|
+
minItems: 1,
|
|
565
|
+
}),
|
|
566
|
+
},
|
|
567
|
+
{ additionalProperties: false },
|
|
568
|
+
),
|
|
569
|
+
]),
|
|
570
|
+
instructions: Type.Optional(Type.String({ minLength: 1, maxLength: 8192 })),
|
|
571
|
+
images: classifyParameters.properties.images,
|
|
572
|
+
},
|
|
573
|
+
{ additionalProperties: false },
|
|
574
|
+
);
|
|
575
|
+
|
|
576
|
+
export const classifyTreeOutput = Type.Object({
|
|
577
|
+
provider: Type.String(),
|
|
578
|
+
model: Type.String(),
|
|
579
|
+
status: Type.Union([
|
|
580
|
+
Type.Literal("complete"),
|
|
581
|
+
Type.Literal("no_match"),
|
|
582
|
+
Type.Literal("ambiguous"),
|
|
583
|
+
Type.Literal("refusal"),
|
|
584
|
+
]),
|
|
585
|
+
levels: Type.Record(Type.String({ pattern: "^Level[1-9][0-9]*$" }), Type.String()),
|
|
586
|
+
steps: Type.Array(
|
|
587
|
+
Type.Object({
|
|
588
|
+
level: Type.Integer({ minimum: 1 }),
|
|
589
|
+
id: Type.String(),
|
|
590
|
+
source: Type.Union([Type.Literal("automatic"), Type.Literal("model")]),
|
|
591
|
+
confidence: Type.Optional(Type.Number({ minimum: 0, maximum: 1 })),
|
|
592
|
+
probabilityScope: Type.Optional(
|
|
593
|
+
Type.Union([Type.Literal("siblings"), Type.Literal("batch")]),
|
|
594
|
+
),
|
|
595
|
+
noneOfAboveProbability: Type.Optional(
|
|
596
|
+
Type.Number({ minimum: 0, maximum: 1 }),
|
|
597
|
+
),
|
|
598
|
+
}),
|
|
599
|
+
),
|
|
600
|
+
providerCalls: Type.Integer({ minimum: 0 }),
|
|
601
|
+
cost: classifyOutput.properties.cost,
|
|
602
|
+
usage: classifyOutput.properties.usage,
|
|
603
|
+
attemptedRoutes: classifyOutput.properties.attemptedRoutes,
|
|
604
|
+
});
|
|
605
|
+
|
|
606
|
+
export const boxParameters = Type.Object(
|
|
607
|
+
{
|
|
608
|
+
image: Type.String({
|
|
609
|
+
minLength: 1,
|
|
610
|
+
maxLength: 4096,
|
|
611
|
+
description:
|
|
612
|
+
"Local PNG, JPEG or WebP file inside cwd. No URLs, symlinks or inline base64.",
|
|
613
|
+
}),
|
|
614
|
+
box: Type.Object(
|
|
615
|
+
{
|
|
616
|
+
top: Type.Number({ minimum: 0, maximum: 1 }),
|
|
617
|
+
bottom: Type.Number({ minimum: 0, maximum: 1 }),
|
|
618
|
+
left: Type.Number({ minimum: 0, maximum: 1 }),
|
|
619
|
+
right: Type.Number({ minimum: 0, maximum: 1 }),
|
|
620
|
+
},
|
|
621
|
+
{
|
|
622
|
+
additionalProperties: false,
|
|
623
|
+
description:
|
|
624
|
+
"Normalized edges between 0 and 1, with top < bottom and left < right.",
|
|
625
|
+
},
|
|
626
|
+
),
|
|
627
|
+
mode: Type.Optional(
|
|
628
|
+
Type.Union([Type.Literal("overlay"), Type.Literal("crop")], {
|
|
629
|
+
description:
|
|
630
|
+
"overlay draws the box on the image (default); crop returns only the boxed region.",
|
|
631
|
+
}),
|
|
632
|
+
),
|
|
633
|
+
},
|
|
634
|
+
{ additionalProperties: false },
|
|
635
|
+
);
|
|
636
|
+
|
|
637
|
+
export const boxOutput = Type.Object({
|
|
638
|
+
mode: Type.Union([Type.Literal("overlay"), Type.Literal("crop")]),
|
|
639
|
+
mimeType: Type.Literal("image/png"),
|
|
640
|
+
width: Type.Integer({ minimum: 1 }),
|
|
641
|
+
height: Type.Integer({ minimum: 1 }),
|
|
642
|
+
pixelBox: Type.Object({
|
|
643
|
+
left: Type.Integer({ minimum: 0 }),
|
|
644
|
+
top: Type.Integer({ minimum: 0 }),
|
|
645
|
+
width: Type.Integer({ minimum: 1 }),
|
|
646
|
+
height: Type.Integer({ minimum: 1 }),
|
|
647
|
+
}),
|
|
648
|
+
byteLength: Type.Integer({ minimum: 1 }),
|
|
649
|
+
});
|
|
650
|
+
|
|
651
|
+
/* Cloudflare Clairic extraction ------------------------------------------ */
|
|
652
|
+
|
|
653
|
+
export const CLASSIFY_EXTRACT_TOOL = "classify_extract";
|
|
654
|
+
export const CLASSIFY_EXTRACT_TOOL_DESCRIPTION =
|
|
655
|
+
"Extract typed fields with Cloudflare Clairic using the configured clairic-api route. fields maps names to provider field specifications such as text, number, date, enum, object, list, estimate and forecast; nested object/list fields are supported. State is text/JSON and optional images or embedded PDF paths are sent to the provider. Returns typed values with optional grounding metadata plus reported token usage and estimated USD cost. Rendering is provider-owned; truncated reports incomplete generated fields. The tool cannot override the provider or model.";
|
|
656
|
+
|
|
657
|
+
// The model-facing JSON schema avoids $ref: validation of nested fields is runtime-owned.
|
|
658
|
+
const extractionFieldDefinition = Type.Object(
|
|
659
|
+
{
|
|
660
|
+
type: Type.Union([
|
|
661
|
+
Type.Literal("text"), Type.Literal("number"), Type.Literal("compute"),
|
|
662
|
+
Type.Literal("date"), Type.Literal("time"), Type.Literal("datetime"),
|
|
663
|
+
Type.Literal("duration"), Type.Literal("boolean"), Type.Literal("enum"),
|
|
664
|
+
Type.Literal("object"), Type.Literal("list"), Type.Literal("estimate"),
|
|
665
|
+
Type.Literal("forecast"),
|
|
666
|
+
]),
|
|
667
|
+
instructions: Type.Optional(Type.String({ maxLength: 16_384 })),
|
|
668
|
+
nullable: Type.Optional(Type.Boolean()),
|
|
669
|
+
unit: Type.Optional(Type.String({ maxLength: 128 })),
|
|
670
|
+
integer: Type.Optional(Type.Boolean()),
|
|
671
|
+
decimals: Type.Optional(Type.Integer({ minimum: 0, maximum: 6 })),
|
|
672
|
+
minimum: Type.Optional(Type.Number()),
|
|
673
|
+
maximum: Type.Optional(Type.Number()),
|
|
674
|
+
exclusiveMinimum: Type.Optional(Type.Number()),
|
|
675
|
+
exclusiveMaximum: Type.Optional(Type.Number()),
|
|
676
|
+
minLength: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
677
|
+
maxLength: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
678
|
+
pattern: Type.Optional(Type.String({ maxLength: 4096 })),
|
|
679
|
+
enum: Type.Optional(Type.Array(Type.Unknown(), { minItems: 1 })),
|
|
680
|
+
knowledge: Type.Optional(Type.Boolean()),
|
|
681
|
+
source_only: Type.Optional(Type.Boolean()),
|
|
682
|
+
null_threshold: Type.Optional(Type.Number({ exclusiveMinimum: 0, maximum: 1 })),
|
|
683
|
+
properties: Type.Optional(
|
|
684
|
+
Type.Record(
|
|
685
|
+
Type.String(),
|
|
686
|
+
Type.Unknown({
|
|
687
|
+
description: "A nested Clairic field specification with the same keys as this object.",
|
|
688
|
+
}),
|
|
689
|
+
{ minProperties: 1 },
|
|
690
|
+
),
|
|
691
|
+
),
|
|
692
|
+
items: Type.Optional(
|
|
693
|
+
Type.Union([
|
|
694
|
+
Type.Literal("text"), Type.Literal("number"), Type.Literal("date"),
|
|
695
|
+
Type.Object(
|
|
696
|
+
{
|
|
697
|
+
type: Type.Literal("object"),
|
|
698
|
+
properties: Type.Record(
|
|
699
|
+
Type.String(),
|
|
700
|
+
Type.Unknown({
|
|
701
|
+
description: "A nested Clairic field specification with the same keys as this object.",
|
|
702
|
+
}),
|
|
703
|
+
{ minProperties: 1 },
|
|
704
|
+
),
|
|
705
|
+
},
|
|
706
|
+
{ additionalProperties: false },
|
|
707
|
+
),
|
|
708
|
+
]),
|
|
709
|
+
),
|
|
710
|
+
max_items: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
711
|
+
min: Type.Optional(Type.Union([Type.Number(), Type.String()])),
|
|
712
|
+
max: Type.Optional(Type.Union([Type.Number(), Type.String()])),
|
|
713
|
+
step: Type.Optional(Type.Union([
|
|
714
|
+
Type.Number({ exclusiveMinimum: 0 }),
|
|
715
|
+
Type.Literal("minute"), Type.Literal("hour"), Type.Literal("day"),
|
|
716
|
+
Type.Literal("week"), Type.Literal("month"), Type.Literal("quarter"), Type.Literal("year"),
|
|
717
|
+
])),
|
|
718
|
+
scale: Type.Optional(Type.Union([Type.Literal("linear"), Type.Literal("log")])),
|
|
719
|
+
horizon: Type.Optional(Type.Integer({ minimum: 1, maximum: 64 })),
|
|
720
|
+
interval: Type.Optional(Type.Union([
|
|
721
|
+
Type.Literal("step"), Type.Literal("minute"), Type.Literal("hour"),
|
|
722
|
+
Type.Literal("day"), Type.Literal("week"), Type.Literal("month"),
|
|
723
|
+
Type.Literal("quarter"), Type.Literal("year"),
|
|
724
|
+
])),
|
|
725
|
+
},
|
|
726
|
+
{ additionalProperties: false },
|
|
727
|
+
);
|
|
728
|
+
|
|
729
|
+
export const classifyExtractParameters = Type.Object(
|
|
730
|
+
{
|
|
731
|
+
state: Type.Optional(classifyParameters.properties.state),
|
|
732
|
+
fields: Type.Record(
|
|
733
|
+
Type.String({ pattern: "^[A-Za-z_][A-Za-z0-9_.-]{0,63}$" }),
|
|
734
|
+
extractionFieldDefinition,
|
|
735
|
+
{ minProperties: 1 },
|
|
736
|
+
),
|
|
737
|
+
images: Type.Optional(
|
|
738
|
+
Type.Array(
|
|
739
|
+
Type.Union([
|
|
740
|
+
Type.String({ minLength: 1, maxLength: 4096 }),
|
|
741
|
+
Type.Object(
|
|
742
|
+
{
|
|
743
|
+
path: Type.String({ minLength: 1, maxLength: 4096 }),
|
|
744
|
+
rotation: Type.Optional(Type.Union([
|
|
745
|
+
Type.Literal(0), Type.Literal(90), Type.Literal(180), Type.Literal(270),
|
|
746
|
+
])),
|
|
747
|
+
},
|
|
748
|
+
{ additionalProperties: false },
|
|
749
|
+
),
|
|
750
|
+
]),
|
|
751
|
+
{ maxItems: 4 },
|
|
752
|
+
),
|
|
753
|
+
),
|
|
754
|
+
documents: Type.Optional(Type.Array(Type.String({ minLength: 1, maxLength: 4096 }), { maxItems: 4 })),
|
|
755
|
+
referenceDate: Type.Optional(Type.String({ pattern: "^\\d{4}-\\d{2}-\\d{2}$" })),
|
|
756
|
+
options: Type.Optional(
|
|
757
|
+
Type.Object(
|
|
758
|
+
{
|
|
759
|
+
includeQuantiles: Type.Optional(Type.Boolean()),
|
|
760
|
+
returnStateText: Type.Optional(Type.Boolean()),
|
|
761
|
+
},
|
|
762
|
+
{ additionalProperties: false },
|
|
763
|
+
),
|
|
764
|
+
),
|
|
765
|
+
},
|
|
766
|
+
{ additionalProperties: false },
|
|
767
|
+
);
|
|
768
|
+
|
|
769
|
+
export const classifyExtractOutput = Type.Object({
|
|
770
|
+
provider: Type.String(),
|
|
771
|
+
model: Type.String(),
|
|
772
|
+
answers: Type.Record(
|
|
773
|
+
Type.String(),
|
|
774
|
+
Type.Object(
|
|
775
|
+
{ type: Type.String(), value: Type.Unknown() },
|
|
776
|
+
{ additionalProperties: true },
|
|
777
|
+
),
|
|
778
|
+
),
|
|
779
|
+
truncated: Type.Boolean(),
|
|
780
|
+
usage: Type.Optional(classifyOutput.properties.usage),
|
|
781
|
+
cost: classifyOutput.properties.cost,
|
|
782
|
+
providerCost: classifyOutput.properties.providerCost,
|
|
783
|
+
requestId: Type.Optional(Type.String()),
|
|
784
|
+
stateText: Type.Optional(Type.String()),
|
|
785
|
+
});
|