universal-llm-client 4.2.0 → 4.5.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 (108) hide show
  1. package/CHANGELOG.md +142 -103
  2. package/LICENSE +21 -21
  3. package/README.md +640 -591
  4. package/dist/ai-model.d.ts +12 -1
  5. package/dist/ai-model.d.ts.map +1 -1
  6. package/dist/ai-model.js +36 -1
  7. package/dist/ai-model.js.map +1 -1
  8. package/dist/gemma-channel.d.ts +14 -0
  9. package/dist/gemma-channel.d.ts.map +1 -0
  10. package/dist/gemma-channel.js +38 -0
  11. package/dist/gemma-channel.js.map +1 -0
  12. package/dist/gemma-diffusion.d.ts +49 -0
  13. package/dist/gemma-diffusion.d.ts.map +1 -0
  14. package/dist/gemma-diffusion.js +147 -0
  15. package/dist/gemma-diffusion.js.map +1 -0
  16. package/dist/http.d.ts +4 -0
  17. package/dist/http.d.ts.map +1 -1
  18. package/dist/http.js +14 -1
  19. package/dist/http.js.map +1 -1
  20. package/dist/index.d.ts +2 -1
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/index.js +4 -0
  23. package/dist/index.js.map +1 -1
  24. package/dist/interfaces.d.ts +183 -7
  25. package/dist/interfaces.d.ts.map +1 -1
  26. package/dist/interfaces.js.map +1 -1
  27. package/dist/providers/anthropic.d.ts.map +1 -1
  28. package/dist/providers/anthropic.js +28 -3
  29. package/dist/providers/anthropic.js.map +1 -1
  30. package/dist/providers/google.d.ts +22 -1
  31. package/dist/providers/google.d.ts.map +1 -1
  32. package/dist/providers/google.js +225 -13
  33. package/dist/providers/google.js.map +1 -1
  34. package/dist/providers/ollama.d.ts +2 -0
  35. package/dist/providers/ollama.d.ts.map +1 -1
  36. package/dist/providers/ollama.js +59 -30
  37. package/dist/providers/ollama.js.map +1 -1
  38. package/dist/providers/openai.d.ts +14 -0
  39. package/dist/providers/openai.d.ts.map +1 -1
  40. package/dist/providers/openai.js +200 -22
  41. package/dist/providers/openai.js.map +1 -1
  42. package/dist/router.d.ts +2 -0
  43. package/dist/router.d.ts.map +1 -1
  44. package/dist/router.js +4 -0
  45. package/dist/router.js.map +1 -1
  46. package/dist/stream-decoder.d.ts +12 -0
  47. package/dist/stream-decoder.d.ts.map +1 -1
  48. package/dist/stream-decoder.js +182 -5
  49. package/dist/stream-decoder.js.map +1 -1
  50. package/dist/thinking.d.ts +36 -0
  51. package/dist/thinking.d.ts.map +1 -0
  52. package/dist/thinking.js +52 -0
  53. package/dist/thinking.js.map +1 -0
  54. package/package.json +118 -116
  55. package/src/ai-model.ts +400 -350
  56. package/src/auditor.ts +213 -213
  57. package/src/client.ts +402 -402
  58. package/src/debug/debug-google-streaming.ts +1 -1
  59. package/src/demos/basic/universal-llm-examples.ts +3 -3
  60. package/src/demos/diffusion-gemma/.env +29 -0
  61. package/src/demos/diffusion-gemma/.env.example +27 -0
  62. package/src/demos/diffusion-gemma/CLAUDE.md +95 -0
  63. package/src/demos/diffusion-gemma/README.md +59 -0
  64. package/src/demos/diffusion-gemma/canvas.ts +1606 -0
  65. package/src/demos/diffusion-gemma/docker-compose.yml +29 -0
  66. package/src/demos/diffusion-gemma/probe-stream.ts +51 -0
  67. package/src/demos/diffusion-gemma/probe-tools.ts +55 -0
  68. package/src/demos/diffusion-gemma/server.ts +1205 -0
  69. package/src/demos/diffusion-gemma/start-vllm.sh +98 -0
  70. package/src/gemma-channel.ts +47 -0
  71. package/src/gemma-diffusion.ts +167 -0
  72. package/src/http.ts +261 -247
  73. package/src/index.ts +180 -161
  74. package/src/interfaces.ts +843 -657
  75. package/src/mcp.ts +345 -345
  76. package/src/providers/anthropic.ts +796 -762
  77. package/src/providers/google.ts +840 -620
  78. package/src/providers/index.ts +8 -8
  79. package/src/providers/ollama.ts +503 -469
  80. package/src/providers/openai.ts +587 -392
  81. package/src/router.ts +785 -780
  82. package/src/stream-decoder.ts +535 -361
  83. package/src/structured-output.ts +759 -759
  84. package/src/test-scripts/test-google-deep-research.ts +33 -0
  85. package/src/test-scripts/test-google-streaming-enhanced.ts +147 -147
  86. package/src/test-scripts/test-google-streaming.ts +1 -1
  87. package/src/test-scripts/test-google-system-prompt-comprehensive.ts +189 -189
  88. package/src/test-scripts/test-google-thinking.ts +46 -0
  89. package/src/test-scripts/test-system-message-positions.ts +163 -163
  90. package/src/test-scripts/test-system-prompt-improvement-demo.ts +83 -83
  91. package/src/test-scripts/test-vllm-qwen36.ts +256 -0
  92. package/src/tests/ai-model.test.ts +1614 -1614
  93. package/src/tests/auditor.test.ts +224 -224
  94. package/src/tests/gemma-diffusion.test.ts +115 -0
  95. package/src/tests/http.test.ts +200 -200
  96. package/src/tests/interfaces.test.ts +117 -117
  97. package/src/tests/providers/anthropic.test.ts +118 -0
  98. package/src/tests/providers/google.test.ts +841 -660
  99. package/src/tests/providers/ollama.test.ts +1034 -954
  100. package/src/tests/providers/openai.test.ts +1511 -1122
  101. package/src/tests/router.test.ts +254 -254
  102. package/src/tests/stream-decoder.test.ts +263 -179
  103. package/src/tests/structured-output.test.ts +1450 -1450
  104. package/src/tests/thinking.test.ts +65 -0
  105. package/src/tests/tools.test.ts +175 -175
  106. package/src/thinking.ts +73 -0
  107. package/src/tools.ts +246 -246
  108. package/src/zod-adapter.ts +72 -72
package/CHANGELOG.md CHANGED
@@ -1,103 +1,142 @@
1
- # Changelog
2
-
3
- All notable changes to this project will be documented in this file.
4
-
5
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
- and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
-
8
- ## [4.0.0] - 2026-03-13
9
-
10
- ### ⚠ BREAKING CHANGES
11
-
12
- - **Zod 4 required** — `zod@^4.0.0` is now a peer dependency (upgraded from Zod 3). Consumers must install `zod@^4.0.0`.
13
- - **Zero-dependency core** — Removed `zod-to-json-schema` from dependencies. Schema conversion now uses Zod 4's native `z.toJSONSchema()`. The library has no runtime dependencies (only peer deps).
14
-
15
- ### Added
16
-
17
- - **Structured Output** First-class structured output with Zod schema validation
18
- - `generateStructured(schema, messages, options)` returns typed, validated output
19
- - `tryParseStructured(schema, messages, options)` non-throwing variant returning `Result<T>`
20
- - `generateStructuredStream(schema, messages, options)` streaming with partial validated objects
21
- - `chat(messages, { output: { schema } })` structured output via `output` parameter on `chat()`
22
- - Custom `StructuredOutputError` with `rawOutput` and `cause` for debuggability
23
- - **Provider Structured Output Support** Native format negotiation per provider
24
- - OpenAI: `response_format: { type: 'json_schema' }` with configurable `strict` mode
25
- - Google/Vertex AI: `responseMimeType` + `responseSchema` with automatic unsupported feature stripping
26
- - Ollama: `format` parameter with JSON Schema objects
27
- - **Streaming JSON Parser** — `StreamingJsonParser` for progressive partial object validation
28
- - **Audit Events** — `structured_request`, `structured_response`, `structured_validation_error` events
29
- - **Schema Utilities** — `zodToJsonSchema()`, `normalizeJsonSchema()`, `stripUnsupportedFeatures()`, `getJsonSchema()`
30
- - **`./structured-output` sub-path export** — Direct import of structured output utilities
31
-
32
- ### Fixed
33
-
34
- - Validation logic deduplicated into `BaseLLMClient` (was copy-pasted across 3 providers)
35
- - Removed double validation (Router + Provider both validated the same response)
36
- - Audit events no longer log `"assistant"` as the model name
37
- - `chatStream()` now throws a clear error if `output` parameter is provided (use `generateStructuredStream()`)
38
- - `zodToJsonSchema()` preserves `definitions`/`$defs` when `$ref` references exist in the schema tree
39
- - OpenAI `strict` mode is now configurable via `output.strict` (defaults to `true`)
40
-
41
- ### Deprecated
42
-
43
- - `ChatOptions.schema`, `.jsonSchema`, `.schemaName`, `.schemaDescription` — use `output` parameter or `generateStructured()` instead
44
-
45
- ---
46
-
47
- ## [3.1.0] - 2026-03-12
48
-
49
- ### Added
50
-
51
- - **Ollama Vision/Multimodal** — Ollama provider now converts OpenAI-style multimodal content (text + image parts) into Ollama's native `images[]` format
52
- - Supports base64 data URLs, raw base64 strings, and gracefully skips HTTP URLs
53
- - Multiple images and mixed text+image messages handled correctly
54
- - **CHANGELOG.md** — Added changelog following [Keep a Changelog](https://keepachangelog.com/) format
55
- - **Ollama Provider Tests** — 13 new unit tests covering vision, tool call arguments, options mapping, and response normalization
56
-
57
- ### Fixed
58
-
59
- - Architecture section in README referenced `@akaito/universal-llm-client` instead of the correct unscoped package name
60
- - LlamaCpp missing from the README architecture tree despite being a supported provider
61
- - `@module` JSDoc in barrel export referenced wrong scoped name
62
-
63
- ### Changed
64
-
65
- - Added `author`, `homepage`, `bugs` fields to `package.json`
66
- - Updated LICENSE copyright year to 2025-2026
67
- - Improved `.npmignore` to exclude dev-only files from tarball
68
-
69
- ---
70
-
71
- ## [3.0.0] - 2026-03-12
72
-
73
- ### BREAKING CHANGES
74
-
75
- - Complete rewrite with a new modular architecture
76
- - `AIModel` is now the sole public-facing class (replaces direct provider instantiation)
77
- - Provider configuration moved to a declarative `providers[]` array
78
- - Minimum runtime: Node.js 22+, Bun 1.0+
79
-
80
- ### Added
81
-
82
- - **Transparent Failover** Priority-ordered provider chain with retries, health tracking, and configurable cooldowns
83
- - **Streaming** — First-class async generator streaming with pluggable decoder strategies (passthrough, standard chat, interleaved reasoning)
84
- - **Tool Calling** — Register tools once, works across all providers. Autonomous multi-turn execution loop via `chatWithTools()`
85
- - **Tool Utilities** — `ToolBuilder` (fluent API), `ToolExecutor` (timeout, validation, safe wrappers, composition)
86
- - **Reasoning/Thinking** Native `<think>` tag parsing, model thinking mode, and interleaved reasoning support
87
- - **Observability** — Built-in `Auditor` interface with `ConsoleAuditor`, `BufferedAuditor`, and `NoopAuditor` implementations
88
- - **MCP Integration** — `MCPToolBridge` for bridging MCP servers to LLM tools with zero glue code
89
- - **Multimodal/Vision** — `multimodalMessage()`, `imageContent()`, `textContent()` helpers; vision support across Google, OpenAI, and Ollama providers
90
- - **Embeddings** — Single (`embed()`) and batch (`embedArray()`) embedding generation
91
- - **Model Discovery** `getModels()` and `getModelInfo()` for runtime model introspection
92
- - **Gemini 3.x Support** `thoughtSignature` handling for multi-turn function calling
93
- - **Provider Support** — Ollama, OpenAI (+ OpenRouter, Groq, LM Studio, vLLM), Google AI Studio, Vertex AI, LlamaCpp
94
-
95
- ### Changed
96
-
97
- - Zero runtime dependencies — core library uses only native `fetch`
98
- - ESM-only distribution (no CJS bundle)
99
- - Full TypeScript strict mode with declaration maps and source maps
100
-
101
- ## [2.x] - Pre-rewrite
102
-
103
- Legacy versions with direct provider APIs. Not documented here — see git history for details.
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [4.5.0] - 2026-06-14
9
+
10
+ ### Added
11
+
12
+ - **Server-side reasoning field support (OpenAI-compatible provider)** — Reasoning models served over the OpenAI-compatible API (vLLM `--reasoning-parser`, DeepSeek-R1, etc.) return their chain-of-thought in a dedicated `reasoning_content` (vLLM) / `reasoning` (some gateways) field instead of inline `<think>` tags. The OpenAI provider now surfaces it:
13
+ - `chat()` populates `LLMChatResponse.reasoning` from `message.reasoning_content` / `message.reasoning`, keeping `message.content` clean
14
+ - `chatStream()` emits `delta.reasoning_content` / `delta.reasoning` chunks as `thinking` stream events and accumulates them into the final `reasoning`
15
+ - Inline `<think>` parsing (via `StandardChatDecoder`) is preserved as a fallback for servers run without a reasoning parser
16
+ - `OpenAIResponse` message type extended with optional `reasoning` / `reasoning_content`
17
+ - Verified end-to-end against vLLM serving `nvidia/Qwen3.6-35B-A3B-NVFP4` (NVFP4) on Blackwell — reasoning, streaming `thinking` events, tool calling (`qwen3_xml`), and structured output all pass
18
+ - **Unified `thinking` flag with levels across all providers** — `thinking` (model config) and per-call `ChatOptions.thinking` accept `true`/`false` **or a level `'minimal' | 'low' | 'medium' | 'high'`** (new `ThinkingLevel` type), mapped to each backend's native control so apps switch providers without reasoning-specific code. A shared `resolveThinking` helper (`src/thinking.ts`) normalizes the value; each provider maps it:
19
+ - **OpenAI-compatible** → OpenAI reasoning models (o-series / GPT-5, by name) get `reasoning_effort:<level>`; vLLM / Qwen get `chat_template_kwargs.enable_thinking`. Emitted only when explicitly set.
20
+ - **Google / Gemini** → Gemini 3.x `thinkingConfig.thinkingLevel`; Gemini 2.5/2.0 `thinkingBudget` (level→budget map, `0` off, `-1` dynamic). `includeThoughts` enabled when thinking is on.
21
+ - **Anthropic** extended thinking `budget_tokens` from the level (kept `< max_tokens`; temperature omitted, per API).
22
+ - **Ollama** `think` on/off (no native levels).
23
+ - Per-call overrides model config everywhere. Verified live against vLLM (Qwen3.6-NVFP4) and **Gemini 3.5 Flash** (levels produce distinct reasoning-token counts); unit-tested per provider + `resolveThinking`.
24
+ - **Gemini reasoning text surfaced** — with thinking on, the Google provider sets `includeThoughts:true` and routes `thought:true` parts into `response.reasoning` (non-streaming) and live `thinking` stream events, matching how Qwen/Anthropic expose chain-of-thought (previously only `reasoningTokens` was reported). Verified live on `gemini-3.5-flash` (654–976 chars of reasoning across levels).
25
+ - **Gemini Deep Research API** — new Google-only `AIModel.deepResearch(input, opts)` (creates a `/v1beta/interactions` background interaction and polls to completion → `{ id, status, report, steps }`) and `AIModel.deepResearchStream(input, opts)` (live `thought`/`text`/`status` events). New `DeepResearchOptions`/`DeepResearchResult`/`DeepResearchStep`/`DeepResearchEvent` types. Throws a clear error if no Google provider is configured. Create + poll plumbing verified live.
26
+ - **Generation stats — `usage.durationMs` and `usage.tokensPerSecond`** — decode throughput is now reported on `LLMChatResponse.usage`: server-precise for Ollama (from `eval_count` / `eval_duration`, which were previously discarded), and client-measured wall-clock for OpenAI-compatible / vLLM (which return no timing in `usage`). `OllamaResponse` gained `total_duration` / `load_duration` typings.
27
+ - **OpenAI-compatible transport flexibility** — `ProviderConfig` gains `headers`, `queryParams`, `authHeader`, `authPrefix`, and `apiBasePath` for Azure OpenAI, custom gateways, and non-`/v1` servers (no custom code needed). Honored by the OpenAI-compatible provider (`headers`/`authHeader`/`authPrefix` also by Ollama, via `buildHeaders`); a `buildUrl` helper applies `queryParams`/`apiBasePath` across all endpoints and preserves any query string already on the base URL. Includes a 2026 provider-API-landscape research doc (`docs/research/`).
28
+
29
+ ### Fixed
30
+
31
+ - **README** — the tool-execution trace field is `response.toolExecutions` (array of `{ tool_call_id, output, error?, duration? }`), not `toolTrace`; corrected the `chatWithTools` example.
32
+
33
+ ## [4.4.0] - 2026-06-11
34
+
35
+ ### Added
36
+
37
+ - **Diffusion LM support (DiffusionGemma family)** First-class client-side protocol for diffusion language models served by OpenAI-compatible endpoints that ship without server-side reasoning or tool-call parsers (e.g. current vLLM diffusion builds, which reject request-level `tools` with auto tool choice):
38
+ - `gemma-diffusion.ts` model detection (`isGemmaDiffusionModel`), native channel parsing (`<|channel>thought … <channel|>` reasoning, `<|tool_call>call:name{…}<tool_call|>` tool calls), and pseudo-JSON argument conversion (`gemmaArgsToJson`: `<|"|>` quote tokens, bare keys, nested objects/arrays)
39
+ - OpenAI provider native mode (auto-detected from the model name, `gemmaNativeProtocol` option to override): sends `skip_special_tokens: false` and `tools` + `tool_choice: "none"` (declarations still render into the chat template), parses reasoning and tool calls client-side, and yields decoder-classified `thinking`/`text` streaming events
40
+ - Full agentic `chatWithTools` loop works end-to-end against DiffusionGemma; history tool turns use standard structured `tool_calls` + `role: "tool"` messages
41
+ - **"Signal from Noise" demo** (`src/demos/diffusion-gemma/`) — vLLM test harness plus a diffusion chat canvas that animates block-parallel denoising paced by real block arrivals, with replay/scrubbing, reasoning-channel separation, a rendered-markdown reading view, and an engine-reload entropy control
42
+
43
+ ### Fixed
44
+
45
+ - Stray unbalanced `<channel|>` / `<turn|>` markers emitted by diffusion models are stripped from parsed content
46
+
47
+ ## [4.0.0] - 2026-03-13
48
+
49
+ ### ⚠ BREAKING CHANGES
50
+
51
+ - **Zod 4 required** — `zod@^4.0.0` is now a peer dependency (upgraded from Zod 3). Consumers must install `zod@^4.0.0`.
52
+ - **Zero-dependency core** Removed `zod-to-json-schema` from dependencies. Schema conversion now uses Zod 4's native `z.toJSONSchema()`. The library has no runtime dependencies (only peer deps).
53
+
54
+ ### Added
55
+
56
+ - **Structured Output** — First-class structured output with Zod schema validation
57
+ - `generateStructured(schema, messages, options)` — returns typed, validated output
58
+ - `tryParseStructured(schema, messages, options)` — non-throwing variant returning `Result<T>`
59
+ - `generateStructuredStream(schema, messages, options)` streaming with partial validated objects
60
+ - `chat(messages, { output: { schema } })` structured output via `output` parameter on `chat()`
61
+ - Custom `StructuredOutputError` with `rawOutput` and `cause` for debuggability
62
+ - **Provider Structured Output Support** — Native format negotiation per provider
63
+ - OpenAI: `response_format: { type: 'json_schema' }` with configurable `strict` mode
64
+ - Google/Vertex AI: `responseMimeType` + `responseSchema` with automatic unsupported feature stripping
65
+ - Ollama: `format` parameter with JSON Schema objects
66
+ - **Streaming JSON Parser** `StreamingJsonParser` for progressive partial object validation
67
+ - **Audit Events** `structured_request`, `structured_response`, `structured_validation_error` events
68
+ - **Schema Utilities** — `zodToJsonSchema()`, `normalizeJsonSchema()`, `stripUnsupportedFeatures()`, `getJsonSchema()`
69
+ - **`./structured-output` sub-path export** — Direct import of structured output utilities
70
+
71
+ ### Fixed
72
+
73
+ - Validation logic deduplicated into `BaseLLMClient` (was copy-pasted across 3 providers)
74
+ - Removed double validation (Router + Provider both validated the same response)
75
+ - Audit events no longer log `"assistant"` as the model name
76
+ - `chatStream()` now throws a clear error if `output` parameter is provided (use `generateStructuredStream()`)
77
+ - `zodToJsonSchema()` preserves `definitions`/`$defs` when `$ref` references exist in the schema tree
78
+ - OpenAI `strict` mode is now configurable via `output.strict` (defaults to `true`)
79
+
80
+ ### Deprecated
81
+
82
+ - `ChatOptions.schema`, `.jsonSchema`, `.schemaName`, `.schemaDescription` use `output` parameter or `generateStructured()` instead
83
+
84
+ ---
85
+
86
+ ## [3.1.0] - 2026-03-12
87
+
88
+ ### Added
89
+
90
+ - **Ollama Vision/Multimodal** — Ollama provider now converts OpenAI-style multimodal content (text + image parts) into Ollama's native `images[]` format
91
+ - Supports base64 data URLs, raw base64 strings, and gracefully skips HTTP URLs
92
+ - Multiple images and mixed text+image messages handled correctly
93
+ - **CHANGELOG.md** — Added changelog following [Keep a Changelog](https://keepachangelog.com/) format
94
+ - **Ollama Provider Tests** — 13 new unit tests covering vision, tool call arguments, options mapping, and response normalization
95
+
96
+ ### Fixed
97
+
98
+ - Architecture section in README referenced `@akaito/universal-llm-client` instead of the correct unscoped package name
99
+ - LlamaCpp missing from the README architecture tree despite being a supported provider
100
+ - `@module` JSDoc in barrel export referenced wrong scoped name
101
+
102
+ ### Changed
103
+
104
+ - Added `author`, `homepage`, `bugs` fields to `package.json`
105
+ - Updated LICENSE copyright year to 2025-2026
106
+ - Improved `.npmignore` to exclude dev-only files from tarball
107
+
108
+ ---
109
+
110
+ ## [3.0.0] - 2026-03-12
111
+
112
+ ### ⚠ BREAKING CHANGES
113
+
114
+ - Complete rewrite with a new modular architecture
115
+ - `AIModel` is now the sole public-facing class (replaces direct provider instantiation)
116
+ - Provider configuration moved to a declarative `providers[]` array
117
+ - Minimum runtime: Node.js 22+, Bun 1.0+
118
+
119
+ ### Added
120
+
121
+ - **Transparent Failover** — Priority-ordered provider chain with retries, health tracking, and configurable cooldowns
122
+ - **Streaming** — First-class async generator streaming with pluggable decoder strategies (passthrough, standard chat, interleaved reasoning)
123
+ - **Tool Calling** — Register tools once, works across all providers. Autonomous multi-turn execution loop via `chatWithTools()`
124
+ - **Tool Utilities** — `ToolBuilder` (fluent API), `ToolExecutor` (timeout, validation, safe wrappers, composition)
125
+ - **Reasoning/Thinking** — Native `<think>` tag parsing, model thinking mode, and interleaved reasoning support
126
+ - **Observability** — Built-in `Auditor` interface with `ConsoleAuditor`, `BufferedAuditor`, and `NoopAuditor` implementations
127
+ - **MCP Integration** — `MCPToolBridge` for bridging MCP servers to LLM tools with zero glue code
128
+ - **Multimodal/Vision** — `multimodalMessage()`, `imageContent()`, `textContent()` helpers; vision support across Google, OpenAI, and Ollama providers
129
+ - **Embeddings** — Single (`embed()`) and batch (`embedArray()`) embedding generation
130
+ - **Model Discovery** — `getModels()` and `getModelInfo()` for runtime model introspection
131
+ - **Gemini 3.x Support** — `thoughtSignature` handling for multi-turn function calling
132
+ - **Provider Support** — Ollama, OpenAI (+ OpenRouter, Groq, LM Studio, vLLM), Google AI Studio, Vertex AI, LlamaCpp
133
+
134
+ ### Changed
135
+
136
+ - Zero runtime dependencies — core library uses only native `fetch`
137
+ - ESM-only distribution (no CJS bundle)
138
+ - Full TypeScript strict mode with declaration maps and source maps
139
+
140
+ ## [2.x] - Pre-rewrite
141
+
142
+ Legacy versions with direct provider APIs. Not documented here — see git history for details.
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2025-2026 Igor Lins e Silva
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2025-2026 Igor Lins e Silva
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.