@warlock.js/grimoire 5.61.0 → 5.63.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 +28 -0
- package/esm/book/build.d.mts +17 -0
- package/esm/book/build.d.mts.map +1 -1
- package/esm/book/build.mjs +78 -16
- package/esm/book/build.mjs.map +1 -1
- package/esm/book/index.mjs +2 -2
- package/esm/codes/codes.d.mts +2 -0
- package/esm/codes/codes.d.mts.map +1 -1
- package/esm/codes/codes.mjs +2 -1
- package/esm/codes/codes.mjs.map +1 -1
- package/esm/contracts/book.d.mts +7 -0
- package/esm/contracts/book.d.mts.map +1 -1
- package/esm/contracts/book.mjs.map +1 -1
- package/esm/contracts/scry.d.mts +29 -5
- package/esm/contracts/scry.d.mts.map +1 -1
- package/esm/contracts/snapshot.d.mts +8 -0
- package/esm/contracts/snapshot.d.mts.map +1 -1
- package/esm/devtools/snapshot-source.mjs +27 -7
- package/esm/devtools/snapshot-source.mjs.map +1 -1
- package/esm/index.d.mts +5 -3
- package/esm/index.mjs +4 -2
- package/esm/scry/error.mjs +20 -0
- package/esm/scry/error.mjs.map +1 -0
- package/esm/scry/format.d.mts.map +1 -1
- package/esm/scry/format.mjs +22 -1
- package/esm/scry/format.mjs.map +1 -1
- package/esm/scry/index.mjs +3 -2
- package/esm/scry/parse.d.mts +1 -1
- package/esm/scry/parse.d.mts.map +1 -1
- package/esm/scry/parse.mjs +12 -9
- package/esm/scry/parse.mjs.map +1 -1
- package/esm/scry/query.d.mts.map +1 -1
- package/esm/scry/query.mjs +77 -268
- package/esm/scry/query.mjs.map +1 -1
- package/esm/scry/search.d.mts +8 -0
- package/esm/scry/search.d.mts.map +1 -0
- package/esm/scry/search.mjs +401 -0
- package/esm/scry/search.mjs.map +1 -0
- package/esm/warlock/actions.mjs +15 -12
- package/esm/warlock/actions.mjs.map +1 -1
- package/esm/warlock/commands.mjs +14 -4
- package/esm/warlock/commands.mjs.map +1 -1
- package/esm/warlock/mcp-tools.mjs +46 -21
- package/esm/warlock/mcp-tools.mjs.map +1 -1
- package/esm/workspace/cache.mjs +13 -1
- package/esm/workspace/cache.mjs.map +1 -1
- package/esm/workspace/derived.mjs +107 -0
- package/esm/workspace/derived.mjs.map +1 -0
- package/esm/workspace/index.d.mts.map +1 -1
- package/esm/workspace/index.mjs +22 -18
- package/esm/workspace/index.mjs.map +1 -1
- package/esm/workspace/stored.d.mts +12 -0
- package/esm/workspace/stored.d.mts.map +1 -0
- package/esm/workspace/stored.mjs +46 -0
- package/esm/workspace/stored.mjs.map +1 -0
- package/llms-full.txt +28 -12
- package/package.json +3 -3
- package/skills/use-the-grimoire/SKILL.md +28 -12
- package/ui/grimoire-view.js +16 -0
package/package.json
CHANGED
|
@@ -26,15 +26,15 @@
|
|
|
26
26
|
"environment": "server"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
|
-
"@warlock.js/core": "5.
|
|
30
|
-
"@warlock.js/web": "5.
|
|
29
|
+
"@warlock.js/core": "5.63.0",
|
|
30
|
+
"@warlock.js/web": "5.63.0"
|
|
31
31
|
},
|
|
32
32
|
"peerDependenciesMeta": {
|
|
33
33
|
"@warlock.js/web": {
|
|
34
34
|
"optional": true
|
|
35
35
|
}
|
|
36
36
|
},
|
|
37
|
-
"version": "5.
|
|
37
|
+
"version": "5.63.0",
|
|
38
38
|
"type": "module",
|
|
39
39
|
"main": "./esm/index.mjs",
|
|
40
40
|
"module": "./esm/index.mjs",
|
|
@@ -28,17 +28,21 @@ edits a file you wrote either.
|
|
|
28
28
|
|
|
29
29
|
1. Find the feature and flow the task is about.
|
|
30
30
|
|
|
31
|
+
Pass the whole task sentence (the commit title or the bug report), not two keywords:
|
|
32
|
+
|
|
31
33
|
```bash
|
|
32
|
-
npx warlock scry --search "new arrivals"
|
|
34
|
+
npx warlock scry --search "new arrivals are empty for customers with no country"
|
|
33
35
|
```
|
|
34
36
|
|
|
35
37
|
```text
|
|
36
|
-
flow catalog/new-arrivals
|
|
37
|
-
block web-client/home/new-arrivals
|
|
38
|
-
route GET /api/products/new-arrivals
|
|
39
|
-
|
|
38
|
+
21.4 flow catalog/new-arrivals New arrivals
|
|
39
|
+
12.9 block web-client/home/new-arrivals catalog/new-arrivals
|
|
40
|
+
11.3 route GET /api/products/new-arrivals catalog.new-arrivals
|
|
41
|
+
9.8 file src/app/catalog/services/new-arrivals.service.ts Lists the newest products sold in the customer's country.
|
|
40
42
|
```
|
|
41
43
|
|
|
44
|
+
The number in front is the score: hits are in score order, best first, whatever their type.
|
|
45
|
+
|
|
42
46
|
2. Read the feature's `README.md`, then the flow file. They say what the behaviour should be.
|
|
43
47
|
3. Ask for the flow's book map. It lists the files behind each step, the tests that prove each
|
|
44
48
|
criterion and the pages that show the flow.
|
|
@@ -55,13 +59,22 @@ edits a file you wrote either.
|
|
|
55
59
|
npx warlock scry src/app/catalog/services/new-arrivals.service.ts # what is this file?
|
|
56
60
|
npx warlock scry --impact src/app/catalog/models/product.model.ts # what breaks if I change it?
|
|
57
61
|
npx warlock scry --route "POST /api/orders" # what is behind this URL?
|
|
62
|
+
npx warlock scry --route "GET /chat" # a page URL works too (--site <id> picks one site)
|
|
58
63
|
npx warlock scry --feature catalog # the whole feature
|
|
59
64
|
npx warlock scry --flow catalog/new-arrivals # one flow, step by step
|
|
60
65
|
```
|
|
61
66
|
|
|
62
|
-
|
|
67
|
+
`scry` only reads the book the last `warlock grimoire build` left; it never rebuilds it. After you
|
|
68
|
+
finish editing files, run `npx warlock grimoire build`. When code, test or written files differ from
|
|
69
|
+
the book, the answer is the stored one and ends with
|
|
70
|
+
`note book is stale (12 files changed); run warlock grimoire build` (in `--json`, the `notes` list):
|
|
71
|
+
build, then ask again. A project with no book stops with `GR9007`. A note
|
|
72
|
+
`route facts look incomplete; run warlock grimoire build` means the stored routes are missing their source files
|
|
73
|
+
(an empty or partial route list): `--route` and `--impact` routes cannot be trusted until you build.
|
|
74
|
+
|
|
75
|
+
Add `--json` for machine-readable output; a failed call then prints `{ "type": "error", "code", "message", "fix" }` on stdout and exits 1 (the scry MCP tools return the same JSON as their error text). `--impact` lists API routes, pages, flows and features,
|
|
63
76
|
including features that only borrow the file; each list has a count and stops at 20 lines, and `--all`
|
|
64
|
-
prints every line. `--search` also reads a flow's summary, story, cases and criteria (`AC-5` works)
|
|
77
|
+
prints every line. `--search` takes the whole sentence (the commit title or the bug report, not two keywords): hits whose name or title holds the words come first, every other hit follows by score, and the list is printed in score order with the score in front. It also reads a flow's summary, story, cases and criteria (`AC-5` works); a hit found by written text shows the part that matched in brackets. Page, screen, block and file hits carry their app, and `--app <id>` keeps one app's hits. Read the flows it names and run their tests after
|
|
65
78
|
your change.
|
|
66
79
|
|
|
67
80
|
A file's entry is also at a fixed path: `src/app/auth/controllers/login.controller.ts` is described
|
|
@@ -71,7 +84,7 @@ in `grimoire/book/app/auth/controllers/login.controller.json`.
|
|
|
71
84
|
|
|
72
85
|
| Command | Does |
|
|
73
86
|
| ------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
|
|
74
|
-
| `warlock grimoire build` | Builds or refreshes the book.
|
|
87
|
+
| `warlock grimoire build` | Builds or refreshes the book (and its derived data). Run it after you finish editing; `scry` only reads and never builds |
|
|
75
88
|
| `warlock grimoire build --site [--out dir]` | Also writes the book as a static site (default `grimoire/book/site`); skipped when the folder is already current (`--force` writes it) |
|
|
76
89
|
| `warlock grimoire build --site --product` | Writes the business export: the Product map only, no file paths, test names or per-file answers |
|
|
77
90
|
| `warlock grimoire check` | Reports broken names, untested criteria, files with no owner. Exit 1 on an error; `--all` lists every warning |
|
|
@@ -85,7 +98,7 @@ that is still `proposed`; it does not fail the check.
|
|
|
85
98
|
|
|
86
99
|
- **Exports, imports, importers, routes, middleware, pages:** read from the code. Trust them.
|
|
87
100
|
- **Route middleware:** a route step also reaches the middleware files the matched route names (not the routes file's other imports). Roles that run by being present (migration, seed, command, main, layout, root) and spec-only helpers are not listed as unreached.
|
|
88
|
-
- **Dev tab route facts:** the dev tab reads routes, events and jobs from the running dev server (nothing is booted twice), so it shows `routes: fresh` on the first open
|
|
101
|
+
- **Dev tab route facts:** the dev tab reads routes, events and jobs from the running dev server (nothing is booted twice), so it shows `routes: fresh` on the first open, and reads them again after a routes file changes. `scry` and the MCP tools use the routes of the last `warlock grimoire build`.
|
|
89
102
|
- **Without route facts** (`routes: missing`): route, mail, notification, job and event steps are `found: null` (not checked), not resolved and not failed; `GR5008` skips mail and notification entries.
|
|
90
103
|
- **Files behind a route:** every file the handler can reach through imports. It is not the exact
|
|
91
104
|
call path; open the handler to see which ones it really uses.
|
|
@@ -97,8 +110,9 @@ that is still `proposed`; it does not fail the check.
|
|
|
97
110
|
|
|
98
111
|
- No flow matches the task: the behaviour is undescribed. Describe it first with
|
|
99
112
|
`write-a-feature`, then change the code.
|
|
100
|
-
- The command says the book is missing or stale
|
|
101
|
-
|
|
113
|
+
- The command says the book is missing (`GR9007`) or stale (`note book is stale …`): run
|
|
114
|
+
`npx warlock grimoire build`, then ask again. If the build reports problems, read them;
|
|
115
|
+
`npx warlock grimoire check` prints the same list.
|
|
102
116
|
- The project has code but no `grimoire/` folder: use `backfill-a-grimoire`.
|
|
103
117
|
|
|
104
118
|
## See also
|
|
@@ -114,8 +128,10 @@ From `@warlock.js/grimoire` (no dependency on core or web):
|
|
|
114
128
|
- `openGrimoire` loads everything once (it runs `parseGrimoire`, `buildBook`, `matchApps`,
|
|
115
129
|
`resolveOwnership`, `scanProofs`, `readTestResults`, `buildCollectedFiles`, then `writeBook`
|
|
116
130
|
and `writeCollectedFiles`), and returns a snapshot.
|
|
131
|
+
- `openStoredGrimoire(root, adapter)` is the read-only open behind `scry` (the stored snapshot, `behind` set when files moved; `GR9007` when never built) and `checkBook()` is `buildBook`'s change check with nothing rebuilt or written.
|
|
117
132
|
- `scry` answers a query from the snapshot; `formatScryResult` prints it; `parseScryQuery` reads
|
|
118
|
-
CLI arguments into a query.
|
|
133
|
+
CLI arguments into a query. `SCRY_STOP_WORDS` is the set of small words search leaves out (add to it
|
|
134
|
+
before the first search of a process).
|
|
119
135
|
- `checkGrimoire` runs every rule; `formatCheckReport` prints the report. Each finding has a code
|
|
120
136
|
from `GRIMOIRE_CODES` (also `GRIMOIRE_CODE_LIST`); `explainGrimoireCode`, `isGrimoireCode` and
|
|
121
137
|
`grimoireCodeDocsUrl` (based on `GRIMOIRE_CODES_DOCS_URL`) describe it, and rules build
|
package/ui/grimoire-view.js
CHANGED
|
@@ -3259,6 +3259,22 @@ async function routeView(ctx, method, path) {
|
|
|
3259
3259
|
);
|
|
3260
3260
|
const { el } = ctx;
|
|
3261
3261
|
const found = data.route;
|
|
3262
|
+
|
|
3263
|
+
// A page or screen URL: no API route, one entry per site that serves the path.
|
|
3264
|
+
if (found === null) {
|
|
3265
|
+
return el("div", { class: "grimoire-view" }, [
|
|
3266
|
+
crumbs(ctx, [["Modules", "modules"], [`${method} ${path}`]]),
|
|
3267
|
+
heading(ctx, `${method} ${path}`, [muted(ctx, "page")]),
|
|
3268
|
+
section(ctx, "Pages", [
|
|
3269
|
+
list(
|
|
3270
|
+
ctx,
|
|
3271
|
+
data.pages.map((page) => [`${page.app} ${page.route} `, fileLink(ctx, page.file)]),
|
|
3272
|
+
),
|
|
3273
|
+
]),
|
|
3274
|
+
section(ctx, "Files behind it", [fileChips(ctx, data.files, 20)]),
|
|
3275
|
+
]);
|
|
3276
|
+
}
|
|
3277
|
+
|
|
3262
3278
|
const out = el("div", { class: "grimoire-view" }, [
|
|
3263
3279
|
crumbs(ctx, [["Modules", "modules"], [`${found.method} ${found.path}`]]),
|
|
3264
3280
|
heading(ctx, `${found.method} ${found.path}`, [muted(ctx, found.description ?? found.handler)]),
|