@pouchy_ai/admin-sdk 0.27.0 → 0.27.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/CHANGELOG.md CHANGED
@@ -2,6 +2,17 @@
2
2
 
3
3
  All notable changes to `@pouchy_ai/admin-sdk` are documented here.
4
4
 
5
+ ## 0.27.1 — 2026-08-28
6
+
7
+ - **Docs-only, but read it if you use `encodingFormat: 'base64'`.** The 0.27.0
8
+ README's decode snippet was `new Float32Array(Buffer.from(s,'base64').buffer)`
9
+ — on Node runtimes that pool small buffers (every 768-dim vector qualifies),
10
+ `.buffer` is the whole shared pool and that form silently decodes ~2048
11
+ garbage-tailed elements. Our own live acceptance probe caught it on first
12
+ field run. Correct, everywhere:
13
+ `const buf = Buffer.from(s, 'base64'); new Float32Array(buf.buffer, buf.byteOffset, buf.length / 4)`.
14
+ No client code changed.
15
+
5
16
  ## 0.27.0 — 2026-08-28
6
17
 
7
18
  - **New: `embedTexts` — text → embedding vectors** (`POST
package/README.md CHANGED
@@ -187,8 +187,26 @@ Two rules keep a stored index honest:
187
187
  is always exactly what you stored.
188
188
 
189
189
  For bulk reindex, `encodingFormat: 'base64'` returns each vector as
190
- little-endian float32 base64 (~3.5× smaller at 768 dims):
191
- `new Float32Array(Buffer.from(embedding, 'base64').buffer)`.
190
+ little-endian float32 base64 (~3.5× smaller at 768 dims). Decode with the
191
+ **offset-safe** form:
192
+
193
+ ```ts
194
+ const res = await admin.embedTexts({
195
+ input: ['来张咖啡店自拍'],
196
+ encodingFormat: 'base64'
197
+ });
198
+ for (const { embedding } of res.data) {
199
+ const buf = Buffer.from(embedding as string, 'base64');
200
+ const vec = new Float32Array(buf.buffer, buf.byteOffset, buf.length / 4);
201
+ // vec.length === res.dimensions, always
202
+ void vec;
203
+ }
204
+ ```
205
+
206
+ Not `new Float32Array(buf.buffer)` — on Node runtimes that pool small buffers
207
+ (every 768-dim vector qualifies), `.buffer` is the whole shared pool and the
208
+ naive form silently decodes ~2048 garbage-tailed elements. Caught live by our
209
+ own acceptance probe; the three-arg form is correct everywhere.
192
210
 
193
211
  Failures are typed: `invalid_request` (400 — fix and resend), `unavailable`
194
212
  (503 — transient, back off and retry), `provider_error` (502 — the upstream
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export declare const ADMIN_SDK_VERSION = "0.27.0";
1
+ export declare const ADMIN_SDK_VERSION = "0.27.1";
2
2
  export declare const DEFAULT_BASE_URL = "https://pouchy.ai/v1/admin";
3
3
  /** Deadline for the routes whose server handler declares `maxDuration: 300` —
4
4
  * the server's own ceiling plus headroom, so a client abort can only ever mean
package/dist/index.js CHANGED
@@ -8,7 +8,7 @@
8
8
  // import { createAdminClient } from '@pouchy_ai/admin-sdk';
9
9
  // const admin = createAdminClient({ adminKey: process.env.POUCHY_ADMIN_KEY! });
10
10
  // const { agents } = await admin.listAgents();
11
- export const ADMIN_SDK_VERSION = '0.27.0';
11
+ export const ADMIN_SDK_VERSION = '0.27.1';
12
12
  export const DEFAULT_BASE_URL = 'https://pouchy.ai/v1/admin';
13
13
  /** Default per-request timeout (ms). A hung upstream otherwise never rejects. */
14
14
  const DEFAULT_TIMEOUT_MS = 30_000;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pouchy_ai/admin-sdk",
3
- "version": "0.27.0",
3
+ "version": "0.27.1",
4
4
  "description": "Typed TypeScript client for the Pouchy Admin API \u2014 manage agents, keys, end users, knowledge, skills, channels, schedules, webhooks and credentials headlessly, with a project Admin key.",
5
5
  "type": "module",
6
6
  "license": "SEE LICENSE IN LICENSE",