wontopos 2.2.37 → 2.2.39

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
@@ -80,12 +80,12 @@ const hits = await mem.search("...the conversation so far...", "alice", 10,
80
80
 
81
81
  Built in, no configuration needed:
82
82
 
83
- - **Automatic retries** — 429 always, and 502 / 503 or a connection error only when a
84
- retry cannot double-process a write. The writes and the searches are POSTs, and a
85
- 502 on one of those may have been returned *after* the service already stored and
86
- billed it, so those get 429 and connect-level failures only. The reads and the
83
+ - **Automatic retries** — 429 always, and 408 / 502 / 503 / 504 or a connection error
84
+ only when a retry cannot double-process a write. The writes and the searches are
85
+ POSTs, and any of those four may have been returned *after* the write already
86
+ landed, so those get 429 and connect-level failures only. The reads and the
87
87
  deletes that address a whole store — `listStores`, `listSpeakers`, `deleteStore`,
88
- `removeSpeaker`, `forgetImage` — are GET or DELETE and do retry a 502. Twice, with
88
+ `removeSpeaker`, `forgetImage` — are GET or DELETE and do retry all four. Twice, with
89
89
  exponential backoff + jitter, honoring the server's `Retry-After`. Tune with
90
90
  `new Client({ maxRetries })`; `0` disables.
91
91
  - **Redirects refused** — the API key never follows a 3xx to another host.
@@ -106,9 +106,7 @@ Built in, no configuration needed:
106
106
  ### Behind a corporate proxy
107
107
 
108
108
  Node's global `fetch` (undici) ignores `HTTP_PROXY` / `HTTPS_PROXY`, so behind an
109
- egress proxy this SDK could not connect at all — while the Python and Rust SDKs went
110
- through, because `requests` and `reqwest` both read those variables. Pass a
111
- proxy-aware `fetch` and the three behave the same:
109
+ egress proxy no request leaves at all. Pass a proxy-aware `fetch` and they go through:
112
110
 
113
111
  This one needs `npm i undici` — Node's global `fetch` is built on undici, but the
114
112
  package itself is not installed for you.
@@ -210,103 +208,8 @@ data to fix it.
210
208
 
211
209
  ## Changelog
212
210
 
213
- The three clients release in lockstep — same version, same surface, same day.
214
- Patch releases are additive: nothing is removed or reordered within a minor line.
215
- Two have bent that, deliberately and named at the top of their entry — 2.2.34 moved the
216
- default engine, and 2.2.35 gives `search` the count range `recall` has always had. A
217
- rule you can bend without saying so is not a rule, so both are stated rather than left
218
- for a reader to hit.
219
-
220
- - **2.2.36** — an outside review, read by a different model with no knowledge of why
221
- any of this was written. The one that mattered: `recall()` promised in its own
222
- documentation that a count outside 5–20 was refused rather than clamped, and
223
- nothing checked — so `{ limit: 500 }` travelled to the service and failed there, for a
224
- mistake visible before opening a socket. `context_limit` (0–20) was unchecked the same way.
225
- Both are refused here now, and `0` still passes for `context_limit` because "attach none" is
226
- an answer, not a missing value.
227
- An argument mistake now throws a plain `Error`, not a `WosError`. A `WosError` with
228
- status 0 is `APIConnectionError` — "the request never got a response" — so
229
- `if (e.status === 0) retry()` would have retried a typo forever. And `recall` is
230
- now `async`: validating inside a non-async method threw synchronously, so
231
- `mem.recall(...).catch(h)` walked past the handler while the same mistake in
232
- `search` landed in it.
233
- New `deadlineMs` / `withDeadline(ms)`: a TOTAL budget for one call across every
234
- retry. `timeoutMs` bounds one ATTEMPT, so at the defaults a call could hold for 30s
235
- + backoff + 30s + backoff + 30s and a request handler with five seconds had no way
236
- to say so. New `signal` / `withSignal(signal)`: cancel work in flight — an abort
237
- ends the request AND any backoff sleep waiting to retry it.
238
- `require("wontopos")` now resolves: the package ships CommonJS and ESM from one
239
- source. Previously `"type": "module"` with no `require` condition meant Node's CJS
240
- resolver could not resolve this package at all.
241
- `replayed` is set only when the service did not send that field itself.
242
- - **2.2.35** — fixes, and **two behaviour changes**, both listed first because a patch
243
- release is not the place to find one by surprise.
244
-
245
- ⚠️ **`search`'s count is now 5–20, and out of range is refused rather than
246
- adjusted.** `recall` has carried that range from the start; search had no contract
247
- anywhere, so the clients sent whatever they were given and the service capped at 50
248
- with no floor. `search(q, limit=50)` and `search(q, limit=3)` both worked on 2.2.34
249
- and now raise. The default is still 10, so a call that passes no count is unaffected.
250
- Asking for 20 and silently getting 10 reads as "that is all there is", which is why
251
- this refuses instead of clamping.
252
-
253
- ⚠️ **A Rust `limit` of 0 is no longer rewritten to 10.** It was, and the caller whose
254
- prompt budget computed zero was handed ten memories and the bill for them. It is now
255
- refused under the range above rather than quietly changed to something nobody asked
256
- for.
257
-
258
- The fixes: a `null` idempotency key no longer becomes the literal key `"null"`, which
259
- had made every write on that path share one key so the second onward stored nothing
260
- (TypeScript). The async client no longer reads an explicit `retries=2` as "the caller
261
- said nothing" (Python). The image read is actually streamed, so the 64MB cap bounds a
262
- compressed body instead of measuring bytes already in memory (Python async), and that
263
- route's ERROR body is capped too (Rust). `iter_images` stops on a repeated cursor the
264
- way `iter_memories` always did (Python). `iterImages` no longer throws on the ordinary
265
- end of a walk (TypeScript). `get_image` retries a 429 and a connect-level failure like
266
- every other call — it had none at all — in the **sync Python client and TypeScript**;
267
- the async Python client and the Rust crate still make a single attempt there, and say
268
- so at the method. An empty or control-character API key is refused at the call site
269
- rather than at the network in **Python and Rust**; TypeScript still refuses only empty
270
- and whitespace. And a page walk that reaches its ceiling now raises instead of
271
- returning a truncated list that looks complete.
272
- - **2.2.34** — the default engine is `tablet-2`: same token price as `tablet-1`, and
273
- the one that serves images and re-ask. Pin the old one with
274
- `model="tablet-1"` for the previous behaviour exactly. (The engine's own default
275
- count differs between the two, but these SDKs always send one, so a call through
276
- them is unaffected.) New `search_full` /
277
- `searchFull` keeps every field the answer came with — `search` was merging away
278
- the photos and `verify_used`, both of which you were billed for. Also: results arrive
279
- best-first — take the order as given. `similarity` is a raw closeness score, and
280
- sorting by it makes results worse.
281
- - **2.2.33** — `get_image` can return a different FORMAT than you uploaded: the
282
- service re-encodes on downscale, so a large PNG comes back as WebP. Take the file
283
- extension from the response Content-Type, not from what you sent.
284
- - **2.2.32** — `get_image` returns the picture the SERVICE holds, not your original.
285
- An image whose long edge is over 1568px is downscaled on the way in, and that
286
- smaller picture is what is stored and handed back. Keep your own copy if you need
287
- the full file.
288
- - **2.2.31** — images, by-speaker, lineage and revisions are SDK methods in all three
289
- clients; `search` and `recall` take `verify`, `max_images` and recall's `limit` /
290
- `context_limit`.
291
- - **2.2.30** — documentation only: this changelog, which had not been updated
292
- in the shipped package since 2.2.10.
293
- - **2.2.29** — a store id that was PASSED but unusable no longer becomes the
294
- default store. 2.2.28 caught a blank string; the value a failed tenant lookup
295
- actually produces in JavaScript is `null` — and `String(null)` is the truthy
296
- `"null"`, so it walked past the check and `null || default` sent the write to
297
- the client's default store. `0` did the same. Anything but a non-blank string
298
- now throws, on `deleteStore` / `deleteAll` too. Omitting the argument still
299
- means "use the default". Also: `deleteStore` validates before it warns, so a
300
- non-string no longer surfaces as a `TypeError` from inside the SDK.
301
- - **2.2.28** — audit: the API key no longer survives an object spread (`private`
302
- is erased at runtime, so `{...client}` copied it), a whitespace `memoryId` can
303
- no longer read as a whole-store delete, and a blank store id throws instead of
304
- silently using the default.
305
- - **2.2.11–2.2.27** — additive fixes and hardening across all three clients.
306
- - **2.2.10** — `Memory` fix: the relevance field is `similarity` (not `score`);
307
- added typed `importance`, `category`, `is_superseded`, `superseded_by`,
308
- `created_at`, `event_date`.
309
- - **2.2.4–2.2.9** — one version across Python, TypeScript and Rust, released in
310
- lockstep; retries, redirect refusal, response cap, key masking, speakers.
311
-
312
- License: MIT.
211
+ The three clients release in lockstep — same version, same surface, same day. Patch
212
+ releases are additive. Five inside 2.2 were not, deliberately and each with its
213
+ reason; the changelog lists them.
214
+
215
+ See [CHANGELOG.md](https://github.com/wontopos/wontopos-node/blob/main/CHANGELOG.md).