@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.
- package/README.md +13 -23
- package/api/build/_adapter.d.mts +5 -0
- package/api/build/_adapter.mjs +49 -34
- package/api/build/blocks/blocks.d.mts +7 -5
- package/api/build/blocks/blocks.mjs +113 -26
- package/api/build/build.doc.mjs +2 -1
- package/api/build/kit/rank.mjs +59 -12
- package/api/build/kit/weights.d.mts +16 -3
- package/api/build/kit/weights.json +1 -1
- package/api/build/kit/weights.mjs +238 -31
- package/api/build/kit/word-model.d.mts +23 -0
- package/api/build/kit/word-model.mjs +46 -0
- package/api/build/kit/words.d.mts +42 -0
- package/api/build/kit/words.mjs +82 -1
- package/api/component/__fixtures__/resolutions/modules.txt +4 -5
- package/api/component/list/list.d.mts +1 -1
- package/api/component/list/list.mjs +46 -5
- package/api/discover/_adapter.d.mts +1 -1
- package/api/docs/_adapter.d.mts +26 -2
- package/api/docs/_adapter.mjs +217 -5
- package/api/docs/docs.d.mts +3 -0
- package/api/docs/docs.doc.mjs +7 -1
- package/api/docs/docs.mjs +12 -0
- package/api/docs/docs.type.d.mts +5 -0
- package/api/docs/docs.type.mjs +2 -0
- package/api/docs/node/node.mjs +1 -1
- package/api/doctor/_adapter.d.mts +27 -5
- package/api/doctor/_adapter.mjs +77 -6
- package/api/doctor/built-checks.mjs +38 -13
- package/api/doctor/doctor.d.mts +4 -3
- package/api/doctor/doctor.mjs +14 -7
- package/api/doctor/theme-checks.mjs +121 -17
- package/api/render/_adapter.mjs +531 -192
- package/api/render/render.doc.mjs +11 -3
- package/api/render/render.type.d.mts +30 -0
- package/api/render/render.type.mjs +19 -0
- package/api/search/ORDERING.md +1 -1
- package/api/search/_candidate-score.mjs +51 -32
- package/api/search/_fit-order.mjs +3 -3
- package/api/search/_result.d.mts +5 -5
- package/api/search/_score.d.mts +6 -1
- package/api/search/_score.mjs +15 -3
- package/api/search/search.d.mts +1 -1
- package/api/theme/_adapter.mjs +10 -0
- package/api/theme/build/build.d.mts +47 -0
- package/api/theme/build/build.mjs +147 -25
- package/api/theme/theme.type.d.mts +10 -0
- package/api/theme/theme.type.mjs +7 -1
- package/api/theme-edit/_adapter.d.mts +48 -0
- package/api/theme-edit/_adapter.mjs +675 -42
- package/api/theme-edit/_check.d.mts +28 -22
- package/api/theme-edit/_check.mjs +1481 -252
- package/api/theme-edit/_color.d.mts +9 -0
- package/api/theme-edit/_color.mjs +41 -1
- package/api/theme-edit/_compiler.mjs +9 -0
- package/api/theme-edit/_context.mjs +60 -3
- package/api/theme-edit/_css.mjs +21 -1
- package/api/theme-edit/_edit.d.mts +22 -0
- package/api/theme-edit/_edit.mjs +1196 -88
- package/api/theme-edit/_how-commands.d.mts +57 -0
- package/api/theme-edit/_how-commands.mjs +536 -1
- package/api/theme-edit/_how-question.d.mts +65 -0
- package/api/theme-edit/_how-question.mjs +4401 -225
- package/api/theme-edit/_how.mjs +104 -4
- package/api/theme-edit/_marks.d.mts +31 -5
- package/api/theme-edit/_marks.mjs +57 -5
- package/api/theme-edit/_normal.d.mts +153 -0
- package/api/theme-edit/_normal.mjs +661 -0
- package/api/theme-edit/_palette.mjs +10 -4
- package/api/theme-edit/_parts.d.mts +8 -0
- package/api/theme-edit/_parts.mjs +103 -2
- package/api/theme-edit/_preview-app.d.mts +7 -1
- package/api/theme-edit/_preview-app.mjs +205 -17
- package/api/theme-edit/_preview.d.mts +64 -8
- package/api/theme-edit/_preview.mjs +447 -89
- package/api/theme-edit/_settings.d.mts +176 -5
- package/api/theme-edit/_settings.mjs +1936 -128
- package/api/theme-edit/_tables.d.mts +6 -0
- package/api/theme-edit/_tables.mjs +32 -1
- package/api/theme-edit/theme-edit.type.d.mts +10 -1
- package/api/theme-edit/theme-edit.type.mjs +4 -1
- package/api/theme-edit/themeEditPreviewApp.doc.mjs +3 -3
- package/assets/codemods/run-codemod.mjs +73 -6
- package/assets/codemods/transforms/next/index.mjs +11 -1
- package/assets/codemods/transforms/next/migrate-item-swipe-actions-to-swipe.mjs +394 -0
- package/assets/docs/author-a-theme.doc.mjs +1 -0
- package/assets/docs/theme.doc.dense.mjs +2 -2
- package/assets/docs/theme.doc.mjs +1 -1
- package/assets/docs/tree/check-your-docs.doc.mjs +1 -1
- package/assets/docs/tree/cli-command.doc.mjs +2 -3
- package/assets/docs/tree/render-pages.doc.mjs +43 -2
- package/assets/docs/tree/template-doc-overview.doc.mjs +1 -1
- package/assets/docs/tree/test-in-an-app.doc.mjs +1 -1
- package/assets/docs/use-a-theme.doc.mjs +1 -1
- package/assets/docs.generated.json +2 -2
- package/assets/self-audit.generated.json +1 -1
- package/assets/templates/blocks/components/ChatComposerInput/useChatDictationHookUsage.doc.mjs +14 -0
- package/assets/templates/blocks/components/ChatComposerInput/useChatDictationHookUsage.tsx +38 -0
- package/assets/templates/blocks/components/SyntaxTheme/useSyntaxThemeHookUsage.doc.mjs +14 -0
- package/assets/templates/blocks/components/SyntaxTheme/useSyntaxThemeHookUsage.tsx +36 -0
- package/assets/templates/components.generated.json +1 -1
- package/assets/templates/pages/ai-chat/template.doc.mjs +5 -4
- package/assets/templates/pages/ai-chat-landing/template.doc.mjs +2 -1
- package/assets/templates/pages/blank/template.doc.mjs +1 -1
- package/assets/templates/pages/canvas-editor/template.doc.mjs +4 -2
- package/assets/templates/pages/centered-hero/template.doc.mjs +9 -1
- package/assets/templates/pages/classic-gallery/template.doc.mjs +1 -1
- package/assets/templates/pages/contact-form/template.doc.mjs +2 -1
- package/assets/templates/pages/dashboard/template.doc.mjs +3 -2
- package/assets/templates/pages/dashboard-alert-rail/template.doc.mjs +2 -1
- package/assets/templates/pages/dashboard-cohort-funnel/template.doc.mjs +2 -1
- package/assets/templates/pages/dashboard-composition/template.doc.mjs +2 -1
- package/assets/templates/pages/dashboard-progress/template.doc.mjs +6 -3
- package/assets/templates/pages/detail-page/template.doc.mjs +10 -3
- package/assets/templates/pages/documentation/template.doc.mjs +4 -1
- package/assets/templates/pages/documentation-design/template.doc.mjs +7 -1
- package/assets/templates/pages/documentation-technical/template.doc.mjs +7 -1
- package/assets/templates/pages/editor/template.doc.mjs +2 -8
- package/assets/templates/pages/file-explorer/template.doc.mjs +1 -1
- package/assets/templates/pages/form-two-column/template.doc.mjs +4 -3
- package/assets/templates/pages/form-wizard/template.doc.mjs +5 -3
- package/assets/templates/pages/gallery-hero/template.doc.mjs +4 -2
- package/assets/templates/pages/ide/page.tsx +24 -2
- package/assets/templates/pages/kanban-board/template.doc.mjs +1 -9
- package/assets/templates/pages/library/template.doc.mjs +4 -1
- package/assets/templates/pages/login/template.doc.mjs +2 -1
- package/assets/templates/pages/login-card/template.doc.mjs +2 -1
- package/assets/templates/pages/login-split/template.doc.mjs +2 -1
- package/assets/templates/pages/login-sso/template.doc.mjs +4 -2
- package/assets/templates/pages/mixed-gallery/template.doc.mjs +2 -1
- package/assets/templates/pages/product-detail/template.doc.mjs +4 -2
- package/assets/templates/pages/product-gallery/template.doc.mjs +2 -1
- package/assets/templates/pages/settings-dialog/template.doc.mjs +2 -1
- package/assets/templates/pages/settings-sidebar/template.doc.mjs +2 -1
- package/assets/templates/pages/shell-nav/template.doc.mjs +4 -2
- package/assets/templates/pages/shell-side-nav/template.doc.mjs +5 -3
- package/assets/templates/pages/shell-top-nav/template.doc.mjs +2 -1
- package/assets/templates/pages/side-gallery/template.doc.mjs +9 -1
- package/assets/templates/pages/table-filter/template.doc.mjs +9 -8
- package/assets/templates/pages/table-grouped/template.doc.mjs +4 -2
- package/assets/templates/pages/table-page/template.doc.mjs +5 -4
- package/assets/templates/pages/table-tree/template.doc.mjs +6 -3
- package/assets/templates/pages/theme-showcase/template.doc.mjs +2 -9
- package/assets/templates/pages/work-item-detail/template.doc.mjs +1 -0
- package/authoring/debug/parse.d.mts +3 -3
- package/authoring/doctypes/_schema.d.mts +3 -3
- package/authoring/doctypes/command/command.doc.mjs +1 -1
- package/authoring/doctypes/template/template.doc.mjs +1 -1
- package/authoring/doctypes/template/type.ts +9 -0
- package/clients/cli/bin/astryx.mjs +6 -9
- package/clients/cli/build-id.generated.json +1 -1
- package/clients/cli/commands/component.doc.mjs +1 -1
- package/clients/cli/commands/component.mjs +20 -2
- package/clients/cli/commands/docs.doc.mjs +7 -1
- package/clients/cli/commands/docs.mjs +3 -1
- package/clients/cli/commands/doctor.mjs +22 -14
- package/clients/cli/commands/experimental/render.mjs +32 -1
- package/clients/cli/commands/experimental/theme.mjs +65 -14
- package/clients/cli/commands/experimental-render.doc.mjs +2 -2
- package/clients/cli/commands/experimental-theme-compile.doc.mjs +3 -3
- package/clients/cli/commands/experimental-theme-editor-show.doc.mjs +1 -1
- package/clients/cli/commands/experimental-theme-editor-undo.doc.mjs +1 -1
- package/clients/cli/commands/experimental-theme-editor.doc.mjs +1 -1
- package/clients/cli/commands/experimental-theme-preview-app.doc.mjs +1 -1
- package/clients/cli/commands/search.doc.mjs +2 -1
- package/clients/cli/commands/search.mjs +6 -1
- package/clients/cli/commands/template.mjs +4 -2
- package/clients/cli/commands/theme-build.doc.mjs +5 -1
- package/clients/cli/commands/theme.doc.mjs +1 -1
- package/clients/cli/commands/theme.mjs +153 -5
- package/clients/cli/commands/upgrade.mjs +42 -7
- package/clients/cli/index.mjs +1 -1
- package/clients/cli/lib/component-format.mjs +205 -98
- package/clients/cli/lib/hook-format.mjs +9 -19
- package/clients/cli/manifest.generated.json +1 -1
- package/foundation/agent-docs/agent-docs.mjs +1 -1
- package/foundation/config/theme-state.d.mts +13 -1
- package/foundation/config/theme-state.mjs +47 -7
- package/foundation/discovery/component-discovery.d.mts +11 -0
- package/foundation/discovery/component-discovery.mjs +27 -2
- package/foundation/discovery/component-replacement.mjs +130 -1
- package/foundation/discovery/entry-name-files.d.mts +43 -0
- package/foundation/discovery/entry-name-files.mjs +264 -0
- package/foundation/discovery/hook-discovery.d.mts +8 -2
- package/foundation/discovery/hook-discovery.mjs +20 -7
- package/foundation/discovery/package-exports.d.mts +10 -0
- package/foundation/discovery/package-exports.mjs +56 -3
- package/foundation/discovery/runner-allowlist.d.mts +1 -0
- package/foundation/discovery/runner-allowlist.mjs +2 -0
- package/foundation/discovery/template-adapter.d.mts +52 -0
- package/foundation/discovery/template-adapter.mjs +173 -10
- package/foundation/discovery/theme-imports.d.mts +14 -0
- package/foundation/discovery/theme-imports.mjs +43 -1
- package/foundation/doc-compiler/import.mjs +7 -1
- package/foundation/doc-compiler/parse-readable.mjs +4 -1
- package/foundation/doc-compiler/stored-docs.d.mts +22 -0
- package/foundation/doc-compiler/stored-docs.mjs +49 -0
- package/foundation/fs/cache-eviction.d.mts +21 -0
- package/foundation/fs/cache-eviction.mjs +73 -0
- package/foundation/fs/gather-cache.d.mts +25 -4
- package/foundation/fs/gather-cache.mjs +163 -53
- package/foundation/fs/jiti-cache.d.mts +19 -1
- package/foundation/fs/jiti-cache.mjs +130 -6
- package/foundation/fs/kept-tree.d.mts +60 -0
- package/foundation/fs/kept-tree.mjs +154 -0
- package/foundation/fs/module-loader.d.mts +18 -2
- package/foundation/fs/module-loader.mjs +92 -20
- package/foundation/identity/provider-identity.d.mts +6 -0
- package/foundation/identity/provider-identity.mjs +10 -1
- package/foundation/render/embedded-imports.d.mts +5 -4
- package/foundation/render/embedded-imports.mjs +7 -16
- package/foundation/render/file-header.d.mts +66 -0
- package/foundation/render/file-header.mjs +118 -0
- package/foundation/render/host-answer.d.mts +18 -0
- package/foundation/render/host-answer.mjs +46 -0
- package/foundation/render/host-exit.d.mts +1 -0
- package/foundation/render/host-exit.mjs +6 -1
- package/foundation/render/html-reader.d.mts +55 -2
- package/foundation/render/html-reader.mjs +145 -26
- package/foundation/render/markup-edits.d.mts +57 -0
- package/foundation/render/markup-edits.mjs +182 -0
- package/foundation/render/page-host.mjs +29 -12
- package/foundation/render/page-worker.mjs +83 -13
- package/foundation/render/render-page.d.mts +34 -2
- package/foundation/render/render-page.mjs +210 -29
- package/foundation/render/source-block.d.mts +73 -6
- package/foundation/render/source-block.mjs +170 -19
- package/foundation/render/ts-paths.d.mts +53 -6
- package/foundation/render/ts-paths.mjs +286 -41
- package/foundation/response/error-codes.d.mts +3 -1
- package/foundation/response/error-codes.d.ts +1 -0
- package/foundation/response/error-codes.doc.mjs +12 -1
- package/foundation/response/error-codes.mjs +10 -0
- package/foundation/text/string-utils.d.mts +3 -2
- package/foundation/text/string-utils.mjs +16 -3
- package/foundation/text/suggest-order.d.mts +9 -0
- package/foundation/text/suggest-order.mjs +13 -0
- package/host/index.mjs +8 -6
- package/package.json +6 -6
package/api/build/kit/rank.mjs
CHANGED
|
@@ -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
|
|
33
|
-
* container match is evidence enough to start from
|
|
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
|
-
//
|
|
146
|
-
|
|
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
|
-
|
|
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
|
-
/**
|
|
173
|
-
|
|
174
|
-
|
|
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
|
|
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 =
|
|
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
|
-
|
|
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
|
|
45
|
-
*
|
|
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
|
};
|