@arnilo/prism-rag 0.0.14 → 0.0.16

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/dist/util.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { type JsonObject, type JsonValue, type Message, type SecretRedactor } from "@arnilo/prism";
1
+ import { type JsonObject, type JsonValue, type Message } from "@arnilo/prism";
2
2
  import type { RagScope } from "./types.js";
3
3
  export declare function assertNotAborted(signal?: AbortSignal): void;
4
4
  export declare function nonEmpty(value: unknown, label: string): string;
@@ -9,7 +9,6 @@ export declare function assertScope(expected: RagScope, actual: {
9
9
  resourceId: string;
10
10
  threadId: string;
11
11
  }): void;
12
- export declare function resolveRedactor(redactor?: SecretRedactor, secrets?: readonly (string | undefined)[]): SecretRedactor | undefined;
13
12
  export declare function byteLength(value: unknown): number;
14
13
  export declare function assertBytes(value: unknown, limit: number, label: string): void;
15
14
  export declare function latestUserText(messages: readonly Message[]): string | undefined;
package/dist/util.js CHANGED
@@ -1,4 +1,3 @@
1
- import { createSecretRedactor } from "@arnilo/prism";
2
1
  import { RagAbortError, RagLimitError, RagScopeError, RagValidationError } from "./errors.js";
3
2
  export function assertNotAborted(signal) {
4
3
  if (signal?.aborted)
@@ -24,15 +23,10 @@ export function requireScope(scope) {
24
23
  };
25
24
  }
26
25
  export function assertScope(expected, actual) {
27
- if (actual.tenantId !== expected.tenantId
28
- || actual.resourceId !== expected.resourceId
29
- || actual.threadId !== expected.corpusId) {
26
+ if (actual.tenantId !== expected.tenantId || actual.resourceId !== expected.resourceId || actual.threadId !== expected.corpusId) {
30
27
  throw new RagScopeError("vector hit crossed tenant/resource/corpus boundary");
31
28
  }
32
29
  }
33
- export function resolveRedactor(redactor, secrets) {
34
- return redactor ?? (secrets?.length ? createSecretRedactor(secrets) : undefined);
35
- }
36
30
  export function byteLength(value) {
37
31
  return Buffer.byteLength(typeof value === "string" ? value : JSON.stringify(value), "utf8");
38
32
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arnilo/prism-rag",
3
- "version": "0.0.14",
3
+ "version": "0.0.16",
4
4
  "description": "Optional bounded text and Markdown RAG primitives for Prism.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -9,6 +9,14 @@
9
9
  ".": {
10
10
  "types": "./dist/index.d.ts",
11
11
  "default": "./dist/index.js"
12
+ },
13
+ "./loaders": {
14
+ "types": "./dist/loaders.d.ts",
15
+ "default": "./dist/loaders.js"
16
+ },
17
+ "./parsers": {
18
+ "types": "./dist/parsers.d.ts",
19
+ "default": "./dist/parsers.js"
12
20
  }
13
21
  },
14
22
  "files": [
@@ -25,8 +33,8 @@
25
33
  "pack:dry-run": "npm pack --dry-run"
26
34
  },
27
35
  "peerDependencies": {
28
- "@arnilo/prism": "0.0.14",
29
- "@arnilo/prism-memory": "0.0.14"
36
+ "@arnilo/prism": "0.0.16",
37
+ "@arnilo/prism-memory": "0.0.16"
30
38
  },
31
39
  "devDependencies": {
32
40
  "@arnilo/prism": "file:../..",