diff --git a/packages/rag/CHANGELOG.md b/packages/rag/CHANGELOG.md index ef1a20bf1d..e1178beb6d 100644 --- a/packages/rag/CHANGELOG.md +++ b/packages/rag/CHANGELOG.md @@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.7.0] + +### Changed + +- Convert `@qvac/rag` to TypeScript compiled ESM (`"type": "module"`). CommonJS `require('@qvac/rag')` no longer works โ€” switch to `import`. Named exports are unchanged (#3718). + +### Fixed + +- Validate `search` and `infer` queries before logging so a non-string or blank query throws `QvacErrorRAG { code: INVALID_INPUT }` instead of a raw `TypeError` (#3729). + ## [0.6.4] ### Changed diff --git a/packages/rag/NOTICE b/packages/rag/NOTICE index b9be65e705..c781e48915 100644 --- a/packages/rag/NOTICE +++ b/packages/rag/NOTICE @@ -15,6 +15,7 @@ JavaScript Dependencies @hyperswarm/secret-stream@6.9.1 https://github.com/holepunchto/hyperswarm-secret-stream @qvac/error@0.1.1 + @qvac/logging@0.1.1 adaptive-timeout@1.0.1 https://github.com/holepunchto/adaptive-timeout b4a@1.8.1 diff --git a/packages/rag/changelog/0.6.4/CHANGELOG.md b/packages/rag/changelog/0.6.4/CHANGELOG.md new file mode 100644 index 0000000000..92d6bde451 --- /dev/null +++ b/packages/rag/changelog/0.6.4/CHANGELOG.md @@ -0,0 +1,7 @@ +# Changelog v0.6.4 + +Release Date: 2026-06-15 + +## ๐Ÿ”ง Changed + +- Drop the unused `crypto-browserify` hard dependency. The package never imported it โ€” `#crypto` resolves to `bare-crypto` (Bare) or `node:crypto` (Node), and the browser / React Native shim reads `globalThis.crypto`. Consumers needing Node-style `crypto.createHash` (e.g. HyperDB document hashing in a browser/RN runtime) should install `crypto-browserify` themselves and assign it to `globalThis.crypto`, as documented in the README. diff --git a/packages/rag/changelog/0.6.4/CHANGELOG_LLM.md b/packages/rag/changelog/0.6.4/CHANGELOG_LLM.md new file mode 100644 index 0000000000..7753d6913e --- /dev/null +++ b/packages/rag/changelog/0.6.4/CHANGELOG_LLM.md @@ -0,0 +1,11 @@ +# QVAC RAG v0.6.4 Release Notes + +๐Ÿ“ฆ **NPM:** https://www.npmjs.com/package/@qvac/rag/v/0.6.4 + +This patch drops the unused `crypto-browserify` hard dependency. The package never imported it. + +## Changed + +### Unused `crypto-browserify` dependency removed + +`#crypto` still resolves to `bare-crypto` on Bare, `node:crypto` on Node, and `globalThis.crypto` on browser / React Native. Consumers that need Node-style `crypto.createHash` (for example HyperDB document hashing in a browser or React Native runtime) should install `crypto-browserify` themselves and assign it to `globalThis.crypto`, as documented in the README. diff --git a/packages/rag/changelog/0.7.0/CHANGELOG.md b/packages/rag/changelog/0.7.0/CHANGELOG.md new file mode 100644 index 0000000000..7ddf6c8d52 --- /dev/null +++ b/packages/rag/changelog/0.7.0/CHANGELOG.md @@ -0,0 +1,22 @@ +# Changelog v0.7.0 + +Release Date: 2026-08-24 + +## ๐Ÿ”Œ API + +- Expose @qvac/rag/errors subpath for consumers. (see PR [#2303](https://github.com/tetherto/qvac/pull/2303)) - See [API changes](./api.md) + +## ๐Ÿž Fixes + +- Load RAG hard deps with require() for Pear/CJS compatibility. (see PR [#2284](https://github.com/tetherto/qvac/pull/2284)) +- Validate RAG query before logging it. (see PR [#3729](https://github.com/tetherto/qvac/pull/3729)) + +## ๐Ÿ“˜ Docs + +- Update npm package homepage metadata. (see PR [#2810](https://github.com/tetherto/qvac/pull/2810)) + +## ๐Ÿงน Chores + +- Switch @qvac/rag to Lunte and Prettier. (see PR [#2801](https://github.com/tetherto/qvac/pull/2801)) +- Unify lint/format/typecheck across SDK-pod packages. (see PR [#3040](https://github.com/tetherto/qvac/pull/3040)) +- Convert @qvac/rag to TypeScript ESM. (see PR [#3718](https://github.com/tetherto/qvac/pull/3718)) - See [breaking changes](./breaking.md) diff --git a/packages/rag/changelog/0.7.0/CHANGELOG_LLM.md b/packages/rag/changelog/0.7.0/CHANGELOG_LLM.md new file mode 100644 index 0000000000..dda1943a68 --- /dev/null +++ b/packages/rag/changelog/0.7.0/CHANGELOG_LLM.md @@ -0,0 +1,31 @@ +# QVAC RAG v0.7.0 Release Notes + +๐Ÿ“ฆ **NPM:** https://www.npmjs.com/package/@qvac/rag/v/0.7.0 + +`@qvac/rag` is now TypeScript compiled to ESM. CommonJS `require('@qvac/rag')` no longer works โ€” switch to `import`. Invalid `search` and `infer` queries throw `QvacErrorRAG` with `INVALID_INPUT` instead of a raw `TypeError`. Named exports are unchanged. + +## Breaking Changes + +### ESM only + +The package is `"type": "module"`. Node rejects `require()` of ESM. Use `import`. Named exports (`RAG`, `HyperDBAdapter`, adapters, `ERR_CODES`, `QvacErrorRAG`) are the same. `@qvac/rag/errors` still exports the error class and codes without loading the full package. + +**Before:** + +```js +const { RAG, HyperDBAdapter } = require('@qvac/rag') +``` + +**After:** + +```ts +import { RAG, HyperDBAdapter } from '@qvac/rag' +``` + +The 0.6.1 Pear/CJS `require()` path for hard dependencies is gone with this conversion. Pear consumers need an ESM-capable loader. + +## Bug Fixes + +### Query validated before logging + +`rag.search()` and `rag.infer()` reject a non-string or blank query with `QvacErrorRAG { code: INVALID_INPUT }` before any debug log reads `query.substring`. Valid queries are unchanged. Previously a non-string hit `TypeError` at the log line and never reached the existing search guard. diff --git a/packages/rag/changelog/0.7.0/api.md b/packages/rag/changelog/0.7.0/api.md new file mode 100644 index 0000000000..facc5ee48c --- /dev/null +++ b/packages/rag/changelog/0.7.0/api.md @@ -0,0 +1,15 @@ +# ๐Ÿ”Œ API Changes v0.7.0 + +## Expose @qvac/rag/errors subpath for consumers + +PR: [#2303](https://github.com/tetherto/qvac/pull/2303) + +```typescript +import { ERR_CODES, QvacErrorRAG } from '@qvac/rag/errors' + +if (err instanceof QvacErrorRAG && err.code === ERR_CODES.OPERATION_CANCELLED) { + // handle cancellation +} +``` + +--- diff --git a/packages/rag/changelog/0.7.0/breaking.md b/packages/rag/changelog/0.7.0/breaking.md new file mode 100644 index 0000000000..48156c3b2a --- /dev/null +++ b/packages/rag/changelog/0.7.0/breaking.md @@ -0,0 +1,19 @@ +# ๐Ÿ’ฅ Breaking Changes v0.7.0 + +## Convert @qvac/rag to TypeScript ESM + +PR: [#3718](https://github.com/tetherto/qvac/pull/3718) + +**BEFORE:** + +```js +const { RAG, HyperDBAdapter } = require('@qvac/rag') +``` + +**AFTER:** + +```ts +import { RAG, HyperDBAdapter } from '@qvac/rag' +``` + +--- diff --git a/packages/rag/package.json b/packages/rag/package.json index 1636bcadfd..4752504df7 100644 --- a/packages/rag/package.json +++ b/packages/rag/package.json @@ -1,6 +1,6 @@ { "name": "@qvac/rag", - "version": "0.6.4", + "version": "0.7.0", "type": "module", "main": "./dist/index.js", "types": "./dist/index.d.ts", diff --git a/packages/rag/src/errors.ts b/packages/rag/src/errors.ts index 71629c3d8b..a8fbefe065 100644 --- a/packages/rag/src/errors.ts +++ b/packages/rag/src/errors.ts @@ -98,4 +98,4 @@ const definitions: ErrorCodesMap = { } } -addCodes(definitions, { name: '@qvac/rag', version: '0.6.4' }) +addCodes(definitions, { name: '@qvac/rag', version: '0.7.0' })