@anvia/core 1.0.0-rc.1 → 1.0.0-rc.3
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 +344 -85
- package/dist/agent/index.d.ts +33 -18
- package/dist/agent/index.js +42 -17
- package/dist/agent-CXScUOpX.d.ts +150 -0
- package/dist/{chunk-R2LJSQUW.js → chunk-3CMWKK32.js} +260 -104
- package/dist/chunk-3CMWKK32.js.map +1 -0
- package/dist/chunk-3RM57ZT2.js +31 -0
- package/dist/chunk-3RM57ZT2.js.map +1 -0
- package/dist/chunk-5MK3BISB.js +704 -0
- package/dist/chunk-5MK3BISB.js.map +1 -0
- package/dist/chunk-AI5JMUW7.js +45 -0
- package/dist/chunk-AI5JMUW7.js.map +1 -0
- package/dist/{chunk-FNQB2JEH.js → chunk-AZB6N7P4.js} +94 -65
- package/dist/chunk-AZB6N7P4.js.map +1 -0
- package/dist/chunk-BEYBU7VJ.js +53 -0
- package/dist/chunk-BEYBU7VJ.js.map +1 -0
- package/dist/chunk-BY4OMNIU.js +4699 -0
- package/dist/chunk-BY4OMNIU.js.map +1 -0
- package/dist/chunk-D2ECOWN5.js +515 -0
- package/dist/chunk-D2ECOWN5.js.map +1 -0
- package/dist/{chunk-A3UBYTJT.js → chunk-FN7HLLAZ.js} +60 -6
- package/dist/chunk-FN7HLLAZ.js.map +1 -0
- package/dist/chunk-GKDERULJ.js +50 -0
- package/dist/chunk-GKDERULJ.js.map +1 -0
- package/dist/chunk-GQL5KRAH.js +331 -0
- package/dist/chunk-GQL5KRAH.js.map +1 -0
- package/dist/{chunk-5XKDW36Z.js → chunk-KFR4CDGK.js} +70 -75
- package/dist/chunk-KFR4CDGK.js.map +1 -0
- package/dist/chunk-KV6QCRQ4.js +171 -0
- package/dist/chunk-KV6QCRQ4.js.map +1 -0
- package/dist/{chunk-DMPUP4R3.js → chunk-LXMAFD23.js} +5 -5
- package/dist/{chunk-I6G7BC42.js → chunk-MGNTXGTX.js} +2 -6
- package/dist/chunk-MGNTXGTX.js.map +1 -0
- package/dist/chunk-PK5LKOFL.js +239 -0
- package/dist/chunk-PK5LKOFL.js.map +1 -0
- package/dist/chunk-QOUPWOGW.js +29 -0
- package/dist/chunk-QOUPWOGW.js.map +1 -0
- package/dist/chunk-TRQ3XRFD.js +54 -0
- package/dist/chunk-TRQ3XRFD.js.map +1 -0
- package/dist/chunk-VKYZZXP5.js +323 -0
- package/dist/chunk-VKYZZXP5.js.map +1 -0
- package/dist/chunk-ZCPOIDAQ.js +127 -0
- package/dist/chunk-ZCPOIDAQ.js.map +1 -0
- package/dist/client-DvUatElp.d.ts +84 -0
- package/dist/completion/index.d.ts +5 -4
- package/dist/completion/index.js +25 -28
- package/dist/documents/index.d.ts +34 -0
- package/dist/documents/index.js +315 -0
- package/dist/documents/index.js.map +1 -0
- package/dist/{dynamic-tools-i9woysFa.d.ts → dynamic-tools-AEBOTgu1.d.ts} +21 -9
- package/dist/embeddings/index.d.ts +11 -9
- package/dist/embeddings/index.js +3 -3
- package/dist/evals/index.d.ts +53 -25
- package/dist/evals/index.js +153 -103
- package/dist/evals/index.js.map +1 -1
- package/dist/extractor/index.d.ts +23 -26
- package/dist/extractor/index.js +7 -8
- package/dist/guardrails/index.d.ts +7 -129
- package/dist/guardrails/index.js +1 -1
- package/dist/image-generation/index.d.ts +18 -16
- package/dist/image-generation/index.js +2 -2
- package/dist/index.d.ts +26 -23
- package/dist/index.js +71 -48
- package/dist/interactions-csssHYcN.d.ts +174 -0
- package/dist/internal/agent.d.ts +36 -29
- package/dist/internal/agent.js +48 -15
- package/dist/internal/agent.js.map +1 -1
- package/dist/mcp/index.d.ts +19 -13
- package/dist/mcp/index.js +14 -348
- package/dist/mcp/index.js.map +1 -1
- package/dist/memory/index.d.ts +20 -6
- package/dist/memory/index.js +10 -10
- package/dist/message-schema-B2M7AYzR.d.ts +52 -0
- package/dist/model-call-options-CZkSw_xN.d.ts +6 -0
- package/dist/model-listing/index.d.ts +3 -1
- package/dist/observability/index.d.ts +21 -6
- package/dist/observability/index.js +8 -5
- package/dist/observability/index.js.map +1 -1
- package/dist/pipeline/index.d.ts +106 -57
- package/dist/pipeline/index.js +419 -236
- package/dist/pipeline/index.js.map +1 -1
- package/dist/{retry-D3Ruy-ba.d.ts → retry-CjvSlKGW.d.ts} +2 -1
- package/dist/skills/index.d.ts +5 -4
- package/dist/skills/index.js +8 -7
- package/dist/speech-generation/index.d.ts +37 -0
- package/dist/speech-generation/index.js +8 -0
- package/dist/text-C_6eKrbC.d.ts +32 -0
- package/dist/{think-tool-DZqZj2LV.d.ts → think-tool-D8frXxwV.d.ts} +16 -2
- package/dist/tool/index.d.ts +9 -7
- package/dist/tool/index.js +12 -10
- package/dist/{tool-C_8GudXn.d.ts → tool-r62gf3QY.d.ts} +17 -8
- package/dist/transcription/index.d.ts +23 -14
- package/dist/transcription/index.js +2 -2
- package/dist/types-C3gv9EX6.d.ts +130 -0
- package/dist/{index-DxB74ybJ.d.ts → types-CElwurHZ.d.ts} +139 -88
- package/dist/types-CIPaIbZo.d.ts +105 -0
- package/dist/types-Cr4uiYo5.d.ts +99 -0
- package/dist/types-D9rKQ_as.d.ts +341 -0
- package/dist/types-DbolvLtZ.d.ts +155 -0
- package/dist/{types-DhQfwiZn.d.ts → types-RT3cuyRk.d.ts} +1 -1
- package/dist/vector-store/index.d.ts +33 -34
- package/dist/vector-store/index.js +7 -6
- package/package.json +10 -14
- package/dist/agent-DGYY_onS.d.ts +0 -145
- package/dist/audio-generation/index.d.ts +0 -31
- package/dist/audio-generation/index.js +0 -8
- package/dist/chunk-5XKDW36Z.js.map +0 -1
- package/dist/chunk-6WGGTJE6.js +0 -139
- package/dist/chunk-6WGGTJE6.js.map +0 -1
- package/dist/chunk-A3UBYTJT.js.map +0 -1
- package/dist/chunk-ADH7NNCS.js +0 -512
- package/dist/chunk-ADH7NNCS.js.map +0 -1
- package/dist/chunk-DZ3CKYTH.js +0 -267
- package/dist/chunk-DZ3CKYTH.js.map +0 -1
- package/dist/chunk-FNQB2JEH.js.map +0 -1
- package/dist/chunk-I6G7BC42.js.map +0 -1
- package/dist/chunk-IL3ZSNJI.js +0 -3748
- package/dist/chunk-IL3ZSNJI.js.map +0 -1
- package/dist/chunk-J6GNQART.js +0 -122
- package/dist/chunk-J6GNQART.js.map +0 -1
- package/dist/chunk-M3IOWB4Y.js +0 -280
- package/dist/chunk-M3IOWB4Y.js.map +0 -1
- package/dist/chunk-QY5GZ7HR.js +0 -39
- package/dist/chunk-QY5GZ7HR.js.map +0 -1
- package/dist/chunk-R2LJSQUW.js.map +0 -1
- package/dist/chunk-RFDVKCIE.js +0 -12
- package/dist/chunk-RFDVKCIE.js.map +0 -1
- package/dist/chunk-RMUBRRSK.js +0 -34
- package/dist/chunk-RMUBRRSK.js.map +0 -1
- package/dist/chunk-RXKHOYEH.js +0 -466
- package/dist/chunk-RXKHOYEH.js.map +0 -1
- package/dist/chunk-XDRSPSR7.js +0 -38
- package/dist/chunk-XDRSPSR7.js.map +0 -1
- package/dist/chunk-XWUC7CIT.js +0 -1
- package/dist/chunk-XWUC7CIT.js.map +0 -1
- package/dist/errors-CYKUcU89.d.ts +0 -17
- package/dist/json-Zo7K3xmt.d.ts +0 -40
- package/dist/loaders/index.d.ts +0 -86
- package/dist/loaders/index.js +0 -299
- package/dist/loaders/index.js.map +0 -1
- package/dist/middleware-KynLg_RW.d.ts +0 -56
- package/dist/types-B3A4YxaA.d.ts +0 -354
- package/dist/types-BBEGKB9m.d.ts +0 -119
- package/dist/types-DT3nEemY.d.ts +0 -79
- package/dist/types-DulRCYdB.d.ts +0 -70
- package/dist/types-p55Jc-sr.d.ts +0 -47
- package/dist/ui/index.d.ts +0 -107
- package/dist/ui/index.js +0 -10
- package/dist/ui/index.js.map +0 -1
- /package/dist/{chunk-DMPUP4R3.js.map → chunk-LXMAFD23.js.map} +0 -0
- /package/dist/{audio-generation → speech-generation}/index.js.map +0 -0
package/dist/pipeline/index.d.ts
CHANGED
|
@@ -1,36 +1,32 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { t as AgentSuspendedResult, f as AgentInput, m as AgentRunSettings } from '../types-CElwurHZ.js';
|
|
2
|
+
import { A as Agent } from '../agent-CXScUOpX.js';
|
|
3
|
+
import { J as JsonObject, C as CompletionModel } from '../types-D9rKQ_as.js';
|
|
4
|
+
import { ExtractOptions } from '../extractor/index.js';
|
|
4
5
|
import { z } from 'zod';
|
|
5
|
-
import '../
|
|
6
|
+
import '../interactions-csssHYcN.js';
|
|
6
7
|
import '../type-utils-CtHVDRn_.js';
|
|
7
|
-
import '../
|
|
8
|
-
import '../
|
|
9
|
-
import '../
|
|
10
|
-
import '../
|
|
11
|
-
import '../tool-C_8GudXn.js';
|
|
8
|
+
import '../retry-CjvSlKGW.js';
|
|
9
|
+
import '../types-CIPaIbZo.js';
|
|
10
|
+
import '../types-DbolvLtZ.js';
|
|
11
|
+
import '../tool-r62gf3QY.js';
|
|
12
12
|
import '../zod-schema-C7F4clpm.js';
|
|
13
|
-
import '../
|
|
14
|
-
import '
|
|
15
|
-
import '
|
|
13
|
+
import '../client-DvUatElp.js';
|
|
14
|
+
import 'node:child_process';
|
|
15
|
+
import 'node:stream';
|
|
16
|
+
import '@modelcontextprotocol/sdk/client/auth.js';
|
|
16
17
|
import '@modelcontextprotocol/sdk/client/streamableHttp.js';
|
|
17
|
-
import '
|
|
18
|
-
import '../
|
|
19
|
-
import '../
|
|
20
|
-
import '../types-
|
|
18
|
+
import '@modelcontextprotocol/sdk/shared/transport.js';
|
|
19
|
+
import '../types-RT3cuyRk.js';
|
|
20
|
+
import '../dynamic-tools-AEBOTgu1.js';
|
|
21
|
+
import '../types-Cr4uiYo5.js';
|
|
22
|
+
import '../model-call-options-CZkSw_xN.js';
|
|
23
|
+
import '../types-C3gv9EX6.js';
|
|
21
24
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
+
declare class PipelineAgentSuspensionError extends Error {
|
|
26
|
+
readonly result: AgentSuspendedResult;
|
|
27
|
+
constructor(result: AgentSuspendedResult);
|
|
25
28
|
}
|
|
26
|
-
|
|
27
|
-
/** Maximum number of inputs processed at the same time. */
|
|
28
|
-
concurrency: number;
|
|
29
|
-
}
|
|
30
|
-
type AwaitedOutput<Op> = Op extends PipelineOp<unknown, infer Output> ? Awaited<Output> : never;
|
|
31
|
-
type ParallelOutput<Branches extends Record<string, PipelineOp<unknown, unknown>>> = {
|
|
32
|
-
[Key in keyof Branches]: AwaitedOutput<Branches[Key]>;
|
|
33
|
-
};
|
|
29
|
+
|
|
34
30
|
type PipelineMetadata = {
|
|
35
31
|
id?: string | undefined;
|
|
36
32
|
name?: string | undefined;
|
|
@@ -45,14 +41,23 @@ type PipelineOptions<Input, Parsed = Input> = {
|
|
|
45
41
|
metadata?: JsonObject | undefined;
|
|
46
42
|
};
|
|
47
43
|
type PipelineStageMetadata = {
|
|
48
|
-
id
|
|
44
|
+
id: string;
|
|
49
45
|
name?: string | undefined;
|
|
50
46
|
description?: string | undefined;
|
|
51
47
|
metadata?: JsonObject | undefined;
|
|
52
48
|
};
|
|
49
|
+
type PipelineStageContext<Input> = {
|
|
50
|
+
input: Input;
|
|
51
|
+
runId: string;
|
|
52
|
+
pipelineId: string;
|
|
53
|
+
runMetadata?: JsonObject | undefined;
|
|
54
|
+
abortSignal?: AbortSignal | undefined;
|
|
55
|
+
};
|
|
53
56
|
type PipelineStageKind = "input" | "step" | "pipeline" | "parallel" | "branch" | "agent" | "extractor" | "output";
|
|
57
|
+
type PipelineNodePath = readonly string[];
|
|
54
58
|
type PipelineGraphNode = {
|
|
55
59
|
id: string;
|
|
60
|
+
path: PipelineNodePath;
|
|
56
61
|
kind: PipelineStageKind;
|
|
57
62
|
label: string;
|
|
58
63
|
description?: string | undefined;
|
|
@@ -64,8 +69,8 @@ type PipelineGraphNode = {
|
|
|
64
69
|
};
|
|
65
70
|
type PipelineGraphEdge = {
|
|
66
71
|
id: string;
|
|
67
|
-
source:
|
|
68
|
-
target:
|
|
72
|
+
source: PipelineNodePath;
|
|
73
|
+
target: PipelineNodePath;
|
|
69
74
|
label?: string | undefined;
|
|
70
75
|
};
|
|
71
76
|
type PipelineGraph = PipelineMetadata & {
|
|
@@ -73,28 +78,80 @@ type PipelineGraph = PipelineMetadata & {
|
|
|
73
78
|
nodes: PipelineGraphNode[];
|
|
74
79
|
edges: PipelineGraphEdge[];
|
|
75
80
|
};
|
|
76
|
-
type
|
|
77
|
-
|
|
81
|
+
type PipelineRunEventBase = {
|
|
82
|
+
runId: string;
|
|
83
|
+
pipelineId: string;
|
|
84
|
+
path: PipelineNodePath;
|
|
78
85
|
node: PipelineGraphNode;
|
|
79
|
-
}
|
|
86
|
+
};
|
|
87
|
+
type PipelineRunEvent = (PipelineRunEventBase & {
|
|
88
|
+
type: "stage_started";
|
|
89
|
+
}) | (PipelineRunEventBase & {
|
|
80
90
|
type: "stage_completed";
|
|
81
|
-
node: PipelineGraphNode;
|
|
82
91
|
durationMs: number;
|
|
83
|
-
} | {
|
|
92
|
+
}) | (PipelineRunEventBase & {
|
|
84
93
|
type: "stage_failed";
|
|
85
|
-
node: PipelineGraphNode;
|
|
86
94
|
durationMs: number;
|
|
87
95
|
error: unknown;
|
|
88
|
-
};
|
|
96
|
+
});
|
|
89
97
|
type PipelineRunObserver = {
|
|
90
98
|
onEvent(event: PipelineRunEvent): void | Promise<void>;
|
|
91
99
|
};
|
|
92
|
-
type PipelineRunOptions = {
|
|
100
|
+
type PipelineRunOptions<Input> = {
|
|
101
|
+
input: Input;
|
|
102
|
+
runId?: string | undefined;
|
|
103
|
+
metadata?: JsonObject | undefined;
|
|
104
|
+
abortSignal?: AbortSignal | undefined;
|
|
105
|
+
observer?: PipelineRunObserver | undefined;
|
|
106
|
+
failOnObserverError?: boolean | undefined;
|
|
107
|
+
};
|
|
108
|
+
type PipelineRunResult<Output> = {
|
|
109
|
+
runId: string;
|
|
110
|
+
output: Awaited<Output>;
|
|
111
|
+
};
|
|
112
|
+
type PipelineBatchOptions<Input> = {
|
|
113
|
+
inputs: Iterable<Input>;
|
|
114
|
+
concurrency: number;
|
|
115
|
+
metadata?: JsonObject | undefined;
|
|
116
|
+
abortSignal?: AbortSignal | undefined;
|
|
93
117
|
observer?: PipelineRunObserver | undefined;
|
|
118
|
+
failOnObserverError?: boolean | undefined;
|
|
119
|
+
};
|
|
120
|
+
type PipelineBatchItem<Output> = {
|
|
121
|
+
status: "completed";
|
|
122
|
+
runId: string;
|
|
123
|
+
output: Awaited<Output>;
|
|
124
|
+
} | {
|
|
125
|
+
status: "failed";
|
|
126
|
+
runId: string;
|
|
127
|
+
error: unknown;
|
|
128
|
+
};
|
|
129
|
+
type PipelineOutput<Value> = Value extends Pipeline<infer _Input, infer Output> ? Awaited<Output> : never;
|
|
130
|
+
type ParallelOutput<Branches extends Record<string, unknown>> = {
|
|
131
|
+
[Key in keyof Branches]: PipelineOutput<Branches[Key]>;
|
|
94
132
|
};
|
|
95
133
|
|
|
96
|
-
|
|
97
|
-
|
|
134
|
+
type RawResponseOf<Model> = Model extends CompletionModel<infer RawResponse> ? RawResponse : unknown;
|
|
135
|
+
type PipelineAgentRequest<Output, Model extends CompletionModel> = AgentInput & Omit<AgentRunSettings<Output, RawResponseOf<Model>>, "abortSignal">;
|
|
136
|
+
type PipelineStepOptions<Input, Output> = PipelineStageMetadata & {
|
|
137
|
+
run(context: PipelineStageContext<Input>): Output | Promise<Output>;
|
|
138
|
+
};
|
|
139
|
+
type PipelineComposeOptions<Input, Output> = PipelineStageMetadata & {
|
|
140
|
+
pipeline: Pipeline<Input, Output>;
|
|
141
|
+
};
|
|
142
|
+
type PipelineParallelOptions<Input, Branches extends Record<string, Pipeline<Input, unknown>>> = PipelineStageMetadata & {
|
|
143
|
+
branches: Branches;
|
|
144
|
+
};
|
|
145
|
+
type PipelineAgentOptions<Input, AgentOutput, Model extends CompletionModel> = PipelineStageMetadata & {
|
|
146
|
+
agent: Agent<AgentOutput, Model>;
|
|
147
|
+
request(context: PipelineStageContext<Input>): PipelineAgentRequest<AgentOutput, Model> | Promise<PipelineAgentRequest<AgentOutput, Model>>;
|
|
148
|
+
suspension: "reject";
|
|
149
|
+
};
|
|
150
|
+
type PipelineExtractOptions<Input, Extracted, Model extends CompletionModel> = PipelineStageMetadata & Omit<ExtractOptions<Extracted, Model>, "text" | "abortSignal"> & {
|
|
151
|
+
text(context: PipelineStageContext<Input>): string | Promise<string>;
|
|
152
|
+
};
|
|
153
|
+
/** Immutable, typed Pipeline with explicit stage and execution boundaries. */
|
|
154
|
+
declare class Pipeline<Input, Output = Input> {
|
|
98
155
|
readonly id: string;
|
|
99
156
|
readonly name: string | undefined;
|
|
100
157
|
readonly description: string | undefined;
|
|
@@ -102,24 +159,16 @@ declare class Pipeline<Input, Output = Input> implements PipelineOp<Input, Await
|
|
|
102
159
|
private readonly executor;
|
|
103
160
|
private readonly state;
|
|
104
161
|
constructor(options: PipelineOptions<Input, Output>);
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
agent(agent: Agent<CompletionModel>, metadata?: PipelineStageMetadata): Pipeline<Input, string>;
|
|
113
|
-
/** Send the current value to an extractor as text and continue with typed schema data. */
|
|
114
|
-
extract<T>(extractor: Extractor<T, CompletionModel>, metadata?: PipelineStageMetadata): Pipeline<Input, T>;
|
|
115
|
-
/** Run one input through the pipeline and return the final stage output. */
|
|
116
|
-
run(input: Input, options?: PipelineRunOptions): Promise<Awaited<Output>>;
|
|
117
|
-
/** Run many inputs through the same pipeline with bounded concurrency. */
|
|
118
|
-
batch<I extends Iterable<Input>>(inputs: I, options: PipelineBatchOptions): Promise<Array<Awaited<Output>>>;
|
|
119
|
-
/** Return an isolated graph snapshot for the current pipeline stages. */
|
|
162
|
+
step<Next>(options: PipelineStepOptions<Awaited<Output>, Next>): Pipeline<Input, Awaited<Next>>;
|
|
163
|
+
compose<Next>(options: PipelineComposeOptions<Awaited<Output>, Next>): Pipeline<Input, Awaited<Next>>;
|
|
164
|
+
parallel<Branches extends Record<string, Pipeline<Awaited<Output>, unknown>>>(options: PipelineParallelOptions<Awaited<Output>, Branches>): Pipeline<Input, ParallelOutput<Branches>>;
|
|
165
|
+
agent<AgentOutput, Model extends CompletionModel>(options: PipelineAgentOptions<Awaited<Output>, AgentOutput, Model>): Pipeline<Input, AgentOutput>;
|
|
166
|
+
extract<Extracted, Model extends CompletionModel>(options: PipelineExtractOptions<Awaited<Output>, Extracted, Model>): Pipeline<Input, Extracted>;
|
|
167
|
+
run(options: PipelineRunOptions<Input>): Promise<PipelineRunResult<Output>>;
|
|
168
|
+
runBatch(options: PipelineBatchOptions<Input>): Promise<Array<PipelineBatchItem<Output>>>;
|
|
120
169
|
graph(): PipelineGraph;
|
|
121
170
|
private derive;
|
|
122
|
-
private
|
|
171
|
+
private execute;
|
|
123
172
|
}
|
|
124
173
|
|
|
125
|
-
export { Pipeline, type PipelineBatchOptions, type PipelineGraph, type PipelineGraphEdge, type PipelineGraphNode, type PipelineMetadata, type
|
|
174
|
+
export { type ParallelOutput, Pipeline, type PipelineAgentOptions, PipelineAgentSuspensionError, type PipelineBatchItem, type PipelineBatchOptions, type PipelineComposeOptions, type PipelineExtractOptions, type PipelineGraph, type PipelineGraphEdge, type PipelineGraphNode, type PipelineMetadata, type PipelineNodePath, type PipelineOptions, type PipelineParallelOptions, type PipelineRunEvent, type PipelineRunObserver, type PipelineRunOptions, type PipelineRunResult, type PipelineStageContext, type PipelineStageKind, type PipelineStageMetadata, type PipelineStepOptions };
|