@autorag/librarian 2.10.0 → 2.10.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/LICENSE +195 -21
- package/NOTICE +17 -21
- package/README.md +335 -161
- package/dist/agent/agent.d.ts +67 -2
- package/dist/agent/context-token-guard.d.ts +23 -0
- package/dist/agent/jev-extension.d.ts +5 -4
- package/dist/agent/jikji-find-tool.d.ts +1 -0
- package/dist/agent/pi-session.d.ts +35 -2
- package/dist/agent/request-limits.d.ts +20 -0
- package/dist/agent/search-all-tool.d.ts +1 -0
- package/dist/agent/search-single-datasource-tool.d.ts +1 -0
- package/dist/cli/config.d.ts +13 -11
- package/dist/cli/index.js +2573 -800
- package/dist/cloud/config.d.ts +18 -0
- package/dist/cloud/jev-backend.d.ts +90 -0
- package/dist/core.js +2185 -418
- package/dist/datasource/crawler-skill.d.ts +17 -0
- package/dist/datasource/sidecar/config.d.ts +26 -0
- package/dist/datasource/sidecar/descriptors.d.ts +67 -0
- package/dist/datasource/sidecar/fusion.d.ts +25 -0
- package/dist/datasource/sidecar/index.d.ts +131 -0
- package/dist/datasource/sidecar/methods.d.ts +27 -0
- package/dist/datasource/types.d.ts +3 -1
- package/dist/embedding-runtime/index.d.ts +6 -6
- package/dist/embedding-runtime/manifest.d.ts +0 -12
- package/dist/embedding-runtime/types.d.ts +1 -1
- package/dist/index.js +2210 -439
- package/dist/mcp/index.js +2205 -438
- package/dist/minsync/client.d.ts +3 -3
- package/dist/minsync/installer.d.ts +1 -1
- package/dist/minsync/process.d.ts +1 -0
- package/dist/minsync/types.d.ts +1 -1
- package/dist/parser/defaults.d.ts +6 -4
- package/dist/parser/ocr-engines.d.ts +6 -0
- package/dist/retrieval/index.d.ts +1 -1
- package/dist/retrieval/rerank.d.ts +20 -3
- package/licenses/embedding-assets.json +0 -35
- package/package.json +24 -27
- package/skills/autorag/SKILL.md +1 -1
- package/skills/autorag-doctor/SKILL.md +1 -1
- package/skills/autorag-lite-setup/SKILL.md +2 -2
- package/skills/autorag-setup/SKILL.md +2 -2
- package/licenses/gemma-notice.txt +0 -24
- package/licenses/gemma-section-3.2-flow-down.txt +0 -9
- package/licenses/gemma-terms-of-use.html +0 -4750
- package/licenses/gemma-terms-of-use.txt +0 -158
package/dist/cloud/config.d.ts
CHANGED
|
@@ -10,6 +10,24 @@ export declare const API_PATH = "/v1";
|
|
|
10
10
|
export declare const MODELS_PATH = "/v1/models";
|
|
11
11
|
export declare const AUTHORIZE_PATH = "/desktop/authorize";
|
|
12
12
|
export declare const TOKEN_PATH = "/api/desktop/token";
|
|
13
|
+
/**
|
|
14
|
+
* Request limits of the hosted API, declared on every `autorag` model.
|
|
15
|
+
*
|
|
16
|
+
* The API is served from Vercel, which rejects a request body above about
|
|
17
|
+
* 4.49 MB with HTTP 413 before it reaches the model (measured against
|
|
18
|
+
* `POST /v1/responses`). pi resends every image a tool returned on each later
|
|
19
|
+
* turn, so a search that reads a few photos crosses that line. The transcript
|
|
20
|
+
* cap leaves headroom for the tool declarations and request framing the
|
|
21
|
+
* transcript size does not count; the resize cap keeps one image well below it.
|
|
22
|
+
*/
|
|
23
|
+
export declare const AUTORAG_INPUT_LIMITS: {
|
|
24
|
+
readonly maxRequestBytes: 3500000;
|
|
25
|
+
readonly images: {
|
|
26
|
+
readonly resize: {
|
|
27
|
+
readonly maxBytes: 1000000;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
};
|
|
13
31
|
/** OAuth client identifier for the AutoRAG agent (Pi-compatible hosts use `pi`). */
|
|
14
32
|
export declare const OAUTH_CLIENT_ID = "agent";
|
|
15
33
|
/**
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Jev backend for the hosted AutoRAG (Dazzi) plan.
|
|
3
|
+
*
|
|
4
|
+
* The server answers Jev's native dialect at `POST <root>/v1/jev` behind the
|
|
5
|
+
* account bearer key (`AUTORAG_API_KEY`), returning the same `answers` map the
|
|
6
|
+
* TypeSafe and OpenRouter backends do. `jev-use`'s package index does not
|
|
7
|
+
* export its native-dialect helpers, so the small mapping and the retrying JSON
|
|
8
|
+
* transport are reimplemented here against that documented dialect (covered by
|
|
9
|
+
* tests against a local HTTP server).
|
|
10
|
+
*
|
|
11
|
+
* Failures surface as `BackendError(name, "HTTP <status>: <message>", status)`
|
|
12
|
+
* so the engine degrades to an escalation with a readable hint instead of
|
|
13
|
+
* blocking the loop.
|
|
14
|
+
*/
|
|
15
|
+
import { type BackendRequest, type BackendResponse, type JevBackend, type Question, type RawAnswer, type State } from "jev-use";
|
|
16
|
+
/** API path appended to the normalized server root. */
|
|
17
|
+
export declare const JEV_PATH = "/v1/jev";
|
|
18
|
+
/** Live Jev model id on the hosted AutoRAG plan. */
|
|
19
|
+
export declare const AUTORAG_DEFAULT_JEV_MODEL = "jev-1.13";
|
|
20
|
+
/** Options for {@link AutoragJevBackend}. */
|
|
21
|
+
export interface AutoragJevBackendOptions {
|
|
22
|
+
/** Environment holding the bearer key and `AUTORAG_BASE_URL`. Default `process.env`. */
|
|
23
|
+
readonly env?: Record<string, string | undefined>;
|
|
24
|
+
/** Explicit bearer key; when omitted, read from `AUTORAG_API_KEY`. */
|
|
25
|
+
readonly apiKey?: string;
|
|
26
|
+
/** Override the server root (test seam); defaults to `resolveBaseUrl(env)`. */
|
|
27
|
+
readonly baseUrl?: string;
|
|
28
|
+
/** Model used when a call names none. @default AUTORAG_DEFAULT_JEV_MODEL */
|
|
29
|
+
readonly defaultModel?: string;
|
|
30
|
+
/** Abort one attempt after this long. @default 10_000 */
|
|
31
|
+
readonly timeoutMs?: number;
|
|
32
|
+
/** Retries on 408/429/5xx and network failures. @default 2 */
|
|
33
|
+
readonly maxRetries?: number;
|
|
34
|
+
/** Injection seam for tests. */
|
|
35
|
+
readonly fetchImpl?: typeof fetch;
|
|
36
|
+
}
|
|
37
|
+
type NativeWireQuestion = {
|
|
38
|
+
type: "noul";
|
|
39
|
+
instructions: string;
|
|
40
|
+
criteria?: {
|
|
41
|
+
true: string;
|
|
42
|
+
false: string;
|
|
43
|
+
};
|
|
44
|
+
} | {
|
|
45
|
+
type: "choice";
|
|
46
|
+
instructions: string;
|
|
47
|
+
criteria: Record<string, string>;
|
|
48
|
+
} | {
|
|
49
|
+
type: "score";
|
|
50
|
+
instructions: string;
|
|
51
|
+
criteria: string[];
|
|
52
|
+
};
|
|
53
|
+
interface NativeBody {
|
|
54
|
+
model: string;
|
|
55
|
+
state: string;
|
|
56
|
+
questions: Record<string, NativeWireQuestion>;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Jev backend served by the hosted AutoRAG (Dazzi) plan.
|
|
60
|
+
*
|
|
61
|
+
* The constructor throws a named error when no account key is configured — a
|
|
62
|
+
* missing credential must be loud, never a silent fake judgment — and the retry
|
|
63
|
+
* policy mirrors `jev-use`'s own remote backends (408/429/5xx, `Retry-After`).
|
|
64
|
+
*/
|
|
65
|
+
export declare class AutoragJevBackend implements JevBackend {
|
|
66
|
+
readonly name = "autorag";
|
|
67
|
+
private readonly apiKey;
|
|
68
|
+
private readonly baseUrl;
|
|
69
|
+
private readonly defaultModel;
|
|
70
|
+
private readonly timeoutMs;
|
|
71
|
+
private readonly maxRetries;
|
|
72
|
+
private readonly fetchImpl;
|
|
73
|
+
constructor(options?: AutoragJevBackendOptions);
|
|
74
|
+
judge(request: BackendRequest): Promise<BackendResponse>;
|
|
75
|
+
/** POST JSON with a per-attempt timeout and jev-use's retry policy. */
|
|
76
|
+
private postJson;
|
|
77
|
+
}
|
|
78
|
+
/** Build the whole request body: model, a string state, and the questions by id. */
|
|
79
|
+
export declare function toNativeBody(state: State, questions: (Question & {
|
|
80
|
+
id: string;
|
|
81
|
+
})[], model: string): NativeBody;
|
|
82
|
+
/**
|
|
83
|
+
* Read the provider's answer map back into raw answers, in question order.
|
|
84
|
+
* Anything missing or mistyped is a `BackendError` — a silently dropped answer
|
|
85
|
+
* would read as a low-confidence judgment.
|
|
86
|
+
*/
|
|
87
|
+
export declare function parseNativeAnswers(backend: string, answers: unknown, questions: (Question & {
|
|
88
|
+
id: string;
|
|
89
|
+
})[]): RawAnswer[];
|
|
90
|
+
export {};
|