@dxos/deus 0.0.0-stage → 0.0.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/LICENSE +105 -0
- package/README.md +24 -2
- package/bin/deus.ts +42 -0
- package/dist/lib/chunk-blocks.mjs +151 -0
- package/dist/lib/chunk-blocks.mjs.map +1 -0
- package/dist/lib/chunk-check.mjs +452 -0
- package/dist/lib/chunk-check.mjs.map +1 -0
- package/dist/lib/chunk-completion.mjs +112 -0
- package/dist/lib/chunk-completion.mjs.map +1 -0
- package/dist/lib/chunk-extension.mjs +396 -0
- package/dist/lib/chunk-extension.mjs.map +1 -0
- package/dist/lib/chunk-parse.mjs +21 -0
- package/dist/lib/chunk-parse.mjs.map +1 -0
- package/dist/lib/cli.mjs +946 -0
- package/dist/lib/cli.mjs.map +1 -0
- package/dist/lib/extension.mjs +4 -0
- package/dist/lib/index.mjs +6 -0
- package/dist/lib/parse.mjs +4 -0
- package/dist/lib/review.mjs +260 -0
- package/dist/lib/review.mjs.map +1 -0
- package/dist/lib/spec-index.mjs +28 -0
- package/dist/lib/spec-index.mjs.map +1 -0
- package/dist/types/bin/deus.d.ts +3 -0
- package/dist/types/bin/deus.d.ts.map +1 -0
- package/dist/types/src/cli/__fixtures__/review/plugin-deps/dx.config.d.ts +8 -0
- package/dist/types/src/cli/__fixtures__/review/plugin-deps/dx.config.d.ts.map +1 -0
- package/dist/types/src/cli/__fixtures__/review/plugin-deps-diverged/dx.config.d.ts +8 -0
- package/dist/types/src/cli/__fixtures__/review/plugin-deps-diverged/dx.config.d.ts.map +1 -0
- package/dist/types/src/cli/__fixtures__/review/plugin-deps-empty/dx.config.d.ts +7 -0
- package/dist/types/src/cli/__fixtures__/review/plugin-deps-empty/dx.config.d.ts.map +1 -0
- package/dist/types/src/cli/__fixtures__/review/plugin-deps-mismatch/dx.config.d.ts +8 -0
- package/dist/types/src/cli/__fixtures__/review/plugin-deps-mismatch/dx.config.d.ts.map +1 -0
- package/dist/types/src/cli/__fixtures__/review/plugin-deps-noplugin/dx.config.d.ts +5 -0
- package/dist/types/src/cli/__fixtures__/review/plugin-deps-noplugin/dx.config.d.ts.map +1 -0
- package/dist/types/src/cli/changelog.d.ts +25 -0
- package/dist/types/src/cli/changelog.d.ts.map +1 -0
- package/dist/types/src/cli/cli.test.d.ts +2 -0
- package/dist/types/src/cli/cli.test.d.ts.map +1 -0
- package/dist/types/src/cli/errors.d.ts +183 -0
- package/dist/types/src/cli/errors.d.ts.map +1 -0
- package/dist/types/src/cli/features.d.ts +58 -0
- package/dist/types/src/cli/features.d.ts.map +1 -0
- package/dist/types/src/cli/git.d.ts +8 -0
- package/dist/types/src/cli/git.d.ts.map +1 -0
- package/dist/types/src/cli/index.d.ts +12 -0
- package/dist/types/src/cli/index.d.ts.map +1 -0
- package/dist/types/src/cli/lint.d.ts +17 -0
- package/dist/types/src/cli/lint.d.ts.map +1 -0
- package/dist/types/src/cli/qa-lint.d.ts +40 -0
- package/dist/types/src/cli/qa-lint.d.ts.map +1 -0
- package/dist/types/src/cli/qa.d.ts +86 -0
- package/dist/types/src/cli/qa.d.ts.map +1 -0
- package/dist/types/src/cli/review.d.ts +38 -0
- package/dist/types/src/cli/review.d.ts.map +1 -0
- package/dist/types/src/cli/spec-index.d.ts +17 -0
- package/dist/types/src/cli/spec-index.d.ts.map +1 -0
- package/dist/types/src/extension/blocks.d.ts +65 -0
- package/dist/types/src/extension/blocks.d.ts.map +1 -0
- package/dist/types/src/extension/check.d.ts +99 -0
- package/dist/types/src/extension/check.d.ts.map +1 -0
- package/dist/types/src/extension/check.test.d.ts +2 -0
- package/dist/types/src/extension/check.test.d.ts.map +1 -0
- package/dist/types/src/extension/code.d.ts +7 -0
- package/dist/types/src/extension/code.d.ts.map +1 -0
- package/dist/types/src/extension/complete.d.ts +6 -0
- package/dist/types/src/extension/complete.d.ts.map +1 -0
- package/dist/types/src/extension/completion.d.ts +10 -0
- package/dist/types/src/extension/completion.d.ts.map +1 -0
- package/dist/types/src/extension/constants.d.ts +6 -0
- package/dist/types/src/extension/constants.d.ts.map +1 -0
- package/dist/types/src/extension/fences.d.ts +10 -0
- package/dist/types/src/extension/fences.d.ts.map +1 -0
- package/dist/types/src/extension/gen/mdl.d.ts +3 -0
- package/dist/types/src/extension/gen/mdl.d.ts.map +1 -0
- package/dist/types/src/extension/gen/mdl.terms.d.ts +2 -0
- package/dist/types/src/extension/gen/mdl.terms.d.ts.map +1 -0
- package/dist/types/src/extension/index.d.ts +8 -0
- package/dist/types/src/extension/index.d.ts.map +1 -0
- package/dist/types/src/extension/language.d.ts +20 -0
- package/dist/types/src/extension/language.d.ts.map +1 -0
- package/dist/types/src/extension/lint.d.ts +8 -0
- package/dist/types/src/extension/lint.d.ts.map +1 -0
- package/dist/types/src/extension/parse.d.ts +6 -0
- package/dist/types/src/extension/parse.d.ts.map +1 -0
- package/dist/types/src/extension/parser.test.d.ts +2 -0
- package/dist/types/src/extension/parser.test.d.ts.map +1 -0
- package/dist/types/src/extension/refs.d.ts +32 -0
- package/dist/types/src/extension/refs.d.ts.map +1 -0
- package/dist/types/src/extension/refs.test.d.ts +2 -0
- package/dist/types/src/extension/refs.test.d.ts.map +1 -0
- package/dist/types/src/extension/syntax.d.ts +12 -0
- package/dist/types/src/extension/syntax.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +3 -0
- package/dist/types/src/index.d.ts.map +1 -0
- package/dist/types/src/review/fields.d.ts +9 -0
- package/dist/types/src/review/fields.d.ts.map +1 -0
- package/dist/types/src/review/index.d.ts +5 -0
- package/dist/types/src/review/index.d.ts.map +1 -0
- package/dist/types/src/review/review.d.ts +70 -0
- package/dist/types/src/review/review.d.ts.map +1 -0
- package/dist/types/src/review/review.test.d.ts +2 -0
- package/dist/types/src/review/review.test.d.ts.map +1 -0
- package/dist/types/src/review/source-key.d.ts +35 -0
- package/dist/types/src/review/source-key.d.ts.map +1 -0
- package/dist/types/src/review/symbol.d.ts +17 -0
- package/dist/types/src/review/symbol.d.ts.map +1 -0
- package/dist/types/src/review/symbol.test.d.ts +2 -0
- package/dist/types/src/review/symbol.test.d.ts.map +1 -0
- package/dist/types/src/spec-index/index.d.ts +3 -0
- package/dist/types/src/spec-index/index.d.ts.map +1 -0
- package/dist/types/src/spec-index/parse.d.ts +11 -0
- package/dist/types/src/spec-index/parse.d.ts.map +1 -0
- package/dist/types/src/spec-index/spec-index.d.ts +21 -0
- package/dist/types/src/spec-index/spec-index.d.ts.map +1 -0
- package/dist/types/src/spec-index/spec-index.test.d.ts +2 -0
- package/dist/types/src/spec-index/spec-index.test.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -0
- package/docs/DESIGN.md +561 -0
- package/docs/IDIOMS.md +265 -0
- package/lang/PLUGIN-.template.mdl +115 -0
- package/lang/app.mdl +200 -0
- package/lang/changelog.mdl +184 -0
- package/lang/core.mdl +203 -0
- package/lang/examples/chess-1.mdl +149 -0
- package/lang/examples/chess-2.mdl +203 -0
- package/lang/examples/chess-3.mdl +231 -0
- package/lang/features.mdl +92 -0
- package/lang/plugin.mdl +59 -0
- package/lang/qa.mdl +383 -0
- package/lang/review.mdl +103 -0
- package/lang/sql.mdl +72 -0
- package/package.json +74 -3
- package/src/cli/__fixtures__/bad-decision.mdl +13 -0
- package/src/cli/__fixtures__/features/CYCLE.mdl +25 -0
- package/src/cli/__fixtures__/features/FEATURES.mdl +47 -0
- package/src/cli/__fixtures__/features/SPEC.mdl +22 -0
- package/src/cli/__fixtures__/features/SPEC.review.mdl +32 -0
- package/src/cli/__fixtures__/features/TASKS.md +5 -0
- package/src/cli/__fixtures__/lint-refs/SPEC.mdl +7 -0
- package/src/cli/__fixtures__/lint-refs/SPEC.review.mdl +7 -0
- package/src/cli/__fixtures__/qa-lint/packages/plugins/plugin-risky/PLUGIN.mdl +29 -0
- package/src/cli/__fixtures__/qa-list/plugin-sample/spec/PLUGIN.mdl +51 -0
- package/src/cli/__fixtures__/review/SPEC.mdl +23 -0
- package/src/cli/__fixtures__/review/SPEC.review.mdl +26 -0
- package/src/cli/__fixtures__/review/plugin-deps/PLUGIN.mdl +9 -0
- package/src/cli/__fixtures__/review/plugin-deps/PLUGIN.review.mdl +13 -0
- package/src/cli/__fixtures__/review/plugin-deps/dx.config.ts +10 -0
- package/src/cli/__fixtures__/review/plugin-deps-diverged/PLUGIN.mdl +9 -0
- package/src/cli/__fixtures__/review/plugin-deps-diverged/PLUGIN.review.mdl +14 -0
- package/src/cli/__fixtures__/review/plugin-deps-diverged/dx.config.ts +10 -0
- package/src/cli/__fixtures__/review/plugin-deps-empty/PLUGIN.mdl +9 -0
- package/src/cli/__fixtures__/review/plugin-deps-empty/PLUGIN.review.mdl +13 -0
- package/src/cli/__fixtures__/review/plugin-deps-empty/dx.config.ts +9 -0
- package/src/cli/__fixtures__/review/plugin-deps-mismatch/PLUGIN.mdl +9 -0
- package/src/cli/__fixtures__/review/plugin-deps-mismatch/PLUGIN.review.mdl +13 -0
- package/src/cli/__fixtures__/review/plugin-deps-mismatch/dx.config.ts +10 -0
- package/src/cli/__fixtures__/review/plugin-deps-noplugin/PLUGIN.mdl +9 -0
- package/src/cli/__fixtures__/review/plugin-deps-noplugin/PLUGIN.review.mdl +13 -0
- package/src/cli/__fixtures__/review/plugin-deps-noplugin/dx.config.ts +7 -0
- package/src/cli/changelog.ts +122 -0
- package/src/cli/cli.test.ts +359 -0
- package/src/cli/errors.ts +23 -0
- package/src/cli/features.ts +320 -0
- package/src/cli/git.ts +35 -0
- package/src/cli/index.ts +27 -0
- package/src/cli/lint.ts +75 -0
- package/src/cli/qa-lint.ts +206 -0
- package/src/cli/qa.ts +300 -0
- package/src/cli/review.ts +359 -0
- package/src/cli/spec-index.ts +54 -0
- package/src/extension/blocks.ts +169 -0
- package/src/extension/check.test.ts +629 -0
- package/src/extension/check.ts +552 -0
- package/src/extension/code.ts +99 -0
- package/src/extension/complete.ts +34 -0
- package/src/extension/completion.ts +64 -0
- package/src/extension/constants.ts +28 -0
- package/src/extension/fences.ts +270 -0
- package/src/extension/gen/mdl.terms.ts +16 -0
- package/src/extension/gen/mdl.ts +16 -0
- package/src/extension/index.ts +25 -0
- package/src/extension/language.ts +33 -0
- package/src/extension/lint.ts +19 -0
- package/src/extension/mdl.grammar +60 -0
- package/src/extension/parse.ts +31 -0
- package/src/extension/parser.test.ts +248 -0
- package/src/extension/refs.test.ts +95 -0
- package/src/extension/refs.ts +94 -0
- package/src/extension/syntax.ts +25 -0
- package/src/index.ts +6 -0
- package/src/review/fields.ts +31 -0
- package/src/review/index.ts +8 -0
- package/src/review/review.test.ts +111 -0
- package/src/review/review.ts +184 -0
- package/src/review/source-key.ts +63 -0
- package/src/review/symbol.test.ts +47 -0
- package/src/review/symbol.ts +96 -0
- package/src/spec-index/index.ts +6 -0
- package/src/spec-index/parse.ts +22 -0
- package/src/spec-index/spec-index.test.ts +56 -0
- package/src/spec-index/spec-index.ts +49 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Regex matching the opening fence of a Spec mdl block.
|
|
3
|
+
* All Spec blocks use ```mdl; the block type lives on the first body line.
|
|
4
|
+
*/
|
|
5
|
+
export declare const FENCE_REGEX: RegExp;
|
|
6
|
+
export type BlockHeader = {
|
|
7
|
+
type: string;
|
|
8
|
+
id: string;
|
|
9
|
+
from: number;
|
|
10
|
+
to: number;
|
|
11
|
+
body: string;
|
|
12
|
+
};
|
|
13
|
+
/** One line of a spec text, classified by its fence context. */
|
|
14
|
+
export type FenceLine = {
|
|
15
|
+
line: string;
|
|
16
|
+
/** Offset of the line in the text. */
|
|
17
|
+
offset: number;
|
|
18
|
+
/** `prose` is outside any fence; `open`/`close` are fence lines; `body` is inside a fence. */
|
|
19
|
+
kind: 'prose' | 'open' | 'body' | 'close';
|
|
20
|
+
/** For `open` and `body`: whether the enclosing fence is a top-level `mdl` block. */
|
|
21
|
+
mdl: boolean;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Classifies each line of the text by CommonMark fence rules: a fence closes only on a line of the
|
|
25
|
+
* opener's character, at least as long, with no info string, so an example fence encloses nested ones.
|
|
26
|
+
*/
|
|
27
|
+
export declare const scanFenceLines: (text: string, visit: (line: FenceLine) => void) => void;
|
|
28
|
+
/**
|
|
29
|
+
* Extracts block headers from the raw document text.
|
|
30
|
+
* Returns { type, id, from, to, body } for each top-level `mdl` fence,
|
|
31
|
+
* reading the block type from the first line of the block body.
|
|
32
|
+
* An unclosed block (mid-edit) runs to the end of the text.
|
|
33
|
+
*/
|
|
34
|
+
export declare const parseBlockHeaders: (text: string) => BlockHeader[];
|
|
35
|
+
/** One fenced `mdl` block: its type, identifier and title from the header line, and the body below it. */
|
|
36
|
+
export type MdlBlock = {
|
|
37
|
+
type: string;
|
|
38
|
+
/** Empty for a block with no identifier. */
|
|
39
|
+
id: string;
|
|
40
|
+
/** The prose after the header's colon, if any. */
|
|
41
|
+
title?: string;
|
|
42
|
+
/** The block's lines after the header. */
|
|
43
|
+
body: string;
|
|
44
|
+
/** Offset of the opening fence in the text. */
|
|
45
|
+
from: number;
|
|
46
|
+
};
|
|
47
|
+
/** Every fenced `mdl` block of a spec, in document order. */
|
|
48
|
+
export declare const parseMdlBlocks: (text: string) => MdlBlock[];
|
|
49
|
+
/** A block header line: `<type> [<id>][: <title>]`. */
|
|
50
|
+
export declare const BLOCK_HEADER_LINE: RegExp;
|
|
51
|
+
/** The terms a document's `## Extensions` table declares: the backticked first cell of each row. */
|
|
52
|
+
export declare const extensionTerms: (text: string) => string[];
|
|
53
|
+
/** A block header that follows another block inside the same fence. */
|
|
54
|
+
export type InnerBlockHeader = {
|
|
55
|
+
type: string;
|
|
56
|
+
id: string;
|
|
57
|
+
from: number;
|
|
58
|
+
to: number;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* Finds the block headers an `mdl` fence hides after its first block: lines past the fence's first body line, at
|
|
62
|
+
* column 0 (a block body is always indented), whose first word is one of `types`.
|
|
63
|
+
*/
|
|
64
|
+
export declare const findInnerBlockHeaders: (text: string, types: ReadonlySet<string>) => InnerBlockHeader[];
|
|
65
|
+
//# sourceMappingURL=blocks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blocks.d.ts","sourceRoot":"","sources":["../../../../src/extension/blocks.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,eAAO,MAAM,WAAW,QAAkB,CAAC;AAE3C,MAAM,MAAM,WAAW,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAE/F,gEAAgE;AAChE,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,sCAAsC;IACtC,MAAM,EAAE,MAAM,CAAC;IACf,8FAA8F;IAC9F,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;IAC1C,qFAAqF;IACrF,GAAG,EAAE,OAAO,CAAC;CACd,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,cAAc,SAAU,MAAM,SAAS,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,KAAG,IAqB/E,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,SAAU,MAAM,KAAG,WAAW,EAuC3D,CAAC;AAEF,0GAA0G;AAC1G,MAAM,MAAM,QAAQ,GAAG;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,4CAA4C;IAC5C,EAAE,EAAE,MAAM,CAAC;IACX,kDAAkD;IAClD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0CAA0C;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,+CAA+C;IAC/C,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,6DAA6D;AAC7D,eAAO,MAAM,cAAc,SAAU,MAAM,KAAG,QAAQ,EAMlD,CAAC;AAEL,uDAAuD;AACvD,eAAO,MAAM,iBAAiB,QAA4C,CAAC;AAE3E,oGAAoG;AACpG,eAAO,MAAM,cAAc,SAAU,MAAM,KAAG,MAAM,EAiBnD,CAAC;AAEF,uEAAuE;AACvE,MAAM,MAAM,gBAAgB,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC;AAEtF;;;GAGG;AACH,eAAO,MAAM,qBAAqB,SAAU,MAAM,SAAS,WAAW,CAAC,MAAM,CAAC,KAAG,gBAAgB,EAmBhG,CAAC"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { type Diagnostic } from '@codemirror/lint';
|
|
2
|
+
import { type SpecIndex } from '../spec-index/spec-index.ts';
|
|
3
|
+
export type LintOptions = {
|
|
4
|
+
/** Enables `mdl/ref` and `mdl/uses`, which need every other spec to resolve against. */
|
|
5
|
+
index?: SpecIndex;
|
|
6
|
+
/** The spec's own id; defaults to the frontmatter `id`. */
|
|
7
|
+
selfId?: string;
|
|
8
|
+
};
|
|
9
|
+
/** Lint message for an id the index does not hold. */
|
|
10
|
+
export declare const unknownSpecMessage: (id: string) => string;
|
|
11
|
+
/** Lint message for a reference to an item the spec does not declare. */
|
|
12
|
+
export declare const missingItemMessage: (id: string, item: string) => string;
|
|
13
|
+
/** Lint message for an id more than one file claims. */
|
|
14
|
+
export declare const duplicateSpecMessage: (id: string) => string;
|
|
15
|
+
/**
|
|
16
|
+
* Whether a `<id>#<item>` candidate is a spec reference rather than prose (a file name, an external schema id):
|
|
17
|
+
* its id is indexed, or shares its first two dotted segments with an indexed id.
|
|
18
|
+
*/
|
|
19
|
+
export declare const specReferenceFilter: (index: SpecIndex) => ((id: string) => boolean);
|
|
20
|
+
/**
|
|
21
|
+
* Lints the text of a Spec .mdl document.
|
|
22
|
+
*
|
|
23
|
+
* Checks:
|
|
24
|
+
* - Unknown block types (first body line of ```mdl blocks) → error
|
|
25
|
+
* - `decision` and `question` attribution (`by:` / `for:` actor prefixes) → error
|
|
26
|
+
* - `mdl/block`: a second block header inside one fence, which every tool reads as body → error
|
|
27
|
+
* - `mdl/ref` and `mdl/uses`: spec references and dependencies, when an index is given → error
|
|
28
|
+
*/
|
|
29
|
+
export declare const lintMdl: (text: string, { index, selfId }?: LintOptions) => Diagnostic[];
|
|
30
|
+
/** One `decision` block of a spec's `## Changelog`, with the fields of `lang/changelog.mdl` it carries. */
|
|
31
|
+
export type ChangelogEntry = {
|
|
32
|
+
id: string;
|
|
33
|
+
/** The whole block body, for comparing entries. */
|
|
34
|
+
text: string;
|
|
35
|
+
/** The decision itself: the inline prose after `decision D-n:`. */
|
|
36
|
+
title: string;
|
|
37
|
+
date?: string;
|
|
38
|
+
/** The decider, `user:<handle>` or `agent:<name>`. */
|
|
39
|
+
by?: string;
|
|
40
|
+
/** The person an agent acted for. */
|
|
41
|
+
for?: string;
|
|
42
|
+
quote?: string;
|
|
43
|
+
context?: string;
|
|
44
|
+
why?: string;
|
|
45
|
+
source?: string;
|
|
46
|
+
supersedes?: string;
|
|
47
|
+
/** The question this decision answers. */
|
|
48
|
+
answers?: string;
|
|
49
|
+
/** Block ids the decision constrains. */
|
|
50
|
+
affects: string[];
|
|
51
|
+
/** Other decisions the prose cites as `[D-n]`, in order of first mention. */
|
|
52
|
+
refs: string[];
|
|
53
|
+
rejected: string[];
|
|
54
|
+
};
|
|
55
|
+
/** One suggested answer of a `question`. */
|
|
56
|
+
export type QuestionOption = {
|
|
57
|
+
title: string;
|
|
58
|
+
description?: string;
|
|
59
|
+
};
|
|
60
|
+
/** One `question` block of a spec's `## Changelog`: a choice nobody has made yet (`lang/changelog.mdl` rule 10). */
|
|
61
|
+
export type ChangelogQuestion = {
|
|
62
|
+
id: string;
|
|
63
|
+
/** The whole block body, for comparing entries. */
|
|
64
|
+
text: string;
|
|
65
|
+
/** The question itself: the inline prose after `question Q-n:`. */
|
|
66
|
+
title: string;
|
|
67
|
+
date?: string;
|
|
68
|
+
/** The asker, `user:<handle>` or `agent:<name>`. */
|
|
69
|
+
by?: string;
|
|
70
|
+
/** The person an agent asked for. */
|
|
71
|
+
for?: string;
|
|
72
|
+
context?: string;
|
|
73
|
+
source?: string;
|
|
74
|
+
/** Block ids the answer will constrain. */
|
|
75
|
+
affects: string[];
|
|
76
|
+
options: QuestionOption[];
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* Splits a spec into its `## Changelog` decisions, its questions, and everything else.
|
|
80
|
+
* The section runs from its heading to the next level-1 or level-2 heading.
|
|
81
|
+
*/
|
|
82
|
+
export declare const parseChangelog: (text: string) => {
|
|
83
|
+
entries: ChangelogEntry[];
|
|
84
|
+
questions: ChangelogQuestion[];
|
|
85
|
+
rest: string;
|
|
86
|
+
};
|
|
87
|
+
/** Reported when a spec changed beyond a trivial edit with no new decision; the one error a waiver lifts. */
|
|
88
|
+
export declare const MISSING_DECISION = "The spec changed but no decision was added to `## Changelog`.";
|
|
89
|
+
/**
|
|
90
|
+
* True when `after` differs from `before` only by whitespace or a few small typo fixes, which do not change what
|
|
91
|
+
* the spec requires. Words with digits are ids or numbers, where one character is a different meaning.
|
|
92
|
+
*/
|
|
93
|
+
export declare const isTrivialEdit: (before: string, after: string) => boolean;
|
|
94
|
+
/**
|
|
95
|
+
* Checks one spec change against the changelog rules: every change except a trivial edit adds a decision, and the
|
|
96
|
+
* log is append-only with monotonic ids. `before` is undefined for a new spec.
|
|
97
|
+
*/
|
|
98
|
+
export declare const checkChangelogChange: (before: string | undefined, after: string) => string[];
|
|
99
|
+
//# sourceMappingURL=check.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../../../src/extension/check.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check.test.d.ts","sourceRoot":"","sources":["../../../../src/extension/check.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type Extension } from '@codemirror/state';
|
|
2
|
+
/**
|
|
3
|
+
* Colours the fenced code of other languages (`ts`, `sql`, …) in a spec, whose tokens the markdown
|
|
4
|
+
* highlight style leaves uncoloured.
|
|
5
|
+
*/
|
|
6
|
+
export declare const codeFenceHighlight: Extension;
|
|
7
|
+
//# sourceMappingURL=code.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code.d.ts","sourceRoot":"","sources":["../../../../src/extension/code.ts"],"names":[],"mappings":"AAKA,OAAO,EAAoB,KAAK,SAAS,EAAmB,MAAM,mBAAmB,CAAC;AAsEtF;;;GAGG;AACH,eAAO,MAAM,kBAAkB,EAAE,SAmBhC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"complete.d.ts","sourceRoot":"","sources":["../../../../src/extension/complete.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAyBnD;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,SAA+D,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const BLOCK_FIELDS: Record<string, string[]>;
|
|
2
|
+
/**
|
|
3
|
+
* The fields a cursor at `pos` may complete: inside an `mdl` fence, past its header line, before any `:` on the line.
|
|
4
|
+
* Undefined anywhere else, or in a block whose type has no known fields.
|
|
5
|
+
*/
|
|
6
|
+
export declare const fieldCompletionContext: (text: string, pos: number) => {
|
|
7
|
+
blockType: string;
|
|
8
|
+
fields: string[];
|
|
9
|
+
} | undefined;
|
|
10
|
+
//# sourceMappingURL=completion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"completion.d.ts","sourceRoot":"","sources":["../../../../src/extension/completion.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAYjD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,sBAAsB,SAC3B,MAAM,OACP,MAAM,KACV;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,GAAG,SAkC5C,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Known Spec block types from the core + standard dialect.
|
|
3
|
+
* In future this will be derived from the Extensions table in the document.
|
|
4
|
+
*/
|
|
5
|
+
export declare const BLOCK_TYPES: readonly ['ext', 'type', 'op', 'feat', 'feature', 'scenario', 'test', 'component', 'service', 'db', 'module', 'suite', 'decision', 'question', 'verdict', 'plugin', 'uses', 'table'];
|
|
6
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/extension/constants.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,eAAO,MAAM,WAAW,YACtB,KAAK,EACL,MAAM,EACN,IAAI,EACJ,MAAM,EACN,SAAS,EACT,UAAU,EACV,MAAM,EACN,WAAW,EACX,SAAS,EACT,IAAI,EACJ,QAAQ,EACR,OAAO,EACP,UAAU,EACV,UAAU,EACV,SAAS,EACT,QAAQ,EACR,MAAM,EACN,OAAO,CACC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type Extension } from '@codemirror/state';
|
|
2
|
+
/**
|
|
3
|
+
* Decorates Spec mdl fenced blocks:
|
|
4
|
+
* - Mutes the ``` ticks and `mdl` keyword (slate-500)
|
|
5
|
+
* - Colors the block type keyword on the first body line (per-type hue)
|
|
6
|
+
* - Colors field names in block body lines (blue-400)
|
|
7
|
+
* - Colors comments in block body lines (green-400, italic)
|
|
8
|
+
*/
|
|
9
|
+
export declare const mdlFenceHighlight: Extension;
|
|
10
|
+
//# sourceMappingURL=fences.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fences.d.ts","sourceRoot":"","sources":["../../../../src/extension/fences.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,SAAS,EAAmB,MAAM,mBAAmB,CAAC;AA6OpE;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,EAAE,SAoB/B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mdl.d.ts","sourceRoot":"","sources":["../../../../../src/extension/gen/mdl.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,QAAQ,EAAC,MAAM,WAAW,CAAA;AAClC,eAAO,MAAM,MAAM,UAajB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mdl.terms.d.ts","sourceRoot":"","sources":["../../../../../src/extension/gen/mdl.terms.ts"],"names":[],"mappings":"AACA,eAAO,MACL,KAAK,IAAI,EACT,QAAQ,IAAI,EACZ,SAAS,IAAI,EACb,QAAQ,IAAI,EACZ,QAAQ,IAAI,EACZ,QAAQ,IAAI,EACZ,QAAQ,IAAI,EACZ,QAAQ,KAAK,EACb,KAAK,KAAK,EACV,SAAS,KAAK,EACd,WAAW,KAAK,EAChB,MAAM,KAAK,EACX,IAAI,KAAK,EACT,OAAO,KAAK,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { mdl, mdlBlockDescription } from './language.ts';
|
|
2
|
+
export { type MdlBlock, parseMdlBlocks } from './blocks.ts';
|
|
3
|
+
export { type ChangelogEntry, type ChangelogQuestion, type LintOptions, MISSING_DECISION, type QuestionOption, checkChangelogChange, duplicateSpecMessage, isTrivialEdit, lintMdl, missingItemMessage, parseChangelog, specReferenceFilter, unknownSpecMessage, } from './check.ts';
|
|
4
|
+
export { mdlLint } from './lint.ts';
|
|
5
|
+
export { mdlComplete } from './complete.ts';
|
|
6
|
+
export { mdlTerms } from './syntax.ts';
|
|
7
|
+
export { type Dependency, type SpecRef, findSpecRefs, specDependencies } from './refs.ts';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/extension/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,GAAG,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,KAAK,QAAQ,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB,gBAAgB,EAChB,KAAK,cAAc,EACnB,oBAAoB,EACpB,oBAAoB,EACpB,aAAa,EACb,OAAO,EACP,kBAAkB,EAClB,cAAc,EACd,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { LanguageDescription } from '@codemirror/language';
|
|
2
|
+
import { type Extension } from '@codemirror/state';
|
|
3
|
+
import { type SpecIndex } from '../spec-index/spec-index.ts';
|
|
4
|
+
/**
|
|
5
|
+
* LanguageDescription for MDL fenced block bodies.
|
|
6
|
+
* All Spec blocks use ```mdl fences; the block type is the first body line.
|
|
7
|
+
* Pass this to createMarkdownExtensions({ codeLanguages: [mdlBlockDescription] }).
|
|
8
|
+
*/
|
|
9
|
+
export declare const mdlBlockDescription: LanguageDescription;
|
|
10
|
+
/**
|
|
11
|
+
* CodeMirror extensions for Spec .mdl block-body highlighting and fence decoration, and for the
|
|
12
|
+
* highlighting of fenced code in other languages.
|
|
13
|
+
* Given an `index`, it also lints spec references and dependencies against it.
|
|
14
|
+
* Does NOT include the Markdown language itself — pass mdlBlockDescription to
|
|
15
|
+
* createMarkdownExtensions() instead so it merges cleanly with the standard language set.
|
|
16
|
+
*/
|
|
17
|
+
export declare const mdl: ({ index }?: {
|
|
18
|
+
index?: SpecIndex | (() => SpecIndex | undefined);
|
|
19
|
+
}) => Extension;
|
|
20
|
+
//# sourceMappingURL=language.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"language.d.ts","sourceRoot":"","sources":["../../../../src/extension/language.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,mBAAmB,EAAmB,MAAM,sBAAsB,CAAC;AAC5E,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAM7D;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,qBAI9B,CAAC;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,GAAG,eAAe;IAAE,KAAK,CAAC,EAAE,SAAS,GAAG,CAAC,MAAM,SAAS,GAAG,SAAS,CAAC,CAAA;CAAE,KAAQ,SACe,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type Extension } from '@codemirror/state';
|
|
2
|
+
import { type SpecIndex } from '../spec-index/spec-index.ts';
|
|
3
|
+
/**
|
|
4
|
+
* Lint extension for Spec .mdl documents; with an index (or a getter for one that loads late) it also
|
|
5
|
+
* checks spec references and dependencies.
|
|
6
|
+
*/
|
|
7
|
+
export declare const mdlLint: (index?: SpecIndex | (() => SpecIndex | undefined)) => Extension;
|
|
8
|
+
//# sourceMappingURL=lint.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lint.d.ts","sourceRoot":"","sources":["../../../../src/extension/lint.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAGnD,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAG7D;;;GAGG;AACH,eAAO,MAAM,OAAO,WAAY,SAAS,GAAG,CAAC,MAAM,SAAS,GAAG,SAAS,CAAC,KAAG,SAGzE,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { BLOCK_HEADER_LINE, type BlockHeader, type FenceLine, type MdlBlock, extensionTerms, parseBlockHeaders, parseMdlBlocks, scanFenceLines, } from './blocks.ts';
|
|
2
|
+
export { type ChangelogEntry, type LintOptions, MISSING_DECISION, checkChangelogChange, duplicateSpecMessage, isTrivialEdit, lintMdl, missingItemMessage, parseChangelog, specReferenceFilter, unknownSpecMessage, } from './check.ts';
|
|
3
|
+
export { BLOCK_FIELDS, fieldCompletionContext } from './completion.ts';
|
|
4
|
+
export { BLOCK_TYPES } from './constants.ts';
|
|
5
|
+
export { type Dependency, type SpecRef, findSpecKeys, findSpecRefs, scanSpecLines, specDependencies } from './refs.ts';
|
|
6
|
+
//# sourceMappingURL=parse.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../../../src/extension/parse.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,iBAAiB,EACjB,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,KAAK,QAAQ,EACb,cAAc,EACd,iBAAiB,EACjB,cAAc,EACd,cAAc,GACf,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,gBAAgB,EAChB,oBAAoB,EACpB,oBAAoB,EACpB,aAAa,EACb,OAAO,EACP,kBAAkB,EAClB,cAAc,EACd,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACvE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parser.test.d.ts","sourceRoot":"","sources":["../../../../src/extension/parser.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/** A `<spec id>#<item>` reference, with the offsets of the whole reference text. */
|
|
2
|
+
export type SpecRef = {
|
|
3
|
+
id: string;
|
|
4
|
+
item: string;
|
|
5
|
+
from: number;
|
|
6
|
+
to: number;
|
|
7
|
+
};
|
|
8
|
+
/** A spec this one depends on, with the offsets of the id text. */
|
|
9
|
+
export type Dependency = {
|
|
10
|
+
id: string;
|
|
11
|
+
via: 'uses' | 'dependsOn';
|
|
12
|
+
from: number;
|
|
13
|
+
to: number;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Calls `visit` for each line of prose and of `mdl` fences, with the line's offset in the text.
|
|
17
|
+
* Every other fenced block is skipped, since it holds code rather than spec text.
|
|
18
|
+
*/
|
|
19
|
+
export declare const scanSpecLines: (text: string, visit: (line: string, offset: number) => void) => void;
|
|
20
|
+
/** Finds `<spec id>#<item>` references in prose and in `mdl` fences (comments included). */
|
|
21
|
+
export declare const findSpecRefs: (text: string) => SpecRef[];
|
|
22
|
+
/** Finds `github:` keys that point at a `.mdl` file, with the offsets of the whole key. */
|
|
23
|
+
export declare const findSpecKeys: (text: string) => {
|
|
24
|
+
from: number;
|
|
25
|
+
to: number;
|
|
26
|
+
}[];
|
|
27
|
+
/**
|
|
28
|
+
* The specs this one depends on: every `uses` block id and every entry of the `plugin` block's
|
|
29
|
+
* `dependsOn: [...]`, in document order.
|
|
30
|
+
*/
|
|
31
|
+
export declare const specDependencies: (text: string) => Dependency[];
|
|
32
|
+
//# sourceMappingURL=refs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refs.d.ts","sourceRoot":"","sources":["../../../../src/extension/refs.ts"],"names":[],"mappings":"AAMA,oFAAoF;AACpF,MAAM,MAAM,OAAO,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC;AAE7E,mEAAmE;AACnE,MAAM,MAAM,UAAU,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,GAAG,WAAW,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC;AAM7F;;;GAGG;AACH,eAAO,MAAM,aAAa,SAAU,MAAM,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,KAAG,IAKxF,CAAC;AAEL,4FAA4F;AAC5F,eAAO,MAAM,YAAY,SAAU,MAAM,KAAG,OAAO,EASlD,CAAC;AAIF,2FAA2F;AAC3F,eAAO,MAAM,YAAY,SAAU,MAAM,KAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,EAQvE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,gBAAgB,SAAU,MAAM,KAAG,UAAU,EAqCzD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refs.test.d.ts","sourceRoot":"","sources":["../../../../src/extension/refs.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { LRLanguage } from '@codemirror/language';
|
|
2
|
+
import * as terms from './gen/mdl.terms.ts';
|
|
3
|
+
/**
|
|
4
|
+
* Language definition for the interior of Spec fenced blocks.
|
|
5
|
+
* Uses the generated Lezer LR parser for structural parsing (completion, linting).
|
|
6
|
+
* Syntax highlighting is handled separately by the regex-based ViewPlugin in fences.ts
|
|
7
|
+
* so that it is immune to LR error-recovery false positives on prose content.
|
|
8
|
+
*/
|
|
9
|
+
export declare const mdlBlockLanguage: LRLanguage;
|
|
10
|
+
/** Node type ids of the generated parser, for callers that walk a parse tree (see `QueryDSL.Node`). */
|
|
11
|
+
export declare const mdlTerms: typeof terms;
|
|
12
|
+
//# sourceMappingURL=syntax.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"syntax.d.ts","sourceRoot":"","sources":["../../../../src/extension/syntax.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD,OAAO,KAAK,KAAK,MAAM,oBAAoB,CAAC;AAG5C;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,YAM3B,CAAC;AAEH,uGAAuG;AACvG,eAAO,MAAM,QAAQ,cAAQ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The top-level fields of a block body: a field's inline value, or for a `|` block or nested map, its
|
|
3
|
+
* indented lines with the common indent removed.
|
|
4
|
+
*/
|
|
5
|
+
export declare const parseFields: (body: string) => Map<string, {
|
|
6
|
+
inline?: string;
|
|
7
|
+
lines: string[];
|
|
8
|
+
}>;
|
|
9
|
+
//# sourceMappingURL=fields.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fields.d.ts","sourceRoot":"","sources":["../../../../src/review/fields.ts"],"names":[],"mappings":"AAMA;;;GAGG;AACH,eAAO,MAAM,WAAW,SAAU,MAAM,KAAG,GAAG,CAAC,MAAM,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAA;CAAE,CAoB1F,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/review/index.ts"],"names":[],"mappings":"AAIA,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { type SourceKey } from './source-key.ts';
|
|
2
|
+
/**
|
|
3
|
+
* How far the code meets one spec item, least severe first: `done` as specified, `untested` present but with no test
|
|
4
|
+
* that covers it, `partial` in part, `diverged` implemented differently from what the spec says, `missing` not at all.
|
|
5
|
+
*/
|
|
6
|
+
export declare const VERDICT_STATUSES: readonly ['done', 'untested', 'partial', 'diverged', 'missing'];
|
|
7
|
+
export type VerdictStatus = (typeof VERDICT_STATUSES)[number];
|
|
8
|
+
export type Verdict = {
|
|
9
|
+
/** The spec item judged: a block id (`Scene`, `F-1`) or a nested requirement (`F-1.2`). */
|
|
10
|
+
id: string;
|
|
11
|
+
status: VerdictStatus;
|
|
12
|
+
summary?: string;
|
|
13
|
+
/** `github:` keys of the code that supports the verdict. */
|
|
14
|
+
evidence: string[];
|
|
15
|
+
/** `github:` keys of the tests that exercise the item; empty when the review names none. */
|
|
16
|
+
tests: string[];
|
|
17
|
+
/** Where each part of the item is implemented, in reading order; empty when the review gives none. */
|
|
18
|
+
walkthrough: WalkthroughStep[];
|
|
19
|
+
note?: string;
|
|
20
|
+
};
|
|
21
|
+
/** One segment of a walkthrough: a sentence and the `github:` key of the code it describes. */
|
|
22
|
+
export type WalkthroughStep = {
|
|
23
|
+
text: string;
|
|
24
|
+
key: string;
|
|
25
|
+
};
|
|
26
|
+
/** At most this many segments: a walkthrough says where things are, it does not retell the code. */
|
|
27
|
+
export declare const MAX_WALKTHROUGH = 5;
|
|
28
|
+
/**
|
|
29
|
+
* The walkthrough shown for a verdict: the reviewer's, or one segment per evidence key when the item is implemented
|
|
30
|
+
* in more than one place. Undefined for a single implementation, whose code chip already shows its declaration.
|
|
31
|
+
*/
|
|
32
|
+
export declare const walkthroughOf: (verdict: Verdict) => WalkthroughStep[] | undefined;
|
|
33
|
+
export type ReviewModel = {
|
|
34
|
+
/** Frontmatter: the reviewed spec's key, the commit the code was read at, when, and by whom. */
|
|
35
|
+
spec?: string;
|
|
36
|
+
commit?: string;
|
|
37
|
+
date?: string;
|
|
38
|
+
by?: string;
|
|
39
|
+
verdicts: Verdict[];
|
|
40
|
+
};
|
|
41
|
+
/** The `verdict` blocks of a review document; a verdict with no known status is dropped. */
|
|
42
|
+
export declare const parseReview: (text: string) => ReviewModel;
|
|
43
|
+
/**
|
|
44
|
+
* The status shown for a spec item: its own verdict, else the worst verdict of the items nested under it
|
|
45
|
+
* (`F-1` from `F-1.1`, `F-1.2`), so a feature reads as missing when any of its requirements is.
|
|
46
|
+
*/
|
|
47
|
+
export declare const statusOf: (review: ReviewModel | undefined, id: string) => VerdictStatus | undefined;
|
|
48
|
+
/** Verdict counts per status, in display order. */
|
|
49
|
+
export declare const summarizeReview: (review: ReviewModel) => {
|
|
50
|
+
status: VerdictStatus;
|
|
51
|
+
count: number;
|
|
52
|
+
}[];
|
|
53
|
+
/** The files a review cites (evidence, tests and walkthrough steps), without fragments and in a stable order. */
|
|
54
|
+
export declare const citedFiles: (review: ReviewModel) => string[];
|
|
55
|
+
/** Keys attached to a spec item from outside its text, e.g. a review's evidence; `id` may name a nested req (`F-1.2`). */
|
|
56
|
+
export type Annotation = {
|
|
57
|
+
id: string;
|
|
58
|
+
/** The code that implements the item. */
|
|
59
|
+
keys: readonly SourceKey[];
|
|
60
|
+
/** Whether a review found tests for the item; absent when it does not say. */
|
|
61
|
+
testing?: 'tested' | 'untested';
|
|
62
|
+
/** The tests that exercise the item. */
|
|
63
|
+
tests?: readonly SourceKey[];
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* A review's verdicts as annotations: the code that implements each item and the tests that exercise it. `done` means
|
|
67
|
+
* tested by definition (see `VERDICT_STATUSES`); nothing is said about testing code that does not exist.
|
|
68
|
+
*/
|
|
69
|
+
export declare const reviewAnnotations: (review: ReviewModel | undefined) => Annotation[];
|
|
70
|
+
//# sourceMappingURL=review.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"review.d.ts","sourceRoot":"","sources":["../../../../src/review/review.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,SAAS,EAAmC,MAAM,iBAAiB,CAAC;AAElF;;;GAGG;AACH,eAAO,MAAM,gBAAgB,YAAI,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,CAAU,CAAC;AAEhG,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE9D,MAAM,MAAM,OAAO,GAAG;IACpB,2FAA2F;IAC3F,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,aAAa,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,4DAA4D;IAC5D,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,4FAA4F;IAC5F,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,sGAAsG;IACtG,WAAW,EAAE,eAAe,EAAE,CAAC;IAC/B,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,+FAA+F;AAC/F,MAAM,MAAM,eAAe,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC;AAE5D,oGAAoG;AACpG,eAAO,MAAM,eAAe,IAAI,CAAC;AAoBjC;;;GAGG;AACH,eAAO,MAAM,aAAa,YAAa,OAAO,KAAG,eAAe,EAAE,GAAG,SAOpE,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,gGAAgG;IAChG,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,OAAO,EAAE,CAAC;CACrB,CAAC;AAiBF,4FAA4F;AAC5F,eAAO,MAAM,WAAW,SAAU,MAAM,KAAG,WA+B1C,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,QAAQ,WAAY,WAAW,GAAG,SAAS,MAAM,MAAM,KAAG,aAAa,GAAG,SAYtF,CAAC;AAEF,mDAAmD;AACnD,eAAO,MAAM,eAAe,WAAY,WAAW,KAAG;IAAE,MAAM,EAAE,aAAa,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EAIxD,CAAC;AAEvC,iHAAiH;AACjH,eAAO,MAAM,UAAU,WAAY,WAAW,KAAG,MAAM,EAS7C,CAAC;AAEX,0HAA0H;AAC1H,MAAM,MAAM,UAAU,GAAG;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,yCAAyC;IACzC,IAAI,EAAE,SAAS,SAAS,EAAE,CAAC;IAC3B,8EAA8E;IAC9E,OAAO,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAC;IAChC,wCAAwC;IACxC,KAAK,CAAC,EAAE,SAAS,SAAS,EAAE,CAAC;CAC9B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,WAAY,WAAW,GAAG,SAAS,KAAG,UAAU,EAM1E,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"review.test.d.ts","sourceRoot":"","sources":["../../../../src/review/review.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/** The prefix of a key written in text: `github:owner/repo/path`. */
|
|
2
|
+
export declare const GITHUB_SOURCE = "github";
|
|
3
|
+
/**
|
|
4
|
+
* A location in a GitHub repository: `github:owner/repo/path/to/file[#fragment]`.
|
|
5
|
+
* The fragment names a spec block (`#F-1`, `#Scene`) or a code symbol (`#MyClass`).
|
|
6
|
+
*/
|
|
7
|
+
export type SourceKey = {
|
|
8
|
+
owner: string;
|
|
9
|
+
repo: string;
|
|
10
|
+
/** POSIX path relative to the repository root. */
|
|
11
|
+
path: string;
|
|
12
|
+
fragment?: string;
|
|
13
|
+
};
|
|
14
|
+
/** Matches a key in running text; a trailing `.` is sentence punctuation and is trimmed by {@link findSourceKeys}. */
|
|
15
|
+
export declare const SOURCE_KEY_PATTERN: RegExp;
|
|
16
|
+
/** Parses `github:owner/repo/path[#fragment]`; undefined when the text is not a key. */
|
|
17
|
+
export declare const parseSourceKey: (text: string) => SourceKey | undefined;
|
|
18
|
+
/** Formats a key; the fragment is included only when asked for. */
|
|
19
|
+
export declare const formatSourceKey: ({ owner, repo, path, fragment }: SourceKey, withFragment?: boolean) => string;
|
|
20
|
+
/** `owner/repo`, the identity a local checkout is matched by. */
|
|
21
|
+
export declare const repoId: ({ owner, repo }: Pick<SourceKey, 'owner' | 'repo'>) => string;
|
|
22
|
+
/** `owner/repo` from a GitHub remote URL (`git@github.com:o/r.git`, `https://github.com/o/r`). */
|
|
23
|
+
export declare const parseGitHubRemote: (url: string) => string | undefined;
|
|
24
|
+
/** Whether the key points at a spec document rather than at code. */
|
|
25
|
+
export declare const isSpecKey: (key: SourceKey) => boolean;
|
|
26
|
+
/** The review written beside a spec: `SPEC.mdl` → `SPEC.review.mdl`. */
|
|
27
|
+
export declare const reviewKeyOf: (key: SourceKey) => SourceKey;
|
|
28
|
+
/** Every key mentioned in a text, with its offsets. */
|
|
29
|
+
export declare const findSourceKeys: (text: string) => {
|
|
30
|
+
from: number;
|
|
31
|
+
to: number;
|
|
32
|
+
key: SourceKey;
|
|
33
|
+
raw: string;
|
|
34
|
+
}[];
|
|
35
|
+
//# sourceMappingURL=source-key.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source-key.d.ts","sourceRoot":"","sources":["../../../../src/review/source-key.ts"],"names":[],"mappings":"AAIA,qEAAqE;AACrE,eAAO,MAAM,aAAa,WAAW,CAAC;AAEtC;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,kDAAkD;IAClD,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,sHAAsH;AACtH,eAAO,MAAM,kBAAkB,QAAuD,CAAC;AAEvF,wFAAwF;AACxF,eAAO,MAAM,cAAc,SAAU,MAAM,KAAG,SAAS,GAAG,SAOzD,CAAC;AAEF,mEAAmE;AACnE,eAAO,MAAM,eAAe,oCAAqC,SAAS,6BAAwB,MACJ,CAAC;AAE/F,iEAAiE;AACjE,eAAO,MAAM,MAAM,oBAAqB,IAAI,CAAC,SAAS,EAAE,OAAO,GAAG,MAAM,CAAC,KAAG,MAA4B,CAAC;AAEzG,kGAAkG;AAClG,eAAO,MAAM,iBAAiB,QAAS,MAAM,KAAG,MAAM,GAAG,SAI3C,CAAC;AAEf,qEAAqE;AACrE,eAAO,MAAM,SAAS,QAAS,SAAS,KAAG,OAAoC,CAAC;AAEhF,wEAAwE;AACxE,eAAO,MAAM,WAAW,QAAS,SAAS,KAAG,SAI3C,CAAC;AAEH,uDAAuD;AACvD,eAAO,MAAM,cAAc,SAAU,MAAM,KAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,SAAS,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,EAKnG,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The 1-based line that declares a symbol in a source file, or undefined when it is not there. A dotted name
|
|
3
|
+
* (`Spec.make`, `Class.method`) finds the outer declaration first and then the member after it.
|
|
4
|
+
*/
|
|
5
|
+
export declare const findSymbolLine: (content: string, symbol: string) => number | undefined;
|
|
6
|
+
/** A short excerpt of a source file: its first line number (1-based) and its lines. */
|
|
7
|
+
export type Snippet = {
|
|
8
|
+
line: number;
|
|
9
|
+
lines: string[];
|
|
10
|
+
truncated: boolean;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* The declaration a key names, as shown on hover: from the declaring line to where its brackets close, or the
|
|
14
|
+
* file's opening lines (after the copyright header) when there is no symbol. Undefined when the symbol is not there.
|
|
15
|
+
*/
|
|
16
|
+
export declare const declarationSnippet: (content: string, symbol?: string) => Snippet | undefined;
|
|
17
|
+
//# sourceMappingURL=symbol.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"symbol.d.ts","sourceRoot":"","sources":["../../../../src/review/symbol.ts"],"names":[],"mappings":"AAoBA;;;GAGG;AACH,eAAO,MAAM,cAAc,YAAa,MAAM,UAAU,MAAM,KAAG,MAAM,GAAG,SAqBzE,CAAC;AAKF,uFAAuF;AACvF,MAAM,MAAM,OAAO,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAC;IAAC,SAAS,EAAE,OAAO,CAAA;CAAE,CAAC;AAQ5E;;;GAGG;AACH,eAAO,MAAM,kBAAkB,YAAa,MAAM,WAAW,MAAM,KAAG,OAAO,GAAG,SAgC/E,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"symbol.test.d.ts","sourceRoot":"","sources":["../../../../src/review/symbol.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/spec-index/index.ts"],"names":[],"mappings":"AAIA,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC"}
|