@dialecte/cli 0.6.0 → 0.8.0
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 +35 -2003
- package/dist/cli.js +67190 -40066
- package/dist/corpus/manifest.json +692 -0
- package/dist/corpus/overrides/fhir-xhtml.xsd +17 -0
- package/dist/corpus/overrides/xlink.xsd +102 -0
- package/dist/corpus/overrides/xml.xsd +35 -0
- package/dist/dialecte_tdd_pytest.py +792 -0
- package/dist/lookups.d.ts +367 -13
- package/dist/lookups.js +2330 -26
- package/dist/schemas/config-list.schema.json +121 -0
- package/dist/schemas/config-yml.schema.json +52 -0
- package/dist/schemas/dialecterc.schema.json +33 -0
- package/dist/schemas/lot-risk.schema.json +32 -0
- package/dist/schemas/risk-line.schema.json +49 -0
- package/dist/schemas/rules.schema.json +51 -0
- package/dist/schemas/scope-change.schema.json +103 -0
- package/dist/tdd-node-reporter.js +167 -0
- package/dist/tdd-reporter.js +2 -0
- package/package.json +43 -5
package/dist/lookups.d.ts
CHANGED
|
@@ -49,6 +49,9 @@ type ApiJson = {
|
|
|
49
49
|
methods: ApiMethod[];
|
|
50
50
|
};
|
|
51
51
|
|
|
52
|
+
/** The exit codes a lookup answers with: 0 answer, 1 nothing found, 2 usage. */
|
|
53
|
+
declare const LOOKUP_EXIT_CODES: readonly [0, 1, 2];
|
|
54
|
+
|
|
52
55
|
declare const printedBrand: unique symbol;
|
|
53
56
|
/**
|
|
54
57
|
* A text the cli may print, every line escaped once (or JSON): only `textOf` and `jsonOf` return one, so a command that
|
|
@@ -59,13 +62,16 @@ type PrintedText = string & {
|
|
|
59
62
|
readonly [printedBrand]: true;
|
|
60
63
|
};
|
|
61
64
|
|
|
65
|
+
/** An exit code of a lookup: 0 answer, 1 nothing found, 2 usage (no lookup exits 3). */
|
|
66
|
+
type LookupExitCode = (typeof LOOKUP_EXIT_CODES)[number];
|
|
62
67
|
/**
|
|
63
|
-
* What a lookup
|
|
64
|
-
*
|
|
68
|
+
* What a lookup answers inside the cli (`runApi`, `runDoctor`, `runModels`, `answerSchema`, the schema and members
|
|
69
|
+
* reads, and the helpers they return): a `CommandOutput` whose exit code is a lookup's, so it stays assignable to
|
|
70
|
+
* the public `LookupOutput`.
|
|
65
71
|
*/
|
|
66
|
-
type
|
|
72
|
+
type LookupCommandOutput = {
|
|
67
73
|
output: PrintedText;
|
|
68
|
-
exitCode:
|
|
74
|
+
exitCode: LookupExitCode;
|
|
69
75
|
};
|
|
70
76
|
/**
|
|
71
77
|
* What a lookup answers, as `@dialecte/cli/lookups` exports it (`CommandOutput` there): the text the command would
|
|
@@ -75,7 +81,7 @@ type CommandOutput = {
|
|
|
75
81
|
*/
|
|
76
82
|
type LookupOutput = {
|
|
77
83
|
output: string;
|
|
78
|
-
exitCode:
|
|
84
|
+
exitCode: LookupExitCode;
|
|
79
85
|
};
|
|
80
86
|
|
|
81
87
|
/**
|
|
@@ -88,7 +94,7 @@ type LookupOutput = {
|
|
|
88
94
|
declare function runApi(params: {
|
|
89
95
|
argv: readonly string[];
|
|
90
96
|
cwd: string;
|
|
91
|
-
}):
|
|
97
|
+
}): LookupCommandOutput;
|
|
92
98
|
/**
|
|
93
99
|
* The packages an api lookup searched, as its not-found answer names them: their names joined by commas (a package
|
|
94
100
|
* searched by its index and its source named once), or the line that says no installed package ships an `api.json`.
|
|
@@ -110,7 +116,7 @@ declare function runDoctor(params: {
|
|
|
110
116
|
dialecteRoot: string | undefined;
|
|
111
117
|
/** The cli's version, or how to read it: `--brief` reads it inside its guard, so a failure never shows. */
|
|
112
118
|
cliVersion: string | (() => string);
|
|
113
|
-
}):
|
|
119
|
+
}): LookupCommandOutput;
|
|
114
120
|
|
|
115
121
|
/** One public method of the q / tx / doc / project surface, with what its JSDoc says about it. */
|
|
116
122
|
type MethodEntry = {
|
|
@@ -141,7 +147,7 @@ type MemberEntriesRead = {
|
|
|
141
147
|
expression: string;
|
|
142
148
|
} | {
|
|
143
149
|
kind: 'output';
|
|
144
|
-
output:
|
|
150
|
+
output: LookupCommandOutput;
|
|
145
151
|
};
|
|
146
152
|
|
|
147
153
|
/**
|
|
@@ -163,7 +169,7 @@ declare function readMemberEntries(params: {
|
|
|
163
169
|
declare function runModels(params: {
|
|
164
170
|
argv: readonly string[];
|
|
165
171
|
cwd: string;
|
|
166
|
-
}):
|
|
172
|
+
}): LookupCommandOutput & {
|
|
167
173
|
warnings: PrintedText;
|
|
168
174
|
};
|
|
169
175
|
|
|
@@ -253,7 +259,7 @@ type SchemaDialectesRead = {
|
|
|
253
259
|
installed: string[];
|
|
254
260
|
} | {
|
|
255
261
|
kind: 'output';
|
|
256
|
-
output:
|
|
262
|
+
output: LookupCommandOutput;
|
|
257
263
|
};
|
|
258
264
|
|
|
259
265
|
/**
|
|
@@ -275,7 +281,7 @@ declare function answerMembers(params: {
|
|
|
275
281
|
entries: readonly MethodEntry[];
|
|
276
282
|
expression: string;
|
|
277
283
|
json: boolean;
|
|
278
|
-
}):
|
|
284
|
+
}): LookupCommandOutput;
|
|
279
285
|
|
|
280
286
|
/**
|
|
281
287
|
* Every `api.json` an agent can search from `cwd`: the package's own skills (inside a dialecte repository)
|
|
@@ -287,6 +293,354 @@ declare function readApiIndexes(params: {
|
|
|
287
293
|
cwd: string;
|
|
288
294
|
}): ApiJson[];
|
|
289
295
|
|
|
296
|
+
/**
|
|
297
|
+
* What a step is and, optionally, what runs inside it (`hook: unit suite`). `hintWhenSilent`: a step
|
|
298
|
+
* running something that prints as it works (a hook): silent past the hint time, its spinner says what
|
|
299
|
+
* that often is (waiting for input, watch mode).
|
|
300
|
+
*/
|
|
301
|
+
type StepDescription = {
|
|
302
|
+
name: string;
|
|
303
|
+
detail?: string;
|
|
304
|
+
hintWhenSilent?: boolean;
|
|
305
|
+
};
|
|
306
|
+
/** A step announced and not finished yet. */
|
|
307
|
+
type RunningStep = {
|
|
308
|
+
/**
|
|
309
|
+
* The step ended: its lines (the last one its result) replace the spinner and what is shown under it,
|
|
310
|
+
* or follow the start line.
|
|
311
|
+
*/
|
|
312
|
+
finish(...lines: string[]): void;
|
|
313
|
+
/**
|
|
314
|
+
* On a terminal: the lines shown live under the spinner (a hook's step and warnings), or how to render
|
|
315
|
+
* them at each redraw (a step's elapsed time). Off a terminal: nothing.
|
|
316
|
+
*/
|
|
317
|
+
show(lines: LiveLines): void;
|
|
318
|
+
/**
|
|
319
|
+
* The step printed something, shown or not: its silence starts again for the silent hint (on both); the
|
|
320
|
+
* running lines off a terminal wait for a line written (`wrote`).
|
|
321
|
+
*/
|
|
322
|
+
touch(): void;
|
|
323
|
+
/**
|
|
324
|
+
* Off a terminal: a line of the step was written (a hook's step or warning), so its running lines start
|
|
325
|
+
* again; output heard but filtered out does not count. On a terminal: nothing.
|
|
326
|
+
*/
|
|
327
|
+
wrote(): void;
|
|
328
|
+
};
|
|
329
|
+
type StepProgress = {
|
|
330
|
+
/** Announces the step before any of its work begins. */
|
|
331
|
+
start(step: StepDescription): RunningStep;
|
|
332
|
+
};
|
|
333
|
+
/** Lines shown live under a spinner, or rendered at each redraw from the clock's time. */
|
|
334
|
+
type LiveLines = string[] | ((now: number) => string[]);
|
|
335
|
+
|
|
336
|
+
/** The kinds a line of a standard's markdown file is classified as, one original line at a time. */
|
|
337
|
+
type StandardLineKind = 'blank' | 'table' | 'code' | 'toc' | 'heading' | 'definition' | 'caption' | 'prose';
|
|
338
|
+
/** One logical line: original lines `from` to `to` (1-based), their kind, and the normalised text. */
|
|
339
|
+
type StandardLogicalLine = {
|
|
340
|
+
from: number;
|
|
341
|
+
to: number;
|
|
342
|
+
kind: StandardLineKind;
|
|
343
|
+
text: string;
|
|
344
|
+
};
|
|
345
|
+
/** A kept heading: `id` is `<file id>#<number>`, with `~<pass>` from the second pass of the file on. */
|
|
346
|
+
type StandardHeading = {
|
|
347
|
+
id: string;
|
|
348
|
+
number: string;
|
|
349
|
+
title: string;
|
|
350
|
+
from: number;
|
|
351
|
+
to: number;
|
|
352
|
+
depth: number;
|
|
353
|
+
parent: string | null;
|
|
354
|
+
pass: number;
|
|
355
|
+
};
|
|
356
|
+
type StandardDefinition = {
|
|
357
|
+
term: string;
|
|
358
|
+
number: string;
|
|
359
|
+
from: number;
|
|
360
|
+
to: number;
|
|
361
|
+
};
|
|
362
|
+
type StandardTable = {
|
|
363
|
+
id: string;
|
|
364
|
+
caption: string | null;
|
|
365
|
+
number: string | null;
|
|
366
|
+
from: number;
|
|
367
|
+
to: number;
|
|
368
|
+
clause: string | null;
|
|
369
|
+
columns: string[];
|
|
370
|
+
};
|
|
371
|
+
type StandardCrossReference = {
|
|
372
|
+
from: number;
|
|
373
|
+
inClause: string | null;
|
|
374
|
+
target: string;
|
|
375
|
+
resolved: boolean;
|
|
376
|
+
};
|
|
377
|
+
/** Information only: a line seen 20 or more times with a median gap of 20 or more lines. Never dropped. */
|
|
378
|
+
type StandardRepeatedLine = {
|
|
379
|
+
text: string;
|
|
380
|
+
count: number;
|
|
381
|
+
length: number;
|
|
382
|
+
medianGap: number;
|
|
383
|
+
};
|
|
384
|
+
type StandardBlockVerdict = 'good' | 'poor' | 'unreadable';
|
|
385
|
+
type StandardFileVerdict = 'good' | 'partial' | 'unreadable';
|
|
386
|
+
/** A block of up to 1,000 original lines: `dropped` lines over `lines` is its noise ratio. */
|
|
387
|
+
type StandardQualityBlock = {
|
|
388
|
+
from: number;
|
|
389
|
+
to: number;
|
|
390
|
+
lines: number;
|
|
391
|
+
dropped: number;
|
|
392
|
+
noiseRatio: number;
|
|
393
|
+
verdict: StandardBlockVerdict;
|
|
394
|
+
};
|
|
395
|
+
type StandardQuality = {
|
|
396
|
+
blocks: StandardQualityBlock[];
|
|
397
|
+
verdict: StandardFileVerdict;
|
|
398
|
+
readableLines: number;
|
|
399
|
+
droppedLines: number;
|
|
400
|
+
headingCandidatesKept: number;
|
|
401
|
+
headingCandidatesTurnedProse: number;
|
|
402
|
+
repeatedLines: StandardRepeatedLine[];
|
|
403
|
+
};
|
|
404
|
+
/** A range of original lines of a file, first and last included (1-based). */
|
|
405
|
+
type StandardOriginalRange = {
|
|
406
|
+
from: number;
|
|
407
|
+
to: number;
|
|
408
|
+
};
|
|
409
|
+
/**
|
|
410
|
+
* What indexing one file's text gives: the logical lines and what is read out of them. `noiseRanges`
|
|
411
|
+
* are the dropped one-character runs (the blank lines inside a run included), in file order.
|
|
412
|
+
*/
|
|
413
|
+
type StandardFileIndex = {
|
|
414
|
+
fileId: string;
|
|
415
|
+
lineCount: number;
|
|
416
|
+
logicalLines: StandardLogicalLine[];
|
|
417
|
+
noiseRanges: StandardOriginalRange[];
|
|
418
|
+
headings: StandardHeading[];
|
|
419
|
+
definitions: StandardDefinition[];
|
|
420
|
+
tables: StandardTable[];
|
|
421
|
+
crossReferences: StandardCrossReference[];
|
|
422
|
+
quality: StandardQuality;
|
|
423
|
+
};
|
|
424
|
+
|
|
425
|
+
/** A kept folder or file: its lowercased id and its name as on disk. */
|
|
426
|
+
type StandardNamed = {
|
|
427
|
+
id: string;
|
|
428
|
+
name: string;
|
|
429
|
+
};
|
|
430
|
+
/** A file of a standard: its id, its name as on disk and its path (a symlink kept as given). */
|
|
431
|
+
type StandardFile = StandardNamed & {
|
|
432
|
+
path: string;
|
|
433
|
+
};
|
|
434
|
+
/** A standard folder of the root: its id, its name, its path and its files in id order (none: skipped). */
|
|
435
|
+
type StandardFolder = StandardNamed & {
|
|
436
|
+
folder: string;
|
|
437
|
+
files: StandardFile[];
|
|
438
|
+
};
|
|
439
|
+
|
|
440
|
+
/**
|
|
441
|
+
* The tags, attributes and enumeration values of the selected dialectes' definitions: the names the tag
|
|
442
|
+
* links are made of.
|
|
443
|
+
*/
|
|
444
|
+
type StandardVocabulary = {
|
|
445
|
+
tags: string[];
|
|
446
|
+
attributes: string[];
|
|
447
|
+
values: string[];
|
|
448
|
+
};
|
|
449
|
+
/**
|
|
450
|
+
* What a unit of search is: a clause's own lines (to its first child heading) minus its tables and
|
|
451
|
+
* their captions, a table with its caption, or the lines before the first heading of a file.
|
|
452
|
+
*/
|
|
453
|
+
type StandardUnitKind = 'clause' | 'table' | 'front';
|
|
454
|
+
/**
|
|
455
|
+
* A unit find scores. Lines are numbered across the standard: the logical lines of its files one after
|
|
456
|
+
* the other, in the order of `files` (a "standard line"). `from`/`to` are original lines of its file;
|
|
457
|
+
* `firstLine`/`lastLine` the standard lines of its first and last logical line (a heading, a caption or
|
|
458
|
+
* a table's first row first); `titleLine` the standard line of its heading or caption, null when none.
|
|
459
|
+
* `clause` is the number of the heading holding it (null for front matter and a table outside every
|
|
460
|
+
* clause), `title` the heading title or the caption (null when none), `target` the cross-reference
|
|
461
|
+
* target naming it (a heading number, or the table prefix and the caption number; null when none).
|
|
462
|
+
*/
|
|
463
|
+
type StandardUnit = {
|
|
464
|
+
fileId: string;
|
|
465
|
+
kind: StandardUnitKind;
|
|
466
|
+
clause: string | null;
|
|
467
|
+
title: string | null;
|
|
468
|
+
target: string | null;
|
|
469
|
+
from: number;
|
|
470
|
+
to: number;
|
|
471
|
+
firstLine: number;
|
|
472
|
+
lastLine: number;
|
|
473
|
+
titleLine: number | null;
|
|
474
|
+
};
|
|
475
|
+
/** The units of a standard and, per standard line, the index of the unit it belongs to. */
|
|
476
|
+
type StandardUnits = {
|
|
477
|
+
units: StandardUnit[];
|
|
478
|
+
lineUnits: number[];
|
|
479
|
+
};
|
|
480
|
+
/**
|
|
481
|
+
* The word index of one standard: per stem, the standard lines holding it in increasing order (their
|
|
482
|
+
* count is the stem's document frequency), and the count of logical lines of the whole standard.
|
|
483
|
+
*/
|
|
484
|
+
type StandardWordIndex = {
|
|
485
|
+
logicalLineCount: number;
|
|
486
|
+
stems: Record<string, number[]>;
|
|
487
|
+
};
|
|
488
|
+
/**
|
|
489
|
+
* A vocabulary name linked to a unit (its index in `units`): the strength of its strongest hit (3, 2
|
|
490
|
+
* or 1) and the standard lines of the unit where it is named.
|
|
491
|
+
*/
|
|
492
|
+
type StandardTagLink = {
|
|
493
|
+
unit: number;
|
|
494
|
+
strength: number;
|
|
495
|
+
lines: number[];
|
|
496
|
+
};
|
|
497
|
+
/** Vocabulary name (case kept) to the units it links. Empty when the vocabulary is empty. */
|
|
498
|
+
type StandardTagLinks = Record<string, StandardTagLink[]>;
|
|
499
|
+
/**
|
|
500
|
+
* The search structures of one standard: its files, the word index (independent of the vocabulary),
|
|
501
|
+
* the units and the tag links of the vocabulary. Plain data, so it can be written as JSON and read back.
|
|
502
|
+
*/
|
|
503
|
+
type StandardSearchIndex = StandardUnits & {
|
|
504
|
+
files: StandardFileIndex[];
|
|
505
|
+
vocabulary: StandardVocabulary;
|
|
506
|
+
words: StandardWordIndex;
|
|
507
|
+
tagLinks: StandardTagLinks;
|
|
508
|
+
};
|
|
509
|
+
/** One answer of find: a range of whole logical lines of one unit, its score, the terms that hit. */
|
|
510
|
+
type StandardSlice = {
|
|
511
|
+
file: string;
|
|
512
|
+
from: number;
|
|
513
|
+
to: number;
|
|
514
|
+
clause: string | null;
|
|
515
|
+
title: string | null;
|
|
516
|
+
score: number;
|
|
517
|
+
terms: string[];
|
|
518
|
+
linked: boolean;
|
|
519
|
+
};
|
|
520
|
+
type FindInStandardParams = {
|
|
521
|
+
indexes: StandardSearchIndex[];
|
|
522
|
+
query: string;
|
|
523
|
+
about?: string;
|
|
524
|
+
limit?: number;
|
|
525
|
+
};
|
|
526
|
+
|
|
527
|
+
/**
|
|
528
|
+
* The vocabulary of the selected installed dialectes, their sorted `name@version` list, and the hash of that
|
|
529
|
+
* list naming its tags file (none when no dialecte is selected).
|
|
530
|
+
*/
|
|
531
|
+
type StandardInstalledVocabulary = {
|
|
532
|
+
vocabulary: StandardVocabulary;
|
|
533
|
+
packages: string[];
|
|
534
|
+
installedHash: string | undefined;
|
|
535
|
+
};
|
|
536
|
+
/** Whether an index was built by this run or found complete in the cache. */
|
|
537
|
+
type StandardIndexState = 'built' | 'reused';
|
|
538
|
+
/** An index ready to answer: its standard, its manifest hash, how it came, its files and search index. */
|
|
539
|
+
type StandardReadyIndex = {
|
|
540
|
+
standardId: string;
|
|
541
|
+
manifestHash: string;
|
|
542
|
+
state: StandardIndexState;
|
|
543
|
+
elapsed: number;
|
|
544
|
+
search: StandardSearchIndex;
|
|
545
|
+
};
|
|
546
|
+
|
|
547
|
+
/**
|
|
548
|
+
* The documents the ask may read: the selected standards' indexes and each folder's files key; or none (with the
|
|
549
|
+
* standard's declared name and its key, null when the dialecte declares none).
|
|
550
|
+
*/
|
|
551
|
+
type AskStandard = {
|
|
552
|
+
kind: 'documents';
|
|
553
|
+
indexes: StandardSearchIndex[];
|
|
554
|
+
folders: {
|
|
555
|
+
id: string;
|
|
556
|
+
files: string;
|
|
557
|
+
}[];
|
|
558
|
+
} | {
|
|
559
|
+
kind: 'none';
|
|
560
|
+
name: string | null;
|
|
561
|
+
key: string | null;
|
|
562
|
+
};
|
|
563
|
+
/** What `loadStandardIndexes` takes: where it runs, its environment, the folders and the vocabulary to read. */
|
|
564
|
+
type LoadStandardIndexesParams = {
|
|
565
|
+
cwd: string;
|
|
566
|
+
environment: NodeJS.ProcessEnv;
|
|
567
|
+
/** The ids of the root's folders to load; every folder of the root when left out. */
|
|
568
|
+
standardIds?: readonly string[];
|
|
569
|
+
/** The one installed dialecte whose vocabulary scores the slices (`--package`); every installed one when left out. */
|
|
570
|
+
packageName?: string;
|
|
571
|
+
rebuild?: boolean;
|
|
572
|
+
/** False: the installed dialectes are not read, the vocabulary is empty (a read that scores nothing). */
|
|
573
|
+
readVocabulary?: boolean;
|
|
574
|
+
/** A refusal of the vocabulary read, checked before any build (`--about` naming a tag no dialecte declares). */
|
|
575
|
+
checkVocabulary?: (params: {
|
|
576
|
+
installed: StandardInstalledVocabulary;
|
|
577
|
+
}) => string | undefined;
|
|
578
|
+
/** The running line, on a terminal only. */
|
|
579
|
+
progress?: StepProgress;
|
|
580
|
+
/** A test seam called right after the build reads each file's text. */
|
|
581
|
+
afterFileRead?: (params: {
|
|
582
|
+
path: string;
|
|
583
|
+
}) => void;
|
|
584
|
+
};
|
|
585
|
+
/** The documents of the ask, and what `standard` prints of them: the ready indexes, the folders without a file. */
|
|
586
|
+
type LoadedStandards = {
|
|
587
|
+
kind: 'loaded';
|
|
588
|
+
standard: Extract<AskStandard, {
|
|
589
|
+
kind: 'documents';
|
|
590
|
+
}>;
|
|
591
|
+
ready: StandardReadyIndex[];
|
|
592
|
+
skipped: StandardFolder[];
|
|
593
|
+
installed: StandardInstalledVocabulary;
|
|
594
|
+
/** Every file of the folders read, as its bytes are now: id, sha256 and original line count, in folder order. */
|
|
595
|
+
manifest: ManifestFile[];
|
|
596
|
+
/** Each file's original lines, from the same bytes as its sha256 (line n at index n - 1). */
|
|
597
|
+
originalLines: Map<string, string[]>;
|
|
598
|
+
};
|
|
599
|
+
/**
|
|
600
|
+
* The standards loaded; a refusal (exit 2, `layout` the expected layout of the root when the refusal is about it);
|
|
601
|
+
* a `packageName` no installed dialecte has (exit 2, the installed ones named); or an aborted build (exit 1).
|
|
602
|
+
*/
|
|
603
|
+
type LoadedStandardIndexes = LoadedStandards | {
|
|
604
|
+
kind: 'refused';
|
|
605
|
+
message: string;
|
|
606
|
+
layout?: string;
|
|
607
|
+
} | {
|
|
608
|
+
kind: 'unknownPackage';
|
|
609
|
+
name: string;
|
|
610
|
+
installed: string[];
|
|
611
|
+
} | {
|
|
612
|
+
kind: 'aborted';
|
|
613
|
+
message: string;
|
|
614
|
+
};
|
|
615
|
+
/** A file of the ask's manifest. */
|
|
616
|
+
type ManifestFile = {
|
|
617
|
+
id: string;
|
|
618
|
+
sha256: string;
|
|
619
|
+
lines: number;
|
|
620
|
+
};
|
|
621
|
+
|
|
622
|
+
/**
|
|
623
|
+
* The selected standards' search indexes (built in the cache when missing), each folder's files key and the
|
|
624
|
+
* installed vocabulary; or a refusal (exit 2: the root, a folder, an id the root does not hold, a cache inside a
|
|
625
|
+
* git work tree, a `packageName` not installed, the caller's vocabulary check), or an aborted build (exit 1). A
|
|
626
|
+
* folder holding no `.md` file is skipped. The one loading path of `standard` and `ask`. Writes a missing or
|
|
627
|
+
* outdated index to the index cache.
|
|
628
|
+
*
|
|
629
|
+
* @intent load the search indexes of standard folders, build the index of the standard text
|
|
630
|
+
*/
|
|
631
|
+
declare function loadStandardIndexes(params: LoadStandardIndexesParams): Promise<LoadedStandardIndexes>;
|
|
632
|
+
|
|
633
|
+
/**
|
|
634
|
+
* Finds the slices of the standards that answer a query: one ranking of the units of every standard by
|
|
635
|
+
* score (rounded), then file id, then first line; the first `limit` are the direct slices. Then, for
|
|
636
|
+
* each direct slice in rank order, each resolved cross-reference inside it gives the slice of its target
|
|
637
|
+
* unit (from its heading or caption, capped), once per unit, at most `limit` of them, after every direct
|
|
638
|
+
* one. Pure, over search indexes already built.
|
|
639
|
+
*
|
|
640
|
+
* @intent find the passages of a standard that answer a question, search the standard text
|
|
641
|
+
*/
|
|
642
|
+
declare function findInStandard(params: FindInStandardParams): StandardSlice[];
|
|
643
|
+
|
|
290
644
|
/**
|
|
291
645
|
* The `version` of the nearest package.json above `startFolder`; by default this file's folder (dist/ in the bundle,
|
|
292
646
|
* src/lib/ in the sources), so the cli's own version. Throws when no package.json is above it.
|
|
@@ -310,7 +664,7 @@ declare function answerSchema(params: {
|
|
|
310
664
|
/** A parent (`--under`): answers the declaration(s) the tag has there. */
|
|
311
665
|
under?: string | undefined;
|
|
312
666
|
json: boolean;
|
|
313
|
-
}):
|
|
667
|
+
}): LookupCommandOutput;
|
|
314
668
|
|
|
315
669
|
/**
|
|
316
670
|
* What an element may hold and where: the declaration that applies under `parent`, or the tag level (the union of
|
|
@@ -325,4 +679,4 @@ declare function describeElement(params: {
|
|
|
325
679
|
parent?: string | undefined;
|
|
326
680
|
}): ElementDescription | undefined;
|
|
327
681
|
|
|
328
|
-
export { type ApiExportedFunction, type ApiJson, type ApiMethod, type ApiMethodFields, type ApiRootMethod, type ApiSourceFunction, type AttributeDescription, type ChildDescription, type LookupOutput as CommandOutput, type ElementDescription, type LoadedDialecte, type MemberEntriesRead, type PrintedText, type SchemaDialectesRead, answerMembers, answerSchema, describeElement, packagesText, readApiIndexes, readCliVersion, readMemberEntries, readSchemaDialectes, runApi, runDoctor, runModels };
|
|
682
|
+
export { type ApiExportedFunction, type ApiJson, type ApiMethod, type ApiMethodFields, type ApiRootMethod, type ApiSourceFunction, type AskStandard, type AttributeDescription, type ChildDescription, type LookupOutput as CommandOutput, type ElementDescription, type FindInStandardParams, type LoadStandardIndexesParams, type LoadedDialecte, type LoadedStandardIndexes, type LoadedStandards, type MemberEntriesRead, type PrintedText, type SchemaDialectesRead, type StandardFolder, type StandardInstalledVocabulary, type StandardReadyIndex, type StandardSearchIndex, type StandardSlice, type StepProgress, answerMembers, answerSchema, describeElement, findInStandard, loadStandardIndexes, packagesText, readApiIndexes, readCliVersion, readMemberEntries, readSchemaDialectes, runApi, runDoctor, runModels };
|