@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
@@ -4,32 +4,44 @@ export declare const TASKS_DIR = "tasks";
4
4
  export declare const DECISIONS_DIR = "decisions";
5
5
  /** File at the root of the tree that holds its terms. */
6
6
  export declare const VOCABULARY_FILE = "vocabulary.md";
7
- /** A phase of the tree as its files lay it out. */
7
+ /**
8
+ * A phase of the tree as its files lay it out.
9
+ *
10
+ * @property name - Folder name of the phase.
11
+ * @property file - Tree-relative path of `<plan>/<phase>/<phase>.md`.
12
+ * @property tasks - Tree-relative paths of the task files, sorted by name.
13
+ */
8
14
  export interface PhaseFiles {
9
15
  readonly name: string;
10
- /** Tree-relative path of `<plan>/<phase>/<phase>.md`. */
11
16
  readonly file: string;
12
- /** Tree-relative paths of the task files, sorted by name. */
13
17
  readonly tasks: readonly string[];
14
18
  }
15
- /** A plan of the tree as its files lay it out. */
19
+ /**
20
+ * A plan of the tree as its files lay it out.
21
+ *
22
+ * @property name - Folder name of the plan.
23
+ * @property file - Tree-relative path of `<plan>/<plan>.md`.
24
+ * @property phases - Sorted by folder name, which is the order task-manager queues them in.
25
+ * @property decisions - Tree-relative paths of the decision files, sorted by name.
26
+ */
16
27
  export interface PlanFiles {
17
28
  readonly name: string;
18
- /** Tree-relative path of `<plan>/<plan>.md`. */
19
29
  readonly file: string;
20
- /** Sorted by folder name, which is the order task-manager queues them in. */
21
30
  readonly phases: readonly PhaseFiles[];
22
- /** Tree-relative paths of the decision files, sorted by name. */
23
31
  readonly decisions: readonly string[];
24
32
  }
25
- /** The task tree as its files lay it out. */
33
+ /**
34
+ * The task tree as its files lay it out.
35
+ *
36
+ * @property plans - Plans in folder order.
37
+ * @property vocabulary - Tree-relative path of the vocabulary, or `null` when the tree has none.
38
+ */
26
39
  export interface TreeFiles {
27
40
  readonly plans: readonly PlanFiles[];
28
- /** Tree-relative path of the vocabulary, or `null` when the tree has none. */
29
41
  readonly vocabulary: string | null;
30
42
  }
31
43
  /**
32
- * Sorts the files of a task tree into plans, phases, tasks and decisions by
44
+ * @brief Sorts the files of a task tree into plans, phases, tasks and decisions by
33
45
  * where they are: `<plan>/<plan>.md`, `<plan>/<phase>/<phase>.md`,
34
46
  * `<plan>/<phase>/tasks/<id>.md` and `<plan>/decisions/<id>.md`. Index files
35
47
  * and any other file are left out, since task-manager derives them.
@@ -6,13 +6,16 @@ import type { GraphBuilder } from '../graph/builder';
6
6
  import type { ProseResolvers } from '../markdown/links';
7
7
  import type { MarkdownRenderer } from '../markdown/renderer';
8
8
  import type { Reporter } from '../reporter';
9
- /** The task tree of one scan: the files below its directory, with paths relative to the scanned root. */
9
+ /**
10
+ * The task tree of one scan: the files below its directory, with paths relative to the scanned root.
11
+ *
12
+ * @property dir - Root-relative POSIX path of the tree, such as `docs/task-manager`.
13
+ */
10
14
  export interface TaskTreeSource extends Source {
11
- /** Root-relative POSIX path of the tree, such as `docs/task-manager`. */
12
15
  readonly dir: string;
13
16
  }
14
17
  /**
15
- * Adds the tasks section to the graph from a task-manager tree: one `plan`
18
+ * @brief Adds the tasks section to the graph from a task-manager tree: one `plan`
16
19
  * page per plan, one `phase` page per phase, one `task` entry per task file,
17
20
  * a `decisions` page per plan with decision files, and the `vocabulary.md`
18
21
  * of the tree as a glossary. Created by `RepositoryScanner` for every scan.
@@ -38,6 +41,11 @@ export declare class TaskPlanner {
38
41
  /**
39
42
  * Creates a planner.
40
43
  *
44
+ * @param graph - Graph the tasks section is added to.
45
+ * @param files - Renders the markdown pages of plans and phases.
46
+ * @param markdown - Renders the bodies of tasks and decisions.
47
+ * @param resolvers - Resolves the links and inline code of each page.
48
+ * @param glossaries - Adds the vocabulary file as a glossary.
41
49
  * @param reporter - Receives a warning for every file that fails its schema and every `depends_on` that names nothing.
42
50
  */
43
51
  constructor(graph: GraphBuilder, files: FileRenderer, markdown: MarkdownRenderer, resolvers: ProseResolvers, glossaries: GlossaryPlanner, reporter: Reporter);
@@ -48,28 +56,75 @@ export declare class TaskPlanner {
48
56
  * @param trees - The task trees of the scan. Usually one, or none when the repository keeps no tasks.
49
57
  */
50
58
  plan(section: NodeRef, trees: readonly TaskTreeSource[]): Promise<void>;
51
- /** Adds one plan with its phases and decisions. */
59
+ /**
60
+ * Adds one plan with its phases and decisions.
61
+ *
62
+ * @param section - Node of the tasks section the plan goes under.
63
+ * @param tree - Task tree the plan's files are read from.
64
+ * @param plan - Files of the plan, from `layoutTree`.
65
+ * @param targets - Nodes that `depends_on` names can point at, filled as nodes are added.
66
+ * @param pending - Dependencies to resolve once every node exists.
67
+ */
52
68
  private planPlan;
53
- /** Adds one phase with its tasks. */
69
+ /**
70
+ * Adds one phase with its tasks.
71
+ *
72
+ * @param planRef - Node of the plan the phase belongs to.
73
+ * @param tree - Task tree the phase's files are read from.
74
+ * @param phase - Files of the phase, from `layoutTree`.
75
+ * @param phases - Phase nodes of this plan, by phase name.
76
+ * @param targets - Nodes that `depends_on` names can point at, filled as nodes are added.
77
+ * @param pending - Dependencies to resolve once every node exists.
78
+ */
54
79
  private planPhase;
55
- /** Adds the decision log of a plan: one `decisions` page for its folder and one `decision` entry per file. */
80
+ /**
81
+ * Adds the decision log of a plan: one `decisions` page for its folder and one `decision` entry per file.
82
+ *
83
+ * @param planRef - Node of the plan the log belongs to.
84
+ * @param tree - Task tree the decision files are read from.
85
+ * @param plan - Files of the plan, from `layoutTree`.
86
+ * @param paths - Tree-relative paths of the decision files.
87
+ */
56
88
  private planDecisions;
57
89
  /**
58
90
  * Renders the page of a plan or a phase whose frontmatter passed its schema.
59
91
  *
92
+ * @param self - Node the page is rendered for.
93
+ * @param read - The file that holds the page.
94
+ * @param meta - Parsed frontmatter of the file.
60
95
  * @returns The content of the node: the rendered file, its title and summary, and where it stands.
61
96
  */
62
97
  private renderTracked;
63
- /** Adds a tree file whose frontmatter failed its schema as a plain document. */
98
+ /**
99
+ * Adds a tree file whose frontmatter failed its schema as a plain document.
100
+ *
101
+ * @param parent - Node the document goes under.
102
+ * @param read - The file to show as a document.
103
+ * @returns The node of the document.
104
+ */
64
105
  private planDocument;
65
106
  /**
66
107
  * Checks the frontmatter of a file against its schema, and reports the file when it fails.
67
108
  *
109
+ * @param schema - Schema the frontmatter must match.
110
+ * @param read - The file whose frontmatter is checked.
68
111
  * @returns The parsed frontmatter, or `null` when it failed.
69
112
  */
70
113
  private parse;
71
- /** Reads a file of the tree and splits off its frontmatter. */
114
+ /**
115
+ * Reads a file of the tree and splits off its frontmatter.
116
+ *
117
+ * @param tree - Task tree the file belongs to.
118
+ * @param treePath - Path of the file relative to the tree.
119
+ * @returns The file with its frontmatter, body and source text.
120
+ */
72
121
  private read;
73
- /** The paths of a tree file as the planners of the docs section take them. */
122
+ /**
123
+ * The paths of a tree file as the planners of the docs section take them.
124
+ *
125
+ * @param tree - Task tree the file belongs to.
126
+ * @param treePath - Path of the file relative to the tree.
127
+ * @returns The file with its root, root-relative path and display path.
128
+ */
74
129
  private docFile;
75
130
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@g3nomaly/analyze",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Turns a repository into one offline HTML documentation site, and queries the same linked model from the terminal and from hooks.",
5
5
  "keywords": [
6
6
  "documentation",
@@ -40,7 +40,7 @@
40
40
  "docs": "bun run build && bun dist/cli.js create_docs"
41
41
  },
42
42
  "dependencies": {
43
- "@g3nomaly/core": "^0.3.1",
43
+ "@g3nomaly/core": "^0.3.2",
44
44
  "@t3-oss/env-core": "^0.13.11",
45
45
  "hast-util-to-string": "^3.0.1",
46
46
  "rehype-parse": "^9.0.1",