@anvia/core 1.7.1 → 1.8.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 +2 -0
- package/dist/agent/agent.js +5 -5
- package/dist/agent/index.js +8 -8
- package/dist/agent/resolve-options.js +2 -2
- package/dist/agent/resolved-agent.js +6 -6
- package/dist/agent/team/agent-team.js +8 -8
- package/dist/agent/team/index.js +8 -8
- package/dist/{chunk-5ZS3DPPC.js → chunk-4EBIM3LP.js} +4 -4
- package/dist/{chunk-VZ5ZZBNX.js → chunk-4IC3CQRL.js} +5 -5
- package/dist/{chunk-SBWSXEIH.js → chunk-7FBSGD6E.js} +1 -1
- package/dist/chunk-7FBSGD6E.js.map +1 -0
- package/dist/{chunk-3BYFZYEV.js → chunk-EWCRSYS6.js} +2 -2
- package/dist/{chunk-NWCJXAE5.js → chunk-JIYOCTRF.js} +4 -4
- package/dist/{chunk-5H5EHU5O.js → chunk-M32FTMYD.js} +2 -2
- package/dist/chunk-M32FTMYD.js.map +1 -0
- package/dist/{chunk-WBXRVW5I.js → chunk-RMOCTCS2.js} +3 -3
- package/dist/{chunk-M7X36BQ7.js → chunk-WSPB4OUU.js} +2 -2
- package/dist/{chunk-KHUWYYOH.js → chunk-ZDS7AHAX.js} +42 -36
- package/dist/chunk-ZDS7AHAX.js.map +1 -0
- package/dist/guardrails/index.js +2 -2
- package/dist/guardrails/runtime.js +2 -2
- package/dist/index.js +20 -20
- package/dist/internal/agent-runtime/agent-run.js +4 -4
- package/dist/internal/agent-runtime/execution.js +1 -1
- package/dist/internal/agent-runtime/run-options.js +1 -1
- package/dist/internal/agent.d.ts +13 -7
- package/dist/internal/agent.js +7 -7
- package/dist/internal/team-runtime/run.js +7 -7
- package/dist/skills/index.js +2 -2
- package/dist/skills/load.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-5H5EHU5O.js.map +0 -1
- package/dist/chunk-KHUWYYOH.js.map +0 -1
- package/dist/chunk-SBWSXEIH.js.map +0 -1
- /package/dist/{chunk-5ZS3DPPC.js.map → chunk-4EBIM3LP.js.map} +0 -0
- /package/dist/{chunk-VZ5ZZBNX.js.map → chunk-4IC3CQRL.js.map} +0 -0
- /package/dist/{chunk-3BYFZYEV.js.map → chunk-EWCRSYS6.js.map} +0 -0
- /package/dist/{chunk-NWCJXAE5.js.map → chunk-JIYOCTRF.js.map} +0 -0
- /package/dist/{chunk-WBXRVW5I.js.map → chunk-RMOCTCS2.js.map} +0 -0
- /package/dist/{chunk-M7X36BQ7.js.map → chunk-WSPB4OUU.js.map} +0 -0
package/README.md
CHANGED
|
@@ -67,6 +67,8 @@ fail provider output validation.
|
|
|
67
67
|
For recoverable execution, register a supported agent with the experimental
|
|
68
68
|
[`@anvia/durable`](../durable/README.md) runtime. Durable tools receive an optional stable
|
|
69
69
|
`ToolCallContext.operationId` for external idempotency. Direct execution does not supply it.
|
|
70
|
+
Durable registrations can opt into persisted streaming with `stream: true`; core execution
|
|
71
|
+
protocol version 2 checkpoints validated streamed completions alongside tool results.
|
|
70
72
|
|
|
71
73
|
## Learn more
|
|
72
74
|
|
package/dist/agent/agent.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Agent
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-EWCRSYS6.js";
|
|
4
|
+
import "../chunk-ZDS7AHAX.js";
|
|
5
5
|
import "../chunk-SXE4J43E.js";
|
|
6
6
|
import "../chunk-C36RVQHF.js";
|
|
7
7
|
import "../chunk-5IURMWFN.js";
|
|
8
8
|
import "../chunk-LAIATEUB.js";
|
|
9
9
|
import "../chunk-MA3TYOKF.js";
|
|
10
10
|
import "../chunk-PFJN5OIQ.js";
|
|
11
|
-
import "../chunk-
|
|
11
|
+
import "../chunk-7FBSGD6E.js";
|
|
12
12
|
import "../chunk-NPJ2T3L5.js";
|
|
13
13
|
import "../chunk-YWRXOPHC.js";
|
|
14
14
|
import "../chunk-5I2NVRHC.js";
|
|
@@ -38,11 +38,11 @@ import "../chunk-OXIK4SIH.js";
|
|
|
38
38
|
import "../chunk-WLUWRBQ4.js";
|
|
39
39
|
import "../chunk-ZPJFXRQZ.js";
|
|
40
40
|
import "../chunk-MEN4AFDZ.js";
|
|
41
|
-
import "../chunk-
|
|
41
|
+
import "../chunk-4IC3CQRL.js";
|
|
42
|
+
import "../chunk-ZXLCTQUX.js";
|
|
42
43
|
import "../chunk-6TAWRKFK.js";
|
|
43
44
|
import "../chunk-6BTJC3ES.js";
|
|
44
45
|
import "../chunk-MT3BLVYN.js";
|
|
45
|
-
import "../chunk-ZXLCTQUX.js";
|
|
46
46
|
import "../chunk-XH2CVR4V.js";
|
|
47
47
|
import "../chunk-MYHGOXHQ.js";
|
|
48
48
|
import "../chunk-5WLIHNNJ.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-RMOCTCS2.js";
|
|
5
5
|
import "../chunk-X6WS3XWL.js";
|
|
6
|
-
import "../chunk-
|
|
6
|
+
import "../chunk-JIYOCTRF.js";
|
|
7
7
|
import "../chunk-PIMD4DYG.js";
|
|
8
8
|
import "../chunk-FSBDE6RF.js";
|
|
9
9
|
import "../chunk-3TAQXJBC.js";
|
|
@@ -12,18 +12,18 @@ import {
|
|
|
12
12
|
AgentTeamInteractionError,
|
|
13
13
|
AgentTeamLimitError
|
|
14
14
|
} from "../chunk-ENZ2XX27.js";
|
|
15
|
-
import "../chunk-
|
|
15
|
+
import "../chunk-WSPB4OUU.js";
|
|
16
16
|
import {
|
|
17
17
|
Agent
|
|
18
|
-
} from "../chunk-
|
|
19
|
-
import "../chunk-
|
|
18
|
+
} from "../chunk-EWCRSYS6.js";
|
|
19
|
+
import "../chunk-ZDS7AHAX.js";
|
|
20
20
|
import "../chunk-SXE4J43E.js";
|
|
21
21
|
import "../chunk-C36RVQHF.js";
|
|
22
22
|
import "../chunk-5IURMWFN.js";
|
|
23
23
|
import "../chunk-LAIATEUB.js";
|
|
24
24
|
import "../chunk-MA3TYOKF.js";
|
|
25
25
|
import "../chunk-PFJN5OIQ.js";
|
|
26
|
-
import "../chunk-
|
|
26
|
+
import "../chunk-7FBSGD6E.js";
|
|
27
27
|
import "../chunk-NPJ2T3L5.js";
|
|
28
28
|
import "../chunk-YWRXOPHC.js";
|
|
29
29
|
import "../chunk-5I2NVRHC.js";
|
|
@@ -53,11 +53,11 @@ import "../chunk-OXIK4SIH.js";
|
|
|
53
53
|
import "../chunk-WLUWRBQ4.js";
|
|
54
54
|
import "../chunk-ZPJFXRQZ.js";
|
|
55
55
|
import "../chunk-MEN4AFDZ.js";
|
|
56
|
-
import "../chunk-
|
|
56
|
+
import "../chunk-4IC3CQRL.js";
|
|
57
|
+
import "../chunk-ZXLCTQUX.js";
|
|
57
58
|
import "../chunk-6TAWRKFK.js";
|
|
58
59
|
import "../chunk-6BTJC3ES.js";
|
|
59
60
|
import "../chunk-MT3BLVYN.js";
|
|
60
|
-
import "../chunk-ZXLCTQUX.js";
|
|
61
61
|
import "../chunk-XH2CVR4V.js";
|
|
62
62
|
import "../chunk-MYHGOXHQ.js";
|
|
63
63
|
import "../chunk-5WLIHNNJ.js";
|
|
@@ -5,11 +5,11 @@ import {
|
|
|
5
5
|
import "../chunk-WLUWRBQ4.js";
|
|
6
6
|
import "../chunk-ZPJFXRQZ.js";
|
|
7
7
|
import "../chunk-MEN4AFDZ.js";
|
|
8
|
-
import "../chunk-
|
|
8
|
+
import "../chunk-4IC3CQRL.js";
|
|
9
|
+
import "../chunk-ZXLCTQUX.js";
|
|
9
10
|
import "../chunk-6TAWRKFK.js";
|
|
10
11
|
import "../chunk-6BTJC3ES.js";
|
|
11
12
|
import "../chunk-MT3BLVYN.js";
|
|
12
|
-
import "../chunk-ZXLCTQUX.js";
|
|
13
13
|
import "../chunk-XH2CVR4V.js";
|
|
14
14
|
import "../chunk-MYHGOXHQ.js";
|
|
15
15
|
import "../chunk-5WLIHNNJ.js";
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createResolvedAgent,
|
|
3
3
|
getResolvedAgentOptions
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-WSPB4OUU.js";
|
|
5
|
+
import "../chunk-EWCRSYS6.js";
|
|
6
|
+
import "../chunk-ZDS7AHAX.js";
|
|
7
7
|
import "../chunk-SXE4J43E.js";
|
|
8
8
|
import "../chunk-C36RVQHF.js";
|
|
9
9
|
import "../chunk-5IURMWFN.js";
|
|
10
10
|
import "../chunk-LAIATEUB.js";
|
|
11
11
|
import "../chunk-MA3TYOKF.js";
|
|
12
12
|
import "../chunk-PFJN5OIQ.js";
|
|
13
|
-
import "../chunk-
|
|
13
|
+
import "../chunk-7FBSGD6E.js";
|
|
14
14
|
import "../chunk-NPJ2T3L5.js";
|
|
15
15
|
import "../chunk-YWRXOPHC.js";
|
|
16
16
|
import "../chunk-5I2NVRHC.js";
|
|
@@ -40,11 +40,11 @@ import "../chunk-OXIK4SIH.js";
|
|
|
40
40
|
import "../chunk-WLUWRBQ4.js";
|
|
41
41
|
import "../chunk-ZPJFXRQZ.js";
|
|
42
42
|
import "../chunk-MEN4AFDZ.js";
|
|
43
|
-
import "../chunk-
|
|
43
|
+
import "../chunk-4IC3CQRL.js";
|
|
44
|
+
import "../chunk-ZXLCTQUX.js";
|
|
44
45
|
import "../chunk-6TAWRKFK.js";
|
|
45
46
|
import "../chunk-6BTJC3ES.js";
|
|
46
47
|
import "../chunk-MT3BLVYN.js";
|
|
47
|
-
import "../chunk-ZXLCTQUX.js";
|
|
48
48
|
import "../chunk-XH2CVR4V.js";
|
|
49
49
|
import "../chunk-MYHGOXHQ.js";
|
|
50
50
|
import "../chunk-5WLIHNNJ.js";
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AgentTeam
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-RMOCTCS2.js";
|
|
4
4
|
import "../../chunk-X6WS3XWL.js";
|
|
5
|
-
import "../../chunk-
|
|
5
|
+
import "../../chunk-JIYOCTRF.js";
|
|
6
6
|
import "../../chunk-PIMD4DYG.js";
|
|
7
7
|
import "../../chunk-FSBDE6RF.js";
|
|
8
8
|
import "../../chunk-3TAQXJBC.js";
|
|
9
9
|
import "../../chunk-E5MIZ6Z5.js";
|
|
10
10
|
import "../../chunk-ENZ2XX27.js";
|
|
11
|
-
import "../../chunk-
|
|
12
|
-
import "../../chunk-
|
|
13
|
-
import "../../chunk-
|
|
11
|
+
import "../../chunk-WSPB4OUU.js";
|
|
12
|
+
import "../../chunk-EWCRSYS6.js";
|
|
13
|
+
import "../../chunk-ZDS7AHAX.js";
|
|
14
14
|
import "../../chunk-SXE4J43E.js";
|
|
15
15
|
import "../../chunk-C36RVQHF.js";
|
|
16
16
|
import "../../chunk-5IURMWFN.js";
|
|
17
17
|
import "../../chunk-LAIATEUB.js";
|
|
18
18
|
import "../../chunk-MA3TYOKF.js";
|
|
19
19
|
import "../../chunk-PFJN5OIQ.js";
|
|
20
|
-
import "../../chunk-
|
|
20
|
+
import "../../chunk-7FBSGD6E.js";
|
|
21
21
|
import "../../chunk-NPJ2T3L5.js";
|
|
22
22
|
import "../../chunk-YWRXOPHC.js";
|
|
23
23
|
import "../../chunk-5I2NVRHC.js";
|
|
@@ -47,11 +47,11 @@ import "../../chunk-OXIK4SIH.js";
|
|
|
47
47
|
import "../../chunk-WLUWRBQ4.js";
|
|
48
48
|
import "../../chunk-ZPJFXRQZ.js";
|
|
49
49
|
import "../../chunk-MEN4AFDZ.js";
|
|
50
|
-
import "../../chunk-
|
|
50
|
+
import "../../chunk-4IC3CQRL.js";
|
|
51
|
+
import "../../chunk-ZXLCTQUX.js";
|
|
51
52
|
import "../../chunk-6TAWRKFK.js";
|
|
52
53
|
import "../../chunk-6BTJC3ES.js";
|
|
53
54
|
import "../../chunk-MT3BLVYN.js";
|
|
54
|
-
import "../../chunk-ZXLCTQUX.js";
|
|
55
55
|
import "../../chunk-XH2CVR4V.js";
|
|
56
56
|
import "../../chunk-MYHGOXHQ.js";
|
|
57
57
|
import "../../chunk-5WLIHNNJ.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-RMOCTCS2.js";
|
|
5
5
|
import "../../chunk-X6WS3XWL.js";
|
|
6
|
-
import "../../chunk-
|
|
6
|
+
import "../../chunk-JIYOCTRF.js";
|
|
7
7
|
import "../../chunk-PIMD4DYG.js";
|
|
8
8
|
import "../../chunk-FSBDE6RF.js";
|
|
9
9
|
import "../../chunk-3TAQXJBC.js";
|
|
@@ -12,16 +12,16 @@ 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-WSPB4OUU.js";
|
|
16
|
+
import "../../chunk-EWCRSYS6.js";
|
|
17
|
+
import "../../chunk-ZDS7AHAX.js";
|
|
18
18
|
import "../../chunk-SXE4J43E.js";
|
|
19
19
|
import "../../chunk-C36RVQHF.js";
|
|
20
20
|
import "../../chunk-5IURMWFN.js";
|
|
21
21
|
import "../../chunk-LAIATEUB.js";
|
|
22
22
|
import "../../chunk-MA3TYOKF.js";
|
|
23
23
|
import "../../chunk-PFJN5OIQ.js";
|
|
24
|
-
import "../../chunk-
|
|
24
|
+
import "../../chunk-7FBSGD6E.js";
|
|
25
25
|
import "../../chunk-NPJ2T3L5.js";
|
|
26
26
|
import "../../chunk-YWRXOPHC.js";
|
|
27
27
|
import "../../chunk-5I2NVRHC.js";
|
|
@@ -51,11 +51,11 @@ import "../../chunk-OXIK4SIH.js";
|
|
|
51
51
|
import "../../chunk-WLUWRBQ4.js";
|
|
52
52
|
import "../../chunk-ZPJFXRQZ.js";
|
|
53
53
|
import "../../chunk-MEN4AFDZ.js";
|
|
54
|
-
import "../../chunk-
|
|
54
|
+
import "../../chunk-4IC3CQRL.js";
|
|
55
|
+
import "../../chunk-ZXLCTQUX.js";
|
|
55
56
|
import "../../chunk-6TAWRKFK.js";
|
|
56
57
|
import "../../chunk-6BTJC3ES.js";
|
|
57
58
|
import "../../chunk-MT3BLVYN.js";
|
|
58
|
-
import "../../chunk-ZXLCTQUX.js";
|
|
59
59
|
import "../../chunk-XH2CVR4V.js";
|
|
60
60
|
import "../../chunk-MYHGOXHQ.js";
|
|
61
61
|
import "../../chunk-5WLIHNNJ.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createSkillTools
|
|
3
|
-
} from "./chunk-OBM7JJCK.js";
|
|
4
1
|
import {
|
|
5
2
|
skillInstructions
|
|
6
3
|
} from "./chunk-JBQNCUXA.js";
|
|
4
|
+
import {
|
|
5
|
+
createSkillTools
|
|
6
|
+
} from "./chunk-OBM7JJCK.js";
|
|
7
7
|
|
|
8
8
|
// src/skills/load.ts
|
|
9
9
|
async function loadSkills(loaders) {
|
|
@@ -26,4 +26,4 @@ async function loadSkills(loaders) {
|
|
|
26
26
|
export {
|
|
27
27
|
loadSkills
|
|
28
28
|
};
|
|
29
|
-
//# sourceMappingURL=chunk-
|
|
29
|
+
//# sourceMappingURL=chunk-4EBIM3LP.js.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
rewriteMessageText,
|
|
3
|
+
textFromMessage
|
|
4
|
+
} from "./chunk-ZXLCTQUX.js";
|
|
1
5
|
import {
|
|
2
6
|
allow,
|
|
3
7
|
inputActions,
|
|
4
8
|
outputActions
|
|
5
9
|
} from "./chunk-MT3BLVYN.js";
|
|
6
|
-
import {
|
|
7
|
-
rewriteMessageText,
|
|
8
|
-
textFromMessage
|
|
9
|
-
} from "./chunk-ZXLCTQUX.js";
|
|
10
10
|
|
|
11
11
|
// src/guardrails/runtime.ts
|
|
12
12
|
async function runInputGuardrails(policies, context) {
|
|
@@ -136,4 +136,4 @@ export {
|
|
|
136
136
|
runInputGuardrails,
|
|
137
137
|
runOutputGuardrails
|
|
138
138
|
};
|
|
139
|
-
//# sourceMappingURL=chunk-
|
|
139
|
+
//# sourceMappingURL=chunk-4IC3CQRL.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/internal/agent-runtime/run-options.ts"],"sourcesContent":["import type { Message } from \"../../completion\";\nimport type { AgentHook } from \"../../hooks\";\nimport type { MemoryCompactionInfo } from \"../../memory\";\nimport type { AgentRunExecution } from \"./execution\";\n\nconst internalAgentRunOptions = Symbol(\"internalAgentRunOptions\");\n\nexport type InternalAgentRunOptions = {\n /** Persistence boundaries for model and tool execution. */\n execution?: AgentRunExecution | undefined;\n hook?: AgentHook | undefined;\n onFailure?: ((failure: { error: unknown; messages: readonly Message[] }) => void) | undefined;\n onMemoryCompaction?: ((compaction: MemoryCompactionInfo) => void | Promise<void>) | undefined;\n runId?: string | undefined;\n beforeFinish?: (() => void | Promise<void>) | undefined;\n onSteeringApplied?: ((id: string) => void) | undefined;\n};\n\ntype AgentRunOptionsWithInternal = {\n [internalAgentRunOptions]?: InternalAgentRunOptions;\n};\n\nexport function withInternalAgentRunOptions<T extends object>(\n options: T,\n internal: InternalAgentRunOptions,\n): T {\n return {\n ...options,\n [internalAgentRunOptions]: internal,\n };\n}\n\nexport function getInternalAgentRunOptions(options: object): InternalAgentRunOptions | undefined {\n return (options as AgentRunOptionsWithInternal)[internalAgentRunOptions];\n}\n"],"mappings":";AAKA,IAAM,0BAA0B,uBAAO,yBAAyB;AAiBzD,SAAS,4BACd,SACA,UACG;AACH,SAAO;AAAA,IACL,GAAG;AAAA,IACH,CAAC,uBAAuB,GAAG;AAAA,EAC7B;AACF;AAEO,SAAS,2BAA2B,SAAsD;AAC/F,SAAQ,QAAwC,uBAAuB;AACzE;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AgentRun
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ZDS7AHAX.js";
|
|
4
4
|
import {
|
|
5
5
|
normalizeMemoryScope
|
|
6
6
|
} from "./chunk-LAIATEUB.js";
|
|
@@ -155,4 +155,4 @@ var Agent = class {
|
|
|
155
155
|
export {
|
|
156
156
|
Agent
|
|
157
157
|
};
|
|
158
|
-
//# sourceMappingURL=chunk-
|
|
158
|
+
//# sourceMappingURL=chunk-EWCRSYS6.js.map
|
|
@@ -19,13 +19,13 @@ import {
|
|
|
19
19
|
import {
|
|
20
20
|
createResolvedAgent,
|
|
21
21
|
getResolvedAgentOptions
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-WSPB4OUU.js";
|
|
23
23
|
import {
|
|
24
24
|
AgentRun
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-ZDS7AHAX.js";
|
|
26
26
|
import {
|
|
27
27
|
withInternalAgentRunOptions
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-7FBSGD6E.js";
|
|
29
29
|
import {
|
|
30
30
|
assertAgentInteractionResponse,
|
|
31
31
|
parseAgentInteractionResponse
|
|
@@ -619,4 +619,4 @@ var TeamRun = class {
|
|
|
619
619
|
export {
|
|
620
620
|
TeamRun
|
|
621
621
|
};
|
|
622
|
-
//# sourceMappingURL=chunk-
|
|
622
|
+
//# sourceMappingURL=chunk-JIYOCTRF.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/internal/agent-runtime/execution.ts"],"sourcesContent":["import type { CompletionRequest, CompletionResponse, ToolCallPart } from \"../../completion\";\nimport type { NormalizedToolOutput, ToolCallContext } from \"../../tool\";\nimport type { AgentStreamEvent } from \"../../agent/run-types\";\n\n/** Runtime capability marker: older core versions must fail before accepting durable work. */\nexport const AGENT_RUN_EXECUTION_VERSION = 2;\n\n/** Normalized generation progress; never includes raw provider responses. */\nexport type AgentCompletionStreamEvent = Extract<\n AgentStreamEvent<unknown, unknown>,\n {\n type:\n | \"text_delta\"\n | \"reasoning_delta\"\n | \"tool_call_delta\"\n | \"tool_call\"\n | \"source\"\n | \"provider_tool_call\";\n }\n>;\n\nexport type AgentCompletionStream = AsyncGenerator<AgentCompletionStreamEvent, CompletionResponse>;\n\nexport type AgentToolExecutionResult =\n | { output: NormalizedToolOutput; failed: false }\n | { output: NormalizedToolOutput; failed: true; error: unknown };\n\n/** Internal persistence boundary used by execution runtimes. Callbacks own external effects. */\nexport interface AgentRunExecution {\n completion(\n turn: number,\n request: CompletionRequest,\n execute: () => Promise<CompletionResponse>,\n ): Promise<CompletionResponse>;\n streamCompletion?(\n turn: number,\n request: CompletionRequest,\n execute: () => AgentCompletionStream,\n ): AgentCompletionStream;\n tool(\n call: { turn: number; toolCall: ToolCallPart; args: string },\n execute: (context?: Pick<ToolCallContext, \"operationId\">) => Promise<AgentToolExecutionResult>,\n ): Promise<AgentToolExecutionResult>;\n}\n"],"mappings":";AAKO,IAAM,8BAA8B;","names":[]}
|
|
@@ -3,13 +3,13 @@ import {
|
|
|
3
3
|
} from "./chunk-X6WS3XWL.js";
|
|
4
4
|
import {
|
|
5
5
|
TeamRun
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-JIYOCTRF.js";
|
|
7
7
|
import {
|
|
8
8
|
TeamStream
|
|
9
9
|
} from "./chunk-3TAQXJBC.js";
|
|
10
10
|
import {
|
|
11
11
|
Agent
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-EWCRSYS6.js";
|
|
13
13
|
import {
|
|
14
14
|
assertPositiveSafeInteger
|
|
15
15
|
} from "./chunk-NPJ2T3L5.js";
|
|
@@ -104,4 +104,4 @@ var AgentTeam = class {
|
|
|
104
104
|
export {
|
|
105
105
|
AgentTeam
|
|
106
106
|
};
|
|
107
|
-
//# sourceMappingURL=chunk-
|
|
107
|
+
//# sourceMappingURL=chunk-RMOCTCS2.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Agent
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-EWCRSYS6.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-WSPB4OUU.js.map
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
} from "./chunk-PFJN5OIQ.js";
|
|
25
25
|
import {
|
|
26
26
|
getInternalAgentRunOptions
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-7FBSGD6E.js";
|
|
28
28
|
import {
|
|
29
29
|
assertNonnegativeSafeInteger,
|
|
30
30
|
assertPositiveSafeInteger
|
|
@@ -78,7 +78,7 @@ import {
|
|
|
78
78
|
import {
|
|
79
79
|
runInputGuardrails,
|
|
80
80
|
runOutputGuardrails
|
|
81
|
-
} from "./chunk-
|
|
81
|
+
} from "./chunk-4IC3CQRL.js";
|
|
82
82
|
import {
|
|
83
83
|
appendGuardrailPolicies,
|
|
84
84
|
hasEnforcedOutputGuardrails
|
|
@@ -728,27 +728,50 @@ var AgentRun = class _AgentRun {
|
|
|
728
728
|
providerErrorUsage: Usage.empty()
|
|
729
729
|
};
|
|
730
730
|
let response;
|
|
731
|
+
const completionRunObservers = runObservers;
|
|
732
|
+
const execute = () => {
|
|
733
|
+
return this.runUncachedStreamingCompletion({
|
|
734
|
+
request,
|
|
735
|
+
turn: currentTurns,
|
|
736
|
+
bufferResponseEvents,
|
|
737
|
+
bufferOutputDeltas,
|
|
738
|
+
generationStartedAt,
|
|
739
|
+
generationObservers,
|
|
740
|
+
runObservers: completionRunObservers,
|
|
741
|
+
state: completionState
|
|
742
|
+
});
|
|
743
|
+
};
|
|
731
744
|
try {
|
|
732
745
|
try {
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
})) {
|
|
743
|
-
yield event;
|
|
746
|
+
if (this.execution !== void 0) {
|
|
747
|
+
if (this.execution.streamCompletion === void 0) {
|
|
748
|
+
throw new TypeError(
|
|
749
|
+
"The execution runtime does not support streaming checkpoints."
|
|
750
|
+
);
|
|
751
|
+
}
|
|
752
|
+
response = yield* this.execution.streamCompletion(currentTurns, request, execute);
|
|
753
|
+
} else {
|
|
754
|
+
response = yield* execute();
|
|
744
755
|
}
|
|
745
756
|
} finally {
|
|
746
757
|
usage = Usage.add(usage, completionState.providerErrorUsage);
|
|
747
758
|
}
|
|
748
|
-
|
|
749
|
-
|
|
759
|
+
let endArgs = {
|
|
760
|
+
turn: currentTurns,
|
|
761
|
+
response: completionState.response ?? response
|
|
762
|
+
};
|
|
763
|
+
if (completionState.firstDeltaMs !== void 0)
|
|
764
|
+
endArgs = { ...endArgs, firstDeltaMs: completionState.firstDeltaMs };
|
|
765
|
+
this.activeGeneration = void 0;
|
|
766
|
+
await generationObservers.end(endArgs);
|
|
767
|
+
response = await this.runCompletionResponseMiddlewares(request, response, currentTurns);
|
|
768
|
+
try {
|
|
769
|
+
assertCompletionResponseIntegrity({ response });
|
|
770
|
+
} catch (error) {
|
|
771
|
+
const providerOutputUsage = completionProviderOutputErrorUsage(error);
|
|
772
|
+
if (providerOutputUsage !== void 0) usage = Usage.add(usage, providerOutputUsage);
|
|
773
|
+
throw error;
|
|
750
774
|
}
|
|
751
|
-
response = completionState.response;
|
|
752
775
|
} catch (error) {
|
|
753
776
|
await settleFailureCleanup([
|
|
754
777
|
() => this.closeActiveGeneration(error),
|
|
@@ -757,23 +780,6 @@ var AgentRun = class _AgentRun {
|
|
|
757
780
|
throw error;
|
|
758
781
|
}
|
|
759
782
|
const { firstDeltaMs, emittedToolCallIds } = completionState;
|
|
760
|
-
let generationEndArgs = {
|
|
761
|
-
turn: currentTurns,
|
|
762
|
-
response
|
|
763
|
-
};
|
|
764
|
-
if (firstDeltaMs !== void 0) {
|
|
765
|
-
generationEndArgs = { ...generationEndArgs, firstDeltaMs };
|
|
766
|
-
}
|
|
767
|
-
this.activeGeneration = void 0;
|
|
768
|
-
await generationObservers.end(generationEndArgs);
|
|
769
|
-
response = await this.runCompletionResponseMiddlewares(request, response, currentTurns);
|
|
770
|
-
try {
|
|
771
|
-
assertCompletionResponseIntegrity({ response });
|
|
772
|
-
} catch (error) {
|
|
773
|
-
const providerOutputUsage = completionProviderOutputErrorUsage(error);
|
|
774
|
-
if (providerOutputUsage !== void 0) usage = Usage.add(usage, providerOutputUsage);
|
|
775
|
-
throw error;
|
|
776
|
-
}
|
|
777
783
|
usage = Usage.add(usage, response.usage);
|
|
778
784
|
this.updateRunProgress(newMessages);
|
|
779
785
|
await this.runCompletionResponseHook(prompt, response, newMessages);
|
|
@@ -1036,7 +1042,7 @@ var AgentRun = class _AgentRun {
|
|
|
1036
1042
|
});
|
|
1037
1043
|
return this.runCompletionRequestMiddlewares(request, turn);
|
|
1038
1044
|
}
|
|
1039
|
-
async *
|
|
1045
|
+
async *runUncachedStreamingCompletion(args) {
|
|
1040
1046
|
const model = this.agent.model;
|
|
1041
1047
|
if (!isStreamingCompletionModel(model)) {
|
|
1042
1048
|
throw new TypeError("Streaming completion requires a streaming-capable model.");
|
|
@@ -1113,7 +1119,7 @@ var AgentRun = class _AgentRun {
|
|
|
1113
1119
|
}
|
|
1114
1120
|
args.state.response = Usage.isEmpty(args.state.providerErrorUsage) ? response : { ...response, usage: cumulativeStructuredUsage };
|
|
1115
1121
|
args.state.providerErrorUsage = Usage.empty();
|
|
1116
|
-
return;
|
|
1122
|
+
return args.state.response;
|
|
1117
1123
|
} catch (error) {
|
|
1118
1124
|
if (!recordedErrorUsage) {
|
|
1119
1125
|
const attemptUsage = completionProviderOutputErrorUsage(error);
|
|
@@ -2343,4 +2349,4 @@ function observerRunEnd(outcome) {
|
|
|
2343
2349
|
export {
|
|
2344
2350
|
AgentRun
|
|
2345
2351
|
};
|
|
2346
|
-
//# sourceMappingURL=chunk-
|
|
2352
|
+
//# sourceMappingURL=chunk-ZDS7AHAX.js.map
|