@astryxdesign/cli 0.7.3-canary.425e78f → 0.7.3-canary.51ad2f4
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 +1 -1
- package/api/build/_adapter.mjs +37 -25
- package/api/build/blocks/blocks.d.mts +68 -20
- package/api/build/blocks/blocks.mjs +472 -196
- package/api/build/blocks/blocks.test.mjs +185 -168
- package/api/build/blocks/blocks.weights.json +1 -1
- package/api/build/build.type.mjs +1 -1
- package/api/build/kit/answer.d.mts +4 -1
- package/api/build/kit/answer.mjs +11 -3
- package/api/build/kit/signals.d.mts +11 -0
- package/api/build/kit/signals.mjs +8 -7
- package/api/build/kit/weights.d.mts +8 -22
- package/api/build/kit/weights.mjs +87 -8
- package/api/build/kit/weights.test.mjs +96 -0
- package/api/build/tree.mjs +2 -1
- package/api/build/tree.test.mjs +27 -27
- package/api/component/_adapter.mjs +39 -5
- package/api/discover/_adapter.d.mts +1 -2
- package/api/discover/_adapter.mjs +6 -8
- package/api/discover/discover.mjs +0 -1
- package/api/docs/_adapter.mjs +4 -0
- package/api/doctor/_adapter.d.mts +33 -13
- package/api/doctor/_adapter.mjs +55 -25
- package/api/doctor/doctor.d.mts +23 -5
- package/api/doctor/doctor.mjs +81 -16
- package/api/doctor/doctor.test.mjs +58 -0
- package/api/integration/validate-integration-gaps.test.mjs +3 -0
- package/api/integration/validateIntegration.doc.mjs +1 -1
- package/api/search/_entries.d.mts +11 -0
- package/api/search/_entries.mjs +35 -17
- package/api/search/_entries.test.mjs +48 -0
- package/api/search/_gather-templates.d.mts +0 -1
- package/api/search/_gather-templates.mjs +25 -0
- package/api/search/search.integration-block.test.mjs +100 -0
- package/api/template/template.mjs +5 -1
- package/api/theme/palette/generate/generate.d.mts +8 -0
- package/api/theme/palette/generate/generate.mjs +38 -11
- package/api/theme/palette/generate/generate.test.mjs +83 -4
- package/api/theme/palette/generate/generator.d.mts +6 -0
- package/api/theme/palette/generate/generator.mjs +6 -0
- package/api/theme/theme.type.d.mts +12 -1
- package/api/theme/theme.type.mjs +7 -1
- package/api/theme/themePaletteGenerate.doc.mjs +1 -1
- package/assets/docs/tree/checks.doc.mjs +1 -1
- package/assets/docs/tree/ci-and-containers.doc.mjs +13 -0
- package/clients/cli/commands/doctor.doc.mjs +1 -1
- package/clients/cli/commands/outside-project.test.mjs +99 -0
- package/clients/cli/commands/setup-nudge.test.mjs +17 -0
- package/clients/cli/index.mjs +25 -8
- package/foundation/agent-docs/agent-doc-state.d.mts +12 -0
- package/foundation/agent-docs/agent-doc-state.mjs +24 -2
- package/foundation/agent-docs/agent-docs.mjs +5 -5
- package/foundation/agent-docs/computer-agent-text.d.mts +39 -2
- package/foundation/agent-docs/computer-agent-text.mjs +135 -8
- package/foundation/agent-docs/computer-agent-text.test.mjs +99 -2
- package/foundation/integrations/public-imports.d.mts +37 -0
- package/foundation/integrations/public-imports.mjs +839 -46
- package/foundation/integrations/public-imports.test.mjs +971 -46
- package/foundation/release/cache.test.mjs +24 -21
- package/foundation/release/global-state.d.mts +8 -4
- package/foundation/release/global-state.mjs +4 -2
- package/foundation/release/notices.d.mts +62 -8
- package/foundation/release/notices.mjs +136 -25
- package/foundation/release/notices.test.mjs +21 -0
- package/foundation/response/response-types.doc.mjs +1 -1
- package/foundation/response/response-types.doc.test.mjs +29 -0
- package/foundation/text/string-utils.d.mts +2 -1
- package/foundation/text/string-utils.mjs +16 -5
- package/foundation/text/suggest-order.d.mts +72 -0
- package/foundation/text/suggest-order.mjs +363 -0
- package/foundation/text/suggest-order.test.mjs +259 -0
- package/package.json +9 -9
package/README.md
CHANGED
|
@@ -517,7 +517,7 @@ Every response has a `type` discriminant. The full set is below (generated from
|
|
|
517
517
|
| `theme.eject` | A local source-fork receipt with the resolved slug, displayName, source theme maintained flag, source-selector package, outputDir, source entry, exportName, and every file written, including the descriptor. The written local descriptor always uses maintained: false. |
|
|
518
518
|
| `theme.template` | A write receipt for the annotated theme template: the path (relative to cwd), whether it was written, and the reason it was not. `exists` when a file was already there, which is a success. |
|
|
519
519
|
| `theme.targets` | The whole themeable surface: the echoed filter, componentCount, and targets, one per theming target — {key, className, component, props, states}, where props and states are its legal override keys. |
|
|
520
|
-
| `theme.palette.generate` | An author-reviewable OKLCH palette candidate,
|
|
520
|
+
| `theme.palette.generate` | An author-reviewable OKLCH palette response: recipe (`astryx-oklch-v1`), status (`candidate`), familyCount, stopCount, modes, candidate (`TonalPaletteCandidate`), and generationReceipt. The generationReceipt contains schemaVersion (1), recipe, generatorVersion (`palette-generator-v1`), candidateFormatVersion (`palette-typescript-v1` or `palette-json-v1`), candidateSha256, optional preview, resolved request, and diagnostics. File-write fields are output, receipt, preview, written, and reason (`exists` or null). |
|
|
521
521
|
| `upgrade.list` | Every available codemod, oldest→newest, as {name, package, title, version, optional}; returned for --list without running anything. |
|
|
522
522
|
| `upgrade.registry` | The copied-composition receipt for --registry: applied, ok, the counts (found, current, wouldUpdate, updated, wouldMerge, merged, wouldRefreshReceipt, receiptsRefreshed, conflicts, missing, invalid, failed), and items. |
|
|
523
523
|
| `upgrade.status` | A short-circuit outcome with no codemods run (up_to_date, no_codemods, or config_fixable), each carrying the agent-docs summary. no_codemods and config_fixable carry cliBehindCore ({cliVersion, command}) when the installed Core is newer than the CLI, which then has no codemods for the releases after its own version. |
|
package/api/build/_adapter.mjs
CHANGED
|
@@ -235,39 +235,51 @@ export function isWeightsFile(file) {
|
|
|
235
235
|
);
|
|
236
236
|
}
|
|
237
237
|
|
|
238
|
+
/** The ranking coefficients the picker reads. */
|
|
239
|
+
const PICKER_THETA = [
|
|
240
|
+
'g',
|
|
241
|
+
'grank',
|
|
242
|
+
'gmargin',
|
|
243
|
+
'seen',
|
|
244
|
+
'lex',
|
|
245
|
+
'sscore',
|
|
246
|
+
'scov',
|
|
247
|
+
'srank',
|
|
248
|
+
'inkit',
|
|
249
|
+
'kitpos',
|
|
250
|
+
'mention',
|
|
251
|
+
'show',
|
|
252
|
+
];
|
|
253
|
+
|
|
238
254
|
/**
|
|
239
255
|
* Whether a parsed block picker file has the shape the picker reads: a
|
|
240
|
-
* vocabulary
|
|
241
|
-
*
|
|
256
|
+
* vocabulary with an idf per entry, two signed byte matrices of vocabulary x
|
|
257
|
+
* dims (base64) with their scales, the lexical weight, the known blocks, and
|
|
258
|
+
* the ranking coefficients.
|
|
242
259
|
* @param {any} w
|
|
243
260
|
* @returns {w is import('./blocks/blocks.mjs').BlockPickerWeights}
|
|
244
261
|
*/
|
|
245
262
|
function isBlockPickerWeights(w) {
|
|
246
|
-
const n = Array.isArray(w?.
|
|
263
|
+
const n = Array.isArray(w?.vocab) ? w.vocab.length : 0;
|
|
264
|
+
const size = (/** @type {unknown} */ s) =>
|
|
265
|
+
typeof s === 'string' ? Buffer.from(s, 'base64').length : -1;
|
|
247
266
|
return (
|
|
248
267
|
n > 0 &&
|
|
249
|
-
w.
|
|
250
|
-
Array.isArray(w.
|
|
251
|
-
w.
|
|
252
|
-
w.
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
Number.isFinite(x) &&
|
|
265
|
-
(i % 2 === 1 || (Number.isInteger(x) && x >= 0 && x < n)),
|
|
266
|
-
),
|
|
267
|
-
) &&
|
|
268
|
-
Array.isArray(w.theta) &&
|
|
269
|
-
w.theta.length === 5 &&
|
|
270
|
-
w.theta.every((/** @type {unknown} */ x) => Number.isFinite(x))
|
|
268
|
+
w.vocab.every((/** @type {unknown} */ t) => typeof t === 'string') &&
|
|
269
|
+
Array.isArray(w.idf) &&
|
|
270
|
+
w.idf.length === n &&
|
|
271
|
+
w.idf.every((/** @type {unknown} */ x) => Number.isFinite(x)) &&
|
|
272
|
+
Number.isInteger(w.dims) &&
|
|
273
|
+
w.dims > 0 &&
|
|
274
|
+
size(w.request) === n * w.dims &&
|
|
275
|
+
size(w.doc) === n * w.dims &&
|
|
276
|
+
Number.isFinite(w.requestScale) &&
|
|
277
|
+
Number.isFinite(w.docScale) &&
|
|
278
|
+
Number.isFinite(w.lexical) &&
|
|
279
|
+
Array.isArray(w.known) &&
|
|
280
|
+
w.known.every((/** @type {unknown} */ b) => typeof b === 'string') &&
|
|
281
|
+
!!w.theta &&
|
|
282
|
+
PICKER_THETA.every(k => Number.isFinite(w.theta[k]))
|
|
271
283
|
);
|
|
272
284
|
}
|
|
273
285
|
|
|
@@ -2,43 +2,91 @@
|
|
|
2
2
|
// DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* A word with a plural or verb ending removed (words over four letters):
|
|
6
|
+
* "-ies" becomes "-y"; "-es" goes only after s, x, z, ch, or sh; otherwise a
|
|
7
|
+
* final "s" goes, but never after another "s"; then "-ing" or "-ed".
|
|
8
|
+
* @param {string} w
|
|
9
|
+
* @returns {string}
|
|
10
|
+
*/
|
|
11
|
+
export function stemOf(w: string): string;
|
|
12
|
+
/**
|
|
13
|
+
* An identifier's words, lowercase: "SideNavNestedItems" -> side, nav,
|
|
14
|
+
* nested, items.
|
|
15
|
+
* @param {string} text
|
|
16
|
+
* @returns {string[]}
|
|
17
|
+
*/
|
|
18
|
+
export function wordsOf(text: string): string[];
|
|
19
|
+
/**
|
|
20
|
+
* A text's stemmed content words, then its adjacent pairs as `a_b`.
|
|
21
|
+
* @param {string} text
|
|
22
|
+
* @returns {string[]}
|
|
23
|
+
*/
|
|
24
|
+
export function termsOf(text: string): string[];
|
|
25
|
+
/**
|
|
26
|
+
* The blocks build names for a request, ranked by the picker.
|
|
6
27
|
* @param {string} request
|
|
7
|
-
* @param {{kitBlocks: string[], searched: BlockScore[], foreign: string[],
|
|
8
|
-
* build's signals: the kit's blocks, search's block results [id, score,
|
|
9
|
-
* matched, total] in order, the blocks whose package is not Core's, and
|
|
10
|
-
* each searched block's display name and description
|
|
28
|
+
* @param {{kitBlocks: string[], searched: BlockScore[], foreign: string[], catalog: CatalogBlock[], components: CatalogComponent[]}} signals
|
|
11
29
|
* @param {BlockPickerWeights} weights
|
|
12
|
-
* @returns {string[]
|
|
13
|
-
* names
|
|
14
|
-
*
|
|
30
|
+
* @returns {{names: string[], entries: Map<string, SearchResultEntry>}} as
|
|
31
|
+
* many names as build's own list, best first; an entry for each listed
|
|
32
|
+
* block search did not return
|
|
15
33
|
*/
|
|
16
34
|
export function pickBlocks(request: string, signals: {
|
|
17
35
|
kitBlocks: string[];
|
|
18
36
|
searched: BlockScore[];
|
|
19
37
|
foreign: string[];
|
|
20
|
-
|
|
21
|
-
|
|
38
|
+
catalog: CatalogBlock[];
|
|
39
|
+
components: CatalogComponent[];
|
|
40
|
+
}, weights: BlockPickerWeights): {
|
|
41
|
+
names: string[];
|
|
42
|
+
entries: Map<string, SearchResultEntry>;
|
|
43
|
+
};
|
|
22
44
|
export type BlockPickerWeights = {
|
|
23
45
|
/**
|
|
24
|
-
*
|
|
46
|
+
* stemmed words and `a_b` word pairs
|
|
25
47
|
*/
|
|
26
|
-
vocab:
|
|
48
|
+
vocab: string[];
|
|
27
49
|
/**
|
|
28
|
-
*
|
|
50
|
+
* one per vocab entry, x1024
|
|
29
51
|
*/
|
|
30
|
-
|
|
52
|
+
idf: number[];
|
|
31
53
|
/**
|
|
32
|
-
*
|
|
54
|
+
* the width of the shared space
|
|
33
55
|
*/
|
|
34
|
-
|
|
56
|
+
dims: number;
|
|
35
57
|
/**
|
|
36
|
-
*
|
|
58
|
+
* base64 bytes, vocab.length x dims, row-major, each a signed weight offset by 128
|
|
37
59
|
*/
|
|
38
|
-
|
|
60
|
+
request: string;
|
|
61
|
+
requestScale: number;
|
|
39
62
|
/**
|
|
40
|
-
*
|
|
63
|
+
* base64 bytes, vocab.length x dims, row-major, each a signed weight offset by 128
|
|
41
64
|
*/
|
|
42
|
-
|
|
65
|
+
doc: string;
|
|
66
|
+
docScale: number;
|
|
67
|
+
/**
|
|
68
|
+
* the weight of the plain overlap
|
|
69
|
+
*/
|
|
70
|
+
lexical: number;
|
|
71
|
+
/**
|
|
72
|
+
* the blocks the matrices were fitted with
|
|
73
|
+
*/
|
|
74
|
+
known: string[];
|
|
75
|
+
/**
|
|
76
|
+
* the ranking coefficients
|
|
77
|
+
*/
|
|
78
|
+
theta: Record<string, number>;
|
|
43
79
|
};
|
|
44
80
|
export type BlockScore = import("../kit/signals.mjs").BlockScore;
|
|
81
|
+
export type CatalogBlock = {
|
|
82
|
+
name: string;
|
|
83
|
+
package?: string;
|
|
84
|
+
displayName?: string;
|
|
85
|
+
description?: string;
|
|
86
|
+
command?: string;
|
|
87
|
+
};
|
|
88
|
+
export type CatalogComponent = {
|
|
89
|
+
name: string;
|
|
90
|
+
keywords?: string[];
|
|
91
|
+
};
|
|
92
|
+
export type SearchResultEntry = import("../../search/search.type.mjs").SearchResultEntry;
|