@autorag/librarian 2.4.2 → 2.5.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.
Files changed (82) hide show
  1. package/NOTICE +68 -0
  2. package/README.md +77 -32
  3. package/dist/agent/agent.d.ts +73 -1
  4. package/dist/agent/fast-answer-tool.d.ts +46 -0
  5. package/dist/agent/peer-target-tool.d.ts +19 -0
  6. package/dist/agent/search-all-tool.d.ts +3 -0
  7. package/dist/agent/search-datasource-tool.d.ts +3 -0
  8. package/dist/agent/search-documents.d.ts +50 -5
  9. package/dist/agent/search-minsync-tool.d.ts +3 -0
  10. package/dist/agent/system-prompt.d.ts +1 -0
  11. package/dist/cli/command-help.d.ts +1 -0
  12. package/dist/cli/commands/gateway.d.ts +7 -0
  13. package/dist/cli/commands/lite-retrieve.d.ts +9 -0
  14. package/dist/cli/commands/models.d.ts +18 -0
  15. package/dist/cli/commands/p2p-policy.d.ts +2 -0
  16. package/dist/cli/commands/p2p.d.ts +7 -0
  17. package/dist/cli/commands/serve.d.ts +18 -0
  18. package/dist/cli/commands/setup.d.ts +2 -0
  19. package/dist/cli/commands/tui.d.ts +1 -1
  20. package/dist/cli/config.d.ts +20 -0
  21. package/dist/cli/index.d.ts +3 -1
  22. package/dist/cli/index.js +13892 -8650
  23. package/dist/cli/output.d.ts +6 -0
  24. package/dist/cli/setup.d.ts +61 -0
  25. package/dist/core.js +4965 -1385
  26. package/dist/datasource/connector-skill.d.ts +1 -1
  27. package/dist/datasource/connector.d.ts +1 -1
  28. package/dist/datasource/index.d.ts +1 -2
  29. package/dist/datasource/skills/discrawl/client.d.ts +12 -2
  30. package/dist/datasource/skills/discrawl/index.d.ts +1 -1
  31. package/dist/datasource/skills/discrawl/skill.d.ts +2 -1
  32. package/dist/datasource/skills/discrawl/types.d.ts +29 -21
  33. package/dist/datasource/skills/factory.d.ts +2 -1
  34. package/dist/datasource/skills/katok/client.d.ts +4 -7
  35. package/dist/datasource/skills/katok/types.d.ts +1 -6
  36. package/dist/embedding-runtime/cache.d.ts +21 -0
  37. package/dist/embedding-runtime/gateway.d.ts +27 -0
  38. package/dist/embedding-runtime/index.d.ts +120 -0
  39. package/dist/embedding-runtime/manifest.d.ts +24 -0
  40. package/dist/embedding-runtime/supervisor.d.ts +74 -0
  41. package/dist/embedding-runtime/types.d.ts +66 -0
  42. package/dist/filesystem/source-paths.d.ts +33 -2
  43. package/dist/index.js +4974 -1389
  44. package/dist/minsync/client.d.ts +25 -1
  45. package/dist/minsync/embedder-config.d.ts +15 -0
  46. package/dist/minsync/index.d.ts +4 -3
  47. package/dist/minsync/installer.d.ts +1 -1
  48. package/dist/minsync/local-embedder.d.ts +16 -0
  49. package/dist/minsync/method.d.ts +5 -0
  50. package/dist/minsync/types.d.ts +15 -0
  51. package/dist/minsync/workspace.d.ts +6 -0
  52. package/dist/mirror/index-store.d.ts +17 -0
  53. package/dist/mirror/sync.d.ts +8 -4
  54. package/dist/observability/run-log.d.ts +2 -0
  55. package/dist/p2p/approval-store.d.ts +31 -0
  56. package/dist/p2p/egress-gate.d.ts +22 -0
  57. package/dist/p2p/file-sharing.d.ts +33 -0
  58. package/dist/p2p/injection-classifier.d.ts +33 -0
  59. package/dist/p2p/injection-gate.d.ts +37 -0
  60. package/dist/p2p/pii-gate.d.ts +47 -0
  61. package/dist/p2p/policy-filter.d.ts +15 -0
  62. package/dist/p2p/policy.d.ts +77 -0
  63. package/dist/p2p/simplex-server.d.ts +95 -0
  64. package/dist/p2p/simplex-transport.d.ts +38 -0
  65. package/dist/p2p/wire.d.ts +39 -0
  66. package/dist/process/terminate-tree.d.ts +20 -0
  67. package/licenses/apache-2.0.txt +202 -0
  68. package/licenses/embedding-assets.json +104 -0
  69. package/licenses/gemma-notice.txt +24 -0
  70. package/licenses/gemma-section-3.2-flow-down.txt +9 -0
  71. package/licenses/gemma-terms-of-use.html +4750 -0
  72. package/licenses/gemma-terms-of-use.txt +158 -0
  73. package/licenses/llama.cpp-MIT.txt +21 -0
  74. package/licenses/qwen3-embedding-notice.txt +13 -0
  75. package/package.json +15 -10
  76. package/skills/autorag/SKILL.md +18 -6
  77. package/skills/autorag-lite-search/SKILL.md +24 -6
  78. package/skills/autorag-lite-setup/SKILL.md +10 -2
  79. package/skills/autorag-setup/SKILL.md +7 -9
  80. package/dist/datasource/skills/gmail/connector.d.ts +0 -30
  81. package/dist/datasource/skills/gmail/index.d.ts +0 -2
  82. package/dist/datasource/skills/gmail/skill.d.ts +0 -24
@@ -0,0 +1 @@
1
+ export declare function commandUsage(command: string | undefined): string | undefined;
@@ -0,0 +1,7 @@
1
+ import { type RuntimeStatus } from "../../embedding-runtime/index.js";
2
+ import type { CommandContext } from "./types.js";
3
+ export interface GatewayCommandDeps {
4
+ runtimeStatus?: () => Promise<RuntimeStatus>;
5
+ stopRuntime?: () => Promise<void>;
6
+ }
7
+ export declare function runGateway(ctx: CommandContext, deps?: GatewayCommandDeps): Promise<number>;
@@ -2,6 +2,11 @@ import type { CommandContext } from "./types.js";
2
2
  export interface LiteRetrieveEnvelope {
3
3
  readonly ok: true;
4
4
  readonly query: string;
5
+ /**
6
+ * True when the last refresh does not cover the current sources. Retrieval still
7
+ * runs; the caller decides whether to trust the result or refresh first.
8
+ */
9
+ readonly stale: boolean;
5
10
  readonly results: readonly LiteRetrieveResultItem[];
6
11
  readonly diagnostics: readonly LiteRetrieveDiagnostic[];
7
12
  }
@@ -18,6 +23,10 @@ export interface LiteRetrieveDiagnostic {
18
23
  readonly severity: string;
19
24
  readonly message: string;
20
25
  readonly source?: string;
26
+ /** Why a source is considered stale, e.g. `mtime-and-size-changed`. */
27
+ readonly reason?: string;
28
+ /** Suggested recovery action, e.g. `refresh`. */
29
+ readonly action?: string;
21
30
  }
22
31
  /**
23
32
  * Run the `autorag lite retrieve` command.
@@ -0,0 +1,18 @@
1
+ import type { ProfileId } from "../../embedding-runtime/types.js";
2
+ import type { CommandContext } from "./types.js";
3
+ export interface ModelsCommandDeps {
4
+ prefetchModel?: (profileId?: ProfileId) => Promise<{
5
+ profileId: ProfileId;
6
+ path: string;
7
+ }>;
8
+ importModel?: (profileId: ProfileId | undefined, sourcePath: string) => Promise<{
9
+ profileId: ProfileId;
10
+ path: string;
11
+ }>;
12
+ verifyModel?: (profileId?: ProfileId) => Promise<{
13
+ profileId: ProfileId;
14
+ path: string;
15
+ hash: string;
16
+ }>;
17
+ }
18
+ export declare function runModels(ctx: CommandContext, deps?: ModelsCommandDeps): Promise<number>;
@@ -0,0 +1,2 @@
1
+ import type { CommandContext } from "./types.js";
2
+ export declare function runP2pPolicy(ctx: CommandContext): number;
@@ -0,0 +1,7 @@
1
+ import type { CommandContext } from "./types.js";
2
+ /** Resolve the workspace used for P2P identity/policy, matching `autorag serve`. */
3
+ export declare function resolveP2pWorkspace(ctx: CommandContext): string;
4
+ /**
5
+ * `autorag p2p` — SimpleX peer trust management.
6
+ */
7
+ export declare function runP2p(ctx: CommandContext): Promise<number>;
@@ -0,0 +1,18 @@
1
+ import type { InjectionClassifierModel } from "../../p2p/injection-classifier.js";
2
+ import { type SimplexPeerServer, startSimplexPeerServer } from "../../p2p/simplex-server.js";
3
+ import { type SimplexTransport, type StartSimplexOptions } from "../../p2p/simplex-transport.js";
4
+ import { type ResolvedAgentModel, resolveAgentModel } from "../config.js";
5
+ import type { CommandContext } from "./types.js";
6
+ export interface ServeCommandDeps {
7
+ readonly startSimplexPeerServer?: typeof startSimplexPeerServer;
8
+ readonly startSimplexChat?: (options: StartSimplexOptions) => Promise<SimplexTransport>;
9
+ readonly waitUntilStopped?: (server: SimplexPeerServer) => Promise<void>;
10
+ readonly modelResolver?: typeof resolveAgentModel;
11
+ }
12
+ export declare function createInjectionClassifierModel(resolved: ResolvedAgentModel): InjectionClassifierModel;
13
+ /**
14
+ * `autorag serve` — start the P2P peer query server over SimpleX Chat.
15
+ * Peers reach this installation through SimpleX; all security gates run
16
+ * unchanged.
17
+ */
18
+ export declare function runServe(ctx: CommandContext, deps?: ServeCommandDeps): Promise<number>;
@@ -0,0 +1,2 @@
1
+ import type { CommandContext } from "./types.js";
2
+ export declare function runSetupCommand(ctx: CommandContext): Promise<number>;
@@ -26,7 +26,7 @@ export interface TuiPresenter {
26
26
  }
27
27
  type TuiAgent = Pick<AutoRAGAgent, "searchDocumentsStream"> & Partial<Pick<AutoRAGAgent, "subscribe" | "abort">>;
28
28
  export interface TuiDeps {
29
- agentFactory?: (opts?: AutoRAGAgentOptions) => TuiAgent;
29
+ agentFactory?: (opts?: Partial<AutoRAGAgentOptions>) => TuiAgent;
30
30
  modelResolver?: (config: CliConfig) => ResolvedAgentModel;
31
31
  tuiFactory?: (ctx: CommandContext) => TuiDriver;
32
32
  sessionStore?: TuiSessionStore;
@@ -31,6 +31,24 @@ export interface RawIndexingMethods {
31
31
  export interface NormalizedIndexingConfig {
32
32
  minSync: MinSyncMethodConfig;
33
33
  }
34
+ export interface P2pConfig {
35
+ enabled?: boolean;
36
+ port?: number;
37
+ host?: string;
38
+ /** SimpleX CLI database prefix (defaults to <workspace>/.autorag/p2p/simplex). */
39
+ simplexDbPrefix?: string;
40
+ maxBodyBytes?: number;
41
+ maxFileBytes?: number;
42
+ policy?: Record<string, unknown>;
43
+ quotas?: {
44
+ queriesPerHour?: number;
45
+ burst?: number;
46
+ };
47
+ injectionClassifier?: boolean;
48
+ piiNer?: boolean;
49
+ searchTimeoutMs?: number;
50
+ newFilesPublic?: boolean;
51
+ }
34
52
  export interface UiConfig {
35
53
  host?: string;
36
54
  port?: number;
@@ -86,6 +104,8 @@ export interface CliConfig {
86
104
  datasourceAccess?: DatasourceAccessContextOptions;
87
105
  /** Optional local/deployment settings for the datasource UI. */
88
106
  ui?: UiConfig;
107
+ /** P2P sharing configuration. Disabled by default. */
108
+ p2p?: P2pConfig;
89
109
  }
90
110
  export interface ResolveConfigInput {
91
111
  flags: Record<string, string | boolean | undefined>;
@@ -1,4 +1,7 @@
1
1
  #!/usr/bin/env node
2
+ declare const COMMANDS: readonly ["init", "setup", "refresh", "status", "search", "feedback", "evidence", "memory", "index", "watch", "health", "duplicates", "tui", "ui", "serve", "p2p", "lite", "models", "gateway"];
3
+ type CommandName = (typeof COMMANDS)[number];
4
+ export type { CommandName };
2
5
  interface ParsedArgs {
3
6
  positionals: string[];
4
7
  flags: Record<string, string | boolean>;
@@ -7,4 +10,3 @@ export declare function parseArgs(argv: readonly string[]): ParsedArgs | {
7
10
  error: string;
8
11
  };
9
12
  export declare function main(argv: readonly string[]): Promise<number>;
10
- export {};