@namzu/anthropic 3.3.1 → 3.4.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/CHANGELOG.md +26 -0
- package/README.md +22 -108
- package/package.json +5 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 3.4.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 03e363c: Declare the Node floor these packages already had, and export a type `TelemetryConfig` already required.
|
|
8
|
+
|
|
9
|
+
**`engines.node: ">=20.0.0"`.** Only `@namzu/cli` declared one; the other fourteen published without any, so npm could not warn a consumer installing onto an unsupported runtime — they got a crash at some later import instead. The floor is not new: `@namzu/cli` has declared it since it shipped and `install.sh` has enforced it since it existed. This makes the other fourteen say the same thing.
|
|
10
|
+
|
|
11
|
+
If you install with `engine-strict=true` on Node 18, an install that previously emitted nothing will now fail. Upgrade to Node 20 or newer, which the code already assumed. Everyone else sees no change, or an `EBADENGINE` warning that replaces a later crash.
|
|
12
|
+
|
|
13
|
+
Worth stating plainly: CI verifies Node 22 and 24. The 20 floor is a declared minimum, not a tested one.
|
|
14
|
+
|
|
15
|
+
**`SpanProcessorLike` is now exported from `@namzu/telemetry`.** `TelemetryConfig.spanProcessors` takes `readonly SpanProcessorLike[]`, and the type had no export — a field on the public surface whose type was not on it, so a host supplying the value had to inline the shape or reach for `any`.
|
|
16
|
+
|
|
17
|
+
## 3.3.2
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- 5394981: Make each driver's README an npm package page rather than its manual.
|
|
22
|
+
|
|
23
|
+
Every driver README carried its full reference — configuration tables, capability matrices, error surfaces — between 167 and 392 lines of it. That is a reasonable shape for a single-package repository, where the README _is_ the documentation, and the wrong one for a package in a monorepo that has a `docs/` tree: it duplicates what the docs say, and nothing checks that the two agree.
|
|
24
|
+
|
|
25
|
+
The README is now what a reader needs in the first minute — what the driver is, install, one working example, links. The reference moved to `docs/providers/<name>.md`, whole, and its code samples are now compiled against the built SDK by the doc-fence gate on every CI run. They never were before; several did not compile.
|
|
26
|
+
|
|
27
|
+
No API change.
|
|
28
|
+
|
|
3
29
|
## 3.3.1
|
|
4
30
|
|
|
5
31
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
type: Reference
|
|
3
3
|
title: "@namzu/anthropic"
|
|
4
4
|
description: >-
|
|
5
|
-
The Anthropic driver for
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
The Anthropic model driver for the Namzu agent kernel. Implements
|
|
6
|
+
LLMProvider over the vendor's official SDK, so the kernel drives it
|
|
7
|
+
through the same interface as every other driver.
|
|
8
8
|
tags: [readme, package, provider, anthropic]
|
|
9
9
|
timestamp: 2026-08-17T00:00:00Z
|
|
10
10
|
status: active
|
|
@@ -15,26 +15,22 @@ diataxis: reference
|
|
|
15
15
|
|
|
16
16
|
<h1>@namzu/anthropic</h1>
|
|
17
17
|
|
|
18
|
-
**The Anthropic driver for [
|
|
18
|
+
**The Anthropic model driver for [Namzu](https://github.com/cogitave/namzu).**
|
|
19
19
|
|
|
20
|
-
[](https://www.npmjs.com/package/@namzu/anthropic)
|
|
21
|
+
[](https://github.com/cogitave/namzu/actions/workflows/ci.yml)
|
|
22
|
+
[](https://github.com/cogitave/namzu/blob/main/LICENSE.md)
|
|
22
23
|
|
|
23
|
-
[Install](#install) · [
|
|
24
|
+
[Install](#install) · [Usage](#usage) · [Documentation](#documentation)
|
|
24
25
|
|
|
25
26
|
</div>
|
|
26
27
|
|
|
27
28
|
---
|
|
28
29
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
through the same interface as every other driver and nothing above the driver
|
|
34
|
-
layer knows which vendor is answering.
|
|
35
|
-
|
|
36
|
-
Installed only if you use it. The kernel has no preferred vendor and no driver
|
|
37
|
-
is a dependency of it.
|
|
30
|
+
Implements the kernel's `LLMProvider` interface over the official
|
|
31
|
+
`@anthropic-ai/sdk`, so nothing above the driver layer knows which vendor is
|
|
32
|
+
answering. Installed only if you use it — the kernel has no preferred vendor
|
|
33
|
+
and no driver is a dependency of it.
|
|
38
34
|
|
|
39
35
|
## Install
|
|
40
36
|
|
|
@@ -44,7 +40,7 @@ pnpm add @namzu/sdk @namzu/anthropic
|
|
|
44
40
|
|
|
45
41
|
`@namzu/sdk` is a peer dependency. Install both.
|
|
46
42
|
|
|
47
|
-
##
|
|
43
|
+
## Usage
|
|
48
44
|
|
|
49
45
|
```ts
|
|
50
46
|
import { ProviderRegistry, collectChatCompletion } from '@namzu/sdk'
|
|
@@ -59,12 +55,7 @@ const { provider } = ProviderRegistry.create({
|
|
|
59
55
|
apiKey: process.env.ANTHROPIC_API_KEY,
|
|
60
56
|
model: 'claude-sonnet-4-5-20250929',
|
|
61
57
|
})
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
`LLMProvider` has **one** model entry point, `chatStream`. A non-streaming
|
|
65
|
-
call is that stream collected:
|
|
66
58
|
|
|
67
|
-
```ts
|
|
68
59
|
const response = await collectChatCompletion(
|
|
69
60
|
provider.chatStream({
|
|
70
61
|
model: 'claude-sonnet-4-5-20250929',
|
|
@@ -73,95 +64,18 @@ const response = await collectChatCompletion(
|
|
|
73
64
|
)
|
|
74
65
|
```
|
|
75
66
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
```ts
|
|
79
|
-
for await (const chunk of provider.chatStream({
|
|
80
|
-
model: 'claude-sonnet-4-5-20250929',
|
|
81
|
-
messages: [{ role: 'user', content: 'Tell me a story' }],
|
|
82
|
-
})) {
|
|
83
|
-
if (chunk.delta.content) process.stdout.write(chunk.delta.content)
|
|
84
|
-
}
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
In practice you rarely call the driver directly — the kernel's run loop does,
|
|
88
|
-
and hands you events. This is the shape when you do.
|
|
89
|
-
|
|
90
|
-
## Authentication
|
|
91
|
-
|
|
92
|
-
Exactly one of `apiKey` or `authToken` must be set.
|
|
93
|
-
|
|
94
|
-
| Field | For |
|
|
95
|
-
|---|---|
|
|
96
|
-
| `apiKey` | a console key (`sk-ant-api-*`), sent as `x-api-key` |
|
|
97
|
-
| `authToken` | an OAuth access token, sent as `Authorization: Bearer …` |
|
|
67
|
+
`chatStream` is the only model entry point; a non-streaming call is that stream
|
|
68
|
+
collected. In practice the kernel's run loop calls it and hands you events.
|
|
98
69
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
## Configuration
|
|
104
|
-
|
|
105
|
-
| Option | Default | Notes |
|
|
106
|
-
|---|---|---|
|
|
107
|
-
| `apiKey` | — | mutually exclusive with `authToken` |
|
|
108
|
-
| `authToken` | — | OAuth bearer token |
|
|
109
|
-
| `model` | — | default model when a call omits one |
|
|
110
|
-
| `maxTokens` | `64000` | the Messages API requires the field; this is the fallback |
|
|
111
|
-
| `baseURL` | vendor default | a proxy or a compatible gateway |
|
|
112
|
-
| `timeout` | SDK default | request timeout, ms |
|
|
113
|
-
| `streamIdleTimeoutMs` | disabled | per-event idle watchdog, for failing a stalled stream independently of the request timeout |
|
|
114
|
-
| `defaultHeaders` | — | appended to every request |
|
|
115
|
-
| `strictToolUse` | `'auto'` | see below |
|
|
116
|
-
|
|
117
|
-
For AWS Bedrock or Vertex access prefer the dedicated driver over a `baseURL`
|
|
118
|
-
override — they carry the auth and region semantics natively.
|
|
119
|
-
|
|
120
|
-
## Extended thinking
|
|
121
|
-
|
|
122
|
-
`resolveEffort`, `resolveThinkingBody` and `resolveThinkingCapability` are
|
|
123
|
-
exported so a host can see how a requested reasoning effort maps onto the
|
|
124
|
-
vendor's thinking parameters before a call is made, rather than inferring it
|
|
125
|
-
from the response.
|
|
126
|
-
|
|
127
|
-
## Strict tool inputs
|
|
128
|
-
|
|
129
|
-
A tool that declares `modelInputSchema` **and** `enforceModelInput: true` is
|
|
130
|
-
sent with `strict: true` on recognised Claude 4.5+ models, which constrains
|
|
131
|
-
generation to the schema instead of validating after the fact.
|
|
132
|
-
|
|
133
|
-
`strictToolUse` decides when that happens: `'auto'` (the default) enables it
|
|
134
|
-
for known model identifiers, `'on'` opts a compatible proxy alias in, `'off'`
|
|
135
|
-
disables it. Zod validation still runs on every tool call either way — strict
|
|
136
|
-
generation narrows what the model can emit; it does not replace the check.
|
|
137
|
-
|
|
138
|
-
The kernel refuses a schema outside the strict subset at registration rather
|
|
139
|
-
than sending it, because the vendor rejects the whole request when one keyword
|
|
140
|
-
is unexpressible and the turn dies before a token is produced.
|
|
141
|
-
|
|
142
|
-
## Capabilities
|
|
143
|
-
|
|
144
|
-
```ts
|
|
145
|
-
import { ANTHROPIC_CAPABILITIES } from '@namzu/anthropic'
|
|
146
|
-
|
|
147
|
-
// {
|
|
148
|
-
// supportsTools: true,
|
|
149
|
-
// supportsStreaming: true,
|
|
150
|
-
// supportsFunctionCalling: true,
|
|
151
|
-
// supportsVision: true,
|
|
152
|
-
// supportsDocuments: true,
|
|
153
|
-
// }
|
|
154
|
-
```
|
|
70
|
+
Set exactly one of `apiKey` or `authToken`. The kernel's credential vault can
|
|
71
|
+
hold the key instead, so it never reaches the driver's config as a plain
|
|
72
|
+
string.
|
|
155
73
|
|
|
156
|
-
##
|
|
74
|
+
## Documentation
|
|
157
75
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
names as there are vendors. Install
|
|
161
|
-
[`@namzu/telemetry`](https://www.npmjs.com/package/@namzu/telemetry) to export
|
|
162
|
-
them.
|
|
76
|
+
- [The Anthropic driver](https://github.com/cogitave/namzu/blob/main/docs/providers/anthropic.md) — every configuration field, extended thinking, strict tool inputs
|
|
77
|
+
- [Namzu docs](https://github.com/cogitave/namzu/tree/main/docs)
|
|
163
78
|
|
|
164
79
|
## License
|
|
165
80
|
|
|
166
|
-
FSL-1.1-MIT, converting to MIT two years after each release.
|
|
167
|
-
`@namzu/sdk`.
|
|
81
|
+
FSL-1.1-MIT, converting to MIT two years after each release.
|
package/package.json
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@namzu/anthropic",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.4.0",
|
|
4
4
|
"description": "Anthropic LLM provider for @namzu/sdk via the official @anthropic-ai/sdk. Messages API with streaming, tool-use, and extended thinking support.",
|
|
5
5
|
"license": "FSL-1.1-MIT",
|
|
6
|
+
"engines": {
|
|
7
|
+
"node": ">=20.0.0"
|
|
8
|
+
},
|
|
6
9
|
"type": "module",
|
|
7
10
|
"homepage": "https://github.com/cogitave/namzu#readme",
|
|
8
11
|
"repository": {
|
|
@@ -54,7 +57,7 @@
|
|
|
54
57
|
"@types/node": "^22.19.17",
|
|
55
58
|
"typescript": "^5.5.0",
|
|
56
59
|
"vitest": "^3.2.6",
|
|
57
|
-
"@namzu/sdk": "^
|
|
60
|
+
"@namzu/sdk": "^30.1.0"
|
|
58
61
|
},
|
|
59
62
|
"scripts": {
|
|
60
63
|
"build": "tsc --build",
|