@hilbras/sdk 0.19.0 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<p align="center">
|
|
2
|
-
<img src="https://img.shields.io/badge/version-0.
|
|
2
|
+
<img src="https://img.shields.io/badge/version-0.20.0-blue" alt="version">
|
|
3
3
|
<img src="https://img.shields.io/badge/license-MIT-green" alt="license">
|
|
4
4
|
<img src="https://img.shields.io/badge/node-%3E%3D18-brightgreen" alt="node">
|
|
5
5
|
<img src="https://img.shields.io/badge/types-strict-blueviolet" alt="types">
|
|
6
|
-
<img src="https://img.shields.io/badge/tests-
|
|
6
|
+
<img src="https://img.shields.io/badge/tests-1278%20passing-brightgreen" alt="tests">
|
|
7
7
|
<img src="https://img.shields.io/badge/runtime%20deps-zero-brightgreen" alt="zero deps">
|
|
8
8
|
</p>
|
|
9
9
|
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
<p align="center">
|
|
13
13
|
<strong>Provider-agnostic AI execution engine for TypeScript.</strong><br>
|
|
14
|
-
Streaming, tool calling, structured output, circuit breaker, retry, reasoning normalization, cost enforcement, and SSRF-safe provider registration — for OpenAI, Anthropic, Gemini, Azure, Groq, and
|
|
14
|
+
Streaming, tool calling, structured output, circuit breaker, retry, reasoning normalization, cost enforcement, and SSRF-safe provider registration — for OpenAI, Anthropic, Gemini, Azure, Groq, Ollama, Bedrock, Vertex AI, HuggingFace, Deepgram, ElevenLabs, Voyage AI, and Cohere Rerank. Zero runtime dependencies.
|
|
15
15
|
</p>
|
|
16
16
|
|
|
17
17
|
---
|
|
@@ -97,10 +97,10 @@ const reply = await client.complete({
|
|
|
97
97
|
|
|
98
98
|
| Feature | Summary | Docs |
|
|
99
99
|
|---|---|---|
|
|
100
|
-
| **Provider abstraction** |
|
|
100
|
+
| **Provider abstraction** | 23 adapters (OpenAI, Anthropic, Gemini, Azure, Groq, Ollama, Bedrock, Vertex AI, HuggingFace, Deepgram, ElevenLabs, Voyage AI, Cohere Rerank) | [Providers](docs/providers.md) |
|
|
101
101
|
| **Streaming** | Async iteration over text/reasoning/tool-call/usage/finish chunks | [Getting Started](docs/getting-started.md#streaming) |
|
|
102
102
|
| **Tool calling** | Native function calling + text-embedded `<tool_call>` markup | [Getting Started](docs/getting-started.md#tool-calling) |
|
|
103
|
-
| **Structured output** |
|
|
103
|
+
| **Structured output** | Schema validation with automatic JSON repair | [API Reference](docs/api-reference.md) |
|
|
104
104
|
| **Model routing** | Pick the best model across providers by task, cost, capabilities | [API Reference](docs/api-reference.md#model-router) |
|
|
105
105
|
| **Circuit breaker** | Per-provider failure isolation with half-open recovery | [API Reference](docs/api-reference.md#reliability) |
|
|
106
106
|
| **Retry & backoff** | Exponential backoff with jitter for 429/5xx/network errors | [API Reference](docs/api-reference.md#reliability) |
|
|
@@ -109,6 +109,13 @@ const reply = await client.complete({
|
|
|
109
109
|
| **SSRF safety** | Default-reject `http://`, block AWS metadata, opt-in for local Ollama | [Security](docs/security.md) |
|
|
110
110
|
| **Error redaction** | API keys auto-redacted from provider error bodies | [Security](docs/security.md#error-redaction-in-provider-responses) |
|
|
111
111
|
| **Reasoning normalization** | Detect & normalize `<thinking>` / `<reasoning>` tags and native fields | [API Reference](docs/api-reference.md) |
|
|
112
|
+
| **Agent framework** | ToolLoopAgent, ReActAgent, PlanAndExecuteAgent with approval, budget, cost tracking | [Agent](docs/agent.md) |
|
|
113
|
+
| **Evaluation** | LLM output evaluation with built-in metrics (exact_match, similarity, toxicity) | [Eval](docs/eval.md) |
|
|
114
|
+
| **Framework hooks** | React, Vue, Svelte, Solid, Angular signal-based hooks | [Frameworks](docs/frameworks.md) |
|
|
115
|
+
| **RAG primitives** | VectorStore, Retriever, RAGPipeline, chunking | [RAG](docs/rag.md) |
|
|
116
|
+
| **Provider catalog** | Runtime provider/model discovery with search | [Catalog](docs/catalog.md) |
|
|
117
|
+
| **CLI** | `hilbras` CLI for init, provider management, model listing, cost estimation | [CLI](docs/cli.md) |
|
|
118
|
+
| **Migration** | Guide from Vercel AI SDK | [Migration](docs/migration-from-vercel-ai-sdk.md) |
|
|
112
119
|
| **Zero runtime deps** | Pure TypeScript, no transitive dependencies | — |
|
|
113
120
|
|
|
114
121
|
---
|
|
@@ -121,6 +128,13 @@ const reply = await client.complete({
|
|
|
121
128
|
- **[Security](docs/security.md)** — SSRF protection, opt-in flags, error redaction
|
|
122
129
|
- **[Observability](docs/observability.md)** — lifecycle events
|
|
123
130
|
- **[API Reference](docs/api-reference.md)** — complete type and function reference
|
|
131
|
+
- **[Agent Framework](docs/agent.md)** — multi-step agent tools
|
|
132
|
+
- **[Evaluation](docs/eval.md)** — LLM output testing
|
|
133
|
+
- **[RAG](docs/rag.md)** — retrieval-augmented generation
|
|
134
|
+
- **[Frameworks](docs/frameworks.md)** — React, Vue, Svelte, Solid, Angular hooks
|
|
135
|
+
- **[Catalog](docs/catalog.md)** — provider/model discovery
|
|
136
|
+
- **[CLI](docs/cli.md)** — command-line tools
|
|
137
|
+
- **[Migration](docs/migration-from-vercel-ai-sdk.md)** — from Vercel AI SDK
|
|
124
138
|
- **[CHANGELOG](CHANGELOG.md)** — version history
|
|
125
139
|
|
|
126
140
|
## Subpath imports
|
|
@@ -133,6 +147,16 @@ import { estimateTokens } from "@hilbras/sdk/tokens"; // Token utiliti
|
|
|
133
147
|
import { loadConfig } from "@hilbras/sdk/config"; // Config
|
|
134
148
|
import { FetchTransport } from "@hilbras/sdk/transport/fetch"; // Transport
|
|
135
149
|
import { validateBaseUrl } from "@hilbras/sdk"; // SSRF guard
|
|
150
|
+
|
|
151
|
+
// Packages
|
|
152
|
+
import { useChat } from "@hilbras/react"; // React hooks
|
|
153
|
+
import { useChat } from "@hilbras/vue"; // Vue composables
|
|
154
|
+
import { useChat } from "@hilbras/svelte"; // Svelte stores
|
|
155
|
+
import { useChat } from "@hilbras/solid"; // Solid signals
|
|
156
|
+
import { useChat } from "@hilbras/angular"; // Angular signals
|
|
157
|
+
import { ToolLoopAgent } from "@hilbras/agent"; // Agent framework
|
|
158
|
+
import { evaluate } from "@hilbras/eval"; // Evaluation
|
|
159
|
+
import { RAGPipeline } from "@hilbras/rag"; // RAG
|
|
136
160
|
```
|
|
137
161
|
|
|
138
162
|
## Development
|
|
@@ -140,7 +164,7 @@ import { validateBaseUrl } from "@hilbras/sdk"; // SSRF guard
|
|
|
140
164
|
```bash
|
|
141
165
|
npm install
|
|
142
166
|
npm run build # Compile TypeScript
|
|
143
|
-
npm test # Run
|
|
167
|
+
npm test # Run 1278 tests
|
|
144
168
|
npm run test:watch # Watch mode
|
|
145
169
|
npm run lint # Lint with oxlint
|
|
146
170
|
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hilbras/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.0",
|
|
4
4
|
"description": "Provider-agnostic LLM client SDK — streaming, tool calling, embeddings, image generation, speech synthesis, transcription, reranking, circuit breaker, retry, reasoning normalization, cost enforcement, structured output with schema validation, type-safe tool builder, and SSRF-safe provider registration. Zero runtime dependencies.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|