@tryformation/querylight-cli 0.1.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 (52) hide show
  1. package/Dockerfile +7 -0
  2. package/LICENSE +21 -0
  3. package/README.md +391 -0
  4. package/dist/chunk/chunk-store.d.ts +4 -0
  5. package/dist/chunk/chunker.d.ts +9 -0
  6. package/dist/cli/format.d.ts +4 -0
  7. package/dist/cli/main.d.ts +2 -0
  8. package/dist/cli/main.js +3523 -0
  9. package/dist/cli/run-cli.d.ts +5 -0
  10. package/dist/core/config.d.ts +4 -0
  11. package/dist/core/constants.d.ts +3 -0
  12. package/dist/core/errors.d.ts +17 -0
  13. package/dist/core/files.d.ts +1 -0
  14. package/dist/core/hashing.d.ts +1 -0
  15. package/dist/core/ids.d.ts +1 -0
  16. package/dist/core/jsonl.d.ts +2 -0
  17. package/dist/core/runs.d.ts +3 -0
  18. package/dist/core/workspace.d.ts +7 -0
  19. package/dist/index/index-store.d.ts +11 -0
  20. package/dist/index/querylight-indexer.d.ts +14 -0
  21. package/dist/index.d.ts +11 -0
  22. package/dist/index.js +2794 -0
  23. package/dist/ingest/adapters/crawl4ai-adapter.d.ts +1 -0
  24. package/dist/ingest/adapters/directory-adapter.d.ts +2 -0
  25. package/dist/ingest/adapters/file-adapter.d.ts +16 -0
  26. package/dist/ingest/adapters/rss-adapter.d.ts +7 -0
  27. package/dist/ingest/adapters/url-adapter.d.ts +11 -0
  28. package/dist/ingest/adapters/website-adapter.d.ts +2 -0
  29. package/dist/ingest/document-utils.d.ts +24 -0
  30. package/dist/ingest/extractors/docx-extractor.d.ts +1 -0
  31. package/dist/ingest/extractors/html-extractor.d.ts +5 -0
  32. package/dist/ingest/extractors/markdown-extractor.d.ts +1 -0
  33. package/dist/ingest/extractors/pdf-extractor.d.ts +1 -0
  34. package/dist/ingest/extractors/text-extractor.d.ts +1 -0
  35. package/dist/ingest/ingest-service.d.ts +23 -0
  36. package/dist/normalize/boilerplate.d.ts +1 -0
  37. package/dist/normalize/normalize-markdown.d.ts +2 -0
  38. package/dist/query/context-builder.d.ts +8 -0
  39. package/dist/query/related-service.d.ts +6 -0
  40. package/dist/query/search-service.d.ts +31 -0
  41. package/dist/report/diff-service.d.ts +23 -0
  42. package/dist/sources/source-model.d.ts +1 -0
  43. package/dist/sources/source-store.d.ts +7 -0
  44. package/dist/types/models.d.ts +309 -0
  45. package/dist/vector/dense.d.ts +13 -0
  46. package/dist/vector/runtime.d.ts +18 -0
  47. package/dist/vector/service.d.ts +26 -0
  48. package/dist/vector/sparse.d.ts +19 -0
  49. package/dist/vector/store.d.ts +20 -0
  50. package/dist/vector/text.d.ts +3 -0
  51. package/package.json +66 -0
  52. package/scripts/sparse-encode.py +104 -0
@@ -0,0 +1,5 @@
1
+ export declare function runCli(argv: string[]): Promise<{
2
+ exitCode: number;
3
+ stdout: string;
4
+ stderr: string;
5
+ }>;
@@ -0,0 +1,4 @@
1
+ import type { WorkspaceConfig } from "../types/models.js";
2
+ export declare const defaultConfig: () => WorkspaceConfig;
3
+ export declare function writeDefaultConfig(workspacePath: string, force?: boolean): Promise<void>;
4
+ export declare function loadConfig(workspacePath: string, configPath?: string): Promise<WorkspaceConfig>;
@@ -0,0 +1,3 @@
1
+ export declare const PACKAGE_NAME = "@tryformation/querylight-cli";
2
+ export declare const PACKAGE_VERSION = "0.1.0";
3
+ export declare const DEFAULT_WORKSPACE = ".kb";
@@ -0,0 +1,17 @@
1
+ export declare enum ExitCode {
2
+ Success = 0,
3
+ GeneralError = 1,
4
+ InvalidArguments = 2,
5
+ WorkspaceError = 3,
6
+ SourceError = 4,
7
+ IngestionError = 5,
8
+ IndexError = 6,
9
+ QueryError = 7,
10
+ ProviderError = 8
11
+ }
12
+ export declare class CliError extends Error {
13
+ readonly code: string;
14
+ readonly exitCode: ExitCode;
15
+ readonly details?: unknown | undefined;
16
+ constructor(message: string, code: string, exitCode: ExitCode, details?: unknown | undefined);
17
+ }
@@ -0,0 +1 @@
1
+ export declare function fileExists(filePath: string): Promise<boolean>;
@@ -0,0 +1 @@
1
+ export declare function sha256(input: string): string;
@@ -0,0 +1 @@
1
+ export declare function stableId(prefix: string, ...parts: string[]): string;
@@ -0,0 +1,2 @@
1
+ export declare function readJsonl<T>(filePath: string): Promise<T[]>;
2
+ export declare function writeJsonl<T>(filePath: string, records: T[]): Promise<void>;
@@ -0,0 +1,3 @@
1
+ import type { RunRecord } from "../types/models.js";
2
+ export declare function writeRun(workspacePath: string, run: RunRecord): Promise<void>;
3
+ export declare function listRuns(workspacePath: string): Promise<RunRecord[]>;
@@ -0,0 +1,7 @@
1
+ export declare function ensureWorkspace({ workspacePath, force }: {
2
+ workspacePath: string;
3
+ force?: boolean;
4
+ }): Promise<{
5
+ workspacePath: string;
6
+ }>;
7
+ export declare function assertWorkspaceExists(workspacePath: string): Promise<string>;
@@ -0,0 +1,11 @@
1
+ import type { IndexMetadata } from "../types/models.js";
2
+ export declare function writeIndexArtifacts({ workspacePath, indexState, metadata }: {
3
+ workspacePath: string;
4
+ indexState: object;
5
+ metadata: IndexMetadata;
6
+ }): Promise<{
7
+ indexPath: string;
8
+ metadataPath: string;
9
+ }>;
10
+ export declare function readLatestIndexState(workspacePath: string): Promise<object>;
11
+ export declare function readLatestIndexMetadata(workspacePath: string): Promise<IndexMetadata>;
@@ -0,0 +1,14 @@
1
+ import { TextFieldIndex } from "@tryformation/querylight-ts";
2
+ import type { IndexMetadata } from "../types/models.js";
3
+ export declare function createIndexMapping(extraFields?: string[]): Record<string, TextFieldIndex>;
4
+ export declare function buildIndex({ workspacePath, denseOverride, sparseOverride, buildAvailableModels }: {
5
+ workspacePath: string;
6
+ denseOverride?: boolean;
7
+ sparseOverride?: boolean;
8
+ buildAvailableModels?: boolean;
9
+ }): Promise<{
10
+ metadata: IndexMetadata;
11
+ indexPath: string;
12
+ denseBuilt: boolean;
13
+ sparseBuilt: boolean;
14
+ }>;
@@ -0,0 +1,11 @@
1
+ export * from "./types/models.js";
2
+ export * from "./core/workspace.js";
3
+ export * from "./core/config.js";
4
+ export * from "./sources/source-store.js";
5
+ export * from "./ingest/ingest-service.js";
6
+ export * from "./chunk/chunker.js";
7
+ export * from "./index/querylight-indexer.js";
8
+ export * from "./query/search-service.js";
9
+ export * from "./query/related-service.js";
10
+ export * from "./query/context-builder.js";
11
+ export * from "./report/diff-service.js";