@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.
@@ -0,0 +1,8 @@
1
+ import { type TSchema, type Static as LegacyStatic } from "@sinclair/typebox";
2
+ import type { Static } from "typebox";
3
+ /** JSON-compatible TypeBox 0.34 or TypeBox 1 schemas, including Elysia 2's t. */
4
+ export type ResearchSchema = TSchema | {
5
+ "~kind": string;
6
+ };
7
+ export type ResearchStatic<S extends ResearchSchema> = S extends TSchema ? LegacyStatic<S> : Static<S>;
8
+ export declare const checkResearchValue: <S extends ResearchSchema>(schema: S, value: unknown) => value is ResearchStatic<S>;
@@ -1,6 +1,7 @@
1
1
  import type { AIProviderConfig, AIUsage } from "@absolutejs/ai";
2
2
  import type { SearchProvider, SearchResult, SearchSource, SearchCacheStore } from "@absolutejs/search";
3
- import type { TSchema, Static } from "@sinclair/typebox";
3
+ import type { ResearchSchema, ResearchStatic } from "./schema";
4
+ export type { ResearchSchema, ResearchStatic } from "./schema";
4
5
  import type { ReadWebpageOptions, WebReadResult } from "../web";
5
6
  export type ResearchOperation = "search" | "read" | "plan" | "extract" | "review";
6
7
  export type ResearchProgress = {
@@ -36,7 +37,7 @@ export type ResearchResult<T = unknown> = {
36
37
  durationMs: number;
37
38
  }[];
38
39
  };
39
- export type ResearchTask<S extends TSchema = TSchema> = {
40
+ export type ResearchTask<S extends ResearchSchema = ResearchSchema> = {
40
41
  schema: S;
41
42
  instructions?: string;
42
43
  };
@@ -91,5 +92,5 @@ export type ResearchConfig = {
91
92
  };
92
93
  export type ResearchRuntime = {
93
94
  run: (input: ResearchInput) => Promise<ResearchResult>;
94
- extract: <S extends TSchema>(task: ResearchTask<S>, input: ResearchInput) => Promise<ResearchResult<Static<S>>>;
95
+ extract: <S extends ResearchSchema>(task: ResearchTask<S>, input: ResearchInput) => Promise<ResearchResult<ResearchStatic<S>>>;
95
96
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@absolutejs/rag",
3
- "version": "0.18.0",
3
+ "version": "0.18.1",
4
4
  "homepage": "https://github.com/absolutejs/rag",
5
5
  "bugs": {
6
6
  "url": "https://github.com/absolutejs/rag/issues"
@@ -90,7 +90,8 @@
90
90
  "pdfjs-dist": "6.3.289",
91
91
  "pdf-lib": "1.17.1",
92
92
  "@absolutejs/egress": "^0.3.0",
93
- "@absolutejs/search": "^0.2.0"
93
+ "@absolutejs/search": "^0.2.0",
94
+ "typebox": "^1.3.16"
94
95
  },
95
96
  "peerDependencies": {
96
97
  "@angular/core": "^21.0.0",
@@ -153,7 +154,8 @@
153
154
  "test": "bun test",
154
155
  "release": "bun run build && bun publish --access public",
155
156
  "check:package": "absolute-changelog check",
156
- "prepublishOnly": "bun run check:package"
157
+ "prepublishOnly": "bun run check:package",
158
+ "test:research-types": "tsc --project tsconfig.research-types.json"
157
159
  },
158
160
  "publishConfig": {
159
161
  "access": "public"