@puku-ai/sdk 4.0.0 → 4.0.1

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 CHANGED
@@ -25,6 +25,7 @@ console.log(msg.content[0].text);
25
25
 
26
26
  - [Install](#install)
27
27
  - [Configuration](#configuration)
28
+ - [Supported models](#supported-models)
28
29
  - [Usage](#usage)
29
30
  - [Working features](#working-features)
30
31
  - [Namespace](#namespace)
@@ -65,6 +66,20 @@ const client = new PukuAI({
65
66
  });
66
67
  ```
67
68
 
69
+ Defaults: `maxRetries = 2`, `timeout = 600_000` ms (10 min).
70
+
71
+ ## Supported models
72
+
73
+ Exactly three model names are accepted by the Puku gateway. Any other string
74
+ returns a model-not-found error.
75
+
76
+ | Model | Family | Notes |
77
+ |---------------|----------|-------|
78
+ | `puku-ai-2.7` | Puku AI | Cheaper, lower-latency. |
79
+ | `puku-ai-2.8` | Puku AI | Default for most workloads. |
80
+ | `opus-4.8` | Opus | Strongest reasoning; pick this for fallbacks (`fallbacks: [{ model: "opus-4.8" }]`). |
81
+
82
+
68
83
  ## Usage
69
84
 
70
85
  ### Blocking
@@ -140,12 +155,8 @@ All error classes are static members of the `PukuAI` class,
140
155
  ## Working features
141
156
 
142
157
  Every feature below was exercised against the live Puku gateway at
143
-
144
-
145
- ```bash
146
- PUKU_BASE_URL="" \
147
- PUKU_API_KEY=pk_live_... \
148
- ```
158
+ `PUKU_BASE_URL=` with a `pk_live_*` API key (see
159
+ `.env` and `.env.staging.example`).
149
160
 
150
161
  ### Verified against the live gateway
151
162
 
@@ -168,6 +179,14 @@ PUKU_API_KEY=pk_live_... \
168
179
  |--------------------------------------|--------|------|
169
180
  | `client.messages.countTokens` | ⚠ 404 | SDK POSTs to `/v1/messages/count_tokens` exactly like upstream. Puku's gateway does not proxy this endpoint. |
170
181
  | `client.messages.batches.create` | ⚠ 404 | SDK POSTs to `/v1/messages/batches` exactly like upstream. Puku's gateway does not proxy this endpoint. |
182
+ | `client.beta.agents.*` | ⚠ 404 | SDK POSTs to `/v1/agents/*` exactly like upstream. Puku's gateway does not proxy these endpoints yet. |
183
+ | `client.beta.environments.*` | ⚠ 404 | SDK POSTs to `/v1/environments/*` exactly like upstream. Puku's gateway does not proxy these endpoints yet. |
184
+ | `client.beta.sessions.*` | ⚠ 404 | SDK POSTs to `/v1/sessions/*` exactly like upstream. Puku's gateway does not proxy these endpoints yet. |
185
+ | `client.beta.vaults.*` | ⚠ 404 | SDK POSTs to `/v1/vaults/*` exactly like upstream. Puku's gateway does not proxy these endpoints yet. |
186
+ | `client.beta.skills.{listVersions, retrieve, delete}` | ⚠ 404 | SDK POSTs/GETs to `/v1/skills/{id}/versions/...` exactly like upstream. Puku's gateway does not proxy these endpoints yet. The pure archive-validation helpers (`assertSafeMemberNames`, `assertNoSpecialMembers`, `runArchiveTool`, `archiveTopDir`, `readHead`) remain usable. |
187
+ | `client.messages.batches.results` | ⚠ n/a | Not exercised against the live gateway because `batches.create` already 404s. |
188
+ | Structured-outputs JSON parser (`output_format` / `output_config.format`) | ⚠ not wired | The SDK accepts the option but no structured-outputs parser is hooked into the stream finalizer. The `JSONOutputFormat` shape exists in types only. |
189
+ | Server-side `web_search` tool result | ⚠ not proxied | The SDK forwards a `web_search_20250305` tool definition; the gateway does not execute the search and returns the placeholder shape. Use the agent toolset + your own search client instead. |
171
190
 
172
191
 
173
192
 
@@ -198,7 +217,7 @@ const getWeather = {
198
217
 
199
218
  const finalMessage = await client.beta.messages
200
219
  .toolRunner({
201
- model: "puku-ai--2.8",
220
+ model: "puku-ai-2.8",
202
221
  max_tokens: 512,
203
222
  messages: [{ role: "user", content: "What's the weather in Tokyo?" }],
204
223
  tools: [getWeather],
@@ -220,7 +239,7 @@ import PukuAI from "@puku-ai/sdk";
220
239
  const client = new PukuAI();
221
240
 
222
241
  const stream = client.messages.stream({
223
- model: "puku-ai--2.8",
242
+ model: "puku-ai-2.8",
224
243
  max_tokens: 128,
225
244
  messages: [{ role: "user", content: "Say hello in three languages." }],
226
245
  });
@@ -255,7 +274,7 @@ await mcp.connect(clientT);
255
274
  const tools = await mcpTools({ mcpClient: mcp });
256
275
 
257
276
  const reply = await client.beta.messages.create({
258
- model: "puku-ai--2.8",
277
+ model: "puku-ai-2.8",
259
278
  max_tokens: 512,
260
279
  mcp_servers: [{ type: "url", url: "https://mcp.example.com/sse", name: "example" }],
261
280
  messages: [{ role: "user", content: "Find any open PRs." }],
@@ -334,7 +353,7 @@ PukuAI.VERSION; // SDK version
334
353
  ### CJS / ESM shim
335
354
 
336
355
  When you `require('@puku-ai/sdk')`, the default export is a callable function
337
- that instantiates `PukuAI` — matching the `@anthropic-ai/sdk` convention:
356
+ that instantiates `PukuAI`:
338
357
 
339
358
  ```ts
340
359
  // CJS or ESM-from-CJS:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@puku-ai/sdk",
3
- "version": "4.0.0",
3
+ "version": "4.0.1",
4
4
  "description": "PukuAI client SDK",
5
5
  "type": "module",
6
6
  "main": "./sdk.cjs",
package/sdk.cjs CHANGED
@@ -7853,9 +7853,9 @@ var init_batches = __esm(() => {
7853
7853
  var MODEL_NONSTREAMING_TOKENS;
7854
7854
  var init_constants = __esm(() => {
7855
7855
  MODEL_NONSTREAMING_TOKENS = {
7856
- "puku-opus-4@20250514": 8192,
7857
- "puku.puku-opus-4-1-20250805-v1:0": 8192,
7858
- "puku-opus-4-1@20250805": 8192
7856
+ "puku-ai-2.7": 8192,
7857
+ "puku-ai-2.8": 8192,
7858
+ "opus-4.8": 8192
7859
7859
  };
7860
7860
  });
7861
7861
 
@@ -8937,7 +8937,7 @@ var init_BetaToolRunner = __esm(() => {
8937
8937
  };
8938
8938
  this.#completion = promiseWithResolvers();
8939
8939
  if (params.compactionControl?.enabled) {
8940
- console.warn("Puku: The `compactionControl` parameter is deprecated and will be removed in a future version. " + 'Use server-side compaction instead by passing `edits: [{ type: "compact_20260112" }]` in the params passed to `toolRunner()`. ' + "See https://puku.ai/docs/en/build-with-puku/compaction");
8940
+ console.warn("Puku: The `compactionControl` parameter is deprecated and will be removed in a future version. " + 'Use server-side compaction instead by passing `edits: [{ type: "compact_20260112" }]` in the params passed to `toolRunner()`. ' + "See https://puku.sh/docs/");
8941
8941
  }
8942
8942
  }
8943
8943
  async#checkAndCompact() {
@@ -14282,7 +14282,7 @@ function mcpResourceToFile(result) {
14282
14282
  init_ToolError();
14283
14283
  init_node2();
14284
14284
 
14285
- //# debugId=85C7CF95569F331C64756E2164756E21
14285
+ //# debugId=012C3C55BCFA558A64756E2164756E21
14286
14286
 
14287
14287
 
14288
14288
  // Capture in a closure so the callable shim doesn't lose the export