@anvia/core 0.3.0 → 0.4.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.
Files changed (74) hide show
  1. package/README.md +7 -8
  2. package/dist/agent/index.d.ts +9 -9
  3. package/dist/agent/index.js +7 -16
  4. package/dist/{agent-D_jXqPAZ.d.ts → agent-0UeJ9Rad.d.ts} +5 -5
  5. package/dist/audio-generation/index.d.ts +1 -1
  6. package/dist/audio-generation/index.js +37 -4
  7. package/dist/audio-generation/index.js.map +1 -1
  8. package/dist/chunk-6U6PZ5MD.js +197 -0
  9. package/dist/chunk-6U6PZ5MD.js.map +1 -0
  10. package/dist/{chunk-QRZ2HPUX.js → chunk-PP4VIN3Y.js} +2 -2
  11. package/dist/chunk-PP4VIN3Y.js.map +1 -0
  12. package/dist/{chunk-GSFQZYS7.js → chunk-TP32W7XT.js} +69 -255
  13. package/dist/chunk-TP32W7XT.js.map +1 -0
  14. package/dist/completion/index.d.ts +2 -2
  15. package/dist/evals/index.d.ts +5 -4
  16. package/dist/evals/index.js +294 -13
  17. package/dist/evals/index.js.map +1 -1
  18. package/dist/extractor/index.d.ts +6 -5
  19. package/dist/extractor/index.js +5 -4
  20. package/dist/image-generation/index.d.ts +1 -1
  21. package/dist/image-generation/index.js +37 -4
  22. package/dist/image-generation/index.js.map +1 -1
  23. package/dist/index.d.ts +12 -21
  24. package/dist/index.js +10 -157
  25. package/dist/internal/agent.d.ts +8 -0
  26. package/dist/internal/agent.js +17 -0
  27. package/dist/internal/agent.js.map +1 -0
  28. package/dist/loaders/index.d.ts +1 -1
  29. package/dist/loaders/index.js +3 -2
  30. package/dist/loaders/index.js.map +1 -1
  31. package/dist/mcp/index.d.ts +4 -4
  32. package/dist/mcp/index.js +140 -4
  33. package/dist/mcp/index.js.map +1 -1
  34. package/dist/memory/index.d.ts +1 -1
  35. package/dist/{middleware-2FR89muX.d.ts → middleware-BQ7fkEEe.d.ts} +3 -6
  36. package/dist/model-listing/index.js +13 -3
  37. package/dist/model-listing/index.js.map +1 -1
  38. package/dist/observability/index.d.ts +2 -2
  39. package/dist/observability/index.js +4 -3
  40. package/dist/observability/index.js.map +1 -1
  41. package/dist/pipeline/index.d.ts +6 -5
  42. package/dist/pipeline/index.js +339 -4
  43. package/dist/pipeline/index.js.map +1 -1
  44. package/dist/skills/index.d.ts +4 -4
  45. package/dist/think-tool-ByArsrxe.d.ts +26 -0
  46. package/dist/tool/index.d.ts +7 -28
  47. package/dist/{tool-ClZYES-Z.d.ts → tool-C3ciF-VG.d.ts} +2 -2
  48. package/dist/transcription/index.d.ts +1 -1
  49. package/dist/transcription/index.js +55 -4
  50. package/dist/transcription/index.js.map +1 -1
  51. package/dist/{types-BM8-Y8Hy.d.ts → types-C54aNoCd.d.ts} +1 -1
  52. package/dist/{types-B0iXLkqi.d.ts → types-T9rlOIUc.d.ts} +2 -2
  53. package/dist/{types-fLi8uM5R.d.ts → types-UhcgW8Fo.d.ts} +3 -3
  54. package/dist/vector-store/index.d.ts +2 -2
  55. package/dist/zod-schema-C7F4clpm.d.ts +5 -0
  56. package/package.json +8 -4
  57. package/dist/chunk-6JCCM2K4.js +0 -304
  58. package/dist/chunk-6JCCM2K4.js.map +0 -1
  59. package/dist/chunk-7QI6ZAFI.js +0 -61
  60. package/dist/chunk-7QI6ZAFI.js.map +0 -1
  61. package/dist/chunk-B24Q2ZYM.js +0 -43
  62. package/dist/chunk-B24Q2ZYM.js.map +0 -1
  63. package/dist/chunk-GSFQZYS7.js.map +0 -1
  64. package/dist/chunk-I77SDTFE.js +0 -43
  65. package/dist/chunk-I77SDTFE.js.map +0 -1
  66. package/dist/chunk-NYUOBGVI.js +0 -146
  67. package/dist/chunk-NYUOBGVI.js.map +0 -1
  68. package/dist/chunk-QRZ2HPUX.js.map +0 -1
  69. package/dist/chunk-RTOGIJH2.js +0 -345
  70. package/dist/chunk-RTOGIJH2.js.map +0 -1
  71. package/dist/chunk-WJT22R3T.js +0 -18
  72. package/dist/chunk-WJT22R3T.js.map +0 -1
  73. package/dist/chunk-ZSYIQYTV.js +0 -9
  74. package/dist/chunk-ZSYIQYTV.js.map +0 -1
@@ -1,7 +1,342 @@
1
- import {
2
- Pipeline,
3
- PipelineBuilder
4
- } from "../chunk-RTOGIJH2.js";
1
+ // src/pipeline/index.ts
2
+ var Pipeline = class {
3
+ constructor(executor, pipelineGraph = initialGraph({})) {
4
+ this.executor = executor;
5
+ this.pipelineGraph = pipelineGraph;
6
+ this.id = pipelineGraph.id;
7
+ this.name = pipelineGraph.name;
8
+ this.description = pipelineGraph.description;
9
+ this.metadata = pipelineGraph.metadata;
10
+ }
11
+ executor;
12
+ pipelineGraph;
13
+ id;
14
+ name;
15
+ description;
16
+ metadata;
17
+ /** Run one input through the built pipeline and return the final stage output. */
18
+ async run(input, options = {}) {
19
+ return await this.executor(input, { observer: options.observer });
20
+ }
21
+ /** Run many inputs through the same pipeline with bounded concurrency. */
22
+ async batch(inputs, options) {
23
+ return mapWithConcurrency([...inputs], options.concurrency, (input) => this.run(input));
24
+ }
25
+ graph() {
26
+ return cloneGraph(this.pipelineGraph);
27
+ }
28
+ };
29
+ var PipelineBuilder = class _PipelineBuilder {
30
+ executor;
31
+ state;
32
+ constructor(metadataOrExecutor, state) {
33
+ if (state !== void 0) {
34
+ this.executor = metadataOrExecutor;
35
+ this.state = state;
36
+ return;
37
+ }
38
+ if (typeof metadataOrExecutor === "function") {
39
+ const executor = metadataOrExecutor;
40
+ this.executor = ((input) => executor(input));
41
+ this.state = initialBuilderState({});
42
+ return;
43
+ }
44
+ this.executor = identity;
45
+ this.state = initialBuilderState(metadataOrExecutor ?? {});
46
+ }
47
+ /** Add a synchronous or asynchronous transform stage. */
48
+ step(fn, metadata) {
49
+ const next = appendNode(
50
+ this.state,
51
+ "step",
52
+ metadata?.name ?? nextStageLabel(this.state, "Step"),
53
+ {
54
+ description: metadata?.description,
55
+ metadata: metadata?.metadata,
56
+ preferredId: metadata?.id
57
+ }
58
+ );
59
+ return new _PipelineBuilder(
60
+ async (input, context) => {
61
+ const value = await this.runStep(input, context);
62
+ const result = await runNode(context, next.node, () => fn(value));
63
+ return result;
64
+ },
65
+ next.state
66
+ );
67
+ }
68
+ /** Compose another pipeline operation after the current stage. */
69
+ use(op, metadata) {
70
+ const nested = op instanceof Pipeline ? op : void 0;
71
+ const next = appendNode(
72
+ this.state,
73
+ nested === void 0 ? "step" : "pipeline",
74
+ metadata?.name ?? nested?.name ?? nested?.id ?? nextStageLabel(this.state, nested === void 0 ? "Operation" : "Pipeline"),
75
+ {
76
+ description: metadata?.description ?? nested?.description,
77
+ metadata: metadata?.metadata ?? nested?.metadata,
78
+ preferredId: metadata?.id,
79
+ pipelineId: nested?.id
80
+ }
81
+ );
82
+ return new _PipelineBuilder(
83
+ async (input, context) => {
84
+ const value = await this.runStep(input, context);
85
+ const result = await runNode(context, next.node, () => op.run(value));
86
+ return result;
87
+ },
88
+ next.state
89
+ );
90
+ }
91
+ /** Run named branch operations concurrently from the current value. */
92
+ parallel(branches, metadata) {
93
+ const parallel = appendNode(
94
+ this.state,
95
+ "parallel",
96
+ metadata?.name ?? `${Object.keys(branches).length} parallel branches`,
97
+ {
98
+ description: metadata?.description,
99
+ metadata: metadata?.metadata,
100
+ preferredId: metadata?.id
101
+ }
102
+ );
103
+ let nextState = parallel.state;
104
+ const branchNodes = {};
105
+ for (const key of Object.keys(branches)) {
106
+ const branch = appendChildNode(nextState, parallel.node.id, "branch", key, {
107
+ branchKey: key
108
+ });
109
+ nextState = branch.state;
110
+ branchNodes[key] = branch.node;
111
+ }
112
+ nextState = withTerminalNodes(
113
+ nextState,
114
+ Object.values(branchNodes).map((node) => node.id)
115
+ );
116
+ return new _PipelineBuilder(async (input, context) => {
117
+ const value = await this.runStep(input, context);
118
+ const entries = await runNode(
119
+ context,
120
+ parallel.node,
121
+ () => Promise.all(
122
+ Object.entries(branches).map(async ([key, op]) => {
123
+ const node = branchNodes[key];
124
+ const output = await runNode(context, node, () => op.run(value));
125
+ return [key, output];
126
+ })
127
+ )
128
+ );
129
+ return Object.fromEntries(entries);
130
+ }, nextState);
131
+ }
132
+ /** Send the current value to an agent as text and continue with the agent output. */
133
+ prompt(agent, metadata) {
134
+ const next = appendNode(this.state, "agent", metadata?.name ?? agent.name ?? agent.id, {
135
+ description: metadata?.description ?? agent.description,
136
+ metadata: metadata?.metadata,
137
+ preferredId: metadata?.id,
138
+ agentId: agent.id,
139
+ agentName: agent.name
140
+ });
141
+ return new _PipelineBuilder(async (input, context) => {
142
+ const value = await this.runStep(input, context);
143
+ return runNode(context, next.node, async () => {
144
+ const response = await agent.prompt(String(value)).send();
145
+ return response.output;
146
+ });
147
+ }, next.state);
148
+ }
149
+ /** Send the current value to an extractor as text and continue with typed schema data. */
150
+ extract(extractor, metadata) {
151
+ const next = appendNode(
152
+ this.state,
153
+ "extractor",
154
+ metadata?.name ?? nextStageLabel(this.state, "Extractor"),
155
+ {
156
+ description: metadata?.description,
157
+ metadata: metadata?.metadata,
158
+ preferredId: metadata?.id
159
+ }
160
+ );
161
+ return new _PipelineBuilder(async (input, context) => {
162
+ const value = await this.runStep(input, context);
163
+ return runNode(context, next.node, () => extractor.extract(String(value)));
164
+ }, next.state);
165
+ }
166
+ /** Finish the builder and return a runnable pipeline. */
167
+ build() {
168
+ const graph = withOutputNode(this.state);
169
+ return new Pipeline(
170
+ (input, context) => this.runStep(input, context),
171
+ graph
172
+ );
173
+ }
174
+ async runStep(input, context) {
175
+ return await this.executor(input, context);
176
+ }
177
+ };
178
+ function initialBuilderState(metadata) {
179
+ return {
180
+ graph: initialGraph(metadata),
181
+ terminalNodeId: "input",
182
+ terminalNodeIds: ["input"],
183
+ nextNodeIndex: 1,
184
+ nextEdgeIndex: 1
185
+ };
186
+ }
187
+ function initialGraph(metadata) {
188
+ const id = normalizeId(metadata.id ?? "pipeline");
189
+ return {
190
+ id,
191
+ ...metadata.name === void 0 ? {} : { name: metadata.name },
192
+ ...metadata.description === void 0 ? {} : { description: metadata.description },
193
+ ...metadata.metadata === void 0 ? {} : { metadata: metadata.metadata },
194
+ nodes: [{ id: "input", kind: "input", label: "Input" }],
195
+ edges: []
196
+ };
197
+ }
198
+ function appendNode(state, kind, label, options = {}) {
199
+ const node = graphNode(kind, label, state.nextNodeIndex, {
200
+ ...options,
201
+ existingIds: new Set(state.graph.nodes.map((item) => item.id))
202
+ });
203
+ return {
204
+ node,
205
+ state: appendGraphNode(state, node, activeTerminalNodeIds(state), [node.id])
206
+ };
207
+ }
208
+ function appendChildNode(state, parentId, kind, label, options = {}) {
209
+ const node = graphNode(kind, label, state.nextNodeIndex, {
210
+ ...options,
211
+ existingIds: new Set(state.graph.nodes.map((item) => item.id))
212
+ });
213
+ return {
214
+ node,
215
+ state: appendGraphNode(state, node, [parentId], activeTerminalNodeIds(state))
216
+ };
217
+ }
218
+ function appendGraphNode(state, node, sourceIds, terminalNodeIds) {
219
+ const edges = sourceIds.map((sourceId, index) => ({
220
+ id: `edge_${state.nextEdgeIndex + index}`,
221
+ source: sourceId,
222
+ target: node.id
223
+ }));
224
+ const terminalNodeId = terminalNodeIds.at(-1) ?? state.terminalNodeId;
225
+ return {
226
+ graph: {
227
+ ...state.graph,
228
+ nodes: [...state.graph.nodes, node],
229
+ edges: [...state.graph.edges, ...edges]
230
+ },
231
+ terminalNodeId,
232
+ terminalNodeIds,
233
+ nextNodeIndex: state.nextNodeIndex + 1,
234
+ nextEdgeIndex: state.nextEdgeIndex + edges.length
235
+ };
236
+ }
237
+ function activeTerminalNodeIds(state) {
238
+ return state.terminalNodeIds.length > 0 ? state.terminalNodeIds : [state.terminalNodeId];
239
+ }
240
+ function withTerminalNodes(state, terminalNodeIds) {
241
+ return {
242
+ ...state,
243
+ terminalNodeId: terminalNodeIds.at(-1) ?? state.terminalNodeId,
244
+ terminalNodeIds
245
+ };
246
+ }
247
+ function graphNode(kind, label, index, options = {}) {
248
+ const id = uniqueGraphNodeId(
249
+ normalizeId(options.preferredId ?? `${kind}_${index}`),
250
+ options.existingIds ?? /* @__PURE__ */ new Set()
251
+ );
252
+ return {
253
+ id,
254
+ kind,
255
+ label,
256
+ ...options.description === void 0 ? {} : { description: options.description },
257
+ ...options.metadata === void 0 ? {} : { metadata: options.metadata },
258
+ ...options.agentId === void 0 ? {} : { agentId: options.agentId },
259
+ ...options.agentName === void 0 ? {} : { agentName: options.agentName },
260
+ ...options.pipelineId === void 0 ? {} : { pipelineId: options.pipelineId },
261
+ ...options.branchKey === void 0 ? {} : { branchKey: options.branchKey }
262
+ };
263
+ }
264
+ function withOutputNode(state) {
265
+ const graph = cloneGraph(state.graph);
266
+ if (graph.nodes.some((node) => node.id === "output")) {
267
+ return graph;
268
+ }
269
+ graph.nodes.push({ id: "output", kind: "output", label: "Output" });
270
+ graph.edges.push(
271
+ ...activeTerminalNodeIds(state).map((sourceId, index) => ({
272
+ id: `edge_${state.nextEdgeIndex + index}`,
273
+ source: sourceId,
274
+ target: "output"
275
+ }))
276
+ );
277
+ return graph;
278
+ }
279
+ async function runNode(context, node, fn) {
280
+ const startedAt = Date.now();
281
+ await context.observer?.onEvent({ type: "stage_started", node });
282
+ try {
283
+ const output = await fn();
284
+ await context.observer?.onEvent({
285
+ type: "stage_completed",
286
+ node,
287
+ durationMs: Date.now() - startedAt
288
+ });
289
+ return output;
290
+ } catch (error) {
291
+ await context.observer?.onEvent({
292
+ type: "stage_failed",
293
+ node,
294
+ durationMs: Date.now() - startedAt,
295
+ error
296
+ });
297
+ throw error;
298
+ }
299
+ }
300
+ function nextStageLabel(state, prefix) {
301
+ return `${prefix} ${state.nextNodeIndex}`;
302
+ }
303
+ function cloneGraph(graph) {
304
+ return {
305
+ ...graph,
306
+ nodes: graph.nodes.map((node) => ({ ...node })),
307
+ edges: graph.edges.map((edge) => ({ ...edge }))
308
+ };
309
+ }
310
+ function normalizeId(value) {
311
+ const normalized = value.trim().toLowerCase().replace(/[^a-z0-9_-]+/g, "_").replace(/^_+|_+$/g, "");
312
+ return normalized.length === 0 ? "pipeline" : normalized;
313
+ }
314
+ function uniqueGraphNodeId(baseId, existingIds) {
315
+ let id = baseId;
316
+ let suffix = 2;
317
+ while (existingIds.has(id)) {
318
+ id = `${baseId}_${suffix}`;
319
+ suffix += 1;
320
+ }
321
+ return id;
322
+ }
323
+ function identity(input) {
324
+ return input;
325
+ }
326
+ async function mapWithConcurrency(inputs, concurrency, fn) {
327
+ const limit = Math.max(1, Math.trunc(concurrency));
328
+ const results = new Array(inputs.length);
329
+ let nextIndex = 0;
330
+ async function worker() {
331
+ while (nextIndex < inputs.length) {
332
+ const index = nextIndex;
333
+ nextIndex += 1;
334
+ results[index] = await fn(inputs[index]);
335
+ }
336
+ }
337
+ await Promise.all(Array.from({ length: Math.min(limit, inputs.length) }, () => worker()));
338
+ return results;
339
+ }
5
340
  export {
6
341
  Pipeline,
7
342
  PipelineBuilder
@@ -1 +1 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
1
+ {"version":3,"sources":["../../src/pipeline/index.ts"],"sourcesContent":["import type { Agent } from \"../agent/agent\";\nimport type { CompletionModel, JsonObject } from \"../completion\";\nimport type { Extractor } from \"../extractor\";\n\n/** Minimal interface for anything that can run as a pipeline stage. */\nexport interface PipelineOp<Input = unknown, Output = unknown> {\n run(input: Input): Output | Promise<Output>;\n}\n\nexport interface PipelineBatchOptions {\n /** Maximum number of inputs processed at the same time. */\n concurrency: number;\n}\n\ntype AwaitedOutput<Op> = Op extends PipelineOp<unknown, infer Output> ? Awaited<Output> : never;\n\ntype ParallelOutput<Branches extends Record<string, PipelineOp<unknown, unknown>>> = {\n [Key in keyof Branches]: AwaitedOutput<Branches[Key]>;\n};\n\nexport type PipelineMetadata = {\n id?: string | undefined;\n name?: string | undefined;\n description?: string | undefined;\n metadata?: JsonObject | undefined;\n};\n\nexport type PipelineStageMetadata = {\n id?: string | undefined;\n name?: string | undefined;\n description?: string | undefined;\n metadata?: JsonObject | undefined;\n};\n\nexport type PipelineStageKind =\n | \"input\"\n | \"step\"\n | \"pipeline\"\n | \"parallel\"\n | \"branch\"\n | \"agent\"\n | \"extractor\"\n | \"output\";\n\nexport type PipelineGraphNode = {\n id: string;\n kind: PipelineStageKind;\n label: string;\n description?: string | undefined;\n metadata?: JsonObject | undefined;\n agentId?: string | undefined;\n agentName?: string | undefined;\n pipelineId?: string | undefined;\n branchKey?: string | undefined;\n};\n\nexport type PipelineGraphEdge = {\n id: string;\n source: string;\n target: string;\n label?: string | undefined;\n};\n\nexport type PipelineGraph = PipelineMetadata & {\n id: string;\n nodes: PipelineGraphNode[];\n edges: PipelineGraphEdge[];\n};\n\nexport type PipelineRunEvent =\n | {\n type: \"stage_started\";\n node: PipelineGraphNode;\n }\n | {\n type: \"stage_completed\";\n node: PipelineGraphNode;\n durationMs: number;\n }\n | {\n type: \"stage_failed\";\n node: PipelineGraphNode;\n durationMs: number;\n error: unknown;\n };\n\nexport type PipelineRunObserver = {\n onEvent(event: PipelineRunEvent): void | Promise<void>;\n};\n\nexport type PipelineRunOptions = {\n observer?: PipelineRunObserver | undefined;\n};\n\ntype PipelineRunContext = {\n observer?: PipelineRunObserver | undefined;\n};\n\ntype PipelineExecutor<Input, Output> = (\n input: Input,\n context: PipelineRunContext,\n) => Output | Promise<Output>;\n\ntype PipelineBuilderState = {\n graph: PipelineGraph;\n terminalNodeId: string;\n terminalNodeIds: string[];\n nextNodeIndex: number;\n nextEdgeIndex: number;\n};\n\n/** Runnable pipeline returned by `PipelineBuilder.build()`. */\nexport class Pipeline<Input, Output> implements PipelineOp<Input, Awaited<Output>> {\n readonly id: string;\n readonly name: string | undefined;\n readonly description: string | undefined;\n readonly metadata: JsonObject | undefined;\n\n constructor(\n private readonly executor: PipelineExecutor<Input, Output>,\n private readonly pipelineGraph: PipelineGraph = initialGraph({}),\n ) {\n this.id = pipelineGraph.id;\n this.name = pipelineGraph.name;\n this.description = pipelineGraph.description;\n this.metadata = pipelineGraph.metadata;\n }\n\n /** Run one input through the built pipeline and return the final stage output. */\n async run(input: Input, options: PipelineRunOptions = {}): Promise<Awaited<Output>> {\n return (await this.executor(input, { observer: options.observer })) as Awaited<Output>;\n }\n\n /** Run many inputs through the same pipeline with bounded concurrency. */\n async batch<I extends Iterable<Input>>(\n inputs: I,\n options: PipelineBatchOptions,\n ): Promise<Array<Awaited<Output>>> {\n return mapWithConcurrency([...inputs], options.concurrency, (input) => this.run(input));\n }\n\n graph(): PipelineGraph {\n return cloneGraph(this.pipelineGraph);\n }\n}\n\n/** Builds a typed pipeline from an original input type to an inferred output type. */\nexport class PipelineBuilder<Input, Output = Input> {\n private readonly executor: PipelineExecutor<Input, Output>;\n private readonly state: PipelineBuilderState;\n\n constructor();\n constructor(metadata: PipelineMetadata);\n constructor(executor: (input: Input) => Output | Promise<Output>);\n constructor(executor: PipelineExecutor<Input, Output>, state: PipelineBuilderState);\n constructor(\n metadataOrExecutor?:\n | PipelineMetadata\n | ((input: Input) => Output | Promise<Output>)\n | PipelineExecutor<Input, Output>,\n state?: PipelineBuilderState,\n ) {\n if (state !== undefined) {\n this.executor = metadataOrExecutor as PipelineExecutor<Input, Output>;\n this.state = state;\n return;\n }\n\n if (typeof metadataOrExecutor === \"function\") {\n const executor = metadataOrExecutor as (input: Input) => Output | Promise<Output>;\n this.executor = ((input) => executor(input)) as PipelineExecutor<Input, Output>;\n this.state = initialBuilderState({});\n return;\n }\n\n this.executor = identity as PipelineExecutor<Input, Output>;\n this.state = initialBuilderState(metadataOrExecutor ?? {});\n }\n\n /** Add a synchronous or asynchronous transform stage. */\n step<Next>(\n fn: (input: Awaited<Output>) => Next | Promise<Next>,\n metadata?: PipelineStageMetadata,\n ): PipelineBuilder<Input, Awaited<Next>> {\n const next = appendNode(\n this.state,\n \"step\",\n metadata?.name ?? nextStageLabel(this.state, \"Step\"),\n {\n description: metadata?.description,\n metadata: metadata?.metadata,\n preferredId: metadata?.id,\n },\n );\n return new PipelineBuilder<Input, Awaited<Next>>(\n async (input, context): Promise<Awaited<Next>> => {\n const value = await this.runStep(input, context);\n const result = await runNode(context, next.node, () => fn(value));\n return result as Awaited<Next>;\n },\n next.state,\n );\n }\n\n /** Compose another pipeline operation after the current stage. */\n use<Next>(\n op: PipelineOp<Awaited<Output>, Next>,\n metadata?: PipelineStageMetadata,\n ): PipelineBuilder<Input, Awaited<Next>> {\n const nested = op instanceof Pipeline ? op : undefined;\n const next = appendNode(\n this.state,\n nested === undefined ? \"step\" : \"pipeline\",\n metadata?.name ??\n nested?.name ??\n nested?.id ??\n nextStageLabel(this.state, nested === undefined ? \"Operation\" : \"Pipeline\"),\n {\n description: metadata?.description ?? nested?.description,\n metadata: metadata?.metadata ?? nested?.metadata,\n preferredId: metadata?.id,\n pipelineId: nested?.id,\n },\n );\n return new PipelineBuilder<Input, Awaited<Next>>(\n async (input, context): Promise<Awaited<Next>> => {\n const value = await this.runStep(input, context);\n const result = await runNode(context, next.node, () => op.run(value));\n return result as Awaited<Next>;\n },\n next.state,\n );\n }\n\n /** Run named branch operations concurrently from the current value. */\n parallel<Branches extends Record<string, PipelineOp<Awaited<Output>, unknown>>>(\n branches: Branches,\n metadata?: PipelineStageMetadata,\n ): PipelineBuilder<Input, ParallelOutput<Branches>> {\n const parallel = appendNode(\n this.state,\n \"parallel\",\n metadata?.name ?? `${Object.keys(branches).length} parallel branches`,\n {\n description: metadata?.description,\n metadata: metadata?.metadata,\n preferredId: metadata?.id,\n },\n );\n let nextState = parallel.state;\n const branchNodes: Record<string, PipelineGraphNode> = {};\n for (const key of Object.keys(branches)) {\n const branch = appendChildNode(nextState, parallel.node.id, \"branch\", key, {\n branchKey: key,\n });\n nextState = branch.state;\n branchNodes[key] = branch.node;\n }\n nextState = withTerminalNodes(\n nextState,\n Object.values(branchNodes).map((node) => node.id),\n );\n\n return new PipelineBuilder<Input, ParallelOutput<Branches>>(async (input, context) => {\n const value = await this.runStep(input, context);\n const entries = await runNode(context, parallel.node, () =>\n Promise.all(\n Object.entries(branches).map(async ([key, op]) => {\n const node = branchNodes[key] as PipelineGraphNode;\n const output = await runNode(context, node, () => op.run(value));\n return [key, output] as const;\n }),\n ),\n );\n return Object.fromEntries(entries) as ParallelOutput<Branches>;\n }, nextState);\n }\n\n /** Send the current value to an agent as text and continue with the agent output. */\n prompt(\n agent: Agent<CompletionModel>,\n metadata?: PipelineStageMetadata,\n ): PipelineBuilder<Input, string> {\n const next = appendNode(this.state, \"agent\", metadata?.name ?? agent.name ?? agent.id, {\n description: metadata?.description ?? agent.description,\n metadata: metadata?.metadata,\n preferredId: metadata?.id,\n agentId: agent.id,\n agentName: agent.name,\n });\n return new PipelineBuilder<Input, string>(async (input, context) => {\n const value = await this.runStep(input, context);\n return runNode(context, next.node, async () => {\n const response = await agent.prompt(String(value)).send();\n return response.output;\n });\n }, next.state);\n }\n\n /** Send the current value to an extractor as text and continue with typed schema data. */\n extract<T>(\n extractor: Extractor<T, CompletionModel>,\n metadata?: PipelineStageMetadata,\n ): PipelineBuilder<Input, T> {\n const next = appendNode(\n this.state,\n \"extractor\",\n metadata?.name ?? nextStageLabel(this.state, \"Extractor\"),\n {\n description: metadata?.description,\n metadata: metadata?.metadata,\n preferredId: metadata?.id,\n },\n );\n return new PipelineBuilder<Input, T>(async (input, context) => {\n const value = await this.runStep(input, context);\n return runNode(context, next.node, () => extractor.extract(String(value)));\n }, next.state);\n }\n\n /** Finish the builder and return a runnable pipeline. */\n build(): Pipeline<Input, Awaited<Output>> {\n const graph = withOutputNode(this.state);\n return new Pipeline<Input, Awaited<Output>>(\n (input, context) => this.runStep(input, context) as Promise<Awaited<Output>>,\n graph,\n );\n }\n\n private async runStep(input: Input, context: PipelineRunContext): Promise<Awaited<Output>> {\n return (await this.executor(input, context)) as Awaited<Output>;\n }\n}\n\nfunction initialBuilderState(metadata: PipelineMetadata): PipelineBuilderState {\n return {\n graph: initialGraph(metadata),\n terminalNodeId: \"input\",\n terminalNodeIds: [\"input\"],\n nextNodeIndex: 1,\n nextEdgeIndex: 1,\n };\n}\n\nfunction initialGraph(metadata: PipelineMetadata): PipelineGraph {\n const id = normalizeId(metadata.id ?? \"pipeline\");\n return {\n id,\n ...(metadata.name === undefined ? {} : { name: metadata.name }),\n ...(metadata.description === undefined ? {} : { description: metadata.description }),\n ...(metadata.metadata === undefined ? {} : { metadata: metadata.metadata }),\n nodes: [{ id: \"input\", kind: \"input\", label: \"Input\" }],\n edges: [],\n };\n}\n\nfunction appendNode(\n state: PipelineBuilderState,\n kind: PipelineStageKind,\n label: string,\n options: {\n description?: string | undefined;\n metadata?: JsonObject | undefined;\n preferredId?: string | undefined;\n agentId?: string | undefined;\n agentName?: string | undefined;\n pipelineId?: string | undefined;\n } = {},\n): { state: PipelineBuilderState; node: PipelineGraphNode } {\n const node = graphNode(kind, label, state.nextNodeIndex, {\n ...options,\n existingIds: new Set(state.graph.nodes.map((item) => item.id)),\n });\n return {\n node,\n state: appendGraphNode(state, node, activeTerminalNodeIds(state), [node.id]),\n };\n}\n\nfunction appendChildNode(\n state: PipelineBuilderState,\n parentId: string,\n kind: PipelineStageKind,\n label: string,\n options: {\n branchKey?: string | undefined;\n } = {},\n): { state: PipelineBuilderState; node: PipelineGraphNode } {\n const node = graphNode(kind, label, state.nextNodeIndex, {\n ...options,\n existingIds: new Set(state.graph.nodes.map((item) => item.id)),\n });\n return {\n node,\n state: appendGraphNode(state, node, [parentId], activeTerminalNodeIds(state)),\n };\n}\n\nfunction appendGraphNode(\n state: PipelineBuilderState,\n node: PipelineGraphNode,\n sourceIds: string[],\n terminalNodeIds: string[],\n): PipelineBuilderState {\n const edges = sourceIds.map((sourceId, index) => ({\n id: `edge_${state.nextEdgeIndex + index}`,\n source: sourceId,\n target: node.id,\n }));\n const terminalNodeId = terminalNodeIds.at(-1) ?? state.terminalNodeId;\n return {\n graph: {\n ...state.graph,\n nodes: [...state.graph.nodes, node],\n edges: [...state.graph.edges, ...edges],\n },\n terminalNodeId,\n terminalNodeIds,\n nextNodeIndex: state.nextNodeIndex + 1,\n nextEdgeIndex: state.nextEdgeIndex + edges.length,\n };\n}\n\nfunction activeTerminalNodeIds(state: PipelineBuilderState): string[] {\n return state.terminalNodeIds.length > 0 ? state.terminalNodeIds : [state.terminalNodeId];\n}\n\nfunction withTerminalNodes(\n state: PipelineBuilderState,\n terminalNodeIds: string[],\n): PipelineBuilderState {\n return {\n ...state,\n terminalNodeId: terminalNodeIds.at(-1) ?? state.terminalNodeId,\n terminalNodeIds,\n };\n}\n\nfunction graphNode(\n kind: PipelineStageKind,\n label: string,\n index: number,\n options: {\n description?: string | undefined;\n metadata?: JsonObject | undefined;\n preferredId?: string | undefined;\n agentId?: string | undefined;\n agentName?: string | undefined;\n pipelineId?: string | undefined;\n branchKey?: string | undefined;\n existingIds?: Set<string> | undefined;\n } = {},\n): PipelineGraphNode {\n const id = uniqueGraphNodeId(\n normalizeId(options.preferredId ?? `${kind}_${index}`),\n options.existingIds ?? new Set(),\n );\n return {\n id,\n kind,\n label,\n ...(options.description === undefined ? {} : { description: options.description }),\n ...(options.metadata === undefined ? {} : { metadata: options.metadata }),\n ...(options.agentId === undefined ? {} : { agentId: options.agentId }),\n ...(options.agentName === undefined ? {} : { agentName: options.agentName }),\n ...(options.pipelineId === undefined ? {} : { pipelineId: options.pipelineId }),\n ...(options.branchKey === undefined ? {} : { branchKey: options.branchKey }),\n };\n}\n\nfunction withOutputNode(state: PipelineBuilderState): PipelineGraph {\n const graph = cloneGraph(state.graph);\n if (graph.nodes.some((node) => node.id === \"output\")) {\n return graph;\n }\n graph.nodes.push({ id: \"output\", kind: \"output\", label: \"Output\" });\n graph.edges.push(\n ...activeTerminalNodeIds(state).map((sourceId, index) => ({\n id: `edge_${state.nextEdgeIndex + index}`,\n source: sourceId,\n target: \"output\",\n })),\n );\n return graph;\n}\n\nasync function runNode<Output>(\n context: PipelineRunContext,\n node: PipelineGraphNode,\n fn: () => Output | Promise<Output>,\n): Promise<Awaited<Output>> {\n const startedAt = Date.now();\n await context.observer?.onEvent({ type: \"stage_started\", node });\n try {\n const output = (await fn()) as Awaited<Output>;\n await context.observer?.onEvent({\n type: \"stage_completed\",\n node,\n durationMs: Date.now() - startedAt,\n });\n return output;\n } catch (error) {\n await context.observer?.onEvent({\n type: \"stage_failed\",\n node,\n durationMs: Date.now() - startedAt,\n error,\n });\n throw error;\n }\n}\n\nfunction nextStageLabel(state: PipelineBuilderState, prefix: string): string {\n return `${prefix} ${state.nextNodeIndex}`;\n}\n\nfunction cloneGraph(graph: PipelineGraph): PipelineGraph {\n return {\n ...graph,\n nodes: graph.nodes.map((node) => ({ ...node })),\n edges: graph.edges.map((edge) => ({ ...edge })),\n };\n}\n\nfunction normalizeId(value: string): string {\n const normalized = value\n .trim()\n .toLowerCase()\n .replace(/[^a-z0-9_-]+/g, \"_\")\n .replace(/^_+|_+$/g, \"\");\n return normalized.length === 0 ? \"pipeline\" : normalized;\n}\n\nfunction uniqueGraphNodeId(baseId: string, existingIds: Set<string>): string {\n let id = baseId;\n let suffix = 2;\n while (existingIds.has(id)) {\n id = `${baseId}_${suffix}`;\n suffix += 1;\n }\n return id;\n}\n\nfunction identity<T>(input: T): T {\n return input;\n}\n\nasync function mapWithConcurrency<Input, Output>(\n inputs: Input[],\n concurrency: number,\n fn: (input: Input) => Promise<Output>,\n): Promise<Output[]> {\n const limit = Math.max(1, Math.trunc(concurrency));\n const results = new Array<Output>(inputs.length);\n let nextIndex = 0;\n\n async function worker(): Promise<void> {\n while (nextIndex < inputs.length) {\n const index = nextIndex;\n nextIndex += 1;\n results[index] = await fn(inputs[index] as Input);\n }\n }\n\n await Promise.all(Array.from({ length: Math.min(limit, inputs.length) }, () => worker()));\n return results;\n}\n"],"mappings":";AAgHO,IAAM,WAAN,MAA4E;AAAA,EAMjF,YACmB,UACA,gBAA+B,aAAa,CAAC,CAAC,GAC/D;AAFiB;AACA;AAEjB,SAAK,KAAK,cAAc;AACxB,SAAK,OAAO,cAAc;AAC1B,SAAK,cAAc,cAAc;AACjC,SAAK,WAAW,cAAc;AAAA,EAChC;AAAA,EAPmB;AAAA,EACA;AAAA,EAPV;AAAA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I,GAAG,KAAK,MAAM,WAAW,CAAC;AACjD,QAAM,UAAU,IAAI,MAAc,OAAO,MAAM;AAC/C,MAAI,YAAY;AAEhB,iBAAe,SAAwB;AACrC,WAAO,YAAY,OAAO,QAAQ;AAChC,YAAM,QAAQ;AACd,mBAAa;AACb,cAAQ,KAAK,IAAI,MAAM,GAAG,OAAO,KAAK,CAAU;AAAA,IAClD;AAAA,EACF;AAEA,QAAM,QAAQ,IAAI,MAAM,KAAK,EAAE,QAAQ,KAAK,IAAI,OAAO,OAAO,MAAM,EAAE,GAAG,MAAM,OAAO,CAAC,CAAC;AACxF,SAAO;AACT;","names":[]}
@@ -1,7 +1,7 @@
1
- import { a as SkillLoader, b as SkillSet } from '../types-B0iXLkqi.js';
2
- export { S as Skill, c as SkillValidationError, d as SkillValidationIssue } from '../types-B0iXLkqi.js';
3
- import '../tool-ClZYES-Z.js';
4
- import '../types-BM8-Y8Hy.js';
1
+ import { b as SkillLoader, a as SkillSet } from '../types-T9rlOIUc.js';
2
+ export { c as Skill, S as SkillValidationError, d as SkillValidationIssue } from '../types-T9rlOIUc.js';
3
+ import '../tool-C3ciF-VG.js';
4
+ import '../types-C54aNoCd.js';
5
5
 
6
6
  declare function loadSkills(loaders: SkillLoader | SkillLoader[]): Promise<SkillSet>;
7
7
 
@@ -0,0 +1,26 @@
1
+ import { z } from 'zod';
2
+ import { Z as ZodSchema } from './zod-schema-C7F4clpm.js';
3
+ import { b as ToolApprovalPolicy, c as ToolCallContext, T as Tool } from './tool-C3ciF-VG.js';
4
+
5
+ type CreateToolOptions<InputSchema extends ZodSchema, OutputSchema extends ZodSchema | undefined = undefined, Output = unknown> = {
6
+ name: string;
7
+ description: string;
8
+ input: InputSchema;
9
+ output?: OutputSchema;
10
+ approval?: ToolApprovalPolicy<z.output<InputSchema>>;
11
+ execute(args: z.output<InputSchema>, context: ToolCallContext): OutputSchema extends ZodSchema ? z.input<OutputSchema> | Promise<z.input<OutputSchema>> : Output | Promise<Output>;
12
+ };
13
+ declare function createTool<InputSchema extends ZodSchema, Output = unknown>(options: CreateToolOptions<InputSchema, undefined, Output> & {
14
+ output?: undefined;
15
+ }): Tool<z.output<InputSchema>, Output>;
16
+ declare function createTool<InputSchema extends ZodSchema, OutputSchema extends ZodSchema>(options: CreateToolOptions<InputSchema, OutputSchema>): Tool<z.output<InputSchema>, z.output<OutputSchema>>;
17
+
18
+ type CreateThinkToolOptions = {
19
+ name?: string;
20
+ description?: string;
21
+ };
22
+ declare function createThinkTool(options?: CreateThinkToolOptions): Tool<{
23
+ thought: string;
24
+ }, string>;
25
+
26
+ export { type CreateToolOptions as C, createTool as a, type CreateThinkToolOptions as b, createThinkTool as c };
@@ -1,25 +1,12 @@
1
- import { z } from 'zod';
2
- import { Z as ZodSchema } from '../middleware-2FR89muX.js';
3
- export { D as DynamicToolIndex, E as EmbedToolsOptions, T as ToolMiddleware, a as ToolResultMiddlewareArgs, b as ToolSearchDocument, c as ToolSet, d as createToolIndex, e as createToolMiddleware, f as embedTools, i as isDynamicToolIndex } from '../middleware-2FR89muX.js';
4
- import { b as ToolApprovalPolicy, d as ToolCallContext, T as Tool } from '../tool-ClZYES-Z.js';
5
- export { A as AnyTool, N as NormalizedToolOutput, a as ToolApprovalContext, c as ToolApprovalRunContext, e as ToolCallStreamEvent, f as ToolOutput, i as isToolResultContentArray, n as normalizeToolResultOutput, p as parseToolArgs, s as serializeToolOutput, t as toolResultContentToText } from '../tool-ClZYES-Z.js';
6
- import '../types-BM8-Y8Hy.js';
1
+ export { b as CreateThinkToolOptions, C as CreateToolOptions, c as createThinkTool, a as createTool } from '../think-tool-ByArsrxe.js';
2
+ export { D as DynamicToolIndex, E as EmbedToolsOptions, T as ToolMiddleware, a as ToolResultMiddlewareArgs, b as ToolSearchDocument, c as ToolSet, d as createToolIndex, e as createToolMiddleware, f as embedTools, i as isDynamicToolIndex } from '../middleware-BQ7fkEEe.js';
3
+ export { A as AnyTool, N as NormalizedToolOutput, T as Tool, a as ToolApprovalContext, b as ToolApprovalPolicy, e as ToolApprovalRunContext, c as ToolCallContext, d as ToolCallStreamEvent, f as ToolOutput, i as isToolResultContentArray, n as normalizeToolResultOutput, p as parseToolArgs, s as serializeToolOutput, t as toolResultContentToText } from '../tool-C3ciF-VG.js';
4
+ import 'zod';
5
+ import '../zod-schema-C7F4clpm.js';
6
+ import '../types-C54aNoCd.js';
7
7
  import '../embeddings/index.js';
8
8
  import '../vector-store/index.js';
9
9
 
10
- type CreateToolOptions<InputSchema extends ZodSchema, OutputSchema extends ZodSchema | undefined = undefined, Output = unknown> = {
11
- name: string;
12
- description: string;
13
- input: InputSchema;
14
- output?: OutputSchema;
15
- approval?: ToolApprovalPolicy<z.output<InputSchema>>;
16
- execute(args: z.output<InputSchema>, context: ToolCallContext): OutputSchema extends ZodSchema ? z.input<OutputSchema> | Promise<z.input<OutputSchema>> : Output | Promise<Output>;
17
- };
18
- declare function createTool<InputSchema extends ZodSchema, Output = unknown>(options: CreateToolOptions<InputSchema, undefined, Output> & {
19
- output?: undefined;
20
- }): Tool<z.output<InputSchema>, Output>;
21
- declare function createTool<InputSchema extends ZodSchema, OutputSchema extends ZodSchema>(options: CreateToolOptions<InputSchema, OutputSchema>): Tool<z.output<InputSchema>, z.output<OutputSchema>>;
22
-
23
10
  declare class ToolCallError extends Error {
24
11
  readonly cause?: unknown | undefined;
25
12
  constructor(message: string, cause?: unknown | undefined);
@@ -33,12 +20,4 @@ declare class ToolJsonError extends Error {
33
20
  constructor(message: string, cause?: unknown | undefined);
34
21
  }
35
22
 
36
- type CreateThinkToolOptions = {
37
- name?: string;
38
- description?: string;
39
- };
40
- declare function createThinkTool(options?: CreateThinkToolOptions): Tool<{
41
- thought: string;
42
- }, string>;
43
-
44
- export { type CreateThinkToolOptions, type CreateToolOptions, Tool, ToolApprovalPolicy, ToolCallContext, ToolCallError, ToolJsonError, ToolNotFoundError, createThinkTool, createTool };
23
+ export { ToolCallError, ToolJsonError, ToolNotFoundError };
@@ -1,4 +1,4 @@
1
- import { J as JsonObject, q as ToolDefinition, u as ToolResultContent, j as JsonValue } from './types-BM8-Y8Hy.js';
1
+ import { J as JsonObject, g as ToolDefinition, j as ToolResultContent, e as JsonValue } from './types-C54aNoCd.js';
2
2
 
3
3
  type ToolApprovalRunContext = {
4
4
  agentId: string;
@@ -47,4 +47,4 @@ declare function normalizeToolResultOutput(output: unknown): NormalizedToolOutpu
47
47
  declare function toolResultContentToText(content: ToolResultContent[]): string;
48
48
  declare function parseToolArgs(args: string): JsonValue;
49
49
 
50
- export { type AnyTool as A, type NormalizedToolOutput as N, type Tool as T, type ToolApprovalContext as a, type ToolApprovalPolicy as b, type ToolApprovalRunContext as c, type ToolCallContext as d, type ToolCallStreamEvent as e, ToolOutput as f, isToolResultContentArray as i, normalizeToolResultOutput as n, parseToolArgs as p, serializeToolOutput as s, toolResultContentToText as t };
50
+ export { type AnyTool as A, type NormalizedToolOutput as N, type Tool as T, type ToolApprovalContext as a, type ToolApprovalPolicy as b, type ToolCallContext as c, type ToolCallStreamEvent as d, type ToolApprovalRunContext as e, ToolOutput as f, isToolResultContentArray as i, normalizeToolResultOutput as n, parseToolArgs as p, serializeToolOutput as s, toolResultContentToText as t };
@@ -1,4 +1,4 @@
1
- import { j as JsonValue } from '../types-BM8-Y8Hy.js';
1
+ import { e as JsonValue } from '../types-C54aNoCd.js';
2
2
 
3
3
  type TranscriptionRequest = {
4
4
  data: Uint8Array;
@@ -1,7 +1,58 @@
1
- import {
2
- TranscriptionRequestBuilder,
3
- transcriptionRequest
4
- } from "../chunk-7QI6ZAFI.js";
1
+ // src/transcription/index.ts
2
+ var TranscriptionRequestBuilder = class {
3
+ constructor(model) {
4
+ this.model = model;
5
+ }
6
+ model;
7
+ request = {
8
+ data: new Uint8Array(),
9
+ filename: "file"
10
+ };
11
+ data(data) {
12
+ this.request = { ...this.request, data: toUint8Array(data) };
13
+ return this;
14
+ }
15
+ filename(filename) {
16
+ this.request = { ...this.request, filename };
17
+ return this;
18
+ }
19
+ language(language) {
20
+ this.request = { ...this.request, language };
21
+ return this;
22
+ }
23
+ prompt(prompt) {
24
+ this.request = { ...this.request, prompt };
25
+ return this;
26
+ }
27
+ temperature(temperature) {
28
+ this.request = { ...this.request, temperature };
29
+ return this;
30
+ }
31
+ additionalParams(additionalParams) {
32
+ this.request = { ...this.request, additionalParams };
33
+ return this;
34
+ }
35
+ build() {
36
+ if (this.request.data.byteLength === 0) {
37
+ throw new Error("Transcription data cannot be empty.");
38
+ }
39
+ return { ...this.request, data: toUint8Array(this.request.data) };
40
+ }
41
+ send() {
42
+ return this.model.transcription(this.build());
43
+ }
44
+ };
45
+ function transcriptionRequest(model) {
46
+ return new TranscriptionRequestBuilder(model);
47
+ }
48
+ function toUint8Array(bytes) {
49
+ if (bytes instanceof Uint8Array) {
50
+ return new Uint8Array(
51
+ bytes.buffer.slice(bytes.byteOffset, bytes.byteOffset + bytes.byteLength)
52
+ );
53
+ }
54
+ return new Uint8Array(bytes);
55
+ }
5
56
  export {
6
57
  TranscriptionRequestBuilder,
7
58
  transcriptionRequest
@@ -1 +1 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
1
+ {"version":3,"sources":["../../src/transcription/index.ts"],"sourcesContent":["import type { JsonValue } from \"../completion\";\n\nexport type TranscriptionRequest = {\n data: Uint8Array;\n filename: string;\n language?: string | undefined;\n prompt?: string | undefined;\n temperature?: number | undefined;\n additionalParams?: JsonValue | undefined;\n};\n\nexport type TranscriptionResponse<RawResponse = unknown> = {\n text: string;\n rawResponse: RawResponse;\n};\n\nexport interface TranscriptionModel<RawResponse = unknown> {\n readonly provider?: string | undefined;\n readonly defaultModel?: string | undefined;\n transcription(request: TranscriptionRequest): Promise<TranscriptionResponse<RawResponse>>;\n}\n\nexport class TranscriptionRequestBuilder<Model extends TranscriptionModel = TranscriptionModel> {\n private request: TranscriptionRequest = {\n data: new Uint8Array(),\n filename: \"file\",\n };\n\n constructor(private readonly model: Model) {}\n\n data(data: Uint8Array | ArrayBuffer): this {\n this.request = { ...this.request, data: toUint8Array(data) };\n return this;\n }\n\n filename(filename: string): this {\n this.request = { ...this.request, filename };\n return this;\n }\n\n language(language: string): this {\n this.request = { ...this.request, language };\n return this;\n }\n\n prompt(prompt: string): this {\n this.request = { ...this.request, prompt };\n return this;\n }\n\n temperature(temperature: number): this {\n this.request = { ...this.request, temperature };\n return this;\n }\n\n additionalParams(additionalParams: JsonValue): this {\n this.request = { ...this.request, additionalParams };\n return this;\n }\n\n build(): TranscriptionRequest {\n if (this.request.data.byteLength === 0) {\n throw new Error(\"Transcription data cannot be empty.\");\n }\n return { ...this.request, data: toUint8Array(this.request.data) };\n }\n\n send(): Promise<Awaited<ReturnType<Model[\"transcription\"]>>> {\n return this.model.transcription(this.build()) as Promise<\n Awaited<ReturnType<Model[\"transcription\"]>>\n >;\n }\n}\n\nexport function transcriptionRequest<Model extends TranscriptionModel>(\n model: Model,\n): TranscriptionRequestBuilder<Model> {\n return new TranscriptionRequestBuilder(model);\n}\n\nfunction toUint8Array(bytes: Uint8Array | ArrayBuffer): Uint8Array {\n if (bytes instanceof Uint8Array) {\n return new Uint8Array(\n bytes.buffer.slice(bytes.byteOffset, bytes.byteOffset + bytes.byteLength),\n );\n }\n return new Uint8Array(bytes);\n}\n"],"mappings":";AAsBO,IAAM,8BAAN,MAAyF;AAAA,EAM9F,YAA6B,OAAc;AAAd;AAAA,EAAe;AAAA,EAAf;AAAA,EALrB,UAAgC;AAAA,IACtC,MAAM,IAAI,WAAW;AAAA,IACrB,UAAU;AAAA,EACZ;AAAA,EAIA,KAAK,MAAsC;AACzC,SAAK,UAAU,EAAE,GAAG,KAAK,SAAS,MAAM,aAAa,IAAI,EAAE;AAC3D,WAAO;AAAA,EACT;AAAA,EAEA,SAAS,UAAwB;AAC/B,SAAK,UAAU,EAAE,GAAG,KAAK,SAAS,SAAS;AAC3C,WAAO;AAAA,EACT;AAAA,EAEA,SAAS,UAAwB;AAC/B,SAAK,UAAU,EAAE,GAAG,KAAK,SAAS,SAAS;AAC3C,WAAO;AAAA,EACT;AAAA,EAEA,OAAO,QAAsB;AAC3B,SAAK,UAAU,EAAE,GAAG,KAAK,SAAS,OAAO;AACzC,WAAO;AAAA,EACT;AAAA,EAEA,YAAY,aAA2B;AACrC,SAAK,UAAU,EAAE,GAAG,KAAK,SAAS,YAAY;AAC9C,WAAO;AAAA,EACT;AAAA,EAEA,iBAAiB,kBAAmC;AAClD,SAAK,UAAU,EAAE,GAAG,KAAK,SAAS,iBAAiB;AACnD,WAAO;AAAA,EACT;AAAA,EAEA,QAA8B;AAC5B,QAAI,KAAK,QAAQ,KAAK,eAAe,GAAG;AACtC,YAAM,IAAI,MAAM,qCAAqC;AAAA,IACvD;AACA,WAAO,EAAE,GAAG,KAAK,SAAS,MAAM,aAAa,KAAK,QAAQ,IAAI,EAAE;AAAA,EAClE;AAAA,EAEA,OAA6D;AAC3D,WAAO,KAAK,MAAM,cAAc,KAAK,MAAM,CAAC;AAAA,EAG9C;AACF;AAEO,SAAS,qBACd,OACoC;AACpC,SAAO,IAAI,4BAA4B,KAAK;AAC9C;AAEA,SAAS,aAAa,OAA6C;AACjE,MAAI,iBAAiB,YAAY;AAC/B,WAAO,IAAI;AAAA,MACT,MAAM,OAAO,MAAM,MAAM,YAAY,MAAM,aAAa,MAAM,UAAU;AAAA,IAC1E;AAAA,EACF;AACA,SAAO,IAAI,WAAW,KAAK;AAC7B;","names":[]}
@@ -250,4 +250,4 @@ declare function assertCompletionRequestSupported(model: CompletionModel, reques
250
250
  }): void;
251
251
  declare function textFromAssistantContent(content: AssistantContent[]): string;
252
252
 
253
- export { AssistantContent as A, CompletionCapabilityError as C, type Document as D, type ImageContent as I, type JsonObject as J, Message as M, type Reasoning as R, type StreamingCompletionModel as S, type Text as T, Usage as U, type AssistantMessage as a, type CompletionModel as b, type CompletionModelCapabilities as c, type CompletionRequest as d, type CompletionResponse as e, type CompletionStreamEvent as f, type DocumentContent as g, type ImageDetail as h, type JsonPrimitive as i, type JsonValue as j, type ReasoningContent as k, type ReasoningContentType as l, type SystemMessage as m, type ToolCall as n, type ToolChoice as o, ToolContent as p, type ToolDefinition as q, type ToolFunction as r, type ToolMessage as s, type ToolResult as t, type ToolResultContent as u, UserContent as v, type UserMessage as w, assertCompletionRequestSupported as x, reasoningDisplayText as y, textFromAssistantContent as z };
253
+ export { AssistantContent as A, type CompletionModel as C, type Document as D, type ImageContent as I, type JsonObject as J, Message as M, type Reasoning as R, type SystemMessage as S, type Text as T, Usage as U, type AssistantMessage as a, type CompletionRequest as b, type CompletionResponse as c, type JsonPrimitive as d, type JsonValue as e, type ToolCall as f, type ToolDefinition as g, type ToolMessage as h, type ToolResult as i, type ToolResultContent as j, UserContent as k, type UserMessage as l, type ToolChoice as m, CompletionCapabilityError as n, type CompletionModelCapabilities as o, type CompletionStreamEvent as p, type DocumentContent as q, type ImageDetail as r, type ReasoningContent as s, type ReasoningContentType as t, type StreamingCompletionModel as u, ToolContent as v, type ToolFunction as w, assertCompletionRequestSupported as x, reasoningDisplayText as y, textFromAssistantContent as z };
@@ -1,4 +1,4 @@
1
- import { A as AnyTool } from './tool-ClZYES-Z.js';
1
+ import { A as AnyTool } from './tool-C3ciF-VG.js';
2
2
 
3
3
  type Skill = {
4
4
  readonly name: string;
@@ -27,4 +27,4 @@ declare class SkillValidationError extends Error {
27
27
  constructor(message: string, issues: SkillValidationIssue[]);
28
28
  }
29
29
 
30
- export { type Skill as S, type SkillLoader as a, type SkillSet as b, SkillValidationError as c, type SkillValidationIssue as d };
30
+ export { SkillValidationError as S, type SkillSet as a, type SkillLoader as b, type Skill as c, type SkillValidationIssue as d };
@@ -1,8 +1,8 @@
1
1
  import { SSEClientTransportOptions } from '@modelcontextprotocol/sdk/client/sse.js';
2
2
  import { StdioServerParameters } from '@modelcontextprotocol/sdk/client/stdio.js';
3
3
  import { StreamableHTTPClientTransportOptions } from '@modelcontextprotocol/sdk/client/streamableHttp.js';
4
- import { J as JsonObject } from './types-BM8-Y8Hy.js';
5
- import { A as AnyTool } from './tool-ClZYES-Z.js';
4
+ import { J as JsonObject } from './types-C54aNoCd.js';
5
+ import { A as AnyTool } from './tool-C3ciF-VG.js';
6
6
 
7
7
  type McpToolDefinition = {
8
8
  name: string;
@@ -67,4 +67,4 @@ type McpSseOptions = {
67
67
  transport?: SSEClientTransportOptions | undefined;
68
68
  };
69
69
 
70
- export type { McpClient as M, McpConnection as a, McpHttpOptions as b, McpServer as c, McpSseOptions as d, McpStdioOptions as e, McpToolCallContent as f, McpToolCallResult as g, McpToolDefinition as h };
70
+ export type { McpConnection as M, McpServer as a, McpStdioOptions as b, McpHttpOptions as c, McpSseOptions as d, McpClient as e, McpToolCallContent as f, McpToolCallResult as g, McpToolDefinition as h };
@@ -1,6 +1,6 @@
1
1
  import { VectorMetadataValue, VectorMetadata, EmbeddingModel, EmbeddedDocument, Embedding } from '../embeddings/index.js';
2
- import { T as Tool } from '../tool-ClZYES-Z.js';
3
- import '../types-BM8-Y8Hy.js';
2
+ import { T as Tool } from '../tool-C3ciF-VG.js';
3
+ import '../types-C54aNoCd.js';
4
4
 
5
5
  type VectorFilter = {
6
6
  type: "eq";
@@ -0,0 +1,5 @@
1
+ import { z } from 'zod';
2
+
3
+ type ZodSchema<T = unknown> = z.ZodType<T>;
4
+
5
+ export type { ZodSchema as Z };