@anvia/core 1.6.1 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/dist/agent/agent-tool.js +4 -4
- package/dist/agent/agent.js +17 -17
- package/dist/agent/index.d.ts +8 -8
- package/dist/agent/index.js +21 -21
- package/dist/agent/resolve-options.js +6 -6
- package/dist/agent/resolved-agent.js +18 -18
- package/dist/agent/team/agent-team.js +21 -21
- package/dist/agent/team/index.js +21 -21
- package/dist/agent/tool-catalog.js +6 -6
- package/dist/{agent-BUc18r6A.d.ts → agent-BOoZ3jbr.d.ts} +5 -5
- package/dist/chunk-5H5EHU5O.js +7 -0
- package/dist/chunk-5H5EHU5O.js.map +1 -0
- package/dist/{chunk-5CQRCTIN.js → chunk-5ZS3DPPC.js} +4 -4
- package/dist/{chunk-LGMH6PCB.js → chunk-6EJHZEXU.js} +6 -6
- package/dist/{chunk-7G3YQQVE.js → chunk-7NYFTW7I.js} +3 -3
- package/dist/{chunk-B57NNDEF.js → chunk-C36RVQHF.js} +27 -8
- package/dist/chunk-C36RVQHF.js.map +1 -0
- package/dist/{chunk-CJKGTEN4.js → chunk-E5MIZ6Z5.js} +2 -2
- package/dist/{chunk-T3ZOZEAB.js → chunk-IZH2ZAE3.js} +2 -2
- package/dist/{chunk-AQ47TF5K.js → chunk-JJSMONFE.js} +2 -2
- package/dist/{chunk-Y365ABZY.js → chunk-JU3RX364.js} +2 -2
- package/dist/{chunk-O7NN7PF4.js → chunk-KRQ2HFXW.js} +3 -3
- package/dist/{chunk-PV6KJWYO.js → chunk-MYHGOXHQ.js} +2 -2
- package/dist/{chunk-XJ5X3NI4.js → chunk-OBM7JJCK.js} +2 -2
- package/dist/{chunk-LWF6AHDG.js → chunk-OXIK4SIH.js} +2 -2
- package/dist/{chunk-KITX3HDN.js → chunk-SBWSXEIH.js} +1 -1
- package/dist/chunk-SBWSXEIH.js.map +1 -0
- package/dist/{chunk-HILMAFZK.js → chunk-VDHMFJCD.js} +2 -2
- package/dist/{chunk-SCFWN3T2.js → chunk-VHPT2C4P.js} +1 -1
- package/dist/chunk-VHPT2C4P.js.map +1 -0
- package/dist/{chunk-647TQE3E.js → chunk-WCJRGYF7.js} +5 -5
- package/dist/{chunk-5TGVDMGM.js → chunk-XH2CVR4V.js} +2 -2
- package/dist/{chunk-7V3DKQTI.js → chunk-Y7Z5EHJD.js} +5 -5
- package/dist/{chunk-6E6ABRJ6.js → chunk-ZMAF3I4H.js} +2 -2
- package/dist/{chunk-BI3T62GL.js → chunk-ZRW27E32.js} +24 -17
- package/dist/chunk-ZRW27E32.js.map +1 -0
- package/dist/{dynamic-tools-BXXLc34l.d.ts → dynamic-tools-B3OjYyhC.d.ts} +1 -1
- package/dist/evals/index.d.ts +2 -2
- package/dist/index.d.ts +7 -7
- package/dist/index.js +26 -26
- package/dist/internal/agent-runtime/agent-run.js +13 -13
- package/dist/internal/agent-runtime/execution.js +7 -0
- package/dist/internal/agent-runtime/execution.js.map +1 -0
- package/dist/internal/agent-runtime/prepared-tool-call.js +2 -2
- package/dist/internal/agent-runtime/retrieval.js +4 -4
- package/dist/internal/agent-runtime/run-options.js +1 -1
- package/dist/internal/agent-runtime/tool-execution.js +9 -9
- package/dist/internal/agent.d.ts +30 -8
- package/dist/internal/agent.js +22 -18
- package/dist/internal/team-runtime/run.js +20 -20
- package/dist/internal/team-runtime/tools.js +4 -4
- package/dist/mcp/index.d.ts +3 -3
- package/dist/{middleware-BxzML2hK.d.ts → middleware-BNxyEpUX.d.ts} +1 -1
- package/dist/observability/index.d.ts +2 -2
- package/dist/pipeline/index.d.ts +6 -6
- package/dist/skills/index.d.ts +3 -3
- package/dist/skills/index.js +10 -10
- package/dist/skills/load.js +10 -10
- package/dist/skills/tools.js +9 -9
- package/dist/speech-generation/index.js +1 -1
- package/dist/{think-tool-2unWbq1w.d.ts → think-tool-DJbtUDZm.d.ts} +1 -1
- package/dist/tool/create-tool.js +3 -3
- package/dist/tool/dynamic-tools.js +5 -5
- package/dist/tool/index.d.ts +4 -4
- package/dist/tool/index.js +12 -12
- 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-D_jV3cRZ.d.ts → tool-W1cAPuRF.d.ts} +2 -0
- package/dist/{types-0t3BczrD.d.ts → types-94Q2mPRa.d.ts} +1 -1
- package/dist/{types-Cu2tEf3V.d.ts → types-CIG2loIE.d.ts} +1 -1
- package/dist/vector-store/index.d.ts +1 -1
- package/dist/vector-store/index.js +4 -4
- package/package.json +1 -1
- package/dist/chunk-B57NNDEF.js.map +0 -1
- package/dist/chunk-BI3T62GL.js.map +0 -1
- package/dist/chunk-KITX3HDN.js.map +0 -1
- package/dist/chunk-SCFWN3T2.js.map +0 -1
- /package/dist/{chunk-5CQRCTIN.js.map → chunk-5ZS3DPPC.js.map} +0 -0
- /package/dist/{chunk-LGMH6PCB.js.map → chunk-6EJHZEXU.js.map} +0 -0
- /package/dist/{chunk-7G3YQQVE.js.map → chunk-7NYFTW7I.js.map} +0 -0
- /package/dist/{chunk-CJKGTEN4.js.map → chunk-E5MIZ6Z5.js.map} +0 -0
- /package/dist/{chunk-T3ZOZEAB.js.map → chunk-IZH2ZAE3.js.map} +0 -0
- /package/dist/{chunk-AQ47TF5K.js.map → chunk-JJSMONFE.js.map} +0 -0
- /package/dist/{chunk-Y365ABZY.js.map → chunk-JU3RX364.js.map} +0 -0
- /package/dist/{chunk-O7NN7PF4.js.map → chunk-KRQ2HFXW.js.map} +0 -0
- /package/dist/{chunk-PV6KJWYO.js.map → chunk-MYHGOXHQ.js.map} +0 -0
- /package/dist/{chunk-XJ5X3NI4.js.map → chunk-OBM7JJCK.js.map} +0 -0
- /package/dist/{chunk-LWF6AHDG.js.map → chunk-OXIK4SIH.js.map} +0 -0
- /package/dist/{chunk-HILMAFZK.js.map → chunk-VDHMFJCD.js.map} +0 -0
- /package/dist/{chunk-647TQE3E.js.map → chunk-WCJRGYF7.js.map} +0 -0
- /package/dist/{chunk-5TGVDMGM.js.map → chunk-XH2CVR4V.js.map} +0 -0
- /package/dist/{chunk-7V3DKQTI.js.map → chunk-Y7Z5EHJD.js.map} +0 -0
- /package/dist/{chunk-6E6ABRJ6.js.map → chunk-ZMAF3I4H.js.map} +0 -0
package/dist/skills/index.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import "../chunk-HTI343NP.js";
|
|
2
2
|
import {
|
|
3
3
|
loadSkills
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-5ZS3DPPC.js";
|
|
5
|
+
import "../chunk-OBM7JJCK.js";
|
|
5
6
|
import "../chunk-JBQNCUXA.js";
|
|
6
7
|
import {
|
|
7
8
|
skill
|
|
8
9
|
} from "../chunk-ZUFS6R7L.js";
|
|
9
|
-
import "../chunk-XJ5X3NI4.js";
|
|
10
10
|
import {
|
|
11
11
|
SkillValidationError
|
|
12
12
|
} from "../chunk-B5JQDR33.js";
|
|
13
13
|
import "../chunk-V4OZ7ISA.js";
|
|
14
|
-
import "../chunk-2NLINXRF.js";
|
|
15
14
|
import "../chunk-JMJFK3A4.js";
|
|
16
15
|
import "../chunk-4AW2633B.js";
|
|
17
|
-
import "../chunk-
|
|
18
|
-
import "../chunk-
|
|
19
|
-
import "../chunk-
|
|
20
|
-
import "../chunk-
|
|
16
|
+
import "../chunk-IZH2ZAE3.js";
|
|
17
|
+
import "../chunk-2NLINXRF.js";
|
|
18
|
+
import "../chunk-ZMAF3I4H.js";
|
|
19
|
+
import "../chunk-XH2CVR4V.js";
|
|
20
|
+
import "../chunk-MYHGOXHQ.js";
|
|
21
21
|
import "../chunk-5WLIHNNJ.js";
|
|
22
22
|
import "../chunk-3FIX7GLM.js";
|
|
23
23
|
import "../chunk-ESOFEAYK.js";
|
|
@@ -31,11 +31,11 @@ import "../chunk-KO5NMTAM.js";
|
|
|
31
31
|
import "../chunk-TFIOU6UR.js";
|
|
32
32
|
import "../chunk-GPVXCY5I.js";
|
|
33
33
|
import "../chunk-5V533R7F.js";
|
|
34
|
-
import "../chunk-
|
|
35
|
-
import "../chunk-
|
|
34
|
+
import "../chunk-JU3RX364.js";
|
|
35
|
+
import "../chunk-WCJRGYF7.js";
|
|
36
36
|
import "../chunk-YZVFIW5D.js";
|
|
37
|
-
import "../chunk-SCFWN3T2.js";
|
|
38
37
|
import "../chunk-J6S6MT7O.js";
|
|
38
|
+
import "../chunk-VHPT2C4P.js";
|
|
39
39
|
import "../chunk-BONQTXRQ.js";
|
|
40
40
|
import "../chunk-4C7AXYOM.js";
|
|
41
41
|
import "../chunk-SQAAVYJG.js";
|
package/dist/skills/load.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
loadSkills
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-5ZS3DPPC.js";
|
|
4
|
+
import "../chunk-OBM7JJCK.js";
|
|
4
5
|
import "../chunk-JBQNCUXA.js";
|
|
5
|
-
import "../chunk-XJ5X3NI4.js";
|
|
6
|
-
import "../chunk-2NLINXRF.js";
|
|
7
6
|
import "../chunk-JMJFK3A4.js";
|
|
8
7
|
import "../chunk-4AW2633B.js";
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-
|
|
12
|
-
import "../chunk-
|
|
8
|
+
import "../chunk-IZH2ZAE3.js";
|
|
9
|
+
import "../chunk-2NLINXRF.js";
|
|
10
|
+
import "../chunk-ZMAF3I4H.js";
|
|
11
|
+
import "../chunk-XH2CVR4V.js";
|
|
12
|
+
import "../chunk-MYHGOXHQ.js";
|
|
13
13
|
import "../chunk-5WLIHNNJ.js";
|
|
14
14
|
import "../chunk-3FIX7GLM.js";
|
|
15
15
|
import "../chunk-ESOFEAYK.js";
|
|
@@ -23,11 +23,11 @@ import "../chunk-KO5NMTAM.js";
|
|
|
23
23
|
import "../chunk-TFIOU6UR.js";
|
|
24
24
|
import "../chunk-GPVXCY5I.js";
|
|
25
25
|
import "../chunk-5V533R7F.js";
|
|
26
|
-
import "../chunk-
|
|
27
|
-
import "../chunk-
|
|
26
|
+
import "../chunk-JU3RX364.js";
|
|
27
|
+
import "../chunk-WCJRGYF7.js";
|
|
28
28
|
import "../chunk-YZVFIW5D.js";
|
|
29
|
-
import "../chunk-SCFWN3T2.js";
|
|
30
29
|
import "../chunk-J6S6MT7O.js";
|
|
30
|
+
import "../chunk-VHPT2C4P.js";
|
|
31
31
|
import "../chunk-BONQTXRQ.js";
|
|
32
32
|
import "../chunk-4C7AXYOM.js";
|
|
33
33
|
import "../chunk-SQAAVYJG.js";
|
package/dist/skills/tools.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createSkillTools
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-2NLINXRF.js";
|
|
3
|
+
} from "../chunk-OBM7JJCK.js";
|
|
5
4
|
import "../chunk-JMJFK3A4.js";
|
|
6
5
|
import "../chunk-4AW2633B.js";
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
6
|
+
import "../chunk-IZH2ZAE3.js";
|
|
7
|
+
import "../chunk-2NLINXRF.js";
|
|
8
|
+
import "../chunk-ZMAF3I4H.js";
|
|
9
|
+
import "../chunk-XH2CVR4V.js";
|
|
10
|
+
import "../chunk-MYHGOXHQ.js";
|
|
11
11
|
import "../chunk-5WLIHNNJ.js";
|
|
12
12
|
import "../chunk-3FIX7GLM.js";
|
|
13
13
|
import "../chunk-ESOFEAYK.js";
|
|
@@ -21,11 +21,11 @@ import "../chunk-KO5NMTAM.js";
|
|
|
21
21
|
import "../chunk-TFIOU6UR.js";
|
|
22
22
|
import "../chunk-GPVXCY5I.js";
|
|
23
23
|
import "../chunk-5V533R7F.js";
|
|
24
|
-
import "../chunk-
|
|
25
|
-
import "../chunk-
|
|
24
|
+
import "../chunk-JU3RX364.js";
|
|
25
|
+
import "../chunk-WCJRGYF7.js";
|
|
26
26
|
import "../chunk-YZVFIW5D.js";
|
|
27
|
-
import "../chunk-SCFWN3T2.js";
|
|
28
27
|
import "../chunk-J6S6MT7O.js";
|
|
28
|
+
import "../chunk-VHPT2C4P.js";
|
|
29
29
|
import "../chunk-BONQTXRQ.js";
|
|
30
30
|
import "../chunk-4C7AXYOM.js";
|
|
31
31
|
import "../chunk-SQAAVYJG.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { Z as ZodSchema } from './zod-schema-C7F4clpm.js';
|
|
3
|
-
import { e as ToolRequiresApproval, c as ToolCallContext, T as Tool } from './tool-
|
|
3
|
+
import { e as ToolRequiresApproval, c as ToolCallContext, T as Tool } from './tool-W1cAPuRF.js';
|
|
4
4
|
import { AgentQuestionPrompt, AgentQuestionAnswer } from './agent/interactions/index.js';
|
|
5
5
|
|
|
6
6
|
type CreateToolOptions<InputSchema extends ZodSchema, OutputSchema extends ZodSchema | undefined = undefined, Output = unknown> = {
|
package/dist/tool/create-tool.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createTool
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-JU3RX364.js";
|
|
4
|
+
import "../chunk-WCJRGYF7.js";
|
|
5
5
|
import "../chunk-YZVFIW5D.js";
|
|
6
|
-
import "../chunk-SCFWN3T2.js";
|
|
7
6
|
import "../chunk-J6S6MT7O.js";
|
|
7
|
+
import "../chunk-VHPT2C4P.js";
|
|
8
8
|
import "../chunk-BONQTXRQ.js";
|
|
9
9
|
import "../chunk-4C7AXYOM.js";
|
|
10
10
|
import "../chunk-SQAAVYJG.js";
|
|
@@ -2,8 +2,8 @@ import {
|
|
|
2
2
|
createToolIndex,
|
|
3
3
|
embedTools,
|
|
4
4
|
isToolIndex
|
|
5
|
-
} from "../chunk-
|
|
6
|
-
import "../chunk-
|
|
5
|
+
} from "../chunk-XH2CVR4V.js";
|
|
6
|
+
import "../chunk-MYHGOXHQ.js";
|
|
7
7
|
import "../chunk-5WLIHNNJ.js";
|
|
8
8
|
import "../chunk-3FIX7GLM.js";
|
|
9
9
|
import "../chunk-ESOFEAYK.js";
|
|
@@ -17,11 +17,11 @@ import "../chunk-KO5NMTAM.js";
|
|
|
17
17
|
import "../chunk-TFIOU6UR.js";
|
|
18
18
|
import "../chunk-GPVXCY5I.js";
|
|
19
19
|
import "../chunk-5V533R7F.js";
|
|
20
|
-
import "../chunk-
|
|
21
|
-
import "../chunk-
|
|
20
|
+
import "../chunk-JU3RX364.js";
|
|
21
|
+
import "../chunk-WCJRGYF7.js";
|
|
22
22
|
import "../chunk-YZVFIW5D.js";
|
|
23
|
-
import "../chunk-SCFWN3T2.js";
|
|
24
23
|
import "../chunk-J6S6MT7O.js";
|
|
24
|
+
import "../chunk-VHPT2C4P.js";
|
|
25
25
|
import "../chunk-BONQTXRQ.js";
|
|
26
26
|
import "../chunk-4C7AXYOM.js";
|
|
27
27
|
import "../chunk-SQAAVYJG.js";
|
package/dist/tool/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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-DJbtUDZm.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-B3OjYyhC.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-BNxyEpUX.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-W1cAPuRF.js';
|
|
5
5
|
import 'zod';
|
|
6
6
|
import '../zod-schema-C7F4clpm.js';
|
|
7
7
|
import '../agent/interactions/index.js';
|
package/dist/tool/index.js
CHANGED
|
@@ -5,16 +5,16 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
createQuestionTool,
|
|
7
7
|
isQuestionTool
|
|
8
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-IZH2ZAE3.js";
|
|
9
9
|
import {
|
|
10
10
|
createThinkTool
|
|
11
|
-
} from "../chunk-
|
|
11
|
+
} from "../chunk-ZMAF3I4H.js";
|
|
12
12
|
import {
|
|
13
13
|
createToolIndex,
|
|
14
14
|
embedTools,
|
|
15
15
|
isToolIndex
|
|
16
|
-
} from "../chunk-
|
|
17
|
-
import "../chunk-
|
|
16
|
+
} from "../chunk-XH2CVR4V.js";
|
|
17
|
+
import "../chunk-MYHGOXHQ.js";
|
|
18
18
|
import "../chunk-5WLIHNNJ.js";
|
|
19
19
|
import "../chunk-3FIX7GLM.js";
|
|
20
20
|
import "../chunk-ESOFEAYK.js";
|
|
@@ -30,21 +30,21 @@ import "../chunk-GPVXCY5I.js";
|
|
|
30
30
|
import "../chunk-5V533R7F.js";
|
|
31
31
|
import {
|
|
32
32
|
createTool
|
|
33
|
-
} from "../chunk-
|
|
34
|
-
import "../chunk-
|
|
33
|
+
} from "../chunk-JU3RX364.js";
|
|
34
|
+
import "../chunk-WCJRGYF7.js";
|
|
35
35
|
import "../chunk-YZVFIW5D.js";
|
|
36
|
+
import {
|
|
37
|
+
ToolCallError,
|
|
38
|
+
ToolJsonError,
|
|
39
|
+
ToolNotFoundError
|
|
40
|
+
} from "../chunk-J6S6MT7O.js";
|
|
36
41
|
import {
|
|
37
42
|
ToolOutput,
|
|
38
43
|
ToolResultSerializationError,
|
|
39
44
|
normalizeToolResultOutput,
|
|
40
45
|
parseToolArgs,
|
|
41
46
|
toolResultContentToText
|
|
42
|
-
} from "../chunk-
|
|
43
|
-
import {
|
|
44
|
-
ToolCallError,
|
|
45
|
-
ToolJsonError,
|
|
46
|
-
ToolNotFoundError
|
|
47
|
-
} from "../chunk-J6S6MT7O.js";
|
|
47
|
+
} from "../chunk-VHPT2C4P.js";
|
|
48
48
|
import "../chunk-BONQTXRQ.js";
|
|
49
49
|
import "../chunk-4C7AXYOM.js";
|
|
50
50
|
import "../chunk-SQAAVYJG.js";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createQuestionTool,
|
|
3
3
|
isQuestionTool
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-IZH2ZAE3.js";
|
|
5
|
+
import "../chunk-JU3RX364.js";
|
|
6
|
+
import "../chunk-WCJRGYF7.js";
|
|
7
7
|
import "../chunk-YZVFIW5D.js";
|
|
8
|
-
import "../chunk-SCFWN3T2.js";
|
|
9
8
|
import "../chunk-J6S6MT7O.js";
|
|
9
|
+
import "../chunk-VHPT2C4P.js";
|
|
10
10
|
import "../chunk-BONQTXRQ.js";
|
|
11
11
|
import "../chunk-4C7AXYOM.js";
|
|
12
12
|
import "../chunk-SQAAVYJG.js";
|
package/dist/tool/think-tool.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createThinkTool
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-ZMAF3I4H.js";
|
|
4
|
+
import "../chunk-JU3RX364.js";
|
|
5
|
+
import "../chunk-WCJRGYF7.js";
|
|
6
6
|
import "../chunk-YZVFIW5D.js";
|
|
7
|
-
import "../chunk-SCFWN3T2.js";
|
|
8
7
|
import "../chunk-J6S6MT7O.js";
|
|
8
|
+
import "../chunk-VHPT2C4P.js";
|
|
9
9
|
import "../chunk-BONQTXRQ.js";
|
|
10
10
|
import "../chunk-4C7AXYOM.js";
|
|
11
11
|
import "../chunk-SQAAVYJG.js";
|
package/dist/tool/tool.js
CHANGED
|
@@ -38,6 +38,8 @@ type ToolCallStreamEvent = {
|
|
|
38
38
|
};
|
|
39
39
|
/** Execution context handed to a tool when the run invokes it. */
|
|
40
40
|
type ToolCallContext = {
|
|
41
|
+
/** Stable external-operation identity supplied by a durable execution runtime. */
|
|
42
|
+
operationId?: string | undefined;
|
|
41
43
|
/** Emits a child-agent event into the parent run's stream. */
|
|
42
44
|
emitStreamEvent?(event: ToolCallStreamEvent): void | Promise<void>;
|
|
43
45
|
/** Aborted when the run is cancelled or the stream consumer leaves. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { V as VectorMetadata, b as VectorMetadataValue, E as EmbeddingModel, a as EmbeddedDocument } from '../types-Cr4uiYo5.js';
|
|
2
|
-
import { T as Tool } from '../tool-
|
|
2
|
+
import { T as Tool } from '../tool-W1cAPuRF.js';
|
|
3
3
|
import { V as VectorFilter, d as VectorStore, R as RetrieveDocumentsOptions, a as VectorSearchResult, f as RetrieveHybridDocumentsOptions, I as IndexStrategy, g as VectorStoreUpsertOptions, h as VectorSearchRequest, b as VectorInspectRequest, c as VectorInspectPage, i as VectorSearchToolOptions } from '../types-ChyQISt-.js';
|
|
4
4
|
export { D as DenseVectorSearchToolOptions, j as HybridVectorSearchRequest, k as HybridVectorSearchToolOptions, H as HybridVectorStore, L as LshOptions, l as RetrieveDocumentsBaseOptions, e as VectorFusion, m as VectorInspectItem, n as VectorMetric, o as VectorSearchToolBaseOptions } from '../types-ChyQISt-.js';
|
|
5
5
|
import { b as RetrySetting } from '../retry-CjvSlKGW.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
InMemoryVectorStore,
|
|
3
3
|
createVectorSearchTool
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-MYHGOXHQ.js";
|
|
5
5
|
import {
|
|
6
6
|
matchesVectorFilter,
|
|
7
7
|
vectorFilter
|
|
@@ -23,11 +23,11 @@ import "../chunk-KO5NMTAM.js";
|
|
|
23
23
|
import "../chunk-TFIOU6UR.js";
|
|
24
24
|
import "../chunk-GPVXCY5I.js";
|
|
25
25
|
import "../chunk-5V533R7F.js";
|
|
26
|
-
import "../chunk-
|
|
27
|
-
import "../chunk-
|
|
26
|
+
import "../chunk-JU3RX364.js";
|
|
27
|
+
import "../chunk-WCJRGYF7.js";
|
|
28
28
|
import "../chunk-YZVFIW5D.js";
|
|
29
|
-
import "../chunk-SCFWN3T2.js";
|
|
30
29
|
import "../chunk-J6S6MT7O.js";
|
|
30
|
+
import "../chunk-VHPT2C4P.js";
|
|
31
31
|
import "../chunk-BONQTXRQ.js";
|
|
32
32
|
import "../chunk-4C7AXYOM.js";
|
|
33
33
|
import "../chunk-SQAAVYJG.js";
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/internal/agent-runtime/tool-execution.ts"],"sourcesContent":["import type { Agent } from \"../../agent/agent\";\nimport { parseAgentQuestionPrompts } from \"../../agent/interactions\";\nimport { type AgentLifecycle, lifecycleSnapshot } from \"../../agent/lifecycle\";\nimport type { AgentChildStreamEvent } from \"../../agent/run-types\";\nimport type {\n JsonObject,\n ToolCallPart,\n ToolDefinition,\n ToolResultContentPart,\n ToolResultOutput,\n ToolResultPart,\n} from \"../../completion\";\nimport { isJsonValue, Usage } from \"../../completion\";\nimport { assertCompletionResponseIntegrity } from \"../../completion/provider-output-error\";\nimport type { AgentHook, ToolApprovalRequestOptions, ToolHookArgs } from \"../../hooks\";\nimport { runControl, toolCallControl } from \"../../hooks\";\nimport { isMcpTool } from \"../../mcp\";\nimport type { ActiveAgentRunObservers, ActiveToolObservers } from \"../../observability/group\";\nimport type {\n AgentToolEndArgs,\n AgentToolErrorArgs,\n AgentToolStartArgs,\n AgentToolStreamEventArgs,\n AgentToolSuspendedArgs,\n} from \"../../observability/types\";\nimport type {\n AnyTool,\n NormalizedToolOutput,\n ToolApprovalContext,\n ToolApprovalRunContext,\n ToolCallContext,\n ToolCallStreamEvent,\n ToolRequiresApproval,\n} from \"../../tool\";\nimport {\n normalizeToolResultOutput,\n parseToolArgs,\n ToolOutput,\n toolResultContentToText,\n} from \"../../tool\";\nimport type {\n AgentMiddleware,\n ToolOutputMiddlewareArgs,\n ToolOutputMiddlewareResult,\n} from \"../../tool/middleware\";\nimport { isQuestionTool } from \"../../tool/question-tool\";\nimport { isSkillTool } from \"../../tool/skill-tool-marker\";\nimport { throwIfAborted } from \"../abort\";\nimport { mapWithConcurrency } from \"../concurrency\";\nimport type { ToolApprovalRequest } from \"./approval-request\";\nimport { assertToolApprovalRequirement, toolMayRequireApproval } from \"./approval-requirement\";\nimport {\n AgentInteractionSignal,\n type PendingToolExecution,\n ToolExecutionSuspension,\n} from \"./interaction-suspension\";\nimport {\n type PreparedToolCall,\n prepareToolCall as prepareRegisteredToolCall,\n prepareToolCallFromInput,\n} from \"./prepared-tool-call\";\n\nexport type ToolResultEventPayload = {\n type: \"tool_result\";\n toolName: string;\n toolCallId: string;\n callId?: string;\n internalCallId: string;\n args: string;\n output: ToolResultOutput;\n result: string;\n structuredResult?: readonly ToolResultContentPart[] | undefined;\n};\n\nexport type AgentToolEventPayload = {\n type: \"agent_tool_event\";\n toolName: string;\n toolCallId?: string;\n internalCallId: string;\n agentId: string;\n agentName?: string;\n event: AgentChildStreamEvent<unknown, unknown>;\n};\n\nexport type ToolExecutionEventPayload = ToolResultEventPayload | AgentToolEventPayload;\n\nexport type ToolExecutionObservation = {\n turn: number;\n runObservers: ActiveAgentRunObservers;\n toolDefinitions?: ToolDefinition[];\n};\n\nexport type ToolExecutionRunContext = {\n runId: string;\n sessionId?: string | undefined;\n metadata?: JsonObject | undefined;\n};\n\nexport type ToolApprovalDecision =\n | { approved: true; reason?: string }\n | { approved: false; reason?: string };\n\nexport type ToolApprovalHandler = (request: ToolApprovalRequest) => Promise<ToolApprovalDecision>;\n\ntype ToolExecutionAgent = Pick<Agent, \"id\" | \"getTool\" | \"callTool\" | \"middlewares\">;\ntype ToolExecutionLifecycle = Pick<AgentLifecycle, \"onToolStart\" | \"onToolFinish\">;\n\nfunction sanitizeToolErrorMessage(error: unknown): string {\n if (error instanceof Error) {\n // Return only name and message, omitting stack traces and internal details\n return `${error.name}: ${error.message}`;\n }\n\n if (typeof error === \"string\") {\n // Strings are JSON values, but JSON.stringify would add surrounding quotes.\n return error;\n }\n\n if (isJsonValue(error)) {\n return JSON.stringify(error);\n }\n\n // Non-Error thrown values\n return String(error);\n}\n\nexport class ToolCallExecutor {\n constructor(\n private readonly agent: ToolExecutionAgent,\n private readonly activeHook: AgentHook | undefined,\n private readonly approvalHandler: ToolApprovalHandler,\n private readonly lifecycle: ToolExecutionLifecycle | undefined,\n private readonly runContext: ToolExecutionRunContext,\n private readonly concurrency: number,\n private readonly requestMiddlewares: readonly AgentMiddleware[],\n private readonly abortSignal: AbortSignal,\n private readonly cancel: (reason: string) => Error,\n ) {}\n\n async execute(\n toolCalls: readonly ToolCallPart[],\n onResult?: (result: ToolResultEventPayload) => void,\n onStreamEvent?: (event: AgentToolEventPayload) => void,\n observation?: ToolExecutionObservation,\n ): Promise<ToolResultPart[]> {\n assertCompletionResponseIntegrity({\n response: {\n choice: [...toolCalls],\n usage: Usage.empty(),\n rawResponse: undefined,\n },\n });\n\n const executeOne = async (toolCall: ToolCallPart): Promise<ToolResultPart> => {\n throwIfAborted(this.abortSignal);\n const args = JSON.stringify(toolCall.input);\n const internalCallId = globalThis.crypto.randomUUID();\n const hookArgs: ToolHookArgs = {\n toolName: toolCall.toolName,\n toolCallId: toolCall.toolCallId,\n internalCallId,\n args,\n };\n if (toolCall.callId !== undefined) {\n hookArgs.callId = toolCall.callId;\n }\n const tool = this.agent.getTool(toolCall.toolName);\n const toolDefinition = observation?.toolDefinitions?.find(\n (definition) => definition.name === toolCall.toolName,\n );\n const toolMetadata = toolTraceMetadata(tool);\n\n let toolStartArgs: AgentToolStartArgs = {\n turn: observation?.turn ?? 0,\n toolCall,\n toolName: toolCall.toolName,\n internalCallId,\n args,\n };\n if (toolCall.callId !== undefined) {\n toolStartArgs = { ...toolStartArgs, toolCallId: toolCall.callId };\n }\n if (toolDefinition !== undefined) toolStartArgs = { ...toolStartArgs, toolDefinition };\n if (toolMetadata !== undefined) toolStartArgs = { ...toolStartArgs, toolMetadata };\n const toolObservers = await observation?.runObservers.startTool(toolStartArgs);\n const toolObservation = new ToolObserverScope(toolObservers);\n\n let output: NormalizedToolOutput | undefined;\n let skipped = false;\n let toolExecutionFailed = false;\n let effectiveArgs = args;\n\n try {\n const callAction = await this.activeHook?.onToolCall?.({\n ...hookArgs,\n tool: toolCallControl,\n });\n if (callAction?.type === \"terminate\") {\n throw this.cancel(callAction.reason);\n }\n if (callAction?.type === \"skip\") {\n output = { type: \"text\", value: callAction.reason };\n skipped = true;\n } else {\n try {\n effectiveArgs = await this.runToolInputMiddlewares({\n ...hookArgs,\n turn: observation?.turn ?? 0,\n originalArgs: args,\n });\n hookArgs.args = effectiveArgs;\n\n let prepared: PreparedToolCall | undefined;\n try {\n prepared = this.prepareToolCall(tool, toolCall.toolName, effectiveArgs);\n } catch (error) {\n const outcome = await this.handleToolError(\n toolCall,\n hookArgs,\n effectiveArgs,\n error,\n toolObservation,\n observation,\n );\n output = outcome.output;\n toolExecutionFailed = outcome.failed;\n }\n if (prepared !== undefined && isQuestionTool(tool)) {\n try {\n const questions = parseAgentQuestionPrompts(\n (prepared.input as { questions?: unknown }).questions,\n );\n const interaction = {\n type: \"tool-question\",\n id: globalThis.crypto.randomUUID(),\n toolName: toolCall.toolName,\n toolCallId: toolCall.toolCallId,\n internalCallId,\n questions,\n } as const;\n if (toolCall.callId !== undefined) {\n Object.assign(interaction, { callId: toolCall.callId });\n }\n throw new AgentInteractionSignal(interaction);\n } catch (error) {\n if (error instanceof AgentInteractionSignal) throw error;\n const outcome = await this.handleToolError(\n toolCall,\n hookArgs,\n effectiveArgs,\n error,\n toolObservation,\n observation,\n );\n output = outcome.output;\n toolExecutionFailed = outcome.failed;\n prepared = undefined;\n }\n }\n if (prepared !== undefined) {\n const approvalContext = createApprovalContext(\n prepared.input,\n hookArgs,\n this.agent,\n this.runContext,\n );\n const approvalDecision =\n callAction?.type === \"approval_request\"\n ? await this.requestApproval(approvalContext, callAction, observation)\n : ((await this.evaluateToolApproval(tool, approvalContext, observation)) ?? {\n approved: true as const,\n });\n if (!approvalDecision.approved) {\n output = { type: \"execution-denied\", reason: approvalDecision.result };\n skipped = true;\n } else {\n const step = observation?.turn ?? 0;\n const lifecycleEvent = {\n runId: this.runContext.runId,\n step,\n toolName: toolCall.toolName,\n input: lifecycleSnapshot(prepared.input),\n };\n if (toolCall.callId !== undefined) {\n Object.assign(lifecycleEvent, { toolCallId: toolCall.callId });\n }\n await this.lifecycle?.onToolStart?.(lifecycleEvent);\n const startedAt = Date.now();\n const outcome = await this.runApprovedToolCall(\n prepared,\n toolCall,\n hookArgs,\n effectiveArgs,\n toolObservation,\n observation,\n onStreamEvent,\n );\n output = outcome.output;\n toolExecutionFailed = outcome.failed;\n const durationMs = Date.now() - startedAt;\n await this.lifecycle?.onToolFinish?.(\n outcome.failed\n ? {\n ...lifecycleEvent,\n durationMs,\n success: false,\n error: lifecycleSnapshot(outcome.error),\n }\n : {\n ...lifecycleEvent,\n durationMs,\n success: true,\n output: lifecycleSnapshot(output),\n },\n );\n }\n }\n } catch (error) {\n if (error instanceof AgentInteractionSignal) {\n await toolObservation.suspend({\n ...toolStartArgs,\n interaction: error.interaction,\n });\n throw error;\n }\n await toolObservation.error(\n toolErrorArgs(observation?.turn ?? 0, toolCall, internalCallId, effectiveArgs, error),\n );\n throw error;\n }\n }\n\n if (output === undefined) {\n throw new Error(`Tool \"${toolCall.toolName}\" did not produce an execution result.`);\n }\n let result = toolOutputToText(output);\n let structuredResult = toolOutputToStructuredResult(output);\n if (!isSkillTool(tool)) {\n const middlewareReplacement = await this.runToolResultMiddlewares({\n ...hookArgs,\n args: effectiveArgs,\n result,\n originalResult: result,\n structuredResult,\n originalStructuredResult: structuredResult,\n turn: observation?.turn ?? 0,\n });\n if (middlewareReplacement !== undefined) {\n output = middlewareReplacement;\n result = toolOutputToText(middlewareReplacement);\n structuredResult = toolOutputToStructuredResult(middlewareReplacement);\n }\n }\n\n const resultAction = await this.activeHook?.onToolResult?.({\n ...hookArgs,\n args: effectiveArgs,\n result,\n structuredResult,\n run: runControl,\n });\n if (!toolExecutionFailed) {\n await toolObservation.end({\n turn: observation?.turn ?? 0,\n toolCall,\n toolName: toolCall.toolName,\n internalCallId,\n args: effectiveArgs,\n result,\n structuredResult,\n skipped,\n toolCallId: toolCall.callId,\n });\n }\n if (resultAction?.type === \"terminate\") {\n throw this.cancel(resultAction.reason);\n }\n\n const resultPayload: ToolResultEventPayload = {\n type: \"tool_result\",\n toolName: toolCall.toolName,\n toolCallId: toolCall.toolCallId,\n internalCallId,\n args: effectiveArgs,\n output,\n result,\n structuredResult,\n };\n if (toolCall.callId !== undefined) resultPayload.callId = toolCall.callId;\n onResult?.(resultPayload);\n let resultPart: ToolResultPart = {\n type: \"tool-result\" as const,\n toolCallId: toolCall.toolCallId,\n toolName: toolCall.toolName,\n output,\n };\n if (toolCall.callId !== undefined) {\n resultPart = { ...resultPart, callId: toolCall.callId };\n }\n return resultPart;\n } catch (error) {\n if (error instanceof AgentInteractionSignal) {\n const pending: PendingToolExecution = {\n toolCall,\n effectiveArgs,\n input:\n error.interaction.type === \"tool-approval\"\n ? error.interaction.input\n : parseToolArgs(effectiveArgs),\n internalCallId,\n };\n if (error.rejectMessage !== undefined) pending.rejectMessage = error.rejectMessage;\n throw new ToolExecutionSuspension(error.interaction, pending);\n }\n await toolObservation.error(\n toolErrorArgs(observation?.turn ?? 0, toolCall, internalCallId, effectiveArgs, error),\n );\n throw error;\n }\n };\n\n if (this.concurrency === 1) {\n const results: ToolResultPart[] = [];\n for (const toolCall of toolCalls) {\n try {\n results.push(await executeOne(toolCall));\n } catch (error) {\n if (error instanceof ToolExecutionSuspension) {\n error.completedResults = [...results];\n error.remainingToolCalls = toolCalls.slice(results.length + 1);\n }\n throw error;\n }\n }\n return results;\n }\n return mapWithConcurrency(toolCalls, this.concurrency, executeOne);\n }\n\n async executeResumed(\n pending: PendingToolExecution,\n onResult?: (result: ToolResultEventPayload) => void,\n onStreamEvent?: (event: AgentToolEventPayload) => void,\n observation?: ToolExecutionObservation,\n ): Promise<ToolResultPart> {\n throwIfAborted(this.abortSignal);\n const { toolCall, internalCallId, effectiveArgs } = pending;\n const tool = this.agent.getTool(toolCall.toolName);\n if (tool === undefined) {\n throw new Error(\n `Cannot resume tool interaction because tool \"${toolCall.toolName}\" is no longer registered.`,\n );\n }\n if (isQuestionTool(tool)) {\n throw new TypeError(\"Question interactions are resolved from their submitted answers.\");\n }\n\n const hookArgs: ToolHookArgs = {\n toolName: toolCall.toolName,\n toolCallId: toolCall.toolCallId,\n internalCallId,\n args: effectiveArgs,\n };\n if (toolCall.callId !== undefined) hookArgs.callId = toolCall.callId;\n const toolDefinition = observation?.toolDefinitions?.find(\n (definition) => definition.name === toolCall.toolName,\n );\n const toolMetadata = toolTraceMetadata(tool);\n let toolStartArgs: AgentToolStartArgs = {\n turn: observation?.turn ?? 0,\n toolCall,\n toolName: toolCall.toolName,\n internalCallId,\n args: effectiveArgs,\n };\n if (toolCall.callId !== undefined) {\n toolStartArgs = { ...toolStartArgs, toolCallId: toolCall.callId };\n }\n if (toolDefinition !== undefined) toolStartArgs = { ...toolStartArgs, toolDefinition };\n if (toolMetadata !== undefined) toolStartArgs = { ...toolStartArgs, toolMetadata };\n const observers = await observation?.runObservers.startTool(toolStartArgs);\n const toolObservation = new ToolObserverScope(observers);\n let output: NormalizedToolOutput;\n let failed = false;\n\n try {\n const prepared = prepareToolCallFromInput(tool, pending.input);\n const step = observation?.turn ?? 0;\n const lifecycleEvent = {\n runId: this.runContext.runId,\n step,\n toolName: toolCall.toolName,\n input: lifecycleSnapshot(prepared.input),\n };\n if (toolCall.callId !== undefined) {\n Object.assign(lifecycleEvent, { toolCallId: toolCall.callId });\n }\n await this.lifecycle?.onToolStart?.(lifecycleEvent);\n const startedAt = Date.now();\n const outcome = await this.runApprovedToolCall(\n prepared,\n toolCall,\n hookArgs,\n effectiveArgs,\n toolObservation,\n observation,\n onStreamEvent,\n );\n output = outcome.output;\n failed = outcome.failed;\n const durationMs = Date.now() - startedAt;\n await this.lifecycle?.onToolFinish?.(\n outcome.failed\n ? {\n ...lifecycleEvent,\n durationMs,\n success: false,\n error: lifecycleSnapshot(outcome.error),\n }\n : {\n ...lifecycleEvent,\n durationMs,\n success: true,\n output: lifecycleSnapshot(output),\n },\n );\n\n let result = toolOutputToText(output);\n let structuredResult = toolOutputToStructuredResult(output);\n if (!isSkillTool(tool)) {\n const replacement = await this.runToolResultMiddlewares({\n ...hookArgs,\n args: effectiveArgs,\n result,\n originalResult: result,\n structuredResult,\n originalStructuredResult: structuredResult,\n turn: step,\n });\n if (replacement !== undefined) {\n output = replacement;\n result = toolOutputToText(replacement);\n structuredResult = toolOutputToStructuredResult(replacement);\n }\n }\n const resultAction = await this.activeHook?.onToolResult?.({\n ...hookArgs,\n result,\n structuredResult,\n run: runControl,\n });\n if (!failed) {\n await toolObservation.end({\n turn: step,\n toolCall,\n toolName: toolCall.toolName,\n internalCallId,\n args: effectiveArgs,\n result,\n structuredResult,\n skipped: false,\n toolCallId: toolCall.callId,\n });\n }\n if (resultAction?.type === \"terminate\") {\n throw this.cancel(resultAction.reason);\n }\n const resultPayload: ToolResultEventPayload = {\n type: \"tool_result\",\n toolName: toolCall.toolName,\n toolCallId: toolCall.toolCallId,\n internalCallId,\n args: effectiveArgs,\n output,\n result,\n structuredResult,\n };\n if (toolCall.callId !== undefined) resultPayload.callId = toolCall.callId;\n onResult?.(resultPayload);\n let resultPart: ToolResultPart = {\n type: \"tool-result\",\n toolName: toolCall.toolName,\n toolCallId: toolCall.toolCallId,\n output,\n };\n if (toolCall.callId !== undefined) resultPart = { ...resultPart, callId: toolCall.callId };\n return resultPart;\n } catch (error) {\n await toolObservation.error(\n toolErrorArgs(observation?.turn ?? 0, toolCall, internalCallId, effectiveArgs, error),\n );\n throw error;\n }\n }\n\n async resolveResumed(\n pending: PendingToolExecution,\n initialOutput: NormalizedToolOutput,\n onResult?: (result: ToolResultEventPayload) => void,\n observation?: ToolExecutionObservation,\n ): Promise<ToolResultPart> {\n throwIfAborted(this.abortSignal);\n const { toolCall, internalCallId, effectiveArgs } = pending;\n const tool = this.agent.getTool(toolCall.toolName);\n if (tool === undefined) {\n throw new Error(\n `Cannot resume tool interaction because tool \"${toolCall.toolName}\" is no longer registered.`,\n );\n }\n\n const hookArgs: ToolHookArgs = {\n toolName: toolCall.toolName,\n toolCallId: toolCall.toolCallId,\n internalCallId,\n args: effectiveArgs,\n };\n if (toolCall.callId !== undefined) hookArgs.callId = toolCall.callId;\n const toolDefinition = observation?.toolDefinitions?.find(\n (definition) => definition.name === toolCall.toolName,\n );\n const toolMetadata = toolTraceMetadata(tool);\n let toolStartArgs: AgentToolStartArgs = {\n turn: observation?.turn ?? 0,\n toolCall,\n toolName: toolCall.toolName,\n internalCallId,\n args: effectiveArgs,\n };\n if (toolCall.callId !== undefined) {\n toolStartArgs = { ...toolStartArgs, toolCallId: toolCall.callId };\n }\n if (toolDefinition !== undefined) toolStartArgs = { ...toolStartArgs, toolDefinition };\n if (toolMetadata !== undefined) toolStartArgs = { ...toolStartArgs, toolMetadata };\n const observers = await observation?.runObservers.startTool(toolStartArgs);\n const toolObservation = new ToolObserverScope(observers);\n\n try {\n let output = initialOutput;\n let result = toolOutputToText(output);\n let structuredResult = toolOutputToStructuredResult(output);\n if (!isSkillTool(tool)) {\n const replacement = await this.runToolResultMiddlewares({\n ...hookArgs,\n args: effectiveArgs,\n result,\n originalResult: result,\n structuredResult,\n originalStructuredResult: structuredResult,\n turn: observation?.turn ?? 0,\n });\n if (replacement !== undefined) {\n output = replacement;\n result = toolOutputToText(replacement);\n structuredResult = toolOutputToStructuredResult(replacement);\n }\n }\n const resultAction = await this.activeHook?.onToolResult?.({\n ...hookArgs,\n result,\n structuredResult,\n run: runControl,\n });\n await toolObservation.end({\n turn: observation?.turn ?? 0,\n toolCall,\n toolName: toolCall.toolName,\n internalCallId,\n args: effectiveArgs,\n result,\n structuredResult,\n skipped: true,\n toolCallId: toolCall.callId,\n });\n if (resultAction?.type === \"terminate\") {\n throw this.cancel(resultAction.reason);\n }\n const resultPayload: ToolResultEventPayload = {\n type: \"tool_result\",\n toolName: toolCall.toolName,\n toolCallId: toolCall.toolCallId,\n internalCallId,\n args: effectiveArgs,\n output,\n result,\n structuredResult,\n };\n if (toolCall.callId !== undefined) resultPayload.callId = toolCall.callId;\n onResult?.(resultPayload);\n let resultPart: ToolResultPart = {\n type: \"tool-result\",\n toolName: toolCall.toolName,\n toolCallId: toolCall.toolCallId,\n output,\n };\n if (toolCall.callId !== undefined) resultPart = { ...resultPart, callId: toolCall.callId };\n return resultPart;\n } catch (error) {\n await toolObservation.error(\n toolErrorArgs(observation?.turn ?? 0, toolCall, internalCallId, effectiveArgs, error),\n );\n throw error;\n }\n }\n\n private async runApprovedToolCall(\n prepared: PreparedToolCall,\n toolCall: ToolCallPart,\n hookArgs: ToolHookArgs,\n effectiveArgs: string,\n toolObservation: ToolObserverScope,\n observation: ToolExecutionObservation | undefined,\n onStreamEvent?: (event: AgentToolEventPayload) => void,\n ): Promise<\n | { output: NormalizedToolOutput; failed: false }\n | { output: NormalizedToolOutput; failed: true; error: unknown }\n > {\n try {\n const toolContext: ToolCallContext = {\n abortSignal: this.abortSignal,\n emitStreamEvent: async (event) => {\n let streamEventArgs: AgentToolStreamEventArgs = {\n turn: observation?.turn ?? 0,\n toolCall,\n toolName: toolCall.toolName,\n internalCallId: hookArgs.internalCallId,\n args: effectiveArgs,\n event,\n };\n if (toolCall.callId !== undefined) {\n streamEventArgs = { ...streamEventArgs, toolCallId: toolCall.callId };\n }\n await toolObservation.streamEvent(streamEventArgs);\n const payload = agentToolEventPayload(toolCall, hookArgs.internalCallId, event);\n if (payload !== undefined) {\n onStreamEvent?.(payload);\n }\n },\n };\n return {\n output: await prepared.call(toolContext),\n failed: false,\n };\n } catch (error) {\n return this.handleToolError(\n toolCall,\n hookArgs,\n effectiveArgs,\n error,\n toolObservation,\n observation,\n );\n }\n }\n\n private prepareToolCall(\n tool: AnyTool | undefined,\n toolName: string,\n args: string,\n ): PreparedToolCall {\n if (tool !== undefined) {\n return prepareRegisteredToolCall(tool, args);\n }\n const input = parseToolArgs(args);\n return {\n input,\n call: (context) => this.agent.callTool(toolName, args, context),\n };\n }\n\n private async handleToolError(\n toolCall: ToolCallPart,\n hookArgs: ToolHookArgs,\n args: string,\n error: unknown,\n toolObservation: ToolObserverScope,\n observation: ToolExecutionObservation | undefined,\n ): Promise<{ output: NormalizedToolOutput; failed: true; error: unknown }> {\n const errorAction = await this.activeHook?.onToolError?.({\n ...hookArgs,\n args,\n error,\n run: runControl,\n });\n await toolObservation.error(\n toolErrorArgs(observation?.turn ?? 0, toolCall, hookArgs.internalCallId, args, error),\n );\n if (errorAction?.type === \"terminate\") {\n throw this.cancel(errorAction.reason);\n }\n return {\n output: {\n type: \"error-text\",\n value: sanitizeToolErrorMessage(error),\n },\n failed: true,\n error,\n };\n }\n\n private async runToolResultMiddlewares(\n args: ToolOutputMiddlewareArgs,\n ): Promise<NormalizedToolOutput | undefined> {\n let result = args.result;\n let structuredResult = args.structuredResult;\n let replaced = false;\n for (const middleware of this.activeMiddlewares()) {\n const outputReplacement = await middleware.onToolOutput?.({\n ...args,\n result,\n structuredResult,\n });\n if (outputReplacement !== undefined) {\n const normalized = normalizeToolOutputMiddlewareResult(outputReplacement);\n if (normalized.result !== undefined) {\n result = normalized.result;\n structuredResult = undefined;\n }\n if (normalized.structuredResult !== undefined) {\n structuredResult = normalized.structuredResult;\n result = toolResultContentToText(normalized.structuredResult);\n }\n replaced = true;\n }\n }\n return replaced\n ? structuredResult === undefined\n ? { type: \"text\", value: result }\n : { type: \"content\", value: structuredResult }\n : undefined;\n }\n\n private async runToolInputMiddlewares(\n args: ToolHookArgs & { turn: number; originalArgs: string },\n ): Promise<string> {\n let current = args.args;\n for (const middleware of this.activeMiddlewares()) {\n const replacement = await middleware.onToolInput?.({\n ...args,\n args: current,\n });\n if (replacement?.args !== undefined) {\n if (typeof replacement.args === \"string\") {\n current = replacement.args;\n } else {\n if (!isJsonValue(replacement.args)) {\n throw new TypeError(\"Tool input middleware args must be a strict JSON value.\");\n }\n current = JSON.stringify(replacement.args);\n }\n }\n }\n return current;\n }\n\n private activeMiddlewares(): AgentMiddleware[] {\n return [...this.agent.middlewares, ...this.requestMiddlewares];\n }\n\n private async evaluateToolApproval(\n tool: AnyTool | undefined,\n context: ToolApprovalContext,\n observation: ToolExecutionObservation | undefined,\n ): Promise<{ approved: true } | { approved: false; result: string } | undefined> {\n const requirement = tool?.requiresApproval as ToolRequiresApproval<unknown> | undefined;\n if (requirement === undefined) return undefined;\n const resolved =\n typeof requirement === \"function\" ? await requirement(context.args, context) : requirement;\n assertToolApprovalRequirement(resolved, { allowFunction: false });\n if (resolved === false) return { approved: true };\n const reason = resolved === true ? undefined : resolved.reason;\n return this.requestApproval(context, reason === undefined ? {} : { reason }, observation);\n }\n\n private async requestApproval(\n context: ToolApprovalContext,\n options: ToolApprovalRequestOptions,\n observation: ToolExecutionObservation | undefined,\n ): Promise<{ approved: true } | { approved: false; result: string }> {\n const request: ToolApprovalRequest = {\n ...context,\n id: globalThis.crypto.randomUUID(),\n };\n if (options.reason !== undefined) {\n request.reason = options.reason;\n }\n if (options.rejectMessage !== undefined) {\n request.rejectMessage = options.rejectMessage;\n }\n await observation?.runObservers.event({\n name: \"tool.approval_requested\",\n attributes: approvalEventAttributes(request, observation.turn),\n });\n let decision: ToolApprovalDecision;\n try {\n decision = await this.approvalHandler(request);\n } catch (error) {\n if (error instanceof AgentInteractionSignal) {\n throw error;\n }\n await observation?.runObservers.event({\n name: \"tool.approval_failed\",\n level: \"ERROR\",\n attributes: {\n ...approvalEventAttributes(request, observation.turn),\n errorName: error instanceof Error ? error.name : typeof error,\n },\n });\n throw error;\n }\n const attributes: JsonObject = {\n ...approvalEventAttributes(request, observation?.turn ?? 0),\n approved: decision.approved,\n };\n if (decision.reason !== undefined) attributes.decisionReason = decision.reason;\n await observation?.runObservers.event({\n name: \"tool.approval_resolved\",\n attributes,\n });\n if (decision.approved) {\n return { approved: true };\n }\n return {\n approved: false,\n result: decision.reason ?? request.rejectMessage ?? \"Tool approval was rejected.\",\n };\n }\n}\n\nfunction createApprovalContext(\n input: unknown,\n hookArgs: ToolHookArgs,\n agent: Pick<Agent, \"id\">,\n run: ToolExecutionRunContext,\n): ToolApprovalContext {\n const approvalRun: ToolApprovalRunContext = {\n agentId: agent.id,\n runId: run.runId,\n };\n if (run.sessionId !== undefined) {\n approvalRun.sessionId = run.sessionId;\n }\n if (run.metadata !== undefined) {\n approvalRun.metadata = run.metadata;\n }\n const context: ToolApprovalContext = {\n toolName: hookArgs.toolName,\n args: lifecycleSnapshot(input),\n rawArgs: hookArgs.args,\n toolCallId: hookArgs.toolCallId,\n internalCallId: hookArgs.internalCallId,\n run: approvalRun,\n };\n if (hookArgs.callId !== undefined) {\n context.callId = hookArgs.callId;\n }\n return context;\n}\n\nfunction approvalEventAttributes(request: ToolApprovalRequest, turn: number): JsonObject {\n const attributes: JsonObject = {\n turn,\n approvalId: request.id,\n toolName: request.toolName,\n internalCallId: request.internalCallId,\n };\n if (request.toolCallId !== undefined) attributes.toolCallId = request.toolCallId;\n if (request.reason !== undefined) attributes.reason = request.reason;\n return attributes;\n}\n\nfunction normalizeToolOutputMiddlewareResult(result: ToolOutputMiddlewareResult): {\n result?: string | undefined;\n structuredResult?: readonly ToolResultContentPart[] | undefined;\n} {\n if (typeof result === \"string\") {\n return { result };\n }\n if (typeof result !== \"object\" || result === null) {\n throw new TypeError(\"Tool output middleware must return text or structured content.\");\n }\n const prototype = Object.getPrototypeOf(result);\n if (prototype !== Object.prototype && prototype !== null) {\n throw new TypeError(\"Tool output middleware must return text or structured content.\");\n }\n const keys = Reflect.ownKeys(result);\n const hasResult = keys.includes(\"result\");\n const hasStructuredResult = keys.includes(\"structuredResult\");\n if (\n hasResult === hasStructuredResult ||\n keys.some((key) => key !== \"result\" && key !== \"structuredResult\")\n ) {\n throw new TypeError(\n \"Tool output middleware must return exactly one of result or structuredResult.\",\n );\n }\n if (hasResult) {\n const descriptor = Object.getOwnPropertyDescriptor(result, \"result\");\n if (\n descriptor === undefined ||\n !(\"value\" in descriptor) ||\n typeof descriptor.value !== \"string\"\n ) {\n throw new TypeError(\"Tool output middleware result must be a string.\");\n }\n return { result: descriptor.value };\n }\n const descriptor = Object.getOwnPropertyDescriptor(result, \"structuredResult\");\n if (descriptor === undefined || !(\"value\" in descriptor)) {\n throw new TypeError(\"Tool output middleware structuredResult must be valid tool content.\");\n }\n const normalized = normalizeToolResultOutput(ToolOutput.content(descriptor.value as never));\n if (normalized.type !== \"content\") {\n throw new TypeError(\"Tool output middleware structuredResult must be valid tool content.\");\n }\n return { structuredResult: normalized.value };\n}\n\nfunction toolTraceMetadata(tool: AnyTool | undefined): JsonObject | undefined {\n if (tool === undefined) {\n return undefined;\n }\n const result: JsonObject = {\n approvalRequired: toolMayRequireApproval(tool.requiresApproval),\n };\n if (isMcpTool(tool)) {\n result.mcpServerName = tool.mcp.serverName;\n result.mcpRemoteName = tool.mcp.remoteName;\n }\n return result;\n}\n\nfunction toolErrorArgs(\n turn: number,\n toolCall: ToolCallPart,\n internalCallId: string,\n args: string,\n error: unknown,\n): AgentToolErrorArgs {\n let observerArgs: AgentToolErrorArgs = {\n turn,\n toolCall,\n toolName: toolCall.toolName,\n internalCallId,\n args,\n error,\n };\n if (toolCall.callId !== undefined) {\n observerArgs = { ...observerArgs, toolCallId: toolCall.callId };\n }\n return observerArgs;\n}\n\nclass ToolObserverScope {\n private terminal = false;\n\n constructor(private readonly observers: ActiveToolObservers | undefined) {}\n\n streamEvent(args: AgentToolStreamEventArgs): Promise<void> | undefined {\n return this.observers?.streamEvent(args);\n }\n\n async end(args: AgentToolEndArgs): Promise<void> {\n if (this.terminal) return;\n this.terminal = true;\n await this.observers?.end(args);\n }\n\n async suspend(args: AgentToolSuspendedArgs): Promise<void> {\n if (this.terminal) return;\n this.terminal = true;\n await this.observers?.suspend(args);\n }\n\n async error(args: AgentToolErrorArgs): Promise<void> {\n if (this.terminal) return;\n this.terminal = true;\n await this.observers?.error(args);\n }\n}\n\nfunction toolOutputToText(output: NormalizedToolOutput): string {\n switch (output.type) {\n case \"text\":\n case \"error-text\":\n return output.value;\n case \"json\":\n case \"error-json\":\n return JSON.stringify(output.value);\n case \"content\":\n return toolResultContentToText(output.value);\n case \"execution-denied\":\n return output.reason ?? \"Tool execution was denied.\";\n }\n}\n\nfunction toolOutputToStructuredResult(\n output: NormalizedToolOutput,\n): readonly ToolResultContentPart[] | undefined {\n return output.type === \"content\" ? output.value : undefined;\n}\n\nfunction agentToolEventPayload(\n toolCall: ToolCallPart,\n internalCallId: string,\n event: ToolCallStreamEvent,\n): AgentToolEventPayload | undefined {\n if (typeof event.agentId !== \"string\" || event.agentId.length === 0) {\n return undefined;\n }\n const payload: AgentToolEventPayload = {\n type: \"agent_tool_event\" as const,\n toolName: toolCall.toolName,\n internalCallId,\n agentId: event.agentId,\n event: event.event as AgentChildStreamEvent<unknown, unknown>,\n };\n if (toolCall.callId !== undefined) {\n payload.toolCallId = toolCall.callId;\n }\n if (event.agentName !== undefined) {\n payload.agentName = event.agentName;\n }\n return payload;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2GA,SAAS,yBAAyB,OAAwB;AACxD,MAAI,iBAAiB,OAAO;AAE1B,WAAO,GAAG,MAAM,IAAI,KAAK,MAAM,OAAO;AAAA,EACxC;AAEA,MAAI,OAAO,UAAU,UAAU;AAE7B,WAAO;AAAA,EACT;AAEA,MAAI,YAAY,KAAK,GAAG;AACtB,WAAO,KAAK,UAAU,KAAK;AAAA,EAC7B;AAGA,SAAO,OAAO,KAAK;AACrB;AAEO,IAAM,mBAAN,MAAuB;AAAA,EAC5B,YACmB,OACA,YACA,iBACA,WACA,YACA,aACA,oBACA,aACA,QACjB;AATiB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA,EAChB;AAAA,EATgB;AAAA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