@g3nomaly/analyze 0.1.0 → 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 (97) hide show
  1. package/README.md +10 -5
  2. package/dist/api/bundle-builder.d.ts +29 -10
  3. package/dist/api/bundle-cache.d.ts +7 -4
  4. package/dist/api/bundle-loader.d.ts +10 -3
  5. package/dist/api/create-docs.d.ts +33 -14
  6. package/dist/api/embedding.d.ts +16 -7
  7. package/dist/api/errors.d.ts +13 -6
  8. package/dist/api/list.d.ts +20 -20
  9. package/dist/api/options.d.ts +18 -22
  10. package/dist/api/refs.d.ts +24 -21
  11. package/dist/api/scan.d.ts +24 -12
  12. package/dist/api/search.d.ts +27 -21
  13. package/dist/api/services.d.ts +9 -1
  14. package/dist/api/show.d.ts +15 -19
  15. package/dist/api/site-reader.d.ts +11 -3
  16. package/dist/api/site-writer.d.ts +30 -7
  17. package/dist/api/source.d.ts +23 -12
  18. package/dist/api/target.d.ts +2 -0
  19. package/dist/cli.js +670 -238
  20. package/dist/embeddings/index-builder.d.ts +3 -1
  21. package/dist/embeddings/model.d.ts +26 -13
  22. package/dist/embeddings/searcher.d.ts +24 -7
  23. package/dist/embeddings/vectors.d.ts +3 -1
  24. package/dist/embeddings/words.d.ts +7 -3
  25. package/dist/index.d.ts +1 -1
  26. package/dist/index.js +647 -229
  27. package/dist/model/index.d.ts +416 -188
  28. package/dist/model/registry.d.ts +204 -11
  29. package/dist/query/graph.d.ts +83 -26
  30. package/dist/query/name-search.d.ts +39 -21
  31. package/dist/query/semantic.d.ts +11 -3
  32. package/dist/retrieval/describe.d.ts +11 -4
  33. package/dist/retrieval/filter.d.ts +27 -8
  34. package/dist/retrieval/index.d.ts +1 -1
  35. package/dist/retrieval/markdown.d.ts +3 -2
  36. package/dist/retrieval/report.d.ts +147 -70
  37. package/dist/retrieval/resolve.d.ts +11 -7
  38. package/dist/retrieval/retriever.d.ts +34 -23
  39. package/dist/retrieval/summary.d.ts +6 -3
  40. package/dist/scanner/code/doc/clean.d.ts +31 -5
  41. package/dist/scanner/code/doc/index.d.ts +7 -1
  42. package/dist/scanner/code/doc/markdown.d.ts +6 -1
  43. package/dist/scanner/code/doc/python.d.ts +6 -1
  44. package/dist/scanner/code/doc/tagged.d.ts +13 -4
  45. package/dist/scanner/code/doc/types.d.ts +16 -5
  46. package/dist/scanner/code/doc/xml.d.ts +6 -1
  47. package/dist/scanner/code/example.d.ts +31 -10
  48. package/dist/scanner/code/extract.d.ts +56 -21
  49. package/dist/scanner/code/grammar.d.ts +20 -5
  50. package/dist/scanner/code/language.d.ts +100 -66
  51. package/dist/scanner/code/languages/index.d.ts +21 -7
  52. package/dist/scanner/code/languages/shared.d.ts +23 -4
  53. package/dist/scanner/code/planner.d.ts +50 -14
  54. package/dist/scanner/code/symbols.d.ts +86 -20
  55. package/dist/scanner/code/types.d.ts +48 -15
  56. package/dist/scanner/config.d.ts +42 -0
  57. package/dist/scanner/content.d.ts +49 -14
  58. package/dist/scanner/decisions/parse.d.ts +20 -11
  59. package/dist/scanner/decisions/planner.d.ts +20 -8
  60. package/dist/scanner/docs.d.ts +36 -19
  61. package/dist/scanner/files.d.ts +44 -19
  62. package/dist/scanner/glossary/parse.d.ts +17 -7
  63. package/dist/scanner/glossary/planner.d.ts +15 -8
  64. package/dist/scanner/glossary/terms.d.ts +57 -27
  65. package/dist/scanner/graph/builder.d.ts +80 -21
  66. package/dist/scanner/highlight.d.ts +32 -9
  67. package/dist/scanner/ignore.d.ts +25 -0
  68. package/dist/scanner/index.d.ts +5 -2
  69. package/dist/scanner/markdown/frontmatter.d.ts +18 -3
  70. package/dist/scanner/markdown/links.d.ts +19 -9
  71. package/dist/scanner/markdown/outline.d.ts +13 -5
  72. package/dist/scanner/markdown/renderer.d.ts +32 -13
  73. package/dist/scanner/openapi/planner.d.ts +20 -8
  74. package/dist/scanner/packages.d.ts +28 -0
  75. package/dist/scanner/reporter.d.ts +5 -2
  76. package/dist/scanner/scanner.d.ts +21 -7
  77. package/dist/scanner/schema/definitions.d.ts +18 -8
  78. package/dist/scanner/schema/describe.d.ts +44 -18
  79. package/dist/scanner/schema/planner.d.ts +6 -3
  80. package/dist/scanner/schema/registry.d.ts +23 -16
  81. package/dist/scanner/skills/classify.d.ts +2 -1
  82. package/dist/scanner/skills/layout.d.ts +27 -9
  83. package/dist/scanner/skills/planner.d.ts +19 -4
  84. package/dist/scanner/specs.d.ts +8 -2
  85. package/dist/scanner/sql/catalog.d.ts +21 -7
  86. package/dist/scanner/sql/cursor.d.ts +9 -4
  87. package/dist/scanner/sql/database.d.ts +6 -3
  88. package/dist/scanner/sql/parse.d.ts +62 -27
  89. package/dist/scanner/sql/planner.d.ts +6 -2
  90. package/dist/scanner/sql/query.d.ts +34 -21
  91. package/dist/scanner/sql/registry.d.ts +24 -10
  92. package/dist/scanner/sql/source.d.ts +1 -0
  93. package/dist/scanner/sql/statements.d.ts +9 -3
  94. package/dist/scanner/sql/tokens.d.ts +25 -12
  95. package/dist/scanner/tasks/layout.d.ts +22 -10
  96. package/dist/scanner/tasks/planner.d.ts +64 -9
  97. package/package.json +2 -2
@@ -1,32 +1,44 @@
1
1
  import { z } from 'zod';
2
- /** What decides the content of a scan. */
2
+ /**
3
+ * What decides the content of a scan.
4
+ *
5
+ * @property repo - Absolute path of the repository to document.
6
+ * @property skillDirs - Absolute skill directories. Empty means: find every `SKILL.md` in the repository.
7
+ * @property docDirs - Absolute docs directories. Empty means: every markdown, JSON and YAML file in the repository.
8
+ * @property excludes - Glob patterns of paths to skip.
9
+ * @property embeddings - Whether the bundle gets the embedding model and search by meaning.
10
+ */
3
11
  export interface ScanOptions {
4
- /** Absolute path of the repository to document. */
5
12
  readonly repo: string;
6
- /** Absolute skill directories. Empty means: find every `SKILL.md` in the repository. */
7
13
  readonly skillDirs: readonly string[];
8
- /** Absolute docs directories. Empty means: every markdown, JSON and YAML file in the repository. */
9
14
  readonly docDirs: readonly string[];
10
15
  readonly excludes: readonly string[];
11
- /** Whether the bundle gets the embedding model and search by meaning. */
12
16
  readonly embeddings: boolean;
13
17
  }
14
- /** The options that choose what to scan, as a caller passes them. Relative paths resolve against the working directory. */
18
+ /**
19
+ * The options that choose what to scan, as a caller passes them. Relative paths resolve against the working directory.
20
+ *
21
+ * @property repo - Repository to read. Default: the working directory.
22
+ * @property skillDirs - Read skills from these directories instead of the repository.
23
+ * @property docDirs - Read docs from these directories instead of the repository.
24
+ * @property excludes - Glob patterns of paths to skip, such as `src/legacy/**`.
25
+ * @property embeddings - `false` leaves out search by meaning. Default: `true`.
26
+ */
15
27
  export declare const scanShape: {
16
- /** Repository to read. Default: the working directory. */
17
28
  repo: z.ZodOptional<z.ZodString>;
18
- /** Read skills from these directories instead of the repository. */
19
29
  skillDirs: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
20
- /** Read docs from these directories instead of the repository. */
21
30
  docDirs: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
22
- /** Glob patterns of paths to skip, such as `src/legacy/**`. */
23
31
  excludes: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
24
- /** `false` leaves out search by meaning. Default: `true`. */
25
32
  embeddings: z.ZodOptional<z.ZodBoolean>;
26
33
  };
27
34
  /** The scan options after validation, before defaults. */
28
35
  export type ScanFields = z.output<z.ZodObject<typeof scanShape>>;
29
- /** Fills in the defaults of validated scan options and makes their paths absolute against the working directory. */
36
+ /**
37
+ * Fills in the defaults of validated scan options and makes their paths absolute against the working directory.
38
+ *
39
+ * @param fields - Validated scan options.
40
+ * @returns The scan options, with defaults filled in.
41
+ */
30
42
  export declare function scanOf(fields: ScanFields): ScanOptions;
31
43
  /**
32
44
  * Names the site file of a repository. `createDocs` writes it, and nothing else outside the cache.
@@ -2,39 +2,32 @@ import { z } from 'zod';
2
2
  import { type NodeFilter, type Retriever, type SearchHit, type SearchMode } from '../retrieval';
3
3
  /** Most hits of a search without a limit. */
4
4
  export declare const DEFAULT_SEARCH_LIMIT = 10;
5
+ /**
6
+ * Schema of the `search` options.
7
+ *
8
+ * @property query - Words to find.
9
+ * @property by - `name` searches by words, `meaning` by the embedding model, `both` by both. Default: `both`.
10
+ * @property limit - Most hits. Default: 10.
11
+ */
5
12
  declare const searchSchema: z.ZodPipe<z.ZodObject<{
6
13
  onWarning: z.ZodOptional<z.ZodCustom<import("./options").WarningHandler, import("./options").WarningHandler>>;
7
14
  kinds: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodEnum<{
8
- agent: "agent";
9
- api: "api";
10
- asset: "asset";
11
- catalog: "catalog";
12
15
  class: "class";
13
- database: "database";
14
16
  decision: "decision";
15
- decisions: "decisions";
16
17
  definition: "definition";
17
- document: "document";
18
18
  enum: "enum";
19
19
  field: "field";
20
+ file: "file";
20
21
  folder: "folder";
21
22
  function: "function";
22
- glossary: "glossary";
23
- hook: "hook";
24
23
  interface: "interface";
25
- json: "json";
26
- method: "method";
27
24
  namespace: "namespace";
28
25
  operation: "operation";
26
+ package: "package";
29
27
  parameter: "parameter";
30
28
  phase: "phase";
31
29
  plan: "plan";
32
30
  query: "query";
33
- reference: "reference";
34
- schema: "schema";
35
- section: "section";
36
- skill: "skill";
37
- source: "source";
38
31
  struct: "struct";
39
32
  table: "table";
40
33
  task: "task";
@@ -74,7 +67,7 @@ declare const searchSchema: z.ZodPipe<z.ZodObject<{
74
67
  };
75
68
  }, {
76
69
  onWarning?: import("./options").WarningHandler | undefined;
77
- kinds?: readonly ("agent" | "api" | "asset" | "catalog" | "class" | "database" | "decision" | "decisions" | "definition" | "document" | "enum" | "field" | "folder" | "function" | "glossary" | "hook" | "interface" | "json" | "method" | "namespace" | "operation" | "parameter" | "phase" | "plan" | "query" | "reference" | "schema" | "section" | "skill" | "source" | "struct" | "table" | "task" | "term" | "trait" | "type")[] | undefined;
70
+ kinds?: readonly ("class" | "decision" | "definition" | "enum" | "field" | "file" | "folder" | "function" | "interface" | "namespace" | "operation" | "package" | "parameter" | "phase" | "plan" | "query" | "struct" | "table" | "task" | "term" | "trait" | "type")[] | undefined;
78
71
  section?: "code" | "database" | "docs" | "skills" | "tasks" | undefined;
79
72
  repo?: string | undefined;
80
73
  skillDirs?: readonly string[] | undefined;
@@ -89,25 +82,38 @@ declare const searchSchema: z.ZodPipe<z.ZodObject<{
89
82
  }>>;
90
83
  /** Options of `search`: the words, how to match them, and the bundle to search. */
91
84
  export type SearchOptions = z.input<typeof searchSchema>;
92
- /** One search on a loaded bundle. */
85
+ /**
86
+ * One search on a loaded bundle.
87
+ *
88
+ * @property query - The words to find.
89
+ * @property mode - How to match them: by words, by meaning, or both.
90
+ * @property limit - Most hits.
91
+ * @property filter - Narrows the nodes that count.
92
+ */
93
93
  export interface SearchRequest {
94
94
  readonly query: string;
95
95
  readonly mode: SearchMode;
96
96
  readonly limit: number;
97
97
  readonly filter: NodeFilter;
98
98
  }
99
- /** What `search` finds. The CLI prints it with `search --json`. */
99
+ /**
100
+ * What `search` finds. The CLI prints it with `search --json`.
101
+ *
102
+ * @property query - The words searched for.
103
+ * @property mode - How the words were matched.
104
+ * @property model - Name of the embedding model of the bundle. `null` when the bundle has none.
105
+ * @property hits - Hits, best first.
106
+ */
100
107
  export interface SearchResult {
101
108
  readonly query: string;
102
109
  readonly mode: SearchMode;
103
- /** Name of the embedding model of the bundle. `null` when the bundle has none. */
104
110
  readonly model: string | null;
105
- /** Hits, best first. */
106
111
  readonly hits: readonly SearchHit[];
107
112
  }
108
113
  /**
109
114
  * Searches a loaded bundle.
110
115
  *
116
+ * @param retriever - The loaded bundle to search.
111
117
  * @param request - The words, the mode, the limit and the filter.
112
118
  * @returns The hits, best first.
113
119
  * @throws {QueryError} When the search is by meaning and the bundle has no embeddings.
@@ -3,5 +3,13 @@ import { BundleBuilder } from './bundle-builder';
3
3
  import type { ScanOptions } from './scan';
4
4
  /** Name and version of the tool, recorded in every bundle it builds. */
5
5
  export declare const GENERATOR: string;
6
- /** Wires the services that scan one repository into a builder, which hands warnings of the scan to `reporter`. */
6
+ /**
7
+ * @brief Wires the services that scan one repository into a builder.
8
+ *
9
+ * Reads the `.analyzeignore` of the repository, creating it when absent, and skips its patterns and `scan.excludes`.
10
+ *
11
+ * @param scan - What to scan. Its `embeddings` flag decides whether the builder embeds the nodes.
12
+ * @param reporter - Receives the warnings of the scan.
13
+ * @returns A builder for that scan.
14
+ */
7
15
  export declare function createBuilder(scan: ScanOptions, reporter: Reporter): BundleBuilder;
@@ -1,38 +1,29 @@
1
1
  import { z } from 'zod';
2
2
  import type { NodeFilter, NodeReport, Retriever } from '../retrieval';
3
+ /**
4
+ * Schema of the `show` options.
5
+ *
6
+ * @property target - Id, path or name of the node.
7
+ */
3
8
  declare const showSchema: z.ZodPipe<z.ZodObject<{
4
9
  onWarning: z.ZodOptional<z.ZodCustom<import("./options").WarningHandler, import("./options").WarningHandler>>;
5
10
  kinds: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodEnum<{
6
- agent: "agent";
7
- api: "api";
8
- asset: "asset";
9
- catalog: "catalog";
10
11
  class: "class";
11
- database: "database";
12
12
  decision: "decision";
13
- decisions: "decisions";
14
13
  definition: "definition";
15
- document: "document";
16
14
  enum: "enum";
17
15
  field: "field";
16
+ file: "file";
18
17
  folder: "folder";
19
18
  function: "function";
20
- glossary: "glossary";
21
- hook: "hook";
22
19
  interface: "interface";
23
- json: "json";
24
- method: "method";
25
20
  namespace: "namespace";
26
21
  operation: "operation";
22
+ package: "package";
27
23
  parameter: "parameter";
28
24
  phase: "phase";
29
25
  plan: "plan";
30
26
  query: "query";
31
- reference: "reference";
32
- schema: "schema";
33
- section: "section";
34
- skill: "skill";
35
- source: "source";
36
27
  struct: "struct";
37
28
  table: "table";
38
29
  task: "task";
@@ -64,7 +55,7 @@ declare const showSchema: z.ZodPipe<z.ZodObject<{
64
55
  };
65
56
  }, {
66
57
  onWarning?: import("./options").WarningHandler | undefined;
67
- kinds?: readonly ("agent" | "api" | "asset" | "catalog" | "class" | "database" | "decision" | "decisions" | "definition" | "document" | "enum" | "field" | "folder" | "function" | "glossary" | "hook" | "interface" | "json" | "method" | "namespace" | "operation" | "parameter" | "phase" | "plan" | "query" | "reference" | "schema" | "section" | "skill" | "source" | "struct" | "table" | "task" | "term" | "trait" | "type")[] | undefined;
58
+ kinds?: readonly ("class" | "decision" | "definition" | "enum" | "field" | "file" | "folder" | "function" | "interface" | "namespace" | "operation" | "package" | "parameter" | "phase" | "plan" | "query" | "struct" | "table" | "task" | "term" | "trait" | "type")[] | undefined;
68
59
  section?: "code" | "database" | "docs" | "skills" | "tasks" | undefined;
69
60
  repo?: string | undefined;
70
61
  skillDirs?: readonly string[] | undefined;
@@ -77,15 +68,20 @@ declare const showSchema: z.ZodPipe<z.ZodObject<{
77
68
  }>>;
78
69
  /** Options of `show`: the node, and the bundle to read it from. */
79
70
  export type ShowOptions = z.input<typeof showSchema>;
80
- /** One `show` on a loaded bundle. */
71
+ /**
72
+ * One `show` on a loaded bundle.
73
+ *
74
+ * @property target - Id, path or name of the node.
75
+ * @property filter - Narrows a name to one node.
76
+ */
81
77
  export interface ShowRequest {
82
- /** Id, path or name of the node. */
83
78
  readonly target: string;
84
79
  readonly filter: NodeFilter;
85
80
  }
86
81
  /**
87
82
  * Describes one node of a loaded bundle.
88
83
  *
84
+ * @param retriever - The loaded bundle to read.
89
85
  * @param request - The node and the filter that narrows a name.
90
86
  * @returns The report of the node: text, parameters, references.
91
87
  * @throws {QueryError} When no node fits the target, or several do.
@@ -1,11 +1,19 @@
1
1
  import { type DocsBundle } from '../model';
2
- /** Checks that parsed JSON has the parts of a bundle that queries read: `meta`, `nodes` and `edges`. */
2
+ /**
3
+ * Checks that parsed JSON has the parts of a bundle that queries read: `meta`, `nodes` and `edges`.
4
+ *
5
+ * @param value - Parsed JSON to check.
6
+ * @returns `true` when `value` has all three parts.
7
+ */
3
8
  export declare function isBundle(value: unknown): value is DocsBundle;
4
9
  /**
5
- * Reads the bundle back out of a site that `createDocs` wrote. The inverse
6
- * of `HtmlSiteWriter.render`.
10
+ * @brief Reads the bundle back out of a site that `createDocs` wrote.
11
+ *
12
+ * The inverse of `HtmlSiteWriter.render`: parses the JSON in the data element of the site.
7
13
  *
14
+ * @param html - Text of the site file.
8
15
  * @param path - Path of the file, only for the error message.
16
+ * @returns The bundle the site holds.
9
17
  * @throws {SourceError} When the file is no analyze site.
10
18
  */
11
19
  export declare function readSite(html: string, path: string): DocsBundle;
@@ -1,20 +1,43 @@
1
1
  import { type DocsBundle } from '../model';
2
2
  /** Writes a bundle as a documentation site. */
3
3
  export interface SiteWriter {
4
- /** Writes the site for `bundle` to `path` and returns its size in bytes. */
4
+ /**
5
+ * Writes the site for `bundle` to `path`.
6
+ *
7
+ * @param path - Where to write the site file.
8
+ * @param bundle - The bundle the site shows.
9
+ * @returns Size of the written site in bytes.
10
+ */
5
11
  write(path: string, bundle: DocsBundle): Promise<number>;
6
12
  }
7
13
  /**
8
- * Fills the prebuilt single-file app with a bundle: the title into `<title>`, the bundle as JSON into the data
9
- * `<script>` element. Holds the template. `createDocs` creates one with `TEMPLATE_HTML` from `src/api/template.ts`;
10
- * `readSite` reads the result back.
14
+ * @brief Fills the prebuilt single-file app with a bundle.
15
+ *
16
+ * Puts the title into `<title>` and the bundle as JSON into the data `<script>` element. Holds the template.
17
+ * `createDocs` creates one with `TEMPLATE_HTML` from `src/api/template.ts`; `readSite` reads the result back.
18
+ * Created with `new HtmlSiteWriter(TEMPLATE_HTML)`.
11
19
  */
12
20
  export declare class HtmlSiteWriter implements SiteWriter {
13
21
  private readonly template;
14
- /** Creates a writer for a template that holds the title and data placeholders once each. */
22
+ /**
23
+ * Creates a writer for one template.
24
+ *
25
+ * @param template - Page text with the title and data placeholders, each exactly once.
26
+ */
15
27
  constructor(template: string);
16
- /** Returns the template with the escaped title and the bundle as script-safe JSON in place of the placeholders. */
28
+ /**
29
+ * Returns the template with the escaped title and the bundle as script-safe JSON in place of the placeholders.
30
+ *
31
+ * @param bundle - The bundle to put in the page.
32
+ * @returns The finished page text.
33
+ */
17
34
  render(bundle: DocsBundle): string;
18
- /** Writes the rendered site to `path`, creating its directory, and returns its size in bytes. */
35
+ /**
36
+ * Writes the rendered site to `path`, creating its directory.
37
+ *
38
+ * @param path - Where to write the site file.
39
+ * @param bundle - The bundle to render.
40
+ * @returns Size of the written site in bytes.
41
+ */
19
42
  write(path: string, bundle: DocsBundle): Promise<number>;
20
43
  }
@@ -2,44 +2,55 @@ import { z } from 'zod';
2
2
  import { Retriever } from '../retrieval';
3
3
  import type { Reporter } from '../scanner';
4
4
  import { type ScanOptions } from './scan';
5
- /** Where a query gets its bundle. */
6
- export type BundleSource =
7
- /** An HTML file that `createDocs` wrote. */
8
- {
5
+ /**
6
+ * Where a query gets its bundle: `site` is an HTML file that `createDocs` wrote; `scan` is a scan of the
7
+ * repository, whose result is kept in `analyze_out/cache` of the repository when `cache` is set.
8
+ */
9
+ export type BundleSource = {
9
10
  readonly kind: 'site';
10
11
  readonly file: string;
11
- }
12
- /** A scan of the repository. With `cache`, its result is kept in `analyze_out/cache` of the repository. */
13
- | {
12
+ } | {
14
13
  readonly kind: 'scan';
15
14
  readonly scan: ScanOptions;
16
15
  readonly cache: boolean;
17
16
  };
18
- /** The options that choose the bundle a query reads, as a caller passes them. */
17
+ /**
18
+ * The options that choose the bundle a query reads, as a caller passes them.
19
+ *
20
+ * @property from - An HTML file that `createDocs` wrote, read in place of the repository. Excludes the scan options.
21
+ * @property cache - `false` scans the repository again even when no file changed. Default: `true`.
22
+ */
19
23
  export declare const sourceShape: {
20
24
  repo: z.ZodOptional<z.ZodString>;
21
25
  skillDirs: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
22
26
  docDirs: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
23
27
  excludes: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
24
28
  embeddings: z.ZodOptional<z.ZodBoolean>;
25
- /** An HTML file that `createDocs` wrote, read in place of the repository. Excludes the scan options. */
26
29
  from: z.ZodOptional<z.ZodString>;
27
- /** `false` scans the repository again even when no file changed. Default: `true`. */
28
30
  cache: z.ZodOptional<z.ZodBoolean>;
29
31
  };
30
32
  /** The source options after validation. */
31
33
  type SourceFields = z.output<z.ZodObject<typeof sourceShape>>;
32
- /** Adds an issue to the schema's refinement context for every scan option that comes with `from`. */
34
+ /**
35
+ * Adds an issue to the schema's refinement context for every scan option that comes with `from`.
36
+ *
37
+ * @param fields - Validated source options.
38
+ * @param context - Refinement context of the schema, which collects the issues.
39
+ */
33
40
  export declare function checkSource(fields: SourceFields, context: z.RefinementCtx): void;
34
41
  /**
35
- * Turns validated source options, checked by `checkSource`, into a bundle source.
42
+ * Turns validated source options into a bundle source.
36
43
  *
44
+ * @param fields - Validated source options, checked by `checkSource` first.
37
45
  * @returns The site file to read, with an absolute path, or the scan to run.
38
46
  */
39
47
  export declare function sourceOf(fields: SourceFields): BundleSource;
40
48
  /**
41
49
  * Loads the bundle of a source and opens it for queries, handing warnings of the load to `reporter`.
42
50
  *
51
+ * @param source - Where the bundle comes from.
52
+ * @param reporter - Receives the warnings of the load.
53
+ * @returns The retriever that answers queries on the bundle.
43
54
  * @throws {SourceError} When the site file or the repository cannot be read.
44
55
  */
45
56
  export declare function openRetriever(source: BundleSource, reporter: Reporter): Promise<Retriever>;
@@ -3,8 +3,10 @@ import type { NodeFilter, Retriever } from '../retrieval';
3
3
  /**
4
4
  * Finds the one node a caller means.
5
5
  *
6
+ * @param retriever - Retriever the node is looked up in.
6
7
  * @param target - An id, a path or a name.
7
8
  * @param filter - Narrows the nodes that count.
9
+ * @returns The one node that fits.
8
10
  * @throws {QueryError} When no node fits, or several do. The message lists the candidates with their ids.
9
11
  */
10
12
  export declare function nodeOf(retriever: Retriever, target: string, filter: NodeFilter): NodeRef;