@aigne/core 1.72.0-beta.2 → 1.72.0-beta.23
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/CHANGELOG.md +261 -0
- package/lib/cjs/agents/agent.d.ts +42 -11
- package/lib/cjs/agents/agent.js +34 -8
- package/lib/cjs/agents/ai-agent.d.ts +63 -4
- package/lib/cjs/agents/ai-agent.js +154 -20
- package/lib/cjs/agents/chat-model.d.ts +157 -0
- package/lib/cjs/agents/chat-model.js +71 -6
- package/lib/cjs/agents/image-agent.d.ts +17 -1
- package/lib/cjs/agents/image-agent.js +16 -0
- package/lib/cjs/agents/image-model.d.ts +12 -2
- package/lib/cjs/agents/image-model.js +1 -1
- package/lib/cjs/agents/mcp-agent.d.ts +17 -0
- package/lib/cjs/agents/mcp-agent.js +18 -0
- package/lib/cjs/agents/model.d.ts +3 -3
- package/lib/cjs/agents/model.js +2 -2
- package/lib/cjs/agents/team-agent.d.ts +55 -0
- package/lib/cjs/agents/team-agent.js +31 -0
- package/lib/cjs/agents/transform-agent.d.ts +12 -0
- package/lib/cjs/agents/transform-agent.js +13 -0
- package/lib/cjs/agents/video-model.d.ts +10 -0
- package/lib/cjs/agents/video-model.js +1 -1
- package/lib/cjs/aigne/context.js +1 -3
- package/lib/cjs/aigne/usage.d.ts +4 -0
- package/lib/cjs/aigne/usage.js +6 -0
- package/lib/cjs/index.d.ts +1 -0
- package/lib/cjs/index.js +1 -0
- package/lib/cjs/loader/agent-yaml.d.ts +5 -63
- package/lib/cjs/loader/agent-yaml.js +4 -129
- package/lib/cjs/loader/agents.d.ts +4 -0
- package/lib/cjs/loader/agents.js +17 -0
- package/lib/cjs/loader/index.d.ts +16 -12
- package/lib/cjs/loader/index.js +20 -81
- package/lib/cjs/loader/schema.d.ts +21 -6
- package/lib/cjs/loader/schema.js +60 -1
- package/lib/cjs/memory/recorder.d.ts +4 -4
- package/lib/cjs/memory/retriever.d.ts +4 -4
- package/lib/cjs/prompt/agent-session.d.ts +163 -0
- package/lib/cjs/prompt/agent-session.js +1008 -0
- package/lib/cjs/prompt/compact/compactor.d.ts +7 -0
- package/lib/cjs/prompt/compact/compactor.js +52 -0
- package/lib/cjs/prompt/compact/session-memory-extractor.d.ts +7 -0
- package/lib/cjs/prompt/compact/session-memory-extractor.js +143 -0
- package/lib/cjs/prompt/compact/types.d.ts +336 -0
- package/lib/cjs/prompt/compact/types.js +53 -0
- package/lib/cjs/prompt/compact/user-memory-extractor.d.ts +7 -0
- package/lib/cjs/prompt/compact/user-memory-extractor.js +124 -0
- package/lib/cjs/prompt/context/afs/history.d.ts +5 -1
- package/lib/cjs/prompt/context/afs/history.js +3 -2
- package/lib/cjs/prompt/context/afs/index.js +8 -1
- package/lib/cjs/prompt/prompt-builder.d.ts +11 -9
- package/lib/cjs/prompt/prompt-builder.js +79 -120
- package/lib/cjs/prompt/skills/afs/agent-skill/agent-skill.d.ts +19 -0
- package/lib/cjs/prompt/skills/afs/agent-skill/agent-skill.js +69 -0
- package/lib/cjs/prompt/skills/afs/agent-skill/skill-loader.d.ts +12 -0
- package/lib/cjs/prompt/skills/afs/agent-skill/skill-loader.js +50 -0
- package/lib/cjs/prompt/skills/afs/delete.js +15 -3
- package/lib/cjs/prompt/skills/afs/edit.d.ts +6 -9
- package/lib/cjs/prompt/skills/afs/edit.js +85 -59
- package/lib/cjs/prompt/skills/afs/exec.js +17 -6
- package/lib/cjs/prompt/skills/afs/index.js +4 -1
- package/lib/cjs/prompt/skills/afs/list.d.ts +2 -0
- package/lib/cjs/prompt/skills/afs/list.js +35 -11
- package/lib/cjs/prompt/skills/afs/read.d.ts +9 -3
- package/lib/cjs/prompt/skills/afs/read.js +67 -15
- package/lib/cjs/prompt/skills/afs/rename.js +18 -4
- package/lib/cjs/prompt/skills/afs/search.js +21 -5
- package/lib/cjs/prompt/skills/afs/write.js +20 -6
- package/lib/cjs/prompt/template.d.ts +84 -9
- package/lib/cjs/prompt/template.js +46 -17
- package/lib/cjs/utils/mcp-utils.js +1 -1
- package/lib/cjs/utils/token-estimator.js +1 -1
- package/lib/dts/agents/agent.d.ts +42 -11
- package/lib/dts/agents/ai-agent.d.ts +63 -4
- package/lib/dts/agents/chat-model.d.ts +157 -0
- package/lib/dts/agents/image-agent.d.ts +17 -1
- package/lib/dts/agents/image-model.d.ts +12 -2
- package/lib/dts/agents/mcp-agent.d.ts +17 -0
- package/lib/dts/agents/model.d.ts +3 -3
- package/lib/dts/agents/team-agent.d.ts +55 -0
- package/lib/dts/agents/transform-agent.d.ts +12 -0
- package/lib/dts/agents/video-model.d.ts +10 -0
- package/lib/dts/aigne/context.d.ts +2 -2
- package/lib/dts/aigne/usage.d.ts +4 -0
- package/lib/dts/index.d.ts +1 -0
- package/lib/dts/loader/agent-yaml.d.ts +5 -63
- package/lib/dts/loader/agents.d.ts +4 -0
- package/lib/dts/loader/index.d.ts +16 -12
- package/lib/dts/loader/schema.d.ts +21 -6
- package/lib/dts/memory/recorder.d.ts +4 -4
- package/lib/dts/memory/retriever.d.ts +4 -4
- package/lib/dts/prompt/agent-session.d.ts +163 -0
- package/lib/dts/prompt/compact/compactor.d.ts +7 -0
- package/lib/dts/prompt/compact/session-memory-extractor.d.ts +7 -0
- package/lib/dts/prompt/compact/types.d.ts +336 -0
- package/lib/dts/prompt/compact/user-memory-extractor.d.ts +7 -0
- package/lib/dts/prompt/context/afs/history.d.ts +5 -1
- package/lib/dts/prompt/prompt-builder.d.ts +11 -9
- package/lib/dts/prompt/skills/afs/agent-skill/agent-skill.d.ts +19 -0
- package/lib/dts/prompt/skills/afs/agent-skill/skill-loader.d.ts +12 -0
- package/lib/dts/prompt/skills/afs/edit.d.ts +6 -9
- package/lib/dts/prompt/skills/afs/list.d.ts +2 -0
- package/lib/dts/prompt/skills/afs/read.d.ts +9 -3
- package/lib/dts/prompt/template.d.ts +84 -9
- package/lib/esm/agents/agent.d.ts +42 -11
- package/lib/esm/agents/agent.js +34 -8
- package/lib/esm/agents/ai-agent.d.ts +63 -4
- package/lib/esm/agents/ai-agent.js +154 -20
- package/lib/esm/agents/chat-model.d.ts +157 -0
- package/lib/esm/agents/chat-model.js +70 -5
- package/lib/esm/agents/image-agent.d.ts +17 -1
- package/lib/esm/agents/image-agent.js +16 -0
- package/lib/esm/agents/image-model.d.ts +12 -2
- package/lib/esm/agents/image-model.js +1 -1
- package/lib/esm/agents/mcp-agent.d.ts +17 -0
- package/lib/esm/agents/mcp-agent.js +18 -0
- package/lib/esm/agents/model.d.ts +3 -3
- package/lib/esm/agents/model.js +2 -2
- package/lib/esm/agents/team-agent.d.ts +55 -0
- package/lib/esm/agents/team-agent.js +31 -0
- package/lib/esm/agents/transform-agent.d.ts +12 -0
- package/lib/esm/agents/transform-agent.js +13 -0
- package/lib/esm/agents/video-model.d.ts +10 -0
- package/lib/esm/agents/video-model.js +1 -1
- package/lib/esm/aigne/context.d.ts +2 -2
- package/lib/esm/aigne/context.js +2 -4
- package/lib/esm/aigne/usage.d.ts +4 -0
- package/lib/esm/aigne/usage.js +6 -0
- package/lib/esm/index.d.ts +1 -0
- package/lib/esm/index.js +1 -0
- package/lib/esm/loader/agent-yaml.d.ts +5 -63
- package/lib/esm/loader/agent-yaml.js +4 -128
- package/lib/esm/loader/agents.d.ts +4 -0
- package/lib/esm/loader/agents.js +14 -0
- package/lib/esm/loader/index.d.ts +16 -12
- package/lib/esm/loader/index.js +21 -81
- package/lib/esm/loader/schema.d.ts +21 -6
- package/lib/esm/loader/schema.js +57 -0
- package/lib/esm/memory/recorder.d.ts +4 -4
- package/lib/esm/memory/retriever.d.ts +4 -4
- package/lib/esm/prompt/agent-session.d.ts +163 -0
- package/lib/esm/prompt/agent-session.js +968 -0
- package/lib/esm/prompt/compact/compactor.d.ts +7 -0
- package/lib/esm/prompt/compact/compactor.js +48 -0
- package/lib/esm/prompt/compact/session-memory-extractor.d.ts +7 -0
- package/lib/esm/prompt/compact/session-memory-extractor.js +139 -0
- package/lib/esm/prompt/compact/types.d.ts +336 -0
- package/lib/esm/prompt/compact/types.js +50 -0
- package/lib/esm/prompt/compact/user-memory-extractor.d.ts +7 -0
- package/lib/esm/prompt/compact/user-memory-extractor.js +120 -0
- package/lib/esm/prompt/context/afs/history.d.ts +5 -1
- package/lib/esm/prompt/context/afs/history.js +3 -2
- package/lib/esm/prompt/context/afs/index.js +8 -1
- package/lib/esm/prompt/prompt-builder.d.ts +11 -9
- package/lib/esm/prompt/prompt-builder.js +80 -121
- package/lib/esm/prompt/skills/afs/agent-skill/agent-skill.d.ts +19 -0
- package/lib/esm/prompt/skills/afs/agent-skill/agent-skill.js +65 -0
- package/lib/esm/prompt/skills/afs/agent-skill/skill-loader.d.ts +12 -0
- package/lib/esm/prompt/skills/afs/agent-skill/skill-loader.js +43 -0
- package/lib/esm/prompt/skills/afs/delete.js +15 -3
- package/lib/esm/prompt/skills/afs/edit.d.ts +6 -9
- package/lib/esm/prompt/skills/afs/edit.js +85 -59
- package/lib/esm/prompt/skills/afs/exec.js +17 -6
- package/lib/esm/prompt/skills/afs/index.js +4 -1
- package/lib/esm/prompt/skills/afs/list.d.ts +2 -0
- package/lib/esm/prompt/skills/afs/list.js +35 -11
- package/lib/esm/prompt/skills/afs/read.d.ts +9 -3
- package/lib/esm/prompt/skills/afs/read.js +67 -15
- package/lib/esm/prompt/skills/afs/rename.js +18 -4
- package/lib/esm/prompt/skills/afs/search.js +21 -5
- package/lib/esm/prompt/skills/afs/write.js +20 -6
- package/lib/esm/prompt/template.d.ts +84 -9
- package/lib/esm/prompt/template.js +46 -17
- package/lib/esm/utils/mcp-utils.js +1 -1
- package/lib/esm/utils/token-estimator.js +1 -1
- package/package.json +7 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,266 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.72.0-beta.23](https://github.com/AIGNE-io/aigne-framework/compare/core-v1.72.0-beta.22...core-v1.72.0-beta.23) (2026-01-15)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* **core:** pin jaison dependency to exact version 2.0.2 ([#916](https://github.com/AIGNE-io/aigne-framework/issues/916)) ([e4ad28b](https://github.com/AIGNE-io/aigne-framework/commit/e4ad28b7fcac977d9d2087e0dceacd320818f0f5))
|
|
9
|
+
|
|
10
|
+
## [1.72.0-beta.22](https://github.com/AIGNE-io/aigne-framework/compare/core-v1.72.0-beta.21...core-v1.72.0-beta.22) (2026-01-15)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Dependencies
|
|
14
|
+
|
|
15
|
+
* The following workspace dependencies were updated
|
|
16
|
+
* dependencies
|
|
17
|
+
* @aigne/observability-api bumped to 0.11.14-beta.6
|
|
18
|
+
|
|
19
|
+
## [1.72.0-beta.21](https://github.com/AIGNE-io/aigne-framework/compare/core-v1.72.0-beta.20...core-v1.72.0-beta.21) (2026-01-15)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Dependencies
|
|
23
|
+
|
|
24
|
+
* The following workspace dependencies were updated
|
|
25
|
+
* dependencies
|
|
26
|
+
* @aigne/observability-api bumped to 0.11.14-beta.5
|
|
27
|
+
|
|
28
|
+
## [1.72.0-beta.20](https://github.com/AIGNE-io/aigne-framework/compare/core-v1.72.0-beta.19...core-v1.72.0-beta.20) (2026-01-15)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
### Bug Fixes
|
|
32
|
+
|
|
33
|
+
* **core:** remove Node.js dependencies from skill loader ([#910](https://github.com/AIGNE-io/aigne-framework/issues/910)) ([e12ae89](https://github.com/AIGNE-io/aigne-framework/commit/e12ae89dad8e3118fd5b9432a619846667f34ab7))
|
|
34
|
+
|
|
35
|
+
## [1.72.0-beta.19](https://github.com/AIGNE-io/aigne-framework/compare/core-v1.72.0-beta.18...core-v1.72.0-beta.19) (2026-01-14)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
### Features
|
|
39
|
+
|
|
40
|
+
* **afs:** add module access control and schema validation support ([#904](https://github.com/AIGNE-io/aigne-framework/issues/904)) ([d0b279a](https://github.com/AIGNE-io/aigne-framework/commit/d0b279aac07ebe2bcc1fd4148498fc3f6bbcd561))
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
### Bug Fixes
|
|
44
|
+
|
|
45
|
+
* improve test coverage tracking and reporting ([#903](https://github.com/AIGNE-io/aigne-framework/issues/903)) ([031144e](https://github.com/AIGNE-io/aigne-framework/commit/031144e74f29e882cffe52ffda8f7a18c76ace7f))
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
### Dependencies
|
|
49
|
+
|
|
50
|
+
* The following workspace dependencies were updated
|
|
51
|
+
* dependencies
|
|
52
|
+
* @aigne/afs bumped to 1.4.0-beta.9
|
|
53
|
+
* @aigne/afs-history bumped to 1.2.0-beta.10
|
|
54
|
+
* @aigne/observability-api bumped to 0.11.14-beta.4
|
|
55
|
+
* @aigne/platform-helpers bumped to 0.6.7-beta.2
|
|
56
|
+
|
|
57
|
+
## [1.72.0-beta.18](https://github.com/AIGNE-io/aigne-framework/compare/core-v1.72.0-beta.17...core-v1.72.0-beta.18) (2026-01-13)
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
### Bug Fixes
|
|
61
|
+
|
|
62
|
+
* bump deps to latest and fix build error ([#897](https://github.com/AIGNE-io/aigne-framework/issues/897)) ([4059e79](https://github.com/AIGNE-io/aigne-framework/commit/4059e790ae63b9e4ebd66487665014b0cd7ce6ec))
|
|
63
|
+
* **core:** make async memory updates non-blocking ([#900](https://github.com/AIGNE-io/aigne-framework/issues/900)) ([314f2c3](https://github.com/AIGNE-io/aigne-framework/commit/314f2c35d8baa88b600cc4de3f5983fef03a804c))
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
### Dependencies
|
|
67
|
+
|
|
68
|
+
* The following workspace dependencies were updated
|
|
69
|
+
* dependencies
|
|
70
|
+
* @aigne/observability-api bumped to 0.11.14-beta.3
|
|
71
|
+
|
|
72
|
+
## [1.72.0-beta.17](https://github.com/AIGNE-io/aigne-framework/compare/core-v1.72.0-beta.16...core-v1.72.0-beta.17) (2026-01-12)
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
### Bug Fixes
|
|
76
|
+
|
|
77
|
+
* **core:** optimize session compaction to reduce compression frequency ([#894](https://github.com/AIGNE-io/aigne-framework/issues/894)) ([bed53dc](https://github.com/AIGNE-io/aigne-framework/commit/bed53dc0311c69acd2c257fe93416d10ac1120e1))
|
|
78
|
+
|
|
79
|
+
## [1.72.0-beta.16](https://github.com/AIGNE-io/aigne-framework/compare/core-v1.72.0-beta.15...core-v1.72.0-beta.16) (2026-01-12)
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
### Bug Fixes
|
|
83
|
+
|
|
84
|
+
* **afs:** show gitignored files with marker instead of filtering ([c2bdea1](https://github.com/AIGNE-io/aigne-framework/commit/c2bdea155f47c9420f2fe810cdfed79ef70ef899))
|
|
85
|
+
* **core:** afs_read skill return pure text result first ([d42e67c](https://github.com/AIGNE-io/aigne-framework/commit/d42e67c33bb211202e9ba579afec2cf4abacbdb5))
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
### Dependencies
|
|
89
|
+
|
|
90
|
+
* The following workspace dependencies were updated
|
|
91
|
+
* dependencies
|
|
92
|
+
* @aigne/afs bumped to 1.4.0-beta.8
|
|
93
|
+
* @aigne/afs-history bumped to 1.2.0-beta.9
|
|
94
|
+
|
|
95
|
+
## [1.72.0-beta.15](https://github.com/AIGNE-io/aigne-framework/compare/core-v1.72.0-beta.14...core-v1.72.0-beta.15) (2026-01-10)
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
### Bug Fixes
|
|
99
|
+
|
|
100
|
+
* **core:** simplify token-estimator logic for remaining characters ([45d43cc](https://github.com/AIGNE-io/aigne-framework/commit/45d43ccd3afd636cfb459eea2e6551e8f9c53765))
|
|
101
|
+
|
|
102
|
+
## [1.72.0-beta.14](https://github.com/AIGNE-io/aigne-framework/compare/core-v1.72.0-beta.13...core-v1.72.0-beta.14) (2026-01-09)
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
### Bug Fixes
|
|
106
|
+
|
|
107
|
+
* **core:** correct session schema for AIAgent ([30b1deb](https://github.com/AIGNE-io/aigne-framework/commit/30b1deb54ac20287580e0a85ef150b95010f8201))
|
|
108
|
+
* **core:** default enable auto breakpoints for chat model ([d4a6b83](https://github.com/AIGNE-io/aigne-framework/commit/d4a6b8323d6c83be45669885b32febb545bdf797))
|
|
109
|
+
|
|
110
|
+
## [1.72.0-beta.13](https://github.com/AIGNE-io/aigne-framework/compare/core-v1.72.0-beta.12...core-v1.72.0-beta.13) (2026-01-08)
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
### Features
|
|
114
|
+
|
|
115
|
+
* **afs,bash:** add physical path mapping for AFS modules in bash execution ([#881](https://github.com/AIGNE-io/aigne-framework/issues/881)) ([50dbda2](https://github.com/AIGNE-io/aigne-framework/commit/50dbda224bd666d951494d2449779830d8db57fc))
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
### Bug Fixes
|
|
119
|
+
|
|
120
|
+
* bump version ([696560f](https://github.com/AIGNE-io/aigne-framework/commit/696560fa2673eddcb4d00ac0523fbbbde7273cb3))
|
|
121
|
+
* **core:** disable session manger for compactor and memory extractor ([#882](https://github.com/AIGNE-io/aigne-framework/issues/882)) ([0ef8702](https://github.com/AIGNE-io/aigne-framework/commit/0ef8702b785b78859131ed45b4e71ab4064f3635))
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
### Dependencies
|
|
125
|
+
|
|
126
|
+
* The following workspace dependencies were updated
|
|
127
|
+
* dependencies
|
|
128
|
+
* @aigne/afs bumped to 1.4.0-beta.7
|
|
129
|
+
* @aigne/afs-history bumped to 1.2.0-beta.8
|
|
130
|
+
* @aigne/observability-api bumped to 0.11.14-beta.2
|
|
131
|
+
* @aigne/platform-helpers bumped to 0.6.7-beta.1
|
|
132
|
+
|
|
133
|
+
## [1.72.0-beta.12](https://github.com/AIGNE-io/aigne-framework/compare/core-v1.72.0-beta.11...core-v1.72.0-beta.12) (2026-01-07)
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
### Bug Fixes
|
|
137
|
+
|
|
138
|
+
* **afs:** support `~` in the local path for local-fs & add agent-skill example ([#877](https://github.com/AIGNE-io/aigne-framework/issues/877)) ([c86293f](https://github.com/AIGNE-io/aigne-framework/commit/c86293f3d70447974395d02e238305a42b256b66))
|
|
139
|
+
|
|
140
|
+
## [1.72.0-beta.11](https://github.com/AIGNE-io/aigne-framework/compare/core-v1.72.0-beta.10...core-v1.72.0-beta.11) (2026-01-06)
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
### Bug Fixes
|
|
144
|
+
|
|
145
|
+
* **core:** preserve Agent Skill in session compact and support complex tool result content ([#876](https://github.com/AIGNE-io/aigne-framework/issues/876)) ([edb86ae](https://github.com/AIGNE-io/aigne-framework/commit/edb86ae2b9cfe56a8f08b276f843606e310566cf))
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
### Dependencies
|
|
149
|
+
|
|
150
|
+
* The following workspace dependencies were updated
|
|
151
|
+
* dependencies
|
|
152
|
+
* @aigne/afs bumped to 1.4.0-beta.6
|
|
153
|
+
* @aigne/afs-history bumped to 1.2.0-beta.7
|
|
154
|
+
|
|
155
|
+
## [1.72.0-beta.10](https://github.com/AIGNE-io/aigne-framework/compare/core-v1.72.0-beta.9...core-v1.72.0-beta.10) (2026-01-06)
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
### Features
|
|
159
|
+
|
|
160
|
+
* **core:** add cross session user memory support ([#873](https://github.com/AIGNE-io/aigne-framework/issues/873)) ([f377aa1](https://github.com/AIGNE-io/aigne-framework/commit/f377aa17f2cf8004fd3225ade4a37fd90af1292f))
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
### Bug Fixes
|
|
164
|
+
|
|
165
|
+
* **core:** compact current turn messages ([#871](https://github.com/AIGNE-io/aigne-framework/issues/871)) ([08c19d7](https://github.com/AIGNE-io/aigne-framework/commit/08c19d7651fb0ff0a0f7faa347746cf62b34f1f5))
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
### Dependencies
|
|
169
|
+
|
|
170
|
+
* The following workspace dependencies were updated
|
|
171
|
+
* dependencies
|
|
172
|
+
* @aigne/afs-history bumped to 1.2.0-beta.6
|
|
173
|
+
|
|
174
|
+
## [1.72.0-beta.9](https://github.com/AIGNE-io/aigne-framework/compare/core-v1.72.0-beta.8...core-v1.72.0-beta.9) (2026-01-02)
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
### Features
|
|
178
|
+
|
|
179
|
+
* **cli:** add run-skill command ([#868](https://github.com/AIGNE-io/aigne-framework/issues/868)) ([f62ffe2](https://github.com/AIGNE-io/aigne-framework/commit/f62ffe21acc49ec1a68349fbb35a13d0fadd239a))
|
|
180
|
+
|
|
181
|
+
## [1.72.0-beta.8](https://github.com/AIGNE-io/aigne-framework/compare/core-v1.72.0-beta.7...core-v1.72.0-beta.8) (2025-12-31)
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
### Features
|
|
185
|
+
|
|
186
|
+
* add session compact support for AIAgent ([#863](https://github.com/AIGNE-io/aigne-framework/issues/863)) ([9010918](https://github.com/AIGNE-io/aigne-framework/commit/9010918cd3f18b02b5c60ddc9ed5c34b568d0b28))
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
### Bug Fixes
|
|
190
|
+
|
|
191
|
+
* **core:** ensure data consistency in async compact mode and load all history entries ([25c7840](https://github.com/AIGNE-io/aigne-framework/commit/25c78406b48f8789a19d59b6d2c82ff859f0113b))
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
### Dependencies
|
|
195
|
+
|
|
196
|
+
* The following workspace dependencies were updated
|
|
197
|
+
* dependencies
|
|
198
|
+
* @aigne/afs bumped to 1.4.0-beta.5
|
|
199
|
+
* @aigne/afs-history bumped to 1.2.0-beta.5
|
|
200
|
+
|
|
201
|
+
## [1.72.0-beta.7](https://github.com/AIGNE-io/aigne-framework/compare/core-v1.72.0-beta.6...core-v1.72.0-beta.7) (2025-12-26)
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
### Features
|
|
205
|
+
|
|
206
|
+
* **core:** add session history support ([#858](https://github.com/AIGNE-io/aigne-framework/issues/858)) ([28a070e](https://github.com/AIGNE-io/aigne-framework/commit/28a070ed33b821d1fd344b899706d817ca992b9f))
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
### Dependencies
|
|
210
|
+
|
|
211
|
+
* The following workspace dependencies were updated
|
|
212
|
+
* dependencies
|
|
213
|
+
* @aigne/afs bumped to 1.4.0-beta.4
|
|
214
|
+
* @aigne/afs-history bumped to 1.2.0-beta.4
|
|
215
|
+
|
|
216
|
+
## [1.72.0-beta.6](https://github.com/AIGNE-io/aigne-framework/compare/core-v1.72.0-beta.5...core-v1.72.0-beta.6) (2025-12-25)
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
### Bug Fixes
|
|
220
|
+
|
|
221
|
+
* **core:** passthrough model options in chat model ([#856](https://github.com/AIGNE-io/aigne-framework/issues/856)) ([41387bd](https://github.com/AIGNE-io/aigne-framework/commit/41387bde0a615080ea5d665e998afb0b9c32c5fd))
|
|
222
|
+
|
|
223
|
+
## [1.72.0-beta.5](https://github.com/AIGNE-io/aigne-framework/compare/core-v1.72.0-beta.4...core-v1.72.0-beta.5) (2025-12-25)
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
### Bug Fixes
|
|
227
|
+
|
|
228
|
+
* **core:** afs skills improvements ([#849](https://github.com/AIGNE-io/aigne-framework/issues/849)) ([557cc8b](https://github.com/AIGNE-io/aigne-framework/commit/557cc8b4b72f0e91ad654556f47bbe0ad0ececdb))
|
|
229
|
+
|
|
230
|
+
## [1.72.0-beta.4](https://github.com/AIGNE-io/aigne-framework/compare/core-v1.72.0-beta.3...core-v1.72.0-beta.4) (2025-12-24)
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
### Features
|
|
234
|
+
|
|
235
|
+
* add Agent Skill support ([#787](https://github.com/AIGNE-io/aigne-framework/issues/787)) ([f04fbe7](https://github.com/AIGNE-io/aigne-framework/commit/f04fbe76ec24cf3c59c74adf92d87b0c3784a8f7))
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
### Bug Fixes
|
|
239
|
+
|
|
240
|
+
* **cli:** improve terminal outputs ([#847](https://github.com/AIGNE-io/aigne-framework/issues/847)) ([329e91b](https://github.com/AIGNE-io/aigne-framework/commit/329e91bc3323f72fc8a2d278ff5e6bba9adbd6e0))
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
### Dependencies
|
|
244
|
+
|
|
245
|
+
* The following workspace dependencies were updated
|
|
246
|
+
* dependencies
|
|
247
|
+
* @aigne/afs bumped to 1.4.0-beta.3
|
|
248
|
+
* @aigne/afs-history bumped to 1.2.0-beta.3
|
|
249
|
+
|
|
250
|
+
## [1.72.0-beta.3](https://github.com/AIGNE-io/aigne-framework/compare/core-v1.72.0-beta.2...core-v1.72.0-beta.3) (2025-12-19)
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
### Features
|
|
254
|
+
|
|
255
|
+
* add prompt caching for OpenAI/Gemini/Anthropic and cache token display ([#838](https://github.com/AIGNE-io/aigne-framework/issues/838)) ([46c628f](https://github.com/AIGNE-io/aigne-framework/commit/46c628f180572ea1b955d1a9888aad6145204842))
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
### Dependencies
|
|
259
|
+
|
|
260
|
+
* The following workspace dependencies were updated
|
|
261
|
+
* dependencies
|
|
262
|
+
* @aigne/observability-api bumped to 0.11.14-beta.1
|
|
263
|
+
|
|
3
264
|
## [1.72.0-beta.2](https://github.com/AIGNE-io/aigne-framework/compare/core-v1.72.0-beta.1...core-v1.72.0-beta.2) (2025-12-19)
|
|
4
265
|
|
|
5
266
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AFS, type AFSExecOptions, type AFSExecResult, type AFSListOptions, type AFSListResult, type AFSModule, type AFSOptions, type AFSReadResult, type AFSSearchOptions } from "@aigne/afs";
|
|
2
2
|
import { nodejs } from "@aigne/platform-helpers/nodejs/index.js";
|
|
3
3
|
import type * as prompts from "@inquirer/prompts";
|
|
4
|
-
import { type ZodObject, type ZodType } from "zod";
|
|
4
|
+
import { type ZodObject, type ZodType, z } from "zod";
|
|
5
5
|
import type { AgentEvent, Context, UserContext } from "../aigne/context.js";
|
|
6
6
|
import type { MessagePayload } from "../aigne/message-queue.js";
|
|
7
7
|
import type { ContextUsage } from "../aigne/usage.js";
|
|
@@ -9,7 +9,7 @@ import type { Memory, MemoryAgent } from "../memory/memory.js";
|
|
|
9
9
|
import type { MemoryRecorderInput } from "../memory/recorder.js";
|
|
10
10
|
import type { MemoryRetrieverInput } from "../memory/retriever.js";
|
|
11
11
|
import { type Nullish, type PromiseOrValue, type XOr } from "../utils/type-utils.js";
|
|
12
|
-
import type { ChatModel } from "./chat-model.js";
|
|
12
|
+
import type { ChatModel, ChatModelInputMessage } from "./chat-model.js";
|
|
13
13
|
import type { GuideRailAgent, GuideRailAgentOutput } from "./guide-rail-agent.js";
|
|
14
14
|
import type { ImageModel } from "./image-model.js";
|
|
15
15
|
import { type GetterSchema, type TransferAgentOutput } from "./types.js";
|
|
@@ -118,7 +118,6 @@ export interface AgentOptions<I extends Message = Message, O extends Message = M
|
|
|
118
118
|
* agentSucceed, or agentFailed
|
|
119
119
|
*/
|
|
120
120
|
disableEvents?: boolean;
|
|
121
|
-
historyConfig?: Agent["historyConfig"];
|
|
122
121
|
/**
|
|
123
122
|
* One or more memory agents this agent can use
|
|
124
123
|
*/
|
|
@@ -173,6 +172,10 @@ export interface AgentInvokeOptions<U extends UserContext = UserContext> {
|
|
|
173
172
|
* This property only exists in the CLI context by command `aigne run`
|
|
174
173
|
*/
|
|
175
174
|
prompts?: typeof prompts;
|
|
175
|
+
/**
|
|
176
|
+
* The caller agent that invoked this agent
|
|
177
|
+
*/
|
|
178
|
+
caller?: Agent;
|
|
176
179
|
}
|
|
177
180
|
/**
|
|
178
181
|
* Agent is the base class for all agents.
|
|
@@ -211,15 +214,15 @@ export declare abstract class Agent<I extends Message = any, O extends Message =
|
|
|
211
214
|
parsed: object;
|
|
212
215
|
}): Promise<Agent<I, O>>;
|
|
213
216
|
constructor(options?: AgentOptions<I, O>);
|
|
217
|
+
afs?: AFS;
|
|
218
|
+
tag?: string;
|
|
214
219
|
/**
|
|
215
220
|
* List of memories this agent can use
|
|
216
221
|
*
|
|
217
222
|
* @deprecated use afs instead
|
|
218
223
|
*/
|
|
219
224
|
readonly memories: MemoryAgent[];
|
|
220
|
-
afs?: AFS;
|
|
221
225
|
asyncMemoryRecord?: boolean;
|
|
222
|
-
tag?: string;
|
|
223
226
|
/**
|
|
224
227
|
* Maximum number of memory items to retrieve
|
|
225
228
|
*/
|
|
@@ -349,11 +352,6 @@ export declare abstract class Agent<I extends Message = any, O extends Message =
|
|
|
349
352
|
* agentSucceed, or agentFailed
|
|
350
353
|
*/
|
|
351
354
|
private disableEvents?;
|
|
352
|
-
historyConfig?: {
|
|
353
|
-
disabled?: boolean;
|
|
354
|
-
maxTokens?: number;
|
|
355
|
-
maxItems?: number;
|
|
356
|
-
};
|
|
357
355
|
private subscriptions;
|
|
358
356
|
/**
|
|
359
357
|
* Attach agent to context:
|
|
@@ -455,7 +453,9 @@ export declare abstract class Agent<I extends Message = any, O extends Message =
|
|
|
455
453
|
* @param options Invocation options
|
|
456
454
|
* @returns Final processed output
|
|
457
455
|
*/
|
|
458
|
-
protected processAgentOutput(input: I, output: Exclude<AgentResponse<O>, AgentResponseStream<O>>, options: AgentInvokeOptions
|
|
456
|
+
protected processAgentOutput(input: I, output: Exclude<AgentResponse<O>, AgentResponseStream<O>>, { messages, ...options }: AgentInvokeOptions & {
|
|
457
|
+
messages?: ChatModelInputMessage[];
|
|
458
|
+
}): Promise<O>;
|
|
459
459
|
/**
|
|
460
460
|
* Process errors that occur during agent execution
|
|
461
461
|
*
|
|
@@ -517,6 +517,7 @@ export declare abstract class Agent<I extends Message = any, O extends Message =
|
|
|
517
517
|
*/
|
|
518
518
|
protected postprocess(input: I, output: O, options: AgentInvokeOptions): Promise<void>;
|
|
519
519
|
protected publishToTopics(output: Message, options: AgentInvokeOptions): Promise<void>;
|
|
520
|
+
formatOutput(output: O): PromiseOrValue<string>;
|
|
520
521
|
/**
|
|
521
522
|
* Core processing method of the agent, must be implemented in subclasses
|
|
522
523
|
*
|
|
@@ -783,12 +784,31 @@ export interface AgentResponseProgress {
|
|
|
783
784
|
} | {
|
|
784
785
|
event: "agentFailed";
|
|
785
786
|
error: Error;
|
|
787
|
+
} | {
|
|
788
|
+
event: "message";
|
|
789
|
+
message: ChatModelInputMessage;
|
|
786
790
|
}) & Omit<AgentEvent, "agent"> & {
|
|
787
791
|
agent: {
|
|
788
792
|
name: string;
|
|
789
793
|
};
|
|
790
794
|
};
|
|
791
795
|
}
|
|
796
|
+
export type AgentResponseProgressMessageItem = {
|
|
797
|
+
type: "text";
|
|
798
|
+
content: string;
|
|
799
|
+
} | {
|
|
800
|
+
type: "thinking";
|
|
801
|
+
thoughts: string;
|
|
802
|
+
} | {
|
|
803
|
+
type: "tool_use";
|
|
804
|
+
toolUseId: string;
|
|
805
|
+
name: string;
|
|
806
|
+
input: unknown;
|
|
807
|
+
} | {
|
|
808
|
+
type: "tool_result";
|
|
809
|
+
toolUseId: string;
|
|
810
|
+
content: unknown;
|
|
811
|
+
};
|
|
792
812
|
export declare function isAgentResponseProgress<T>(chunk: AgentResponseChunk<T>): chunk is AgentResponseProgress;
|
|
793
813
|
/**
|
|
794
814
|
* Creates a text delta for streaming responses
|
|
@@ -870,6 +890,17 @@ export interface FunctionAgentOptions<I extends Message = Message, O extends Mes
|
|
|
870
890
|
*/
|
|
871
891
|
export declare class FunctionAgent<I extends Message = Message, O extends Message = Message> extends Agent<I, O> {
|
|
872
892
|
tag: string;
|
|
893
|
+
static schema(): ZodObject<{
|
|
894
|
+
process: ZodType<FunctionAgentFn>;
|
|
895
|
+
}, "strip", z.ZodTypeAny, {
|
|
896
|
+
process: FunctionAgentFn<any, any, FunctionAgent<any, any>>;
|
|
897
|
+
}, {
|
|
898
|
+
process: FunctionAgentFn<any, any, FunctionAgent<any, any>>;
|
|
899
|
+
}>;
|
|
900
|
+
static load<I extends Message = any, O extends Message = any>(options: {
|
|
901
|
+
filepath: string;
|
|
902
|
+
parsed: object;
|
|
903
|
+
}): Promise<Agent<I, O>>;
|
|
873
904
|
/**
|
|
874
905
|
* Create a function agent from a function or options
|
|
875
906
|
*
|
package/lib/cjs/agents/agent.js
CHANGED
|
@@ -51,8 +51,10 @@ const index_js_1 = require("@aigne/platform-helpers/nodejs/index.js");
|
|
|
51
51
|
const fast_deep_equal_1 = __importDefault(require("fast-deep-equal"));
|
|
52
52
|
const nunjucks_1 = __importDefault(require("nunjucks"));
|
|
53
53
|
const ufo_1 = require("ufo");
|
|
54
|
+
const yaml_1 = require("yaml");
|
|
54
55
|
const zod_1 = require("zod");
|
|
55
56
|
const zod_to_json_schema_1 = require("zod-to-json-schema");
|
|
57
|
+
const function_agent_js_1 = require("../loader/function-agent.js");
|
|
56
58
|
const agent_utils_js_1 = require("../utils/agent-utils.js");
|
|
57
59
|
const json_schema_js_1 = require("../utils/json-schema.js");
|
|
58
60
|
const logger_js_1 = require("../utils/logger.js");
|
|
@@ -151,7 +153,6 @@ class Agent {
|
|
|
151
153
|
if (options.skills?.length)
|
|
152
154
|
this.skills.push(...options.skills.map(functionToAgent));
|
|
153
155
|
this.disableEvents = options.disableEvents;
|
|
154
|
-
this.historyConfig = options.historyConfig;
|
|
155
156
|
if (Array.isArray(options.memory)) {
|
|
156
157
|
this.memories.push(...options.memory);
|
|
157
158
|
}
|
|
@@ -178,15 +179,15 @@ class Agent {
|
|
|
178
179
|
: options.retryOnError;
|
|
179
180
|
this.guideRails = options.guideRails;
|
|
180
181
|
}
|
|
182
|
+
afs;
|
|
183
|
+
tag;
|
|
181
184
|
/**
|
|
182
185
|
* List of memories this agent can use
|
|
183
186
|
*
|
|
184
187
|
* @deprecated use afs instead
|
|
185
188
|
*/
|
|
186
189
|
memories = [];
|
|
187
|
-
afs;
|
|
188
190
|
asyncMemoryRecord;
|
|
189
|
-
tag;
|
|
190
191
|
/**
|
|
191
192
|
* Maximum number of memory items to retrieve
|
|
192
193
|
*/
|
|
@@ -331,7 +332,6 @@ class Agent {
|
|
|
331
332
|
* agentSucceed, or agentFailed
|
|
332
333
|
*/
|
|
333
334
|
disableEvents;
|
|
334
|
-
historyConfig;
|
|
335
335
|
subscriptions = [];
|
|
336
336
|
/**
|
|
337
337
|
* Attach agent to context:
|
|
@@ -462,11 +462,15 @@ class Agent {
|
|
|
462
462
|
: (0, stream_utils_js_1.isAsyncGenerator)(response)
|
|
463
463
|
? (0, stream_utils_js_1.asyncGeneratorToReadableStream)(response)
|
|
464
464
|
: (0, stream_utils_js_1.objectToAgentResponseStream)(response);
|
|
465
|
+
const messages = [];
|
|
465
466
|
for await (const chunk of stream) {
|
|
466
467
|
(0, stream_utils_js_1.mergeAgentResponseChunk)(output, chunk);
|
|
467
468
|
yield chunk;
|
|
469
|
+
if (isAgentResponseProgress(chunk) && chunk.progress.event === "message") {
|
|
470
|
+
messages.push(chunk.progress.message);
|
|
471
|
+
}
|
|
468
472
|
}
|
|
469
|
-
let result = await this.processAgentOutput(input, output, options);
|
|
473
|
+
let result = await this.processAgentOutput(input, output, { ...options, messages });
|
|
470
474
|
if (attempt > 0) {
|
|
471
475
|
result = { ...result, $meta: { ...result.$meta, retries: attempt } };
|
|
472
476
|
}
|
|
@@ -551,6 +555,7 @@ class Agent {
|
|
|
551
555
|
...options,
|
|
552
556
|
model: this.model || options.model,
|
|
553
557
|
imageModel: this.imageModel || options.imageModel,
|
|
558
|
+
caller: this,
|
|
554
559
|
});
|
|
555
560
|
});
|
|
556
561
|
/**
|
|
@@ -563,7 +568,7 @@ class Agent {
|
|
|
563
568
|
* @param options Invocation options
|
|
564
569
|
* @returns Final processed output
|
|
565
570
|
*/
|
|
566
|
-
async processAgentOutput(input, output, options) {
|
|
571
|
+
async processAgentOutput(input, output, { messages, ...options }) {
|
|
567
572
|
const { context } = options;
|
|
568
573
|
if (!(0, type_utils_js_1.isRecord)(output)) {
|
|
569
574
|
throw new Error(`expect to return a record type such as {result: ...}, but got (${typeof output}): ${output}`);
|
|
@@ -575,8 +580,14 @@ class Agent {
|
|
|
575
580
|
const o = await this.callHooks(["onSuccess", "onEnd"], { input, output: finalOutput }, options);
|
|
576
581
|
if (o?.output)
|
|
577
582
|
finalOutput = o.output;
|
|
578
|
-
|
|
579
|
-
this.
|
|
583
|
+
this.afs?.emit("agentSucceed", {
|
|
584
|
+
agentId: this.name,
|
|
585
|
+
userId: context.userContext.userId,
|
|
586
|
+
sessionId: context.userContext.sessionId,
|
|
587
|
+
input,
|
|
588
|
+
output: finalOutput,
|
|
589
|
+
messages,
|
|
590
|
+
});
|
|
580
591
|
if (!this.disableEvents)
|
|
581
592
|
context.emit("agentSucceed", { agent: this, output: finalOutput });
|
|
582
593
|
return finalOutput;
|
|
@@ -706,6 +717,9 @@ class Agent {
|
|
|
706
717
|
});
|
|
707
718
|
}
|
|
708
719
|
}
|
|
720
|
+
formatOutput(output) {
|
|
721
|
+
return (0, yaml_1.stringify)(output);
|
|
722
|
+
}
|
|
709
723
|
/**
|
|
710
724
|
* Shut down the agent and clean up resources
|
|
711
725
|
*
|
|
@@ -873,6 +887,18 @@ function checkAgentInputOutputSchema(schema) {
|
|
|
873
887
|
*/
|
|
874
888
|
class FunctionAgent extends Agent {
|
|
875
889
|
tag = "FunctionAgent";
|
|
890
|
+
static schema() {
|
|
891
|
+
return zod_1.z.object({
|
|
892
|
+
process: zod_1.z.preprocess((v) => (typeof v === "string" ? (0, function_agent_js_1.codeToFunctionAgentFn)(v) : v), zod_1.z.custom()),
|
|
893
|
+
});
|
|
894
|
+
}
|
|
895
|
+
static async load(options) {
|
|
896
|
+
const valid = await FunctionAgent.schema().parseAsync(options.parsed);
|
|
897
|
+
return new FunctionAgent({
|
|
898
|
+
...options.parsed,
|
|
899
|
+
process: valid.process,
|
|
900
|
+
});
|
|
901
|
+
}
|
|
876
902
|
/**
|
|
877
903
|
* Create a function agent from a function or options
|
|
878
904
|
*
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { type ZodObject, type ZodType, z } from "zod";
|
|
2
|
+
import { type NestAgentSchema } from "../loader/agent-yaml.js";
|
|
3
|
+
import type { AgentLoadOptions } from "../loader/index.js";
|
|
4
|
+
import { type Instructions } from "../loader/schema.js";
|
|
5
|
+
import type { CompactConfig, SessionMemoryConfig, UserMemoryConfig } from "../prompt/agent-session.js";
|
|
2
6
|
import { PromptBuilder } from "../prompt/prompt-builder.js";
|
|
3
7
|
import { Agent, type AgentInvokeOptions, type AgentOptions, type AgentProcessAsyncGenerator, type AgentProcessResult, type Message } from "./agent.js";
|
|
4
8
|
import type { ChatModel, ChatModelInput } from "./chat-model.js";
|
|
@@ -23,8 +27,6 @@ export interface AIAgentOptions<I extends Message = Message, O extends Message =
|
|
|
23
27
|
* more complex prompt templates
|
|
24
28
|
*/
|
|
25
29
|
instructions?: string | PromptBuilder;
|
|
26
|
-
autoReorderSystemMessages?: boolean;
|
|
27
|
-
autoMergeSystemMessages?: boolean;
|
|
28
30
|
/**
|
|
29
31
|
* Pick a message from input to use as the user's message
|
|
30
32
|
*/
|
|
@@ -124,6 +126,53 @@ export interface AIAgentOptions<I extends Message = Message, O extends Message =
|
|
|
124
126
|
*/
|
|
125
127
|
memoryPromptTemplate?: string;
|
|
126
128
|
useMemoriesFromContext?: boolean;
|
|
129
|
+
/**
|
|
130
|
+
* Agent session configuration
|
|
131
|
+
*
|
|
132
|
+
* Controls history recording, memory extraction, and conversation compaction.
|
|
133
|
+
* By default, mode is "auto" (enabled). Set `{ mode: "disabled" }` to disable
|
|
134
|
+
* for internal utility agents (extractors, compactors, etc.).
|
|
135
|
+
*
|
|
136
|
+
* @example
|
|
137
|
+
* ```typescript
|
|
138
|
+
* // Default behavior - session features enabled
|
|
139
|
+
* new AIAgent({
|
|
140
|
+
* session: {
|
|
141
|
+
* compact: { mode: "auto" },
|
|
142
|
+
* sessionMemory: { mode: "auto" },
|
|
143
|
+
* userMemory: { mode: "auto" }
|
|
144
|
+
* }
|
|
145
|
+
* })
|
|
146
|
+
*
|
|
147
|
+
* // Disable for internal utility agents
|
|
148
|
+
* new AIAgent({
|
|
149
|
+
* session: { mode: "disabled" }
|
|
150
|
+
* })
|
|
151
|
+
* ```
|
|
152
|
+
*/
|
|
153
|
+
session?: Partial<Omit<import("../prompt/agent-session.js").AgentSessionOptions, "sessionId" | "userId" | "agentId" | "afs">>;
|
|
154
|
+
}
|
|
155
|
+
export interface AIAgentLoadSchema {
|
|
156
|
+
instructions?: Instructions;
|
|
157
|
+
inputKey?: string;
|
|
158
|
+
inputFileKey?: string;
|
|
159
|
+
outputKey?: string;
|
|
160
|
+
outputFileKey?: string;
|
|
161
|
+
toolChoice?: AIAgentToolChoice;
|
|
162
|
+
toolCallsConcurrency?: number;
|
|
163
|
+
keepTextInToolUses?: boolean;
|
|
164
|
+
session?: {
|
|
165
|
+
mode?: "auto" | "disabled";
|
|
166
|
+
compact?: Omit<CompactConfig, "compactor"> & {
|
|
167
|
+
compactor?: NestAgentSchema;
|
|
168
|
+
};
|
|
169
|
+
sessionMemory?: Omit<SessionMemoryConfig, "extractor"> & {
|
|
170
|
+
extractor?: NestAgentSchema;
|
|
171
|
+
};
|
|
172
|
+
userMemory?: Omit<UserMemoryConfig, "extractor"> & {
|
|
173
|
+
extractor?: NestAgentSchema;
|
|
174
|
+
};
|
|
175
|
+
};
|
|
127
176
|
}
|
|
128
177
|
/**
|
|
129
178
|
* Tool choice options for AI agents
|
|
@@ -188,6 +237,14 @@ export declare const aiAgentOptionsSchema: ZodObject<{
|
|
|
188
237
|
*/
|
|
189
238
|
export declare class AIAgent<I extends Message = any, O extends Message = any> extends Agent<I, O> {
|
|
190
239
|
tag: string;
|
|
240
|
+
static schema<T>({ filepath }: {
|
|
241
|
+
filepath: string;
|
|
242
|
+
}): ZodType<T>;
|
|
243
|
+
static load<I extends Message = any, O extends Message = any>(options: {
|
|
244
|
+
filepath: string;
|
|
245
|
+
parsed: object;
|
|
246
|
+
options?: AgentLoadOptions;
|
|
247
|
+
}): Promise<Agent<I, O>>;
|
|
191
248
|
/**
|
|
192
249
|
* Create an AIAgent with the specified options
|
|
193
250
|
*
|
|
@@ -218,8 +275,6 @@ export declare class AIAgent<I extends Message = any, O extends Message = any> e
|
|
|
218
275
|
* {@includeCode ../../test/agents/ai-agent.test.ts#example-ai-agent-prompt-builder}
|
|
219
276
|
*/
|
|
220
277
|
instructions: PromptBuilder;
|
|
221
|
-
autoReorderSystemMessages?: boolean;
|
|
222
|
-
autoMergeSystemMessages?: boolean;
|
|
223
278
|
/**
|
|
224
279
|
* Pick a message from input to use as the user's message
|
|
225
280
|
*/
|
|
@@ -315,6 +370,10 @@ export declare class AIAgent<I extends Message = any, O extends Message = any> e
|
|
|
315
370
|
metadataEnd: string;
|
|
316
371
|
parse: (raw: string) => object;
|
|
317
372
|
};
|
|
373
|
+
/**
|
|
374
|
+
* Agent session configuration
|
|
375
|
+
*/
|
|
376
|
+
session?: Partial<Omit<import("../prompt/agent-session.js").AgentSessionOptions, "sessionId" | "userId" | "agentId" | "afs">>;
|
|
318
377
|
get inputSchema(): ZodType<I>;
|
|
319
378
|
/**
|
|
320
379
|
* Process an input message and generate a response
|