@astryxdesign/cli 0.7.16 → 0.7.17-canary.gb36275e

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 (239) hide show
  1. package/README.md +13 -23
  2. package/api/build/_adapter.d.mts +5 -0
  3. package/api/build/_adapter.mjs +49 -34
  4. package/api/build/blocks/blocks.d.mts +7 -5
  5. package/api/build/blocks/blocks.mjs +113 -26
  6. package/api/build/build.doc.mjs +2 -1
  7. package/api/build/kit/rank.mjs +59 -12
  8. package/api/build/kit/weights.d.mts +16 -3
  9. package/api/build/kit/weights.json +1 -1
  10. package/api/build/kit/weights.mjs +238 -31
  11. package/api/build/kit/word-model.d.mts +23 -0
  12. package/api/build/kit/word-model.mjs +46 -0
  13. package/api/build/kit/words.d.mts +42 -0
  14. package/api/build/kit/words.mjs +82 -1
  15. package/api/component/__fixtures__/resolutions/modules.txt +4 -5
  16. package/api/component/list/list.d.mts +1 -1
  17. package/api/component/list/list.mjs +46 -5
  18. package/api/discover/_adapter.d.mts +1 -1
  19. package/api/docs/_adapter.d.mts +26 -2
  20. package/api/docs/_adapter.mjs +217 -5
  21. package/api/docs/docs.d.mts +3 -0
  22. package/api/docs/docs.doc.mjs +7 -1
  23. package/api/docs/docs.mjs +12 -0
  24. package/api/docs/docs.type.d.mts +5 -0
  25. package/api/docs/docs.type.mjs +2 -0
  26. package/api/docs/node/node.mjs +1 -1
  27. package/api/doctor/_adapter.d.mts +27 -5
  28. package/api/doctor/_adapter.mjs +77 -6
  29. package/api/doctor/built-checks.mjs +38 -13
  30. package/api/doctor/doctor.d.mts +4 -3
  31. package/api/doctor/doctor.mjs +14 -7
  32. package/api/doctor/theme-checks.mjs +121 -17
  33. package/api/render/_adapter.mjs +531 -192
  34. package/api/render/render.doc.mjs +11 -3
  35. package/api/render/render.type.d.mts +30 -0
  36. package/api/render/render.type.mjs +19 -0
  37. package/api/search/ORDERING.md +1 -1
  38. package/api/search/_candidate-score.mjs +51 -32
  39. package/api/search/_fit-order.mjs +3 -3
  40. package/api/search/_result.d.mts +5 -5
  41. package/api/search/_score.d.mts +6 -1
  42. package/api/search/_score.mjs +15 -3
  43. package/api/search/search.d.mts +1 -1
  44. package/api/theme/_adapter.mjs +10 -0
  45. package/api/theme/build/build.d.mts +47 -0
  46. package/api/theme/build/build.mjs +147 -25
  47. package/api/theme/theme.type.d.mts +10 -0
  48. package/api/theme/theme.type.mjs +7 -1
  49. package/api/theme-edit/_adapter.d.mts +48 -0
  50. package/api/theme-edit/_adapter.mjs +675 -42
  51. package/api/theme-edit/_check.d.mts +28 -22
  52. package/api/theme-edit/_check.mjs +1481 -252
  53. package/api/theme-edit/_color.d.mts +9 -0
  54. package/api/theme-edit/_color.mjs +41 -1
  55. package/api/theme-edit/_compiler.mjs +9 -0
  56. package/api/theme-edit/_context.mjs +60 -3
  57. package/api/theme-edit/_css.mjs +21 -1
  58. package/api/theme-edit/_edit.d.mts +22 -0
  59. package/api/theme-edit/_edit.mjs +1196 -88
  60. package/api/theme-edit/_how-commands.d.mts +57 -0
  61. package/api/theme-edit/_how-commands.mjs +536 -1
  62. package/api/theme-edit/_how-question.d.mts +65 -0
  63. package/api/theme-edit/_how-question.mjs +4401 -225
  64. package/api/theme-edit/_how.mjs +104 -4
  65. package/api/theme-edit/_marks.d.mts +31 -5
  66. package/api/theme-edit/_marks.mjs +57 -5
  67. package/api/theme-edit/_normal.d.mts +153 -0
  68. package/api/theme-edit/_normal.mjs +661 -0
  69. package/api/theme-edit/_palette.mjs +10 -4
  70. package/api/theme-edit/_parts.d.mts +8 -0
  71. package/api/theme-edit/_parts.mjs +103 -2
  72. package/api/theme-edit/_preview-app.d.mts +7 -1
  73. package/api/theme-edit/_preview-app.mjs +205 -17
  74. package/api/theme-edit/_preview.d.mts +64 -8
  75. package/api/theme-edit/_preview.mjs +447 -89
  76. package/api/theme-edit/_settings.d.mts +176 -5
  77. package/api/theme-edit/_settings.mjs +1936 -128
  78. package/api/theme-edit/_tables.d.mts +6 -0
  79. package/api/theme-edit/_tables.mjs +32 -1
  80. package/api/theme-edit/theme-edit.type.d.mts +10 -1
  81. package/api/theme-edit/theme-edit.type.mjs +4 -1
  82. package/api/theme-edit/themeEditPreviewApp.doc.mjs +3 -3
  83. package/assets/codemods/run-codemod.mjs +73 -6
  84. package/assets/codemods/transforms/next/index.mjs +11 -1
  85. package/assets/codemods/transforms/next/migrate-item-swipe-actions-to-swipe.mjs +394 -0
  86. package/assets/docs/author-a-theme.doc.mjs +1 -0
  87. package/assets/docs/theme.doc.dense.mjs +2 -2
  88. package/assets/docs/theme.doc.mjs +1 -1
  89. package/assets/docs/tree/check-your-docs.doc.mjs +1 -1
  90. package/assets/docs/tree/cli-command.doc.mjs +2 -3
  91. package/assets/docs/tree/render-pages.doc.mjs +43 -2
  92. package/assets/docs/tree/template-doc-overview.doc.mjs +1 -1
  93. package/assets/docs/tree/test-in-an-app.doc.mjs +1 -1
  94. package/assets/docs/use-a-theme.doc.mjs +1 -1
  95. package/assets/docs.generated.json +2 -2
  96. package/assets/self-audit.generated.json +1 -1
  97. package/assets/templates/blocks/components/ChatComposerInput/useChatDictationHookUsage.doc.mjs +14 -0
  98. package/assets/templates/blocks/components/ChatComposerInput/useChatDictationHookUsage.tsx +38 -0
  99. package/assets/templates/blocks/components/SyntaxTheme/useSyntaxThemeHookUsage.doc.mjs +14 -0
  100. package/assets/templates/blocks/components/SyntaxTheme/useSyntaxThemeHookUsage.tsx +36 -0
  101. package/assets/templates/components.generated.json +1 -1
  102. package/assets/templates/pages/ai-chat/template.doc.mjs +5 -4
  103. package/assets/templates/pages/ai-chat-landing/template.doc.mjs +2 -1
  104. package/assets/templates/pages/blank/template.doc.mjs +1 -1
  105. package/assets/templates/pages/canvas-editor/template.doc.mjs +4 -2
  106. package/assets/templates/pages/centered-hero/template.doc.mjs +9 -1
  107. package/assets/templates/pages/classic-gallery/template.doc.mjs +1 -1
  108. package/assets/templates/pages/contact-form/template.doc.mjs +2 -1
  109. package/assets/templates/pages/dashboard/template.doc.mjs +3 -2
  110. package/assets/templates/pages/dashboard-alert-rail/template.doc.mjs +2 -1
  111. package/assets/templates/pages/dashboard-cohort-funnel/template.doc.mjs +2 -1
  112. package/assets/templates/pages/dashboard-composition/template.doc.mjs +2 -1
  113. package/assets/templates/pages/dashboard-progress/template.doc.mjs +6 -3
  114. package/assets/templates/pages/detail-page/template.doc.mjs +10 -3
  115. package/assets/templates/pages/documentation/template.doc.mjs +4 -1
  116. package/assets/templates/pages/documentation-design/template.doc.mjs +7 -1
  117. package/assets/templates/pages/documentation-technical/template.doc.mjs +7 -1
  118. package/assets/templates/pages/editor/template.doc.mjs +2 -8
  119. package/assets/templates/pages/file-explorer/template.doc.mjs +1 -1
  120. package/assets/templates/pages/form-two-column/template.doc.mjs +4 -3
  121. package/assets/templates/pages/form-wizard/template.doc.mjs +5 -3
  122. package/assets/templates/pages/gallery-hero/template.doc.mjs +4 -2
  123. package/assets/templates/pages/ide/page.tsx +24 -2
  124. package/assets/templates/pages/kanban-board/template.doc.mjs +1 -9
  125. package/assets/templates/pages/library/template.doc.mjs +4 -1
  126. package/assets/templates/pages/login/template.doc.mjs +2 -1
  127. package/assets/templates/pages/login-card/template.doc.mjs +2 -1
  128. package/assets/templates/pages/login-split/template.doc.mjs +2 -1
  129. package/assets/templates/pages/login-sso/template.doc.mjs +4 -2
  130. package/assets/templates/pages/mixed-gallery/template.doc.mjs +2 -1
  131. package/assets/templates/pages/product-detail/template.doc.mjs +4 -2
  132. package/assets/templates/pages/product-gallery/template.doc.mjs +2 -1
  133. package/assets/templates/pages/settings-dialog/template.doc.mjs +2 -1
  134. package/assets/templates/pages/settings-sidebar/template.doc.mjs +2 -1
  135. package/assets/templates/pages/shell-nav/template.doc.mjs +4 -2
  136. package/assets/templates/pages/shell-side-nav/template.doc.mjs +5 -3
  137. package/assets/templates/pages/shell-top-nav/template.doc.mjs +2 -1
  138. package/assets/templates/pages/side-gallery/template.doc.mjs +9 -1
  139. package/assets/templates/pages/table-filter/template.doc.mjs +9 -8
  140. package/assets/templates/pages/table-grouped/template.doc.mjs +4 -2
  141. package/assets/templates/pages/table-page/template.doc.mjs +5 -4
  142. package/assets/templates/pages/table-tree/template.doc.mjs +6 -3
  143. package/assets/templates/pages/theme-showcase/template.doc.mjs +2 -9
  144. package/assets/templates/pages/work-item-detail/template.doc.mjs +1 -0
  145. package/authoring/debug/parse.d.mts +3 -3
  146. package/authoring/doctypes/_schema.d.mts +3 -3
  147. package/authoring/doctypes/command/command.doc.mjs +1 -1
  148. package/authoring/doctypes/template/template.doc.mjs +1 -1
  149. package/authoring/doctypes/template/type.ts +9 -0
  150. package/clients/cli/bin/astryx.mjs +6 -9
  151. package/clients/cli/build-id.generated.json +1 -1
  152. package/clients/cli/commands/component.doc.mjs +1 -1
  153. package/clients/cli/commands/component.mjs +20 -2
  154. package/clients/cli/commands/docs.doc.mjs +7 -1
  155. package/clients/cli/commands/docs.mjs +3 -1
  156. package/clients/cli/commands/doctor.mjs +22 -14
  157. package/clients/cli/commands/experimental/render.mjs +32 -1
  158. package/clients/cli/commands/experimental/theme.mjs +65 -14
  159. package/clients/cli/commands/experimental-render.doc.mjs +2 -2
  160. package/clients/cli/commands/experimental-theme-compile.doc.mjs +3 -3
  161. package/clients/cli/commands/experimental-theme-editor-show.doc.mjs +1 -1
  162. package/clients/cli/commands/experimental-theme-editor-undo.doc.mjs +1 -1
  163. package/clients/cli/commands/experimental-theme-editor.doc.mjs +1 -1
  164. package/clients/cli/commands/experimental-theme-preview-app.doc.mjs +1 -1
  165. package/clients/cli/commands/search.doc.mjs +2 -1
  166. package/clients/cli/commands/search.mjs +6 -1
  167. package/clients/cli/commands/template.mjs +4 -2
  168. package/clients/cli/commands/theme-build.doc.mjs +5 -1
  169. package/clients/cli/commands/theme.doc.mjs +1 -1
  170. package/clients/cli/commands/theme.mjs +153 -5
  171. package/clients/cli/commands/upgrade.mjs +42 -7
  172. package/clients/cli/index.mjs +1 -1
  173. package/clients/cli/lib/component-format.mjs +205 -98
  174. package/clients/cli/lib/hook-format.mjs +9 -19
  175. package/clients/cli/manifest.generated.json +1 -1
  176. package/foundation/agent-docs/agent-docs.mjs +1 -1
  177. package/foundation/config/theme-state.d.mts +13 -1
  178. package/foundation/config/theme-state.mjs +47 -7
  179. package/foundation/discovery/component-discovery.d.mts +11 -0
  180. package/foundation/discovery/component-discovery.mjs +27 -2
  181. package/foundation/discovery/component-replacement.mjs +130 -1
  182. package/foundation/discovery/entry-name-files.d.mts +43 -0
  183. package/foundation/discovery/entry-name-files.mjs +264 -0
  184. package/foundation/discovery/hook-discovery.d.mts +8 -2
  185. package/foundation/discovery/hook-discovery.mjs +20 -7
  186. package/foundation/discovery/package-exports.d.mts +10 -0
  187. package/foundation/discovery/package-exports.mjs +56 -3
  188. package/foundation/discovery/runner-allowlist.d.mts +1 -0
  189. package/foundation/discovery/runner-allowlist.mjs +2 -0
  190. package/foundation/discovery/template-adapter.d.mts +52 -0
  191. package/foundation/discovery/template-adapter.mjs +173 -10
  192. package/foundation/discovery/theme-imports.d.mts +14 -0
  193. package/foundation/discovery/theme-imports.mjs +43 -1
  194. package/foundation/doc-compiler/import.mjs +7 -1
  195. package/foundation/doc-compiler/parse-readable.mjs +4 -1
  196. package/foundation/doc-compiler/stored-docs.d.mts +22 -0
  197. package/foundation/doc-compiler/stored-docs.mjs +49 -0
  198. package/foundation/fs/cache-eviction.d.mts +21 -0
  199. package/foundation/fs/cache-eviction.mjs +73 -0
  200. package/foundation/fs/gather-cache.d.mts +25 -4
  201. package/foundation/fs/gather-cache.mjs +163 -53
  202. package/foundation/fs/jiti-cache.d.mts +19 -1
  203. package/foundation/fs/jiti-cache.mjs +130 -6
  204. package/foundation/fs/kept-tree.d.mts +60 -0
  205. package/foundation/fs/kept-tree.mjs +154 -0
  206. package/foundation/fs/module-loader.d.mts +18 -2
  207. package/foundation/fs/module-loader.mjs +92 -20
  208. package/foundation/identity/provider-identity.d.mts +6 -0
  209. package/foundation/identity/provider-identity.mjs +10 -1
  210. package/foundation/render/embedded-imports.d.mts +5 -4
  211. package/foundation/render/embedded-imports.mjs +7 -16
  212. package/foundation/render/file-header.d.mts +66 -0
  213. package/foundation/render/file-header.mjs +118 -0
  214. package/foundation/render/host-answer.d.mts +18 -0
  215. package/foundation/render/host-answer.mjs +46 -0
  216. package/foundation/render/host-exit.d.mts +1 -0
  217. package/foundation/render/host-exit.mjs +6 -1
  218. package/foundation/render/html-reader.d.mts +55 -2
  219. package/foundation/render/html-reader.mjs +145 -26
  220. package/foundation/render/markup-edits.d.mts +57 -0
  221. package/foundation/render/markup-edits.mjs +182 -0
  222. package/foundation/render/page-host.mjs +29 -12
  223. package/foundation/render/page-worker.mjs +83 -13
  224. package/foundation/render/render-page.d.mts +34 -2
  225. package/foundation/render/render-page.mjs +210 -29
  226. package/foundation/render/source-block.d.mts +73 -6
  227. package/foundation/render/source-block.mjs +170 -19
  228. package/foundation/render/ts-paths.d.mts +53 -6
  229. package/foundation/render/ts-paths.mjs +286 -41
  230. package/foundation/response/error-codes.d.mts +3 -1
  231. package/foundation/response/error-codes.d.ts +1 -0
  232. package/foundation/response/error-codes.doc.mjs +12 -1
  233. package/foundation/response/error-codes.mjs +10 -0
  234. package/foundation/text/string-utils.d.mts +3 -2
  235. package/foundation/text/string-utils.mjs +16 -3
  236. package/foundation/text/suggest-order.d.mts +9 -0
  237. package/foundation/text/suggest-order.mjs +13 -0
  238. package/host/index.mjs +8 -6
  239. package/package.json +6 -6
@@ -29,8 +29,10 @@
29
29
  * the page is ("audit dashboard: dense table with …"); a family word there
30
30
  * outweighs the same word among the parts.
31
31
  * - The container. In "draft history in a modal", the modal is the page's
32
- * frame, and a template is its frame; container words count double, and a
33
- * container match is evidence enough to start from. Only an overlay frame
32
+ * frame, and a template is its frame; container words count double. A
33
+ * container match is evidence enough to start from only when the frame holds
34
+ * a word of the template's own family ("settings in a modal"); a frame that
35
+ * holds a part ("saved drafts in a modal") is not. Only an overlay frame
34
36
  * counts: "inside a data card" names a component the part lives in, and "in
35
37
  * an existing dashboard" names the page being changed.
36
38
  * - Phrase heads. In "side-by-side product response", "product" describes the
@@ -56,6 +58,9 @@ import {
56
58
  normalized,
57
59
  SYNONYMS_OF,
58
60
  familyWordsOf,
61
+ keywordUnits,
62
+ keywordWordsFor,
63
+ framesOf,
59
64
  } from './words.mjs';
60
65
 
61
66
  /**
@@ -136,14 +141,17 @@ const START_TERMS = 2;
136
141
  export function rankPages(query, pages) {
137
142
  const docs = pages.map(page => {
138
143
  const [family = '', ...variantParts] = page.category.split(' - ');
144
+ const keywords = page.keywords ?? [];
145
+ const phrases = keywordUnits(keywords, terms).filter(u => u.includes(' '));
139
146
  /** @type {Record<keyof typeof FIELD_WEIGHT, string>} */
140
147
  const fields = {
141
148
  id: page.name.replace(/-/g, ' '),
142
149
  variant: variantParts.join(' - '),
143
150
  family,
144
151
  display: page.displayName,
145
- // Each keyword is its own phrase: a pair never spans two of them.
146
- keywords: (page.keywords ?? []).join(', '),
152
+ // A one-word keyword is a term like any other. A longer one gives its
153
+ // words only to an idea that names the whole phrase (keywordWordsFor).
154
+ keywords: keywords.filter(k => terms(k).length === 1).join(', '),
147
155
  description: page.description,
148
156
  };
149
157
  /** @type {Map<string, number>} */
@@ -158,7 +166,9 @@ export function rankPages(query, pages) {
158
166
  page,
159
167
  family: family.trim(),
160
168
  bag,
161
- pairs: pairsOf(Object.values(fields)),
169
+ phrases,
170
+ // Each keyword is its own phrase: a pair never spans two of them.
171
+ pairs: pairsOf([...Object.values(fields), keywords.join(', ')]),
162
172
  };
163
173
  });
164
174
 
@@ -169,27 +179,52 @@ export function rankPages(query, pages) {
169
179
  for (const {bag} of docs)
170
180
  for (const t of bag.keys()) df.set(t, (df.get(t) ?? 0) + 1);
171
181
  const n = docs.length;
172
- /** @param {string} t */
173
- const idf = t => {
174
- const d = df.get(t);
182
+ /**
183
+ * @param {string} t
184
+ * @param {number} [own] 1 when the template scored carries `t` only through
185
+ * a phrase keyword the idea names, so it counts among the templates that
186
+ * carry `t`
187
+ */
188
+ const idf = (t, own = 0) => {
189
+ const d = (df.get(t) ?? 0) + own;
175
190
  return d ? Math.log(1 + (n - d + 0.5) / (d + 0.5)) : 0;
176
191
  };
177
192
 
193
+ // How many templates of each family carry each term, for how typical of its
194
+ // family a template's descriptor is.
195
+ /** @type {Map<string, Map<string, number>>} */
196
+ const familyDf = new Map();
197
+ for (const {family, bag} of docs) {
198
+ const counts = familyDf.get(family) ?? new Map();
199
+ familyDf.set(family, counts);
200
+ for (const t of bag.keys()) counts.set(t, (counts.get(t) ?? 0) + 1);
201
+ }
202
+
178
203
  const familyOfWord = familyWordsOf(pages);
179
204
  /** @param {string[]} ts */
180
205
  const familiesIn = ts =>
181
206
  new Set(ts.filter(t => familyOfWord.has(t)).map(t => familyOfWord.get(t)));
182
207
 
183
- const queryTerms = [...new Set(terms(query))];
208
+ const queryWords = terms(query);
209
+ const queryTerms = [...new Set(queryWords)];
184
210
  const headFamilies = familiesIn(
185
211
  terms(String(query).split(HEAD_END)[0] ?? ''),
186
212
  );
187
213
  const namedFamilies = familiesIn(queryTerms);
188
214
  const modifiers = modifiersOf(query);
189
215
  const containers = containersOf(query);
216
+ const frames = framesOf(query);
190
217
 
191
218
  const ranked = docs
192
- .map(({page, family, bag, pairs}) => {
219
+ .map(({page, family, bag, phrases, pairs}) => {
220
+ // The words of the phrase keywords this idea names count as keywords.
221
+ const phraseWords = new Set(keywordWordsFor(phrases, queryWords));
222
+ /** @param {string} t */
223
+ const weightOf = t =>
224
+ Math.max(
225
+ bag.get(t) ?? 0,
226
+ phraseWords.has(t) ? FIELD_WEIGHT.keywords : 0,
227
+ );
193
228
  let score = 0;
194
229
  let hits = 0;
195
230
  let containerMatched = false;
@@ -202,7 +237,10 @@ export function rankPages(query, pages) {
202
237
  const discounted =
203
238
  modified !== undefined &&
204
239
  ![...modified].some(n => pairs.has(`${t} ${n}`));
205
- const direct = idf(t) * (bag.get(t) ?? 0) * (discounted ? MODIFIER : 1);
240
+ const direct =
241
+ idf(t, bag.has(t) ? 0 : Number(phraseWords.has(t))) *
242
+ weightOf(t) *
243
+ (discounted ? MODIFIER : 1);
206
244
  let viaSynonym = 0;
207
245
  for (const s of SYNONYMS_OF.get(t) ?? []) {
208
246
  if (queryTerms.includes(s)) continue;
@@ -217,7 +255,12 @@ export function rankPages(query, pages) {
217
255
  score += value;
218
256
  hits++;
219
257
  matched.add(t);
220
- if (containers.has(t)) containerMatched = true;
258
+ // A frame is start evidence only when it holds the template's
259
+ // family itself, not a part placed on some page.
260
+ if (
261
+ [...(frames.get(t) ?? [])].some(h => familyOfWord.get(h) === family)
262
+ )
263
+ containerMatched = true;
221
264
  }
222
265
  }
223
266
  const familyNamed = namedFamilies.has(family);
@@ -226,8 +269,12 @@ export function rankPages(query, pages) {
226
269
  else if (familyNamed) score += BODY_FAMILY;
227
270
  const base = normalized(page.name) === normalized(family);
228
271
  if (familyNamed && base) score += FAMILY_BASE;
272
+ const inFamily = familyDf.get(family);
273
+ let shared = 0;
274
+ for (const t of bag.keys()) shared += (inFamily?.get(t) ?? 1) - 1;
229
275
  return {
230
276
  name: page.name,
277
+ typical: bag.size ? shared / bag.size : 0,
231
278
  score,
232
279
  hits,
233
280
  familyNamed,
@@ -41,8 +41,9 @@ export function weighStart(idea: string, ranked: import("./rank.mjs").RankedPage
41
41
  newPage?: boolean;
42
42
  }): string | null | undefined;
43
43
  /**
44
- * The blend's scores: the app shell's, and the best non-shell template with
45
- * its score and the runner-up's. Null without weights.
44
+ * The call model's scores: the app shell's, the best non-shell template's and
45
+ * the runner-up's, with the page to start from (the pick model's choice when
46
+ * the file has one, else the call model's best page). Null without weights.
46
47
  * @param {string} idea
47
48
  * @param {import('./rank.mjs').RankedPage[]} ranked
48
49
  * @param {import('./rank.mjs').RankedPage | null} pick
@@ -51,7 +52,7 @@ export function weighStart(idea: string, ranked: import("./rank.mjs").RankedPage
51
52
  */
52
53
  export function blendSummary(idea: string, ranked: import("./rank.mjs").RankedPage[], pick: import("./rank.mjs").RankedPage | null, catalog: DescribedTemplate[], weights: WeightsFile | null): {
53
54
  shell: number;
54
- best: string;
55
+ best: string | null;
55
56
  bestScore: number;
56
57
  secondScore: number;
57
58
  } | null;
@@ -86,10 +87,22 @@ export type WeightsFile = {
86
87
  * with the ranker second), then one for `SHELL`
87
88
  */
88
89
  blend: number[];
90
+ /**
91
+ * the pick
92
+ * model: its own tables and blend numbers, used only to choose which page
93
+ * starts once the call model (the top-level tables and blend) has called a
94
+ * page. Without it, one model does both.
95
+ */
96
+ pick?: {
97
+ tables: WeightTable[];
98
+ blend: number[];
99
+ } | undefined;
89
100
  };
90
101
  export type DescribedTemplate = {
91
102
  name: string;
92
103
  displayName?: string | undefined;
93
104
  category?: string | undefined;
94
105
  keywords?: string[] | undefined;
106
+ description?: string | undefined;
107
+ components?: string[] | undefined;
95
108
  };