@notic/agent-engine 1.2.0 → 2.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 (43) hide show
  1. package/CHANGELOG.md +51 -17
  2. package/README.md +434 -409
  3. package/dist/adapter/AnthropicAdapter.js +2 -2
  4. package/dist/adapter/GeminiAdapter.js +2 -2
  5. package/dist/adapter/OpenAIAdapter.js +2 -2
  6. package/dist/adapter/OpenAIResponsesAdapter.js +2 -2
  7. package/dist/agent/Agent.d.ts +12 -0
  8. package/dist/agent/Agent.d.ts.map +1 -1
  9. package/dist/agent/Agent.js +45 -4
  10. package/dist/agent/Agent.js.map +1 -1
  11. package/dist/index.d.ts +3 -3
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.js +3 -3
  14. package/dist/index.js.map +1 -1
  15. package/dist/media/BrowserMediaResolver.d.ts +14 -0
  16. package/dist/media/BrowserMediaResolver.d.ts.map +1 -0
  17. package/dist/media/BrowserMediaResolver.js +52 -0
  18. package/dist/media/BrowserMediaResolver.js.map +1 -0
  19. package/dist/media/index.d.ts +1 -0
  20. package/dist/media/index.d.ts.map +1 -1
  21. package/dist/media/index.js +3 -1
  22. package/dist/media/index.js.map +1 -1
  23. package/dist/message/Message.d.ts +16 -2
  24. package/dist/message/Message.d.ts.map +1 -1
  25. package/dist/message/Message.js +50 -10
  26. package/dist/message/Message.js.map +1 -1
  27. package/dist/node.d.ts +3 -0
  28. package/dist/node.d.ts.map +1 -0
  29. package/dist/node.js +6 -0
  30. package/dist/node.js.map +1 -0
  31. package/dist/prompt/PromptBuilder.d.ts +10 -2
  32. package/dist/prompt/PromptBuilder.d.ts.map +1 -1
  33. package/dist/prompt/PromptBuilder.js +14 -5
  34. package/dist/prompt/PromptBuilder.js.map +1 -1
  35. package/dist/stream/StreamEvent.d.ts +13 -1
  36. package/dist/stream/StreamEvent.d.ts.map +1 -1
  37. package/dist/stream/StreamEvent.js +2 -0
  38. package/dist/stream/StreamEvent.js.map +1 -1
  39. package/dist/stream/index.d.ts +1 -1
  40. package/dist/stream/index.d.ts.map +1 -1
  41. package/dist/stream/index.js.map +1 -1
  42. package/docs/API.md +1698 -1642
  43. package/package.json +37 -30
package/CHANGELOG.md CHANGED
@@ -1,26 +1,60 @@
1
1
  # Changelog
2
2
 
3
- ## 1.2.0 - 2026-06-11
3
+ ## 2.1.0 - 2026-06-19
4
4
 
5
5
  ### Added
6
6
 
7
- - Low-coupling Provider architecture composed from `ModelClient`, `MessageAdapter`, and `MessageStreamParser`.
8
- - Native presets for OpenAI Responses, Anthropic Messages, and Gemini, alongside OpenAI-compatible Chat Completions.
9
- - Non-streaming Agent requests through `agent.run(..., { stream: false })` and `runRaw()`.
10
- - Complete-response transport support through optional `ModelClient.complete()`.
11
- - Provider capability inspection through `provider.supportsComplete`.
12
- - Native stream parsers for OpenAI Responses, Anthropic, and Gemini.
13
- - Protocol-preserving reasoning and function-call state for multi-turn tool execution.
7
+ - `Message.isEmpty` and `Message.pruneEmpty()` for shared empty-message handling.
8
+ - `PromptBuilder` support for using empty messages as anchors while dropping them from the final context by default.
9
+ - `dropEmptyMessages: false` build option for debugging or custom context pipelines that need to retain empty messages.
14
10
 
15
- ### Improved
11
+ ### Changed
16
12
 
17
- - Tool approval, interruption, recovery, parser errors, and partial-message handling.
18
- - Provider-specific request option mapping, usage parsing, thinking signatures, and multimodal serialization.
19
- - Session and Message mutation consistency, tool error handling, exports, tests, and package subpaths.
20
- - README and API documentation for Provider configuration and streaming modes.
13
+ - `Message.getHistory(true)` now preserves an empty system root instead of silently omitting it.
14
+ - `Agent` prunes empty messages at the model request boundary, including `runRaw()`, so incompatible providers do not receive empty messages.
15
+ - API documentation now describes empty-root history behavior and PromptBuilder empty-message cleanup.
21
16
 
22
- ### Compatibility
17
+ ## 2.0.0 - 2026-06-11
23
18
 
24
- - Existing OpenAI-compatible `client` initialization remains supported.
25
- - Existing custom `ModelClient` implementations that only provide `stream()` remain valid.
26
- - Streaming remains the default behavior.
19
+ ### Added
20
+
21
+ - `agent.generate()` for generating from the current Session without appending a User message.
22
+ - Awaitable `BEFORE_ASSISTANT_COMMIT` lifecycle handlers before Session persistence.
23
+ - `agent.emitAsync()` for ordered, error-propagating asynchronous events.
24
+ - Safe `Message.setText()` and `Message.setParts()` mutation APIs.
25
+ - Browser-safe `BrowserMediaResolver` and an explicit `@notic/agent-engine/node` media subpath.
26
+ - Browser bundling and package export smoke tests.
27
+
28
+ ### Changed
29
+
30
+ - Built-in adapters now default to `BrowserMediaResolver` so the package root contains no Node.js builtin imports.
31
+ - Local file media resolution now requires `DefaultMediaResolver` from `@notic/agent-engine/node` or a custom resolver.
32
+
33
+ ### Breaking
34
+
35
+ - `DefaultMediaResolver` is no longer exported from the package root. Import it from `@notic/agent-engine/node` in Node.js applications.
36
+
37
+ ## 1.2.0 - 2026-06-11
38
+
39
+ ### Added
40
+
41
+ - Low-coupling Provider architecture composed from `ModelClient`, `MessageAdapter`, and `MessageStreamParser`.
42
+ - Native presets for OpenAI Responses, Anthropic Messages, and Gemini, alongside OpenAI-compatible Chat Completions.
43
+ - Non-streaming Agent requests through `agent.run(..., { stream: false })` and `runRaw()`.
44
+ - Complete-response transport support through optional `ModelClient.complete()`.
45
+ - Provider capability inspection through `provider.supportsComplete`.
46
+ - Native stream parsers for OpenAI Responses, Anthropic, and Gemini.
47
+ - Protocol-preserving reasoning and function-call state for multi-turn tool execution.
48
+
49
+ ### Improved
50
+
51
+ - Tool approval, interruption, recovery, parser errors, and partial-message handling.
52
+ - Provider-specific request option mapping, usage parsing, thinking signatures, and multimodal serialization.
53
+ - Session and Message mutation consistency, tool error handling, exports, tests, and package subpaths.
54
+ - README and API documentation for Provider configuration and streaming modes.
55
+
56
+ ### Compatibility
57
+
58
+ - Existing OpenAI-compatible `client` initialization remains supported.
59
+ - Existing custom `ModelClient` implementations that only provide `stream()` remain valid.
60
+ - Streaming remains the default behavior.