@astryxdesign/cli 0.7.15 → 0.7.16-canary.g22213fd
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 +6 -4
- package/api/build/_adapter.d.mts +10 -0
- package/api/build/_adapter.mjs +24 -0
- package/api/build/blocks/blocks.d.mts +1 -0
- package/api/build/blocks/blocks.mjs +18 -1
- package/api/build/kit/shell.weights.json +1 -0
- package/api/build/kit/shellcall.d.mts +26 -0
- package/api/build/kit/shellcall.mjs +87 -0
- package/api/build/kit/start.mjs +67 -4
- package/api/build/kit/weights.d.mts +15 -0
- package/api/build/kit/weights.mjs +27 -0
- package/api/component/__fixtures__/resolutions/modules.txt +1 -1
- package/api/component/_adapter.d.mts +1 -1
- package/api/component/_adapter.mjs +28 -1
- package/api/doctor/_adapter.d.mts +38 -2
- package/api/doctor/_adapter.mjs +76 -1
- package/api/doctor/built-checks.mjs +1 -1
- package/api/doctor/doctor.d.mts +26 -0
- package/api/doctor/doctor.doc.mjs +1 -1
- package/api/doctor/doctor.mjs +156 -11
- package/api/doctor/theme-checks.mjs +163 -18
- package/api/icon/_adapter.d.mts +7 -3
- package/api/icon/_adapter.mjs +12 -3
- package/api/icon/icon.type.d.mts +15 -0
- package/api/icon/icon.type.mjs +10 -3
- package/api/icon/iconUse.doc.mjs +19 -5
- package/api/icon/list/list.mjs +7 -1
- package/api/icon/use/use.d.mts +8 -5
- package/api/icon/use/use.mjs +95 -13
- package/api/init/run/run.mjs +1 -0
- package/api/integration/add-contribution.mjs +3 -3
- package/api/integration/pack-check.mjs +14 -8
- package/api/integration/validate-integration.mjs +1 -1
- package/api/search/_adapter.mjs +15 -16
- package/api/search/_entries.d.mts +2 -1
- package/api/search/_entries.mjs +28 -1
- package/api/swizzle/_moduleGraph.mjs +1 -1
- package/api/template/template.type.d.mts +6 -2
- package/api/template/template.type.mjs +2 -1
- package/api/theme/_adapter.d.mts +5 -2
- package/api/theme/_adapter.mjs +59 -14
- package/api/theme/_fork.mjs +1 -1
- package/api/theme/build/build.d.mts +120 -32
- package/api/theme/build/build.mjs +471 -111
- package/api/theme/eject/eject.mjs +22 -1
- package/api/theme/generateTonalPalette.doc.mjs +2 -2
- package/api/theme/palette/generate/generator.mjs +141 -2
- package/api/theme/template/template.d.mts +19 -0
- package/api/theme/template/template.mjs +102 -25
- package/api/theme/theme.type.d.mts +44 -1
- package/api/theme/theme.type.mjs +23 -1
- package/api/theme/themeBuild.doc.mjs +4 -4
- package/api/theme/themeEject.doc.mjs +1 -1
- package/api/theme/themePaletteGenerate.doc.mjs +1 -1
- package/api/theme/themeTemplate.doc.mjs +9 -3
- package/api/theme-edit/_adapter.d.mts +33 -2
- package/api/theme-edit/_adapter.mjs +276 -41
- package/api/theme-edit/_check.d.mts +93 -4
- package/api/theme-edit/_check.mjs +1712 -223
- package/api/theme-edit/_color.d.mts +2 -8
- package/api/theme-edit/_color.mjs +292 -219
- package/api/theme-edit/_compiler.d.mts +1 -0
- package/api/theme-edit/_compiler.mjs +20 -1
- package/api/theme-edit/_context.d.mts +31 -1
- package/api/theme-edit/_context.mjs +445 -41
- package/api/theme-edit/_css.d.mts +60 -1
- package/api/theme-edit/_css.mjs +404 -28
- package/api/theme-edit/_edit.d.mts +25 -0
- package/api/theme-edit/_edit.mjs +1620 -154
- package/api/theme-edit/_how-commands.d.mts +11 -26
- package/api/theme-edit/_how-commands.mjs +30 -2
- package/api/theme-edit/_how-question.d.mts +15 -0
- package/api/theme-edit/_how-question.mjs +1469 -194
- package/api/theme-edit/_how.mjs +144 -30
- package/api/theme-edit/_marks.d.mts +13 -0
- package/api/theme-edit/_marks.mjs +15 -0
- package/api/theme-edit/_overview.mjs +2 -0
- package/api/theme-edit/_palette.d.mts +38 -0
- package/api/theme-edit/_palette.mjs +306 -73
- package/api/theme-edit/_parts.d.mts +33 -0
- package/api/theme-edit/_parts.mjs +138 -9
- package/api/theme-edit/_png.d.mts +18 -0
- package/api/theme-edit/_png.mjs +95 -14
- package/api/theme-edit/_preview-app.d.mts +55 -1
- package/api/theme-edit/_preview-app.mjs +1552 -101
- package/api/theme-edit/_preview.d.mts +71 -3
- package/api/theme-edit/_preview.mjs +565 -35
- package/api/theme-edit/_project.d.mts +15 -0
- package/api/theme-edit/_project.mjs +68 -13
- package/api/theme-edit/_settings.d.mts +299 -5
- package/api/theme-edit/_settings.mjs +2806 -158
- package/api/theme-edit/_tables.d.mts +24 -0
- package/api/theme-edit/_tables.mjs +212 -150
- package/api/theme-edit/_vet.d.mts +42 -0
- package/api/theme-edit/_vet.mjs +144 -0
- package/api/theme-edit/theme-edit.type.d.mts +31 -2
- package/api/theme-edit/theme-edit.type.mjs +10 -2
- package/api/theme-edit/themeEditNew.doc.mjs +1 -1
- package/api/theme-edit/themeEditPreviewApp.doc.mjs +1 -1
- package/api/theme-edit/themeEditShow.doc.mjs +11 -3
- package/api/upgrade/registry/registry.mjs +6 -1
- package/assets/codemods/parse.mjs +2 -2
- package/assets/docs/author-a-theme.doc.mjs +1 -1
- package/assets/docs/theme.doc.dense.mjs +1 -1
- package/assets/docs/theme.doc.mjs +1 -1
- package/assets/docs/theme.doc.zh.mjs +4 -3
- package/assets/docs/tree/define-the-theme.doc.mjs +1 -1
- package/assets/docs/tree/icon-sets.doc.mjs +63 -8
- package/assets/docs/tree/single-component.doc.mjs +11 -2
- package/assets/docs/tree/tokens-and-setup.doc.mjs +39 -3
- package/assets/docs.generated.json +2 -2
- package/assets/preview-app/next.config.mjs +7 -1
- package/assets/preview-app/package.json +1 -0
- package/assets/preview-app/src/app/globals.css +1 -0
- package/assets/self-audit.generated.json +1 -1
- package/assets/templates/blocks/components/Outline/useOutlineFromDOMHookUsage.doc.mjs +21 -0
- package/assets/templates/blocks/components/Outline/useOutlineFromDOMHookUsage.tsx +62 -0
- package/assets/templates/blocks/components/Table/ColumnsVirtualizationHookUsage.doc.mjs +14 -0
- package/assets/templates/blocks/components/Table/ColumnsVirtualizationHookUsage.tsx +53 -0
- package/assets/templates/blocks/components/Table/InfiniteScrollHookUsage.doc.mjs +14 -0
- package/assets/templates/blocks/components/Table/InfiniteScrollHookUsage.tsx +33 -0
- package/assets/templates/components.generated.json +1 -1
- package/assets/templates/pages/ai-chat/page.tsx +20 -2
- package/assets/templates/pages/dashboard/page.tsx +1 -1
- package/assets/templates/themes/neutral/neutralPalettes.generated.receipt.json +2 -0
- package/authoring/config/config.doc.mjs +8 -0
- package/authoring/config/parse.d.mts +1 -0
- package/authoring/config/parse.mjs +12 -0
- package/authoring/config/type.ts +8 -0
- package/authoring/doctypes/_schema.d.mts +52 -5
- package/authoring/doctypes/_schema.mjs +62 -7
- package/authoring/doctypes/base/type.ts +10 -0
- package/authoring/doctypes/component/component.doc.mjs +1 -1
- package/authoring/doctypes/function/function.doc.mjs +6 -0
- package/authoring/doctypes/function/type.ts +3 -0
- package/authoring/doctypes/icon-set/icon-set-data.doc.mjs +3 -3
- package/authoring/doctypes/legacy.mjs +5 -1
- package/authoring/index.d.ts +1 -0
- package/authoring/shadcn/source-variants.d.mts +1 -1
- package/authoring/shadcn/source-variants.mjs +32 -10
- package/clients/cli/build-id.generated.json +1 -1
- package/clients/cli/commands/doctor.doc.mjs +2 -2
- package/clients/cli/commands/experimental/icon.mjs +61 -6
- package/clients/cli/commands/experimental/theme.mjs +244 -45
- package/clients/cli/commands/experimental-icon-use.doc.mjs +12 -5
- package/clients/cli/commands/experimental-theme-compile.doc.mjs +2 -2
- package/clients/cli/commands/experimental-theme-editor-new.doc.mjs +2 -2
- package/clients/cli/commands/experimental-theme-editor-set.doc.mjs +2 -2
- package/clients/cli/commands/experimental-theme-editor-show.doc.mjs +3 -3
- package/clients/cli/commands/experimental-theme-editor-undo.doc.mjs +2 -2
- package/clients/cli/commands/experimental-theme-editor.doc.mjs +1 -1
- package/clients/cli/commands/experimental-theme-eject.doc.mjs +1 -1
- package/clients/cli/commands/experimental-theme-preview-add.doc.mjs +1 -1
- package/clients/cli/commands/experimental-theme-preview-app.doc.mjs +1 -1
- package/clients/cli/commands/experimental-theme-template.doc.mjs +2 -2
- package/clients/cli/commands/theme-build.doc.mjs +2 -2
- package/clients/cli/commands/theme-eject.doc.mjs +1 -1
- package/clients/cli/commands/theme-template.doc.mjs +3 -1
- package/clients/cli/commands/theme.doc.mjs +7 -2
- package/clients/cli/commands/theme.mjs +222 -55
- package/clients/cli/commands.generated.json +1 -1
- package/clients/cli/formatters/index.mjs +7 -4
- package/clients/cli/index.mjs +25 -5
- package/clients/cli/lib/cli-error.mjs +9 -3
- package/clients/cli/lib/component-format.mjs +27 -9
- package/clients/cli/lib/json-shim.mjs +72 -2
- package/clients/cli/manifest.generated.json +1 -1
- package/clients/cli/run.mjs +49 -0
- package/foundation/agent-docs/agent-docs-target.d.mts +2 -6
- package/foundation/agent-docs/agent-docs-target.mjs +9 -17
- package/foundation/agent-docs/agent-docs.mjs +4 -3
- package/foundation/config/config-writer.d.mts +23 -0
- package/foundation/config/config-writer.mjs +152 -58
- package/foundation/config/project.mjs +103 -16
- package/foundation/discovery/component-discovery.mjs +11 -22
- package/foundation/discovery/icon-set-checks.mjs +164 -48
- package/foundation/discovery/icon-set-discovery.d.mts +38 -5
- package/foundation/discovery/icon-set-discovery.mjs +50 -6
- package/foundation/discovery/icon-set-theme-maps.d.mts +59 -0
- package/foundation/discovery/icon-set-theme-maps.mjs +95 -0
- package/foundation/discovery/icon-set-writer.d.mts +2 -3
- package/foundation/discovery/icon-set-writer.mjs +58 -17
- package/foundation/discovery/module-exports.mjs +1 -15
- package/foundation/discovery/template-adapter.mjs +44 -19
- package/foundation/discovery/template-icons.d.mts +27 -10
- package/foundation/discovery/template-icons.mjs +142 -26
- package/foundation/discovery/template-source-tree.mjs +3 -16
- package/foundation/discovery/theme-discovery.d.mts +30 -1
- package/foundation/discovery/theme-discovery.mjs +109 -50
- package/foundation/fs/exact-codec.d.mts +35 -0
- package/foundation/fs/exact-codec.mjs +148 -0
- package/foundation/fs/gather-cache.d.mts +15 -5
- package/foundation/fs/gather-cache.mjs +129 -31
- package/foundation/fs/paths.d.mts +39 -0
- package/foundation/fs/paths.mjs +44 -11
- package/foundation/fs/read-record.mjs +11 -1
- package/foundation/integrations/autolink.d.mts +4 -2
- package/foundation/integrations/autolink.mjs +4 -2
- package/foundation/integrations/cli-requirement.d.mts +16 -5
- package/foundation/integrations/cli-requirement.mjs +27 -6
- package/foundation/integrations/contribution-fixes.mjs +1 -16
- package/foundation/integrations/may-have-integrations.mjs +7 -3
- package/foundation/integrations/missing-dependency.d.mts +9 -0
- package/foundation/integrations/missing-dependency.mjs +100 -0
- package/foundation/integrations/public-imports.mjs +1 -1
- package/foundation/render/embedded-imports.mjs +1 -1
- package/foundation/render/host-exit.d.mts +8 -0
- package/foundation/render/host-exit.mjs +11 -0
- package/foundation/render/page-host.mjs +56 -10
- package/foundation/render/page-worker.mjs +14 -0
- package/foundation/render/render-page.mjs +37 -2
- package/foundation/response/error-codes.d.mts +2 -1
- package/foundation/response/error-codes.d.ts +1 -0
- package/foundation/response/error-codes.doc.mjs +5 -0
- package/foundation/response/error-codes.mjs +3 -0
- package/foundation/response/json.d.mts +15 -0
- package/foundation/response/json.mjs +52 -1
- package/foundation/response/response-types.doc.mjs +1 -1
- package/foundation/runtime/lazy-dependencies.d.mts +14 -0
- package/foundation/runtime/lazy-dependencies.mjs +82 -0
- package/foundation/xle/browser.d.mts +2 -2
- package/package.json +7 -6
package/README.md
CHANGED
|
@@ -112,7 +112,7 @@ Each command declares what it does in a folder outside any project, and `astryx
|
|
|
112
112
|
| `search` | Search components, hooks, docs, templates, and themes in one ranked list | `same` |
|
|
113
113
|
| `swizzle` | Copy component source for customization | `refuse` |
|
|
114
114
|
| `template` | List, show, or scaffold page and block templates | `same` |
|
|
115
|
-
| `theme` | Add, switch, build, and author themes
|
|
115
|
+
| `theme` | Add, switch, build, and author themes (to make or change one, use experimental theme editor) | by subcommand |
|
|
116
116
|
| `upgrade` | Update your code after upgrading Astryx, and refresh ShadCN-copied components | `own` |
|
|
117
117
|
|
|
118
118
|
<!-- END GENERATED: commands -->
|
|
@@ -223,6 +223,7 @@ if (isError(result)) {
|
|
|
223
223
|
| `ERR_WRITE_FAILED` | Writing output files failed (and was rolled back). |
|
|
224
224
|
| `ERR_THEME_INVALID` | A theme definition or contributed theme descriptor is invalid. |
|
|
225
225
|
| `ERR_THEME_LOAD` | A theme file could not be loaded / parsed into a defineTheme result. |
|
|
226
|
+
| `ERR_THEME_STALE` | `theme build --check` found stale or missing outputs: exit 1, in the check result (`code`), not an error. |
|
|
226
227
|
| `ERR_PALETTE_GENERATION` | A palette generation request or one of its constraints was invalid. |
|
|
227
228
|
| `ERR_VERSION_DETECT` | The current `@astryxdesign/core` version could not be detected. |
|
|
228
229
|
| `ERR_INVALID_VERSION` | A `--from`/`--to` value was not a valid semver string. |
|
|
@@ -511,7 +512,7 @@ Every response has a `type` discriminant. The full set is below (generated from
|
|
|
511
512
|
| `hook.detail` | One hook's full authored HookDoc. The envelope's package is @astryxdesign/core. |
|
|
512
513
|
| `hook.detail.params` | Just one hook's parameters table (HookParamDoc[]). The envelope's package is @astryxdesign/core. |
|
|
513
514
|
| `theme.build` | A theme build receipt: name, tokenCount and componentCount (override counts), sizeKB, the written outputs {css, cssDts, js, dts, and variantsDts when applicable}, warnings (defects to fix), and notices (advisories about a correct theme, such as a named font it does not load). |
|
|
514
|
-
| `theme.build.check` | The --check receipt: theme name, an upToDate flag, the stale outputs (each {path, reason: missing \| outdated}),
|
|
515
|
+
| `theme.build.check` | The --check receipt: theme name, an upToDate flag, the stale outputs (each {path, reason: missing \| outdated}), the full list of checked paths, and, when any is stale or missing, code ERR_THEME_STALE. Writes nothing. |
|
|
515
516
|
| `theme.build.batch` | Several themes built in one invocation: `count` plus one {file, receipt} per theme in argument order, where receipt is that theme's theme.build (or theme.build.check) envelope, or null when it produced no CSS. |
|
|
516
517
|
| `theme.list` | Every bundled, installed package, and local theme as a ThemeListEntry[]. Each entry has slug, displayName, description, maintained, owner package or local root, source, added, and default fields. Optional meta.unmigratedCopies names earlier descriptor-less copies, their missing descriptor, and the upgrade command; those copies are not data entries. |
|
|
517
518
|
| `theme.app` | The app theme record after add, remove, or use. It includes every added theme and its built imports, the default slug, generated module path, and the command change. After add, the envelope package names the npm package that owns the added theme; a local theme has none. |
|
|
@@ -540,8 +541,9 @@ Every response has a `type` discriminant. The full set is below (generated from
|
|
|
540
541
|
|
|
541
542
|
## Doctor
|
|
542
543
|
|
|
543
|
-
`astryx doctor` runs
|
|
544
|
-
|
|
544
|
+
`astryx doctor` runs health checks against your project and environment. It
|
|
545
|
+
changes nothing in the project; once the per-user cache folder exists, it
|
|
546
|
+
keeps its docs checks and integration check results there. Each record uses `[ok]`, `[warn]`, `[fail]`, or `[info]`, and
|
|
545
547
|
includes an actionable `fix` when one is available. Field names match the
|
|
546
548
|
`--json` keys. The exact checks and values depend on the project; the output
|
|
547
549
|
shape is stable:
|
package/api/build/_adapter.d.mts
CHANGED
|
@@ -69,6 +69,15 @@ export function loadComponents(cwd: string): Promise<ComponentWords[]>;
|
|
|
69
69
|
* @returns {import('./kit/weights.mjs').WeightsFile | null}
|
|
70
70
|
*/
|
|
71
71
|
export function loadWeights(): import("./kit/weights.mjs").WeightsFile | null;
|
|
72
|
+
/**
|
|
73
|
+
* The fixed word table of the shell-start check (kit/shell.weights.json), read
|
|
74
|
+
* once. Null when the file is missing or unreadable.
|
|
75
|
+
* @returns {{threshold: number, weights: Record<string, number>} | null}
|
|
76
|
+
*/
|
|
77
|
+
export function loadShellWeights(): {
|
|
78
|
+
threshold: number;
|
|
79
|
+
weights: Record<string, number>;
|
|
80
|
+
} | null;
|
|
72
81
|
/**
|
|
73
82
|
* The classifier weights of build's root (tree.weights.json), read once.
|
|
74
83
|
* @returns {import('../../foundation/route/route.mjs').ClassifierWeights}
|
|
@@ -77,6 +86,7 @@ export function loadTreeWeights(): import("../../foundation/route/route.mjs").Cl
|
|
|
77
86
|
export function keptBlockCatalog<T>(key: unknown[], compute: () => T, codec: {
|
|
78
87
|
encode: (value: T) => any;
|
|
79
88
|
decode: (stored: any) => T;
|
|
89
|
+
valid?: (value: any) => boolean;
|
|
80
90
|
}): T;
|
|
81
91
|
/**
|
|
82
92
|
* The block picker's weights (blocks/blocks.weights.json), read once; null
|
package/api/build/_adapter.mjs
CHANGED
|
@@ -164,6 +164,30 @@ export function loadWeights() {
|
|
|
164
164
|
return weights ?? null;
|
|
165
165
|
}
|
|
166
166
|
|
|
167
|
+
/** @type {{threshold: number, weights: Record<string, number>} | null | undefined} */
|
|
168
|
+
let shellWeights;
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* The fixed word table of the shell-start check (kit/shell.weights.json), read
|
|
172
|
+
* once. Null when the file is missing or unreadable.
|
|
173
|
+
* @returns {{threshold: number, weights: Record<string, number>} | null}
|
|
174
|
+
*/
|
|
175
|
+
export function loadShellWeights() {
|
|
176
|
+
if (shellWeights === undefined) {
|
|
177
|
+
try {
|
|
178
|
+
shellWeights = JSON.parse(
|
|
179
|
+
fs.readFileSync(
|
|
180
|
+
new URL('./kit/shell.weights.json', import.meta.url),
|
|
181
|
+
'utf8',
|
|
182
|
+
),
|
|
183
|
+
);
|
|
184
|
+
} catch {
|
|
185
|
+
shellWeights = null;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
return shellWeights ?? null;
|
|
189
|
+
}
|
|
190
|
+
|
|
167
191
|
/** @type {import('../../foundation/route/route.mjs').ClassifierWeights | undefined} */
|
|
168
192
|
let treeWeights;
|
|
169
193
|
|
|
@@ -90,6 +90,7 @@ export function pickBlocks(request: string, signals: {
|
|
|
90
90
|
export type KeepCatalog = <T>(key: unknown[], compute: () => T, codec: {
|
|
91
91
|
encode: (value: T) => any;
|
|
92
92
|
decode: (stored: any) => T;
|
|
93
|
+
valid?: (value: any) => boolean;
|
|
93
94
|
}) => T;
|
|
94
95
|
export type BlockPickerWeights = {
|
|
95
96
|
/**
|
|
@@ -45,7 +45,7 @@ import {STOPWORDS} from '../../search/_query.mjs';
|
|
|
45
45
|
/**
|
|
46
46
|
* Keeps a value derived from the catalog between runs (build's adapter does
|
|
47
47
|
* it beside the kept search catalog), or works it out.
|
|
48
|
-
* @typedef {<T>(key: unknown[], compute: () => T, codec: {encode: (value: T) => any, decode: (stored: any) => T}) => T} KeepCatalog
|
|
48
|
+
* @typedef {<T>(key: unknown[], compute: () => T, codec: {encode: (value: T) => any, decode: (stored: any) => T, valid?: (value: any) => boolean}) => T} KeepCatalog
|
|
49
49
|
*/
|
|
50
50
|
|
|
51
51
|
/**
|
|
@@ -410,6 +410,23 @@ function computeCatalog(key, catalog, components, weights) {
|
|
|
410
410
|
* projection as its numbers.
|
|
411
411
|
*/
|
|
412
412
|
const CATALOG_CODEC = {
|
|
413
|
+
/**
|
|
414
|
+
* What decode can get wrong in a read-back catalog: its key, each block's
|
|
415
|
+
* component, and projections of one width with finite numbers.
|
|
416
|
+
* @param {any} read
|
|
417
|
+
*/
|
|
418
|
+
valid: read => {
|
|
419
|
+
if (read == null || typeof read.key !== 'string') return false;
|
|
420
|
+
const blocks = [...read.blocks.values()];
|
|
421
|
+
const width = blocks[0]?.projected.length;
|
|
422
|
+
return blocks.every(
|
|
423
|
+
(/** @type {any} */ b) =>
|
|
424
|
+
typeof b.component === 'string' &&
|
|
425
|
+
b.projected.length > 0 &&
|
|
426
|
+
b.projected.length === width &&
|
|
427
|
+
[...b.projected].every(Number.isFinite),
|
|
428
|
+
);
|
|
429
|
+
},
|
|
413
430
|
/** @param {ReturnType<typeof computeCatalog>} read */
|
|
414
431
|
encode: read => ({
|
|
415
432
|
key: read.key,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"threshold":1.5,"weights":{"b:above_an":-0.5,"b:above_existing":-0.5,"b:action_and":-1.0,"b:action_with":-1.0,"b:actions_and":-1.0,"b:add_button":1.0,"b:all_and":-1.0,"b:an_add":0.5,"b:an_empty":-1.0,"b:an_existing":-1.5,"b:an_external":-1.0,"b:an_open":-1.0,"b:an_optional":-0.5,"b:analytics_dashboard":-0.5,"b:and_accessible":-1.5,"b:and_action":-1.0,"b:and_after":0.5,"b:and_before":-0.5,"b:and_cancel":-0.5,"b:and_collapsed":-1.0,"b:and_collapsible":0.5,"b:and_compact":1.5,"b:and_confirmation":-0.5,"b:and_current":-0.5,"b:and_dark":-1.0,"b:and_data":0.5,"b:and_date":-0.5,"b:and_dense":0.5,"b:and_detail":1.5,"b:and_empty":-0.5,"b:and_evidence":0.5,"b:and_explicit":1.0,"b:and_inline":1.0,"b:and_links":0.5,"b:and_live":1.0,"b:and_metadata":1.0,"b:and_next":1.0,"b:and_no":-1.0,"b:and_one":0.5,"b:and_open":0.5,"b:and_optional":1.0,"b:and_percentage":-0.5,"b:and_refresh":-1.0,"b:and_saved":-0.5,"b:and_selected":1.0,"b:and_separate":1.0,"b:and_show":1.5,"b:and_source":-0.5,"b:and_status":0.5,"b:and_table":-0.5,"b:and_three":-1.0,"b:and_time":-0.5,"b:and_two":1.0,"b:and_unavailable":-1.5,"b:app_name":-0.5,"b:app_shell":0.5,"b:app_with":0.5,"b:banner_for":-0.5,"b:banner_with":-0.5,"b:bar_and":-1.0,"b:bar_chart":-0.5,"b:bar_with":0.5,"b:bars_and":0.5,"b:before_after":1.0,"b:before_and":0.5,"b:below_the":-0.5,"b:beside_an":-0.5,"b:button_and":1.0,"b:button_in":-0.5,"b:button_opening":-0.5,"b:button_with":-0.5,"b:buttons_and":0.5,"b:calendar_with":1.5,"b:card_with":-1.5,"b:cards_and":1.5,"b:cell_with":-0.5,"b:chart_and":1.0,"b:chart_legend":-0.5,"b:chart_with":-1.5,"b:charts_with":-1.5,"b:columns_and":-0.5,"b:compact_chart":-0.5,"b:compact_inline":-0.5,"b:compact_model":-0.5,"b:compact_read":-0.5,"b:compact_status":-0.5,"b:compact_table":-1.0,"b:comparison_table":0.5,"b:comparison_with":1.0,"b:confirmation_dialog":-0.5,"b:controls_for":-0.5,"b:controls_with":-1.5,"b:copy_link":-1.0,"b:counts_and":1.0,"b:coverage_and":-0.5,"b:coverage_table":-0.5,"b:dashboard_with":0.5,"b:data_dashboard":-0.5,"b:data_source":0.5,"b:data_table":-0.5,"b:date_and":-0.5,"b:dense_data":1.0,"b:dense_read":0.5,"b:dense_table":-1.0,"b:description_and":0.5,"b:detail_dialog":1.0,"b:detail_page":-0.5,"b:detail_panel":0.5,"b:detail_with":1.0,"b:details_and":-0.5,"b:details_dialog":-0.5,"b:details_panel":0.5,"b:details_with":-0.5,"b:dialog_and":-0.5,"b:dialog_with":-2.5,"b:each_with":-1.5,"b:empty_and":0.5,"b:empty_state":-0.5,"b:empty_states":-0.5,"b:error_and":0.5,"b:error_banner":0.5,"b:error_states":-0.5,"b:evidence_and":1.0,"b:evidence_table":1.0,"b:existing_analytics":-0.5,"b:existing_app":3.0,"b:existing_dashboard":-0.5,"b:existing_dense":-2.0,"b:existing_metric":-0.5,"b:existing_metrics":-0.5,"b:existing_overview":-0.5,"b:existing_page":-1.0,"b:existing_review":-0.5,"b:existing_run":-0.5,"b:existing_sidebar":-0.5,"b:existing_test":-0.5,"b:external_link":-0.5,"b:external_links":-0.5,"b:fields_and":-0.5,"b:filter_for":-0.5,"b:filters_and":0.5,"b:filters_with":-0.5,"b:for_an":1.0,"b:for_the":1.0,"b:form_and":0.5,"b:form_dialog":-0.5,"b:form_to":0.5,"b:form_with":1.0,"b:full_width":0.5,"b:graph_with":-0.5,"b:grid_of":1.0,"b:grid_with":1.0,"b:header_and":-2.0,"b:header_with":-0.5,"b:heading_and":-0.5,"b:headings_and":-0.5,"b:health_dashboard":-0.5,"b:history_table":0.5,"b:history_with":0.5,"b:hover_card":-0.5,"b:in_an":-0.5,"b:inside_existing":-0.5,"b:inside_the":2.0,"b:inspector_with":-1.0,"b:keep_existing":-0.5,"b:keep_the":-2.0,"b:keyboard_accessible":-0.5,"b:label_and":-1.0,"b:labels_and":-0.5,"b:landing_page":-0.5,"b:last_updated":0.5,"b:left_and":1.0,"b:light_and":-0.5,"b:line_chart":1.5,"b:link_button":-0.5,"b:link_to":1.0,"b:links_and":-0.5,"b:links_in":-1.0,"b:links_to":1.5,"b:list_and":-1.0,"b:list_with":1.0,"b:loading_empty":1.0,"b:loading_error":0.5,"b:menu_with":-1.0,"b:metadata_and":0.5,"b:metadata_rows":-0.5,"b:metadata_with":-1.0,"b:metric_card":-0.5,"b:metric_cards":-1.0,"b:metrics_and":-1.0,"b:metrics_table":-1.0,"b:metrics_with":0.5,"b:modal_with":-0.5,"b:name_and":-0.5,"b:names_and":-0.5,"b:navigation_and":0.5,"b:navigation_with":-0.5,"b:next_action":0.5,"b:next_to":-0.5,"b:notice_with":-0.5,"b:of_an":-0.5,"b:of_the":0.5,"b:on_an":-0.5,"b:on_hover":-0.5,"b:on_mobile":-0.5,"b:on_the":0.5,"b:one_compact":-0.5,"b:one_primary":-0.5,"b:overview_and":-1.0,"b:overview_with":2.0,"b:page_and":-0.5,"b:page_for":1.0,"b:page_frame":-1.0,"b:page_header":-1.0,"b:page_with":1.0,"b:panel_with":-2.5,"b:per_row":0.5,"b:picker_with":-0.5,"b:popover_with":-1.0,"b:preserve_the":-0.5,"b:primary_action":0.5,"b:report_with":1.0,"b:results_table":-0.5,"b:results_with":-0.5,"b:retry_button":-0.5,"b:review_page":0.5,"b:review_queue":0.5,"b:review_table":-0.5,"b:review_with":0.5,"b:right_side":-0.5,"b:row_and":-0.5,"b:row_with":-0.5,"b:rows_and":0.5,"b:rows_in":-0.5,"b:rows_with":-0.5,"b:run_history":0.5,"b:save_and":-0.5,"b:search_and":-0.5,"b:search_with":1.5,"b:searchable_multi":-1.0,"b:section_with":-1.0,"b:sections_with":-1.5,"b:segmented_control":-0.5,"b:selector_for":-0.5,"b:selector_in":-0.5,"b:selector_to":-1.0,"b:selectors_and":-0.5,"b:series_chart":-1.0,"b:shell_and":1.5,"b:shell_with":-0.5,"b:side_navigation":-1.0,"b:sidebar_and":1.5,"b:sidebar_with":-1.5,"b:single_page":1.5,"b:source_and":0.5,"b:source_details":-0.5,"b:source_links":1.0,"b:state_for":-0.5,"b:status_in":-0.5,"b:status_rows":1.0,"b:summary_and":1.0,"b:summary_card":-0.5,"b:summary_table":-0.5,"b:summary_with":-1.0,"b:switch_and":0.5,"b:tab_with":0.5,"b:table_and":0.5,"b:table_cell":-0.5,"b:table_column":-1.0,"b:table_of":0.5,"b:table_row":-1.0,"b:table_rows":-0.5,"b:table_to":-0.5,"b:table_with":0.5,"b:tables_and":1.0,"b:tables_with":0.5,"b:tags_and":-0.5,"b:text_and":-0.5,"b:text_input":2.5,"b:that_opens":-0.5,"b:the_app":1.0,"b:the_current":-1.5,"b:the_existing":-1.0,"b:the_left":0.5,"b:the_page":-1.0,"b:the_right":0.5,"b:the_selected":0.5,"b:time_and":-1.0,"b:time_range":0.5,"b:time_series":0.5,"b:timeline_with":-0.5,"b:timestamp_and":-0.5,"b:title_and":-0.5,"b:to_show":-1.0,"b:to_the":-1.0,"b:toggle_to":-0.5,"b:tokens_and":-0.5,"b:tool_with":0.5,"b:toolbar_and":1.0,"b:toolbar_with":-1.0,"b:trend_and":0.5,"b:two_column":-0.5,"b:two_compact":-1.0,"b:unavailable_states":-1.0,"b:update_the":-0.5,"b:using_the":1.0,"b:warning_and":-0.5,"b:while_preserving":-0.5,"b:with_clickable":0.5,"b:with_colored":-0.5,"b:with_compact":-0.5,"b:with_copy":-1.0,"b:with_counts":-0.5,"b:with_current":0.5,"b:with_editable":0.5,"b:with_exact":-0.5,"b:with_expandable":-1.0,"b:with_explicit":-0.5,"b:with_filters":0.5,"b:with_four":-0.5,"b:with_grouped":0.5,"b:with_hover":1.0,"b:with_independent":-0.5,"b:with_inline":1.5,"b:with_one":0.5,"b:with_per":0.5,"b:with_progress":-1.0,"b:with_read":-0.5,"b:with_request":1.0,"b:with_search":-0.5,"b:with_separate":-0.5,"b:with_shared":0.5,"b:with_tabs":0.5,"b:with_the":-0.5,"b:with_title":-1.0,"b:without_changing":-0.5,"b:workflow_with":1.5,"b:workspace_with":1.5,"base":-0.5,"commas:0":-0.5,"commas:3":1.0,"commas:4":1.0,"h:3":-0.5,"k:edit":-1.0,"k:page":0.5,"k:part":-0.5,"len:0":-1.0,"len:1":-1.0,"len:2":-0.5,"len:4":0.5,"len:5":0.5,"len:6":1.5,"s:0":-0.5,"s:4":0.5,"s:5":0.5,"u:above":-0.5,"u:accepted":-0.5,"u:access":1.0,"u:accessible":-1.0,"u:account":0.5,"u:actions":-0.5,"u:add":-1.5,"u:admin":1.0,"u:after":-0.5,"u:agent":0.5,"u:ai":0.5,"u:alert":1.0,"u:all":-0.5,"u:analytics":0.5,"u:animated":0.5,"u:answer":0.5,"u:application":0.5,"u:apply":-0.5,"u:architecture":1.0,"u:area":-0.5,"u:areas":1.0,"u:artifact":-0.5,"u:artifacts":-0.5,"u:as":-0.5,"u:assistant":-0.5,"u:at":0.5,"u:attachment":-1.0,"u:badge":-1.0,"u:banner":-0.5,"u:bar":-0.5,"u:below":-1.0,"u:benchmark":1.0,"u:between":-0.5,"u:blocked":-0.5,"u:blocking":-0.5,"u:blocks":0.5,"u:board":1.5,"u:body":0.5,"u:bounded":-1.0,"u:brief":0.5,"u:browser":1.0,"u:bug":-1.0,"u:bulk":-0.5,"u:button":-0.5,"u:buttons":-0.5,"u:by":0.5,"u:calendar":1.0,"u:cancel":-0.5,"u:candidate":0.5,"u:candidates":-0.5,"u:capture":0.5,"u:card":-0.5,"u:catalog":0.5,"u:category":0.5,"u:cells":0.5,"u:center":0.5,"u:change":-0.5,"u:changes":-0.5,"u:changing":-0.5,"u:chart":-1.0,"u:charts":0.5,"u:check":0.5,"u:checkboxes":-1.0,"u:chips":-1.0,"u:choose":-1.0,"u:clear":-1.0,"u:close":-0.5,"u:closed":-1.5,"u:cohort":0.5,"u:collapse":-0.5,"u:collapsed":-1.5,"u:collapsible":-0.5,"u:color":-0.5,"u:colors":-0.5,"u:columns":0.5,"u:comment":-0.5,"u:comments":-1.5,"u:compact":-0.5,"u:compare":2.0,"u:completed":-1.0,"u:completion":-0.5,"u:component":1.0,"u:concise":-0.5,"u:config":1.0,"u:configuration":-0.5,"u:confirm":-1.0,"u:confirmed":-1.0,"u:console":1.0,"u:containing":0.5,"u:content":-1.0,"u:contextual":-1.0,"u:conversation":-0.5,"u:copy":-0.5,"u:count":-0.5,"u:counts":-1.0,"u:create":0.5,"u:custom":-0.5,"u:daily":0.5,"u:dark":0.5,"u:dashboard":0.5,"u:data":-0.5,"u:dataset":0.5,"u:day":-0.5,"u:days":-0.5,"u:decision":0.5,"u:decisions":1.5,"u:default":-2.0,"u:definition":-0.5,"u:definitions":0.5,"u:delete":-0.5,"u:delta":-1.5,"u:demand":-0.5,"u:dense":0.5,"u:dependency":-1.0,"u:description":-0.5,"u:descriptions":-1.0,"u:destination":-1.5,"u:detailed":-0.5,"u:details":0.5,"u:diagnostic":0.5,"u:diagnostics":0.5,"u:dialog":-1.0,"u:directory":2.5,"u:disabled":-0.5,"u:disclosure":-0.5,"u:display":-0.5,"u:distinct":-0.5,"u:document":1.5,"u:documentation":0.5,"u:dot":-0.5,"u:dots":0.5,"u:drafts":-0.5,"u:drawer":-1.0,"u:drill":0.5,"u:drop":-0.5,"u:dropdown":-0.5,"u:duration":-0.5,"u:each":1.0,"u:editable":1.0,"u:editor":-0.5,"u:edits":-1.0,"u:embedded":-1.0,"u:end":-0.5,"u:entity":0.5,"u:error":-0.5,"u:event":0.5,"u:events":0.5,"u:evidence":-0.5,"u:existing":-2.5,"u:expand":-1.0,"u:expandable":-0.5,"u:expanded":-1.5,"u:experiment":-0.5,"u:explain":-1.0,"u:explaining":-0.5,"u:explicit":-1.0,"u:failed":-0.5,"u:failure":-0.5,"u:fallback":-1.0,"u:feature":1.0,"u:feed":0.5,"u:feedback":-0.5,"u:fields":-0.5,"u:file":0.5,"u:filterable":1.5,"u:filtered":-1.0,"u:filters":0.5,"u:findings":0.5,"u:first":0.5,"u:flow":-0.5,"u:follow":0.5,"u:footer":-1.5,"u:for":-1.0,"u:form":1.0,"u:four":1.0,"u:from":-0.5,"u:gallery":0.5,"u:gap":-0.5,"u:gate":1.0,"u:generate":0.5,"u:generated":-0.5,"u:global":0.5,"u:graph":0.5,"u:grid":1.0,"u:group":0.5,"u:grouped":0.5,"u:guide":2.0,"u:header":-0.5,"u:headers":-0.5,"u:heading":-0.5,"u:headings":0.5,"u:headline":0.5,"u:health":0.5,"u:hierarchy":-0.5,"u:highlight":-0.5,"u:highlighted":0.5,"u:home":0.5,"u:horizontal":0.5,"u:host":-0.5,"u:hours":0.5,"u:hover":-1.0,"u:icon":-1.5,"u:icons":-0.5,"u:id":-0.5,"u:in":-1.0,"u:inbox":1.0,"u:independently":0.5,"u:indicator":-0.5,"u:info":-1.0,"u:information":-0.5,"u:informational":-1.0,"u:inline":-1.5,"u:inside":-1.0,"u:inspector":1.5,"u:intake":1.5,"u:interactive":1.0,"u:into":-1.0,"u:inventory":1.5,"u:item":-0.5,"u:items":-1.5,"u:its":0.5,"u:job":0.5,"u:jobs":-0.5,"u:json":0.5,"u:keep":-1.0,"u:keeping":-0.5,"u:label":-1.0,"u:labeled":-0.5,"u:labeling":1.0,"u:labels":-1.0,"u:landing":1.0,"u:legend":-0.5,"u:level":-1.0,"u:library":0.5,"u:lifecycle":0.5,"u:light":-0.5,"u:line":-0.5,"u:lines":-0.5,"u:linked":-1.0,"u:links":-0.5,"u:list":1.0,"u:listing":1.0,"u:lists":0.5,"u:load":-0.5,"u:loading":-1.0,"u:log":2.0,"u:long":-0.5,"u:lookup":1.0,"u:manager":0.5,"u:match":-1.0,"u:matching":1.0,"u:matrix":1.5,"u:measured":0.5,"u:measurement":0.5,"u:message":-0.5,"u:messages":-1.5,"u:metadata":-0.5,"u:metric":0.5,"u:minimal":-0.5,"u:mobile":1.0,"u:modal":-1.0,"u:mode":-0.5,"u:model":-0.5,"u:monitoring":-0.5,"u:more":0.5,"u:multi":0.5,"u:multiple":-0.5,"u:my":1.0,"u:name":-0.5,"u:names":-0.5,"u:nav":-0.5,"u:navigation":-0.5,"u:neutral":-1.0,"u:new":-0.5,"u:node":-0.5,"u:not":-1.0,"u:note":1.0,"u:numbered":-0.5,"u:numbers":-1.5,"u:observed":-1.0,"u:of":0.5,"u:on":-1.0,"u:only":0.5,"u:open":-0.5,"u:opening":-0.5,"u:opens":-0.5,"u:operations":0.5,"u:option":0.5,"u:optional":-1.0,"u:options":-1.5,"u:outcome":-1.0,"u:output":-0.5,"u:over":-1.0,"u:overlay":-1.0,"u:owner":0.5,"u:page":1.0,"u:pages":0.5,"u:paginated":0.5,"u:pagination":-0.5,"u:pane":1.0,"u:panel":-0.5,"u:panels":1.0,"u:percentage":-0.5,"u:performance":0.5,"u:person":-0.5,"u:pill":-1.5,"u:pills":-0.5,"u:pinned":0.5,"u:pipeline":-1.0,"u:placeholder":-2.0,"u:plus":0.5,"u:popover":-0.5,"u:post":0.5,"u:presentation":1.5,"u:preserve":-1.5,"u:preserving":-2.5,"u:preview":0.5,"u:previews":0.5,"u:primary":0.5,"u:priority":1.5,"u:production":0.5,"u:progress":0.5,"u:project":0.5,"u:projects":1.0,"u:prominent":0.5,"u:prompt":1.0,"u:public":1.0,"u:publication":0.5,"u:publish":1.0,"u:published":1.5,"u:quality":-0.5,"u:query":-0.5,"u:question":1.5,"u:queue":1.0,"u:quick":0.5,"u:quiet":1.0,"u:rail":-2.0,"u:range":-1.0,"u:ranked":0.5,"u:rate":0.5,"u:read":0.5,"u:readiness":-0.5,"u:reading":0.5,"u:reason":-0.5,"u:reasoning":-0.5,"u:recording":0.5,"u:reference":0.5,"u:region":-1.0,"u:release":0.5,"u:rename":-0.5,"u:report":1.0,"u:reporting":-0.5,"u:reports":0.5,"u:request":0.5,"u:requirement":-0.5,"u:resizable":-0.5,"u:response":-1.0,"u:responsive":-0.5,"u:result":-0.5,"u:results":0.5,"u:retain":-1.0,"u:retry":-1.0,"u:review":0.5,"u:reviewed":0.5,"u:rollout":-0.5,"u:routing":1.0,"u:rows":0.5,"u:rule":-0.5,"u:running":-1.5,"u:runs":0.5,"u:save":-1.5,"u:saved":0.5,"u:scoped":0.5,"u:score":0.5,"u:scorecard":0.5,"u:scroll":-1.5,"u:scrollable":0.5,"u:scrolling":-0.5,"u:search":0.5,"u:section":-1.0,"u:sections":1.0,"u:segment":-1.0,"u:select":-1.0,"u:selectable":-0.5,"u:selecting":-0.5,"u:selection":0.5,"u:semantic":-0.5,"u:send":-0.5,"u:separate":-1.0,"u:separated":-1.0,"u:series":-0.5,"u:server":0.5,"u:service":0.5,"u:sessions":0.5,"u:setup":0.5,"u:share":-1.0,"u:shared":-0.5,"u:shell":0.5,"u:short":0.5,"u:show":-0.5,"u:shows":1.0,"u:side":0.5,"u:sidebar":-0.5,"u:single":0.5,"u:six":1.0,"u:small":-0.5,"u:snapshot":-1.0,"u:sortable":0.5,"u:sources":-1.0,"u:spacing":-1.0,"u:stacked":-1.0,"u:stage":0.5,"u:stale":-1.0,"u:step":-0.5,"u:stepper":1.0,"u:steps":0.5,"u:sticky":0.5,"u:strip":-1.0,"u:style":1.0,"u:submission":0.5,"u:submit":1.0,"u:suggestions":-1.0,"u:summaries":0.5,"u:surface":-0.5,"u:svg":0.5,"u:system":1.5,"u:tab":-0.5,"u:table":0.5,"u:tables":0.5,"u:tabs":0.5,"u:tag":-1.0,"u:tags":-0.5,"u:target":-0.5,"u:team":1.0,"u:technical":-0.5,"u:text":-0.5,"u:that":-0.5,"u:the":-1.0,"u:theme":0.5,"u:then":2.0,"u:tiles":1.0,"u:timestamp":-1.5,"u:timing":0.5,"u:to":-0.5,"u:toggles":1.0,"u:token":-0.5,"u:tokens":-0.5,"u:tool":1.0,"u:toolbar":-0.5,"u:tools":0.5,"u:top":-1.0,"u:totals":-0.5,"u:trace":-0.5,"u:tracker":0.5,"u:tracking":1.0,"u:transcript":-0.5,"u:tree":1.0,"u:trends":2.0,"u:triage":0.5,"u:turn":-0.5,"u:type":-0.5,"u:typed":-0.5,"u:types":-1.5,"u:unavailable":-1.5,"u:up":-0.5,"u:updated":0.5,"u:upload":1.0,"u:url":0.5,"u:usage":-1.0,"u:use":-0.5,"u:using":0.5,"u:validation":-1.0,"u:value":-0.5,"u:values":-1.0,"u:version":-1.0,"u:versus":-0.5,"u:vertical":-0.5,"u:vertically":-0.5,"u:view":0.5,"u:viewer":1.0,"u:visible":-0.5,"u:visual":1.0,"u:visualization":-0.5,"u:volume":0.5,"u:warning":-1.0,"u:warnings":0.5,"u:weekly":1.5,"u:when":-2.0,"u:where":1.0,"u:while":-2.0,"u:widget":-1.0,"u:widgets":-1.5,"u:windows":1.0,"u:with":0.5,"u:without":-1.5,"u:wizard":-0.5,"u:work":0.5,"u:workflow":0.5,"u:workspace":1.0,"u:wrapped":-0.5,"u:wrapping":-0.5}}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// @generated by scripts/sync-api-types.mjs from the JSDoc in api/**/*.mjs.
|
|
2
|
+
// DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Whether an idea carries an edit phrase. It needs no word table.
|
|
6
|
+
* @param {string} idea
|
|
7
|
+
* @returns {boolean}
|
|
8
|
+
*/
|
|
9
|
+
export function hasEditPhrase(idea: string): boolean;
|
|
10
|
+
/**
|
|
11
|
+
* The ranker's best page template that is not a shell, or undefined.
|
|
12
|
+
* @param {import('./rank.mjs').RankedPage[]} ranked
|
|
13
|
+
*/
|
|
14
|
+
export function bestPage(ranked: import("./rank.mjs").RankedPage[]): import("./words.mjs").RankedPage | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* The text score without its threshold, and whether the edit rule fires.
|
|
17
|
+
* Null without the table or a page to weigh.
|
|
18
|
+
* @param {string} idea
|
|
19
|
+
* @param {import('./rank.mjs').IdeaKind} kind
|
|
20
|
+
* @param {import('./rank.mjs').RankedPage[]} ranked
|
|
21
|
+
* @returns {{edit: boolean, score: number} | null}
|
|
22
|
+
*/
|
|
23
|
+
export function shellCallScore(idea: string, kind: import("./rank.mjs").IdeaKind, ranked: import("./rank.mjs").RankedPage[]): {
|
|
24
|
+
edit: boolean;
|
|
25
|
+
score: number;
|
|
26
|
+
} | null;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file Whether an idea that build would start on the app shell still asks
|
|
5
|
+
* for a whole page.
|
|
6
|
+
*
|
|
7
|
+
* @input The idea, its kind (`ideaKind`), and the page ranker's output.
|
|
8
|
+
* @output True when the idea reads as a new page, so build starts from the
|
|
9
|
+
* closest page template instead of the empty shell.
|
|
10
|
+
* @position Beside start.mjs (api/build/kit/). It runs only on a shell start,
|
|
11
|
+
* after the placement rules. An idea with an edit phrase keeps the shell.
|
|
12
|
+
*
|
|
13
|
+
* The call is a linear score over fixed weights
|
|
14
|
+
* (`shell.weights.json`): the idea's words and word pairs, its kind, its
|
|
15
|
+
* length, and how strongly the ranker's best page template matched.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import {loadShellWeights} from '../_adapter.mjs';
|
|
19
|
+
import {SHELL_FAMILY} from './words.mjs';
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Words that mark a change to a page or app the builder already has.
|
|
23
|
+
*/
|
|
24
|
+
const EDIT =
|
|
25
|
+
/\b(existing|current|my (page|app|dashboard|screen|site)|add (a |an |the )?\w* ?to|change|fix|move|rename|restyle|update|modify|replace|remove|tweak|adjust|improve|refactor|our (page|app))\b/;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Whether an idea carries an edit phrase. It needs no word table.
|
|
29
|
+
* @param {string} idea
|
|
30
|
+
* @returns {boolean}
|
|
31
|
+
*/
|
|
32
|
+
export function hasEditPhrase(idea) {
|
|
33
|
+
return EDIT.test(String(idea).toLowerCase());
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* The features the weights are keyed by.
|
|
38
|
+
* @param {string} text the idea, lower case
|
|
39
|
+
* @param {string} kind
|
|
40
|
+
* @param {import('./rank.mjs').RankedPage | undefined} best the ranker's best
|
|
41
|
+
* page template that is not a shell
|
|
42
|
+
* @returns {Set<string>}
|
|
43
|
+
*/
|
|
44
|
+
function featuresOf(text, kind, best) {
|
|
45
|
+
const words = text.match(/[a-z]+/g) ?? [];
|
|
46
|
+
const features = new Set(['bias', `k:${kind}`]);
|
|
47
|
+
words.forEach((word, i) => {
|
|
48
|
+
features.add(`u:${word}`);
|
|
49
|
+
if (i > 0) features.add(`b:${words[i - 1]}_${word}`);
|
|
50
|
+
});
|
|
51
|
+
if (best) {
|
|
52
|
+
features.add(`s:${Math.min(Math.floor(best.score / 5), 6)}`);
|
|
53
|
+
features.add(`h:${Math.min(best.hits, 4)}`);
|
|
54
|
+
if (best.familyNamed) features.add('fam');
|
|
55
|
+
if (best.base) features.add('base');
|
|
56
|
+
}
|
|
57
|
+
features.add(`len:${Math.min(Math.floor(words.length / 5), 6)}`);
|
|
58
|
+
features.add(`commas:${Math.min((text.match(/,/g) ?? []).length, 4)}`);
|
|
59
|
+
return features;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* The ranker's best page template that is not a shell, or undefined.
|
|
64
|
+
* @param {import('./rank.mjs').RankedPage[]} ranked
|
|
65
|
+
*/
|
|
66
|
+
export function bestPage(ranked) {
|
|
67
|
+
return ranked.find(r => r.family !== SHELL_FAMILY && r.score > 0);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* The text score without its threshold, and whether the edit rule fires.
|
|
72
|
+
* Null without the table or a page to weigh.
|
|
73
|
+
* @param {string} idea
|
|
74
|
+
* @param {import('./rank.mjs').IdeaKind} kind
|
|
75
|
+
* @param {import('./rank.mjs').RankedPage[]} ranked
|
|
76
|
+
* @returns {{edit: boolean, score: number} | null}
|
|
77
|
+
*/
|
|
78
|
+
export function shellCallScore(idea, kind, ranked) {
|
|
79
|
+
const weights = loadShellWeights();
|
|
80
|
+
if (!weights) return null;
|
|
81
|
+
const text = String(idea).toLowerCase();
|
|
82
|
+
const best = bestPage(ranked);
|
|
83
|
+
let score = 0;
|
|
84
|
+
for (const feature of featuresOf(text, kind, best))
|
|
85
|
+
score += weights.weights[feature] ?? 0;
|
|
86
|
+
return {edit: EDIT.test(text), score};
|
|
87
|
+
}
|
package/api/build/kit/start.mjs
CHANGED
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
import {loadWeights} from '../_adapter.mjs';
|
|
9
9
|
import {asksForNewPage} from './kind.mjs';
|
|
10
10
|
import {pickAlternatives, pickStart} from './rank.mjs';
|
|
11
|
-
import {
|
|
11
|
+
import {hasEditPhrase, shellCallScore} from './shellcall.mjs';
|
|
12
|
+
import {blendOrder, blendSummary, weighStart} from './weights.mjs';
|
|
12
13
|
|
|
13
14
|
/**
|
|
14
15
|
* @typedef {import('../../search/search.type.mjs').SearchResultEntry} SearchResultEntry
|
|
@@ -57,6 +58,60 @@ function placement(kind, inPage) {
|
|
|
57
58
|
return null;
|
|
58
59
|
}
|
|
59
60
|
|
|
61
|
+
/**
|
|
62
|
+
* Fixed coefficients of a logistic decision over build's own numbers: bias,
|
|
63
|
+
* whole page, edit, blend margin over the shell, the shell's blend score, the
|
|
64
|
+
* gap to the blend's second template, the idea's comma count, the text score
|
|
65
|
+
* (shellcall.mjs) and its edit-word flag. Fixed constants; nothing is trained
|
|
66
|
+
* at run time. An edit phrase keeps the shell before the decision runs, so the
|
|
67
|
+
* two edit inputs are 0 whenever it runs; they stay because the constants were
|
|
68
|
+
* fit with them.
|
|
69
|
+
*/
|
|
70
|
+
const LIFT = [
|
|
71
|
+
-0.7707, 0.6706, -0.2642, 0.2815, -0.1621, 0.1759, 0.1713, 0.2891, -0.3491,
|
|
72
|
+
];
|
|
73
|
+
|
|
74
|
+
/** The decision replaces the shell with a page when p >= 0.30. */
|
|
75
|
+
const LIFT_AT = 0.3;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* The page template that replaces an app-shell start, or null to keep the
|
|
79
|
+
* shell. The blend's best template takes the start when the decision's
|
|
80
|
+
* whole-page probability is at least 0.30.
|
|
81
|
+
* @param {import('./rank.mjs').RankedPage[]} ranked
|
|
82
|
+
* @param {import('./rank.mjs').IdeaKind} kind
|
|
83
|
+
* @param {PageTemplate[]} catalog
|
|
84
|
+
* @param {string} idea
|
|
85
|
+
* @returns {PageTemplate | null}
|
|
86
|
+
*/
|
|
87
|
+
function liftFromShell(ranked, kind, catalog, idea) {
|
|
88
|
+
const b = blendSummary(
|
|
89
|
+
idea,
|
|
90
|
+
ranked,
|
|
91
|
+
pickStart(ranked, 'page'),
|
|
92
|
+
catalog,
|
|
93
|
+
loadWeights(),
|
|
94
|
+
);
|
|
95
|
+
if (!b || !b.best) return null;
|
|
96
|
+
// A change to a page or app the builder already has keeps its shell.
|
|
97
|
+
if (hasEditPhrase(idea)) return null;
|
|
98
|
+
const text = shellCallScore(idea, kind, ranked);
|
|
99
|
+
const x = [
|
|
100
|
+
1,
|
|
101
|
+
kind === 'page' ? 1 : 0,
|
|
102
|
+
kind === 'edit' ? 1 : 0,
|
|
103
|
+
b.bestScore - b.shell,
|
|
104
|
+
b.shell,
|
|
105
|
+
b.bestScore - b.secondScore,
|
|
106
|
+
(String(idea).match(/,/g) ?? []).length,
|
|
107
|
+
text?.score ?? 0,
|
|
108
|
+
text?.edit ? 1 : 0,
|
|
109
|
+
];
|
|
110
|
+
const logit = x.reduce((s, v, i) => s + v * LIFT[i], 0);
|
|
111
|
+
if (1 / (1 + Math.exp(-logit)) < LIFT_AT) return null;
|
|
112
|
+
return catalog.find(t => t.name === b.best) ?? null;
|
|
113
|
+
}
|
|
114
|
+
|
|
60
115
|
/**
|
|
61
116
|
* The template to start from: the ready page the ranker puts first when it
|
|
62
117
|
* has the evidence to lead, else the first fallback shell the project can
|
|
@@ -113,10 +168,18 @@ export function chooseStart(ranked, kind, pages, directMatch, catalog, idea) {
|
|
|
113
168
|
? proposed
|
|
114
169
|
: null
|
|
115
170
|
: (ranked.find(r => r.name === weighed) ?? proposed);
|
|
116
|
-
|
|
117
|
-
|
|
171
|
+
// An idea that would start on the app shell starts from the blend's best page
|
|
172
|
+
// when the decision's whole-page probability is at least 0.30. A direct match,
|
|
173
|
+
// ready or not, keeps the start and reason it already has.
|
|
174
|
+
const lifted =
|
|
175
|
+
!direct && (!pick || pick.family === 'Shell')
|
|
176
|
+
? liftFromShell(ranked, kind, catalog, idea)
|
|
177
|
+
: null;
|
|
178
|
+
const closest = lifted ?? (pick && catalog.find(t => t.name === pick.name));
|
|
179
|
+
if (closest) {
|
|
118
180
|
const agrees = closest.name === direct;
|
|
119
|
-
const place =
|
|
181
|
+
const place =
|
|
182
|
+
lifted || !pick ? null : placement(kind, pick.base && pick.familyNamed);
|
|
120
183
|
return {
|
|
121
184
|
...asTemplate(closest),
|
|
122
185
|
basis: agrees ? 'direct' : 'closest',
|
|
@@ -40,6 +40,21 @@ export function weighStart(idea: string, ranked: import("./rank.mjs").RankedPage
|
|
|
40
40
|
weights?: WeightsFile | null;
|
|
41
41
|
newPage?: boolean;
|
|
42
42
|
}): string | null | undefined;
|
|
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.
|
|
46
|
+
* @param {string} idea
|
|
47
|
+
* @param {import('./rank.mjs').RankedPage[]} ranked
|
|
48
|
+
* @param {import('./rank.mjs').RankedPage | null} pick
|
|
49
|
+
* @param {DescribedTemplate[]} catalog
|
|
50
|
+
* @param {WeightsFile | null} weights
|
|
51
|
+
*/
|
|
52
|
+
export function blendSummary(idea: string, ranked: import("./rank.mjs").RankedPage[], pick: import("./rank.mjs").RankedPage | null, catalog: DescribedTemplate[], weights: WeightsFile | null): {
|
|
53
|
+
shell: number;
|
|
54
|
+
best: string;
|
|
55
|
+
bestScore: number;
|
|
56
|
+
secondScore: number;
|
|
57
|
+
} | null;
|
|
43
58
|
/** The app shell, as one candidate. */
|
|
44
59
|
export const SHELL: "SHELL";
|
|
45
60
|
export type WeightTable = {
|
|
@@ -418,3 +418,30 @@ export function weighStart(
|
|
|
418
418
|
if (newPage && kept) return kept;
|
|
419
419
|
return null;
|
|
420
420
|
}
|
|
421
|
+
|
|
422
|
+
/**
|
|
423
|
+
* The blend's scores: the app shell's, and the best non-shell template with
|
|
424
|
+
* its score and the runner-up's. Null without weights.
|
|
425
|
+
* @param {string} idea
|
|
426
|
+
* @param {import('./rank.mjs').RankedPage[]} ranked
|
|
427
|
+
* @param {import('./rank.mjs').RankedPage | null} pick
|
|
428
|
+
* @param {DescribedTemplate[]} catalog
|
|
429
|
+
* @param {WeightsFile | null} weights
|
|
430
|
+
*/
|
|
431
|
+
export function blendSummary(idea, ranked, pick, catalog, weights) {
|
|
432
|
+
if (!weights) return null;
|
|
433
|
+
const {cands, scores} = blend(idea, ranked, pick, catalog, weights);
|
|
434
|
+
let shell = 0;
|
|
435
|
+
const rest = [];
|
|
436
|
+
for (let i = 0; i < cands.length; i++) {
|
|
437
|
+
if (cands[i] === SHELL) shell = scores[i];
|
|
438
|
+
else rest.push({name: cands[i], score: scores[i], i});
|
|
439
|
+
}
|
|
440
|
+
rest.sort((x, y) => y.score - x.score || x.i - y.i);
|
|
441
|
+
return {
|
|
442
|
+
shell,
|
|
443
|
+
best: rest[0]?.name ?? null,
|
|
444
|
+
bestScore: rest[0]?.score ?? 0,
|
|
445
|
+
secondScore: rest[1]?.score ?? 0,
|
|
446
|
+
};
|
|
447
|
+
}
|
|
@@ -277,7 +277,7 @@ useMenuDrillIn useMenuDrillIn DropdownMenu/DropdownMenu.doc.mjs DropdownMenu/use
|
|
|
277
277
|
useMenuHover useMenuHover hooks/useAnimatedLayout.doc.mjs hooks/useMenuHover.ts
|
|
278
278
|
useMenuOverflow useMenuOverflow DropdownMenu/DropdownMenu.doc.mjs DropdownMenu/useMenuOverflow.ts
|
|
279
279
|
useMobileKeyboard ERR_UNKNOWN_COMPONENT - keyboard/useMobileKeyboard.ts
|
|
280
|
-
useOutlineFromDOM useOutlineFromDOM Outline/
|
|
280
|
+
useOutlineFromDOM useOutlineFromDOM Outline/useOutlineFromDOM.doc.mjs Outline/useOutlineFromDOM.ts
|
|
281
281
|
useOverlay useOverlay Overlay/useOverlay.doc.mjs Overlay/useOverlay.tsx
|
|
282
282
|
useOwnScrollGesture useOwnScrollGesture DateInput/DateInput.doc.mjs DateInput/useOwnScrollGesture.ts
|
|
283
283
|
usePager usePager hooks/useAnimatedLayout.doc.mjs hooks/usePager.ts
|
|
@@ -206,7 +206,7 @@ export function extractProps(docs: LoadedComponentDoc): any[];
|
|
|
206
206
|
* Augment a loaded `component.detail` doc with ownership metadata. Adds
|
|
207
207
|
* `package`, the resolved `import` specifier, and `sourceAvailable` (whether a
|
|
208
208
|
* swizzleable source file exists for the owner). Existing doc fields (name,
|
|
209
|
-
* usage, props, …) are preserved
|
|
209
|
+
* usage, props, …) are preserved; each example carries its `kind`.
|
|
210
210
|
* @param {LoadedComponentDoc} docs
|
|
211
211
|
* @param {OwnershipSubject} owner
|
|
212
212
|
* @param {string} componentName
|
|
@@ -589,11 +589,26 @@ export function extractProps(docs) {
|
|
|
589
589
|
);
|
|
590
590
|
}
|
|
591
591
|
|
|
592
|
+
/**
|
|
593
|
+
* Give every example its `kind`, so a JSON reader never has to know the
|
|
594
|
+
* default: an example with no `kind` is a `demo`.
|
|
595
|
+
* @param {unknown} examples
|
|
596
|
+
* @returns {unknown}
|
|
597
|
+
*/
|
|
598
|
+
function withExampleKinds(examples) {
|
|
599
|
+
if (!Array.isArray(examples)) return examples;
|
|
600
|
+
return examples.map(example =>
|
|
601
|
+
example && typeof example === 'object'
|
|
602
|
+
? {...example, kind: example.kind ?? 'demo'}
|
|
603
|
+
: example,
|
|
604
|
+
);
|
|
605
|
+
}
|
|
606
|
+
|
|
592
607
|
/**
|
|
593
608
|
* Augment a loaded `component.detail` doc with ownership metadata. Adds
|
|
594
609
|
* `package`, the resolved `import` specifier, and `sourceAvailable` (whether a
|
|
595
610
|
* swizzleable source file exists for the owner). Existing doc fields (name,
|
|
596
|
-
* usage, props, …) are preserved
|
|
611
|
+
* usage, props, …) are preserved; each example carries its `kind`.
|
|
597
612
|
* @param {LoadedComponentDoc} docs
|
|
598
613
|
* @param {OwnershipSubject} owner
|
|
599
614
|
* @param {string} componentName
|
|
@@ -605,8 +620,20 @@ export function withOwnership(docs, owner, componentName, coreDir) {
|
|
|
605
620
|
owner.package === CORE_PACKAGE
|
|
606
621
|
? (docs.import ?? resolveImportPath(coreDir, componentName))
|
|
607
622
|
: resolveIntegrationImportPath(owner, componentName, docs.import);
|
|
623
|
+
/** @type {any} */
|
|
624
|
+
const doc = docs;
|
|
608
625
|
return /** @type {any} */ ({
|
|
609
626
|
...docs,
|
|
627
|
+
...(doc.examples ? {examples: withExampleKinds(doc.examples)} : {}),
|
|
628
|
+
...(Array.isArray(doc.components)
|
|
629
|
+
? {
|
|
630
|
+
components: doc.components.map((/** @type {any} */ entry) =>
|
|
631
|
+
entry?.examples
|
|
632
|
+
? {...entry, examples: withExampleKinds(entry.examples)}
|
|
633
|
+
: entry,
|
|
634
|
+
),
|
|
635
|
+
}
|
|
636
|
+
: {}),
|
|
610
637
|
package: owner.package,
|
|
611
638
|
import: importSpec,
|
|
612
639
|
sourceAvailable: owner.sourcePath != null,
|