@warlock.js/grimoire 0.0.0-stage → 5.55.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/CHANGELOG.md +46 -0
- package/LICENSE +21 -0
- package/README.md +55 -2
- package/esm/apps/check-apps.mjs +207 -0
- package/esm/apps/check-apps.mjs.map +1 -0
- package/esm/apps/index.mjs +4 -0
- package/esm/apps/match-apps.d.mts +12 -0
- package/esm/apps/match-apps.d.mts.map +1 -0
- package/esm/apps/match-apps.mjs +30 -0
- package/esm/apps/match-apps.mjs.map +1 -0
- package/esm/book/build.d.mts +14 -0
- package/esm/book/build.d.mts.map +1 -0
- package/esm/book/build.mjs +300 -0
- package/esm/book/build.mjs.map +1 -0
- package/esm/book/index.mjs +5 -0
- package/esm/book/io.mjs +162 -0
- package/esm/book/io.mjs.map +1 -0
- package/esm/book/normalize.mjs +71 -0
- package/esm/book/normalize.mjs.map +1 -0
- package/esm/book/render.mjs +262 -0
- package/esm/book/render.mjs.map +1 -0
- package/esm/book/write.d.mts +12 -0
- package/esm/book/write.d.mts.map +1 -0
- package/esm/book/write.mjs +90 -0
- package/esm/book/write.mjs.map +1 -0
- package/esm/bookmap/build.d.mts +21 -0
- package/esm/bookmap/build.d.mts.map +1 -0
- package/esm/bookmap/build.mjs +272 -0
- package/esm/bookmap/build.mjs.map +1 -0
- package/esm/bookmap/index.mjs +5 -0
- package/esm/bookmap/steps.mjs +137 -0
- package/esm/bookmap/steps.mjs.map +1 -0
- package/esm/bookmap/write.d.mts +19 -0
- package/esm/bookmap/write.d.mts.map +1 -0
- package/esm/bookmap/write.mjs +118 -0
- package/esm/bookmap/write.mjs.map +1 -0
- package/esm/check/check-grimoire.d.mts +7 -0
- package/esm/check/check-grimoire.d.mts.map +1 -0
- package/esm/check/check-grimoire.mjs +98 -0
- package/esm/check/check-grimoire.mjs.map +1 -0
- package/esm/check/format-check-report.d.mts +20 -0
- package/esm/check/format-check-report.d.mts.map +1 -0
- package/esm/check/format-check-report.mjs +55 -0
- package/esm/check/format-check-report.mjs.map +1 -0
- package/esm/check/index.mjs +4 -0
- package/esm/check/rules/book-notes.mjs +18 -0
- package/esm/check/rules/book-notes.mjs.map +1 -0
- package/esm/check/rules/criteria.mjs +48 -0
- package/esm/check/rules/criteria.mjs.map +1 -0
- package/esm/check/rules/links.mjs +196 -0
- package/esm/check/rules/links.mjs.map +1 -0
- package/esm/check/rules/lookup.mjs +41 -0
- package/esm/check/rules/lookup.mjs.map +1 -0
- package/esm/check/rules/source-files.mjs +119 -0
- package/esm/check/rules/source-files.mjs.map +1 -0
- package/esm/check/rules/versions.mjs +92 -0
- package/esm/check/rules/versions.mjs.map +1 -0
- package/esm/codes/codes.d.mts +182 -0
- package/esm/codes/codes.d.mts.map +1 -0
- package/esm/codes/codes.mjs +111 -0
- package/esm/codes/codes.mjs.map +1 -0
- package/esm/codes/index.d.mts +33 -0
- package/esm/codes/index.d.mts.map +1 -0
- package/esm/codes/index.mjs +63 -0
- package/esm/codes/index.mjs.map +1 -0
- package/esm/contracts/adapter.d.mts +209 -0
- package/esm/contracts/adapter.d.mts.map +1 -0
- package/esm/contracts/book.d.mts +233 -0
- package/esm/contracts/book.d.mts.map +1 -0
- package/esm/contracts/book.mjs +7 -0
- package/esm/contracts/book.mjs.map +1 -0
- package/esm/contracts/bookmap.d.mts +175 -0
- package/esm/contracts/bookmap.d.mts.map +1 -0
- package/esm/contracts/findings.d.mts +79 -0
- package/esm/contracts/findings.d.mts.map +1 -0
- package/esm/contracts/location.d.mts +22 -0
- package/esm/contracts/location.d.mts.map +1 -0
- package/esm/contracts/releases.d.mts +53 -0
- package/esm/contracts/releases.d.mts.map +1 -0
- package/esm/contracts/scry.d.mts +143 -0
- package/esm/contracts/scry.d.mts.map +1 -0
- package/esm/contracts/snapshot.d.mts +52 -0
- package/esm/contracts/snapshot.d.mts.map +1 -0
- package/esm/contracts/test-results.d.mts +63 -0
- package/esm/contracts/test-results.d.mts.map +1 -0
- package/esm/contracts/written.d.mts +363 -0
- package/esm/contracts/written.d.mts.map +1 -0
- package/esm/contracts/written.mjs +19 -0
- package/esm/contracts/written.mjs.map +1 -0
- package/esm/devtools/data.mjs +171 -0
- package/esm/devtools/data.mjs.map +1 -0
- package/esm/devtools/graphs.mjs +142 -0
- package/esm/devtools/graphs.mjs.map +1 -0
- package/esm/devtools/index.d.mts +35 -0
- package/esm/devtools/index.d.mts.map +1 -0
- package/esm/devtools/index.mjs +102 -0
- package/esm/devtools/index.mjs.map +1 -0
- package/esm/devtools/site.d.mts +26 -0
- package/esm/devtools/site.d.mts.map +1 -0
- package/esm/devtools/site.mjs +190 -0
- package/esm/devtools/site.mjs.map +1 -0
- package/esm/devtools/snapshot-source.mjs +70 -0
- package/esm/devtools/snapshot-source.mjs.map +1 -0
- package/esm/front-matter/index.d.mts +33 -0
- package/esm/front-matter/index.d.mts.map +1 -0
- package/esm/front-matter/index.mjs +130 -0
- package/esm/front-matter/index.mjs.map +1 -0
- package/esm/graph/index.d.mts +15 -0
- package/esm/graph/index.d.mts.map +1 -0
- package/esm/graph/index.mjs +42 -0
- package/esm/graph/index.mjs.map +1 -0
- package/esm/index.d.mts +33 -0
- package/esm/index.mjs +33 -0
- package/esm/ownership/index.d.mts +8 -0
- package/esm/ownership/index.d.mts.map +1 -0
- package/esm/ownership/index.mjs +137 -0
- package/esm/ownership/index.mjs.map +1 -0
- package/esm/paths/index.d.mts +58 -0
- package/esm/paths/index.d.mts.map +1 -0
- package/esm/paths/index.mjs +137 -0
- package/esm/paths/index.mjs.map +1 -0
- package/esm/proves/index.mjs +3 -0
- package/esm/proves/scan-proofs.d.mts +22 -0
- package/esm/proves/scan-proofs.d.mts.map +1 -0
- package/esm/proves/scan-proofs.mjs +214 -0
- package/esm/proves/scan-proofs.mjs.map +1 -0
- package/esm/releases/index.d.mts +29 -0
- package/esm/releases/index.d.mts.map +1 -0
- package/esm/releases/index.mjs +157 -0
- package/esm/releases/index.mjs.map +1 -0
- package/esm/scry/format.d.mts +14 -0
- package/esm/scry/format.d.mts.map +1 -0
- package/esm/scry/format.mjs +193 -0
- package/esm/scry/format.mjs.map +1 -0
- package/esm/scry/index.mjs +5 -0
- package/esm/scry/parse.d.mts +10 -0
- package/esm/scry/parse.d.mts.map +1 -0
- package/esm/scry/parse.mjs +108 -0
- package/esm/scry/parse.mjs.map +1 -0
- package/esm/scry/query.d.mts +11 -0
- package/esm/scry/query.d.mts.map +1 -0
- package/esm/scry/query.mjs +457 -0
- package/esm/scry/query.mjs.map +1 -0
- package/esm/tasks/index.mjs +116 -0
- package/esm/tasks/index.mjs.map +1 -0
- package/esm/test-results/criterion-status.d.mts +15 -0
- package/esm/test-results/criterion-status.d.mts.map +1 -0
- package/esm/test-results/criterion-status.mjs +17 -0
- package/esm/test-results/criterion-status.mjs.map +1 -0
- package/esm/test-results/index.d.mts +8 -0
- package/esm/test-results/index.d.mts.map +1 -0
- package/esm/test-results/index.mjs +124 -0
- package/esm/test-results/index.mjs.map +1 -0
- package/esm/vitest/index.d.mts +15 -0
- package/esm/vitest/index.d.mts.map +1 -0
- package/esm/vitest/index.mjs +146 -0
- package/esm/vitest/index.mjs.map +1 -0
- package/esm/warlock/actions.mjs +265 -0
- package/esm/warlock/actions.mjs.map +1 -0
- package/esm/warlock/adapter.d.mts +28 -0
- package/esm/warlock/adapter.d.mts.map +1 -0
- package/esm/warlock/adapter.mjs +377 -0
- package/esm/warlock/adapter.mjs.map +1 -0
- package/esm/warlock/commands.d.mts +15 -0
- package/esm/warlock/commands.d.mts.map +1 -0
- package/esm/warlock/commands.mjs +199 -0
- package/esm/warlock/commands.mjs.map +1 -0
- package/esm/warlock/index.d.mts +4 -0
- package/esm/warlock/index.mjs +5 -0
- package/esm/warlock/mcp-tools.mjs +247 -0
- package/esm/warlock/mcp-tools.mjs.map +1 -0
- package/esm/warlock/mobile-facts.d.mts +32 -0
- package/esm/warlock/mobile-facts.d.mts.map +1 -0
- package/esm/warlock/mobile-facts.mjs +185 -0
- package/esm/warlock/mobile-facts.mjs.map +1 -0
- package/esm/workspace/index.d.mts +11 -0
- package/esm/workspace/index.d.mts.map +1 -0
- package/esm/workspace/index.mjs +122 -0
- package/esm/workspace/index.mjs.map +1 -0
- package/esm/written/apps.mjs +227 -0
- package/esm/written/apps.mjs.map +1 -0
- package/esm/written/features.mjs +400 -0
- package/esm/written/features.mjs.map +1 -0
- package/esm/written/fields.mjs +173 -0
- package/esm/written/fields.mjs.map +1 -0
- package/esm/written/index.mjs +3 -0
- package/esm/written/lists.mjs +68 -0
- package/esm/written/lists.mjs.map +1 -0
- package/esm/written/markdown.mjs +173 -0
- package/esm/written/markdown.mjs.map +1 -0
- package/esm/written/parse-grimoire.d.mts +20 -0
- package/esm/written/parse-grimoire.d.mts.map +1 -0
- package/esm/written/parse-grimoire.mjs +552 -0
- package/esm/written/parse-grimoire.mjs.map +1 -0
- package/esm/written/sink.mjs +65 -0
- package/esm/written/sink.mjs.map +1 -0
- package/esm/written/tasks-releases.mjs +166 -0
- package/esm/written/tasks-releases.mjs.map +1 -0
- package/llms-full.txt +869 -0
- package/llms.txt +15 -0
- package/package.json +66 -4
- package/skills/backfill-a-grimoire/SKILL.md +128 -0
- package/skills/describe-an-app/SKILL.md +162 -0
- package/skills/document-a-file/SKILL.md +75 -0
- package/skills/index.md +26 -0
- package/skills/record-a-change/SKILL.md +139 -0
- package/skills/use-the-grimoire/SKILL.md +137 -0
- package/skills/write-a-feature/SKILL.md +168 -0
- package/ui/grimoire-static.js +136 -0
- package/ui/grimoire-view.js +1005 -0
- package/ui/grimoire.css +88 -0
|
@@ -0,0 +1,363 @@
|
|
|
1
|
+
import { Located, SourceLocation } from "./location.mjs";
|
|
2
|
+
//#region ../../packages/grimoire/src/contracts/written.d.ts
|
|
3
|
+
/** Status of a feature or a flow. */
|
|
4
|
+
export type WrittenStatus = "proposed" | "building" | "shipped" | "retired";
|
|
5
|
+
/** Whether the description was written from the code (`inferred`) or confirmed by the owner. */
|
|
6
|
+
export type WrittenOrigin = "inferred" | "confirmed";
|
|
7
|
+
/** A feature version: `<whole>.<decimal>` (`2.1`). */
|
|
8
|
+
export type FeatureVersion = string;
|
|
9
|
+
/** A flow reference: `<feature>/<flow>`. */
|
|
10
|
+
export type FlowRef = string;
|
|
11
|
+
/** A criterion id: `AC-<n>`. */
|
|
12
|
+
export type CriterionId = string;
|
|
13
|
+
/** One `- name text` line of a list section. */
|
|
14
|
+
export type WrittenListLine = {
|
|
15
|
+
/** The first word or phrase (a flow id, an app id, a condition name, a question). */
|
|
16
|
+
name: string;
|
|
17
|
+
/** The rest of the line, continuation lines joined with a space. */
|
|
18
|
+
text: string;
|
|
19
|
+
at: SourceLocation;
|
|
20
|
+
};
|
|
21
|
+
/** `grimoire/features/<id>/README.md`. */
|
|
22
|
+
export type WrittenFeatureReadme = {
|
|
23
|
+
file: string;
|
|
24
|
+
/** Front matter `id`; must equal the folder name. */
|
|
25
|
+
id: Located<string>;
|
|
26
|
+
title: Located<string>;
|
|
27
|
+
status: Located<WrittenStatus>;
|
|
28
|
+
version: Located<FeatureVersion>;
|
|
29
|
+
/** `yyyy-mm-dd`. */
|
|
30
|
+
updated: Located<string>;
|
|
31
|
+
/** App ids under `grimoire/apps/`. */
|
|
32
|
+
apps: Located<string>[];
|
|
33
|
+
/** Project-relative folders whose files the feature owns; an entry with a code-file extension names one file. */
|
|
34
|
+
folders: Located<string>[];
|
|
35
|
+
origin: Located<WrittenOrigin> | null;
|
|
36
|
+
/** The `# Heading`. */
|
|
37
|
+
heading: Located<string> | null;
|
|
38
|
+
/** The paragraph under the heading, or `null`. */
|
|
39
|
+
summary: string | null;
|
|
40
|
+
/** `## Flows`: `- <flow-id> <what it does>`. */
|
|
41
|
+
flows: WrittenListLine[];
|
|
42
|
+
/** `## Affects and affected by`: free lines; references `<feature>/<flow>` are read from them. */
|
|
43
|
+
relations: {
|
|
44
|
+
text: string;
|
|
45
|
+
refs: FlowRef[];
|
|
46
|
+
at: SourceLocation;
|
|
47
|
+
}[];
|
|
48
|
+
};
|
|
49
|
+
/** A changed-word of a changelog entry. */
|
|
50
|
+
export type ChangeWord = "added" | "changed" | "fixed" | "removed";
|
|
51
|
+
/**
|
|
52
|
+
* One changelog entry:
|
|
53
|
+
* `- <version> <word> [<flow>: ]<text>[ (AC-n[, AC-m])]`, continuation
|
|
54
|
+
* lines indented.
|
|
55
|
+
*/
|
|
56
|
+
export type WrittenChangelogEntry = {
|
|
57
|
+
feature: string;
|
|
58
|
+
version: Located<FeatureVersion>;
|
|
59
|
+
word: ChangeWord;
|
|
60
|
+
/** The flow id named before `:`, or `null`. */
|
|
61
|
+
flow: string | null;
|
|
62
|
+
/** Criteria named in the trailing parentheses. */
|
|
63
|
+
criteria: CriterionId[];
|
|
64
|
+
/** The text without the flow prefix and the criteria. */
|
|
65
|
+
text: string;
|
|
66
|
+
/** `null` while under `## Unreleased`; the section's release once the agent moved it. */
|
|
67
|
+
release: string | null;
|
|
68
|
+
/** `yyyy-mm-dd` of the release section, or `null`. */
|
|
69
|
+
date: string | null;
|
|
70
|
+
at: SourceLocation;
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* A changelog section: `## Unreleased`, or `## <release> (<yyyy-mm-dd>)`
|
|
74
|
+
* for a release the agent stamped.
|
|
75
|
+
*/
|
|
76
|
+
export type WrittenChangelogSection = {
|
|
77
|
+
release: string | null;
|
|
78
|
+
date: string | null;
|
|
79
|
+
at: SourceLocation;
|
|
80
|
+
};
|
|
81
|
+
/** `grimoire/features/<id>/CHANGELOG.md`, newest first. */
|
|
82
|
+
export type WrittenChangelog = {
|
|
83
|
+
file: string;
|
|
84
|
+
sections: WrittenChangelogSection[];
|
|
85
|
+
entries: WrittenChangelogEntry[];
|
|
86
|
+
};
|
|
87
|
+
/** Flow step kinds. `affects` names an effect on another feature. */
|
|
88
|
+
export type StepType = "page" | "route" | "mail" | "notification" | "job" | "event" | "outside service" | "affects";
|
|
89
|
+
/** One `<n>. <kind> <target>[ — note]` line of `## Steps`. */
|
|
90
|
+
export type WrittenStep = {
|
|
91
|
+
/** The number written before the dot. */
|
|
92
|
+
index: number;
|
|
93
|
+
type: StepType;
|
|
94
|
+
/** The name as written (`POST /wishlist`, `/products/:id`, `order-confirmation`, `catalog/stock`). */
|
|
95
|
+
target: string;
|
|
96
|
+
/**
|
|
97
|
+
* For a page step written `/support [web-admin]`: the app the page is in
|
|
98
|
+
* (the target is then the path alone). `null` for every other step.
|
|
99
|
+
*/
|
|
100
|
+
app: string | null;
|
|
101
|
+
/** For a route step: the uppercase method and the path. */
|
|
102
|
+
route: {
|
|
103
|
+
method: string;
|
|
104
|
+
path: string;
|
|
105
|
+
} | null;
|
|
106
|
+
/** For an affects step: the feature and, when given, the flow. */
|
|
107
|
+
affects: {
|
|
108
|
+
feature: string;
|
|
109
|
+
flow: string | null;
|
|
110
|
+
} | null;
|
|
111
|
+
/** Text after ` — ` (or ` -- `), or `null`. */
|
|
112
|
+
note: string | null;
|
|
113
|
+
at: SourceLocation;
|
|
114
|
+
};
|
|
115
|
+
/** The fixed case questions every flow answers (in `## Cases` or `## Not handled`). */
|
|
116
|
+
export declare const CASE_QUESTIONS: readonly ["invalid input", "not allowed", "not found", "duplicate", "limits", "expiry", "double submit", "outside service down"];
|
|
117
|
+
/** One fixed case question. */
|
|
118
|
+
export type CaseQuestion = (typeof CASE_QUESTIONS)[number];
|
|
119
|
+
/** One `- <question> <answer>` line of `## Cases`. */
|
|
120
|
+
export type WrittenCase = {
|
|
121
|
+
/** The question, lower-case (`double submit`), or the owner's own case label. */
|
|
122
|
+
question: string;
|
|
123
|
+
/** Whether `question` is one of {@link CASE_QUESTIONS}. */
|
|
124
|
+
fixed: boolean;
|
|
125
|
+
answer: string;
|
|
126
|
+
/** The answer starts with `does not apply`. */
|
|
127
|
+
doesNotApply: boolean;
|
|
128
|
+
at: SourceLocation;
|
|
129
|
+
};
|
|
130
|
+
/** One `- AC-<n>[ [app-id]] <text>` line of `## Acceptance criteria`. */
|
|
131
|
+
export type WrittenCriterion = {
|
|
132
|
+
id: CriterionId;
|
|
133
|
+
number: number;
|
|
134
|
+
/** The app the criterion is scoped to, or `null` for every app. */
|
|
135
|
+
app: string | null;
|
|
136
|
+
text: string;
|
|
137
|
+
at: SourceLocation;
|
|
138
|
+
};
|
|
139
|
+
/** `grimoire/features/<feature>/flows/<id>.md`. */
|
|
140
|
+
export type WrittenFlow = {
|
|
141
|
+
file: string;
|
|
142
|
+
feature: string;
|
|
143
|
+
/** Front matter `id`; must equal the file name without `.md`. */
|
|
144
|
+
id: Located<string>;
|
|
145
|
+
/** `<feature>/<id>`. */
|
|
146
|
+
ref: FlowRef;
|
|
147
|
+
/** The feature version that introduced the flow. */
|
|
148
|
+
since: Located<FeatureVersion>;
|
|
149
|
+
status: Located<WrittenStatus>;
|
|
150
|
+
/** Who walks the flow (`customer`, `guest`, `admin`, `system`). Free text. */
|
|
151
|
+
who: Located<string>;
|
|
152
|
+
origin: Located<WrittenOrigin> | null;
|
|
153
|
+
heading: Located<string> | null;
|
|
154
|
+
steps: WrittenStep[];
|
|
155
|
+
/** `## Differs by app`: `- <app-id> <what differs>`. */
|
|
156
|
+
differs: WrittenListLine[];
|
|
157
|
+
cases: WrittenCase[];
|
|
158
|
+
/** `## Not handled`: questions the code does not handle yet. */
|
|
159
|
+
notHandled: WrittenListLine[];
|
|
160
|
+
/** Every line starting with `Unknown:` anywhere in the flow. */
|
|
161
|
+
unknowns: {
|
|
162
|
+
text: string;
|
|
163
|
+
at: SourceLocation;
|
|
164
|
+
}[];
|
|
165
|
+
criteria: WrittenCriterion[];
|
|
166
|
+
};
|
|
167
|
+
/** `grimoire/features/<feature>/versions/v<n>.md`: the brief before a whole-number version. */
|
|
168
|
+
export type WrittenVersionBrief = {
|
|
169
|
+
file: string;
|
|
170
|
+
feature: string;
|
|
171
|
+
/** The whole number from the file name (`3` for `v3.md`). */
|
|
172
|
+
major: number;
|
|
173
|
+
heading: Located<string> | null;
|
|
174
|
+
};
|
|
175
|
+
/** One feature folder. */
|
|
176
|
+
export type WrittenFeature = {
|
|
177
|
+
id: string;
|
|
178
|
+
/** `grimoire/features/<id>`. */
|
|
179
|
+
dir: string;
|
|
180
|
+
/** `null` when the folder has no README (a structure error). */
|
|
181
|
+
readme: WrittenFeatureReadme | null;
|
|
182
|
+
changelog: WrittenChangelog | null;
|
|
183
|
+
flows: WrittenFlow[];
|
|
184
|
+
versions: WrittenVersionBrief[];
|
|
185
|
+
};
|
|
186
|
+
/** Who sees a block: `everyone`, or condition names of the app. */
|
|
187
|
+
export type WrittenWho = {
|
|
188
|
+
everyone: boolean;
|
|
189
|
+
conditions: string[];
|
|
190
|
+
};
|
|
191
|
+
/** One `Changes with` item: `<condition>: <text>`, or free text with no condition. */
|
|
192
|
+
export type WrittenChangesWith = {
|
|
193
|
+
condition: string | null;
|
|
194
|
+
text: string;
|
|
195
|
+
};
|
|
196
|
+
/** One row of a `## Blocks` table: `| Block | Flow | Who sees it | Changes with |`. */
|
|
197
|
+
export type WrittenBlockRow = {
|
|
198
|
+
block: string;
|
|
199
|
+
/** `<feature>/<flow>`, or `null` for `—`. */
|
|
200
|
+
flow: FlowRef | null;
|
|
201
|
+
who: WrittenWho;
|
|
202
|
+
/** Empty for `—`. Items are separated by `;`. */
|
|
203
|
+
changesWith: WrittenChangesWith[];
|
|
204
|
+
at: SourceLocation;
|
|
205
|
+
};
|
|
206
|
+
/** `grimoire/apps/<app>/layouts/<id>.md`. */
|
|
207
|
+
export type WrittenLayout = {
|
|
208
|
+
file: string;
|
|
209
|
+
app: string;
|
|
210
|
+
/** The file name without `.md`. */
|
|
211
|
+
id: string;
|
|
212
|
+
/** Front matter `origin`, when given. */
|
|
213
|
+
origin: Located<WrittenOrigin> | null;
|
|
214
|
+
heading: Located<string> | null;
|
|
215
|
+
blocks: WrittenBlockRow[];
|
|
216
|
+
};
|
|
217
|
+
/** `grimoire/apps/<app>/pages/<page>/blocks/<id>.md`. */
|
|
218
|
+
export type WrittenBlockFile = {
|
|
219
|
+
file: string;
|
|
220
|
+
app: string;
|
|
221
|
+
/** The page or screen folder name. */
|
|
222
|
+
page: string;
|
|
223
|
+
id: string;
|
|
224
|
+
flow: Located<FlowRef> | null;
|
|
225
|
+
heading: Located<string> | null;
|
|
226
|
+
/** `- <key> <value>` lines. */
|
|
227
|
+
details: WrittenListLine[];
|
|
228
|
+
};
|
|
229
|
+
/** One `- <kind> <name>` line of `## Also reached from`. */
|
|
230
|
+
export type WrittenEntryPoint = {
|
|
231
|
+
/** `mail`, `notification`, `page`, `screen`, `outside service`, or another word. */
|
|
232
|
+
type: string;
|
|
233
|
+
name: string;
|
|
234
|
+
at: SourceLocation;
|
|
235
|
+
};
|
|
236
|
+
/**
|
|
237
|
+
* `grimoire/apps/<app>/pages/<id>/README.md` (a site page) or
|
|
238
|
+
* `grimoire/apps/<app>/screens/<id>/README.md` (a mobile screen).
|
|
239
|
+
*/
|
|
240
|
+
export type WrittenPage = {
|
|
241
|
+
file: string;
|
|
242
|
+
app: string;
|
|
243
|
+
type: "page" | "screen";
|
|
244
|
+
/** The folder name. */
|
|
245
|
+
id: string;
|
|
246
|
+
/** Front matter `route`: the page's route path, or a screen's file-based route. */
|
|
247
|
+
route: Located<string> | null;
|
|
248
|
+
/** Front matter `screen`: the screen name used by code-defined navigation. */
|
|
249
|
+
screen: Located<string> | null;
|
|
250
|
+
/** Front matter `layout`: a file in the app's `layouts/`. */
|
|
251
|
+
layout: Located<string> | null;
|
|
252
|
+
/** Front matter `origin`, when given. */
|
|
253
|
+
origin: Located<WrittenOrigin> | null;
|
|
254
|
+
heading: Located<string> | null;
|
|
255
|
+
/** The paragraph under the heading, or `null`. */
|
|
256
|
+
purpose: string | null;
|
|
257
|
+
blocks: WrittenBlockRow[];
|
|
258
|
+
alsoReachedFrom: WrittenEntryPoint[];
|
|
259
|
+
blockFiles: WrittenBlockFile[];
|
|
260
|
+
};
|
|
261
|
+
/** `grimoire/apps/<id>/README.md` and everything under that folder. */
|
|
262
|
+
export type WrittenApp = {
|
|
263
|
+
/** `grimoire/apps/<id>`. */
|
|
264
|
+
dir: string;
|
|
265
|
+
/** `README.md`, or `null` when missing (a structure error). */
|
|
266
|
+
file: string | null;
|
|
267
|
+
/** Front matter `id`; must equal the folder name. */
|
|
268
|
+
id: Located<string>;
|
|
269
|
+
type: Located<"site" | "mobile">;
|
|
270
|
+
/** Project-relative root of the site or mobile app (`src/web/$sites/client`, `mobile`). */
|
|
271
|
+
root: Located<string>;
|
|
272
|
+
/** Front matter `origin`, when given. */
|
|
273
|
+
origin: Located<WrittenOrigin> | null;
|
|
274
|
+
heading: Located<string> | null;
|
|
275
|
+
/** `## Conditions`: `- <name> <meaning>`. */
|
|
276
|
+
conditions: WrittenListLine[];
|
|
277
|
+
layouts: WrittenLayout[];
|
|
278
|
+
pages: WrittenPage[];
|
|
279
|
+
screens: WrittenPage[];
|
|
280
|
+
};
|
|
281
|
+
export type TaskType = "bug" | "feature" | "decision" | "chore";
|
|
282
|
+
export type TaskStatus = "open" | "waiting for approval" | "approved" | "in progress" | "blocked" | "done" | "dropped";
|
|
283
|
+
/**
|
|
284
|
+
* `grimoire/tasks/open/T-<n>-<slug>.md` or
|
|
285
|
+
* `grimoire/tasks/done/<yyyy-mm>/T-<n>-<slug>.md`.
|
|
286
|
+
*/
|
|
287
|
+
export type WrittenTask = {
|
|
288
|
+
file: string;
|
|
289
|
+
/** Which folder holds it. */
|
|
290
|
+
folder: "open" | "done";
|
|
291
|
+
/** `yyyy-mm` of the done folder, or `null` for open tasks. */
|
|
292
|
+
month: string | null;
|
|
293
|
+
/** `T-<n>`. */
|
|
294
|
+
id: Located<string>;
|
|
295
|
+
type: Located<TaskType>;
|
|
296
|
+
feature: Located<string> | null;
|
|
297
|
+
/** Flow id within `feature`, or a full `<feature>/<flow>`; stored as written. */
|
|
298
|
+
flow: Located<string> | null;
|
|
299
|
+
apps: Located<string>[];
|
|
300
|
+
status: Located<TaskStatus>;
|
|
301
|
+
/** `shipped: <feature> <version>`, once done. */
|
|
302
|
+
shipped: Located<{
|
|
303
|
+
feature: string;
|
|
304
|
+
version: FeatureVersion;
|
|
305
|
+
}> | null;
|
|
306
|
+
heading: Located<string> | null;
|
|
307
|
+
/** `- <Key>: <value>` lines of the body (`Asked by`, `Why`, `Brief`, `Decision needed`, …). */
|
|
308
|
+
fields: {
|
|
309
|
+
key: string;
|
|
310
|
+
value: string;
|
|
311
|
+
at: SourceLocation;
|
|
312
|
+
}[];
|
|
313
|
+
/** The `Decision needed` value, or `null`. */
|
|
314
|
+
decisionNeeded: string | null;
|
|
315
|
+
};
|
|
316
|
+
/** Markers around the list Warlock writes into a release file. */
|
|
317
|
+
export declare const COLLECTED_START_MARKER = "<!-- grimoire:collected:start -->";
|
|
318
|
+
export declare const COLLECTED_END_MARKER = "<!-- grimoire:collected:end -->";
|
|
319
|
+
/** One line of a release file's collected list, read back. */
|
|
320
|
+
export type WrittenReleaseListed = {
|
|
321
|
+
feature: string;
|
|
322
|
+
version: FeatureVersion;
|
|
323
|
+
word: ChangeWord;
|
|
324
|
+
flow: string | null;
|
|
325
|
+
criteria: CriterionId[];
|
|
326
|
+
text: string;
|
|
327
|
+
at: SourceLocation;
|
|
328
|
+
};
|
|
329
|
+
/** `grimoire/releases/<release>.md`. */
|
|
330
|
+
export type WrittenRelease = {
|
|
331
|
+
file: string;
|
|
332
|
+
/** Front matter `release`; must equal the file name without `.md`. */
|
|
333
|
+
release: Located<string>;
|
|
334
|
+
/** `yyyy-mm-dd`. */
|
|
335
|
+
date: Located<string>;
|
|
336
|
+
heading: Located<string> | null;
|
|
337
|
+
/** The agent's brief: the text between the heading and the collected list. */
|
|
338
|
+
brief: string;
|
|
339
|
+
/** The list between the markers; `null` when the release command has not run yet. */
|
|
340
|
+
collected: {
|
|
341
|
+
start: SourceLocation;
|
|
342
|
+
end: SourceLocation;
|
|
343
|
+
entries: WrittenReleaseListed[];
|
|
344
|
+
} | null;
|
|
345
|
+
};
|
|
346
|
+
/** Every written file of a project, parsed. */
|
|
347
|
+
export type WrittenGrimoire = {
|
|
348
|
+
/** Absolute project root. */
|
|
349
|
+
root: string;
|
|
350
|
+
/** `false` when the project has no `grimoire/` folder (book-only mode). */
|
|
351
|
+
exists: boolean;
|
|
352
|
+
features: WrittenFeature[];
|
|
353
|
+
apps: WrittenApp[];
|
|
354
|
+
tasks: WrittenTask[];
|
|
355
|
+
releases: WrittenRelease[];
|
|
356
|
+
/**
|
|
357
|
+
* sha256 over the path and content of every written file, in path order.
|
|
358
|
+
* The book manifest stores it to know when ownership and book maps change.
|
|
359
|
+
*/
|
|
360
|
+
hash: string;
|
|
361
|
+
};
|
|
362
|
+
//#endregion
|
|
363
|
+
//# sourceMappingURL=written.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"written.d.mts","names":[],"sources":["../../../../../../../../packages/grimoire/src/contracts/written.ts"],"mappings":";;;YAeY;;YAGA;;YAGA;;YAGA;;YAGA;;YAGA;;EAEV;;EAEA;EACA,IAAI;;;YAMM;EACV;;EAEA,IAAI;EACJ,OAAO;EACP,QAAQ,QAAQ;EAChB,SAAS,QAAQ;;EAEjB,SAAS;;EAET,MAAM;;EAEN,SAAS;EACT,QAAQ,QAAQ;;EAEhB,SAAS;;EAET;;EAEA,OAAO;;EAEP;IAAa;IAAc,MAAM;IAAW,IAAI;;;;YAItC;;;;;;YAOA;EACV;EACA,SAAS,QAAQ;EACjB,MAAM;;EAEN;;EAEA,UAAU;;EAEV;;EAEA;;EAEA;EACA,IAAI;;;;;;YAOM;EACV;EACA;EACA,IAAI;;;YAIM;EACV;EACA,UAAU;EACV,SAAS;;;YAIC;;YAWA;;EAEV;EACA,MAAM;;EAEN;;;;;EAKA;;EAEA;IAAS;IAAgB;;;EAEzB;IAAW;IAAiB;;;EAE5B;EACA,IAAI;;;qBAIO;;YAYD,uBAAuB;;YAGvB;;EAEV;;EAEA;EACA;;EAEA;EACA,IAAI;;;YAIM;EACV,IAAI;EACJ;;EAEA;EACA;EACA,IAAI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;;EAET;;EAEA;IAAa,OAAO;IAAgB,KAAK;IAAgB,SAAS;;;;YAMxD;;EAEV;;EAEA;EACA,UAAU;EACV,MAAM;EACN,OAAO;EACP,UAAU;;;;;EAKV"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//#region ../../packages/grimoire/src/contracts/written.ts
|
|
2
|
+
/** The fixed case questions every flow answers (in `## Cases` or `## Not handled`). */
|
|
3
|
+
const CASE_QUESTIONS = [
|
|
4
|
+
"invalid input",
|
|
5
|
+
"not allowed",
|
|
6
|
+
"not found",
|
|
7
|
+
"duplicate",
|
|
8
|
+
"limits",
|
|
9
|
+
"expiry",
|
|
10
|
+
"double submit",
|
|
11
|
+
"outside service down"
|
|
12
|
+
];
|
|
13
|
+
/** Markers around the list Warlock writes into a release file. */
|
|
14
|
+
const COLLECTED_START_MARKER = "<!-- grimoire:collected:start -->";
|
|
15
|
+
const COLLECTED_END_MARKER = "<!-- grimoire:collected:end -->";
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
export { CASE_QUESTIONS, COLLECTED_END_MARKER, COLLECTED_START_MARKER };
|
|
19
|
+
//# sourceMappingURL=written.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"written.mjs","names":[],"sources":["../../../../../../../../packages/grimoire/src/contracts/written.ts"],"sourcesContent":["/**\n * The agent-written files under `grimoire/`, as the parser (`parseGrimoire`)\n * returns them. Warlock reads these files and never edits them, except the\n * collected list between the markers of a release file.\n *\n * Every value that a check may point at carries its location. Absent\n * optional values are `null`, never `undefined`.\n *\n * The grammar of each file is fixed (see the docs page \"Written files\"):\n * front matter between `---` lines (`key: value`, inline lists `[a, b]` or\n * `- item` lines under the key), then Markdown with fixed headings.\n */\nimport type { Located, SourceLocation } from \"./location\";\n\n/** Status of a feature or a flow. */\nexport type WrittenStatus = \"proposed\" | \"building\" | \"shipped\" | \"retired\";\n\n/** Whether the description was written from the code (`inferred`) or confirmed by the owner. */\nexport type WrittenOrigin = \"inferred\" | \"confirmed\";\n\n/** A feature version: `<whole>.<decimal>` (`2.1`). */\nexport type FeatureVersion = string;\n\n/** A flow reference: `<feature>/<flow>`. */\nexport type FlowRef = string;\n\n/** A criterion id: `AC-<n>`. */\nexport type CriterionId = string;\n\n/** One `- name text` line of a list section. */\nexport type WrittenListLine = {\n /** The first word or phrase (a flow id, an app id, a condition name, a question). */\n name: string;\n /** The rest of the line, continuation lines joined with a space. */\n text: string;\n at: SourceLocation;\n};\n\n// ── Features ───────────────────────────────────────────────────────────────\n\n/** `grimoire/features/<id>/README.md`. */\nexport type WrittenFeatureReadme = {\n file: string;\n /** Front matter `id`; must equal the folder name. */\n id: Located<string>;\n title: Located<string>;\n status: Located<WrittenStatus>;\n version: Located<FeatureVersion>;\n /** `yyyy-mm-dd`. */\n updated: Located<string>;\n /** App ids under `grimoire/apps/`. */\n apps: Located<string>[];\n /** Project-relative folders whose files the feature owns; an entry with a code-file extension names one file. */\n folders: Located<string>[];\n origin: Located<WrittenOrigin> | null;\n /** The `# Heading`. */\n heading: Located<string> | null;\n /** The paragraph under the heading, or `null`. */\n summary: string | null;\n /** `## Flows`: `- <flow-id> <what it does>`. */\n flows: WrittenListLine[];\n /** `## Affects and affected by`: free lines; references `<feature>/<flow>` are read from them. */\n relations: { text: string; refs: FlowRef[]; at: SourceLocation }[];\n};\n\n/** A changed-word of a changelog entry. */\nexport type ChangeWord = \"added\" | \"changed\" | \"fixed\" | \"removed\";\n\n/**\n * One changelog entry:\n * `- <version> <word> [<flow>: ]<text>[ (AC-n[, AC-m])]`, continuation\n * lines indented.\n */\nexport type WrittenChangelogEntry = {\n feature: string;\n version: Located<FeatureVersion>;\n word: ChangeWord;\n /** The flow id named before `:`, or `null`. */\n flow: string | null;\n /** Criteria named in the trailing parentheses. */\n criteria: CriterionId[];\n /** The text without the flow prefix and the criteria. */\n text: string;\n /** `null` while under `## Unreleased`; the section's release once the agent moved it. */\n release: string | null;\n /** `yyyy-mm-dd` of the release section, or `null`. */\n date: string | null;\n at: SourceLocation;\n};\n\n/**\n * A changelog section: `## Unreleased`, or `## <release> (<yyyy-mm-dd>)`\n * for a release the agent stamped.\n */\nexport type WrittenChangelogSection = {\n release: string | null;\n date: string | null;\n at: SourceLocation;\n};\n\n/** `grimoire/features/<id>/CHANGELOG.md`, newest first. */\nexport type WrittenChangelog = {\n file: string;\n sections: WrittenChangelogSection[];\n entries: WrittenChangelogEntry[];\n};\n\n/** Flow step kinds. `affects` names an effect on another feature. */\nexport type StepType =\n | \"page\"\n | \"route\"\n | \"mail\"\n | \"notification\"\n | \"job\"\n | \"event\"\n | \"outside service\"\n | \"affects\";\n\n/** One `<n>. <kind> <target>[ — note]` line of `## Steps`. */\nexport type WrittenStep = {\n /** The number written before the dot. */\n index: number;\n type: StepType;\n /** The name as written (`POST /wishlist`, `/products/:id`, `order-confirmation`, `catalog/stock`). */\n target: string;\n /**\n * For a page step written `/support [web-admin]`: the app the page is in\n * (the target is then the path alone). `null` for every other step.\n */\n app: string | null;\n /** For a route step: the uppercase method and the path. */\n route: { method: string; path: string } | null;\n /** For an affects step: the feature and, when given, the flow. */\n affects: { feature: string; flow: string | null } | null;\n /** Text after ` — ` (or ` -- `), or `null`. */\n note: string | null;\n at: SourceLocation;\n};\n\n/** The fixed case questions every flow answers (in `## Cases` or `## Not handled`). */\nexport const CASE_QUESTIONS = [\n \"invalid input\",\n \"not allowed\",\n \"not found\",\n \"duplicate\",\n \"limits\",\n \"expiry\",\n \"double submit\",\n \"outside service down\",\n] as const;\n\n/** One fixed case question. */\nexport type CaseQuestion = (typeof CASE_QUESTIONS)[number];\n\n/** One `- <question> <answer>` line of `## Cases`. */\nexport type WrittenCase = {\n /** The question, lower-case (`double submit`), or the owner's own case label. */\n question: string;\n /** Whether `question` is one of {@link CASE_QUESTIONS}. */\n fixed: boolean;\n answer: string;\n /** The answer starts with `does not apply`. */\n doesNotApply: boolean;\n at: SourceLocation;\n};\n\n/** One `- AC-<n>[ [app-id]] <text>` line of `## Acceptance criteria`. */\nexport type WrittenCriterion = {\n id: CriterionId;\n number: number;\n /** The app the criterion is scoped to, or `null` for every app. */\n app: string | null;\n text: string;\n at: SourceLocation;\n};\n\n/** `grimoire/features/<feature>/flows/<id>.md`. */\nexport type WrittenFlow = {\n file: string;\n feature: string;\n /** Front matter `id`; must equal the file name without `.md`. */\n id: Located<string>;\n /** `<feature>/<id>`. */\n ref: FlowRef;\n /** The feature version that introduced the flow. */\n since: Located<FeatureVersion>;\n status: Located<WrittenStatus>;\n /** Who walks the flow (`customer`, `guest`, `admin`, `system`). Free text. */\n who: Located<string>;\n origin: Located<WrittenOrigin> | null;\n heading: Located<string> | null;\n steps: WrittenStep[];\n /** `## Differs by app`: `- <app-id> <what differs>`. */\n differs: WrittenListLine[];\n cases: WrittenCase[];\n /** `## Not handled`: questions the code does not handle yet. */\n notHandled: WrittenListLine[];\n /** Every line starting with `Unknown:` anywhere in the flow. */\n unknowns: { text: string; at: SourceLocation }[];\n criteria: WrittenCriterion[];\n};\n\n/** `grimoire/features/<feature>/versions/v<n>.md`: the brief before a whole-number version. */\nexport type WrittenVersionBrief = {\n file: string;\n feature: string;\n /** The whole number from the file name (`3` for `v3.md`). */\n major: number;\n heading: Located<string> | null;\n};\n\n/** One feature folder. */\nexport type WrittenFeature = {\n id: string;\n /** `grimoire/features/<id>`. */\n dir: string;\n /** `null` when the folder has no README (a structure error). */\n readme: WrittenFeatureReadme | null;\n changelog: WrittenChangelog | null;\n flows: WrittenFlow[];\n versions: WrittenVersionBrief[];\n};\n\n// ── Apps ───────────────────────────────────────────────────────────────────\n\n/** Who sees a block: `everyone`, or condition names of the app. */\nexport type WrittenWho = {\n everyone: boolean;\n conditions: string[];\n};\n\n/** One `Changes with` item: `<condition>: <text>`, or free text with no condition. */\nexport type WrittenChangesWith = {\n condition: string | null;\n text: string;\n};\n\n/** One row of a `## Blocks` table: `| Block | Flow | Who sees it | Changes with |`. */\nexport type WrittenBlockRow = {\n block: string;\n /** `<feature>/<flow>`, or `null` for `—`. */\n flow: FlowRef | null;\n who: WrittenWho;\n /** Empty for `—`. Items are separated by `;`. */\n changesWith: WrittenChangesWith[];\n at: SourceLocation;\n};\n\n/** `grimoire/apps/<app>/layouts/<id>.md`. */\nexport type WrittenLayout = {\n file: string;\n app: string;\n /** The file name without `.md`. */\n id: string;\n /** Front matter `origin`, when given. */\n origin: Located<WrittenOrigin> | null;\n heading: Located<string> | null;\n blocks: WrittenBlockRow[];\n};\n\n/** `grimoire/apps/<app>/pages/<page>/blocks/<id>.md`. */\nexport type WrittenBlockFile = {\n file: string;\n app: string;\n /** The page or screen folder name. */\n page: string;\n id: string;\n flow: Located<FlowRef> | null;\n heading: Located<string> | null;\n /** `- <key> <value>` lines. */\n details: WrittenListLine[];\n};\n\n/** One `- <kind> <name>` line of `## Also reached from`. */\nexport type WrittenEntryPoint = {\n /** `mail`, `notification`, `page`, `screen`, `outside service`, or another word. */\n type: string;\n name: string;\n at: SourceLocation;\n};\n\n/**\n * `grimoire/apps/<app>/pages/<id>/README.md` (a site page) or\n * `grimoire/apps/<app>/screens/<id>/README.md` (a mobile screen).\n */\nexport type WrittenPage = {\n file: string;\n app: string;\n type: \"page\" | \"screen\";\n /** The folder name. */\n id: string;\n /** Front matter `route`: the page's route path, or a screen's file-based route. */\n route: Located<string> | null;\n /** Front matter `screen`: the screen name used by code-defined navigation. */\n screen: Located<string> | null;\n /** Front matter `layout`: a file in the app's `layouts/`. */\n layout: Located<string> | null;\n /** Front matter `origin`, when given. */\n origin: Located<WrittenOrigin> | null;\n heading: Located<string> | null;\n /** The paragraph under the heading, or `null`. */\n purpose: string | null;\n blocks: WrittenBlockRow[];\n alsoReachedFrom: WrittenEntryPoint[];\n blockFiles: WrittenBlockFile[];\n};\n\n/** `grimoire/apps/<id>/README.md` and everything under that folder. */\nexport type WrittenApp = {\n /** `grimoire/apps/<id>`. */\n dir: string;\n /** `README.md`, or `null` when missing (a structure error). */\n file: string | null;\n /** Front matter `id`; must equal the folder name. */\n id: Located<string>;\n type: Located<\"site\" | \"mobile\">;\n /** Project-relative root of the site or mobile app (`src/web/$sites/client`, `mobile`). */\n root: Located<string>;\n /** Front matter `origin`, when given. */\n origin: Located<WrittenOrigin> | null;\n heading: Located<string> | null;\n /** `## Conditions`: `- <name> <meaning>`. */\n conditions: WrittenListLine[];\n layouts: WrittenLayout[];\n pages: WrittenPage[];\n screens: WrittenPage[];\n};\n\n// ── Tasks ──────────────────────────────────────────────────────────────────\n\nexport type TaskType = \"bug\" | \"feature\" | \"decision\" | \"chore\";\n\nexport type TaskStatus =\n | \"open\"\n | \"waiting for approval\"\n | \"approved\"\n | \"in progress\"\n | \"blocked\"\n | \"done\"\n | \"dropped\";\n\n/**\n * `grimoire/tasks/open/T-<n>-<slug>.md` or\n * `grimoire/tasks/done/<yyyy-mm>/T-<n>-<slug>.md`.\n */\nexport type WrittenTask = {\n file: string;\n /** Which folder holds it. */\n folder: \"open\" | \"done\";\n /** `yyyy-mm` of the done folder, or `null` for open tasks. */\n month: string | null;\n /** `T-<n>`. */\n id: Located<string>;\n type: Located<TaskType>;\n feature: Located<string> | null;\n /** Flow id within `feature`, or a full `<feature>/<flow>`; stored as written. */\n flow: Located<string> | null;\n apps: Located<string>[];\n status: Located<TaskStatus>;\n /** `shipped: <feature> <version>`, once done. */\n shipped: Located<{ feature: string; version: FeatureVersion }> | null;\n heading: Located<string> | null;\n /** `- <Key>: <value>` lines of the body (`Asked by`, `Why`, `Brief`, `Decision needed`, …). */\n fields: { key: string; value: string; at: SourceLocation }[];\n /** The `Decision needed` value, or `null`. */\n decisionNeeded: string | null;\n};\n\n// ── Releases ───────────────────────────────────────────────────────────────\n\n/** Markers around the list Warlock writes into a release file. */\nexport const COLLECTED_START_MARKER = \"<!-- grimoire:collected:start -->\";\nexport const COLLECTED_END_MARKER = \"<!-- grimoire:collected:end -->\";\n\n/** One line of a release file's collected list, read back. */\nexport type WrittenReleaseListed = {\n feature: string;\n version: FeatureVersion;\n word: ChangeWord;\n flow: string | null;\n criteria: CriterionId[];\n text: string;\n at: SourceLocation;\n};\n\n/** `grimoire/releases/<release>.md`. */\nexport type WrittenRelease = {\n file: string;\n /** Front matter `release`; must equal the file name without `.md`. */\n release: Located<string>;\n /** `yyyy-mm-dd`. */\n date: Located<string>;\n heading: Located<string> | null;\n /** The agent's brief: the text between the heading and the collected list. */\n brief: string;\n /** The list between the markers; `null` when the release command has not run yet. */\n collected: { start: SourceLocation; end: SourceLocation; entries: WrittenReleaseListed[] } | null;\n};\n\n// ── Everything ─────────────────────────────────────────────────────────────\n\n/** Every written file of a project, parsed. */\nexport type WrittenGrimoire = {\n /** Absolute project root. */\n root: string;\n /** `false` when the project has no `grimoire/` folder (book-only mode). */\n exists: boolean;\n features: WrittenFeature[];\n apps: WrittenApp[];\n tasks: WrittenTask[];\n releases: WrittenRelease[];\n /**\n * sha256 over the path and content of every written file, in path order.\n * The book manifest stores it to know when ownership and book maps change.\n */\n hash: string;\n};\n"],"mappings":";;AA4IA,MAAa,iBAAiB;CAC5B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;;AA8NA,MAAa,yBAAyB;AACtC,MAAa,uBAAuB"}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { isGrimoireCode } from "../codes/index.mjs";
|
|
2
|
+
import { checkGrimoire } from "../check/check-grimoire.mjs";
|
|
3
|
+
import "../check/index.mjs";
|
|
4
|
+
import { scry } from "../scry/query.mjs";
|
|
5
|
+
import "../scry/index.mjs";
|
|
6
|
+
import { featureGraph, fileGraph, moduleGraph, pageGraph } from "./graphs.mjs";
|
|
7
|
+
|
|
8
|
+
//#region ../../packages/grimoire/src/devtools/data.ts
|
|
9
|
+
/**
|
|
10
|
+
* The answers of the tab, as functions of the snapshot. The devtools routes
|
|
11
|
+
* and the static export both call them; questions about one item go to
|
|
12
|
+
* `scry()`, the rest read the snapshot directly.
|
|
13
|
+
*/
|
|
14
|
+
/** An error a route answers with a status (devtools turns `statusCode` into the response status). */
|
|
15
|
+
var GrimoirePanelError = class extends Error {
|
|
16
|
+
statusCode;
|
|
17
|
+
constructor(statusCode, message) {
|
|
18
|
+
super(message);
|
|
19
|
+
this.name = "GrimoirePanelError";
|
|
20
|
+
this.statusCode = statusCode;
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
/** `scry()` with its not-found codes turned into a 404 and the rest into a 400. */
|
|
24
|
+
function ask(snapshot, query) {
|
|
25
|
+
try {
|
|
26
|
+
return scry(snapshot, query);
|
|
27
|
+
} catch (error) {
|
|
28
|
+
const code = error.code;
|
|
29
|
+
if (typeof code === "string" && isGrimoireCode(code)) throw new GrimoirePanelError(code === "GR9006" ? 400 : 404, error.message);
|
|
30
|
+
throw error;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
function required(value, name) {
|
|
34
|
+
if (value === void 0 || value === "") throw new GrimoirePanelError(400, `Missing "${name}".`);
|
|
35
|
+
return value;
|
|
36
|
+
}
|
|
37
|
+
function summary(snapshot) {
|
|
38
|
+
const files = snapshot.book.facts.files;
|
|
39
|
+
const written = snapshot.written;
|
|
40
|
+
return {
|
|
41
|
+
routes: snapshot.routes,
|
|
42
|
+
features: snapshot.collected.featuresIndex,
|
|
43
|
+
tasks: snapshot.collected.tasksIndex,
|
|
44
|
+
counts: checkGrimoire(snapshot).counts,
|
|
45
|
+
written: [
|
|
46
|
+
written.features,
|
|
47
|
+
written.apps,
|
|
48
|
+
written.tasks,
|
|
49
|
+
written.releases
|
|
50
|
+
].some((items) => items.length > 0),
|
|
51
|
+
book: {
|
|
52
|
+
files: files.length,
|
|
53
|
+
modules: new Set(files.map((file) => file.module)).size,
|
|
54
|
+
builtAt: snapshot.book.manifest.builtAt
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
function search(snapshot, text, limit) {
|
|
59
|
+
return ask(snapshot, {
|
|
60
|
+
type: "search",
|
|
61
|
+
text,
|
|
62
|
+
...limit !== void 0 && Number.isFinite(limit) && limit > 0 ? { limit: Math.min(limit, 100) } : {}
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
function file(snapshot, path) {
|
|
66
|
+
return ask(snapshot, {
|
|
67
|
+
type: "file",
|
|
68
|
+
file: required(path, "path")
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
function impact(snapshot, path) {
|
|
72
|
+
return ask(snapshot, {
|
|
73
|
+
type: "impact",
|
|
74
|
+
file: required(path, "path")
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
function route(snapshot, method, path) {
|
|
78
|
+
return ask(snapshot, {
|
|
79
|
+
type: "route",
|
|
80
|
+
method: required(method, "method"),
|
|
81
|
+
path: required(path, "path")
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
function feature(snapshot, id) {
|
|
85
|
+
return ask(snapshot, {
|
|
86
|
+
type: "feature",
|
|
87
|
+
feature: required(id, "feature")
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
function flow(snapshot, featureId, flowId) {
|
|
91
|
+
return ask(snapshot, {
|
|
92
|
+
type: "flow",
|
|
93
|
+
feature: required(featureId, "feature"),
|
|
94
|
+
flow: required(flowId, "flow")
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
function apps(snapshot) {
|
|
98
|
+
return { apps: snapshot.written.apps.map((app) => ({
|
|
99
|
+
id: app.id.value,
|
|
100
|
+
type: app.type.value,
|
|
101
|
+
root: app.root.value,
|
|
102
|
+
pages: app.pages.map((page) => page.id),
|
|
103
|
+
screens: app.screens.map((screen) => screen.id)
|
|
104
|
+
})) };
|
|
105
|
+
}
|
|
106
|
+
function findApp(snapshot, id) {
|
|
107
|
+
const app = snapshot.written.apps.find((candidate) => candidate.id.value === id);
|
|
108
|
+
if (app === void 0) throw new GrimoirePanelError(404, `No app "${id ?? ""}" is written in grimoire/apps.`);
|
|
109
|
+
return app;
|
|
110
|
+
}
|
|
111
|
+
/** A page or screen by its id or its route. */
|
|
112
|
+
function findPage(app, key) {
|
|
113
|
+
return [...app.pages, ...app.screens].find((page) => page.id === key || page.route?.value === key || page.screen?.value === key);
|
|
114
|
+
}
|
|
115
|
+
function page(snapshot, appId, key) {
|
|
116
|
+
const app = findApp(snapshot, appId);
|
|
117
|
+
const written = findPage(app, required(key, "page"));
|
|
118
|
+
if (written === void 0) throw new GrimoirePanelError(404, `App "${app.id.value}" has no page or screen "${key ?? ""}".`);
|
|
119
|
+
const match = snapshot.apps[app.id.value];
|
|
120
|
+
const route = written.route?.value ?? written.screen?.value ?? null;
|
|
121
|
+
let book = null;
|
|
122
|
+
if (route !== null && match?.site) book = snapshot.book.facts.pages.find((candidate) => candidate.site === match.site?.id && candidate.route === route) ?? null;
|
|
123
|
+
else if (route !== null && match?.mobile) book = match.mobile.screens.find((screen) => screen.route === route) ?? null;
|
|
124
|
+
const layoutId = written.layout?.value ?? null;
|
|
125
|
+
return {
|
|
126
|
+
page: written,
|
|
127
|
+
layout: layoutId === null ? null : app.layouts.find((layout) => layout.id === layoutId) ?? null,
|
|
128
|
+
book
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
function tasks(snapshot) {
|
|
132
|
+
return snapshot.collected.tasksIndex;
|
|
133
|
+
}
|
|
134
|
+
function releases(snapshot) {
|
|
135
|
+
return { releases: snapshot.written.releases.map((release) => ({
|
|
136
|
+
release: release.release.value,
|
|
137
|
+
date: release.date.value,
|
|
138
|
+
file: release.file
|
|
139
|
+
})) };
|
|
140
|
+
}
|
|
141
|
+
function release(snapshot, id) {
|
|
142
|
+
const found = snapshot.written.releases.find((candidate) => candidate.release.value === id);
|
|
143
|
+
if (found === void 0) throw new GrimoirePanelError(404, `No release "${id ?? ""}" in grimoire/releases.`);
|
|
144
|
+
return found;
|
|
145
|
+
}
|
|
146
|
+
function check(snapshot) {
|
|
147
|
+
return checkGrimoire(snapshot);
|
|
148
|
+
}
|
|
149
|
+
function graphOrNotFound(graph, what) {
|
|
150
|
+
if (graph === null) throw new GrimoirePanelError(404, `${what} is not in the book.`);
|
|
151
|
+
return graph;
|
|
152
|
+
}
|
|
153
|
+
function graphOfFile(snapshot, path) {
|
|
154
|
+
const target = required(path, "path");
|
|
155
|
+
return graphOrNotFound(fileGraph(snapshot, target), `"${target}"`);
|
|
156
|
+
}
|
|
157
|
+
function graphOfFeature(snapshot, id) {
|
|
158
|
+
const target = required(id, "feature");
|
|
159
|
+
return graphOrNotFound(featureGraph(snapshot, target), `Feature "${target}"`);
|
|
160
|
+
}
|
|
161
|
+
function graphOfPage(snapshot, appId, key) {
|
|
162
|
+
const target = required(key, "page");
|
|
163
|
+
return graphOrNotFound(pageGraph(snapshot, required(appId, "app"), target), `Page "${target}"`);
|
|
164
|
+
}
|
|
165
|
+
function graphOfModules(snapshot) {
|
|
166
|
+
return moduleGraph(snapshot);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
//#endregion
|
|
170
|
+
export { GrimoirePanelError, apps, check, feature, file, findPage, flow, graphOfFeature, graphOfFile, graphOfModules, graphOfPage, impact, page, release, releases, route, search, summary, tasks };
|
|
171
|
+
//# sourceMappingURL=data.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data.mjs","names":[],"sources":["../../../../../../../../packages/grimoire/src/devtools/data.ts"],"sourcesContent":["/**\n * The answers of the tab, as functions of the snapshot. The devtools routes\n * and the static export both call them; questions about one item go to\n * `scry()`, the rest read the snapshot directly.\n */\nimport { isGrimoireCode } from \"../codes\";\nimport { checkGrimoire } from \"../check\";\nimport type { BookPage, BookScreen } from \"../contracts/adapter\";\nimport type { TasksIndex, FeaturesIndex } from \"../contracts/bookmap\";\nimport type { GrimoireCheckReport, RouteFreshness } from \"../contracts/findings\";\nimport type {\n ScryFeatureResult,\n ScryFileResult,\n ScryFlowResult,\n ScryImpactResult,\n ScryRouteResult,\n ScrySearchResult,\n} from \"../contracts/scry\";\nimport type { GrimoireSnapshot } from \"../contracts/snapshot\";\nimport type { WrittenApp, WrittenLayout, WrittenPage, WrittenRelease } from \"../contracts/written\";\nimport { scry } from \"../scry\";\nimport { featureGraph, fileGraph, moduleGraph, pageGraph, type GrimoireGraph } from \"./graphs\";\n\n/** An error a route answers with a status (devtools turns `statusCode` into the response status). */\nexport class GrimoirePanelError extends Error {\n public readonly statusCode: number;\n\n public constructor(statusCode: number, message: string) {\n super(message);\n this.name = \"GrimoirePanelError\";\n this.statusCode = statusCode;\n }\n}\n\nexport type GrimoireSummary = {\n routes: RouteFreshness;\n features: FeaturesIndex;\n tasks: TasksIndex;\n counts: GrimoireCheckReport[\"counts\"];\n /** Whether any feature, app, task or release is written, and how big the book is. */\n written: boolean;\n book: { files: number; modules: number; builtAt: string };\n};\n\nexport type GrimoireAppsAnswer = {\n apps: { id: string; type: string; root: string; pages: string[]; screens: string[] }[];\n};\n\nexport type GrimoirePageAnswer = {\n page: WrittenPage;\n layout: WrittenLayout | null;\n book: BookPage | BookScreen | null;\n};\n\nexport type GrimoireReleasesAnswer = {\n releases: { release: string; date: string; file: string }[];\n};\n\n/** `scry()` with its not-found codes turned into a 404 and the rest into a 400. */\nfunction ask<Result>(snapshot: GrimoireSnapshot, query: Parameters<typeof scry>[1]): Result {\n try {\n return scry(snapshot, query) as Result;\n } catch (error) {\n const code = (error as { code?: unknown }).code;\n\n if (typeof code === \"string\" && isGrimoireCode(code)) {\n throw new GrimoirePanelError(code === \"GR9006\" ? 400 : 404, (error as Error).message);\n }\n\n throw error;\n }\n}\n\nfunction required(value: string | undefined, name: string): string {\n if (value === undefined || value === \"\") throw new GrimoirePanelError(400, `Missing \"${name}\".`);\n\n return value;\n}\n\nexport function summary(snapshot: GrimoireSnapshot): GrimoireSummary {\n const files = snapshot.book.facts.files;\n const written = snapshot.written;\n\n return {\n routes: snapshot.routes,\n features: snapshot.collected.featuresIndex,\n tasks: snapshot.collected.tasksIndex,\n counts: checkGrimoire(snapshot).counts,\n written: [written.features, written.apps, written.tasks, written.releases].some(\n (items) => items.length > 0,\n ),\n book: {\n files: files.length,\n modules: new Set(files.map((file) => file.module)).size,\n builtAt: snapshot.book.manifest.builtAt,\n },\n };\n}\n\nexport function search(snapshot: GrimoireSnapshot, text: string, limit?: number): ScrySearchResult {\n return ask<ScrySearchResult>(snapshot, {\n type: \"search\",\n text,\n ...(limit !== undefined && Number.isFinite(limit) && limit > 0\n ? { limit: Math.min(limit, 100) }\n : {}),\n });\n}\n\nexport function file(snapshot: GrimoireSnapshot, path: string | undefined): ScryFileResult {\n return ask(snapshot, { type: \"file\", file: required(path, \"path\") });\n}\n\nexport function impact(snapshot: GrimoireSnapshot, path: string | undefined): ScryImpactResult {\n return ask(snapshot, { type: \"impact\", file: required(path, \"path\") });\n}\n\nexport function route(\n snapshot: GrimoireSnapshot,\n method: string | undefined,\n path: string | undefined,\n): ScryRouteResult {\n return ask(snapshot, {\n type: \"route\",\n method: required(method, \"method\"),\n path: required(path, \"path\"),\n });\n}\n\nexport function feature(snapshot: GrimoireSnapshot, id: string | undefined): ScryFeatureResult {\n return ask(snapshot, { type: \"feature\", feature: required(id, \"feature\") });\n}\n\nexport function flow(\n snapshot: GrimoireSnapshot,\n featureId: string | undefined,\n flowId: string | undefined,\n): ScryFlowResult {\n return ask(snapshot, {\n type: \"flow\",\n feature: required(featureId, \"feature\"),\n flow: required(flowId, \"flow\"),\n });\n}\n\nexport function apps(snapshot: GrimoireSnapshot): GrimoireAppsAnswer {\n return {\n apps: snapshot.written.apps.map((app) => ({\n id: app.id.value,\n type: app.type.value,\n root: app.root.value,\n pages: app.pages.map((page) => page.id),\n screens: app.screens.map((screen) => screen.id),\n })),\n };\n}\n\nfunction findApp(snapshot: GrimoireSnapshot, id: string | undefined): WrittenApp {\n const app = snapshot.written.apps.find((candidate) => candidate.id.value === id);\n\n if (app === undefined)\n throw new GrimoirePanelError(404, `No app \"${id ?? \"\"}\" is written in grimoire/apps.`);\n\n return app;\n}\n\n/** A page or screen by its id or its route. */\nexport function findPage(app: WrittenApp, key: string): WrittenPage | undefined {\n return [...app.pages, ...app.screens].find(\n (page) => page.id === key || page.route?.value === key || page.screen?.value === key,\n );\n}\n\nexport function page(\n snapshot: GrimoireSnapshot,\n appId: string | undefined,\n key: string | undefined,\n): GrimoirePageAnswer {\n const app = findApp(snapshot, appId);\n const written = findPage(app, required(key, \"page\"));\n\n if (written === undefined) {\n throw new GrimoirePanelError(\n 404,\n `App \"${app.id.value}\" has no page or screen \"${key ?? \"\"}\".`,\n );\n }\n\n const match = snapshot.apps[app.id.value];\n const route = written.route?.value ?? written.screen?.value ?? null;\n let book: BookPage | BookScreen | null = null;\n\n if (route !== null && match?.site) {\n book =\n snapshot.book.facts.pages.find(\n (candidate) => candidate.site === match.site?.id && candidate.route === route,\n ) ?? null;\n } else if (route !== null && match?.mobile) {\n book = match.mobile.screens.find((screen) => screen.route === route) ?? null;\n }\n\n const layoutId = written.layout?.value ?? null;\n\n return {\n page: written,\n layout:\n layoutId === null ? null : (app.layouts.find((layout) => layout.id === layoutId) ?? null),\n book,\n };\n}\n\nexport function tasks(snapshot: GrimoireSnapshot): TasksIndex {\n return snapshot.collected.tasksIndex;\n}\n\nexport function releases(snapshot: GrimoireSnapshot): GrimoireReleasesAnswer {\n return {\n releases: snapshot.written.releases.map((release) => ({\n release: release.release.value,\n date: release.date.value,\n file: release.file,\n })),\n };\n}\n\nexport function release(snapshot: GrimoireSnapshot, id: string | undefined): WrittenRelease {\n const found = snapshot.written.releases.find((candidate) => candidate.release.value === id);\n\n if (found === undefined)\n throw new GrimoirePanelError(404, `No release \"${id ?? \"\"}\" in grimoire/releases.`);\n\n return found;\n}\n\nexport function check(snapshot: GrimoireSnapshot): GrimoireCheckReport {\n return checkGrimoire(snapshot);\n}\n\nfunction graphOrNotFound(graph: GrimoireGraph | null, what: string): GrimoireGraph {\n if (graph === null) throw new GrimoirePanelError(404, `${what} is not in the book.`);\n\n return graph;\n}\n\nexport function graphOfFile(snapshot: GrimoireSnapshot, path: string | undefined): GrimoireGraph {\n const target = required(path, \"path\");\n\n return graphOrNotFound(fileGraph(snapshot, target), `\"${target}\"`);\n}\n\nexport function graphOfFeature(snapshot: GrimoireSnapshot, id: string | undefined): GrimoireGraph {\n const target = required(id, \"feature\");\n\n return graphOrNotFound(featureGraph(snapshot, target), `Feature \"${target}\"`);\n}\n\nexport function graphOfPage(\n snapshot: GrimoireSnapshot,\n appId: string | undefined,\n key: string | undefined,\n): GrimoireGraph {\n const target = required(key, \"page\");\n\n return graphOrNotFound(pageGraph(snapshot, required(appId, \"app\"), target), `Page \"${target}\"`);\n}\n\nexport function graphOfModules(snapshot: GrimoireSnapshot): GrimoireGraph {\n return moduleGraph(snapshot);\n}\n"],"mappings":";;;;;;;;;;;;;;AAwBA,IAAa,qBAAb,cAAwC,MAAM;CAC5C,AAAgB;CAEhB,AAAO,YAAY,YAAoB,SAAiB;EACtD,MAAM,OAAO;EACb,KAAK,OAAO;EACZ,KAAK,aAAa;CACpB;AACF;;AA2BA,SAAS,IAAY,UAA4B,OAA2C;CAC1F,IAAI;EACF,OAAO,KAAK,UAAU,KAAK;CAC7B,SAAS,OAAO;EACd,MAAM,OAAQ,MAA6B;EAE3C,IAAI,OAAO,SAAS,YAAY,eAAe,IAAI,GACjD,MAAM,IAAI,mBAAmB,SAAS,WAAW,MAAM,KAAM,MAAgB,OAAO;EAGtF,MAAM;CACR;AACF;AAEA,SAAS,SAAS,OAA2B,MAAsB;CACjE,IAAI,UAAU,UAAa,UAAU,IAAI,MAAM,IAAI,mBAAmB,KAAK,YAAY,KAAK,GAAG;CAE/F,OAAO;AACT;AAEA,SAAgB,QAAQ,UAA6C;CACnE,MAAM,QAAQ,SAAS,KAAK,MAAM;CAClC,MAAM,UAAU,SAAS;CAEzB,OAAO;EACL,QAAQ,SAAS;EACjB,UAAU,SAAS,UAAU;EAC7B,OAAO,SAAS,UAAU;EAC1B,QAAQ,cAAc,QAAQ,CAAC,CAAC;EAChC,SAAS;GAAC,QAAQ;GAAU,QAAQ;GAAM,QAAQ;GAAO,QAAQ;EAAQ,CAAC,CAAC,MACxE,UAA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