@anvia/core 1.13.0 → 1.14.1
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.js +7 -7
- package/dist/agent/index.d.ts +4 -4
- package/dist/agent/index.js +10 -10
- package/dist/agent/resolve-options.js +1 -1
- package/dist/agent/resolved-agent.js +8 -8
- package/dist/agent/snapshot.js +1 -1
- package/dist/agent/team/agent-team.js +10 -10
- package/dist/agent/team/index.js +10 -10
- package/dist/agent/tool-catalog.js +3 -3
- package/dist/{agent-BuX5AXsO.d.ts → agent-DdkrgyW0.d.ts} +1 -1
- package/dist/{chunk-NVALGVQG.js → chunk-4PV56T23.js} +7 -1
- package/dist/chunk-4PV56T23.js.map +1 -0
- package/dist/{chunk-22E25UM7.js → chunk-6S7ZON2E.js} +2 -2
- package/dist/{chunk-OZ2GZHWH.js → chunk-ATFSEEFX.js} +20 -11
- package/dist/chunk-ATFSEEFX.js.map +1 -0
- package/dist/{chunk-KL652GO5.js → chunk-EF26KTFU.js} +2 -2
- package/dist/{chunk-AGOZCYFP.js → chunk-ET5SCES6.js} +6 -6
- package/dist/{chunk-KDGMHES4.js → chunk-GEFG7VGF.js} +4 -4
- package/dist/{chunk-YNA3UR42.js → chunk-J5UQ5I76.js} +72 -21
- package/dist/chunk-J5UQ5I76.js.map +1 -0
- package/dist/{chunk-MG7JYQN2.js → chunk-LC23KCUN.js} +1 -1
- package/dist/chunk-LC23KCUN.js.map +1 -0
- package/dist/{chunk-L2JI2GDH.js → chunk-PNMBJMLB.js} +2 -2
- package/dist/{chunk-ED7RKQHE.js → chunk-RVGSTZD3.js} +7 -3
- package/dist/chunk-RVGSTZD3.js.map +1 -0
- package/dist/{chunk-D43A3KOF.js → chunk-SS52CC5R.js} +3 -3
- package/dist/{chunk-HF5SX5BQ.js → chunk-TJOIYN4O.js} +4 -4
- package/dist/{chunk-KLDNHX4Z.js → chunk-X4XULHDO.js} +4 -4
- package/dist/{chunk-CKWIXVXM.js → chunk-XIIVC5LY.js} +3 -3
- package/dist/embeddings/index.js +8 -8
- package/dist/evals/advanced-metrics.js +2 -2
- package/dist/evals/cli.js +3 -3
- package/dist/evals/index.d.ts +1 -1
- package/dist/evals/index.js +32 -32
- package/dist/evals/metrics.js +4 -4
- package/dist/evals/runner.js +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +12 -12
- package/dist/internal/agent-runtime/agent-run.js +4 -4
- package/dist/internal/agent-runtime/execution.js +1 -1
- package/dist/internal/agent-runtime/retrieval.js +1 -1
- package/dist/internal/agent-runtime/tool-execution.js +2 -2
- package/dist/internal/agent.d.ts +20 -4
- package/dist/internal/agent.js +9 -9
- package/dist/internal/team-runtime/run.js +9 -9
- package/dist/{middleware-D_kNSjzW.d.ts → middleware-rxi6GI2B.d.ts} +16 -1
- package/dist/observability/group.js +1 -1
- package/dist/observability/index.d.ts +1 -1
- package/dist/observability/index.js +1 -1
- package/dist/pipeline/index.d.ts +2 -2
- package/dist/skills/index.js +3 -3
- package/dist/skills/load.js +3 -3
- package/dist/skills/tools.js +1 -1
- package/dist/tool/dynamic-tools.js +1 -1
- package/dist/tool/index.d.ts +1 -1
- package/dist/tool/index.js +1 -1
- package/dist/vector-store/index.js +1 -1
- package/dist/vector-store/ingest.js +1 -1
- package/dist/vector-store/retrieve.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-ED7RKQHE.js.map +0 -1
- package/dist/chunk-MG7JYQN2.js.map +0 -1
- package/dist/chunk-NVALGVQG.js.map +0 -1
- package/dist/chunk-OZ2GZHWH.js.map +0 -1
- package/dist/chunk-YNA3UR42.js.map +0 -1
- /package/dist/{chunk-22E25UM7.js.map → chunk-6S7ZON2E.js.map} +0 -0
- /package/dist/{chunk-KL652GO5.js.map → chunk-EF26KTFU.js.map} +0 -0
- /package/dist/{chunk-AGOZCYFP.js.map → chunk-ET5SCES6.js.map} +0 -0
- /package/dist/{chunk-KDGMHES4.js.map → chunk-GEFG7VGF.js.map} +0 -0
- /package/dist/{chunk-L2JI2GDH.js.map → chunk-PNMBJMLB.js.map} +0 -0
- /package/dist/{chunk-D43A3KOF.js.map → chunk-SS52CC5R.js.map} +0 -0
- /package/dist/{chunk-HF5SX5BQ.js.map → chunk-TJOIYN4O.js.map} +0 -0
- /package/dist/{chunk-KLDNHX4Z.js.map → chunk-X4XULHDO.js.map} +0 -0
- /package/dist/{chunk-CKWIXVXM.js.map → chunk-XIIVC5LY.js.map} +0 -0
package/dist/agent/agent.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Agent
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-TJOIYN4O.js";
|
|
4
|
+
import "../chunk-ATFSEEFX.js";
|
|
5
5
|
import "../chunk-SXE4J43E.js";
|
|
6
|
-
import "../chunk-
|
|
6
|
+
import "../chunk-RVGSTZD3.js";
|
|
7
7
|
import "../chunk-LAIATEUB.js";
|
|
8
8
|
import "../chunk-3F6ZY63S.js";
|
|
9
9
|
import "../chunk-ZWYMXBGB.js";
|
|
@@ -18,7 +18,7 @@ import "../chunk-JMJFK3A4.js";
|
|
|
18
18
|
import "../chunk-IRXAEVEQ.js";
|
|
19
19
|
import "../chunk-CASF2TDK.js";
|
|
20
20
|
import "../chunk-4AW2633B.js";
|
|
21
|
-
import "../chunk-
|
|
21
|
+
import "../chunk-J5UQ5I76.js";
|
|
22
22
|
import "../chunk-H3H74RWJ.js";
|
|
23
23
|
import "../chunk-6Q5VOKBO.js";
|
|
24
24
|
import "../chunk-LQJ4KHMY.js";
|
|
@@ -27,7 +27,7 @@ import "../chunk-MJCMKZFP.js";
|
|
|
27
27
|
import "../chunk-OJF67RNM.js";
|
|
28
28
|
import "../chunk-FAPIZJS2.js";
|
|
29
29
|
import "../chunk-7LBPRXZP.js";
|
|
30
|
-
import "../chunk-
|
|
30
|
+
import "../chunk-PNMBJMLB.js";
|
|
31
31
|
import "../chunk-A7BXVZXZ.js";
|
|
32
32
|
import "../chunk-TP3MCUXS.js";
|
|
33
33
|
import "../chunk-6RQYWZI3.js";
|
|
@@ -54,14 +54,14 @@ import "../chunk-PJNE75WC.js";
|
|
|
54
54
|
import "../chunk-PLDJCCVL.js";
|
|
55
55
|
import "../chunk-3J2CSVPR.js";
|
|
56
56
|
import "../chunk-ERN7P6Q4.js";
|
|
57
|
+
import "../chunk-7F53DOML.js";
|
|
57
58
|
import "../chunk-YCTXTOOQ.js";
|
|
58
59
|
import "../chunk-DU4WA6LQ.js";
|
|
59
60
|
import "../chunk-KO5NMTAM.js";
|
|
60
61
|
import "../chunk-TFIOU6UR.js";
|
|
61
62
|
import "../chunk-GPVXCY5I.js";
|
|
62
|
-
import "../chunk-7F53DOML.js";
|
|
63
63
|
import "../chunk-4FIVU53H.js";
|
|
64
|
-
import "../chunk-
|
|
64
|
+
import "../chunk-4PV56T23.js";
|
|
65
65
|
import "../chunk-ZHC5CD6J.js";
|
|
66
66
|
import "../chunk-5V533R7F.js";
|
|
67
67
|
import "../chunk-KY4VXIN2.js";
|
package/dist/agent/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export { M as ModelCallOptions } from '../model-call-options-CZkSw_xN.js';
|
|
2
2
|
export { R as RetryContext, a as RetryOptions, b as RetrySetting } from '../retry-CjvSlKGW.js';
|
|
3
|
-
import { A as Agent, d as AgentOptions } from '../agent-
|
|
4
|
-
export { a as AgentContextInput, b as AgentMemory, c as AgentMemoryOptions, 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-
|
|
3
|
+
import { A as Agent, d as AgentOptions } from '../agent-DdkrgyW0.js';
|
|
4
|
+
export { a as AgentContextInput, b as AgentMemory, c as AgentMemoryOptions, 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-DdkrgyW0.js';
|
|
5
5
|
import { d as CompletionModel, f as CompletionModelControlsOf, M as Message, U as Usage, c as CompletionFinishReason } from '../types-DYqZKDA8.js';
|
|
6
6
|
import { AgentInteractionRequest, AgentInteractionResponse } from './interactions/index.js';
|
|
7
|
-
import { p as AgentRunSettings, m as AgentPrompt, n as AgentResponse, A as AgentBlockedOutcome, v as AgentStreamEvent, r as AgentSteerInput, s as AgentSteerReceipt, g as AgentInteractionOutcome } from '../middleware-
|
|
8
|
-
export { a as AgentChildStreamEvent, b as AgentDeltaEvent, c as AgentErrorEvent, d as AgentErrorStreamEvent, e as AgentFinishEvent, f as AgentInput, h as AgentLifecycle, i as AgentMemoryCompactionEvent, j as AgentMemoryCompactionOptions, l as AgentOutcome, o as AgentRunOptions, q as AgentStartEvent, t as AgentStepFinishEvent, u as AgentStream, w as AgentToolCallDeltaEvent, x as AgentToolFinishEvent, y as AgentToolStartEvent } from '../middleware-
|
|
7
|
+
import { p as AgentRunSettings, m as AgentPrompt, n as AgentResponse, A as AgentBlockedOutcome, v as AgentStreamEvent, r as AgentSteerInput, s as AgentSteerReceipt, g as AgentInteractionOutcome } from '../middleware-rxi6GI2B.js';
|
|
8
|
+
export { a as AgentChildStreamEvent, b as AgentDeltaEvent, c as AgentErrorEvent, d as AgentErrorStreamEvent, e as AgentFinishEvent, f as AgentInput, h as AgentLifecycle, i as AgentMemoryCompactionEvent, j as AgentMemoryCompactionOptions, l as AgentOutcome, o as AgentRunOptions, q as AgentStartEvent, t as AgentStepFinishEvent, u as AgentStream, w as AgentToolCallDeltaEvent, x as AgentToolFinishEvent, y as AgentToolStartEvent } from '../middleware-rxi6GI2B.js';
|
|
9
9
|
import '../types-CqiX-4_C.js';
|
|
10
10
|
import '../types-94Q2mPRa.js';
|
|
11
11
|
import '../tool-W1cAPuRF.js';
|
package/dist/agent/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import "../chunk-53TPAXYR.js";
|
|
2
2
|
import {
|
|
3
3
|
AgentTeam
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-SS52CC5R.js";
|
|
5
5
|
import "../chunk-X6WS3XWL.js";
|
|
6
|
-
import "../chunk-
|
|
6
|
+
import "../chunk-XIIVC5LY.js";
|
|
7
7
|
import "../chunk-PIMD4DYG.js";
|
|
8
8
|
import "../chunk-FSBDE6RF.js";
|
|
9
9
|
import "../chunk-3TAQXJBC.js";
|
|
@@ -12,13 +12,13 @@ import {
|
|
|
12
12
|
AgentTeamInteractionError,
|
|
13
13
|
AgentTeamLimitError
|
|
14
14
|
} from "../chunk-ENZ2XX27.js";
|
|
15
|
-
import "../chunk-
|
|
15
|
+
import "../chunk-6S7ZON2E.js";
|
|
16
16
|
import {
|
|
17
17
|
Agent
|
|
18
|
-
} from "../chunk-
|
|
19
|
-
import "../chunk-
|
|
18
|
+
} from "../chunk-TJOIYN4O.js";
|
|
19
|
+
import "../chunk-ATFSEEFX.js";
|
|
20
20
|
import "../chunk-SXE4J43E.js";
|
|
21
|
-
import "../chunk-
|
|
21
|
+
import "../chunk-RVGSTZD3.js";
|
|
22
22
|
import "../chunk-LAIATEUB.js";
|
|
23
23
|
import "../chunk-3F6ZY63S.js";
|
|
24
24
|
import "../chunk-ZWYMXBGB.js";
|
|
@@ -33,7 +33,7 @@ import "../chunk-JMJFK3A4.js";
|
|
|
33
33
|
import "../chunk-IRXAEVEQ.js";
|
|
34
34
|
import "../chunk-CASF2TDK.js";
|
|
35
35
|
import "../chunk-4AW2633B.js";
|
|
36
|
-
import "../chunk-
|
|
36
|
+
import "../chunk-J5UQ5I76.js";
|
|
37
37
|
import "../chunk-H3H74RWJ.js";
|
|
38
38
|
import "../chunk-6Q5VOKBO.js";
|
|
39
39
|
import "../chunk-LQJ4KHMY.js";
|
|
@@ -42,7 +42,7 @@ import "../chunk-MJCMKZFP.js";
|
|
|
42
42
|
import "../chunk-OJF67RNM.js";
|
|
43
43
|
import "../chunk-FAPIZJS2.js";
|
|
44
44
|
import "../chunk-7LBPRXZP.js";
|
|
45
|
-
import "../chunk-
|
|
45
|
+
import "../chunk-PNMBJMLB.js";
|
|
46
46
|
import "../chunk-A7BXVZXZ.js";
|
|
47
47
|
import "../chunk-TP3MCUXS.js";
|
|
48
48
|
import "../chunk-6RQYWZI3.js";
|
|
@@ -69,14 +69,14 @@ import "../chunk-PJNE75WC.js";
|
|
|
69
69
|
import "../chunk-PLDJCCVL.js";
|
|
70
70
|
import "../chunk-3J2CSVPR.js";
|
|
71
71
|
import "../chunk-ERN7P6Q4.js";
|
|
72
|
+
import "../chunk-7F53DOML.js";
|
|
72
73
|
import "../chunk-YCTXTOOQ.js";
|
|
73
74
|
import "../chunk-DU4WA6LQ.js";
|
|
74
75
|
import "../chunk-KO5NMTAM.js";
|
|
75
76
|
import "../chunk-TFIOU6UR.js";
|
|
76
77
|
import "../chunk-GPVXCY5I.js";
|
|
77
|
-
import "../chunk-7F53DOML.js";
|
|
78
78
|
import "../chunk-4FIVU53H.js";
|
|
79
|
-
import "../chunk-
|
|
79
|
+
import "../chunk-4PV56T23.js";
|
|
80
80
|
import {
|
|
81
81
|
createVectorContext,
|
|
82
82
|
isVectorContext
|
|
@@ -20,12 +20,12 @@ import "../chunk-PJNE75WC.js";
|
|
|
20
20
|
import "../chunk-PLDJCCVL.js";
|
|
21
21
|
import "../chunk-3J2CSVPR.js";
|
|
22
22
|
import "../chunk-ERN7P6Q4.js";
|
|
23
|
+
import "../chunk-7F53DOML.js";
|
|
23
24
|
import "../chunk-YCTXTOOQ.js";
|
|
24
25
|
import "../chunk-DU4WA6LQ.js";
|
|
25
26
|
import "../chunk-KO5NMTAM.js";
|
|
26
27
|
import "../chunk-TFIOU6UR.js";
|
|
27
28
|
import "../chunk-GPVXCY5I.js";
|
|
28
|
-
import "../chunk-7F53DOML.js";
|
|
29
29
|
import "../chunk-4FIVU53H.js";
|
|
30
30
|
import "../chunk-5V533R7F.js";
|
|
31
31
|
import "../chunk-MEFGXAKJ.js";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createResolvedAgent,
|
|
3
3
|
getResolvedAgentOptions
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-6S7ZON2E.js";
|
|
5
|
+
import "../chunk-TJOIYN4O.js";
|
|
6
|
+
import "../chunk-ATFSEEFX.js";
|
|
7
7
|
import "../chunk-SXE4J43E.js";
|
|
8
|
-
import "../chunk-
|
|
8
|
+
import "../chunk-RVGSTZD3.js";
|
|
9
9
|
import "../chunk-LAIATEUB.js";
|
|
10
10
|
import "../chunk-3F6ZY63S.js";
|
|
11
11
|
import "../chunk-ZWYMXBGB.js";
|
|
@@ -20,7 +20,7 @@ import "../chunk-JMJFK3A4.js";
|
|
|
20
20
|
import "../chunk-IRXAEVEQ.js";
|
|
21
21
|
import "../chunk-CASF2TDK.js";
|
|
22
22
|
import "../chunk-4AW2633B.js";
|
|
23
|
-
import "../chunk-
|
|
23
|
+
import "../chunk-J5UQ5I76.js";
|
|
24
24
|
import "../chunk-H3H74RWJ.js";
|
|
25
25
|
import "../chunk-6Q5VOKBO.js";
|
|
26
26
|
import "../chunk-LQJ4KHMY.js";
|
|
@@ -29,7 +29,7 @@ import "../chunk-MJCMKZFP.js";
|
|
|
29
29
|
import "../chunk-OJF67RNM.js";
|
|
30
30
|
import "../chunk-FAPIZJS2.js";
|
|
31
31
|
import "../chunk-7LBPRXZP.js";
|
|
32
|
-
import "../chunk-
|
|
32
|
+
import "../chunk-PNMBJMLB.js";
|
|
33
33
|
import "../chunk-A7BXVZXZ.js";
|
|
34
34
|
import "../chunk-TP3MCUXS.js";
|
|
35
35
|
import "../chunk-6RQYWZI3.js";
|
|
@@ -56,14 +56,14 @@ import "../chunk-PJNE75WC.js";
|
|
|
56
56
|
import "../chunk-PLDJCCVL.js";
|
|
57
57
|
import "../chunk-3J2CSVPR.js";
|
|
58
58
|
import "../chunk-ERN7P6Q4.js";
|
|
59
|
+
import "../chunk-7F53DOML.js";
|
|
59
60
|
import "../chunk-YCTXTOOQ.js";
|
|
60
61
|
import "../chunk-DU4WA6LQ.js";
|
|
61
62
|
import "../chunk-KO5NMTAM.js";
|
|
62
63
|
import "../chunk-TFIOU6UR.js";
|
|
63
64
|
import "../chunk-GPVXCY5I.js";
|
|
64
|
-
import "../chunk-7F53DOML.js";
|
|
65
65
|
import "../chunk-4FIVU53H.js";
|
|
66
|
-
import "../chunk-
|
|
66
|
+
import "../chunk-4PV56T23.js";
|
|
67
67
|
import "../chunk-ZHC5CD6J.js";
|
|
68
68
|
import "../chunk-5V533R7F.js";
|
|
69
69
|
import "../chunk-KY4VXIN2.js";
|
package/dist/agent/snapshot.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AgentTeam
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-SS52CC5R.js";
|
|
4
4
|
import "../../chunk-X6WS3XWL.js";
|
|
5
|
-
import "../../chunk-
|
|
5
|
+
import "../../chunk-XIIVC5LY.js";
|
|
6
6
|
import "../../chunk-PIMD4DYG.js";
|
|
7
7
|
import "../../chunk-FSBDE6RF.js";
|
|
8
8
|
import "../../chunk-3TAQXJBC.js";
|
|
9
9
|
import "../../chunk-X35O3AQG.js";
|
|
10
10
|
import "../../chunk-ENZ2XX27.js";
|
|
11
|
-
import "../../chunk-
|
|
12
|
-
import "../../chunk-
|
|
13
|
-
import "../../chunk-
|
|
11
|
+
import "../../chunk-6S7ZON2E.js";
|
|
12
|
+
import "../../chunk-TJOIYN4O.js";
|
|
13
|
+
import "../../chunk-ATFSEEFX.js";
|
|
14
14
|
import "../../chunk-SXE4J43E.js";
|
|
15
|
-
import "../../chunk-
|
|
15
|
+
import "../../chunk-RVGSTZD3.js";
|
|
16
16
|
import "../../chunk-LAIATEUB.js";
|
|
17
17
|
import "../../chunk-3F6ZY63S.js";
|
|
18
18
|
import "../../chunk-ZWYMXBGB.js";
|
|
@@ -27,7 +27,7 @@ import "../../chunk-JMJFK3A4.js";
|
|
|
27
27
|
import "../../chunk-IRXAEVEQ.js";
|
|
28
28
|
import "../../chunk-CASF2TDK.js";
|
|
29
29
|
import "../../chunk-4AW2633B.js";
|
|
30
|
-
import "../../chunk-
|
|
30
|
+
import "../../chunk-J5UQ5I76.js";
|
|
31
31
|
import "../../chunk-H3H74RWJ.js";
|
|
32
32
|
import "../../chunk-6Q5VOKBO.js";
|
|
33
33
|
import "../../chunk-LQJ4KHMY.js";
|
|
@@ -36,7 +36,7 @@ import "../../chunk-MJCMKZFP.js";
|
|
|
36
36
|
import "../../chunk-OJF67RNM.js";
|
|
37
37
|
import "../../chunk-FAPIZJS2.js";
|
|
38
38
|
import "../../chunk-7LBPRXZP.js";
|
|
39
|
-
import "../../chunk-
|
|
39
|
+
import "../../chunk-PNMBJMLB.js";
|
|
40
40
|
import "../../chunk-A7BXVZXZ.js";
|
|
41
41
|
import "../../chunk-TP3MCUXS.js";
|
|
42
42
|
import "../../chunk-6RQYWZI3.js";
|
|
@@ -63,14 +63,14 @@ import "../../chunk-PJNE75WC.js";
|
|
|
63
63
|
import "../../chunk-PLDJCCVL.js";
|
|
64
64
|
import "../../chunk-3J2CSVPR.js";
|
|
65
65
|
import "../../chunk-ERN7P6Q4.js";
|
|
66
|
+
import "../../chunk-7F53DOML.js";
|
|
66
67
|
import "../../chunk-YCTXTOOQ.js";
|
|
67
68
|
import "../../chunk-DU4WA6LQ.js";
|
|
68
69
|
import "../../chunk-KO5NMTAM.js";
|
|
69
70
|
import "../../chunk-TFIOU6UR.js";
|
|
70
71
|
import "../../chunk-GPVXCY5I.js";
|
|
71
|
-
import "../../chunk-7F53DOML.js";
|
|
72
72
|
import "../../chunk-4FIVU53H.js";
|
|
73
|
-
import "../../chunk-
|
|
73
|
+
import "../../chunk-4PV56T23.js";
|
|
74
74
|
import "../../chunk-ZHC5CD6J.js";
|
|
75
75
|
import "../../chunk-5V533R7F.js";
|
|
76
76
|
import "../../chunk-KY4VXIN2.js";
|
package/dist/agent/team/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import "../../chunk-53TPAXYR.js";
|
|
2
2
|
import {
|
|
3
3
|
AgentTeam
|
|
4
|
-
} from "../../chunk-
|
|
4
|
+
} from "../../chunk-SS52CC5R.js";
|
|
5
5
|
import "../../chunk-X6WS3XWL.js";
|
|
6
|
-
import "../../chunk-
|
|
6
|
+
import "../../chunk-XIIVC5LY.js";
|
|
7
7
|
import "../../chunk-PIMD4DYG.js";
|
|
8
8
|
import "../../chunk-FSBDE6RF.js";
|
|
9
9
|
import "../../chunk-3TAQXJBC.js";
|
|
@@ -12,11 +12,11 @@ import {
|
|
|
12
12
|
AgentTeamInteractionError,
|
|
13
13
|
AgentTeamLimitError
|
|
14
14
|
} from "../../chunk-ENZ2XX27.js";
|
|
15
|
-
import "../../chunk-
|
|
16
|
-
import "../../chunk-
|
|
17
|
-
import "../../chunk-
|
|
15
|
+
import "../../chunk-6S7ZON2E.js";
|
|
16
|
+
import "../../chunk-TJOIYN4O.js";
|
|
17
|
+
import "../../chunk-ATFSEEFX.js";
|
|
18
18
|
import "../../chunk-SXE4J43E.js";
|
|
19
|
-
import "../../chunk-
|
|
19
|
+
import "../../chunk-RVGSTZD3.js";
|
|
20
20
|
import "../../chunk-LAIATEUB.js";
|
|
21
21
|
import "../../chunk-3F6ZY63S.js";
|
|
22
22
|
import "../../chunk-ZWYMXBGB.js";
|
|
@@ -31,7 +31,7 @@ import "../../chunk-JMJFK3A4.js";
|
|
|
31
31
|
import "../../chunk-IRXAEVEQ.js";
|
|
32
32
|
import "../../chunk-CASF2TDK.js";
|
|
33
33
|
import "../../chunk-4AW2633B.js";
|
|
34
|
-
import "../../chunk-
|
|
34
|
+
import "../../chunk-J5UQ5I76.js";
|
|
35
35
|
import "../../chunk-H3H74RWJ.js";
|
|
36
36
|
import "../../chunk-6Q5VOKBO.js";
|
|
37
37
|
import "../../chunk-LQJ4KHMY.js";
|
|
@@ -40,7 +40,7 @@ import "../../chunk-MJCMKZFP.js";
|
|
|
40
40
|
import "../../chunk-OJF67RNM.js";
|
|
41
41
|
import "../../chunk-FAPIZJS2.js";
|
|
42
42
|
import "../../chunk-7LBPRXZP.js";
|
|
43
|
-
import "../../chunk-
|
|
43
|
+
import "../../chunk-PNMBJMLB.js";
|
|
44
44
|
import "../../chunk-A7BXVZXZ.js";
|
|
45
45
|
import "../../chunk-TP3MCUXS.js";
|
|
46
46
|
import "../../chunk-6RQYWZI3.js";
|
|
@@ -67,14 +67,14 @@ import "../../chunk-PJNE75WC.js";
|
|
|
67
67
|
import "../../chunk-PLDJCCVL.js";
|
|
68
68
|
import "../../chunk-3J2CSVPR.js";
|
|
69
69
|
import "../../chunk-ERN7P6Q4.js";
|
|
70
|
+
import "../../chunk-7F53DOML.js";
|
|
70
71
|
import "../../chunk-YCTXTOOQ.js";
|
|
71
72
|
import "../../chunk-DU4WA6LQ.js";
|
|
72
73
|
import "../../chunk-KO5NMTAM.js";
|
|
73
74
|
import "../../chunk-TFIOU6UR.js";
|
|
74
75
|
import "../../chunk-GPVXCY5I.js";
|
|
75
|
-
import "../../chunk-7F53DOML.js";
|
|
76
76
|
import "../../chunk-4FIVU53H.js";
|
|
77
|
-
import "../../chunk-
|
|
77
|
+
import "../../chunk-4PV56T23.js";
|
|
78
78
|
import "../../chunk-ZHC5CD6J.js";
|
|
79
79
|
import "../../chunk-5V533R7F.js";
|
|
80
80
|
import "../../chunk-KY4VXIN2.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
prepareAgentTools
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-PNMBJMLB.js";
|
|
4
4
|
import "../chunk-VUY2C2QD.js";
|
|
5
5
|
import "../chunk-Y5FHUUNC.js";
|
|
6
6
|
import "../chunk-3FIX7GLM.js";
|
|
@@ -11,14 +11,14 @@ import "../chunk-PJNE75WC.js";
|
|
|
11
11
|
import "../chunk-PLDJCCVL.js";
|
|
12
12
|
import "../chunk-3J2CSVPR.js";
|
|
13
13
|
import "../chunk-ERN7P6Q4.js";
|
|
14
|
+
import "../chunk-7F53DOML.js";
|
|
14
15
|
import "../chunk-YCTXTOOQ.js";
|
|
15
16
|
import "../chunk-DU4WA6LQ.js";
|
|
16
17
|
import "../chunk-KO5NMTAM.js";
|
|
17
18
|
import "../chunk-TFIOU6UR.js";
|
|
18
19
|
import "../chunk-GPVXCY5I.js";
|
|
19
|
-
import "../chunk-7F53DOML.js";
|
|
20
20
|
import "../chunk-4FIVU53H.js";
|
|
21
|
-
import "../chunk-
|
|
21
|
+
import "../chunk-4PV56T23.js";
|
|
22
22
|
import "../chunk-ZHC5CD6J.js";
|
|
23
23
|
import "../chunk-5V533R7F.js";
|
|
24
24
|
import "../chunk-MEFGXAKJ.js";
|
|
@@ -3,7 +3,7 @@ import { D as Document, d as CompletionModel, P as ProviderTool, J as JsonObject
|
|
|
3
3
|
import { d as GuardrailPolicyInput, c as GuardrailPolicy } from './types-CqiX-4_C.js';
|
|
4
4
|
import { a as McpServer } from './types-94Q2mPRa.js';
|
|
5
5
|
import { F as MemoryStore, A as MemorySavePolicy, G as MemoryTokenCounter, o as MemoryCompactor, d as MemoryCompactionConflictRetryOptions, z as MemoryOptions, k as MemoryCompactionResult } from './types-CWh9AQrq.js';
|
|
6
|
-
import { h as AgentLifecycle, P as AgentObservabilityOptions, k as AgentMiddleware, o as AgentRunOptions, l as AgentOutcome, p as AgentRunSettings, u as AgentStream, j as AgentMemoryCompactionOptions } from './middleware-
|
|
6
|
+
import { h as AgentLifecycle, P as AgentObservabilityOptions, k as AgentMiddleware, o as AgentRunOptions, l as AgentOutcome, p as AgentRunSettings, u as AgentStream, j as AgentMemoryCompactionOptions } from './middleware-rxi6GI2B.js';
|
|
7
7
|
import { Z as ZodSchema } from './zod-schema-C7F4clpm.js';
|
|
8
8
|
import { A as AnyTool, T as Tool, c as ToolCallContext, N as NormalizedToolOutput } from './tool-W1cAPuRF.js';
|
|
9
9
|
import { AgentContinuation, AgentInteractionResponse } from './agent/interactions/index.js';
|
|
@@ -37,6 +37,9 @@ function snapshotAgentObservability(observability) {
|
|
|
37
37
|
if (errorPolicy !== "ignore" && errorPolicy !== "throw") {
|
|
38
38
|
throw new TypeError('Agent observability.errorPolicy must be "ignore" or "throw".');
|
|
39
39
|
}
|
|
40
|
+
if (observability.onObserverError !== void 0 && typeof observability.onObserverError !== "function") {
|
|
41
|
+
throw new TypeError("Agent observability.onObserverError must be a function.");
|
|
42
|
+
}
|
|
40
43
|
let snapshot = {
|
|
41
44
|
observers: Object.freeze(observers),
|
|
42
45
|
errorPolicy
|
|
@@ -44,6 +47,9 @@ function snapshotAgentObservability(observability) {
|
|
|
44
47
|
if (observability.primaryTrace !== void 0) {
|
|
45
48
|
snapshot = { ...snapshot, primaryTrace: observability.primaryTrace };
|
|
46
49
|
}
|
|
50
|
+
if (observability.onObserverError !== void 0) {
|
|
51
|
+
snapshot = { ...snapshot, onObserverError: observability.onObserverError };
|
|
52
|
+
}
|
|
47
53
|
return Object.freeze(snapshot);
|
|
48
54
|
}
|
|
49
55
|
function snapshotGuardrailPolicies(policies) {
|
|
@@ -147,4 +153,4 @@ export {
|
|
|
147
153
|
snapshotAgentMemory,
|
|
148
154
|
cloneFrozenPlainData
|
|
149
155
|
};
|
|
150
|
-
//# sourceMappingURL=chunk-
|
|
156
|
+
//# sourceMappingURL=chunk-4PV56T23.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/agent/snapshot.ts"],"sourcesContent":["import type { GuardrailPolicy } from \"../guardrails\";\nimport { assertFiniteMinScore, assertPositiveSearchLimit } from \"../internal/vector-search-options\";\nimport type { AgentObservabilityOptions, AgentObserverMap } from \"../observability\";\nimport type { VectorSearchResult } from \"../vector-store\";\nimport type { AgentContextInput, AgentMemory } from \"./types\";\nimport {\n isVectorContext,\n type VectorContext,\n type VectorContextBaseOptions,\n} from \"./vector-context\";\n\nexport function snapshotAgentContext<T>(\n inputs: readonly AgentContextInput<T>[] | undefined,\n): readonly AgentContextInput<T>[] {\n const context = (inputs ?? []).map(snapshotContextInput);\n for (const input of context) {\n if (!isVectorContext(input)) continue;\n assertPositiveSearchLimit(input.topK);\n assertFiniteMinScore(input.minScore);\n }\n return Object.freeze(context);\n}\n\nexport function snapshotAgentObservability(\n observability: AgentObservabilityOptions | undefined,\n): AgentObservabilityOptions | undefined {\n if (observability === undefined) return undefined;\n const observers: Record<string, AgentObserverMap[string]> = {};\n for (const [name, observer] of Object.entries(observability.observers)) {\n if (name.trim().length === 0) {\n throw new TypeError(\"Agent observer names must not be empty.\");\n }\n if (\n typeof observer !== \"object\" ||\n observer === null ||\n typeof observer.startRun !== \"function\"\n ) {\n throw new TypeError(`Agent observer \"${name}\" must implement startRun().`);\n }\n observers[name] = observer;\n }\n if (observability.primaryTrace !== undefined && !(observability.primaryTrace in observers)) {\n throw new TypeError(\n `Agent primaryTrace \"${observability.primaryTrace}\" must name a configured observer.`,\n );\n }\n const errorPolicy = observability.errorPolicy ?? \"ignore\";\n if (errorPolicy !== \"ignore\" && errorPolicy !== \"throw\") {\n throw new TypeError('Agent observability.errorPolicy must be \"ignore\" or \"throw\".');\n }\n if (\n observability.onObserverError !== undefined &&\n typeof observability.onObserverError !== \"function\"\n ) {\n throw new TypeError(\"Agent observability.onObserverError must be a function.\");\n }\n let snapshot: AgentObservabilityOptions = {\n observers: Object.freeze(observers),\n errorPolicy,\n };\n if (observability.primaryTrace !== undefined) {\n snapshot = { ...snapshot, primaryTrace: observability.primaryTrace };\n }\n if (observability.onObserverError !== undefined) {\n snapshot = { ...snapshot, onObserverError: observability.onObserverError };\n }\n return Object.freeze(snapshot);\n}\n\nexport function snapshotGuardrailPolicies(\n policies: readonly GuardrailPolicy[] | undefined,\n): readonly GuardrailPolicy[] {\n return Object.freeze((policies ?? []).map(snapshotGuardrailPolicy));\n}\n\nexport function snapshotAgentMemory(memory: AgentMemory | undefined): AgentMemory | undefined {\n if (memory === undefined) {\n return undefined;\n }\n const compaction =\n memory.compaction === undefined\n ? undefined\n : Object.freeze({\n ...memory.compaction,\n trigger: Object.freeze({ ...memory.compaction.trigger }),\n retention: Object.freeze({ ...memory.compaction.retention }),\n conflictRetries:\n memory.compaction.conflictRetries === false\n ? false\n : Object.freeze({ ...memory.compaction.conflictRetries }),\n });\n let snapshot: AgentMemory = {\n store: memory.store,\n savePolicy: memory.savePolicy,\n };\n if (compaction !== undefined) {\n snapshot = { ...snapshot, compaction };\n }\n return Object.freeze(snapshot);\n}\n\nexport function cloneFrozenPlainData<T>(value: T): T {\n if (Array.isArray(value)) {\n return Object.freeze(value.map(cloneFrozenPlainData)) as T;\n }\n if (typeof value !== \"object\" || value === null) {\n return value;\n }\n const prototype = Object.getPrototypeOf(value);\n if (prototype !== Object.prototype && prototype !== null) {\n return value;\n }\n const clone = Object.fromEntries(\n Object.entries(value).map(([key, item]) => [key, cloneFrozenPlainData(item)]),\n );\n return Object.freeze(clone) as T;\n}\n\nfunction snapshotContextInput<T>(input: AgentContextInput<T>): AgentContextInput<T> {\n if (!isVectorContext(input)) {\n let document: AgentContextInput<T> = {\n id: input.id,\n text: input.text,\n };\n if (input.additionalProps !== undefined) {\n document = {\n ...document,\n additionalProps: cloneFrozenPlainData(input.additionalProps),\n };\n }\n return Object.freeze(document);\n }\n const format = input.format;\n let shared: VectorContextBaseOptions<T> & {\n kind: \"vector-context\";\n store: VectorContext<T>[\"store\"];\n } = {\n kind: \"vector-context\" as const,\n store: input.store,\n topK: input.topK,\n };\n if (input.minScore !== undefined) {\n shared = { ...shared, minScore: input.minScore };\n }\n if (input.filter !== undefined) {\n shared = { ...shared, filter: cloneFrozenPlainData(input.filter) };\n }\n if (input.retries !== undefined) {\n shared = { ...shared, retries: cloneFrozenPlainData(input.retries) };\n }\n if (format !== undefined) {\n shared = {\n ...shared,\n format: (result: VectorSearchResult<T>) => format.call(input, result),\n };\n }\n if (!(\"models\" in input) || input.models === undefined) {\n return Object.freeze<VectorContext<T>>({ ...shared, store: input.store, model: input.model });\n }\n let context: VectorContext<T> = {\n ...shared,\n store: input.store,\n models: input.models,\n };\n if (input.fusion !== undefined) {\n context = { ...context, fusion: input.fusion };\n }\n return Object.freeze(context);\n}\n\nfunction snapshotGuardrailPolicy(policy: GuardrailPolicy): GuardrailPolicy {\n return Object.freeze({\n ...policy,\n input: Object.freeze([...policy.input]),\n output: Object.freeze([...policy.output]),\n }) as GuardrailPolicy;\n}\n"],"mappings":"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","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Agent
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-TJOIYN4O.js";
|
|
4
4
|
import {
|
|
5
5
|
getAgentToolState
|
|
6
6
|
} from "./chunk-A7BXVZXZ.js";
|
|
@@ -45,4 +45,4 @@ export {
|
|
|
45
45
|
createResolvedAgent,
|
|
46
46
|
getResolvedAgentOptions
|
|
47
47
|
};
|
|
48
|
-
//# sourceMappingURL=chunk-
|
|
48
|
+
//# sourceMappingURL=chunk-6S7ZON2E.js.map
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "./chunk-SXE4J43E.js";
|
|
7
7
|
import {
|
|
8
8
|
ToolCallExecutor
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-RVGSTZD3.js";
|
|
10
10
|
import {
|
|
11
11
|
normalizeMemoryScope
|
|
12
12
|
} from "./chunk-LAIATEUB.js";
|
|
@@ -43,8 +43,9 @@ import {
|
|
|
43
43
|
isQuestionTool
|
|
44
44
|
} from "./chunk-IRXAEVEQ.js";
|
|
45
45
|
import {
|
|
46
|
+
ActiveGenerationObservers,
|
|
46
47
|
startAgentRunObservers
|
|
47
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-J5UQ5I76.js";
|
|
48
49
|
import {
|
|
49
50
|
MemoryCompactionError
|
|
50
51
|
} from "./chunk-LQJ4KHMY.js";
|
|
@@ -397,14 +398,16 @@ var AgentRun = class _AgentRun {
|
|
|
397
398
|
const historyForRequest = [...this.chatHistory, ...newMessages.slice(0, -1)];
|
|
398
399
|
await this.runTurnStartHook(currentTurns, prompt, historyForRequest, newMessages);
|
|
399
400
|
await this.runCompletionCallHook(prompt, historyForRequest, newMessages);
|
|
401
|
+
const contextReplayed = this.replayed({ kind: "context", turn: currentTurns });
|
|
400
402
|
const prepared = this.execution?.prepareMessages !== void 0 || this.agent.memory?.compaction !== void 0 ? await this.prepareTurnMessages(currentTurns, [...historyForRequest, prompt]) : { messages: [...historyForRequest, prompt] };
|
|
401
403
|
if (prepared.compaction !== void 0) {
|
|
402
|
-
usage = Usage.add(usage, prepared.compaction.usage);
|
|
404
|
+
if (!contextReplayed) usage = Usage.add(usage, prepared.compaction.usage);
|
|
403
405
|
this.memoryCompaction = prepared.compaction;
|
|
404
406
|
await this.notifyInternalMemoryCompaction(prepared.compaction);
|
|
405
|
-
await this.recordMemoryCompaction(prepared, runObservers);
|
|
407
|
+
if (!contextReplayed) await this.recordMemoryCompaction(prepared, runObservers);
|
|
406
408
|
}
|
|
407
409
|
const request = await this.createTurnRequest(prompt, prepared.messages, currentTurns);
|
|
410
|
+
const modelReplayed = this.replayed({ kind: "model", turn: currentTurns });
|
|
408
411
|
let response;
|
|
409
412
|
try {
|
|
410
413
|
response = await this.runCompletion(request, currentTurns, runObservers);
|
|
@@ -422,7 +425,7 @@ var AgentRun = class _AgentRun {
|
|
|
422
425
|
if (providerOutputUsage !== void 0) usage = Usage.add(usage, providerOutputUsage);
|
|
423
426
|
throw error;
|
|
424
427
|
}
|
|
425
|
-
usage = Usage.add(usage, response.usage);
|
|
428
|
+
if (!modelReplayed) usage = Usage.add(usage, response.usage);
|
|
426
429
|
this.updateRunProgress(newMessages);
|
|
427
430
|
await this.runCompletionResponseHook(prompt, response, newMessages);
|
|
428
431
|
await this.runTurnEndHook(currentTurns, response, newMessages);
|
|
@@ -717,12 +720,13 @@ var AgentRun = class _AgentRun {
|
|
|
717
720
|
};
|
|
718
721
|
await this.runTurnStartHook(currentTurns, prompt, historyForRequest, newMessages);
|
|
719
722
|
await this.runCompletionCallHook(prompt, historyForRequest, newMessages);
|
|
723
|
+
const contextReplayed = this.replayed({ kind: "context", turn: currentTurns });
|
|
720
724
|
const prepared = this.execution?.prepareMessages !== void 0 || this.agent.memory?.compaction !== void 0 ? await this.prepareTurnMessages(currentTurns, [...historyForRequest, prompt]) : { messages: [...historyForRequest, prompt] };
|
|
721
725
|
if (prepared.compaction !== void 0) {
|
|
722
|
-
usage = Usage.add(usage, prepared.compaction.usage);
|
|
726
|
+
if (!contextReplayed) usage = Usage.add(usage, prepared.compaction.usage);
|
|
723
727
|
this.memoryCompaction = prepared.compaction;
|
|
724
728
|
await this.notifyInternalMemoryCompaction(prepared.compaction);
|
|
725
|
-
await this.recordMemoryCompaction(prepared, runObservers);
|
|
729
|
+
if (!contextReplayed) await this.recordMemoryCompaction(prepared, runObservers);
|
|
726
730
|
yield { type: "memory_compaction", ...prepared.compaction };
|
|
727
731
|
}
|
|
728
732
|
const request = await this.createTurnRequest(prompt, prepared.messages, currentTurns);
|
|
@@ -733,7 +737,8 @@ var AgentRun = class _AgentRun {
|
|
|
733
737
|
request,
|
|
734
738
|
providerRequest
|
|
735
739
|
);
|
|
736
|
-
const
|
|
740
|
+
const modelReplayed = this.replayed({ kind: "model", turn: currentTurns });
|
|
741
|
+
const generationObservers = modelReplayed ? new ActiveGenerationObservers([], "ignore") : await runObservers.startGeneration(generationStartArgs);
|
|
737
742
|
this.activeGeneration = { turn: currentTurns, observers: generationObservers };
|
|
738
743
|
const generationStartedAt = Date.now();
|
|
739
744
|
yield {
|
|
@@ -803,7 +808,7 @@ var AgentRun = class _AgentRun {
|
|
|
803
808
|
throw error;
|
|
804
809
|
}
|
|
805
810
|
const { firstDeltaMs, emittedToolCallIds } = completionState;
|
|
806
|
-
usage = Usage.add(usage, response.usage);
|
|
811
|
+
if (!modelReplayed) usage = Usage.add(usage, response.usage);
|
|
807
812
|
this.updateRunProgress(newMessages);
|
|
808
813
|
await this.runCompletionResponseHook(prompt, response, newMessages);
|
|
809
814
|
await this.runTurnEndHook(currentTurns, response, newMessages);
|
|
@@ -1767,6 +1772,9 @@ var AgentRun = class _AgentRun {
|
|
|
1767
1772
|
}
|
|
1768
1773
|
return context;
|
|
1769
1774
|
}
|
|
1775
|
+
replayed(step) {
|
|
1776
|
+
return this.execution?.replayed?.(step) === true;
|
|
1777
|
+
}
|
|
1770
1778
|
async startRunObservers(runId) {
|
|
1771
1779
|
const observability = this.agent.observability;
|
|
1772
1780
|
return startAgentRunObservers(
|
|
@@ -1784,7 +1792,8 @@ var AgentRun = class _AgentRun {
|
|
|
1784
1792
|
},
|
|
1785
1793
|
{
|
|
1786
1794
|
primaryTrace: observability?.primaryTrace,
|
|
1787
|
-
errorPolicy: observability?.errorPolicy ?? "ignore"
|
|
1795
|
+
errorPolicy: observability?.errorPolicy ?? "ignore",
|
|
1796
|
+
onObserverError: observability?.onObserverError
|
|
1788
1797
|
}
|
|
1789
1798
|
);
|
|
1790
1799
|
}
|
|
@@ -2393,4 +2402,4 @@ function observerRunEnd(outcome) {
|
|
|
2393
2402
|
export {
|
|
2394
2403
|
AgentRun
|
|
2395
2404
|
};
|
|
2396
|
-
//# sourceMappingURL=chunk-
|
|
2405
|
+
//# sourceMappingURL=chunk-ATFSEEFX.js.map
|