@autorag/librarian 2.12.0 → 2.13.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/README.md +22 -4
- package/dist/agent/agent.d.ts +84 -44
- package/dist/agent/answer-guidelines.d.ts +19 -2
- package/dist/agent/current-date.d.ts +10 -0
- package/dist/agent/datasource-skill.d.ts +2 -2
- package/dist/agent/environment-prompt.d.ts +20 -0
- package/dist/agent/evidence-ledger.d.ts +4 -2
- package/dist/agent/location-claims.d.ts +14 -0
- package/dist/agent/packaged-skill.d.ts +19 -0
- package/dist/agent/query-routing.d.ts +80 -26
- package/dist/agent/results.d.ts +10 -2
- package/dist/agent/search-documents.d.ts +6 -1
- package/dist/agent/self-config.d.ts +4 -4
- package/dist/agent/skill-invocation.d.ts +17 -0
- package/dist/agent/user-requests.d.ts +2 -2
- package/dist/cli/commands/attachments.d.ts +13 -0
- package/dist/cli/commands/evidence.d.ts +2 -0
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.js +13923 -12387
- package/dist/cli/setup.d.ts +2 -0
- package/dist/core.js +22362 -21005
- package/dist/datasource/crawler-skill.d.ts +1 -0
- package/dist/datasource/index.d.ts +1 -1
- package/dist/datasource/sidecar/descriptors.d.ts +14 -1
- package/dist/datasource/sidecar/index.d.ts +4 -0
- package/dist/datasource/sidecar/methods.d.ts +12 -2
- package/dist/datasource/skills/clawgallery/skill.d.ts +4 -0
- package/dist/datasource/skills/discrawl/attachments.d.ts +139 -0
- package/dist/datasource/skills/discrawl/client.d.ts +11 -1
- package/dist/datasource/skills/discrawl/index.d.ts +2 -1
- package/dist/datasource/skills/discrawl/ranked-method.d.ts +19 -0
- package/dist/datasource/skills/discrawl/sidecar.d.ts +21 -0
- package/dist/datasource/skills/discrawl/skill.d.ts +23 -2
- package/dist/datasource/skills/discrawl/types.d.ts +41 -0
- package/dist/datasource/skills/factory.d.ts +17 -2
- package/dist/datasource/skills/lazykatok/index.d.ts +1 -1
- package/dist/datasource/skills/lazykatok/methods.d.ts +5 -5
- package/dist/datasource/skills/lazykatok/skill.d.ts +1 -0
- package/dist/datasource/skills/mailcrawl/skill.d.ts +1 -0
- package/dist/index.js +22454 -21046
- package/dist/mcp/index.js +22451 -21044
- package/dist/memory/memory.d.ts +4 -1
- package/dist/minsync/installer.d.ts +1 -1
- package/dist/mirror/atomic-write.d.ts +16 -1
- package/dist/mirror/sync.d.ts +2 -0
- package/dist/profiles.js +25935 -24578
- package/dist/retrieval/chunk-location.d.ts +28 -0
- package/dist/retrieval/fallback.d.ts +24 -0
- package/dist/retrieval/index.d.ts +1 -0
- package/dist/retrieval/types.d.ts +16 -0
- package/internal-skills/organize/SKILL.md +43 -0
- package/package.json +2 -1
- package/skills/autorag/SKILL.md +18 -7
- package/skills/autorag-lite-setup/SKILL.md +24 -0
- package/skills/autorag-setup/SKILL.md +31 -5
package/dist/agent/results.d.ts
CHANGED
|
@@ -16,6 +16,8 @@ export declare const reportSchema: Type.TObject<{
|
|
|
16
16
|
evidence: Type.TArray<Type.TObject<{
|
|
17
17
|
excerpt: Type.TString;
|
|
18
18
|
lineNumber: Type.TOptional<Type.TInteger>;
|
|
19
|
+
lineEnd: Type.TOptional<Type.TInteger>;
|
|
20
|
+
section: Type.TOptional<Type.TString>;
|
|
19
21
|
}>>;
|
|
20
22
|
confidence: Type.TNumber;
|
|
21
23
|
}>>;
|
|
@@ -38,7 +40,8 @@ export declare const reportSchema: Type.TObject<{
|
|
|
38
40
|
documentType: Type.TOptional<Type.TString>;
|
|
39
41
|
documentArea: Type.TOptional<Type.TString>;
|
|
40
42
|
evidenceType: Type.TOptional<Type.TString>;
|
|
41
|
-
|
|
43
|
+
lineEnd: Type.TOptional<Type.TInteger>;
|
|
44
|
+
section: Type.TOptional<Type.TString>;
|
|
42
45
|
confidence: Type.TOptional<Type.TNumber>;
|
|
43
46
|
}>>>;
|
|
44
47
|
}>>;
|
|
@@ -47,6 +50,10 @@ export declare const reportSchema: Type.TObject<{
|
|
|
47
50
|
export interface AutoRAGEmittedEvidence {
|
|
48
51
|
readonly excerpt: string;
|
|
49
52
|
readonly lineNumber?: number;
|
|
53
|
+
/** Last line of the chunk; with {@link lineNumber} the exact range in the parsed document. */
|
|
54
|
+
readonly lineEnd?: number;
|
|
55
|
+
/** Article or heading the chunk sits in. */
|
|
56
|
+
readonly section?: string;
|
|
50
57
|
}
|
|
51
58
|
export interface AutoRAGEmittedResult {
|
|
52
59
|
readonly number: number;
|
|
@@ -64,13 +71,14 @@ export interface AutoRAGEvidenceRef {
|
|
|
64
71
|
readonly retrievalResultId?: string;
|
|
65
72
|
readonly chunkIndex?: number;
|
|
66
73
|
readonly lineNumber?: number;
|
|
74
|
+
readonly lineEnd?: number;
|
|
75
|
+
readonly section?: string;
|
|
67
76
|
readonly stableEvidenceId?: string;
|
|
68
77
|
readonly retrieverMix?: readonly string[];
|
|
69
78
|
readonly parserType?: string;
|
|
70
79
|
readonly documentType?: string;
|
|
71
80
|
readonly documentArea?: string;
|
|
72
81
|
readonly evidenceType?: string;
|
|
73
|
-
readonly evidenceLocation?: string;
|
|
74
82
|
readonly confidence?: number;
|
|
75
83
|
}
|
|
76
84
|
export interface AutoRAGMappingEntry {
|
|
@@ -9,7 +9,7 @@ export type SearchDocumentDiagnosticSeverity = "info" | "warning" | "error";
|
|
|
9
9
|
* (#21/#22) does not require another source-breaking type change; codes not yet
|
|
10
10
|
* emitted are still valid members.
|
|
11
11
|
*/
|
|
12
|
-
export type SearchDocumentDiagnosticCode = "empty-query" | "no-verified-results" | "unknown-warning" | "caller-tool-dropped" | "minsync-staging-excluded" | "minsync-file-skipped" | "minsync-sync-failed" | "minsync-lock-held" | "embedder-unavailable" | "embedding-identity-mismatch" | "lexical-tokenizer-unavailable" | "parser-skipped" | "parser-failed" | "parser-crashed" | "source-vanished" | "source-unreadable" | "source-read-failed" | "mirror-write-failed" | "parser-warning" | "duplicate-excluded" | "unsupported-file" | "stale-index" | "deleted-mirror" | "search-root-unavailable" | "mass-delete-suppressed" | "walk-truncated" | "directory-unreadable" | "pdf-extract-thin" | "retrieval-method-failed" | "rerank-failed" | "jikji-unavailable" | "jikji-prepare-failed" | "jikji-find-failed" | "everything-index-failed" | "fsearch-index-failed" | "fsearch-binary-missing" | "refresh-failed" | "refresh-interrupted" | "watch-failed" | "watch-limited" | "unknown-datasource-skill" | "no-final-answer" | "model-request-failed" | "tool-call-burst" | "query-routed" | "query-route-fallback" | "query-decomposition-failed" | "follow-up-skipped" | "follow-up-check-fallback" | "datasources-selected" | "datasource-selection-fallback" | "citation-without-result" | "citation-irrelevant" | "citation-relevance-fallback" | "evidence-judged" | "evidence-judgment-fallback" | "memory-search-fallback" | "self-config-unavailable" | "self-config-rolled-back" | "embedding-unavailable";
|
|
12
|
+
export type SearchDocumentDiagnosticCode = "empty-query" | "no-verified-results" | "unknown-warning" | "caller-tool-dropped" | "minsync-staging-excluded" | "minsync-file-skipped" | "minsync-sync-failed" | "minsync-lock-held" | "embedder-unavailable" | "embedding-identity-mismatch" | "lexical-tokenizer-unavailable" | "parser-skipped" | "parser-failed" | "parser-crashed" | "source-vanished" | "source-unreadable" | "source-read-failed" | "mirror-write-failed" | "parser-warning" | "duplicate-excluded" | "unsupported-file" | "stale-index" | "deleted-mirror" | "search-root-unavailable" | "mass-delete-suppressed" | "walk-truncated" | "directory-unreadable" | "pdf-extract-thin" | "retrieval-method-failed" | "rerank-failed" | "jikji-unavailable" | "jikji-prepare-failed" | "jikji-find-failed" | "everything-index-failed" | "fsearch-index-failed" | "fsearch-binary-missing" | "refresh-failed" | "refresh-interrupted" | "watch-failed" | "watch-limited" | "unknown-datasource-skill" | "no-final-answer" | "model-request-failed" | "tool-call-burst" | "query-routed" | "query-route-fallback" | "query-decomposition-failed" | "follow-up-skipped" | "follow-up-check-fallback" | "datasources-selected" | "datasource-selection-fallback" | "web-datasource-id-taken" | "web-search-failed" | "citation-without-result" | "line-reference-unverified" | "citation-irrelevant" | "citation-relevance-fallback" | "evidence-judged" | "evidence-judgment-fallback" | "memory-search-fallback" | "self-config-unavailable" | "self-config-rolled-back" | "organize-skill-unavailable" | "embedding-unavailable";
|
|
13
13
|
export interface SearchDocumentDiagnostic {
|
|
14
14
|
readonly code: SearchDocumentDiagnosticCode;
|
|
15
15
|
readonly severity: SearchDocumentDiagnosticSeverity;
|
|
@@ -19,7 +19,12 @@ export interface SearchDocumentDiagnostic {
|
|
|
19
19
|
}
|
|
20
20
|
export interface SearchDocumentEvidence {
|
|
21
21
|
readonly excerpt: string;
|
|
22
|
+
/** First line of the chunk in its parsed document, measured by the harness. */
|
|
22
23
|
readonly lineNumber?: number;
|
|
24
|
+
/** Last line of the chunk in its parsed document. */
|
|
25
|
+
readonly lineEnd?: number;
|
|
26
|
+
/** Article or heading the chunk sits in. */
|
|
27
|
+
readonly section?: string;
|
|
23
28
|
}
|
|
24
29
|
export interface SearchDocumentResult {
|
|
25
30
|
readonly number: number;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { PackagedAgentSkill } from "./packaged-skill.js";
|
|
1
2
|
/**
|
|
2
3
|
* Host opt-in for agent self-configuration: the Jev `config` branch, where the
|
|
3
4
|
* agent edits its own settings with the full `autorag-setup` skill in hand.
|
|
@@ -5,7 +6,7 @@
|
|
|
5
6
|
export interface SelfConfigOptions {
|
|
6
7
|
/** The active AutoRAG config file the agent may read and edit. */
|
|
7
8
|
readonly configPath: string;
|
|
8
|
-
/** Override for the `autorag-setup`
|
|
9
|
+
/** Override for the packaged `autorag-setup` skill file; defaults to the packaged skill. */
|
|
9
10
|
readonly skillPath?: string;
|
|
10
11
|
/**
|
|
11
12
|
* Check the config file after a config turn changed it. Resolves to a
|
|
@@ -14,13 +15,12 @@ export interface SelfConfigOptions {
|
|
|
14
15
|
*/
|
|
15
16
|
readonly validate?: (configPath: string) => Promise<string | undefined>;
|
|
16
17
|
}
|
|
17
|
-
/** Full text of the `autorag-setup` skill with its YAML front matter removed. */
|
|
18
|
-
export declare function loadSetupSkill(skillPath?: string): string;
|
|
19
18
|
export interface SelfConfigPromptInput {
|
|
20
19
|
readonly query: string;
|
|
21
20
|
readonly configPath: string;
|
|
22
21
|
readonly agentDir: string;
|
|
23
|
-
|
|
22
|
+
/** The loaded `autorag-setup` skill, embedded as a `<skill …>` invocation. */
|
|
23
|
+
readonly skill: PackagedAgentSkill;
|
|
24
24
|
/** True when `manage_automations` is available: file-triggered automations are then in scope. */
|
|
25
25
|
readonly automations?: boolean;
|
|
26
26
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `<skill name="…" location="…">…</skill>` invocation block AutoRAG embeds
|
|
3
|
+
* in a turn prompt: the shape pi uses for its file-backed skills, with a
|
|
4
|
+
* path-opaque `location`. AutoRAG loads skills that have no path the model
|
|
5
|
+
* should resolve against (datasource skills and its own packaged skills), so
|
|
6
|
+
* the location names the skill without exposing a real filesystem path.
|
|
7
|
+
*/
|
|
8
|
+
export interface SkillInvocation {
|
|
9
|
+
/** Skill name, as listed in the prompt's skill listing. */
|
|
10
|
+
readonly name: string;
|
|
11
|
+
/** Opaque, path-free location: `datasource://<name>` or `autorag-skill://<name>`. */
|
|
12
|
+
readonly location: string;
|
|
13
|
+
/** Full skill instructions. */
|
|
14
|
+
readonly content: string;
|
|
15
|
+
}
|
|
16
|
+
/** Render one skill's full instructions in the shared invocation shape. */
|
|
17
|
+
export declare function formatSkillInvocation(skill: SkillInvocation): string;
|
|
@@ -13,8 +13,8 @@ export interface UserRequest {
|
|
|
13
13
|
type SaveEntry = (request: UserRequest) => void;
|
|
14
14
|
/**
|
|
15
15
|
* What the user has said in this conversation, in order, exactly as typed: the first question, every
|
|
16
|
-
* follow-up, every steer. AutoRAG's own phase prompts (fast answer, verification,
|
|
17
|
-
* continuation) never enter it, because it is fed where the user's words arrive, not from the transcript.
|
|
16
|
+
* follow-up, every steer. AutoRAG's own phase prompts (fast answer, verification, the extra/organize/config
|
|
17
|
+
* turn, steer continuation) never enter it, because it is fed where the user's words arrive, not from the transcript.
|
|
18
18
|
*
|
|
19
19
|
* It is not truncated here. Whoever consumes it fits it to its own limit.
|
|
20
20
|
*/
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type DiscordAttachmentConnection } from "../../datasource/skills/factory.js";
|
|
2
|
+
import { type CliConfig } from "../config.js";
|
|
3
|
+
import type { CommandContext } from "./types.js";
|
|
4
|
+
/**
|
|
5
|
+
* `autorag attachments [status|download]` — show or fill each Discord connection's attachments folder.
|
|
6
|
+
*
|
|
7
|
+
* `status` re-checks every saved file (a deleted, renamed, or edited file is no longer counted as downloaded)
|
|
8
|
+
* and rewrites `download-status.json`. `download` additionally saves every attachment whose signed link still
|
|
9
|
+
* works, even when `connector.downloadAttachments` is `false`.
|
|
10
|
+
*
|
|
11
|
+
* Exit codes: 0 on success, 2 on config/usage error, 1 when a connection could not be checked.
|
|
12
|
+
*/
|
|
13
|
+
export declare function runAttachments(ctx: CommandContext, connections?: (config: CliConfig) => readonly DiscordAttachmentConnection[]): Promise<number>;
|
|
@@ -9,6 +9,8 @@ interface EvidenceView {
|
|
|
9
9
|
readonly retrievalResultId?: string;
|
|
10
10
|
readonly chunkIndex?: number;
|
|
11
11
|
readonly lineNumber?: number;
|
|
12
|
+
readonly lineEnd?: number;
|
|
13
|
+
readonly section?: string;
|
|
12
14
|
readonly metadata?: Record<string, unknown>;
|
|
13
15
|
}
|
|
14
16
|
export declare function evidenceFor(schema: MemorySchema, sessionId: string, resultNumber?: number): {
|
package/dist/cli/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
declare const COMMANDS: readonly ["init", "setup", "refresh", "status", "search", "evidence", "memory", "index", "watch", "health", "duplicates", "tui", "lite", "models", "update-check", "automate"];
|
|
2
|
+
declare const COMMANDS: readonly ["init", "setup", "refresh", "status", "search", "evidence", "memory", "index", "watch", "health", "duplicates", "tui", "lite", "models", "update-check", "automate", "attachments"];
|
|
3
3
|
type CommandName = (typeof COMMANDS)[number];
|
|
4
4
|
export type { CommandName };
|
|
5
5
|
interface ParsedArgs {
|