@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
|
@@ -1,37 +1,34 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { b as RetrySetting } from '../retry-CjvSlKGW.js';
|
|
2
|
+
import { C as CompletionModel, J as JsonObject, U as Usage, g as CompletionResult } from '../types-D9rKQ_as.js';
|
|
2
3
|
import { Z as ZodSchema } from '../zod-schema-C7F4clpm.js';
|
|
3
|
-
import
|
|
4
|
+
import '../model-call-options-CZkSw_xN.js';
|
|
4
5
|
import 'zod';
|
|
5
6
|
|
|
6
|
-
type
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
type RawResponseOf<Model> = Model extends CompletionModel<infer RawResponse> ? RawResponse : unknown;
|
|
8
|
+
type ExtractOptions<Output, Model extends CompletionModel = CompletionModel> = {
|
|
9
|
+
model: Model;
|
|
10
|
+
text: string;
|
|
11
|
+
outputSchema: ZodSchema<Output>;
|
|
9
12
|
instructions?: string | undefined;
|
|
10
|
-
|
|
11
|
-
type ExtractOptions = {
|
|
12
|
-
retries?: RetryOptions | undefined;
|
|
13
|
+
retries?: RetrySetting | undefined;
|
|
13
14
|
temperature?: number | undefined;
|
|
14
15
|
maxTokens?: number | undefined;
|
|
15
|
-
|
|
16
|
+
providerOptions?: JsonObject | undefined;
|
|
17
|
+
abortSignal?: AbortSignal | undefined;
|
|
16
18
|
};
|
|
17
|
-
type ExtractionResult<
|
|
18
|
-
|
|
19
|
-
usage: Usage;
|
|
20
|
-
messages: Message[];
|
|
19
|
+
type ExtractionResult<Output, RawResponse = unknown> = Omit<CompletionResult<string, RawResponse>, "output"> & {
|
|
20
|
+
output: Output;
|
|
21
21
|
};
|
|
22
22
|
declare class ExtractionError extends Error {
|
|
23
|
-
readonly
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
private readonly instructions;
|
|
31
|
-
private readonly submitTool;
|
|
32
|
-
constructor(options: ExtractorOptions<T, M>);
|
|
33
|
-
extract(text: string, options?: ExtractOptions): Promise<T>;
|
|
34
|
-
extractResult(text: string, options?: ExtractOptions): Promise<ExtractionResult<T>>;
|
|
23
|
+
readonly attempts: number;
|
|
24
|
+
readonly usage: Usage;
|
|
25
|
+
constructor(message: string, options: {
|
|
26
|
+
cause?: unknown;
|
|
27
|
+
attempts: number;
|
|
28
|
+
usage: Usage;
|
|
29
|
+
});
|
|
35
30
|
}
|
|
31
|
+
/** Extract structured data from text using a required, schema-backed submit tool. */
|
|
32
|
+
declare function extract<Output, Model extends CompletionModel>(options: ExtractOptions<Output, Model>): Promise<ExtractionResult<Output, RawResponseOf<Model>>>;
|
|
36
33
|
|
|
37
|
-
export { type ExtractOptions, ExtractionError, type ExtractionResult,
|
|
34
|
+
export { type ExtractOptions, ExtractionError, type ExtractionResult, extract };
|
package/dist/extractor/index.js
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ExtractionError,
|
|
3
|
-
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-A3UBYTJT.js";
|
|
3
|
+
extract
|
|
4
|
+
} from "../chunk-ZCPOIDAQ.js";
|
|
5
|
+
import "../chunk-MGNTXGTX.js";
|
|
6
|
+
import "../chunk-D2ECOWN5.js";
|
|
7
|
+
import "../chunk-PK5LKOFL.js";
|
|
8
|
+
import "../chunk-FN7HLLAZ.js";
|
|
10
9
|
export {
|
|
11
10
|
ExtractionError,
|
|
12
|
-
|
|
11
|
+
extract
|
|
13
12
|
};
|
|
14
13
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,133 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
1
|
+
export { a as allow, f as appendGuardrailPolicies, b as block, d as defineGuardrailPolicy, c as defineInputGuardrail, e as defineOutputGuardrail, g as guardrails, h as hasEnforcedOutputGuardrails, n as normalizeGuardrailPolicies } from '../text-C_6eKrbC.js';
|
|
2
|
+
import { c as GuardrailPolicy, g as InputGuardrailContext, j as InputGuardrailRunResult, i as OutputGuardrailContext, k as OutputGuardrailRunResult } from '../types-CIPaIbZo.js';
|
|
3
|
+
export { l as GuardrailActionBase, m as GuardrailActionName, n as GuardrailAllow, o as GuardrailBlock, G as GuardrailBoundary, p as GuardrailCommonActions, a as GuardrailDecisionRecord, b as GuardrailMode, d as GuardrailPolicyInput, e as GuardrailPolicyOptions, q as GuardrailRunContext, I as InputGuardrail, f as InputGuardrailActions, r as InputGuardrailResult, s as InputGuardrailRewrite, O as OutputGuardrail, h as OutputGuardrailActions, t as OutputGuardrailResult, u as OutputGuardrailRewrite } from '../types-CIPaIbZo.js';
|
|
4
|
+
import '../types-D9rKQ_as.js';
|
|
5
|
+
import '../model-call-options-CZkSw_xN.js';
|
|
6
|
+
import '../type-utils-CtHVDRn_.js';
|
|
3
7
|
|
|
4
|
-
type GuardrailMode = "enforce" | "observe";
|
|
5
|
-
type GuardrailBoundary = "input" | "output";
|
|
6
|
-
type GuardrailRunContext = {
|
|
7
|
-
agentId: string;
|
|
8
|
-
runId: string;
|
|
9
|
-
sessionId?: string | undefined;
|
|
10
|
-
metadata?: JsonObject | undefined;
|
|
11
|
-
};
|
|
12
|
-
type GuardrailDecisionRecord = {
|
|
13
|
-
policyId: string;
|
|
14
|
-
guardrailId: string;
|
|
15
|
-
boundary: GuardrailBoundary;
|
|
16
|
-
mode: GuardrailMode;
|
|
17
|
-
action: GuardrailActionName;
|
|
18
|
-
applied: boolean;
|
|
19
|
-
reason?: string | undefined;
|
|
20
|
-
message?: string | undefined;
|
|
21
|
-
metadata?: JsonObject | undefined;
|
|
22
|
-
latencyMs: number;
|
|
23
|
-
};
|
|
24
|
-
type GuardrailActionName = "allow" | "block" | "rewrite" | "error";
|
|
25
|
-
type GuardrailActionBase = {
|
|
26
|
-
reason?: string | undefined;
|
|
27
|
-
metadata?: JsonObject | undefined;
|
|
28
|
-
};
|
|
29
|
-
type GuardrailAllow = GuardrailActionBase & {
|
|
30
|
-
action: "allow";
|
|
31
|
-
};
|
|
32
|
-
type GuardrailBlock = GuardrailActionBase & {
|
|
33
|
-
action: "block";
|
|
34
|
-
reason: string;
|
|
35
|
-
message?: string | undefined;
|
|
36
|
-
};
|
|
37
|
-
type InputGuardrailRewrite = GuardrailActionBase & {
|
|
38
|
-
action: "rewrite";
|
|
39
|
-
prompt?: Message | undefined;
|
|
40
|
-
inputText?: string | undefined;
|
|
41
|
-
};
|
|
42
|
-
type OutputGuardrailRewrite = GuardrailActionBase & {
|
|
43
|
-
action: "rewrite";
|
|
44
|
-
outputText: string;
|
|
45
|
-
};
|
|
46
|
-
type InputGuardrailResult = GuardrailAllow | GuardrailBlock | InputGuardrailRewrite;
|
|
47
|
-
type OutputGuardrailResult = GuardrailAllow | GuardrailBlock | OutputGuardrailRewrite;
|
|
48
|
-
type GuardrailCommonActions = {
|
|
49
|
-
allow(options?: GuardrailActionBase): GuardrailAllow;
|
|
50
|
-
block(options: Omit<GuardrailBlock, "action">): GuardrailBlock;
|
|
51
|
-
};
|
|
52
|
-
type InputGuardrailActions = GuardrailCommonActions & {
|
|
53
|
-
rewrite(options: Omit<InputGuardrailRewrite, "action">): InputGuardrailRewrite;
|
|
54
|
-
};
|
|
55
|
-
type OutputGuardrailActions = GuardrailCommonActions & {
|
|
56
|
-
rewrite(options: Omit<OutputGuardrailRewrite, "action">): OutputGuardrailRewrite;
|
|
57
|
-
};
|
|
58
|
-
type InputGuardrailContext = {
|
|
59
|
-
prompt: Message;
|
|
60
|
-
history: Message[];
|
|
61
|
-
inputText: string;
|
|
62
|
-
run: GuardrailRunContext;
|
|
63
|
-
};
|
|
64
|
-
type OutputGuardrailContext = {
|
|
65
|
-
outputText: string;
|
|
66
|
-
messages: Message[];
|
|
67
|
-
usage: Usage;
|
|
68
|
-
run: GuardrailRunContext;
|
|
69
|
-
};
|
|
70
|
-
type InputGuardrail = {
|
|
71
|
-
id: string;
|
|
72
|
-
check(context: InputGuardrailContext, actions: InputGuardrailActions): MaybePromise<InputGuardrailResult | undefined>;
|
|
73
|
-
};
|
|
74
|
-
type OutputGuardrail = {
|
|
75
|
-
id: string;
|
|
76
|
-
check(context: OutputGuardrailContext, actions: OutputGuardrailActions): MaybePromise<OutputGuardrailResult | undefined>;
|
|
77
|
-
};
|
|
78
|
-
type GuardrailPolicy = {
|
|
79
|
-
id: string;
|
|
80
|
-
mode: GuardrailMode;
|
|
81
|
-
input: InputGuardrail[];
|
|
82
|
-
output: OutputGuardrail[];
|
|
83
|
-
};
|
|
84
|
-
type GuardrailPolicyOptions = {
|
|
85
|
-
id: string;
|
|
86
|
-
mode?: GuardrailMode | undefined;
|
|
87
|
-
input?: InputGuardrail[] | undefined;
|
|
88
|
-
output?: OutputGuardrail[] | undefined;
|
|
89
|
-
};
|
|
90
|
-
type GuardrailPolicyInput = GuardrailPolicy | GuardrailPolicy[];
|
|
91
|
-
type InputGuardrailRunResult = {
|
|
92
|
-
prompt: Message;
|
|
93
|
-
inputText: string;
|
|
94
|
-
blocked: boolean;
|
|
95
|
-
message?: string | undefined;
|
|
96
|
-
decisions: GuardrailDecisionRecord[];
|
|
97
|
-
};
|
|
98
|
-
type OutputGuardrailRunResult = {
|
|
99
|
-
outputText: string;
|
|
100
|
-
blocked: boolean;
|
|
101
|
-
message?: string | undefined;
|
|
102
|
-
decisions: GuardrailDecisionRecord[];
|
|
103
|
-
};
|
|
104
|
-
declare function defineGuardrailPolicy(options: GuardrailPolicyOptions): GuardrailPolicy;
|
|
105
|
-
declare function defineInputGuardrail(guardrail: InputGuardrail): InputGuardrail;
|
|
106
|
-
declare function defineOutputGuardrail(guardrail: OutputGuardrail): OutputGuardrail;
|
|
107
|
-
declare function allow(options?: GuardrailActionBase): GuardrailAllow;
|
|
108
|
-
declare function block(options: Omit<GuardrailBlock, "action">): GuardrailBlock;
|
|
109
|
-
declare const guardrails: {
|
|
110
|
-
blockText: typeof blockText;
|
|
111
|
-
redactText: typeof redactText;
|
|
112
|
-
};
|
|
113
|
-
declare function normalizeGuardrailPolicies(policies: GuardrailPolicyInput | undefined): GuardrailPolicy[];
|
|
114
|
-
declare function appendGuardrailPolicies(current: GuardrailPolicy[], next: GuardrailPolicyInput): GuardrailPolicy[];
|
|
115
|
-
declare function hasEnforcedOutputGuardrails(policies: GuardrailPolicy[]): boolean;
|
|
116
8
|
declare function runInputGuardrails(policies: GuardrailPolicy[], context: InputGuardrailContext): Promise<InputGuardrailRunResult>;
|
|
117
9
|
declare function runOutputGuardrails(policies: GuardrailPolicy[], context: OutputGuardrailContext): Promise<OutputGuardrailRunResult>;
|
|
118
|
-
type TextPatternBoundary = "input" | "output";
|
|
119
|
-
type TextPatternGuardrailFor<Boundary extends TextPatternBoundary> = Boundary extends "input" ? InputGuardrail : OutputGuardrail;
|
|
120
|
-
type TextPatternGuardrailOptions<Boundary extends TextPatternBoundary = TextPatternBoundary> = {
|
|
121
|
-
id: string;
|
|
122
|
-
boundary: Boundary;
|
|
123
|
-
patterns: Array<string | RegExp>;
|
|
124
|
-
reason: string;
|
|
125
|
-
message?: string | undefined;
|
|
126
|
-
};
|
|
127
|
-
type TextPatternRedactOptions<Boundary extends TextPatternBoundary = TextPatternBoundary> = TextPatternGuardrailOptions<Boundary> & {
|
|
128
|
-
replacement?: string | undefined;
|
|
129
|
-
};
|
|
130
|
-
declare function blockText<Boundary extends TextPatternBoundary>(options: TextPatternGuardrailOptions<Boundary>): TextPatternGuardrailFor<Boundary>;
|
|
131
|
-
declare function redactText<Boundary extends TextPatternBoundary>(options: TextPatternRedactOptions<Boundary>): TextPatternGuardrailFor<Boundary>;
|
|
132
10
|
|
|
133
|
-
export {
|
|
11
|
+
export { GuardrailPolicy, InputGuardrailContext, InputGuardrailRunResult, OutputGuardrailContext, OutputGuardrailRunResult, runInputGuardrails, runOutputGuardrails };
|
package/dist/guardrails/index.js
CHANGED
|
@@ -1,36 +1,38 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { M as ModelCallOptions } from '../model-call-options-CZkSw_xN.js';
|
|
2
|
+
import { b as RetrySetting } from '../retry-CjvSlKGW.js';
|
|
3
|
+
export { R as RetryContext, a as RetryOptions } from '../retry-CjvSlKGW.js';
|
|
4
|
+
import { J as JsonObject } from '../types-D9rKQ_as.js';
|
|
4
5
|
|
|
5
6
|
type ImageGenerationRequest = {
|
|
6
7
|
prompt: string;
|
|
7
8
|
width: number;
|
|
8
9
|
height: number;
|
|
9
|
-
|
|
10
|
+
providerOptions?: JsonObject | undefined;
|
|
10
11
|
};
|
|
11
12
|
type GeneratedImage = {
|
|
12
13
|
data: Uint8Array;
|
|
13
14
|
mediaType?: string | undefined;
|
|
14
15
|
};
|
|
15
|
-
type
|
|
16
|
-
|
|
17
|
-
images: GeneratedImage[];
|
|
18
|
-
mediaType?: string | undefined;
|
|
16
|
+
type ImageGenerationResult<RawResponse = unknown> = {
|
|
17
|
+
images: readonly [GeneratedImage, ...GeneratedImage[]];
|
|
19
18
|
rawResponse: RawResponse;
|
|
20
19
|
};
|
|
21
|
-
interface ImageGenerationModel<RawResponse = unknown
|
|
22
|
-
readonly provider
|
|
23
|
-
readonly
|
|
24
|
-
imageGeneration(request: ImageGenerationRequest): Promise<
|
|
20
|
+
interface ImageGenerationModel<RawResponse = unknown> {
|
|
21
|
+
readonly provider: string;
|
|
22
|
+
readonly modelId: string | undefined;
|
|
23
|
+
imageGeneration(request: ImageGenerationRequest, options?: ModelCallOptions): Promise<ImageGenerationResult<RawResponse>>;
|
|
25
24
|
}
|
|
26
25
|
|
|
27
26
|
type GenerateImageOptions<Model extends ImageGenerationModel = ImageGenerationModel> = {
|
|
28
27
|
model: Model;
|
|
28
|
+
prompt: string;
|
|
29
29
|
width?: number | undefined;
|
|
30
30
|
height?: number | undefined;
|
|
31
|
-
|
|
32
|
-
retries?:
|
|
31
|
+
providerOptions?: JsonObject | undefined;
|
|
32
|
+
retries?: RetrySetting | undefined;
|
|
33
|
+
abortSignal?: AbortSignal | undefined;
|
|
33
34
|
};
|
|
34
|
-
|
|
35
|
+
type RawResponseOf<Model> = Model extends ImageGenerationModel<infer RawResponse> ? RawResponse : unknown;
|
|
36
|
+
declare function generateImage<Model extends ImageGenerationModel>(options: GenerateImageOptions<Model>): Promise<ImageGenerationResult<RawResponseOf<Model>>>;
|
|
35
37
|
|
|
36
|
-
export { type GenerateImageOptions, type GeneratedImage, type ImageGenerationModel, type ImageGenerationRequest, type
|
|
38
|
+
export { type GenerateImageOptions, type GeneratedImage, type ImageGenerationModel, type ImageGenerationRequest, type ImageGenerationResult, ModelCallOptions, RetrySetting, generateImage };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,28 +1,31 @@
|
|
|
1
|
-
export { A as Agent, a as AgentContextInput, b as
|
|
2
|
-
export { AgentRunCancelledError, MaxTurnsError } from './agent/index.js';
|
|
3
|
-
export { A as
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
export { A as
|
|
8
|
-
export {
|
|
9
|
-
export {
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
1
|
+
export { A as Agent, a as AgentContextInput, b as AgentMemory, c as AgentMemoryOptions, d as AgentOptions, e as AgentToolInput, f as AgentToolOptions, C as CreateHybridVectorContextOptions, g as CreateVectorContextOptions, V as VectorContext, h as VectorContextBaseOptions, i as createVectorContext, j as isVectorContext } from './agent-CXScUOpX.js';
|
|
2
|
+
export { AgentRunBlockedError, AgentRunCancelledError, AgentStreamClosedError, AgentToolSuspensionError, MaxTurnsError } from './agent/index.js';
|
|
3
|
+
export { A as AgentContinuation, a as AgentInteractionRequest, b as AgentInteractionResponse, c as AgentMiddleware, d as AgentQuestionAnswer, e as AgentQuestionChoice, f as AgentQuestionPrompt, g as AgentToolApprovalRequest, h as AgentToolQuestionRequest, C as CompletionRequestMiddlewareArgs, i as CompletionRequestMiddlewareResult, j as CompletionResponseMiddlewareArgs, k as CompletionResponseMiddlewareResult, T as ToolInputMiddlewareArgs, l as ToolInputMiddlewareResult, m as ToolOutputMiddlewareArgs, n as ToolOutputMiddlewareResult, o as ToolResultMiddlewareArgs, p as agentContinuationSchema, q as agentInteractionRequestSchema, r as agentInteractionResponseSchema, s as createMiddleware, t as parseAgentContinuation, u as parseAgentInteractionRequest, v as parseAgentInteractionResponse } from './interactions-csssHYcN.js';
|
|
4
|
+
export { A as AgentBlockedResult, a as AgentChildStreamEvent, b as AgentDeltaEvent, c as AgentErrorEvent, d as AgentErrorStreamEvent, e as AgentFinishEvent, f as AgentInput, g as AgentLifecycle, h as AgentMemoryCompactionEvent, i as AgentPrompt, j as AgentResponse, k as AgentResult, l as AgentRunOptions, m as AgentRunSettings, n as AgentStartEvent, o as AgentSteerInput, p as AgentSteerReceipt, q as AgentStepFinishEvent, r as AgentStream, s as AgentStreamEvent, t as AgentSuspendedResult, u as AgentToolCallDeltaEvent, v as AgentToolFinishEvent, w as AgentToolStartEvent } from './types-CElwurHZ.js';
|
|
5
|
+
export { M as ModelCallOptions } from './model-call-options-CZkSw_xN.js';
|
|
6
|
+
export { R as RetryContext, a as RetryOptions, b as RetrySetting } from './retry-CjvSlKGW.js';
|
|
7
|
+
export { A as AssistantContentPart, a as AssistantGenerationMetadata, b as AssistantMessage, C as CompletionModel, c as CompletionModelInfo, d as CompletionModelStreamEvent, e as CompletionRequest, f as CompletionResponse, g as CompletionResult, h as CompletionSource, i as CompletionStreamEvent, j as CompletionTool, k as ContextUsage, D as Document, F as FileData, l as FilePart, I as ImageDetail, m as ImagePart, J as JsonObject, n as JsonPrimitive, o as JsonValue, M as Message, p as ModelContextLimits, P as ProviderTool, q as ProviderToolCall, R as ReasoningContentType, r as ReasoningDetail, s as ReasoningPart, S as SystemMessage, T as TextPart, t as ToolCallPart, u as ToolChoice, v as ToolDefinition, w as ToolMessage, x as ToolResultContentPart, y as ToolResultOutput, z as ToolResultPart, U as Usage, B as UserContentPart, E as UserMessage, G as calculateContextUsage, H as getAssistantGenerationMetadata, K as isProviderTool, L as resolveModelContextLimits, N as withContextUsage } from './types-D9rKQ_as.js';
|
|
8
|
+
export { C as CompletionBaseOptions, a as CompletionInput, G as GenerateCompletionOptions, b as GenerateStructuredCompletionOptions, M as MessageMetadataSchema, S as StreamCompletionOptions, c as StreamStructuredCompletionOptions, d as createMessageSchema, g as generateCompletion, i as isJsonValue, e as isMessage, m as messageSchema, f as messagesSchema, p as parseMessage, h as parseMessages, s as streamCompletion } from './message-schema-B2M7AYzR.js';
|
|
9
|
+
export { a as allow, b as block, d as defineGuardrailPolicy, c as defineInputGuardrail, e as defineOutputGuardrail, g as guardrails } from './text-C_6eKrbC.js';
|
|
10
|
+
export { G as GuardrailBoundary, a as GuardrailDecisionRecord, b as GuardrailMode, c as GuardrailPolicy, d as GuardrailPolicyInput, e as GuardrailPolicyOptions, I as InputGuardrail, f as InputGuardrailActions, g as InputGuardrailContext, O as OutputGuardrail, h as OutputGuardrailActions, i as OutputGuardrailContext } from './types-CIPaIbZo.js';
|
|
11
|
+
export { GenerateImageOptions, GeneratedImage, ImageGenerationModel, ImageGenerationRequest, ImageGenerationResult, generateImage } from './image-generation/index.js';
|
|
12
|
+
export { MemoryCompactionConflictError, MemoryCompactionError, createMemoryScopeKey, createSummaryMemoryCompactor, isMemoryCompactionMessage } from './memory/index.js';
|
|
13
|
+
export { C as CreateMemoryScopeKeyOptions, a as CreateSummaryMemoryCompactorOptions, M as MemoryAppendOptions, b as MemoryClearOptions, c as MemoryCompactionCapability, d as MemoryCompactionConflictRetryOptions, e as MemoryCompactionInfo, f as MemoryCompactionMessage, g as MemoryCompactionMetadata, h as MemoryCompactionOptions, i as MemoryCompactionReplacePrefixOptions, j as MemoryCompactionReplacePrefixResult, k as MemoryCompactionSnapshot, l as MemoryCompactionSnapshotOptions, m as MemoryCompactor, n as MemoryCompactorInput, o as MemoryCompactorResult, p as MemoryConversation, q as MemoryConversationGetOptions, r as MemoryConversationListOptions, s as MemoryConversationMessage, t as MemoryConversationSummary, u as MemoryErrorOptions, v as MemoryInspector, w as MemoryLoadOptions, x as MemoryOptions, y as MemorySavePolicy, z as MemoryScope, A as MemoryScopeKeyOptions, B as MemoryScopeKeyResolver, D as MemoryStore } from './types-DbolvLtZ.js';
|
|
12
14
|
export { Z as ZodSchema } from './zod-schema-C7F4clpm.js';
|
|
13
15
|
export { loadSkills, skill } from './skills/index.js';
|
|
14
|
-
export { S as SkillValidationError } from './types-
|
|
15
|
-
export {
|
|
16
|
-
export {
|
|
17
|
-
export { A as
|
|
18
|
-
export { TranscribeOptions, TranscriptionModel, TranscriptionRequest,
|
|
19
|
-
|
|
20
|
-
import '
|
|
21
|
-
import '
|
|
22
|
-
import '@modelcontextprotocol/sdk/client/
|
|
16
|
+
export { S as SkillValidationError } from './types-RT3cuyRk.js';
|
|
17
|
+
export { GenerateSpeechOptions, SpeechGenerationModel, SpeechGenerationRequest, SpeechGenerationResult, generateSpeech } from './speech-generation/index.js';
|
|
18
|
+
export { C as CreateToolOptions, c as createQuestionTool, a as createThinkTool, b as createTool } from './think-tool-D8frXxwV.js';
|
|
19
|
+
export { A as AnyTool, T as Tool, a as ToolApprovalContext, b as ToolApprovalRequirement, c as ToolCallContext, d as ToolCallStreamEvent, e as ToolRequiresApproval } from './tool-r62gf3QY.js';
|
|
20
|
+
export { TranscribeOptions, TranscriptionAudio, TranscriptionModel, TranscriptionRequest, TranscriptionResult, transcribe } from './transcription/index.js';
|
|
21
|
+
import './client-DvUatElp.js';
|
|
22
|
+
import 'node:child_process';
|
|
23
|
+
import 'node:stream';
|
|
24
|
+
import '@modelcontextprotocol/sdk/client/auth.js';
|
|
23
25
|
import '@modelcontextprotocol/sdk/client/streamableHttp.js';
|
|
24
|
-
import '
|
|
25
|
-
import './
|
|
26
|
-
import './types-
|
|
26
|
+
import '@modelcontextprotocol/sdk/shared/transport.js';
|
|
27
|
+
import './dynamic-tools-AEBOTgu1.js';
|
|
28
|
+
import './types-Cr4uiYo5.js';
|
|
29
|
+
import './types-C3gv9EX6.js';
|
|
27
30
|
import './type-utils-CtHVDRn_.js';
|
|
28
31
|
import 'zod';
|
package/dist/index.js
CHANGED
|
@@ -2,65 +2,78 @@ import {
|
|
|
2
2
|
SkillValidationError,
|
|
3
3
|
loadSkills,
|
|
4
4
|
skill
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-LXMAFD23.js";
|
|
6
6
|
import {
|
|
7
7
|
transcribe
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import {
|
|
10
|
-
coreMessagesToUIMessages,
|
|
11
|
-
uiMessagesToCoreMessages
|
|
12
|
-
} from "./chunk-RXKHOYEH.js";
|
|
8
|
+
} from "./chunk-GKDERULJ.js";
|
|
13
9
|
import {
|
|
14
10
|
generateImage
|
|
15
|
-
} from "./chunk-
|
|
16
|
-
import
|
|
17
|
-
|
|
11
|
+
} from "./chunk-BEYBU7VJ.js";
|
|
12
|
+
import {
|
|
13
|
+
createMemoryScopeKey
|
|
14
|
+
} from "./chunk-QOUPWOGW.js";
|
|
18
15
|
import {
|
|
19
16
|
generateSpeech
|
|
20
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-AI5JMUW7.js";
|
|
21
18
|
import {
|
|
22
19
|
Agent,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
20
|
+
agentContinuationSchema,
|
|
21
|
+
agentInteractionRequestSchema,
|
|
22
|
+
agentInteractionResponseSchema,
|
|
23
|
+
createVectorContext,
|
|
24
|
+
isVectorContext,
|
|
25
|
+
parseAgentContinuation,
|
|
26
|
+
parseAgentInteractionRequest,
|
|
27
|
+
parseAgentInteractionResponse
|
|
28
|
+
} from "./chunk-BY4OMNIU.js";
|
|
28
29
|
import "./chunk-YK4WAAS4.js";
|
|
30
|
+
import "./chunk-5MK3BISB.js";
|
|
31
|
+
import "./chunk-CQNNSZPG.js";
|
|
29
32
|
import {
|
|
30
33
|
createMiddleware,
|
|
34
|
+
createQuestionTool,
|
|
31
35
|
createThinkTool
|
|
32
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-KV6QCRQ4.js";
|
|
33
37
|
import {
|
|
34
38
|
createTool
|
|
35
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-3CMWKK32.js";
|
|
36
40
|
import {
|
|
37
41
|
MemoryCompactionConflictError,
|
|
38
42
|
MemoryCompactionError,
|
|
39
43
|
createSummaryMemoryCompactor,
|
|
40
|
-
|
|
41
|
-
} from "./chunk-
|
|
42
|
-
import "./chunk-
|
|
43
|
-
import "./chunk-I6G7BC42.js";
|
|
44
|
+
isMemoryCompactionMessage
|
|
45
|
+
} from "./chunk-KFR4CDGK.js";
|
|
46
|
+
import "./chunk-VKYZZXP5.js";
|
|
44
47
|
import {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
AgentRunBlockedError,
|
|
49
|
+
AgentRunCancelledError,
|
|
50
|
+
AgentStreamClosedError,
|
|
51
|
+
AgentToolSuspensionError,
|
|
52
|
+
MaxTurnsError
|
|
53
|
+
} from "./chunk-TRQ3XRFD.js";
|
|
54
|
+
import "./chunk-GQL5KRAH.js";
|
|
55
|
+
import "./chunk-3RM57ZT2.js";
|
|
56
|
+
import "./chunk-MGNTXGTX.js";
|
|
50
57
|
import {
|
|
51
|
-
AssistantContent,
|
|
52
|
-
Message,
|
|
53
|
-
ToolContent,
|
|
54
58
|
Usage,
|
|
55
|
-
UserContent,
|
|
56
59
|
calculateContextUsage,
|
|
60
|
+
generateCompletion,
|
|
57
61
|
getAssistantGenerationMetadata,
|
|
58
|
-
isJsonValue,
|
|
59
62
|
isProviderTool,
|
|
60
|
-
|
|
63
|
+
resolveModelContextLimits,
|
|
64
|
+
streamCompletion,
|
|
61
65
|
withContextUsage
|
|
62
|
-
} from "./chunk-
|
|
63
|
-
import
|
|
66
|
+
} from "./chunk-D2ECOWN5.js";
|
|
67
|
+
import {
|
|
68
|
+
createMessageSchema,
|
|
69
|
+
isJsonValue,
|
|
70
|
+
isMessage,
|
|
71
|
+
messageSchema,
|
|
72
|
+
messagesSchema,
|
|
73
|
+
parseMessage,
|
|
74
|
+
parseMessages
|
|
75
|
+
} from "./chunk-PK5LKOFL.js";
|
|
76
|
+
import "./chunk-FN7HLLAZ.js";
|
|
64
77
|
import {
|
|
65
78
|
allow,
|
|
66
79
|
block,
|
|
@@ -68,47 +81,57 @@ import {
|
|
|
68
81
|
defineInputGuardrail,
|
|
69
82
|
defineOutputGuardrail,
|
|
70
83
|
guardrails
|
|
71
|
-
} from "./chunk-
|
|
84
|
+
} from "./chunk-AZB6N7P4.js";
|
|
72
85
|
export {
|
|
73
86
|
Agent,
|
|
87
|
+
AgentRunBlockedError,
|
|
74
88
|
AgentRunCancelledError,
|
|
75
|
-
|
|
89
|
+
AgentStreamClosedError,
|
|
90
|
+
AgentToolSuspensionError,
|
|
76
91
|
MaxTurnsError,
|
|
77
92
|
MemoryCompactionConflictError,
|
|
78
93
|
MemoryCompactionError,
|
|
79
|
-
Message,
|
|
80
94
|
SkillValidationError,
|
|
81
|
-
ToolContent,
|
|
82
95
|
Usage,
|
|
83
|
-
|
|
96
|
+
agentContinuationSchema,
|
|
97
|
+
agentInteractionRequestSchema,
|
|
98
|
+
agentInteractionResponseSchema,
|
|
84
99
|
allow,
|
|
85
100
|
block,
|
|
86
101
|
calculateContextUsage,
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
createCompletionStream,
|
|
90
|
-
createContextIndex,
|
|
102
|
+
createMemoryScopeKey,
|
|
103
|
+
createMessageSchema,
|
|
91
104
|
createMiddleware,
|
|
92
|
-
|
|
105
|
+
createQuestionTool,
|
|
93
106
|
createSummaryMemoryCompactor,
|
|
94
107
|
createThinkTool,
|
|
95
108
|
createTool,
|
|
109
|
+
createVectorContext,
|
|
96
110
|
defineGuardrailPolicy,
|
|
97
111
|
defineInputGuardrail,
|
|
98
112
|
defineOutputGuardrail,
|
|
113
|
+
generateCompletion,
|
|
99
114
|
generateImage,
|
|
100
115
|
generateSpeech,
|
|
101
116
|
getAssistantGenerationMetadata,
|
|
102
117
|
guardrails,
|
|
103
|
-
isContextIndex,
|
|
104
118
|
isJsonValue,
|
|
105
|
-
|
|
119
|
+
isMemoryCompactionMessage,
|
|
120
|
+
isMessage,
|
|
106
121
|
isProviderTool,
|
|
122
|
+
isVectorContext,
|
|
107
123
|
loadSkills,
|
|
108
|
-
|
|
124
|
+
messageSchema,
|
|
125
|
+
messagesSchema,
|
|
126
|
+
parseAgentContinuation,
|
|
127
|
+
parseAgentInteractionRequest,
|
|
128
|
+
parseAgentInteractionResponse,
|
|
129
|
+
parseMessage,
|
|
130
|
+
parseMessages,
|
|
131
|
+
resolveModelContextLimits,
|
|
109
132
|
skill,
|
|
133
|
+
streamCompletion,
|
|
110
134
|
transcribe,
|
|
111
|
-
uiMessagesToCoreMessages,
|
|
112
135
|
withContextUsage
|
|
113
136
|
};
|
|
114
137
|
//# sourceMappingURL=index.js.map
|