@absolutejs/rag 0.18.0 → 0.18.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 +6 -0
- package/RESEARCH.md +3 -4
- package/changelog.json +17 -0
- package/dist/research/index.js +11 -2
- package/dist/research/index.js.map +5 -4
- package/dist/src/research/schema.d.ts +8 -0
- package/dist/src/research/types.d.ts +4 -3
- package/package.json +5 -3
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,12 @@ This file is generated by `absolute-changelog` from the entries in
|
|
|
6
6
|
`changelog/`. Edit an entry, not this file — and add new ones under
|
|
7
7
|
`changelog/unreleased/`.
|
|
8
8
|
|
|
9
|
+
## 0.18.1 — 2026-09-24
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
|
|
13
|
+
- **Accept Elysia 2 and TypeBox 1 research schemas with inferred result types and matching runtime validation while preserving TypeBox 0.34 compatibility.** (`ResearchTask`, `ResearchRuntime`, `ResearchSchema`, `ResearchStatic`, `createResearch`)
|
|
14
|
+
|
|
9
15
|
## 0.18.0 — 2026-09-24
|
|
10
16
|
|
|
11
17
|
### Added
|
package/RESEARCH.md
CHANGED
|
@@ -5,8 +5,7 @@
|
|
|
5
5
|
## Configure once
|
|
6
6
|
|
|
7
7
|
```ts
|
|
8
|
-
import { Elysia } from "elysia";
|
|
9
|
-
import { Type } from "@sinclair/typebox";
|
|
8
|
+
import { Elysia, t } from "elysia";
|
|
10
9
|
import { anthropic } from "@absolutejs/ai/anthropic";
|
|
11
10
|
import { createBraveSearch } from "@absolutejs/search/brave";
|
|
12
11
|
import {
|
|
@@ -21,7 +20,7 @@ const research = createResearch({
|
|
|
21
20
|
model: process.env.RESEARCH_MODEL!,
|
|
22
21
|
tasks: {
|
|
23
22
|
company: {
|
|
24
|
-
schema:
|
|
23
|
+
schema: t.Object({ name: t.String(), description: t.String() }),
|
|
25
24
|
},
|
|
26
25
|
signals: researchMonitorTask,
|
|
27
26
|
},
|
|
@@ -45,7 +44,7 @@ const result = await research.run({
|
|
|
45
44
|
|
|
46
45
|
`authorizeResearchRequest` is your application's authorization function, not an export of this package. It is required. For multiple tenants, pass `runtime: request => runtimeForAuthorizedTenant(request)`; authorization runs first. Scope tenant caches, workflows and budget ledgers to the same resolved identity. The plugin rejects cross-origin browser POSTs and sends `Cache-Control: no-store`. Do not treat a caller-supplied tenant header as identity.
|
|
47
46
|
|
|
48
|
-
`run` selects server-registered schemas; browsers cannot override models, limits, schemas or credentials. `extract({schema, instructions}, input)` accepts
|
|
47
|
+
`run` selects server-registered schemas; browsers cannot override models, limits, schemas or credentials. `extract({schema, instructions}, input)` accepts JSON-compatible Elysia 2 `t`, TypeBox 1 (`typebox`), or legacy TypeBox 0.34 (`@sinclair/typebox`) schemas directly, preserving result type inference and runtime validation for trusted server code. The same configured AI provider handles planning, extraction and independent review, with transport retries and schema repair retries disabled.
|
|
49
48
|
|
|
50
49
|
Default limits are four searches, four page reads, two planning rounds, 90 seconds, 32,000 evidence characters, 4,096 output tokens per model call and 128 primitive output fields. Limits are per research call, not per entire batch. Page reading uses the existing hardened public web transport; optional `render` enables your existing browser service. A browser process is not provisioned automatically. Cancellation must also be honored by custom providers and readers.
|
|
51
50
|
|
package/changelog.json
CHANGED
|
@@ -2,6 +2,23 @@
|
|
|
2
2
|
"contract": 1,
|
|
3
3
|
"name": "@absolutejs/rag",
|
|
4
4
|
"releases": [
|
|
5
|
+
{
|
|
6
|
+
"changes": [
|
|
7
|
+
{
|
|
8
|
+
"kind": "fixed",
|
|
9
|
+
"summary": "Accept Elysia 2 and TypeBox 1 research schemas with inferred result types and matching runtime validation while preserving TypeBox 0.34 compatibility.",
|
|
10
|
+
"symbols": [
|
|
11
|
+
"ResearchTask",
|
|
12
|
+
"ResearchRuntime",
|
|
13
|
+
"ResearchSchema",
|
|
14
|
+
"ResearchStatic",
|
|
15
|
+
"createResearch"
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"date": "2026-09-24",
|
|
20
|
+
"version": "0.18.1"
|
|
21
|
+
},
|
|
5
22
|
{
|
|
6
23
|
"changes": [
|
|
7
24
|
{
|
package/dist/research/index.js
CHANGED
|
@@ -124126,6 +124126,15 @@ __export(exports_value2, {
|
|
|
124126
124126
|
Patch: () => Patch,
|
|
124127
124127
|
ValueErrorIterator: () => ValueErrorIterator
|
|
124128
124128
|
});
|
|
124129
|
+
// src/research/schema.ts
|
|
124130
|
+
import { Check as Check2 } from "typebox/value";
|
|
124131
|
+
var isLegacySchema = (schema) => (Kind in schema);
|
|
124132
|
+
var checkResearchValue = (schema, value) => {
|
|
124133
|
+
if (isLegacySchema(schema))
|
|
124134
|
+
return exports_value2.Check(schema, value);
|
|
124135
|
+
return Check2(schema, value);
|
|
124136
|
+
};
|
|
124137
|
+
|
|
124129
124138
|
// src/research/evidence.ts
|
|
124130
124139
|
import { sourceSupportsQuote } from "@absolutejs/search";
|
|
124131
124140
|
var ReviewSchema = Type2.Object({
|
|
@@ -124273,7 +124282,7 @@ var createResearch = (config) => {
|
|
|
124273
124282
|
${prompt}`,
|
|
124274
124283
|
messages: [{ role: "user", content: JSON.stringify(payload) }],
|
|
124275
124284
|
validate: (value) => {
|
|
124276
|
-
if (!
|
|
124285
|
+
if (!checkResearchValue(schema, value))
|
|
124277
124286
|
throw new Error(`Invalid ${kind} output`);
|
|
124278
124287
|
return value;
|
|
124279
124288
|
}
|
|
@@ -125273,5 +125282,5 @@ export {
|
|
|
125273
125282
|
selectResearchMonitorEvents
|
|
125274
125283
|
};
|
|
125275
125284
|
|
|
125276
|
-
//# debugId=
|
|
125285
|
+
//# debugId=FE8A4140B2EAA36864756E2164756E21
|
|
125277
125286
|
//# sourceMappingURL=index.js.map
|