@ai-zen/agents-sdk 1.0.0-alpha.9 → 1.1.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.
Files changed (86) hide show
  1. package/CHANGELOG.md +691 -2
  2. package/README.md +22 -6
  3. package/README.zh.md +23 -7
  4. package/dist/agent-plugins/AutoMigratePlugin.d.ts +35 -9
  5. package/dist/agent-plugins/AutoMigratePlugin.js +26 -10
  6. package/dist/agent-plugins/AutoRefreshToolsPlugin.js +1 -3
  7. package/dist/agent-plugins/ContextGuardPlugin.d.ts +28 -16
  8. package/dist/agent-plugins/ContextGuardPlugin.js +23 -17
  9. package/dist/agent-plugins/UnknownToolHintPlugin.js +4 -4
  10. package/dist/config/ConfigManager.d.ts +57 -8
  11. package/dist/config/ConfigManager.js +167 -26
  12. package/dist/config/constants.d.ts +7 -0
  13. package/dist/config/constants.js +70 -43
  14. package/dist/config/factory-skills.d.ts +33 -0
  15. package/dist/config/factory-skills.js +126 -0
  16. package/dist/config/migrate.d.ts +106 -0
  17. package/dist/config/migrate.js +196 -0
  18. package/dist/config/reasoning-presets.d.ts +37 -0
  19. package/dist/config/reasoning-presets.js +64 -0
  20. package/dist/index.d.ts +13 -7
  21. package/dist/index.js +11 -3
  22. package/dist/runtime/HandoffGuardPlugin.d.ts +35 -0
  23. package/dist/runtime/HandoffGuardPlugin.js +65 -0
  24. package/dist/runtime/HandoffService.d.ts +288 -0
  25. package/dist/runtime/HandoffService.js +538 -0
  26. package/dist/runtime/SdkAgent.d.ts +7 -1
  27. package/dist/runtime/SdkAgent.js +3 -0
  28. package/dist/runtime/createAgent.d.ts +20 -1
  29. package/dist/runtime/createAgent.js +14 -9
  30. package/dist/runtime/createModel.d.ts +8 -4
  31. package/dist/runtime/createModel.js +22 -5
  32. package/dist/scope/PermissionEvaluator.js +1 -1
  33. package/dist/scope/Scope.d.ts +3 -1
  34. package/dist/scope/Scope.js +4 -2
  35. package/dist/scope/plugins/builtin/BatchEditTool.js +24 -14
  36. package/dist/scope/plugins/builtin/CopyTool.js +4 -4
  37. package/dist/scope/plugins/builtin/CwdTool.js +1 -1
  38. package/dist/scope/plugins/builtin/DownloadFileTool.d.ts +1 -0
  39. package/dist/scope/plugins/builtin/DownloadFileTool.js +58 -34
  40. package/dist/scope/plugins/builtin/EditTool.js +25 -25
  41. package/dist/scope/plugins/builtin/ExecTool.js +134 -25
  42. package/dist/scope/plugins/builtin/ExistTool.js +2 -2
  43. package/dist/scope/plugins/builtin/FindTextTool.js +15 -10
  44. package/dist/scope/plugins/builtin/GenerateImageTool.js +91 -25
  45. package/dist/scope/plugins/builtin/GlobTool.js +10 -5
  46. package/dist/scope/plugins/builtin/InspectFileTool.js +7 -7
  47. package/dist/scope/plugins/builtin/LsTool.js +5 -5
  48. package/dist/scope/plugins/builtin/MkdirTool.js +3 -3
  49. package/dist/scope/plugins/builtin/ReadTool.js +8 -8
  50. package/dist/scope/plugins/builtin/RenameTool.js +3 -3
  51. package/dist/scope/plugins/builtin/RmTool.js +3 -3
  52. package/dist/scope/plugins/builtin/SleepTool.js +6 -6
  53. package/dist/scope/plugins/builtin/SpawnTool.js +32 -49
  54. package/dist/scope/plugins/builtin/ViewImageTool.d.ts +6 -4
  55. package/dist/scope/plugins/builtin/ViewImageTool.js +50 -62
  56. package/dist/scope/plugins/builtin/WriteTool.js +3 -3
  57. package/dist/scope/plugins/builtin/searchBase.d.ts +9 -0
  58. package/dist/scope/plugins/builtin/searchBase.js +17 -0
  59. package/dist/scope/plugins/builtin/test-helpers.d.ts +3 -3
  60. package/dist/scope/plugins/builtin/test-helpers.js +3 -3
  61. package/dist/scope/plugins/builtin/textEdit.d.ts +17 -0
  62. package/dist/scope/plugins/builtin/textEdit.js +37 -0
  63. package/dist/scope/plugins/mcp/McpConnectionManager.d.ts +9 -1
  64. package/dist/scope/plugins/mcp/McpConnectionManager.js +95 -16
  65. package/dist/scope/plugins/mcp/McpScopePlugin.d.ts +1 -1
  66. package/dist/scope/plugins/mcp/McpScopePlugin.js +8 -6
  67. package/dist/scope/plugins/mcp/discover.js +1 -1
  68. package/dist/scope/plugins/mcp/mcpTools.d.ts +9 -3
  69. package/dist/scope/plugins/mcp/mcpTools.js +247 -37
  70. package/dist/scope/plugins/skills/SkillsScopePlugin.js +2 -3
  71. package/dist/scope/plugins/skills/discover.js +28 -9
  72. package/dist/scope/plugins/skills/skillTools.js +30 -20
  73. package/dist/scope/plugins/subagents/SubAgentsScopePlugin.js +1 -3
  74. package/dist/scope/plugins/subagents/subAgentTools.js +4 -3
  75. package/dist/scope/plugins/usertools/discover.d.ts +8 -3
  76. package/dist/scope/plugins/usertools/discover.js +139 -12
  77. package/dist/shared/EntityRepository.d.ts +10 -1
  78. package/dist/shared/EntityRepository.js +18 -6
  79. package/dist/shared/content-blocks.d.ts +101 -0
  80. package/dist/shared/content-blocks.js +253 -0
  81. package/dist/shared/errors.d.ts +4 -8
  82. package/dist/shared/errors.js +8 -14
  83. package/dist/types/index.d.ts +170 -8
  84. package/package.json +16 -7
  85. package/dist/runtime/TaskMigrationService.d.ts +0 -128
  86. package/dist/runtime/TaskMigrationService.js +0 -211
package/CHANGELOG.md CHANGED
@@ -1,5 +1,694 @@
1
+ ## [1.1.0] - 2026-11-09
2
+
3
+ > Cancelling a handoff now means "go back to how it was". Before this release `Ctrl+C` only
4
+ > stopped the work: the handoff turn — a multi-KB skill instruction, its tool results and the
5
+ > acknowledgement — stayed in `agent.messages`, so the CLI showed it in the transcript, `↑`
6
+ > history offered it back as a draft, and the next request resent it as conversation history.
7
+ >
8
+ > Worse, on the auto-migration path the interrupt was not honoured at all: `AutoMigratePlugin`
9
+ > drives `migrate()` directly, so a caller-supplied `signal` never reached the service. The
10
+ > aborted `self` round was then read as "the model never wrote the document", burning one retry
11
+ > and one `summary` round — and then migrating anyway.
12
+ >
13
+ > Requires `@ai-zen/agents-core@^4.5.4`. Not a breaking change: the defaults of `handoff()` /
14
+ > `migrate()` are untouched and an external `signal` keeps working.
15
+
16
+ ### ✨ Cancellation belongs to the service
17
+
18
+ - **`HandoffService.abort()` (new public method)** — the service owns the cancel handle of the
19
+ run it is executing and merges it with any caller-supplied `signal` (`AbortSignal.any`), so
20
+ `/handoff`, `/migrate` **and auto-migration** share one switch. On an idle service it is a
21
+ no-op (`null` handle), which is what keeps a stale `abort()` from "succeeding" silently later.
22
+ - **Cancel means roll back** — `agent.messages` is truncated back to the length it had before
23
+ the handoff turn, a document created by this run is deleted, and `HandoffAbortedError` is
24
+ thrown. No retry, no degradation, no migration. The cleanup lives in one place so it also
25
+ covers the state that no per-stage `catch` used to see: document written, not yet validated.
26
+ - **Commit point** — once the document passes validation (`isHandoffFileReady`) the run is
27
+ committed: saving the old conversation, pruning history and persisting the new session no
28
+ longer react to cancellation. Stopping there would leave a third state ("user cancelled, old
29
+ conversation archived, history already pruned"), which is worse than finishing.
30
+ - **A cancelled auto-migration is no longer logged as a failure** — `AutoMigratePlugin`
31
+ swallows `HandoffAbortedError` instead of writing "migration failed" through the logger
32
+ (default `console.error`, i.e. a torn frame in a TUI).
33
+
34
+ ### 🧪 Tests
35
+
36
+ - 635 unit cases in 53 files — 7 new: service-side `abort()`, message rollback, document removal
37
+ after a late cancel, commit-point semantics, idle `abort()` as a no-op, a `summary` request
38
+ interrupted through the service handle, and the silent cancel in the plugin. `tsc --noEmit`
39
+ is clean for both the production and the test config.
40
+
41
+ ## [1.0.0] - 2026-11-03
42
+
43
+ > First stable release. The whole `1.0.0-alpha.x` line — up to and including `alpha.26` — is
44
+ > folded into this version: nothing was dropped, no alpha behaviour was reverted. What changes
45
+ > with the version number is the promise, not the code. The documented surface (`Scope`,
46
+ > `ScopePlugin`, `allInOne()`, the built-in tools, `ConfigManager`, the entity repositories) is
47
+ > now frozen: from here on a breaking change needs a major bump, so a `^1.0.0` range is safe to
48
+ > depend on. Anything still marked as internal in the docs may move without notice.
49
+ >
50
+ > Requires `@ai-zen/agents-core@^4.5.4`.
51
+ >
52
+ > The per-release history of the alpha line is preserved below, unedited, because those entries
53
+ > are the only place where the reasoning behind each fix is written down.
54
+
55
+ ### 📌 What to know before upgrading from the alpha line
56
+
57
+ - **`send()` returns after the hooks, not before them** (`agents-core` 4.5.4) — code that
58
+ inspected `messages` right after `await send()` now sees the post-hook state, which is what
59
+ was actually sent.
60
+ - **`lastUsage` is read-only and derived from `messages`** — assigning to it is a type error
61
+ rather than a silently ignored write. Anything that used to reset it by hand should drop
62
+ that code; replacing `messages` is enough.
63
+ - **Tool results tell the truth** about exit codes, truncation, "started" vs "succeeded", and
64
+ permissions that were declared but not enforced. A tool call that used to report success
65
+ while doing nothing is now a failure — this is the one category that may surface as a new
66
+ error in existing prompts.
67
+ - **Entity ids cannot escape their directory** — `EntityRepository` validates the resolved path
68
+ against the repository root, so `../x` and absolute ids are rejected.
69
+
70
+ ### 🧪 Tests
71
+
72
+ - 628 unit cases in 53 files, plus 36 integration / e2e cases (6 skipped — they need real API
73
+ keys). `tsc --noEmit` is clean for both the production and the test config.
74
+
75
+ ## [1.0.0-alpha.26] - 2026-11-03
76
+
77
+ > A full review of this package (ledger committed as `docs/code-review-ledger.md`)
78
+ > turned up 24 defects that bite in ordinary use. 14 candidate findings were
79
+ > dropped on purpose: the model is not an attacker, the tool layer is not a
80
+ > security boundary, and an error string returned by a tool is a legitimate
81
+ > result. What stayed is everything a normal session trips over: a tool call that
82
+ > freezes the process, a silent file corruption, a silent data loss, a "success"
83
+ > that never happened, permission rules that were declared but not enforced.
84
+ >
85
+ > Two of the fixes live elsewhere: `@ai-zen/agents-core@4.5.4` (`send()` return
86
+ > timing, `lastUsage` as a derived value) and a following `ai-zen/cli` release
87
+ > (guard hand-off and dependency bump).
88
+
89
+ ### 🛡️ Fixed — a tool call that froze the whole process
90
+
91
+ - **`edit` with an empty `oldText`** spun forever in `countOccurrences()`
92
+ (`indexOf("", pos)` returns `pos`, `pos += 0` never advances). It blocked the
93
+ event loop, so `abort()` could not help — one agent froze every session in the
94
+ process. Empty `oldText` is now rejected before anything else; `batch_edit`
95
+ treats it as a failed replacement instead of stalling the batch.
96
+
97
+ ### 🛡️ Fixed — `edit` / `batch_edit` silently rewrote the replacement text
98
+
99
+ - `content.replace(oldText, newText)` treats `$&`, `` $` ``, `$'` and `$$` inside
100
+ `newText` as replacement patterns. Writing `cost: $& ($$)` produced `cost: PRICE
101
+ ($)` — a corrupted file reported as `success`. Both tools now use the callback
102
+ form of the replacer, where the return value is always taken literally. The
103
+ shared logic moved to `builtin/textEdit.ts`.
104
+ - `batch_edit` keeps its cascading semantics (each replacement applies to the
105
+ result of the previous one) but now says so in its description; the "no match"
106
+ reason explains that matching happens against the post-previous-replacements
107
+ content, and `replacedCount` is the actual number of replacements (it used to
108
+ report `1` for `isReplaceAll`).
109
+
110
+ ### 🛡️ Fixed — `download_file` could delete an existing file, and had no limits
111
+
112
+ - On abort it ran `rm(savePath, { force: true })`. With the old
113
+ buffer-then-write design the abort could only happen before the single
114
+ `writeFile`, so the only file that branch could ever delete was one that
115
+ already existed at that path. The branch is gone; an interrupted download now
116
+ reports what happened and never touches the file.
117
+ - The body is written as a stream instead of `arrayBuffer()` (a 200 MB file used
118
+ to cost ~650 MB of heap).
119
+ - **New required `timeout` parameter** (milliseconds, same convention as `exec`):
120
+ `fetch` only bounds the response headers, the body could stream forever.
121
+
122
+ ### 🛡️ Fixed — `exec` lied about exit codes, leaked orphans, and truncated silently
123
+
124
+ - Successful commands reported `exitCode: null`, which reads as "did not finish
125
+ normally". Now `0`.
126
+ - `child_process.exec()` **ignores `detached`** (verified on Node 26), so the
127
+ timeout only killed the shell and grandchildren survived as orphans. `exec` now
128
+ uses `spawn(shell, detached)` with its own stream collection and kills the whole
129
+ process group (`kill(-pid)`); on Windows it falls back to killing the child.
130
+ When the child exited but a descendant still holds the stdio pipes, the tool
131
+ drains what arrived and returns instead of hanging until the timeout.
132
+ - `maxBuffer` is set explicitly (16 MB) and truncation is reported as
133
+ `truncated` + a truthful note, instead of returning
134
+ `ERR_CHILD_PROCESS_STDIO_MAXBUFFER` as the "exit code" while claiming the full
135
+ content had been written to disk.
136
+
137
+ ### 🛡️ Fixed — `spawn` reported failures as success
138
+
139
+ - Its `exit` listener was removed by `removeAllListeners()`, so a command that
140
+ failed immediately (`exit 3`, missing binary, syntax error) came back as
141
+ `success: true`. The field is now `started`, with an explicit note that this
142
+ tool does not track the exit status — use `exec` for that.
143
+
144
+ ### 🛡️ Fixed — `glob` / `find_text` answered "no files" for a bad base directory
145
+
146
+ - A non-existent or non-directory `path` silently returned `[]` (`ls` raises
147
+ `ENOENT` in the same situation). Both tools now validate the base directory and
148
+ say so; the implicit `**/node_modules/**` default for `exclude` is documented in
149
+ the parameter description.
150
+
151
+ ### 🛡️ Fixed — `generate_image` returned `success: true` with no images
152
+
153
+ - Only `url` entries were collected, so an endpoint that returns `b64_json`
154
+ produced `{ success: true, images: [] }`. Base64 payloads are now decoded,
155
+ written to `<tmp>/ai-zen/generated-images/` (extension sniffed from the magic
156
+ bytes) and returned as a local path; a response with neither field is a
157
+ failure.
158
+
159
+ ### 🛡️ Fixed — `permissions` were declared but not enforced
160
+
161
+ - `load_skill` / `call_skill_sub_agent` only used `filteredSkills` to build the
162
+ `enum`; the callback read from the full skill directory, so a denied skill
163
+ could be loaded by naming it (and `../..` escaped the directory entirely). Both
164
+ now validate `skill_id` against the filtered set.
165
+ - `call_mcp_tool` / `read_mcp_resource` only checked "is this server connected".
166
+ The connection manager is shared across the Scope, so any server connected by
167
+ one agent was callable by every agent. Both tools receive the filtered server
168
+ list and validate against it.
169
+
170
+ ### 🛡️ Fixed — runtime edges around handoff and MCP
171
+
172
+ - Handoff file names dropped the `conversationId` suffix (and the parameter with
173
+ it): session names are hand-edited and would only make the file name noisier.
174
+ - `migrate()` reads `definition.messages ?? []` — a hand-written definition
175
+ without `messages` used to throw a raw `TypeError` after the handoff turn had
176
+ already run.
177
+ - MCP: a `disconnect()` during connect no longer resurrects the connection (and
178
+ closes the resources it built); a transport that closes at runtime marks the
179
+ server `disconnected` instead of leaving a stale manifest behind; connecting
180
+ has a 60 s timeout (`connectTimeoutMs`) instead of hanging `load_mcp` forever
181
+ on a misconfigured endpoint.
182
+ - `ContextGuardPlugin` gained `isSuspended?: () => boolean`. Handoff/migration
183
+ turns are started precisely when the context is fullest; the guard now steps
184
+ aside for them itself, and `HandoffService` no longer clears usage data to make
185
+ that happen ("whoever imposes the limit lifts it").
186
+
187
+ ### 🧪 Engineering
188
+
189
+ - Tests are now type-checked: new `tsconfig.test.json`, `pretest` runs it. 234
190
+ type errors had accumulated (including real drift: `defaultModel` removed,
191
+ `maxTokens` → `handoffTokens`, `McpServerConfig.name` removed,
192
+ `AgentDefinition.messages` must be `Message` instances). All cleared.
193
+ - `npm test` no longer pulls in `test/e2e-*.test.ts`: those need an API key, real
194
+ network, or a local MCP server, and `prepublishOnly` hangs off that command.
195
+ Scripts now mirror the CLI: `test` / `test:e2e` / `test:all`.
196
+ - Default suite: **628 passed** (53 files). E2E: **36 passed, 6 skipped**.
197
+
198
+ ### 📖 Docs
199
+
200
+ - Aligned 8 drifts: `ContextGuardPlugin({ guardTokens, isSuspended })` (no
201
+ `maxTokens`, no `ratio`, no `suspendedRatio` — the threshold is absolute),
202
+ `AutoMigratePlugin({ handoffTokens })`, `AutoMigrateModeResolver`'s
203
+ `info.handoffTokens`, `Model.tokenThresholds` instead of `maxContextTokens`,
204
+ `Endpoint.capabilities`, the `content-blocks` module in the directory tree and
205
+ the module layering, plus a new "file → content block" section describing the
206
+ transport decision table, upload cache, degradation rules and the `deps.upload`
207
+ injection point.
208
+
209
+ ## [1.0.0-alpha.25] - 2026-11-02
210
+
211
+ > Endpoint capability bits are now backfilled on migration. Since alpha.12 the
212
+ > `capabilities.filesApi` bit decides whether local media is uploaded (Files API) or
213
+ > inlined as base64 — but endpoints are never factory-managed, and migration did not
214
+ > touch them either, so any config written before alpha.12 kept `deepseek` without the
215
+ > bit. For those users the promised "deepseek goes through the Files API" never took
216
+ > effect: images, `view_image` and MCP media silently degraded to base64 inline, and
217
+ > the request body grew with every turn of history.
218
+ >
219
+ > Alongside it, entity ids are now confined to their repository directory: a hostile id
220
+ > could previously make `AgentRepository` read / write / delete JSON files outside of
221
+ > `agents/`.
222
+
223
+ ### 🛡️ Fixed — `Endpoint.capabilities` is backfilled when missing
224
+
225
+ - **`normalizeEndpointCapabilities()`** (in `config/migrate.ts`, wired into
226
+ `migrateConfig()`) fills in `capabilities` **only when the whole field is absent**,
227
+ taking the values from the factory endpoint with the same id. Nothing else is touched:
228
+ - an endpoint that already has `capabilities` — even `{}` or `{"filesApi": false}` — is
229
+ left byte-for-byte alone; an explicit `false` is a decision, not a gap;
230
+ - endpoints whose id is not in the factory list (user-built) are left alone, because
231
+ guessing would send uploads to a `/files` endpoint that may not exist.
232
+ - The migration lands on disk through the usual `ensureDefaultConfig()` path, so it runs
233
+ exactly once per config: a second start finds nothing to change.
234
+ - Verified end to end against a legacy-shaped config: `deepseek` gains
235
+ `{ filesApi: true }` in memory **and** on disk, a user-written `filesApi: false` on
236
+ `openai` survives, a self-built endpoint stays untouched, and the second start does not
237
+ rewrite the file.
238
+
239
+ ### 🔒 Fixed — entity ids can no longer escape their repository directory
240
+
241
+ - **`EntityRepository.path()`** now validates the resolved target:
242
+ `resolve()` + a `root + sep` prefix check, instead of `join(dir, `${id}.json`)`.
243
+ - A bare `startsWith(root)` would not have been enough: `../agents-evil/x` normalizes to
244
+ `<root>-evil/x.json`, which still *starts with* `<root>`.
245
+ - `join` cannot normalize absolute paths, so `/etc/passwd` used to land in
246
+ `<dir>/etc/passwd.json`; `resolve` catches it.
247
+ - The check lives in `path()` rather than in `write()` / `delete()`: `read`, `write` and
248
+ `delete` all go through it, and `list()` only ever passes single-segment names coming
249
+ from `readdir`, so it cannot break listing — one gate, read/write/delete consistent.
250
+ - Affected callers that pass a user-supplied id straight through: `AgentRepository`
251
+ (agent / sub-agent definitions) and the CLI's conversation repository (`/save`, `/load`).
252
+ A hostile id now fails loudly (`Invalid entity id: …`) instead of writing outside the
253
+ directory.
254
+ - Known and accepted: `a/../b` normalizes back inside `<root>/b.json` and is therefore
255
+ still allowed — the only remaining effect is overwriting another definition, and
256
+ `config.json` is out of reach.
257
+
258
+ ### ✅ Tests
259
+
260
+ - `AgentRepository.test.ts` +5: `../escaped` rejected *and* no file written outside,
261
+ `../agents-evil/x` rejected, `read` / `delete` share the same gate, absolute path
262
+ rejected, normal id unaffected. Uses a two-level temp directory so an escape would land
263
+ inside the test's own tmpdir instead of `/tmp`.
264
+ - `migrate.test.ts` +7: backfill on a legacy config, explicit `false` respected,
265
+ existing-but-empty `capabilities` untouched, user-built endpoint untouched, factory
266
+ endpoint without the bit untouched, idempotency, and "no side effects on the caller's
267
+ object".
268
+ - Full suite: **57 files / 629 tests passing** (6 skipped), `tsc --noEmit` clean.
269
+
270
+ ### 🔧 Toolchain — TypeScript 5.9.3 → 7.0.2
271
+
272
+ - **`packages/sdk/tsconfig.json`**: added `"types": ["node"]`. TypeScript 7 no longer
273
+ picks global types up from `node_modules/@types` automatically (at least under this
274
+ repo's pnpm symlink layout), so `"node:fs"` / `process` / `Buffer` all turn into
275
+ `TS2591`. Naming the types explicitly is also what `@ai-zen/cli` already does.
276
+ - **`packages/core/tsconfig.json`**: `moduleResolution: "Node"` → `"Bundler"`. The
277
+ `node10` resolution mode was **removed** in TypeScript 7 (`TS5108`); `Bundler` is the
278
+ closest equivalent for a package compiled with `module: ESNext`.
279
+ - Verified after the upgrade: `tsc --noEmit` clean for both packages, both `build`
280
+ scripts succeed, core **150 passed / 17 skipped**, sdk **624 passed / 6 skipped**
281
+ at that point (629 after the entity-id hardening above), and `dist/index.js` still
282
+ loads at runtime (84 exports).
283
+
1
284
  # Changelog
2
285
 
286
+ ## [1.0.0-alpha.24] - 2026-10-29
287
+
288
+ > User tool files can no longer damage the host. `tools/` holds code that the SDK
289
+ > **evaluates in-process**, so a stray script in that directory used to be able to
290
+ > kill the process, hang startup, or silently rewrite project files.
291
+
292
+ ### 💥 Breaking Changes
293
+
294
+ - **`tools/` is now explicitly a trusted-extension directory.** Files there are
295
+ still `import()`-ed in-process, so the SDK cannot sandbox them: a top-level
296
+ synchronous infinite loop or a native `process.kill()` still takes the host
297
+ down. Anything untrusted belongs in an MCP server, which is the out-of-process
298
+ extension path. This is documented in `discover.ts` next to the guards.
299
+
300
+ ### 🛡️ Fixed — user tool loading is now fail-safe
301
+
302
+ Real-world incident that motivated this release: a one-off developer script
303
+ (`process.exit(2)` when called without arguments) was dropped into
304
+ `.ai-zen/tools/`. Every startup imported it during session creation, so the CLI
305
+ process was killed mid-initialization and the last drawn frame stayed on screen —
306
+ it looked like a hang. Another script in the same directory rewrote PNG assets at
307
+ module top level on every startup. All four such files are now skipped or
308
+ neutralised.
309
+
310
+ - **Static pre-check: files without `export` are never evaluated.** A module with
311
+ no `export` cannot export a `Tool`, so `normalizeToolExport()` was already going
312
+ to discard it — the only difference is that the old code found out *after*
313
+ evaluating it, i.e. after the side effects had happened. Reading the source
314
+ first costs one `fs.readFile` and buys complete immunity from that class of
315
+ file. Read failures fail open (the file is still imported) so an unreadable but
316
+ valid tool is never silently dropped.
317
+ - **`process.exit` / `process.abort` are suppressed during evaluation.** They are
318
+ swapped for a thrown `UserToolExitError`, which lands in the existing
319
+ `try/catch` and rejects just that one file. The originals are restored in a
320
+ `finally` — the guard must never outlive the import, or the host itself could
321
+ not exit. What was saved is the *current* value, not the value at module load,
322
+ so nested/concurrent discoveries restore correctly.
323
+ - **`console.log` / `info` / `debug` are redirected to stderr while evaluating.**
324
+ stdout belongs to the host's UI; a tool file writing to it tears an Ink frame
325
+ apart. This is also why the stray scripts visibly corrupted the TUI.
326
+ - **Per-file import timeout (`importTimeoutMs`, default 5000).** A module whose
327
+ top-level `await` never settles no longer blocks startup. A timeout only stops
328
+ *waiting* — ESM evaluation cannot be cancelled, so the module may still finish
329
+ later; this is stated at the call site rather than pretended away.
330
+
331
+ ### 🔧 Changed
332
+
333
+ - Rejections are reported through `getLogger().warn/error` (previously the
334
+ failure path logged at `error` only). No new notification API was added: hosts
335
+ that want these on screen should tee their `Logger`, which is a single hook that
336
+ covers every SDK subsystem at once instead of one callback per feature.
337
+
338
+ ### ✅ Tests
339
+
340
+ - `discover.test.ts` 16 → 21 cases. The five new ones pin each hazard: a file
341
+ without `export` is skipped **without being evaluated** (asserted via a
342
+ side-effect marker file), a top-level `process.exit(2)` neither kills the host
343
+ nor prevents later files from loading, top-level `console.log` does not reach
344
+ stdout, a never-settling top-level `await` times out, and `process.exit` /
345
+ `console.log` are restored afterwards.
346
+ - Full suite: 57 files / 617 passed / 6 skipped.
347
+
348
+ ## [1.0.0-alpha.23] - 2026-10-29
349
+
350
+ > The SDK is now English-only. Every model-facing and user-facing string is a
351
+ > fixed English literal: no i18n layer, no locale field in `AppConfig`, no
352
+ > runtime language switching. This is a performance boundary, not a convenience
353
+ > choice — SDK behaviour and performance must not vary with the user's language.
354
+
355
+ ### 💥 Breaking Changes
356
+
357
+ - **Language is a performance boundary, not a translation gap.** `Model.tokenThresholds.handoff` / `guard` and `AppConfig.maxToolOutput` are absolute token / character counts, so a localized tool schema is a different token count and would make handoff and context-guard trip at different amounts of real content for the same `config.json`. Tool descriptions are also re-sent on every request, so a token delta is a standing cost rather than a one-off, and per-language prompt-cache prefixes would strip benchmarks of the single variable they rely on.
358
+
359
+ - **All tool schema descriptions are now English.** 270 hardcoded Chinese string literals across 39 source files were translated. Tool names, parameter keys, enum values and identifiers were already English and are unchanged.
360
+ - **The factory system prompt no longer forces a reply language.** The hardcoded `reply in Chinese` directive was removed and replaced with a language-neutral instruction — `Always reply in the same language the user writes in.` The model now follows the user's language per message instead of per installation, which is what a locale dimension could never express.
361
+ - **Factory assets are English.** The default Agent and SubAgent prompts, the factory handoff Skill (`skills/handoff/SKILL.md`), the fallback handoff template, and the factory catalog (endpoint / model / MCP server descriptions) are all English. `DEFAULT_AGENT_DEFINITION` and `DEFAULT_SUBAGENT_DEFINITION` keep their shape — only the text changed, so no consumer code needs updating.
362
+ - **Upgrade behaviour.** `bootstrap()` rewrites the factory prompt in `agents/default.json`; Agents marked `custom: true` are untouched. Conversation archives keep their original text: a conversation copies its system message at creation time and never re-derives it from the factory definition, so existing archives stay exactly as they were.
363
+
364
+ ### 🔧 Changed
365
+
366
+ - Runtime-injected guidance (`UnknownToolHintPlugin`), tool results, error messages, and the `[handoff]` / `[autoMigrate]` / `[usertools]` / `[sdk]` log lines are English. Log prefixes are preserved.
367
+ - The `⚠️ Unverified` placeholder marker is now spelled identically in the handoff Skill and in the `HandoffService` summary-mode instruction; the two previously differed in letter case, which let the model emit either form.
368
+ - `CHANGELOG.md` is English-only.
369
+
370
+ ### ✅ Tests
371
+
372
+ - 167 assertions across 43 test files updated. Case count and assertion strictness unchanged — several assertions became more specific rather than looser.
373
+ - Full suite: 57 files / 612 passed / 6 skipped, identical to alpha.22. `tsc --noEmit` clean, build clean.
374
+ - Change verified as text-only: every removed line in the diff contained CJK characters, so no logic, signature or control flow was touched.
375
+
376
+ ### 📄 Docs
377
+
378
+ - Design docs under `docs/` stay Chinese; `README.md` (English) and `README.zh.md` (Chinese) keep their existing split.
379
+
380
+ ## [1.0.0-alpha.22] - 2026-10-28
381
+
382
+ > Abort strategy (`abortedMessageStrategy` / `abortedToolRoundStrategy`) moved from "each caller passes its own params"
383
+ > to a **config entry**: written into `config.json`, read automatically by `createAgent()`.
384
+
385
+ ### 🚀 New Features
386
+
387
+ - **`AppConfig` gained two strategy fields** (`types/index.ts`):
388
+ - `abortedMessageStrategy?: "keep" | "drop"` — whether to keep the thinking / body text an interrupted assistant has already emitted. `keep` lets the model continue from the half-finished output in the next round instead of "losing memory and starting over".
389
+ - `abortedToolRoundStrategy?: "fill" | "drop"` — how to normalize an interrupted / incomplete tool round. `fill` keeps the whole round and supplies a reason for unfinished results, guaranteeing that `tool_calls` and results pair up one-to-one.
390
+ - **Factory defaults are `keep` + `fill`** (`DEFAULT_APP_CONFIG`): `keep` is a product-level decision (the library-level default in core is still `drop`); `fill` matches the core default and changes no behavior.
391
+ - **`createAgent()` takes the strategy from `scope.config`**: priority is "explicit parameter > `scope.config` > core default". Upstream consumers (CLI / Desktop) no longer have to read the config themselves and forward another round of params, and child Agents inherit the same strategy naturally when created.
392
+ - **Config migration now fills in the strategy fields** (`migrateConfig`): a missing or invalid `abortedMessageStrategy` / `abortedToolRoundStrategy` is always written back as the factory default (`changed` set to true, `ensureDefaultConfig()` persists it once). So "what the config file says is what runs at runtime", and no client needs a `?? "keep"`-style fallback anymore.
393
+
394
+ ### ✅ Tests
395
+
396
+ - Full suite **57 files / 612 cases passing** (6 skipped; 608 cases in alpha.21).
397
+ - `migrate.test.ts` 20 → 22 cases: filling in missing strategy, rewriting invalid values, keeping valid values as is with `changed=false`; the existing "no migration needed, returns the original object" case now also covers the strategy fields.
398
+ - `createAgent.test.ts` 6 → 8 cases: strategy taken from `scope.config`, explicit params overriding the config, falling back to the core default when config has no value (`drop` / `fill`).
399
+
400
+ ## [1.0.0-alpha.21] - 2026-10-28
401
+
402
+ ### 🚀 New Features
403
+
404
+ - **Handoff/migration now supports cancellation (`AbortSignal`)** — previously `handoff()` / `migrate()` had no means of aborting once started, and pressing Ctrl+C in the host could not stop them:
405
+ - the standalone model request in `summary` mode had no cancellation point at all;
406
+ - `self` mode could be interrupted by `agent.abort()`, but the abort was misjudged as "the model produced no document", so it retried one round and then degraded to `summary` for another round — the user thought it was cancelled while two extra rounds of full input were burned.
407
+
408
+ `HandoffParams` now gains `signal?: AbortSignal`, honored by both executors:
409
+
410
+ - `summary`: `signal` is passed as the **RequestOptions (second argument)** to `chat.completions.create`, so the request is genuinely aborted;
411
+ - `self`: after every `agent.send()` it **actively checks** `aborted` (because `abort()` does not throw), and on cancellation throws `HandoffAbortedError` — **no retry, no degradation**;
412
+ - `runHandoff()` adds cancellation points between phases; when `migrate()` is cancelled it **leaves the session history untouched** (no fake "already migrated" state left behind).
413
+
414
+ - **Exported `HandoffAbortedError`** — cancellation gets its own type, so callers can handle "the user pressed Ctrl+C" and "the handoff genuinely failed" separately: the former ends quietly, only the latter should raise an error.
415
+
416
+ ### 🔧 Fixed
417
+
418
+ - **Cleaned up the half-written handoff document on cancellation** — only the file created in this run is deleted (an existing file with the same name is left alone). A half-finished artifact is worse than none: the next round's receiver would read it as a real handoff.
419
+
420
+ ### ✅ Tests
421
+
422
+ - Full suite **57 files / 608 cases passing** (6 skipped).
423
+ - `HandoffService.test.ts` **24 → 30 cases**: signal forwarded as RequestOptions, cancelled summary writes nothing, cancelled self neither retries nor degrades, half-finished cleanup, cancelled migrate leaves history unchanged, and the normal path is not broken when nothing is cancelled.
424
+ - Destructive verification: removing the cancellation check in `self` turns the "no retry, no degradation" case red.
425
+
426
+ ## [1.0.0-alpha.20] - 2026-10-27
427
+
428
+ ### 🚀 New Features
429
+
430
+ - **`createAgent(scope, agentId, options?)` gained a third parameter that forwards the abort-related strategies** — previously the SDK did not expose core's `abortedToolRoundStrategy` / `abortedToolRoundReason` at all, so callers were stuck with the defaults. This release surfaces three fields (with the new exported type `CreateAgentOptions`, also supported by the `SdkAgent` constructor):
431
+ - `abortedToolRoundStrategy?: "drop" | "fill"` — normalization strategy when a tool round is interrupted (or its results are incomplete) (core default `fill`);
432
+ - `abortedToolRoundReason?: string` — the reason filled in for unfinished tool results under the `fill` strategy;
433
+ - `abortedMessageStrategy?: "drop" | "keep"` — **new capability**: whether to keep the content / thinking an interrupted assistant has already emitted (core default `drop`). With `keep`, the half sentence from a user interruption still enters the next round's context, so the model can continue instead of "losing memory and starting over"; rounds with tool calls are still governed by `abortedToolRoundStrategy` and are unaffected.
434
+
435
+ ### ⚠️ Dependency
436
+
437
+ - Upgraded `@ai-zen/agents-core` to `4.5.3` (adds `abortedMessageStrategy` and `reconcileAbortedMessages()`).
438
+
439
+ ### ✅ Tests
440
+
441
+ - Full suite **57 files / 602 cases passing** (6 skipped).
442
+
443
+ ## [1.0.0-alpha.19] - 2026-10-27
444
+
445
+ ### 🔧 Fixed
446
+
447
+ - **Logging no longer bypasses `getLogger()`: logs such as `[load_mcp]` went straight to the host terminal** — 4 modules previously ran `const log = getLogger()` at **module top level**, and `getLogger()` at the time returned `{ info: console.log, ... }`. At the moment the module was evaluated, the **function reference** of `console.log` was frozen into the constant; afterwards the host's `setLogger()` swapped the internal `currentLogger` variable, which **could not change the already captured reference**. Consequence: whatever the host did to take over logging, it did not help — when the CLI's Ink TUI loaded MCP, `load_mcp` dumped the entire tools / resources list outside the render area and shredded the interface into garbled output.
448
+
449
+ All 4 sites now **fetch the logger at runtime** (`getLogger().info(...)` etc.), so `setLogger()` takes effect immediately:
450
+
451
+ - `scope/plugins/mcp/mcpTools.ts` — two `[load_mcp]` info logs (summary + full list);
452
+ - `scope/plugins/skills/discover.ts` — one `[skills]` warn;
453
+ - `agent-plugins/AutoMigratePlugin.ts` — one `[autoMigrate]` error;
454
+ - `scope/plugins/skills/skillTools.ts` — the top-level snapshot was **never called** (dead code) and was deleted together with the `getLogger` import.
455
+
456
+ With this, all 10 log call sites in the SDK go through the single `getLogger()` exit; whatever the host installs via `setLogger()` is what gets used, and no console bypass remains.
457
+
458
+ ### ✅ Tests
459
+
460
+ - Full suite **57 files / 602 cases passing** (6 skipped).
461
+ - End-to-end comparison: with the same code "evaluate the module first → then `setLogger` → call `load_mcp`", the old version wrote logs straight to stdout and left the log file empty; the new version keeps stdout clean and writes the logs fully to disk.
462
+
463
+ ## [1.0.0-alpha.18] - 2026-10-22
464
+
465
+ ### 💥 Breaking Changes
466
+
467
+ - **The single source of truth for the model became `AgentDefinition.modelId`, and `AppConfig.defaultModel` was removed** — the model previously had two sources: `modelId` in the Agent definition took priority, falling back to `config.defaultModel` when missing. Clients such as the CLI also kept another copy of the model name in the **session archive** for display. Once the three values diverged, a silent mismatch appeared where "the UI says DeepSeek while the request goes to GLM": the user saw a 401 but could not switch back no matter what (the switch command judged "already the current model" from the display layer and returned immediately, while the actual model never changed). Now:
468
+ - the `defaultModel` field was removed from `AppConfig`, and from the factory config as well; `migrateConfig` **clears** the old field on disk (one-time, it never reappears after being written);
469
+ - `createAgent` reads only `definition.modelId` and **throws when it is missing**, with no implicit fallback left;
470
+ - `ViewImageTool.isAvailable` / `resolveModelAndEndpoint` dropped the `defaultModel` fallback as well; a failed lookup now counts as "no endpoint", letting the caller take a degradation path instead of guessing a model.
471
+ - **`DEFAULT_AGENT_DEFINITION.modelId = "deepseek-flash"` (new export `DEFAULT_MODEL_ID`)** — the factory default Agent ships with a model ID, usable right after install, no longer relying on a default from the config layer.
472
+ - **Upgrade compatibility: `ensureDefaultAgent()` fills in `modelId` for legacy Agents that lack it** — it first reuses the old `config.defaultModel` (if that model is still in the list), otherwise falls back to the factory `deepseek-flash`, so upgrading does not change the model the user is currently using.
473
+
474
+ ### ✅ Tests
475
+
476
+ - Full suite **57 files / 602 cases passing** (6 skipped).
477
+ - New/rewritten highlights: `createAgent` must throw when `modelId` is missing, `ensureDefaultAgent` backfills and persists it, `migrateConfig` removes deprecated fields without mutating the original object in place, `resolveModelAndEndpoint` returns a `null` endpoint on a miss, and the MCP / image tools resolve endpoints via `ctx.agent.model` (no longer falling back to a default model).
478
+
479
+ ## [1.0.0-alpha.16] - 2026-10-22
480
+
481
+ ### 💥 Breaking Changes
482
+
483
+ - **Upgraded `@ai-zen/agents-core` to `4.5.2`: fixed fields in the request body are no longer overridden by `modelParams`** — core used to spread the model params **last** in the request body (`{ model, messages, tools, stream, stream_options, ...modelConfig }`), and `modelConfig` comes from the user-editable `Model.defaultParams` / `AgentDefinition.modelParams`. Any key of the same name then took effect silently: the worst case was `stream: false`, which turned streaming off while the caller was still parsing an async stream, failing the whole round outright. The order is now reversed, so fixed fields always win, while non-fixed keys (`temperature` / `reasoning_effort` / vendor-specific `thinking`, etc.) pass through as before.
484
+
485
+ Actual impact on this SDK: writing `model` / `messages` / `tools` / `stream` / `stream_options` in `AgentDefinition.modelParams` now has no effect at all. Normal configuration (temperature, thinking params) is unaffected.
486
+
487
+ ### ✅ Tests
488
+
489
+ - 3 new cases on the core side (non-fixed keys pass through, fixed keys are ignored, the request body contains only framework fields when there is no `modelConfig`). The SDK itself: **57 files / 600 cases passing** (6 skipped).
490
+
491
+ ## [1.0.0-alpha.15] - 2026-10-22
492
+
493
+ ### 💥 Breaking Changes
494
+
495
+ - **The SDK no longer "consumes" reasoning levels; only the table itself remains** — alpha.14 pushed the entire "level → request params" resolution into the SDK runtime: `applyReasoningEffort` / `modelLevels` / `resolveReasoningEffort` / `resolveModelParams`, plus `Scope.reasoningPresets` injection, storing level names on the Agent, and looking up the table at runtime to assemble params. But `low` / `high` / `max` / `off` are **product semantics, not protocol facts**; the only thing the SDK objectively knows is "what the request params look like" — which `defaultParams` already carries. Now:
496
+ - **the entire API of `shared/reasoning.ts` was removed** (`applyReasoningEffort` / `modelLevels` / `presetOf` / `readReasoningEffort` / `resolveReasoningEffort` / `resolveModelParams`), along with `Scope.reasoningPresets`;
497
+ - **kept**: the **definition and factory content** of the reasoning presets (`ReasoningPresets` / `ReasoningPreset` / `ReasoningPatch` types, `config/reasoning-presets.ts`, `ConfigManager.readReasoningPresets()` / `ensureReasoningPresets()`) — it is an **asset shared by clients** such as the CLI / desktop app (knowledge like "Zhipu 5.3 only accepts low/high/max" should not be written out again by every client), but it is only **data**; the SDK does not use it to generate request params.
498
+ - **`AgentDefinition.reasoningEffort` → `AgentDefinition.modelParams?: ModelParams`** — the Agent-level override changed from "a level name" to "concrete params". The client reads the table, takes the level patch, and expands it into `modelParams` **when writing the config**. So **config is the fact**: no table lookups or inference at runtime.
499
+ - **`createModel(scope, modelId, overrides?: ModelParams)`** — the third parameter changed from `Pick<AgentDefinition, "reasoningEffort">` to a bare params object, and internally it is just one line:
500
+ ```ts
501
+ modelConfig = { ...model.defaultParams, ...overrides };
502
+ ```
503
+ Shallow merge (nested objects are replaced wholesale); without overrides it returns `defaultParams` as is. From now on the SDK interprets no key names and does not even know what `thinking` / `reasoning_effort` are. A SubAgent given its own `modelId` likewise applies its own `modelParams`.
504
+ - **`Model.reasoningPreset` was kept**, with the semantics changed to "a key referencing the preset table", so clients can tell which levels that model offers; the SDK only guarantees that it can be read and written with the model config and synced from the factory — it does not consume it.
505
+
506
+ ### 🔧 Fixed
507
+
508
+ - **Migrated the legacy `Model.reasoning` field (left over from alpha.13)** — models without `custom` were overwritten wholesale by the factory definition, but **those marked `custom: true` were kept in place**, leaving behind a `reasoning` nobody recognized, and because `reasoningPreset` was missing the client judged them "not adjustable". `ConfigManager.read()` now deletes that legacy field and restores `reasoningPreset` from the factory model with the same id; ids not in the factory list (genuinely custom models) are only cleaned, not restored. Only the "legacy field exists" case is handled, so a `reasoningPreset` the user removes later is not restored over and over.
509
+
510
+ ### ✅ Tests
511
+
512
+ - `src/runtime/createModel.test.ts` added 6 cases locking down the merge semantics: no overrides returns as is, empty overrides equal no overrides, same-name keys override while other keys are kept, with no `defaultParams` on the model the overrides are everything, **shallow merge does not deep merge** (switching levels leaves no old sub-keys behind), and two Agents with their own sets do not affect each other.
513
+ - `src/config/migrate.test.ts` added 6 cases (19 in total).
514
+ - Removed `src/shared/reasoning.test.ts` (26 cases; the runtime resolution is gone); `src/config/reasoning-presets.test.ts` (11 cases) is kept — the table is still in the SDK.
515
+ - Full suite **57 files / 600 cases passing** (6 skipped).
516
+
517
+ ## [1.0.0-alpha.14] - 2026-10-22
518
+
519
+ ### 💥 Breaking Changes
520
+
521
+ - **Reasoning capability declaration moved from "model fields" to a "preset table"** — alpha.13 expressed vendor differences with `Model.reasoning: { efforts, disable? }`, which resulted in three structural flaws: `disable` carried two meanings (both the way to turn it off and the capability itself), `off` was assembled rather than declared (`disable ? ["off", ...efforts] : efforts`), and a global `ReasoningEffort` enum pretended every vendor's levels were equivalent. It is now a declarative table of **level → request-param patch**:
522
+ - added `<basePath>/reasoning-presets.json` (sibling of `config.json`); factory content lives in `config/reasoning-presets.ts`;
523
+ - `Model.reasoning?` → **`Model.reasoningPreset?: string`** (references a preset name; absent = not adjustable);
524
+ - the type of `AgentDefinition.reasoningEffort` changed from `ReasoningEffort` to **`string`** (level names are defined by the preset table; no more fake enums pretending uniformity);
525
+ - removed the `ReasoningEffort` / `ReasoningCapability` types and the `capabilityOf` / `modelEfforts` / `modelAllowedEfforts` / `isReasoningEffort` functions;
526
+ - function signatures now all start with `(model, presets, …)`: `readReasoningEffort(model, presets, params?)`, `applyReasoningEffort(model, presets, level, params?)`, `resolveReasoningEffort(model, presets, definition?)`, `resolveModelParams(model, presets, definition?)`;
527
+ - `Scope` gained `reasoningPresets` (injected alongside `config`, not a global singleton).
528
+
529
+ In exchange, three structural guarantees, all stemming from the table's shape with zero branches in the code: ① selectable levels = `Object.keys(levels)`; ② whether reasoning can be turned off = whether the table has an `off` key; ③ "which param keys belong to reasoning" = the union of keys appearing anywhere in the table (used to strip stale values before writing, so `max` → `off` no longer leaves `reasoning_effort` behind, and switching a model's preset does not regurgitate the previous param set).
530
+
531
+ - **`applyReasoningEffort` validates levels more strictly** — a level absent from the preset now throws immediately (the old version returned an "unsupported level" message for models without a declared capability), and the error message includes the preset name and the list of available levels.
532
+
533
+ ### 🚀 New Features
534
+
535
+ - **`ConfigManager.readReasoningPresets()` / `ensureReasoningPresets()`** — read/write of the preset table plus factory sync. Sync granularity is **per individual preset**, with rules isomorphic to factory model sync: a missing file writes the seed; presets marked `custom: true` are frozen; unmarked ones are overwritten by the factory version; user-created non-factory presets are always preserved. `bootstrap()` calls it automatically. When the file is missing or corrupt, `readReasoningPresets()` falls back to the factory seed, so upper layers never get an empty table.
536
+ - **`presetOf(model, presets)` / `modelLevels(model, presets)`** — preset lookup and reading of available levels (`modelLevels` replaces the old `modelEfforts` + `modelAllowedEfforts` pair: `off` is now just another row in the table, with no split between "level" and "off").
537
+ - **The package entry now also exports `TokenThresholds` / `ReasoningPatch` / `ReasoningPreset` / `ReasoningPresets`** — alpha.13 was missing exports for these types (the original `7b10196` patch is merged into this release).
538
+
539
+ ### ✅ Tests
540
+
541
+ - `src/shared/reasoning.test.ts` rewritten (26 cases): protocol facts of the factory tables (the OpenAI table has no `thinking` key, `zhipu-5.3` has no `off`, DeepSeek turns reasoning off via `thinking.type`), adjustable levels = the table's keys, lookup picks the most specific match, stale keys are stripped on write, round-trip consistency, an invalid Agent declaration falls back to the model default, and prototype-chain names (`constructor`) have no effect.
542
+ - `src/config/reasoning-presets.test.ts` added (11 cases): file location, first-time release, idempotent runs do not write, entries not marked `custom` are overwritten, entries marked `custom` are frozen, user-created presets are preserved, corrupt / array content falls back to the seed, and `bootstrap()` releases it as a side effect.
543
+
544
+ ### 📄 Docs
545
+
546
+ - `docs/{zh,en}/sdk.md`: the "reasoning effort" section was rewritten as "reasoning presets", covering the preset table structure, a factory preset comparison table, the three structural guarantees, a table of the new APIs, and a `Scope` injection example.
547
+ - Also fixed examples that had been stale since alpha.13: `ContextGuardPlugin({ maxTokens, isSuspended })` → `{ guardTokens }`, `AutoMigratePlugin({ maxTokens })` → `{ handoffTokens }`, and the old "handoff turn guard relaxed × 2" description.
548
+
549
+ ## [1.0.0-alpha.13] - 2026-10-22
550
+
551
+ ### 💥 Breaking Changes
552
+
553
+ - **`Model.maxContextTokens` / `maxContextChars` → `Model.tokenThresholds: { handoff, guard }`** — The old names were misleading all along (they were neither a context window nor a single concept). Now split into two **absolute values**:
554
+ - `handoff`: the soft line — once `prompt_tokens` after a response returns exceeds it, task handoff is triggered (`AutoMigratePlugin`);
555
+ - `guard`: the hard line — if usage before a request exceeds it, `ContextOverflowError` is thrown and the turn is aborted (`ContextGuardPlugin`).
556
+ - `maxContextChars` was dropped outright (the character metric predates the token metric; keeping both only leaves "which one decides" ambiguous for good).
557
+ - Migration is performed by `config/migrate.ts`: `ConfigManager.read()` migrates on read, `ensureDefaultConfig()` writes to disk only when a difference is detected: `maxContextTokens` → `handoff`, `maxContextChars` → `floor(/4)`, and when `guard` is missing it is derived once as 1.5x (preserving pre-migration behavior); the old keys are removed right after.
558
+ - **All of `ContextGuardPlugin`'s `ratio` / `suspendedRatio` / `isSuspended` were removed** — they were merely artifacts of "relative thresholds". Now `new ContextGuardPlugin({ guardTokens })` with one absolute number is enough: to loosen it, just make the number larger. The cost is that **handoff turns no longer get the extra 2.0x relaxation**; if that buffer is needed, configure a larger `guard` (the default is `handoff × 1.5`, written as an integer).
559
+ - **`ContextOverflowError(promptTokens, guardTokens)`** — dropped the three derived fields `maxTokens` / `ratio` / `threshold` and now exposes the exceeded `guardTokens` directly.
560
+ - **`AutoMigratePlugin`'s `maxTokens` → `handoffTokens`**, `AutoMigrateTriggerInfo.maxTokens` → `handoffTokens`, and `HandoffService`'s `HandoffParams.maxTokens` / `HandoffContext.maxTokens` → `handoffTokens` (field rename only, semantics unchanged: the handoff threshold).
561
+
562
+ ### 🚀 New Features
563
+
564
+ - **Reasoning effort capability bit** — effort levels were previously not modeled at all; the CLI could only hand-edit `defaultParams`, while each endpoint accepts a different value range (Zhipu's GLM-5.3 family errors out directly on `medium`, and also errors on `thinking.type = "disabled"`). Now there are three layers:
565
+ - `Model.reasoning: { efforts: ReasoningEffort[], disable?: "thinking" | "effort-none" }` — the **physical capability ceiling**, declared per the vendor's official docs (to avoid 400s);
566
+ - `AgentDefinition.reasoningEffort?: ReasoningEffort` — the actual effort level for that Agent, overriding the model's `defaultParams` at the `createModel` stage. So the same model can be given different strengths for different Agents (coding Agent `max`, chit-chat Agent `low`, chit-chat mini `off`).
567
+ - Deliberately **did not** add an Agent-side effort whitelist (`reasoningEfforts`): it solves a non-problem (what actually causes 400s is endpoint capability, and that is already covered by the model declaration), yet introduces a "one s apart" naming trap and an extra layer of intersection rules.
568
+ - **`shared/reasoning.ts`** (public API, all exported from the package entry): `resolveReasoningEffort()`, `resolveModelParams()`, `applyReasoningEffort()` (writes per the declaration, throws on invalid levels), `modelEfforts()` / `modelAllowedEfforts()` / `readReasoningEffort()` / `isReasoningEffort()` / `capabilityOf()`, plus the `ReasoningEffort` / `ReasoningCapability` types.
569
+ - **Write shape is decided by the declaration**: `disable: "thinking"` → maintains both `thinking.type` and `reasoning_effort` (DeepSeek); `disable: "effort-none"` → writes only `reasoning_effort` (OpenAI has no `thinking` parameter, and writing it would be treated as an unknown parameter); no `disable` declared → writes only `reasoning_effort`, and `off` throws directly (Zhipu 5.3 family).
570
+ - **Factory models declare capabilities per the official docs** (the basis is recorded in the `constants.ts` comments):
571
+ - `deepseek-flash` → `low/high/max`, can be disabled (`api-docs.deepseek.com/guides/thinking_mode`)
572
+ - `glm-5.3` / `glm-5.3-flash` / `glm-5.3-flashx` → `low/high/max`, **cannot be disabled** (`docs.bigmodel.cn/cn/guide/capabilities/thinking`)
573
+ - `glm-4.7-flash` → not adjustable (thinking is forced; `reasoning_effort` is supported only in 5.2+)
574
+ - `gpt-6-astra` / `gpt-6.1-sol` / `gpt-6-luna` → `minimal/low/medium/high`, can be disabled with `reasoning_effort: "none"`
575
+ - Models with no declaration are all treated as non-adjustable; no guessing
576
+
577
+ ### 🔧 Changed
578
+
579
+ - **`createModel(scope, modelId)` → `createModel(scope, modelId, overrides?: Pick<AgentDefinition, "reasoningEffort">)`** — the new optional third parameter is passed in by `createAgent` as `definition.reasoningEffort`. When omitted, behavior is exactly as before (returns the model's `defaultParams` unchanged).
580
+
581
+ ### ✅ Tests
582
+
583
+ - Added 22 cases in `shared/reasoning.test.ts`: capability declarations match the factory list, `off` is available only for models with `disable`, GLM-5.3 throws for both `medium` and `off`, OpenAI never writes a `thinking` key, round-trip consistency, Agent override and fallback.
584
+ - Added 13 cases in `config/migrate.test.ts`: old-field migration (tokens / chars / both / neither / dirty values), `guard` derivation, no migration when already in the new shape, input arguments are not mutated, and untouched entries keep the same reference during partial migration.
585
+ - Full suite **57 files / 599 cases** passing (6 skipped), `tsc --noEmit` and `build` with zero errors.
586
+
587
+ ### 📄 Docs
588
+
589
+ - `docs/{zh,en}/sdk.md` added a "Reasoning effort" section (the three-layer model, the factory declaration table, write shapes, public API), and the core entity table now includes `Model.reasoning` and the Agent's two effort fields.
590
+
591
+ ## [1.0.0-alpha.12] - 2026-10-22
592
+
593
+ ### 💥 Breaking Changes
594
+
595
+ - **`createReadMcpResourceTool(mcpManager)` → `createReadMcpResourceTool(mcpManager, env: ToolEnv)`** — aligned with `createCallMcpTool` from alpha.11: `env` is used to read `maxToolOutput` and to resolve the endpoint bound to the current model. Downstream code calling this factory directly must add the second argument.
596
+ - **`view_image` no longer depends on the `deepseek` endpoint** — previously local images were always uploaded to the endpoint with `id === "deepseek"`, and when it was not configured it failed with "no deepseek endpoint configured, cannot upload local images". Now it is decided by capability bit: endpoints declaring `capabilities.filesApi` go through upload, all others go through base64 inlining, so local images can be viewed without deepseek. The returned message changed accordingly (including the transport and the fallback notes).
597
+ - **`Endpoint` gained the optional field `capabilities`** — non-breaking at the type level (optional), but semantically important: absent means "no special capabilities", i.e. no upload.
598
+
599
+ ### 🚀 New Features
600
+
601
+ - **Single unified entry point for "local file → content block": `shared/content-blocks.ts`**. This logic was previously scattered across three places each doing its own thing (`ViewImageTool` hardcoding the endpoint id, MCP media block normalization, and yet another implementation on the CLI side); it is now consolidated into one place:
602
+ - `fileToContentSection({ source, endpoint, model, signal, maxInlineBytes, deps })` → `{ section, transport, bytes, warning? }`; `source` supports four kinds of sources: `path` / `url` / `data` (`Uint8Array`) / `base64`.
603
+ - Decision chain: http(s) URL → `image_url`; endpoint has Files API → upload to get a `file_id` (**falls back automatically** to inlining on failure); other endpoints + image → `image_url` + base64 data URL; other endpoints + non-image → `file` block + `file_data`; non-vision model + image → text hint; inline over the limit and upload impossible → throw (never silently stuffed into the request body).
604
+ - Companion helpers: `resolveModelAndEndpoint()` (looks up the model and endpoint by the model name sent to the API), `supportsFilesApi()`, `mimeOf()` / `toDataUrl()` / `base64ByteLength()` / `contentHash()`, `clearUploadCache()`, `DEFAULT_MAX_INLINE_BYTES` (8 MiB).
605
+ - **Exported from the package entry `src/index.ts` as public API** (`fileToContentSection` / `resolveModelAndEndpoint` / `supportsFilesApi` / `mimeOf` / `toDataUrl` / `base64ByteLength` / `contentHash` / `clearUploadCache` / `MIME_BY_EXT` / `DEFAULT_MAX_INLINE_BYTES`, plus the `FileSource` / `FileToSectionInput` / `FileToSectionResult` / `ContentTransport` / `UploadFn` / `EndpointCapabilities` types). Upper-layer applications should reuse this directly when building media messages instead of each reimplementing "upload or inline".
606
+ - Upload cache: path sources key on "endpoint id + absolute path + mtime + size", in-memory sources key on the content sha256 (the same image is never uploaded twice), capped at 200 entries.
607
+ - `deps.upload` is injectable, which makes testing easier and lets the upload implementation be swapped.
608
+ - **`Endpoint.capabilities.filesApi` capability bit** — only `deepseek` is marked `true` out of the box (the description says so as well). The criterion changed from "is the endpoint id deepseek" to the capability bit, so user-built endpoints get upload just by declaring it.
609
+
610
+ ### 🔧 Fixed
611
+
612
+ - **MCP media is no longer always base64-inlined**: `image` / `audio` / `resource.blob` from `call_mcp_tool` now go through the unified entry point; when the endpoint has Files API capability they are uploaded and sent as `file_id`, so the request body no longer keeps ballooning with history; a failed conversion **does not drop the block** but degrades to a text note, so the whole tool call does not fail over a media problem.
613
+ - **Binary resources from `read_mcp_resource` were silently dropped**: previously only `contents[].text` was concatenated, so `blob` content such as images / PDFs simply vanished. Added `resourceToMessageSection()` — note that `readResource`'s contents look like `{ uri, mimeType?, text|blob }` and have **no `type` discriminator field**, so `toMessageSection` cannot be reused (otherwise text resources would be JSON-ified); `blob` is handed to the unified entry point.
614
+ - **`read_mcp_resource` now has output protection**: it shares the same rules as `call_mcp_tool` — text over the limit is written to disk as `result.txt` and a head/tail preview is returned, while media blocks stay in place; the return shape is likewise "text only → string / contains media → content block array".
615
+ - **Non-vision model degradation**: when `Model.vision !== true`, images degrade to a one-line text hint (applies to both local-path sources and MCP in-memory base64 sources), so `image_url` is not rejected by the server with a 4xx.
616
+ - **`edit` concurrency guardrail**: the `edit` / `batch_edit` tool descriptions state explicitly that "parallel `edit` on the same file is forbidden; use `batch_edit` for multiple changes; only different files may be parallelized" — a description-level deterrent (no runtime lock introduced).
617
+
618
+ ### ✅ Tests
619
+
620
+ - Added 16 cases in `shared/content-blocks.test.ts`; `mcpTools.test.ts` was extended to cover the unified media entry point, non-vision degradation, `read` over-limit disk writes, and order preservation in mixed content; the assertions in `ViewImageTool` / `EditTool` / `BatchEditTool` were synced to the new semantics.
621
+ - Full suite **55 files / 569 cases** passing (6 skipped), `tsc --noEmit` and `build` with zero errors.
622
+
623
+ ### 📄 Docs
624
+
625
+ - `docs/{zh,en}/sdk.md` added a "Local file → content block (unified entry point)" section, plus the `Endpoint` capability bit and notes on MCP media / degradation / output protection.
626
+ - `docs/{zh,en}/mcp.md` synced on the media transport and output protection rules for `call_mcp_tool` / `read_mcp_resource`.
627
+
628
+
629
+ ## [1.0.0-alpha.11] - 2026-10-20
630
+
631
+ ### 💥 Breaking Changes
632
+
633
+ - **`createCallMcpTool(mcpManager)` → `createCallMcpTool(mcpManager, env: ToolEnv)`** — the new `env` is used only to read `maxToolOutput`, and is passed in by `McpScopePlugin.instantiate` as `scope.env`. Downstream code calling this factory directly must add the second argument.
634
+
635
+ ### 🚀 New Features
636
+
637
+ - **`call_mcp_tool` output protection**: MCP tools are the channel most likely to spit out hundreds of KB or even several MB of JSON in one go, and previously it was returned completely raw. Now when the text portion exceeds `maxToolOutput` (default 32768 characters), the full text is written to disk as `result.txt` and only a warning plus a head/tail preview are returned (`outputTooLarge` / `chars` / `head` / `tail` / `files`). It reuses the same `outputGuard` skeleton and the same configuration rules as the built-in tools; no separate threshold.
638
+ - **Media content blocks are passed through as-is**: `image` → `image_url` (`data:<mimeType>;base64,...`), `audio` → `file` (`file_data`, inlined data URL), `resource.blob` routed by mimeType to `image_url` / `file`. Media **does not count toward the character count, is not written to disk, and is never dropped** — only text is protected.
639
+ - **Return shape**: text only → plain string (consistent with the past); contains media → content block array.
640
+
641
+ ### 🔧 Fixed
642
+
643
+ - **Non-text content blocks were silently dropped**: the old implementation only took `type === "text"`, so `image` / `audio` / `resource` / `resource_link` were all thrown away, leaving the model knowing only that "a block was not given to me". Now media is passed through, `resource.text` is merged into the body, `resource_link` becomes a `[resource_link] name · uri · mimeType` clue, and unknown types (such as `tool_use`) degrade to JSON text.
644
+ - **Content block order**: blocks are mapped strictly one by one in the original order of MCP `content[]`, so text sandwiched between images also keeps its position. When over the limit, a single warning block takes the place of the original **first** text block, the remaining text goes to disk, and media stays exactly where it was — even if text sits between two images, the correspondence between captions and images is not scrambled.
645
+ - **Threshold rule**: the limit is judged on the **total** character count of all text, not block by block (otherwise N segments of 30k characters each would all pass individually while together they could still flood the context).
646
+
647
+ ### ✅ Tests
648
+
649
+ - `mcpTools.test.ts` 38 cases (8 new for content block mapping, 4 for output protection, 4 for order preservation). Full suite **54 files / 542 cases** passing, `tsc --noEmit` and `build` with zero errors.
650
+
651
+ ### 📄 Docs
652
+
653
+ - `docs/sdk-design-v1.md` §9 on `call_mcp_tool` gained the content block mapping table, the output protection rules, and the folding rule that preserves order when over the limit; `../docs/{zh,en}/mcp.md` and the website mirror were synced.
654
+
655
+
656
+ ## [1.0.0-alpha.10] - 2026-10-20
657
+
658
+ ### 💥 Breaking Changes
659
+
660
+ - **`TaskMigrationService` → `HandoffService`, split into two layers, `handoff()` / `migrate()`** — "handoff" (writing a handoff document) and "migration" (handoff + starting a new session) used to be mixed into one method; now the concepts and the API map one-to-one:
661
+ - `handoff(params)`: stop work → verify → write the document → validate (fall back on failure). **Does not touch the session**;
662
+ - `migrate(params)`: after `handoff()`, clears history and injects the breakpoint message according to `strategy`.
663
+ - Types moved along: `MigrationContext` → `HandoffContext` (added `mode` / `requestedMode` / `handoffPath` / `migrating`), `TaskMigrationServiceOptions` → `HandoffServiceOptions` (added `handoffDir` / `mode` / `skillDirs` / `minHandoffBytes`).
664
+ - Hooks renamed: `onBeforeMigrate` → `onBeforeHandoff`; added `onHandoff` (after the document is written, before history is cleared).
665
+ - **Handoff documents are now written by "the original agent in its own session" (`mode: "self"`, the default)**, rather than by a separate standalone summary call. The old implementation serialized the history into `[role]: content` and handed it to a call with no tools and no context of the original session, so tool names and call arguments were all lost during serialization, and the writing side could not verify branches/changes/test status — it could only infer them — which was the root cause of the poor document quality. The `self` turn today: the original agent keeps its full context and tools and can `read` / `exec` / `git status` to verify before writing to disk.
666
+ - **`summary` (the old standalone summary) is kept as an escape mode**, and serves as the **one-way** fallback target when `self` fails (no `write` tool / file missing or too small (retry once) / tool or guard error). The reverse never happens — that would add one more full request at the moment the context is the fullest.
667
+ - **`AutoMigrateOptions` gained `resolveMode`**, moving "who performs the handoff" from plugin inheritance to a callback: it returns a `HandoffMode` or `null` (skip this migration). The CLI's `AutoMigrateConfirmPlugin` subclass therefore degrades into a pure callback.
668
+
669
+ ### 🚀 New Features
670
+
671
+ - **`HandoffGuardPlugin`**: a one-shot tool guard for the handoff turn. It only allows `write` to the handoff document (compared after normalizing to an absolute path) and rejects `edit` / `batch_edit` / `rm` / `rename` / `mkdir` / `copy`. A rejection returns a string (soft rejection) rather than throwing — a thrown error would be marked by core as Error + `isPreventDefault`, killing the whole handoff turn outright. The boundary is recorded honestly: it cannot stop `exec`; it lowers the probability of mistakes, it is not a sandbox.
672
+ - **`ContextGuardPlugin` gained `isSuspended` / `suspendedRatio`**: during the handoff turn (`service.busy`) the hard limit is relaxed from `× 1.5` to `× 2`, so the turn is neither killed by mistake nor left without the circuit breaker.
673
+ - **Factory Skill mechanism**: `ConfigManager.ensureFactorySkills()` releases / syncs `skills/handoff/SKILL.md` in `bootstrap()`. The overwrite policy mirrors `syncManagedModels` — frontmatter marked `metadata.custom: "true"` is treated as user-owned and never overwritten; otherwise it syncs with the version. The content is inlined as a string constant in `config/factory-skills.ts` (`tsc` compiles it directly, no need to bundle non-TS assets).
674
+ - **The single source of truth for the handoff template is now the Skill**: `HANDOFF_SECTIONS` / `createPrompt()` are removed, and the code keeps only "read the Skill → inject → validate the file → fall back to `FALLBACK_HANDOFF_TEMPLATE` when it cannot be read". The Skill only covers "how to write"; the code only covers "where to write and what capabilities are available" (this system has no template variable engine, and placeholders are not invented).
675
+ - `HandoffService.createHandoffFileName()` (`<YYYYMMDD-HHmmss>-<first 8 chars of session id>.md`), `createHandoffInstruction()`, `createPostMessages(handoffPath)` (the breakpoint **gives only the path**, which the receiving side `read`s).
676
+
677
+ ### 🔧 Fixed
678
+
679
+ - **Infinite recursion triggered by handoff**: the handoff turn is itself a `send()`, and its `onAfterSend` re-enters `AutoMigratePlugin`. It now yields on `service.busy` (`handoff()` / `migrate()` share one lock, which also rejects re-entry).
680
+ - **The handoff turn being triggered by itself / killed by the guard**: handoff happens exactly at the moment the context is the fullest. Besides yielding on `busy`, `agent.lastUsage` is cleared before the handoff turn starts (defense in depth) and cleared by the caller after migration (otherwise the guard would use the handoff turn's usage to kill the first message of the new session by mistake).
681
+
682
+ ### ✅ Tests
683
+
684
+ - Added `HandoffService.test.ts` (24 cases), `HandoffGuardPlugin.test.ts` (7 cases), `factory-skills.test.ts` (7 cases); rewrote `AutoMigratePlugin.test.ts`, `ContextGuardPlugin.test.ts` (added 4 `isSuspended` cases). The full suite of **54 files / 525 cases** passes, with zero errors from `tsc --noEmit` and `build`.
685
+
686
+ ### 📄 Docs
687
+
688
+ - `docs/sdk-design-v1.md` §18 rewritten as "Task handoff (HandoffService)" (two-layer semantics, Template as the single source of truth, two kinds of executor, three safeguards for self-handoff, the interface, breakpoint gives only the path); the §17 plugin chapter, the directory tree and the consumption examples were synced.
689
+ - `README.md` / `README.zh.md`, `../docs/{en,zh}/sdk.md`, `architecture.md`, `getting-started.md` and the website mirror synced.
690
+
691
+
3
692
  ## [1.0.0-alpha.9] - 2026-10-14
4
693
 
5
694
  ### ⚠️ Dependency
@@ -70,7 +759,7 @@
70
759
 
71
760
  ### 🔧 Fixed
72
761
 
73
- - **`generateImage` `model` parameter description no longer points at a host-CLI command** — the description used to read "配置中的图片模型可通过 'aiz config show' 查看" (the configured image models can be viewed via `aiz config show`). Since tool descriptions ship inside every request's `tools` payload, that hint propagated into **every layer** of the agent stack: the model would `exec("aiz config show")`, but the CLI resolves a bare `aiz config show` invocation as stdio mode with the instruction `config show` — i.e. a **brand-new agent** — whose own `generateImage` description repeats the very same hint, producing a self-referential recursion that keeps spawning nested agents. The parameter now reads "若指定的模型不存在,本工具会返回当前可用的模型列表" (if the specified model does not exist, this tool returns the list of currently available models), which matches the actual `!imageModel` branch in `call()` and stops the model from shelling out to the host CLI.
762
+ - **`generateImage` `model` parameter description no longer points at a host-CLI command** — the description used to read "the configured image models can be viewed via `aiz config show`". Since tool descriptions ship inside every request's `tools` payload, that hint propagated into **every layer** of the agent stack: the model would `exec("aiz config show")`, but the CLI resolves a bare `aiz config show` invocation as stdio mode with the instruction `config show` — i.e. a **brand-new agent** — whose own `generateImage` description repeats the very same hint, producing a self-referential recursion that keeps spawning nested agents. The parameter now reads "if the specified model does not exist, this tool returns the list of currently available models", which matches the actual `!imageModel` branch in `call()` and stops the model from shelling out to the host CLI.
74
763
 
75
764
  ### 📄 Docs
76
765
 
@@ -100,7 +789,7 @@
100
789
  - **Zhipu**: `glm-5.1` / `glm-5v-turbo` → `glm-5.3` / `glm-5.3-flash` / `glm-5.3-flashx`
101
790
  - **DeepSeek**: `deepseek-v4-pro` / `deepseek-v4-flash` / `deepseek-v4-flash-vision-exp` → `deepseek-flash`. The two V4-Flash variants were retired by the vendor, and V4-Pro requests are routed to V4.1-Flash.
102
791
  - Defaults: `defaultModel` / `defaultMigrationModel` move from `deepseek-v4-flash` to `deepseek-flash`.
103
- - **`Model.maxContextTokens` semantics clarified — it is the task-migration (handoff) trigger threshold, not the model context window** — `AutoMigratePlugin` does not estimate or learn: it only compares `usage.prompt_tokens` from the API response against this value. The previous comment read "上下文窗口 token 上限" ("context window token limit"), which is why values had been filled in with raw window sizes. Values are now ~25% of the real window (250K for ≥1M-window models), except `glm-4.7-flash` (200K window) which uses 100K.
792
+ - **`Model.maxContextTokens` semantics clarified — it is the task-migration (handoff) trigger threshold, not the model context window** — `AutoMigratePlugin` does not estimate or learn: it only compares `usage.prompt_tokens` from the API response against this value. The previous comment read "context window token limit", which is why values had been filled in with raw window sizes. Values are now ~25% of the real window (250K for ≥1M-window models), except `glm-4.7-flash` (200K window) which uses 100K.
104
793
 
105
794
  ### 🚀 New Features
106
795