@anvia/core 1.2.0 → 1.2.2
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/dist/agent/agent-tool.js +8 -8
- package/dist/agent/agent.js +26 -26
- package/dist/agent/index.d.ts +12 -12
- package/dist/agent/index.js +31 -31
- package/dist/agent/interactions/index.d.ts +1 -1
- package/dist/agent/resolve-options.js +13 -13
- package/dist/agent/resolved-agent.js +27 -27
- package/dist/agent/team/agent-team.js +31 -31
- package/dist/agent/team/index.js +31 -31
- package/dist/agent/tool-catalog.js +12 -12
- package/dist/{agent-C9VhENdj.d.ts → agent-CUZdf9G0.d.ts} +9 -9
- package/dist/{chunk-UTAB3XQI.js → chunk-2JZV4LUS.js} +2 -2
- package/dist/{chunk-TSPQD5HW.js → chunk-3EX524LK.js} +36 -27
- package/dist/chunk-3EX524LK.js.map +1 -0
- package/dist/{chunk-UOGM62JL.js → chunk-3P65RSBB.js} +3 -3
- package/dist/{chunk-RT5LUEO3.js → chunk-4PGI5HYY.js} +9 -9
- package/dist/{chunk-QEPBHHAP.js → chunk-54ZZJRP2.js} +19 -3
- package/dist/chunk-54ZZJRP2.js.map +1 -0
- package/dist/{chunk-BDDC72GF.js → chunk-5HFXHKDD.js} +2 -2
- package/dist/{chunk-QHGYCYV6.js → chunk-5KS4SG2U.js} +4 -4
- package/dist/{chunk-RXKUIJ77.js → chunk-5REZFNZ3.js} +5 -5
- package/dist/{chunk-B47EXUHL.js → chunk-5TMN4MYN.js} +2 -2
- package/dist/{chunk-LKIABZNR.js → chunk-63DUKYEG.js} +3 -3
- package/dist/{chunk-MHOJJYDK.js → chunk-647TQE3E.js} +2 -2
- package/dist/{chunk-HP34GRQX.js → chunk-AS7A2LU5.js} +2 -2
- package/dist/{chunk-BDKFFFVX.js → chunk-BD2USPK5.js} +4 -4
- package/dist/{chunk-B5YTCKUJ.js → chunk-BVAQJOZX.js} +9 -9
- package/dist/{chunk-T4KS577P.js → chunk-FSBDE6RF.js} +7 -6
- package/dist/chunk-FSBDE6RF.js.map +1 -0
- package/dist/{chunk-CKKNO4XB.js → chunk-GSVOMQEE.js} +2 -2
- package/dist/{chunk-TIZGADU4.js → chunk-HAVSSHOW.js} +7 -7
- package/dist/{chunk-TIZGADU4.js.map → chunk-HAVSSHOW.js.map} +1 -1
- package/dist/{chunk-IDNL6IH4.js → chunk-HJ6KTQTZ.js} +7 -1
- package/dist/chunk-HJ6KTQTZ.js.map +1 -0
- package/dist/{chunk-IV6YQTY2.js → chunk-ICDPUAKN.js} +2 -2
- package/dist/{chunk-JB3RFK6K.js → chunk-KSVFGXS6.js} +2 -2
- package/dist/{chunk-F3E2RLC7.js → chunk-KSXA7YK7.js} +3 -3
- package/dist/{chunk-5P2YOQSA.js → chunk-KX2TRKO2.js} +2 -2
- package/dist/{chunk-KZGSXJKU.js → chunk-LMZ54UNC.js} +2 -2
- package/dist/{chunk-PYLPLFJZ.js → chunk-N2AQUFGO.js} +4 -4
- package/dist/{chunk-7KAGWJ5M.js → chunk-NA44V5OE.js} +3 -3
- package/dist/{chunk-5AETKC4L.js → chunk-NSWBPKWH.js} +3 -3
- package/dist/{chunk-J4SINPUA.js → chunk-P6IEZWI3.js} +18 -6
- package/dist/chunk-P6IEZWI3.js.map +1 -0
- package/dist/{chunk-PPJ7SYQL.js → chunk-RGYVR4FE.js} +3 -3
- package/dist/{chunk-47NTHIVB.js → chunk-SCFWN3T2.js} +2 -1
- package/dist/chunk-SCFWN3T2.js.map +1 -0
- package/dist/{chunk-JOQ2T3QP.js → chunk-SIXS4CCU.js} +8 -8
- package/dist/{chunk-23GEYG2X.js → chunk-VCMBQTR4.js} +2 -2
- package/dist/{chunk-BUPC72Y2.js → chunk-VPTAGK7G.js} +3 -3
- package/dist/{chunk-PT777EQ3.js → chunk-VQTSZ4ZW.js} +3 -3
- package/dist/{chunk-6N4ENZO4.js → chunk-VU6YTPPH.js} +2 -2
- package/dist/{chunk-XV3DH5GC.js → chunk-WUZG6B3Q.js} +2 -2
- package/dist/{chunk-XJRNBTIV.js → chunk-YNA3UR42.js} +2 -2
- package/dist/completion/generate-completion.js +4 -4
- package/dist/completion/index.d.ts +3 -3
- package/dist/completion/index.js +4 -4
- package/dist/completion/stream-accumulator.js +2 -2
- package/dist/completion/types.js +1 -1
- package/dist/{dynamic-tools-CNHSPXr1.d.ts → dynamic-tools-BXXLc34l.d.ts} +3 -3
- package/dist/embeddings/index.js +1 -1
- package/dist/evals/advanced-metrics.js +8 -8
- package/dist/evals/cli.js +7 -7
- package/dist/evals/index.d.ts +5 -5
- package/dist/evals/index.js +37 -37
- package/dist/evals/judge.js +6 -6
- package/dist/evals/metrics.js +8 -8
- package/dist/evals/runner.js +6 -6
- package/dist/extractor/extractor.js +5 -5
- package/dist/extractor/index.d.ts +1 -1
- package/dist/extractor/index.js +5 -5
- package/dist/guardrails/index.d.ts +4 -4
- package/dist/image-generation/index.d.ts +1 -1
- package/dist/index.d.ts +13 -13
- package/dist/index.js +34 -34
- package/dist/internal/agent-runtime/agent-run.js +22 -22
- package/dist/internal/agent-runtime/continuation-state.js +4 -4
- package/dist/internal/agent-runtime/interaction-suspension.js +4 -4
- package/dist/internal/agent-runtime/memory.js +6 -6
- package/dist/internal/agent-runtime/prepared-tool-call.js +2 -2
- package/dist/internal/agent-runtime/retrieval.js +10 -10
- package/dist/internal/agent-runtime/tool-execution.js +18 -18
- package/dist/internal/agent.d.ts +43 -10
- package/dist/internal/agent.js +27 -27
- package/dist/internal/completion-request.js +2 -2
- package/dist/internal/team-runtime/member.js +5 -5
- package/dist/internal/team-runtime/run.js +30 -30
- package/dist/internal/team-runtime/tools.js +4 -4
- package/dist/mcp/index.d.ts +4 -4
- package/dist/memory/compaction.js +5 -5
- package/dist/memory/index.d.ts +3 -3
- package/dist/memory/index.js +5 -5
- package/dist/{middleware-CWjnMbiH.d.ts → middleware-DORuwSy-.d.ts} +67 -4
- package/dist/observability/group.js +5 -5
- package/dist/observability/index.d.ts +5 -5
- package/dist/observability/index.js +5 -5
- package/dist/pipeline/index.d.ts +10 -10
- package/dist/pipeline/index.js +6 -6
- package/dist/pipeline/pipeline.js +6 -6
- package/dist/{provider-output-error-OQ4fjw5W.d.ts → provider-output-error-CMVoe1xT.d.ts} +1 -1
- package/dist/skills/index.d.ts +4 -4
- package/dist/skills/index.js +15 -15
- package/dist/skills/load.js +15 -15
- package/dist/skills/tools.js +14 -14
- package/dist/speech-generation/index.d.ts +1 -1
- package/dist/speech-generation/index.js +1 -1
- package/dist/streaming/index.js +2 -1
- package/dist/streaming/readable-stream.js +2 -1
- package/dist/{text-GbW4WYMg.d.ts → text-CklbSG7K.d.ts} +1 -1
- package/dist/{think-tool-YWsV98I5.d.ts → think-tool-2unWbq1w.d.ts} +1 -1
- package/dist/tool/create-tool.js +3 -3
- package/dist/tool/dynamic-tools.js +11 -11
- package/dist/tool/index.d.ts +8 -8
- package/dist/tool/index.js +13 -13
- package/dist/tool/question-tool.js +4 -4
- package/dist/tool/think-tool.js +4 -4
- package/dist/tool/tool.js +1 -1
- package/dist/{tool-DQMZpZSS.d.ts → tool-D_jV3cRZ.d.ts} +38 -1
- package/dist/transcription/index.d.ts +1 -1
- package/dist/{types-DfRPfehE.d.ts → types-0t3BczrD.d.ts} +2 -2
- package/dist/{types-CODGMHnp.d.ts → types-ChyQISt-.d.ts} +1 -1
- package/dist/{types-Bqw0AuFl.d.ts → types-CqiX-4_C.d.ts} +1 -1
- package/dist/{types-C1xYKXF2.d.ts → types-Cu2tEf3V.d.ts} +1 -1
- package/dist/{types-CiHjqE6J.d.ts → types-DYqZKDA8.d.ts} +140 -0
- package/dist/{types-CafU6Ux5.d.ts → types-DhWxTobb.d.ts} +37 -1
- package/dist/vector-store/index.d.ts +4 -4
- package/dist/vector-store/index.js +13 -13
- package/dist/vector-store/ingest.js +5 -5
- package/dist/vector-store/retrieve.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-47NTHIVB.js.map +0 -1
- package/dist/chunk-IDNL6IH4.js.map +0 -1
- package/dist/chunk-J4SINPUA.js.map +0 -1
- package/dist/chunk-QEPBHHAP.js.map +0 -1
- package/dist/chunk-T4KS577P.js.map +0 -1
- package/dist/chunk-TSPQD5HW.js.map +0 -1
- /package/dist/{chunk-UTAB3XQI.js.map → chunk-2JZV4LUS.js.map} +0 -0
- /package/dist/{chunk-UOGM62JL.js.map → chunk-3P65RSBB.js.map} +0 -0
- /package/dist/{chunk-RT5LUEO3.js.map → chunk-4PGI5HYY.js.map} +0 -0
- /package/dist/{chunk-BDDC72GF.js.map → chunk-5HFXHKDD.js.map} +0 -0
- /package/dist/{chunk-QHGYCYV6.js.map → chunk-5KS4SG2U.js.map} +0 -0
- /package/dist/{chunk-RXKUIJ77.js.map → chunk-5REZFNZ3.js.map} +0 -0
- /package/dist/{chunk-B47EXUHL.js.map → chunk-5TMN4MYN.js.map} +0 -0
- /package/dist/{chunk-LKIABZNR.js.map → chunk-63DUKYEG.js.map} +0 -0
- /package/dist/{chunk-MHOJJYDK.js.map → chunk-647TQE3E.js.map} +0 -0
- /package/dist/{chunk-HP34GRQX.js.map → chunk-AS7A2LU5.js.map} +0 -0
- /package/dist/{chunk-BDKFFFVX.js.map → chunk-BD2USPK5.js.map} +0 -0
- /package/dist/{chunk-B5YTCKUJ.js.map → chunk-BVAQJOZX.js.map} +0 -0
- /package/dist/{chunk-CKKNO4XB.js.map → chunk-GSVOMQEE.js.map} +0 -0
- /package/dist/{chunk-IV6YQTY2.js.map → chunk-ICDPUAKN.js.map} +0 -0
- /package/dist/{chunk-JB3RFK6K.js.map → chunk-KSVFGXS6.js.map} +0 -0
- /package/dist/{chunk-F3E2RLC7.js.map → chunk-KSXA7YK7.js.map} +0 -0
- /package/dist/{chunk-5P2YOQSA.js.map → chunk-KX2TRKO2.js.map} +0 -0
- /package/dist/{chunk-KZGSXJKU.js.map → chunk-LMZ54UNC.js.map} +0 -0
- /package/dist/{chunk-PYLPLFJZ.js.map → chunk-N2AQUFGO.js.map} +0 -0
- /package/dist/{chunk-7KAGWJ5M.js.map → chunk-NA44V5OE.js.map} +0 -0
- /package/dist/{chunk-5AETKC4L.js.map → chunk-NSWBPKWH.js.map} +0 -0
- /package/dist/{chunk-PPJ7SYQL.js.map → chunk-RGYVR4FE.js.map} +0 -0
- /package/dist/{chunk-JOQ2T3QP.js.map → chunk-SIXS4CCU.js.map} +0 -0
- /package/dist/{chunk-23GEYG2X.js.map → chunk-VCMBQTR4.js.map} +0 -0
- /package/dist/{chunk-BUPC72Y2.js.map → chunk-VPTAGK7G.js.map} +0 -0
- /package/dist/{chunk-PT777EQ3.js.map → chunk-VQTSZ4ZW.js.map} +0 -0
- /package/dist/{chunk-6N4ENZO4.js.map → chunk-VU6YTPPH.js.map} +0 -0
- /package/dist/{chunk-XV3DH5GC.js.map → chunk-WUZG6B3Q.js.map} +0 -0
- /package/dist/{chunk-XJRNBTIV.js.map → chunk-YNA3UR42.js.map} +0 -0
|
@@ -2,25 +2,25 @@ import {
|
|
|
2
2
|
createToolIndex,
|
|
3
3
|
embedTools,
|
|
4
4
|
isToolIndex
|
|
5
|
-
} from "../chunk-
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-5WLIHNNJ.js";
|
|
8
|
-
import "../chunk-QHGYCYV6.js";
|
|
5
|
+
} from "../chunk-VCMBQTR4.js";
|
|
6
|
+
import "../chunk-5REZFNZ3.js";
|
|
9
7
|
import "../chunk-ESOFEAYK.js";
|
|
10
8
|
import "../chunk-HAAGSIZH.js";
|
|
9
|
+
import "../chunk-5WLIHNNJ.js";
|
|
10
|
+
import "../chunk-5KS4SG2U.js";
|
|
11
|
+
import "../chunk-KO5NMTAM.js";
|
|
12
|
+
import "../chunk-TFIOU6UR.js";
|
|
13
|
+
import "../chunk-GPVXCY5I.js";
|
|
11
14
|
import "../chunk-ERN7P6Q4.js";
|
|
15
|
+
import "../chunk-DU4WA6LQ.js";
|
|
12
16
|
import "../chunk-7F53DOML.js";
|
|
13
17
|
import "../chunk-HHMLE3TZ.js";
|
|
14
|
-
import "../chunk-DU4WA6LQ.js";
|
|
15
18
|
import "../chunk-4FIVU53H.js";
|
|
16
|
-
import "../chunk-KO5NMTAM.js";
|
|
17
|
-
import "../chunk-TFIOU6UR.js";
|
|
18
|
-
import "../chunk-GPVXCY5I.js";
|
|
19
19
|
import "../chunk-5V533R7F.js";
|
|
20
|
-
import "../chunk-
|
|
20
|
+
import "../chunk-WUZG6B3Q.js";
|
|
21
21
|
import "../chunk-YZVFIW5D.js";
|
|
22
|
-
import "../chunk-
|
|
23
|
-
import "../chunk-
|
|
22
|
+
import "../chunk-647TQE3E.js";
|
|
23
|
+
import "../chunk-SCFWN3T2.js";
|
|
24
24
|
import "../chunk-J6S6MT7O.js";
|
|
25
25
|
import "../chunk-BONQTXRQ.js";
|
|
26
26
|
import "../chunk-4C7AXYOM.js";
|
package/dist/tool/index.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
export { d as CreateQuestionToolOptions, e as CreateThinkToolOptions, C as CreateToolOptions, Q as QuestionToolInput, f as QuestionToolOutput, c as createQuestionTool, a as createThinkTool, b as createTool, i as isQuestionTool } from '../think-tool-
|
|
2
|
-
export { C as CreateToolIndexOptions, E as EmbedToolsOptions, T as ToolIndex, a as ToolSearchDocument, c as createToolIndex, e as embedTools, i as isToolIndex } from '../dynamic-tools-
|
|
3
|
-
export { k as AgentMiddleware, C as CompletionRequestMiddlewareArgs, z as CompletionRequestMiddlewareResult, B as CompletionResponseMiddlewareArgs, D as CompletionResponseMiddlewareResult, T as ToolInputMiddlewareArgs, E as ToolInputMiddlewareResult, F as ToolOutputMiddlewareArgs, G as ToolOutputMiddlewareResult, H as ToolResultMiddlewareArgs, I as createMiddleware } from '../middleware-
|
|
4
|
-
export { A as AnyTool, N as NormalizedToolOutput, R as RichToolOutput, T as Tool, a as ToolApprovalContext, b as ToolApprovalRequirement, f as ToolApprovalRunContext, c as ToolCallContext, d as ToolCallStreamEvent, g as ToolOutput, e as ToolRequiresApproval, h as ToolResultSerializationError, n as normalizeToolResultOutput, p as parseToolArgs, t as toolResultContentToText } from '../tool-
|
|
1
|
+
export { d as CreateQuestionToolOptions, e as CreateThinkToolOptions, C as CreateToolOptions, Q as QuestionToolInput, f as QuestionToolOutput, c as createQuestionTool, a as createThinkTool, b as createTool, i as isQuestionTool } from '../think-tool-2unWbq1w.js';
|
|
2
|
+
export { C as CreateToolIndexOptions, E as EmbedToolsOptions, T as ToolIndex, a as ToolSearchDocument, c as createToolIndex, e as embedTools, i as isToolIndex } from '../dynamic-tools-BXXLc34l.js';
|
|
3
|
+
export { k as AgentMiddleware, C as CompletionRequestMiddlewareArgs, z as CompletionRequestMiddlewareResult, B as CompletionResponseMiddlewareArgs, D as CompletionResponseMiddlewareResult, T as ToolInputMiddlewareArgs, E as ToolInputMiddlewareResult, F as ToolOutputMiddlewareArgs, G as ToolOutputMiddlewareResult, H as ToolResultMiddlewareArgs, I as createMiddleware } from '../middleware-DORuwSy-.js';
|
|
4
|
+
export { A as AnyTool, N as NormalizedToolOutput, R as RichToolOutput, T as Tool, a as ToolApprovalContext, b as ToolApprovalRequirement, f as ToolApprovalRunContext, c as ToolCallContext, d as ToolCallStreamEvent, g as ToolOutput, e as ToolRequiresApproval, h as ToolResultSerializationError, n as normalizeToolResultOutput, p as parseToolArgs, t as toolResultContentToText } from '../tool-D_jV3cRZ.js';
|
|
5
5
|
import 'zod';
|
|
6
6
|
import '../zod-schema-C7F4clpm.js';
|
|
7
7
|
import '../agent/interactions/index.js';
|
|
8
|
-
import '../types-
|
|
8
|
+
import '../types-DYqZKDA8.js';
|
|
9
9
|
import '../model-call-options-CZkSw_xN.js';
|
|
10
10
|
import '../retry-CjvSlKGW.js';
|
|
11
11
|
import '../types-Cr4uiYo5.js';
|
|
12
|
-
import '../types-
|
|
13
|
-
import '../types-
|
|
14
|
-
import '../types-
|
|
12
|
+
import '../types-ChyQISt-.js';
|
|
13
|
+
import '../types-CqiX-4_C.js';
|
|
14
|
+
import '../types-DhWxTobb.js';
|
|
15
15
|
|
|
16
16
|
declare class ToolCallError extends Error {
|
|
17
17
|
readonly cause?: unknown | undefined;
|
package/dist/tool/index.js
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
1
|
import "../chunk-JMJFK3A4.js";
|
|
2
2
|
import {
|
|
3
3
|
createThinkTool
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-VU6YTPPH.js";
|
|
5
5
|
import {
|
|
6
6
|
createMiddleware
|
|
7
7
|
} from "../chunk-4AW2633B.js";
|
|
8
8
|
import {
|
|
9
9
|
createQuestionTool,
|
|
10
10
|
isQuestionTool
|
|
11
|
-
} from "../chunk-
|
|
11
|
+
} from "../chunk-ICDPUAKN.js";
|
|
12
12
|
import {
|
|
13
13
|
createToolIndex,
|
|
14
14
|
embedTools,
|
|
15
15
|
isToolIndex
|
|
16
|
-
} from "../chunk-
|
|
17
|
-
import "../chunk-
|
|
18
|
-
import "../chunk-5WLIHNNJ.js";
|
|
19
|
-
import "../chunk-QHGYCYV6.js";
|
|
16
|
+
} from "../chunk-VCMBQTR4.js";
|
|
17
|
+
import "../chunk-5REZFNZ3.js";
|
|
20
18
|
import "../chunk-ESOFEAYK.js";
|
|
21
19
|
import "../chunk-HAAGSIZH.js";
|
|
20
|
+
import "../chunk-5WLIHNNJ.js";
|
|
21
|
+
import "../chunk-5KS4SG2U.js";
|
|
22
|
+
import "../chunk-KO5NMTAM.js";
|
|
23
|
+
import "../chunk-TFIOU6UR.js";
|
|
24
|
+
import "../chunk-GPVXCY5I.js";
|
|
22
25
|
import "../chunk-ERN7P6Q4.js";
|
|
26
|
+
import "../chunk-DU4WA6LQ.js";
|
|
23
27
|
import "../chunk-7F53DOML.js";
|
|
24
28
|
import "../chunk-HHMLE3TZ.js";
|
|
25
|
-
import "../chunk-DU4WA6LQ.js";
|
|
26
29
|
import "../chunk-4FIVU53H.js";
|
|
27
|
-
import "../chunk-KO5NMTAM.js";
|
|
28
|
-
import "../chunk-TFIOU6UR.js";
|
|
29
|
-
import "../chunk-GPVXCY5I.js";
|
|
30
30
|
import "../chunk-5V533R7F.js";
|
|
31
31
|
import {
|
|
32
32
|
createTool
|
|
33
|
-
} from "../chunk-
|
|
33
|
+
} from "../chunk-WUZG6B3Q.js";
|
|
34
34
|
import "../chunk-YZVFIW5D.js";
|
|
35
|
-
import "../chunk-
|
|
35
|
+
import "../chunk-647TQE3E.js";
|
|
36
36
|
import {
|
|
37
37
|
ToolOutput,
|
|
38
38
|
ToolResultSerializationError,
|
|
39
39
|
normalizeToolResultOutput,
|
|
40
40
|
parseToolArgs,
|
|
41
41
|
toolResultContentToText
|
|
42
|
-
} from "../chunk-
|
|
42
|
+
} from "../chunk-SCFWN3T2.js";
|
|
43
43
|
import {
|
|
44
44
|
ToolCallError,
|
|
45
45
|
ToolJsonError,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createQuestionTool,
|
|
3
3
|
isQuestionTool
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-ICDPUAKN.js";
|
|
5
|
+
import "../chunk-WUZG6B3Q.js";
|
|
6
6
|
import "../chunk-YZVFIW5D.js";
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
7
|
+
import "../chunk-647TQE3E.js";
|
|
8
|
+
import "../chunk-SCFWN3T2.js";
|
|
9
9
|
import "../chunk-J6S6MT7O.js";
|
|
10
10
|
import "../chunk-BONQTXRQ.js";
|
|
11
11
|
import "../chunk-4C7AXYOM.js";
|
package/dist/tool/think-tool.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createThinkTool
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-VU6YTPPH.js";
|
|
4
|
+
import "../chunk-WUZG6B3Q.js";
|
|
5
5
|
import "../chunk-YZVFIW5D.js";
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
6
|
+
import "../chunk-647TQE3E.js";
|
|
7
|
+
import "../chunk-SCFWN3T2.js";
|
|
8
8
|
import "../chunk-J6S6MT7O.js";
|
|
9
9
|
import "../chunk-BONQTXRQ.js";
|
|
10
10
|
import "../chunk-4C7AXYOM.js";
|
package/dist/tool/tool.js
CHANGED
|
@@ -1,33 +1,53 @@
|
|
|
1
|
-
import { J as JsonObject, B as ToolDefinition, t as JsonValue, H as ToolResultOutput, G as ToolResultContentPart } from './types-
|
|
1
|
+
import { J as JsonObject, B as ToolDefinition, t as JsonValue, H as ToolResultOutput, G as ToolResultContentPart } from './types-DYqZKDA8.js';
|
|
2
2
|
|
|
3
|
+
/** Identifies the agent run that requested a tool approval. */
|
|
3
4
|
type ToolApprovalRunContext = {
|
|
4
5
|
agentId: string;
|
|
5
6
|
runId: string;
|
|
6
7
|
sessionId?: string;
|
|
7
8
|
metadata?: JsonObject;
|
|
8
9
|
};
|
|
10
|
+
/** Details of the pending tool call being evaluated for approval. */
|
|
9
11
|
type ToolApprovalContext<Args = unknown> = {
|
|
10
12
|
toolName: string;
|
|
11
13
|
args: Args;
|
|
14
|
+
/** The serialized argument string passed to hooks and approval checks. */
|
|
12
15
|
rawArgs: string;
|
|
13
16
|
toolCallId: string;
|
|
14
17
|
callId?: string;
|
|
15
18
|
internalCallId: string;
|
|
16
19
|
run: ToolApprovalRunContext;
|
|
17
20
|
};
|
|
21
|
+
/** An approval demand, with an optional human-readable reason. */
|
|
18
22
|
type ToolApprovalRequirement = {
|
|
19
23
|
reason?: string | undefined;
|
|
20
24
|
};
|
|
25
|
+
/**
|
|
26
|
+
* Whether a tool call needs human approval before execution:
|
|
27
|
+
*
|
|
28
|
+
* - `boolean`: a static requirement
|
|
29
|
+
* - `ToolApprovalRequirement`: a requirement with a reason
|
|
30
|
+
* - a function: evaluated per call, receiving the parsed args and call context
|
|
31
|
+
*/
|
|
21
32
|
type ToolRequiresApproval<Args = unknown> = boolean | ToolApprovalRequirement | ((args: Args, context: ToolApprovalContext<Args>) => boolean | ToolApprovalRequirement | Promise<boolean | ToolApprovalRequirement>);
|
|
33
|
+
/** A child-agent event forwarded through a tool into the parent run's stream. */
|
|
22
34
|
type ToolCallStreamEvent = {
|
|
23
35
|
agentId: string;
|
|
24
36
|
agentName?: string | undefined;
|
|
25
37
|
event: unknown;
|
|
26
38
|
};
|
|
39
|
+
/** Execution context handed to a tool when the run invokes it. */
|
|
27
40
|
type ToolCallContext = {
|
|
41
|
+
/** Emits a child-agent event into the parent run's stream. */
|
|
28
42
|
emitStreamEvent?(event: ToolCallStreamEvent): void | Promise<void>;
|
|
43
|
+
/** Aborted when the run is cancelled or the stream consumer leaves. */
|
|
29
44
|
abortSignal?: AbortSignal | undefined;
|
|
30
45
|
};
|
|
46
|
+
/**
|
|
47
|
+
* A model-callable tool. `definition` builds the model-facing JSON description,
|
|
48
|
+
* `call` executes it, and the optional `parseInput` converts raw model-supplied
|
|
49
|
+
* JSON arguments into the typed `Args` before `call` runs.
|
|
50
|
+
*/
|
|
31
51
|
interface Tool<Args = unknown, Output = unknown> {
|
|
32
52
|
readonly name: string;
|
|
33
53
|
readonly requiresApproval?: ToolRequiresApproval<Args>;
|
|
@@ -35,24 +55,41 @@ interface Tool<Args = unknown, Output = unknown> {
|
|
|
35
55
|
call(args: Args, context?: ToolCallContext): Output | Promise<Output>;
|
|
36
56
|
parseInput?(args: JsonValue): Args;
|
|
37
57
|
}
|
|
58
|
+
/** A tool with its argument and output types erased, e.g. as stored in an agent's catalog. */
|
|
38
59
|
type AnyTool = Omit<Tool<unknown, unknown>, "requiresApproval"> & {
|
|
39
60
|
readonly requiresApproval?: unknown;
|
|
40
61
|
};
|
|
41
62
|
declare const richToolOutput: unique symbol;
|
|
63
|
+
/**
|
|
64
|
+
* A tool result carrying mixed content parts (text, files), created with
|
|
65
|
+
* {@link ToolOutput.content}. The brand symbol keeps plain objects from
|
|
66
|
+
* impersonating rich outputs.
|
|
67
|
+
*/
|
|
42
68
|
type RichToolOutput = Readonly<{
|
|
43
69
|
[richToolOutput]: true;
|
|
44
70
|
content: readonly ToolResultContentPart[];
|
|
45
71
|
}>;
|
|
72
|
+
/** Normalized tool result as stored in tool messages. */
|
|
46
73
|
type NormalizedToolOutput = ToolResultOutput;
|
|
74
|
+
/** Thrown when a tool returns a value that cannot be represented as a tool result. */
|
|
47
75
|
declare class ToolResultSerializationError extends TypeError {
|
|
48
76
|
readonly output: unknown;
|
|
49
77
|
constructor(output: unknown);
|
|
50
78
|
}
|
|
79
|
+
/** Helpers for building tool results. */
|
|
51
80
|
declare const ToolOutput: {
|
|
81
|
+
/** Wraps content parts so a tool can return text and files together. */
|
|
52
82
|
content(content: readonly ToolResultContentPart[]): RichToolOutput;
|
|
53
83
|
};
|
|
84
|
+
/**
|
|
85
|
+
* Coerces a tool's return value into a normalized result: strings become text,
|
|
86
|
+
* rich outputs are validated, and strict JSON values become JSON results.
|
|
87
|
+
* Anything else throws {@link ToolResultSerializationError}.
|
|
88
|
+
*/
|
|
54
89
|
declare function normalizeToolResultOutput(output: unknown): NormalizedToolOutput;
|
|
90
|
+
/** Renders tool result content as text; file parts become `[file:<mediaType>]` placeholders. */
|
|
55
91
|
declare function toolResultContentToText(content: readonly ToolResultContentPart[]): string;
|
|
92
|
+
/** Parses and JSON-validates the raw argument string supplied by the model. */
|
|
56
93
|
declare function parseToolArgs(args: string): JsonValue;
|
|
57
94
|
|
|
58
95
|
export { type AnyTool as A, type NormalizedToolOutput as N, type RichToolOutput as R, type Tool as T, type ToolApprovalContext as a, type ToolApprovalRequirement as b, type ToolCallContext as c, type ToolCallStreamEvent as d, type ToolRequiresApproval as e, type ToolApprovalRunContext as f, ToolOutput as g, ToolResultSerializationError as h, normalizeToolResultOutput as n, parseToolArgs as p, toolResultContentToText as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { M as ModelCallOptions } from '../model-call-options-CZkSw_xN.js';
|
|
2
2
|
import { b as RetrySetting } from '../retry-CjvSlKGW.js';
|
|
3
3
|
export { R as RetryContext, a as RetryOptions } from '../retry-CjvSlKGW.js';
|
|
4
|
-
import { J as JsonObject } from '../types-
|
|
4
|
+
import { J as JsonObject } from '../types-DYqZKDA8.js';
|
|
5
5
|
|
|
6
6
|
type TranscriptionRequest = {
|
|
7
7
|
data: Uint8Array;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { J as JsonObject } from './types-
|
|
2
|
-
import { A as AnyTool } from './tool-
|
|
1
|
+
import { J as JsonObject } from './types-DYqZKDA8.js';
|
|
2
|
+
import { A as AnyTool } from './tool-D_jV3cRZ.js';
|
|
3
3
|
|
|
4
4
|
type McpServerInfo = {
|
|
5
5
|
readonly name: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { b as RetrySetting } from './retry-CjvSlKGW.js';
|
|
2
|
-
import { J as JsonObject } from './types-
|
|
2
|
+
import { J as JsonObject } from './types-DYqZKDA8.js';
|
|
3
3
|
import { b as VectorMetadataValue, V as VectorMetadata, a as EmbeddedDocument, S as SparseVector, E as EmbeddingModel, c as SparseEmbeddingModel } from './types-Cr4uiYo5.js';
|
|
4
4
|
|
|
5
5
|
type VectorFilter = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { M as Message, J as JsonObject, U as Usage } from './types-
|
|
1
|
+
import { M as Message, J as JsonObject, U as Usage } from './types-DYqZKDA8.js';
|
|
2
2
|
|
|
3
3
|
type MaybePromise<T> = T | Promise<T>;
|
|
4
4
|
type DeepReadonly<T> = T extends (...args: never[]) => unknown ? T : T extends readonly (infer Item)[] ? readonly DeepReadonly<Item>[] : T extends object ? {
|