@namzu/sdk 0.1.7 → 0.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,11 +2,18 @@
2
2
 
3
3
  All notable changes to Namzu are documented here.
4
4
 
5
+ ## [0.1.8] — 2026-04-15
6
+
7
+ ### Documentation
8
+
9
+ - **changelog**: update for sdk-v0.1.7
10
+ - **readme**: rewrite root + fix sdk stale ProviderFactory refs
5
11
  ## [0.1.7] — 2026-04-15
6
12
 
7
13
  ### Documentation
8
14
 
9
15
  - **changelog**: add 0.1.6 (sdk) and 0.1.0 (computer-use) entries; fix cliff tag prefix + workflow race
16
+ - **changelog**: update for sdk-v0.1.6-rc.1
10
17
  ### Features
11
18
 
12
19
  - **bedrock**: extract BedrockProvider to @namzu/bedrock package (Phase I.3 pilot)
@@ -15,11 +22,6 @@ All notable changes to Namzu are documented here.
15
22
 
16
23
  - **sdk**: address Codex review — scope providers/ subfolder, hide registry reset
17
24
  - **sdk**: replace ProviderFactory with ProviderRegistry for per-vendor extraction [**BREAKING**]
18
- ## [0.1.6] — 2026-04-15
19
-
20
- ### Documentation
21
-
22
- - **changelog**: update for sdk-v0.1.6-rc.1
23
25
  ## [0.1.6-rc.1] — 2026-04-15
24
26
 
25
27
  ### Documentation
package/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
  [![CI](https://github.com/cogitave/namzu/actions/workflows/ci.yml/badge.svg)](https://github.com/cogitave/namzu/actions/workflows/ci.yml)
7
7
  [![License](https://img.shields.io/badge/license-FSL--1.1--MIT-green)](./LICENSE.md)
8
8
  [![TypeScript](https://img.shields.io/badge/TypeScript-strict-blue)](https://www.typescriptlang.org/)
9
- [![Node](https://img.shields.io/badge/node-%3E%3D22-brightgreen)](https://nodejs.org/)
9
+ [![Node](https://img.shields.io/badge/node-%3E%3D20-brightgreen)](https://nodejs.org/)
10
10
 
11
11
  ---
12
12
 
@@ -265,9 +265,9 @@ The kernel does not render a UI for this — it emits events and exposes a typed
265
265
 
266
266
  ### 15. Providers (`provider/`)
267
267
 
268
- An LLM provider implements a narrow interface: given a typed request, return a typed response (streaming or not) and propagate normalized usage, cost, and cache telemetry. Today `provider/openrouter/` and `provider/bedrock/` are in the box; adding another vendor is adding one directory. `provider/telemetry/` normalizes provider-specific response fields (OpenRouter's `cache_read_input_tokens`, `cache_creation_input_tokens`, `cache_discount`, Bedrock's equivalents) into a single kernel-wide telemetry shape.
268
+ An LLM provider implements a narrow interface: given a typed request, return a typed response (streaming or not) and propagate normalized usage, cost, and cache telemetry. Concrete providers live in dedicated sibling packages — `@namzu/anthropic`, `@namzu/bedrock`, `@namzu/http`, `@namzu/lmstudio`, `@namzu/ollama`, `@namzu/openai`, `@namzu/openrouter` each calling `ProviderRegistry.register('<vendor>', Class, capabilities)` via a `register<Vendor>()` helper. The kernel itself ships only the `LLMProvider` interface, the `ProviderRegistry`, and a pre-registered `MockLLMProvider` for tests and offline work. `provider/telemetry/` normalizes provider-specific response fields (`cache_read_input_tokens`, `cache_creation_input_tokens`, `cache_discount`, Bedrock equivalents) into a single kernel-wide telemetry shape.
269
269
 
270
- `ProviderFactory` is the single entry point. Every run chooses its provider by name; the provider object itself is stateless enough to be shared across runs.
270
+ `ProviderRegistry` is the single entry point. `ProviderRegistry.create({ type, ... })` returns `{ provider, capabilities }`; TypeScript module augmentation from each provider package gives type-narrowed config. Providers are stateless enough to be shared across runs.
271
271
 
272
272
  ### 16. Connectors (`connector/`)
273
273
 
@@ -321,17 +321,22 @@ A **thread** is a conversation: a series of user ↔ assistant messages, possibl
321
321
  ## Install
322
322
 
323
323
  ```bash
324
- npm install @namzu/sdk
324
+ pnpm add @namzu/sdk
325
325
  ```
326
326
 
327
- Requirements: Node ≥ 22, TypeScript strict mode, ESM.
327
+ Requirements: Node ≥ 20, TypeScript strict mode, ESM.
328
+
329
+ The SDK ships the kernel only. Pick an LLM backend by adding a provider package — `@namzu/anthropic`, `@namzu/openai`, `@namzu/ollama`, `@namzu/bedrock`, `@namzu/openrouter`, `@namzu/lmstudio`, or the zero-dep `@namzu/http`. The kernel alone runs against `MockLLMProvider`, which is pre-registered and good for tests.
328
330
 
329
331
  ## Quick Start
330
332
 
331
333
  ```typescript
332
- import { defineTool, ProviderFactory, ReactiveAgent, ToolRegistry } from '@namzu/sdk'
334
+ import { defineTool, ProviderRegistry, ReactiveAgent, ToolRegistry } from '@namzu/sdk'
335
+ import { registerOpenRouter } from '@namzu/openrouter'
333
336
  import { z } from 'zod'
334
337
 
338
+ registerOpenRouter()
339
+
335
340
  const searchWeb = defineTool({
336
341
  name: 'search_web',
337
342
  description: 'Search the web for information',
@@ -347,7 +352,7 @@ const searchWeb = defineTool({
347
352
  },
348
353
  })
349
354
 
350
- const provider = ProviderFactory.createProvider({
355
+ const { provider } = ProviderRegistry.create({
351
356
  type: 'openrouter',
352
357
  apiKey: process.env.OPENROUTER_KEY!,
353
358
  })
@@ -365,11 +370,11 @@ const agent = new ReactiveAgent({
365
370
 
366
371
  const result = await agent.run(
367
372
  { messages: [{ role: 'user', content: 'Summarize the latest LLM benchmarks' }], workingDirectory: process.cwd() },
368
- { model: 'anthropic/claude-sonnet-4-20250514', tokenBudget: 8192, timeoutMs: 600_000, provider, tools },
373
+ { model: 'anthropic/claude-sonnet-4', tokenBudget: 8192, timeoutMs: 600_000, provider, tools },
369
374
  )
370
375
  ```
371
376
 
372
- That is a complete, sandbox-isolated, checkpointed, telemetrized agent run with prompt caching, progressive tool disclosure, structured compaction, and emergency save all wired in by default. Those are not features you enable; they are how the kernel runs.
377
+ That is a complete, sandbox-isolated, checkpointed, telemetrized agent run with prompt caching, progressive tool disclosure, structured compaction, and emergency save all wired in by default. Those are not features you enable; they are how the kernel runs. Swap `registerOpenRouter()` for `registerOllama()`, `registerAnthropic()`, `registerBedrock()`, `registerOpenAI()`, `registerLMStudio()`, or `registerHttp()` — the code below the registration line stays identical.
373
378
 
374
379
  Examples for `PipelineAgent`, `RouterAgent`, and `SupervisorAgent` are in `src/agents/`.
375
380
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@namzu/sdk",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "description": "Open-source AI agent SDK with a built-in runtime. Nothing between you and your agents.",
5
5
  "license": "FSL-1.1-MIT",
6
6
  "type": "module",