@astryxdesign/cli 0.6.3-canary.7ada42e → 0.6.3-canary.7ec7be0

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 (221) hide show
  1. package/README.md +21 -19
  2. package/api/build/_adapter.d.mts +50 -0
  3. package/api/build/_adapter.mjs +60 -0
  4. package/api/build/build.doc.mjs +13 -7
  5. package/api/build/build.test.mjs +184 -6
  6. package/api/build/build.type.d.mts +57 -2
  7. package/api/build/build.type.mjs +30 -7
  8. package/api/build/help/help.d.mts +4 -0
  9. package/api/build/help/help.mjs +24 -11
  10. package/api/build/kit/kit.d.mts +4 -1
  11. package/api/build/kit/kit.mjs +165 -49
  12. package/api/build/kit/rank.d.mts +44 -0
  13. package/api/build/kit/rank.mjs +432 -0
  14. package/api/build/kit/rank.test.mjs +196 -0
  15. package/api/component/_adapter.d.mts +6 -12
  16. package/api/component/_adapter.mjs +20 -10
  17. package/api/component/component.mjs +60 -12
  18. package/api/component/list/list.mjs +3 -2
  19. package/api/docs/_adapter.d.mts +251 -28
  20. package/api/docs/_adapter.mjs +918 -35
  21. package/api/docs/detail/detail.mjs +11 -3
  22. package/api/docs/detail/section/section.mjs +24 -13
  23. package/api/docs/detail/section/section.test.mjs +15 -6
  24. package/api/docs/docs.d.mts +5 -3
  25. package/api/docs/docs.doc.mjs +38 -17
  26. package/api/docs/docs.mjs +44 -8
  27. package/api/docs/docs.test.mjs +158 -4
  28. package/api/docs/docs.type.d.mts +181 -2
  29. package/api/docs/docs.type.mjs +117 -3
  30. package/api/docs/index/index.mjs +11 -3
  31. package/api/docs/index/index.test.mjs +1 -1
  32. package/api/docs/integration-tree.test.mjs +555 -0
  33. package/api/docs/integrationDocs.test.mjs +14 -14
  34. package/api/docs/list/list.mjs +25 -5
  35. package/api/docs/node/node.d.mts +43 -0
  36. package/api/docs/node/node.mjs +192 -0
  37. package/api/docs/reference-blocks.test.mjs +406 -0
  38. package/api/doctor/doctor.d.mts +30 -2
  39. package/api/doctor/doctor.mjs +151 -8
  40. package/api/doctor/doctor.test.mjs +95 -7
  41. package/api/index.d.mts +1 -1
  42. package/api/index.mjs +1 -0
  43. package/api/init/init.doc.mjs +1 -1
  44. package/api/integration/add-contribution.d.mts +2 -1
  45. package/api/integration/add-contribution.mjs +107 -5
  46. package/api/integration/add-contribution.test.mjs +137 -0
  47. package/api/integration/authoring-checks.mjs +138 -28
  48. package/api/integration/authoring-checks.test.mjs +171 -3
  49. package/api/integration/authoring-checks.type.mjs +6 -1
  50. package/api/integration/integration-authoring.type.d.mts +2 -0
  51. package/api/integration/integration-authoring.type.mjs +2 -0
  52. package/api/integration/integrationAdd.doc.mjs +6 -0
  53. package/api/integration/integrationAddDoc.doc.mjs +7 -1
  54. package/api/integration/integrationDocConflicts.doc.mjs +1 -1
  55. package/api/integration/integrationPackCheck.doc.mjs +1 -1
  56. package/api/integration/integrationTemplateConflicts.doc.d.mts +3 -0
  57. package/api/integration/integrationTemplateConflicts.doc.mjs +3 -0
  58. package/api/integration/pack-check.mjs +34 -0
  59. package/api/integration/pack-check.test.mjs +121 -0
  60. package/api/integration/pack-check.type.d.mts +26 -2
  61. package/api/integration/pack-check.type.mjs +14 -1
  62. package/api/integration/template-conflict-compatibility.test.mjs +73 -0
  63. package/api/integration/validate-integration.test.mjs +3 -3
  64. package/api/integration/validateIntegration.doc.mjs +1 -1
  65. package/api/json/index.ts +2 -0
  66. package/api/layout/_adapter.mjs +20 -5
  67. package/api/search/search.d.mts +59 -1
  68. package/api/search/search.doc.mjs +4 -3
  69. package/api/search/search.mjs +442 -71
  70. package/api/search/search.test.mjs +91 -2
  71. package/api/search/search.type.d.mts +13 -1
  72. package/api/search/search.type.mjs +4 -1
  73. package/api/template/list/list.mjs +1 -0
  74. package/api/template/table-floating-bulk-actions.test.mjs +66 -0
  75. package/api/template/template-integration.test.mjs +1072 -3
  76. package/api/template/template.doc.mjs +27 -7
  77. package/api/template/template.mjs +45 -8
  78. package/api/template/template.type.d.mts +6 -8
  79. package/api/template/template.type.mjs +3 -2
  80. package/api/theme/template/template.test.mjs +5 -0
  81. package/api/theme/themeTemplate.doc.mjs +1 -1
  82. package/assets/docs/getting-started.doc.mjs +2 -2
  83. package/assets/docs/layout.doc.dense.mjs +2 -2
  84. package/assets/docs/layout.doc.mjs +1 -1
  85. package/assets/docs/principles.doc.mjs +6 -6
  86. package/assets/docs/styling-libraries.doc.mjs +3 -3
  87. package/assets/docs/styling.doc.mjs +4 -4
  88. package/assets/docs/theme.doc.mjs +4 -4
  89. package/assets/docs/tokens.doc.mjs +1 -1
  90. package/assets/docs/tree/api.doc.mjs +30 -0
  91. package/assets/docs/tree/cli.doc.mjs +23 -0
  92. package/assets/docs/tree/commands.doc.mjs +25 -0
  93. package/assets/docs/{cli-integrations.doc.mjs → tree/integrations.doc.mjs} +37 -9
  94. package/assets/docs/tree/integrations.test.mjs +62 -0
  95. package/assets/docs/tree/writing-docs.doc.mjs +286 -0
  96. package/assets/docs/working-with-ai.doc.mjs +3 -3
  97. package/assets/templates/blocks/components/CheckboxList/CheckboxListSelectAllPattern.doc.mjs +1 -1
  98. package/assets/templates/blocks/components/CheckboxList/CheckboxListSelectAllPattern.tsx +1 -3
  99. package/assets/templates/blocks/components/Table/TableBulkActionsTable.doc.mjs +14 -0
  100. package/assets/templates/blocks/components/Table/TableBulkActionsTable.tsx +71 -0
  101. package/assets/templates/blocks/components/Table/TableFloatingBulkActionsTable.doc.mjs +19 -0
  102. package/assets/templates/blocks/components/Table/TableFloatingBulkActionsTable.tsx +139 -0
  103. package/authoring/debug/parse.d.mts +3 -3
  104. package/authoring/doctypes/_schema.d.mts +119 -117
  105. package/authoring/doctypes/_schema.mjs +54 -3
  106. package/authoring/doctypes/base/graph-fields.doc.mjs +7 -5
  107. package/authoring/doctypes/base/type.ts +6 -5
  108. package/authoring/doctypes/command/command.doc.mjs +1 -1
  109. package/authoring/doctypes/command/type.ts +2 -2
  110. package/authoring/doctypes/enum/enum.doc.mjs +1 -1
  111. package/authoring/doctypes/enum/type.ts +1 -1
  112. package/authoring/doctypes/function/function.doc.mjs +3 -2
  113. package/authoring/doctypes/function/type.ts +3 -2
  114. package/authoring/doctypes/load-contract.test.mjs +26 -1
  115. package/authoring/doctypes/namespace/namespace.doc.mjs +6 -10
  116. package/authoring/doctypes/namespace/parse.test.mjs +23 -25
  117. package/authoring/doctypes/namespace/type.ts +5 -2
  118. package/authoring/doctypes/parse.mjs +3 -2
  119. package/authoring/doctypes/reference/reference.doc.mjs +34 -5
  120. package/authoring/doctypes/reference/type.ts +28 -11
  121. package/authoring/doctypes/schema/schema.doc.mjs +1 -1
  122. package/authoring/doctypes/schema/type.ts +1 -1
  123. package/authoring/doctypes/template/parse.d.mts +2 -0
  124. package/authoring/doctypes/template/parse.mjs +4 -0
  125. package/authoring/doctypes/template/parse.test.mjs +18 -0
  126. package/authoring/doctypes/template/template.doc.mjs +6 -0
  127. package/authoring/doctypes/template/type.ts +8 -0
  128. package/authoring/identity/identity.doc.mjs +2 -2
  129. package/authoring/index.d.ts +1 -0
  130. package/authoring/integration/type.ts +1 -1
  131. package/clients/cli/commands/build-theme.adaptations.test.mjs +100 -1
  132. package/clients/cli/commands/build-theme.mjs +1 -1
  133. package/clients/cli/commands/build.doc.mjs +11 -6
  134. package/clients/cli/commands/build.mjs +105 -67
  135. package/clients/cli/commands/build.text-fields.test.mjs +41 -0
  136. package/clients/cli/commands/component/index.mjs +1 -1
  137. package/clients/cli/commands/component-ownership.test.mjs +3 -3
  138. package/clients/cli/commands/discover.broken-integration.test.mjs +7 -8
  139. package/clients/cli/commands/discover.mjs +1 -1
  140. package/clients/cli/commands/docs.doc.mjs +20 -8
  141. package/clients/cli/commands/docs.mjs +183 -69
  142. package/clients/cli/commands/docs.test.mjs +120 -16
  143. package/clients/cli/commands/doctor-integration-docs.doc.mjs +2 -2
  144. package/clients/cli/commands/doctor-integration-templates.doc.mjs +14 -7
  145. package/clients/cli/commands/doctor-integration.test.mjs +75 -1
  146. package/clients/cli/commands/doctor.mjs +53 -16
  147. package/clients/cli/commands/integration-add.doc.mjs +10 -0
  148. package/clients/cli/commands/integration.mjs +1 -0
  149. package/clients/cli/commands/search.mjs +11 -2
  150. package/clients/cli/commands/setup-nudge.test.mjs +6 -0
  151. package/clients/cli/commands/template.doc.mjs +23 -6
  152. package/clients/cli/commands/template.mjs +4 -91
  153. package/clients/cli/index.mjs +8 -0
  154. package/clients/cli/lib/manifest.mjs +9 -2
  155. package/foundation/agent-docs/agent-docs.d.mts +3 -2
  156. package/foundation/agent-docs/agent-docs.mjs +13 -9
  157. package/foundation/agent-docs/agent-docs.test.mjs +19 -1
  158. package/foundation/config/project.d.mts +12 -11
  159. package/foundation/config/project.mjs +73 -59
  160. package/foundation/config/project.test.mjs +141 -5
  161. package/foundation/discovery/authoring-self-docs.d.mts +12 -0
  162. package/foundation/discovery/authoring-self-docs.mjs +20 -8
  163. package/foundation/discovery/authoring-self-docs.test.mjs +25 -9
  164. package/foundation/discovery/cli-self-docs.d.mts +40 -34
  165. package/foundation/discovery/cli-self-docs.mjs +91 -115
  166. package/foundation/discovery/cli-self-docs.test.mjs +104 -166
  167. package/foundation/discovery/component-discovery.d.mts +38 -0
  168. package/foundation/discovery/component-discovery.mjs +48 -0
  169. package/foundation/discovery/docs-discovery.d.mts +109 -9
  170. package/foundation/discovery/docs-discovery.mjs +223 -24
  171. package/foundation/discovery/docs-discovery.test.mjs +103 -27
  172. package/foundation/discovery/docs-output-budget.d.mts +2 -2
  173. package/foundation/discovery/docs-output-budget.mjs +1 -1
  174. package/foundation/discovery/docs-section-key.d.mts +28 -10
  175. package/foundation/discovery/docs-section-key.mjs +134 -33
  176. package/foundation/discovery/docs-section-key.test.mjs +41 -19
  177. package/foundation/discovery/template-adapter.d.mts +92 -6
  178. package/foundation/discovery/template-adapter.mjs +453 -17
  179. package/foundation/discovery/template-adapter.test.mjs +42 -0
  180. package/foundation/discovery/template-conflict-release.d.mts +13 -0
  181. package/foundation/discovery/template-conflict-release.mjs +40 -0
  182. package/foundation/discovery/template-conflict-release.test.mjs +40 -0
  183. package/foundation/doc-compiler/bundle.mjs +61 -1
  184. package/foundation/doc-compiler/bundle.test.mjs +21 -10
  185. package/foundation/doc-compiler/compile.d.mts +113 -132
  186. package/foundation/doc-compiler/compile.mjs +57 -10
  187. package/foundation/doc-compiler/diagnostics.mjs +28 -0
  188. package/foundation/doc-compiler/doc-loads.test.mjs +2 -2
  189. package/foundation/doc-compiler/inputs.d.mts +2 -2
  190. package/foundation/doc-compiler/inputs.mjs +6 -1
  191. package/foundation/doc-compiler/ir.mjs +7 -0
  192. package/foundation/doc-compiler/lenses.d.mts +8 -5
  193. package/foundation/doc-compiler/lenses.mjs +50 -4
  194. package/foundation/doc-compiler/links.d.mts +162 -0
  195. package/foundation/doc-compiler/links.mjs +294 -0
  196. package/foundation/doc-compiler/links.test.mjs +192 -0
  197. package/foundation/doc-compiler/lower-doc.test.mjs +5 -2
  198. package/foundation/doc-compiler/read.d.mts +3 -2
  199. package/foundation/doc-compiler/read.mjs +6 -1
  200. package/foundation/doc-compiler/tree.d.mts +288 -0
  201. package/foundation/doc-compiler/tree.mjs +876 -0
  202. package/foundation/doc-compiler/tree.test.mjs +598 -0
  203. package/foundation/integrations/autolink.test.mjs +1 -1
  204. package/foundation/integrations/cli-requirement.d.mts +45 -0
  205. package/foundation/integrations/cli-requirement.mjs +154 -0
  206. package/foundation/integrations/cli-requirement.test.mjs +84 -0
  207. package/foundation/integrations/contribution-inventory.d.mts +2 -1
  208. package/foundation/integrations/contribution-inventory.mjs +10 -4
  209. package/foundation/integrations/contribution-inventory.test.mjs +19 -0
  210. package/foundation/integrations/integration-warnings.d.mts +9 -2
  211. package/foundation/integrations/integration-warnings.mjs +51 -26
  212. package/foundation/integrations/integration-warnings.test.mjs +74 -1
  213. package/foundation/integrations/validate-contributions.mjs +25 -27
  214. package/foundation/response/response-types.doc.d.mts +5 -1
  215. package/foundation/response/response-types.doc.mjs +19 -10
  216. package/foundation/text/string-utils.d.mts +8 -0
  217. package/foundation/text/string-utils.mjs +18 -0
  218. package/foundation/xle/expand.mjs +1 -1
  219. package/foundation/xle/xle.test.mjs +13 -0
  220. package/package.json +9 -9
  221. package/assets/docs/cli.doc.mjs +0 -15
@@ -160,7 +160,7 @@ describe('validate-integration API', () => {
160
160
  fs.mkdirSync(componentsDir);
161
161
  fs.writeFileSync(
162
162
  path.join(componentsDir, 'Widget.doc.mjs'),
163
- `export default {name: 'Widget'};\n`,
163
+ `export default {name: 'Widget', props: []};\n`,
164
164
  );
165
165
  fs.writeFileSync(
166
166
  path.join(componentsDir, 'Widget.tsx'),
@@ -485,7 +485,7 @@ export default {type: 'theme', name: 'ocean', displayName: 'Ocean', description:
485
485
  fs.mkdirSync(cDir, {recursive: true});
486
486
  fs.writeFileSync(
487
487
  path.join(cDir, 'Widget.doc.mjs'),
488
- `export default { name: 'Widget' };\n`,
488
+ `export default { type: 'component', name: 'Widget', props: [] };\n`,
489
489
  );
490
490
  fs.writeFileSync(
491
491
  path.join(cDir, 'Widget.tsx'),
@@ -507,7 +507,7 @@ export default {type: 'theme', name: 'ocean', displayName: 'Ocean', description:
507
507
  // Doc with no sibling Widget.tsx.
508
508
  fs.writeFileSync(
509
509
  path.join(cDir, 'Widget.doc.mjs'),
510
- `export default { name: 'Widget' };\n`,
510
+ `export default { type: 'component', name: 'Widget', props: [] };\n`,
511
511
  );
512
512
 
513
513
  const result = await validateLocalIntegration(pkgDir);
@@ -60,5 +60,5 @@ export const doc = {
60
60
  },
61
61
  ],
62
62
  command: 'doctor integration validate',
63
- related: ['summarizeIssues', 'doctor integration templates', 'upgrade'],
63
+ related: ['summarizeIssues', 'integrationTemplateConflicts', 'upgrade'],
64
64
  };
package/api/json/index.ts CHANGED
@@ -28,6 +28,8 @@ export type * from '../init/init.type.mjs';
28
28
  export type * from '../doctor/doctor.type.mjs';
29
29
  export type * from '../layout/layout.type.mjs';
30
30
  export type * from '../integration/validate-integration.type.mjs';
31
+ export type * from '../integration/authoring-checks.type.mjs';
32
+ export type * from '../integration/pack-check.type.mjs';
31
33
  export type * from '../../foundation/response/base';
32
34
  export type * from '../../foundation/response/error-codes';
33
35
  export type * from '../../clients/cli/lib/manifest';
@@ -50,7 +50,18 @@ async function loadBlocks(cwd) {
50
50
  const blocks = [];
51
51
  try {
52
52
  const all = await discoverTemplates(cwd);
53
- for (const t of all) if (t.type === 'block') blocks.push({...t, kind: 'template'});
53
+ const templates = all.filter(template => template.type === 'block');
54
+ /** @type {Map<string, import('../../foundation/discovery/template-adapter.mjs').DiscoveredTemplate>} */
55
+ const byId = new Map();
56
+ // Exact ids are the fallback. Active replacement aliases override them in a
57
+ // second pass, matching template() regardless of discovery/display order.
58
+ for (const template of templates) byId.set(template.dirName, template);
59
+ for (const template of templates) {
60
+ if (template.replaces != null) byId.set(template.replaces, template);
61
+ }
62
+ for (const [id, template] of byId) {
63
+ blocks.push({...template, dirName: id, kind: 'template'});
64
+ }
54
65
  } catch {
55
66
  // discovery is best-effort
56
67
  }
@@ -91,7 +102,10 @@ export function formatIssue(issue) {
91
102
  * @param {string} expression
92
103
  * @param {{form?: 'compact'|'outline'|'auto', loose?: boolean, cwd?: string}} [options]
93
104
  */
94
- export async function analyze(expression, {form = 'auto', loose = false, cwd = process.cwd()} = {}) {
105
+ export async function analyze(
106
+ expression,
107
+ {form = 'auto', loose = false, cwd = process.cwd()} = {},
108
+ ) {
95
109
  // Validate inputs in the API (not just the CLI): an empty expression or an
96
110
  // unknown --form must error, not silently parse as an empty/compact layout.
97
111
  if (typeof expression !== 'string' || expression.trim() === '') {
@@ -108,9 +122,10 @@ export async function analyze(expression, {form = 'auto', loose = false, cwd = p
108
122
  ERROR_CODES.ERR_INVALID_OPTION,
109
123
  );
110
124
  }
111
- const registry = /** @type {import('../../foundation/xle/xle-ast').Registry} */ (
112
- /** @type {unknown} */ (await buildRegistry({cwd}))
113
- );
125
+ const registry =
126
+ /** @type {import('../../foundation/xle/xle-ast').Registry} */ (
127
+ /** @type {unknown} */ (await buildRegistry({cwd}))
128
+ );
114
129
  const blocks = await loadBlocks(cwd);
115
130
 
116
131
  /** @type {import('../../foundation/xle/xle-ast').XLEDoc} */
@@ -9,6 +9,13 @@
9
9
  * @returns {string}
10
10
  */
11
11
  export function stem(w: string): string;
12
+ /**
13
+ * Whether two lowercase words are the same word, up to plural and stem form.
14
+ * @param {string} a
15
+ * @param {string} b
16
+ * @returns {boolean}
17
+ */
18
+ export function sameWord(a: string, b: string): boolean;
12
19
  /**
13
20
  * Split a query into meaningful content tokens (lowercased, stopwords + very
14
21
  * short words removed). Empty for single-word queries (callers fall back to
@@ -47,6 +54,7 @@ export function scoreQuery(term: string, tokens: string[], candidate: Candidate)
47
54
  * @param {string} [candidate.description]
48
55
  * @param {string[]} [candidate.prose] - Extra free-text blobs (doc section text, best practices).
49
56
  * @param {string[]} [candidate.guidance] - Usage guidance (features, best practices) — scored a tier below description.
57
+ * @param {{fuzzy?: boolean}} [opts] - `fuzzy`: allow edit-distance (typo) matches. Default true; multi-word queries pass false.
50
58
  * @returns {{score: number, reason: string} | null}
51
59
  */
52
60
  export function scoreCandidate(term: string, { name, keywords, weakKeywords, description, prose, guidance, }: {
@@ -56,6 +64,8 @@ export function scoreCandidate(term: string, { name, keywords, weakKeywords, des
56
64
  description?: string | undefined;
57
65
  prose?: string[] | undefined;
58
66
  guidance?: string[] | undefined;
67
+ }, { fuzzy }?: {
68
+ fuzzy?: boolean;
59
69
  }): {
60
70
  score: number;
61
71
  reason: string;
@@ -72,11 +82,34 @@ export function scoreCandidate(term: string, { name, keywords, weakKeywords, des
72
82
  */
73
83
  export function search(query: string, options?: {
74
84
  cwd?: string | undefined;
75
- type?: "component" | "hook" | "doc" | "template" | undefined;
85
+ type?: "component" | "hook" | "template" | "doc" | undefined;
76
86
  limit?: number | undefined;
77
87
  }): Promise<import("./search.type.mjs").SearchResponse>;
88
+ export namespace SYNONYMS {
89
+ let dashboard: string[];
90
+ let login: string[];
91
+ let signup: string[];
92
+ let payment: string[];
93
+ let pricing: string[];
94
+ let chat: string[];
95
+ let settings: string[];
96
+ let calendar: string[];
97
+ let table: string[];
98
+ let gallery: string[];
99
+ let hero: string[];
100
+ let form: string[];
101
+ let profile: string[];
102
+ let documentation: string[];
103
+ let navigation: string[];
104
+ }
78
105
  /** Valid domain filters for `--type`. */
79
106
  export const SEARCH_DOMAINS: string[];
107
+ /**
108
+ * Filler words stripped from multi-word queries so natural-language phrasing
109
+ * ("a page where you can see business stats") ranks on its content words.
110
+ * Exported for `build`, whose page ranker strips the same words.
111
+ */
112
+ export const STOPWORDS: Set<string>;
80
113
  /**
81
114
  * A search candidate gathered from one content domain. Extra underscore-
82
115
  * prefixed fields carry domain-specific payload used only by {@link toResult}.
@@ -91,6 +124,31 @@ export type Candidate = {
91
124
  guidance?: string[] | undefined;
92
125
  _import?: string | undefined;
93
126
  _title?: string | undefined;
127
+ /**
128
+ * - A doc result's topic or docs-tree route.
129
+ */
130
+ _topic?: string | undefined;
131
+ /**
132
+ * - A doc result's section key, when it is one section.
133
+ */
134
+ _section?: string | undefined;
135
+ /**
136
+ * - The command that reads exactly this doc part.
137
+ */
138
+ _command?: string | undefined;
139
+ /**
140
+ * - The command that opens the level above a doc
141
+ * part: its topic's section list, or the docs-tree namespace it sits in.
142
+ */
143
+ _parent?: string | undefined;
144
+ /**
145
+ * - The npm package that authored a docs-tree
146
+ * doc part. Flat topics carry none: an extension's sections can come from
147
+ * another package.
148
+ */
149
+ _package?: string | undefined;
94
150
  _displayName?: string | undefined;
95
151
  _kind?: "page" | "block" | undefined;
152
+ _resultName?: string | undefined;
153
+ _commandName?: string | undefined;
96
154
  };
@@ -47,14 +47,15 @@ export const doc = {
47
47
  {
48
48
  name: 'options.cwd',
49
49
  type: 'string',
50
- description: 'Directory to resolve @astryxdesign/core from.',
50
+ description:
51
+ "Directory to resolve @astryxdesign/core from. A docs-only search (`type: 'doc'`) does not need it.",
51
52
  },
52
53
  ],
53
54
  returns: [
54
55
  {
55
56
  type: 'search',
56
57
  description:
57
- 'The query echoed back, `matchCount` (how many candidates matched in total, before `limit`), plus a ranked SearchResultEntry[] bounded by `limit`: each has domain, name, score, reason, description, and follow-up command, plus `import` for components and hooks, `title` for docs, and `displayName` and `kind` for templates.',
58
+ 'The query echoed back, `matchCount` (how many candidates matched in total, before `limit`), plus a ranked SearchResultEntry[] bounded by `limit`: each has domain, name, score, reason, description, and follow-up command, plus `import` for components and hooks, `title` for docs, and `displayName` and `kind` for templates. A doc result is the smallest part that answers: one section (with `section`, and a command that reads only it), one docs-tree route, or a topic, whose command lists its sections. `parent` is the command that opens the level above it: the section list of its topic, the namespace a tree node sits in, the Unorganized level for a flat topic, or the topic list for a top-level namespace. Every doc result also carries `package`, the npm package that authored it (for a section, the package its file came from).',
58
59
  },
59
60
  ],
60
61
  throws: [
@@ -64,7 +65,7 @@ export const doc = {
64
65
  },
65
66
  {
66
67
  code: 'ERR_CORE_NOT_FOUND',
67
- when: '@astryxdesign/core cannot be found from the cwd',
68
+ when: '@astryxdesign/core cannot be found from the cwd, and the search reads it: every `type` but `doc`',
68
69
  },
69
70
  ],
70
71
  examples: [