@warlock.js/grimoire 5.57.0 → 5.59.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.
Files changed (123) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/esm/apps/check-apps.mjs +11 -5
  3. package/esm/apps/check-apps.mjs.map +1 -1
  4. package/esm/book/build.d.mts.map +1 -1
  5. package/esm/book/build.mjs +2 -1
  6. package/esm/book/build.mjs.map +1 -1
  7. package/esm/book/render.mjs +10 -0
  8. package/esm/book/render.mjs.map +1 -1
  9. package/esm/bookmap/build.d.mts.map +1 -1
  10. package/esm/bookmap/build.mjs +7 -5
  11. package/esm/bookmap/build.mjs.map +1 -1
  12. package/esm/bookmap/steps.mjs +85 -39
  13. package/esm/bookmap/steps.mjs.map +1 -1
  14. package/esm/check/check-grimoire.d.mts.map +1 -1
  15. package/esm/check/check-grimoire.mjs +4 -1
  16. package/esm/check/check-grimoire.mjs.map +1 -1
  17. package/esm/check/rules/criteria.mjs +21 -2
  18. package/esm/check/rules/criteria.mjs.map +1 -1
  19. package/esm/check/rules/screenshots.mjs +57 -0
  20. package/esm/check/rules/screenshots.mjs.map +1 -0
  21. package/esm/codes/codes.d.mts +12 -0
  22. package/esm/codes/codes.d.mts.map +1 -1
  23. package/esm/codes/codes.mjs +6 -0
  24. package/esm/codes/codes.mjs.map +1 -1
  25. package/esm/contracts/adapter.d.mts +28 -1
  26. package/esm/contracts/adapter.d.mts.map +1 -1
  27. package/esm/contracts/book.d.mts +2 -0
  28. package/esm/contracts/book.d.mts.map +1 -1
  29. package/esm/contracts/book.mjs.map +1 -1
  30. package/esm/contracts/bookmap.d.mts +19 -1
  31. package/esm/contracts/bookmap.d.mts.map +1 -1
  32. package/esm/contracts/scry.d.mts +26 -6
  33. package/esm/contracts/scry.d.mts.map +1 -1
  34. package/esm/contracts/snapshot.d.mts +14 -1
  35. package/esm/contracts/snapshot.d.mts.map +1 -1
  36. package/esm/contracts/test-results.d.mts +34 -0
  37. package/esm/contracts/test-results.d.mts.map +1 -1
  38. package/esm/contracts/written.d.mts +44 -0
  39. package/esm/contracts/written.d.mts.map +1 -1
  40. package/esm/contracts/written.mjs.map +1 -1
  41. package/esm/devtools/data.mjs +116 -5
  42. package/esm/devtools/data.mjs.map +1 -1
  43. package/esm/devtools/feature-map.mjs +149 -0
  44. package/esm/devtools/feature-map.mjs.map +1 -0
  45. package/esm/devtools/index.d.mts +28 -2
  46. package/esm/devtools/index.d.mts.map +1 -1
  47. package/esm/devtools/index.mjs +111 -7
  48. package/esm/devtools/index.mjs.map +1 -1
  49. package/esm/devtools/product-map.d.mts +14 -0
  50. package/esm/devtools/product-map.d.mts.map +1 -0
  51. package/esm/devtools/product-map.mjs +460 -0
  52. package/esm/devtools/product-map.mjs.map +1 -0
  53. package/esm/devtools/site.d.mts +43 -1
  54. package/esm/devtools/site.d.mts.map +1 -1
  55. package/esm/devtools/site.mjs +190 -22
  56. package/esm/devtools/site.mjs.map +1 -1
  57. package/esm/devtools/snapshot-source.mjs +24 -7
  58. package/esm/devtools/snapshot-source.mjs.map +1 -1
  59. package/esm/graph/index.d.mts +10 -1
  60. package/esm/graph/index.d.mts.map +1 -1
  61. package/esm/graph/index.mjs +3 -2
  62. package/esm/graph/index.mjs.map +1 -1
  63. package/esm/index.d.mts +5 -5
  64. package/esm/ownership/index.d.mts.map +1 -1
  65. package/esm/ownership/index.mjs +60 -1
  66. package/esm/ownership/index.mjs.map +1 -1
  67. package/esm/paths/index.d.mts +2 -0
  68. package/esm/paths/index.d.mts.map +1 -1
  69. package/esm/paths/index.mjs +3 -1
  70. package/esm/paths/index.mjs.map +1 -1
  71. package/esm/scry/compact.mjs +170 -0
  72. package/esm/scry/compact.mjs.map +1 -0
  73. package/esm/scry/format.d.mts.map +1 -1
  74. package/esm/scry/format.mjs +19 -2
  75. package/esm/scry/format.mjs.map +1 -1
  76. package/esm/scry/query.d.mts.map +1 -1
  77. package/esm/scry/query.mjs +159 -24
  78. package/esm/scry/query.mjs.map +1 -1
  79. package/esm/test-results/index.d.mts +7 -2
  80. package/esm/test-results/index.d.mts.map +1 -1
  81. package/esm/test-results/index.mjs +79 -12
  82. package/esm/test-results/index.mjs.map +1 -1
  83. package/esm/vitest/index.d.mts +6 -0
  84. package/esm/vitest/index.d.mts.map +1 -1
  85. package/esm/vitest/index.mjs +22 -6
  86. package/esm/vitest/index.mjs.map +1 -1
  87. package/esm/warlock/actions.mjs +15 -7
  88. package/esm/warlock/actions.mjs.map +1 -1
  89. package/esm/warlock/adapter.d.mts.map +1 -1
  90. package/esm/warlock/adapter.mjs +42 -4
  91. package/esm/warlock/adapter.mjs.map +1 -1
  92. package/esm/warlock/commands.mjs +7 -2
  93. package/esm/warlock/commands.mjs.map +1 -1
  94. package/esm/warlock/logo.mjs +12 -0
  95. package/esm/warlock/logo.mjs.map +1 -0
  96. package/esm/warlock/mcp-tools.mjs +51 -15
  97. package/esm/warlock/mcp-tools.mjs.map +1 -1
  98. package/esm/workspace/cache.mjs +194 -0
  99. package/esm/workspace/cache.mjs.map +1 -0
  100. package/esm/workspace/index.d.mts.map +1 -1
  101. package/esm/workspace/index.mjs +7 -3
  102. package/esm/workspace/index.mjs.map +1 -1
  103. package/esm/written/apps.mjs +4 -2
  104. package/esm/written/apps.mjs.map +1 -1
  105. package/esm/written/features.mjs +119 -6
  106. package/esm/written/features.mjs.map +1 -1
  107. package/esm/written/markdown.mjs +66 -1
  108. package/esm/written/markdown.mjs.map +1 -1
  109. package/esm/written/parse-grimoire.d.mts.map +1 -1
  110. package/esm/written/parse-grimoire.mjs +1 -1
  111. package/esm/written/parse-grimoire.mjs.map +1 -1
  112. package/llms-full.txt +108 -12
  113. package/package.json +3 -3
  114. package/skills/backfill-a-grimoire/SKILL.md +5 -0
  115. package/skills/describe-an-app/SKILL.md +12 -0
  116. package/skills/record-a-change/SKILL.md +10 -0
  117. package/skills/use-the-grimoire/SKILL.md +44 -10
  118. package/skills/write-a-feature/SKILL.md +37 -2
  119. package/ui/grimoire-static.js +61 -6
  120. package/ui/grimoire-view.js +2133 -316
  121. package/ui/grimoire.css +1030 -24
  122. package/ui/product-map.css +785 -0
  123. package/ui/product-map.js +1265 -0
@@ -1 +1 @@
1
- {"version":3,"file":"codes.mjs","names":[],"sources":["../../../../../../../../packages/grimoire/src/codes/codes.ts"],"sourcesContent":["/**\n * The catalog of stable Grimoire finding codes.\n *\n * THE SCHEME: `GR` followed by four digits. The first digit is the area:\n *\n * | Range | Area | Meaning |\n * | ------ | --------- | ----------------------------------------------------------- |\n * | GR1xxx | structure | a written file does not follow its fixed structure |\n * | GR2xxx | links | a written name points at something that does not exist |\n * | GR3xxx | files | source files: headers, owners, files no flow reaches |\n * | GR4xxx | tests | criteria, `@proves` lines and test results |\n * | GR5xxx | apps | sites, mobile apps, pages, screens and blocks |\n * | GR6xxx | changelog | feature versions, changelogs and releases |\n * | GR7xxx | tasks | task files |\n * | GR8xxx | book | building the book from the framework's facts |\n * | GR9xxx | usage | a command or query was asked something it cannot answer |\n *\n * STABILITY: a released code keeps its meaning. Titles and fixes may be\n * reworded; a code is never reused or renumbered.\n *\n * This module imports nothing, so any entry can use it.\n */\nimport type { GrimoireCodeDefinition } from \"../contracts/findings\";\n\nfunction define<const Code extends string>(\n code: Code,\n area: GrimoireCodeDefinition[\"area\"],\n severity: GrimoireCodeDefinition[\"severity\"],\n title: string,\n fix: string,\n skill: string,\n): GrimoireCodeDefinition & { readonly code: Code } {\n return { code, area, severity, title, fix, skill };\n}\n\nconst WRITE = \"write-a-feature\";\nconst RECORD = \"record-a-change\";\nconst APP = \"describe-an-app\";\nconst FILE = \"document-a-file\";\nconst USE = \"use-the-grimoire\";\n\n/** Every code, in order. */\nexport const GRIMOIRE_CODE_LIST = [\n // ── GR1xxx structure ─────────────────────────────────────────────────────\n define(\n \"GR1001\",\n \"structure\",\n \"error\",\n \"A written file has no front matter\",\n \"Start the file with the front matter block its template shows, between two `---` lines.\",\n WRITE,\n ),\n define(\n \"GR1002\",\n \"structure\",\n \"error\",\n \"The front matter cannot be read\",\n \"Write one `key: value` per line; lists as `[a, b]` or as `- item` lines under the key; close the block with `---`.\",\n WRITE,\n ),\n define(\n \"GR1003\",\n \"structure\",\n \"error\",\n \"A required front matter key is missing\",\n \"Add the key named in the message; the template of that file lists every required key.\",\n WRITE,\n ),\n define(\n \"GR1004\",\n \"structure\",\n \"error\",\n \"A front matter value has the wrong form\",\n \"Use the form the message names: dates as yyyy-mm-dd, versions as 2.1, ids in lower-case-with-dashes, a status from the list (a task status is open, waiting for approval, approved, in progress, blocked, done or dropped; a question for the owner is waiting for approval).\",\n WRITE,\n ),\n define(\n \"GR1005\",\n \"structure\",\n \"warning\",\n \"A front matter key is not part of the template\",\n \"Remove the key, or move what it says into the body of the file.\",\n WRITE,\n ),\n define(\n \"GR1006\",\n \"structure\",\n \"error\",\n \"A required heading is missing\",\n \"Add the heading named in the message, spelled as in the template.\",\n WRITE,\n ),\n define(\n \"GR1007\",\n \"structure\",\n \"warning\",\n \"A heading is not part of the template\",\n \"Use the template's headings; put the text under one of them or remove it.\",\n WRITE,\n ),\n define(\n \"GR1008\",\n \"structure\",\n \"error\",\n \"A step line has the wrong form\",\n \"Write steps as `1. route POST /wishlist`: a number, a kind, then the name used in code.\",\n WRITE,\n ),\n define(\n \"GR1009\",\n \"structure\",\n \"error\",\n \"A step names an unknown kind\",\n \"Use one of: page, route, mail, notification, job, event, outside service, affects.\",\n WRITE,\n ),\n define(\n \"GR1010\",\n \"structure\",\n \"error\",\n \"Steps are not numbered 1, 2, 3 in order\",\n \"Number the steps from 1 without gaps, in the order a user meets them.\",\n WRITE,\n ),\n define(\n \"GR1011\",\n \"structure\",\n \"error\",\n \"A case line has the wrong form\",\n \"Write cases as `- double submit two taps save once`: the question, spaces, then the answer.\",\n WRITE,\n ),\n define(\n \"GR1012\",\n \"structure\",\n \"warning\",\n \"A case question is not answered\",\n \"Answer the question under Cases (or `does not apply` and why), or list it under Not handled.\",\n WRITE,\n ),\n define(\n \"GR1013\",\n \"structure\",\n \"error\",\n \"A criterion line has the wrong form\",\n \"Write criteria as `- AC-3 a guest is sent to sign in`, optionally `- AC-4 [mobile] …`.\",\n WRITE,\n ),\n define(\n \"GR1014\",\n \"structure\",\n \"error\",\n \"A criterion id is used twice in one flow\",\n \"Give the new criterion the next free number. Never renumber existing criteria.\",\n WRITE,\n ),\n define(\n \"GR1015\",\n \"structure\",\n \"error\",\n \"A changelog line has the wrong form\",\n \"Write entries as `- 2.1 fixed new-arrivals: what changed (AC-2)`.\",\n RECORD,\n ),\n define(\n \"GR1016\",\n \"structure\",\n \"error\",\n \"A changelog entry uses an unknown word\",\n \"Use one of: added, changed, fixed, removed.\",\n RECORD,\n ),\n define(\n \"GR1017\",\n \"structure\",\n \"error\",\n \"A changelog heading has the wrong form\",\n \"Use `## Unreleased`, or `## <release> (<yyyy-mm-dd>)` for entries of a release.\",\n RECORD,\n ),\n define(\n \"GR1018\",\n \"structure\",\n \"error\",\n \"A blocks table has the wrong form\",\n \"Use the columns Block, Flow, Who sees it, Changes with; one row per part of the page.\",\n APP,\n ),\n define(\n \"GR1019\",\n \"structure\",\n \"error\",\n \"An id does not match its folder or file name\",\n \"Make the front matter `id` (or `release`) equal the folder or file name.\",\n WRITE,\n ),\n define(\n \"GR1020\",\n \"structure\",\n \"warning\",\n \"A file in the grimoire folder is not part of the layout\",\n \"Move the file to where the layout expects it, or remove it.\",\n USE,\n ),\n define(\n \"GR1021\",\n \"structure\",\n \"error\",\n \"A feature, app, page or screen folder has no README.md\",\n \"Add README.md with the front matter of its template.\",\n WRITE,\n ),\n define(\n \"GR1022\",\n \"structure\",\n \"error\",\n \"Two files use the same id\",\n \"Give each feature, app or task its own id.\",\n WRITE,\n ),\n define(\n \"GR1023\",\n \"structure\",\n \"error\",\n \"A task file is misnamed or misplaced\",\n \"Name tasks `T-<n>-<slug>.md`, in `tasks/open/` or `tasks/done/<yyyy-mm>/`.\",\n RECORD,\n ),\n define(\n \"GR1024\",\n \"structure\",\n \"error\",\n \"The collected-list markers of a release file are broken\",\n \"Keep the start and end markers in pairs, or remove both and run `warlock grimoire release` again.\",\n RECORD,\n ),\n define(\n \"GR1025\",\n \"structure\",\n \"error\",\n \"A written file cannot be read\",\n \"Save the file as UTF-8 text.\",\n USE,\n ),\n define(\n \"GR1026\",\n \"structure\",\n \"error\",\n \"The feature README lists a flow that has no file\",\n \"Add `flows/<flow>.md`, or remove the flow from the README's Flows list.\",\n WRITE,\n ),\n define(\n \"GR1027\",\n \"structure\",\n \"warning\",\n \"A flow file is not listed in the feature README\",\n \"Add the flow to the README's Flows list.\",\n WRITE,\n ),\n define(\n \"GR1028\",\n \"structure\",\n \"error\",\n \"A list line has the wrong form\",\n \"Write list lines as `- name text`: the name, spaces, then the text.\",\n WRITE,\n ),\n\n // ── GR2xxx links ─────────────────────────────────────────────────────────\n define(\n \"GR2001\",\n \"links\",\n \"error\",\n \"A route step names a route that does not exist\",\n \"Fix the method and path in the flow, or add the route in code.\",\n RECORD,\n ),\n define(\n \"GR2002\",\n \"links\",\n \"error\",\n \"A page step names a page that does not exist\",\n \"Fix the route path in the flow, or add the page to one of the feature's apps. A step scoped like `page /support [web-admin]` looks only in that app.\",\n RECORD,\n ),\n define(\n \"GR2003\",\n \"links\",\n \"error\",\n \"A mail step names a mail that does not exist\",\n \"Use the mail's name as code defines it, or add the mail.\",\n RECORD,\n ),\n define(\n \"GR2004\",\n \"links\",\n \"error\",\n \"A notification step names a notification that does not exist\",\n \"Use the notification's name as code defines it, or add it.\",\n RECORD,\n ),\n define(\n \"GR2005\",\n \"links\",\n \"error\",\n \"A job step names a job that does not exist\",\n \"Use the job's name as code defines it, or add the job.\",\n RECORD,\n ),\n define(\n \"GR2006\",\n \"links\",\n \"error\",\n \"An event step names an event that does not exist\",\n \"Use the event's name as code emits it, or add the event.\",\n RECORD,\n ),\n define(\n \"GR2007\",\n \"links\",\n \"error\",\n \"An affects step names a feature or flow that does not exist\",\n \"Write `affects <feature>/<flow>` with an existing feature and flow.\",\n WRITE,\n ),\n define(\n \"GR2008\",\n \"links\",\n \"error\",\n \"A name refers to an app with no folder\",\n \"Add `grimoire/apps/<app>/README.md`, or fix the app id.\",\n APP,\n ),\n define(\n \"GR2009\",\n \"links\",\n \"warning\",\n \"A flow names an app its feature does not list\",\n \"Add the app to the feature's `apps`, or fix the app id in Differs by app or the criterion.\",\n WRITE,\n ),\n define(\n \"GR2010\",\n \"links\",\n \"error\",\n \"A changelog entry names a flow that does not exist\",\n \"Fix the flow id before the `:`, or add the flow.\",\n RECORD,\n ),\n define(\n \"GR2011\",\n \"links\",\n \"error\",\n \"A changelog entry names a criterion the flow does not have\",\n \"Fix the criterion id, or add the criterion to the flow.\",\n RECORD,\n ),\n define(\n \"GR2012\",\n \"links\",\n \"error\",\n \"A README relation names a flow that does not exist\",\n \"Fix the `<feature>/<flow>` reference in Affects and affected by.\",\n WRITE,\n ),\n\n // ── GR3xxx files ─────────────────────────────────────────────────────────\n define(\n \"GR3001\",\n \"files\",\n \"warning\",\n \"A source file has no header sentence\",\n \"Start the file with a one-sentence comment saying why it exists.\",\n FILE,\n ),\n define(\n \"GR3002\",\n \"files\",\n \"warning\",\n \"A source file belongs to no feature\",\n \"Add its folder to a feature's `folders`, or tag it `@feature <id>` in its header.\",\n FILE,\n ),\n define(\n \"GR3003\",\n \"files\",\n \"error\",\n \"A source file has two owners\",\n \"Keep one owner: remove the duplicate folder from one feature, or keep one `@feature` tag.\",\n FILE,\n ),\n define(\n \"GR3004\",\n \"files\",\n \"error\",\n \"A `@feature` tag names a feature that does not exist\",\n \"Fix the tag, or write the feature.\",\n FILE,\n ),\n define(\n \"GR3005\",\n \"files\",\n \"error\",\n \"A feature's `folders` entry does not exist\",\n \"Fix the folder or file path, or remove it from `folders`.\",\n WRITE,\n ),\n define(\n \"GR3006\",\n \"files\",\n \"warning\",\n \"A file in a feature's folders is reached by no flow\",\n \"Describe the behaviour in a flow, or delete dead code.\",\n RECORD,\n ),\n\n // ── GR4xxx tests ─────────────────────────────────────────────────────────\n define(\n \"GR4001\",\n \"tests\",\n \"warning\",\n \"A criterion has no test\",\n \"Write a test with `// @proves <feature>/<flow> AC-<n>` above it, or say in the task why not.\",\n RECORD,\n ),\n define(\n \"GR4002\",\n \"tests\",\n \"error\",\n \"A `@proves` line names a flow or criterion that does not exist\",\n \"Fix the `@proves` line to name an existing `<feature>/<flow> AC-<n>`.\",\n RECORD,\n ),\n define(\n \"GR4003\",\n \"tests\",\n \"error\",\n \"A `@proves` line has the wrong form\",\n \"Write `// @proves <feature>/<flow> AC-<n>` on its own line.\",\n RECORD,\n ),\n define(\n \"GR4004\",\n \"tests\",\n \"error\",\n \"A `@proves` line is not directly above a test\",\n \"Move the line right above the `it(…)` or `test(…)` it describes.\",\n RECORD,\n ),\n define(\n \"GR4005\",\n \"tests\",\n \"warning\",\n \"One test proves two criteria\",\n \"Split the test so each proves one criterion.\",\n RECORD,\n ),\n define(\n \"GR4006\",\n \"tests\",\n \"error\",\n \"A test proving a criterion failed in its last run\",\n \"Fix the code or the test, then run the tests again.\",\n RECORD,\n ),\n define(\n \"GR4007\",\n \"tests\",\n \"warning\",\n \"A criterion's test result is older than the test file\",\n \"Run the tests again.\",\n RECORD,\n ),\n define(\n \"GR4008\",\n \"tests\",\n \"warning\",\n \"A criterion's test did not run in the last run\",\n \"Run the tests that prove the criterion.\",\n RECORD,\n ),\n\n // ── GR5xxx apps ──────────────────────────────────────────────────────────\n define(\n \"GR5001\",\n \"apps\",\n \"error\",\n \"A block points to a flow that does not exist\",\n \"Fix the `<feature>/<flow>` in the Flow column or the block file.\",\n APP,\n ),\n define(\n \"GR5002\",\n \"apps\",\n \"error\",\n \"A condition is not declared in the app README\",\n \"Add the condition under Conditions in the app README, or use a declared one.\",\n APP,\n ),\n define(\n \"GR5003\",\n \"apps\",\n \"error\",\n \"A page's route does not exist in its site\",\n \"Fix the `route` of the page file, or remove the page file if the page is gone.\",\n APP,\n ),\n define(\n \"GR5004\",\n \"apps\",\n \"error\",\n \"A page names a layout with no file\",\n \"Add `layouts/<layout>.md` to the app, or fix the page's `layout`.\",\n APP,\n ),\n define(\n \"GR5005\",\n \"apps\",\n \"error\",\n \"An app's root matches no site or mobile app\",\n \"Set `root` to the site folder (`src/web/$sites/<site>`) or the mobile app folder.\",\n APP,\n ),\n define(\n \"GR5006\",\n \"apps\",\n \"error\",\n \"A screen's route does not exist in the mobile app\",\n \"Fix the `route` of the screen file, or remove it if the screen is gone.\",\n APP,\n ),\n define(\n \"GR5007\",\n \"apps\",\n \"warning\",\n \"A block file has no row in its page's Blocks table\",\n \"Add the block to the page's Blocks table, or remove the block file.\",\n APP,\n ),\n define(\n \"GR5008\",\n \"apps\",\n \"error\",\n \"An entry point in Also reached from does not exist\",\n \"Fix the mail, notification or page name.\",\n APP,\n ),\n define(\n \"GR5009\",\n \"apps\",\n \"warning\",\n \"A site or mobile app has no folder in grimoire/apps\",\n \"Add `grimoire/apps/<app>/README.md` for it.\",\n APP,\n ),\n\n // ── GR6xxx changelog ─────────────────────────────────────────────────────\n define(\n \"GR6001\",\n \"changelog\",\n \"error\",\n \"A release lists a changelog entry that is not stamped with it\",\n \"Move the entry under `## <release> (<date>)` in the feature's CHANGELOG.md.\",\n RECORD,\n ),\n define(\n \"GR6002\",\n \"changelog\",\n \"error\",\n \"A changelog release section has no release file\",\n \"Write `grimoire/releases/<release>.md`, or fix the release in the heading.\",\n RECORD,\n ),\n define(\n \"GR6003\",\n \"changelog\",\n \"error\",\n \"A changelog release date differs from the release file\",\n \"Use the date in the release file's front matter.\",\n RECORD,\n ),\n define(\n \"GR6004\",\n \"changelog\",\n \"error\",\n \"The README `updated` is older than the newest changelog entry\",\n \"Reshape the README to describe the feature as it is now, and set `updated`.\",\n RECORD,\n ),\n define(\n \"GR6005\",\n \"changelog\",\n \"error\",\n \"The README `version` differs from the newest changelog entry\",\n \"Set `version` to the newest entry's version.\",\n RECORD,\n ),\n define(\n \"GR6006\",\n \"changelog\",\n \"warning\",\n \"A changelog word does not match its version step\",\n \"Use a whole-number version for added and removed, a decimal for changed and fixed.\",\n RECORD,\n ),\n define(\n \"GR6007\",\n \"changelog\",\n \"error\",\n \"A flow's `since` is newer than its feature's version\",\n \"Fix `since`, or the feature `version`.\",\n WRITE,\n ),\n define(\n \"GR6008\",\n \"changelog\",\n \"warning\",\n \"A new whole-number version has no brief\",\n \"Write `versions/v<n>.md` before building it.\",\n WRITE,\n ),\n\n // ── GR7xxx tasks ─────────────────────────────────────────────────────────\n define(\n \"GR7001\",\n \"tasks\",\n \"error\",\n \"A task names a feature that does not exist\",\n \"Fix the task's `feature`, or write the feature first.\",\n WRITE,\n ),\n define(\n \"GR7002\",\n \"tasks\",\n \"error\",\n \"A task names a flow that does not exist\",\n \"Fix the task's `flow`, or write the flow first.\",\n WRITE,\n ),\n define(\n \"GR7003\",\n \"tasks\",\n \"error\",\n \"A task's status does not match its folder\",\n \"Done tasks live in `tasks/done/<yyyy-mm>/` with `status: done` and `shipped`; open tasks in `tasks/open/`.\",\n RECORD,\n ),\n define(\n \"GR7004\",\n \"tasks\",\n \"error\",\n \"A task's `shipped` names a version the changelog does not have\",\n \"Fix `shipped: <feature> <version>`, or add the changelog entry.\",\n RECORD,\n ),\n define(\n \"GR7005\",\n \"tasks\",\n \"warning\",\n \"A task's brief does not exist\",\n \"Fix the `Brief:` path, or write the brief.\",\n WRITE,\n ),\n\n // ── GR8xxx book ──────────────────────────────────────────────────────────\n define(\n \"GR8001\",\n \"book\",\n \"error\",\n \"The project's source files could not be read\",\n \"Read the message; fix the file or folder it names, then build again.\",\n USE,\n ),\n define(\n \"GR8002\",\n \"book\",\n \"warning\",\n \"Route facts could not be read because the app did not boot\",\n \"Run `warlock doctor`, fix what stops the app from booting, then `warlock grimoire build`.\",\n USE,\n ),\n define(\n \"GR8003\",\n \"book\",\n \"warning\",\n \"Route facts are older than the routes files\",\n \"Run `warlock grimoire build` to refresh them.\",\n USE,\n ),\n define(\n \"GR8004\",\n \"book\",\n \"warning\",\n \"Pages or screens could not be read\",\n \"Read the message; fix the page file it names, then build again.\",\n USE,\n ),\n\n // ── GR9xxx usage ─────────────────────────────────────────────────────────\n define(\n \"GR9001\",\n \"usage\",\n \"error\",\n \"The file is not in the book\",\n \"Pass a code file under the source roots, as a project-relative path.\",\n USE,\n ),\n define(\n \"GR9002\",\n \"usage\",\n \"error\",\n \"No route matches\",\n 'Pass `\"<METHOD> <path>\"` as the route is registered; `warlock routes` lists them.',\n USE,\n ),\n define(\n \"GR9003\",\n \"usage\",\n \"error\",\n \"No feature has that id\",\n \"Use an id from `grimoire/features/`.\",\n USE,\n ),\n define(\n \"GR9004\",\n \"usage\",\n \"error\",\n \"No flow has that id\",\n \"Use `<feature>/<flow>` with a file in `grimoire/features/<feature>/flows/`.\",\n USE,\n ),\n define(\n \"GR9005\",\n \"usage\",\n \"error\",\n \"The release file has no brief yet\",\n \"Write `grimoire/releases/<release>.md` with `release` and `date` front matter and the brief, then run the command again.\",\n RECORD,\n ),\n define(\n \"GR9006\",\n \"usage\",\n \"error\",\n \"A query argument has the wrong form\",\n \"Read the command's help (`warlock scry --help`) and pass the argument in that form.\",\n USE,\n ),\n] as const;\n\n/** One registered code, as a union. */\nexport type GrimoireCode = (typeof GRIMOIRE_CODE_LIST)[number][\"code\"];\n\n/** The catalog, keyed by code. */\nexport const GRIMOIRE_CODES: Readonly<Record<GrimoireCode, GrimoireCodeDefinition>> =\n Object.fromEntries(\n GRIMOIRE_CODE_LIST.map((definition) => [definition.code, definition]),\n ) as Record<GrimoireCode, GrimoireCodeDefinition>;\n"],"mappings":";AAwBA,SAAS,OACP,MACA,MACA,UACA,OACA,KACA,OACkD;CAClD,OAAO;EAAE;EAAM;EAAM;EAAU;EAAO;EAAK;CAAM;AACnD;AAEA,MAAM,QAAQ;AACd,MAAM,SAAS;AACf,MAAM,MAAM;AACZ,MAAM,OAAO;AACb,MAAM,MAAM;;AAGZ,MAAa,qBAAqB;CAEhC,OACE,UACA,aACA,SACA,sCACA,2FACA,KACF;CACA,OACE,UACA,aACA,SACA,mCACA,sHACA,KACF;CACA,OACE,UACA,aACA,SACA,0CACA,yFACA,KACF;CACA,OACE,UACA,aACA,SACA,2CACA,iRACA,KACF;CACA,OACE,UACA,aACA,WACA,kDACA,mEACA,KACF;CACA,OACE,UACA,aACA,SACA,iCACA,qEACA,KACF;CACA,OACE,UACA,aACA,WACA,yCACA,6EACA,KACF;CACA,OACE,UACA,aACA,SACA,kCACA,6FACA,KACF;CACA,OACE,UACA,aACA,SACA,gCACA,sFACA,KACF;CACA,OACE,UACA,aACA,SACA,2CACA,yEACA,KACF;CACA,OACE,UACA,aACA,SACA,kCACA,iGACA,KACF;CACA,OACE,UACA,aACA,WACA,mCACA,gGACA,KACF;CACA,OACE,UACA,aACA,SACA,uCACA,8FACA,KACF;CACA,OACE,UACA,aACA,SACA,4CACA,kFACA,KACF;CACA,OACE,UACA,aACA,SACA,uCACA,wEACA,MACF;CACA,OACE,UACA,aACA,SACA,0CACA,+CACA,MACF;CACA,OACE,UACA,aACA,SACA,0CACA,mFACA,MACF;CACA,OACE,UACA,aACA,SACA,qCACA,yFACA,GACF;CACA,OACE,UACA,aACA,SACA,gDACA,4EACA,KACF;CACA,OACE,UACA,aACA,WACA,2DACA,+DACA,GACF;CACA,OACE,UACA,aACA,SACA,0DACA,wDACA,KACF;CACA,OACE,UACA,aACA,SACA,6BACA,8CACA,KACF;CACA,OACE,UACA,aACA,SACA,wCACA,8EACA,MACF;CACA,OACE,UACA,aACA,SACA,2DACA,qGACA,MACF;CACA,OACE,UACA,aACA,SACA,iCACA,gCACA,GACF;CACA,OACE,UACA,aACA,SACA,oDACA,2EACA,KACF;CACA,OACE,UACA,aACA,WACA,mDACA,4CACA,KACF;CACA,OACE,UACA,aACA,SACA,kCACA,yEACA,KACF;CAGA,OACE,UACA,SACA,SACA,kDACA,kEACA,MACF;CACA,OACE,UACA,SACA,SACA,gDACA,wJACA,MACF;CACA,OACE,UACA,SACA,SACA,gDACA,4DACA,MACF;CACA,OACE,UACA,SACA,SACA,gEACA,8DACA,MACF;CACA,OACE,UACA,SACA,SACA,8CACA,0DACA,MACF;CACA,OACE,UACA,SACA,SACA,oDACA,4DACA,MACF;CACA,OACE,UACA,SACA,SACA,+DACA,yEACA,KACF;CACA,OACE,UACA,SACA,SACA,0CACA,2DACA,GACF;CACA,OACE,UACA,SACA,WACA,iDACA,8FACA,KACF;CACA,OACE,UACA,SACA,SACA,sDACA,oDACA,MACF;CACA,OACE,UACA,SACA,SACA,8DACA,2DACA,MACF;CACA,OACE,UACA,SACA,SACA,sDACA,oEACA,KACF;CAGA,OACE,UACA,SACA,WACA,wCACA,oEACA,IACF;CACA,OACE,UACA,SACA,WACA,uCACA,qFACA,IACF;CACA,OACE,UACA,SACA,SACA,gCACA,6FACA,IACF;CACA,OACE,UACA,SACA,SACA,wDACA,sCACA,IACF;CACA,OACE,UACA,SACA,SACA,8CACA,6DACA,KACF;CACA,OACE,UACA,SACA,WACA,uDACA,0DACA,MACF;CAGA,OACE,UACA,SACA,WACA,2BACA,gGACA,MACF;CACA,OACE,UACA,SACA,SACA,kEACA,yEACA,MACF;CACA,OACE,UACA,SACA,SACA,uCACA,+DACA,MACF;CACA,OACE,UACA,SACA,SACA,iDACA,oEACA,MACF;CACA,OACE,UACA,SACA,WACA,gCACA,gDACA,MACF;CACA,OACE,UACA,SACA,SACA,qDACA,uDACA,MACF;CACA,OACE,UACA,SACA,WACA,yDACA,wBACA,MACF;CACA,OACE,UACA,SACA,WACA,kDACA,2CACA,MACF;CAGA,OACE,UACA,QACA,SACA,gDACA,oEACA,GACF;CACA,OACE,UACA,QACA,SACA,iDACA,gFACA,GACF;CACA,OACE,UACA,QACA,SACA,6CACA,kFACA,GACF;CACA,OACE,UACA,QACA,SACA,sCACA,qEACA,GACF;CACA,OACE,UACA,QACA,SACA,+CACA,qFACA,GACF;CACA,OACE,UACA,QACA,SACA,qDACA,2EACA,GACF;CACA,OACE,UACA,QACA,WACA,sDACA,uEACA,GACF;CACA,OACE,UACA,QACA,SACA,sDACA,4CACA,GACF;CACA,OACE,UACA,QACA,WACA,uDACA,+CACA,GACF;CAGA,OACE,UACA,aACA,SACA,iEACA,+EACA,MACF;CACA,OACE,UACA,aACA,SACA,mDACA,8EACA,MACF;CACA,OACE,UACA,aACA,SACA,0DACA,oDACA,MACF;CACA,OACE,UACA,aACA,SACA,iEACA,+EACA,MACF;CACA,OACE,UACA,aACA,SACA,gEACA,gDACA,MACF;CACA,OACE,UACA,aACA,WACA,oDACA,sFACA,MACF;CACA,OACE,UACA,aACA,SACA,wDACA,0CACA,KACF;CACA,OACE,UACA,aACA,WACA,2CACA,gDACA,KACF;CAGA,OACE,UACA,SACA,SACA,8CACA,yDACA,KACF;CACA,OACE,UACA,SACA,SACA,2CACA,mDACA,KACF;CACA,OACE,UACA,SACA,SACA,6CACA,8GACA,MACF;CACA,OACE,UACA,SACA,SACA,kEACA,mEACA,MACF;CACA,OACE,UACA,SACA,WACA,iCACA,8CACA,KACF;CAGA,OACE,UACA,QACA,SACA,gDACA,wEACA,GACF;CACA,OACE,UACA,QACA,WACA,8DACA,6FACA,GACF;CACA,OACE,UACA,QACA,WACA,+CACA,iDACA,GACF;CACA,OACE,UACA,QACA,WACA,sCACA,mEACA,GACF;CAGA,OACE,UACA,SACA,SACA,+BACA,wEACA,GACF;CACA,OACE,UACA,SACA,SACA,oBACA,uFACA,GACF;CACA,OACE,UACA,SACA,SACA,0BACA,wCACA,GACF;CACA,OACE,UACA,SACA,SACA,uBACA,+EACA,GACF;CACA,OACE,UACA,SACA,SACA,qCACA,4HACA,MACF;CACA,OACE,UACA,SACA,SACA,uCACA,uFACA,GACF;AACF;;AAMA,MAAa,iBACX,OAAO,YACL,mBAAmB,KAAK,eAAe,CAAC,WAAW,MAAM,UAAU,CAAC,CACtE"}
1
+ {"version":3,"file":"codes.mjs","names":[],"sources":["../../../../../../../../packages/grimoire/src/codes/codes.ts"],"sourcesContent":["/**\n * The catalog of stable Grimoire finding codes.\n *\n * THE SCHEME: `GR` followed by four digits. The first digit is the area:\n *\n * | Range | Area | Meaning |\n * | ------ | --------- | ----------------------------------------------------------- |\n * | GR1xxx | structure | a written file does not follow its fixed structure |\n * | GR2xxx | links | a written name points at something that does not exist |\n * | GR3xxx | files | source files: headers, owners, files no flow reaches |\n * | GR4xxx | tests | criteria, `@proves` lines and test results |\n * | GR5xxx | apps | sites, mobile apps, pages, screens and blocks |\n * | GR6xxx | changelog | feature versions, changelogs and releases |\n * | GR7xxx | tasks | task files |\n * | GR8xxx | book | building the book from the framework's facts |\n * | GR9xxx | usage | a command or query was asked something it cannot answer |\n *\n * STABILITY: a released code keeps its meaning. Titles and fixes may be\n * reworded; a code is never reused or renumbered.\n *\n * This module imports nothing, so any entry can use it.\n */\nimport type { GrimoireCodeDefinition } from \"../contracts/findings\";\n\nfunction define<const Code extends string>(\n code: Code,\n area: GrimoireCodeDefinition[\"area\"],\n severity: GrimoireCodeDefinition[\"severity\"],\n title: string,\n fix: string,\n skill: string,\n): GrimoireCodeDefinition & { readonly code: Code } {\n return { code, area, severity, title, fix, skill };\n}\n\nconst WRITE = \"write-a-feature\";\nconst RECORD = \"record-a-change\";\nconst APP = \"describe-an-app\";\nconst FILE = \"document-a-file\";\nconst USE = \"use-the-grimoire\";\n\n/** Every code, in order. */\nexport const GRIMOIRE_CODE_LIST = [\n // ── GR1xxx structure ─────────────────────────────────────────────────────\n define(\n \"GR1001\",\n \"structure\",\n \"error\",\n \"A written file has no front matter\",\n \"Start the file with the front matter block its template shows, between two `---` lines.\",\n WRITE,\n ),\n define(\n \"GR1002\",\n \"structure\",\n \"error\",\n \"The front matter cannot be read\",\n \"Write one `key: value` per line; lists as `[a, b]` or as `- item` lines under the key; close the block with `---`.\",\n WRITE,\n ),\n define(\n \"GR1003\",\n \"structure\",\n \"error\",\n \"A required front matter key is missing\",\n \"Add the key named in the message; the template of that file lists every required key.\",\n WRITE,\n ),\n define(\n \"GR1004\",\n \"structure\",\n \"error\",\n \"A front matter value has the wrong form\",\n \"Use the form the message names: dates as yyyy-mm-dd, versions as 2.1, ids in lower-case-with-dashes, a status from the list (a task status is open, waiting for approval, approved, in progress, blocked, done or dropped; a question for the owner is waiting for approval).\",\n WRITE,\n ),\n define(\n \"GR1005\",\n \"structure\",\n \"warning\",\n \"A front matter key is not part of the template\",\n \"Remove the key, or move what it says into the body of the file.\",\n WRITE,\n ),\n define(\n \"GR1006\",\n \"structure\",\n \"error\",\n \"A required heading is missing\",\n \"Add the heading named in the message, spelled as in the template.\",\n WRITE,\n ),\n define(\n \"GR1007\",\n \"structure\",\n \"warning\",\n \"A heading is not part of the template\",\n \"Use the template's headings; put the text under one of them or remove it.\",\n WRITE,\n ),\n define(\n \"GR1008\",\n \"structure\",\n \"error\",\n \"A step line has the wrong form\",\n \"Write steps as `1. route POST /wishlist`: a number, a kind, then the name used in code.\",\n WRITE,\n ),\n define(\n \"GR1009\",\n \"structure\",\n \"error\",\n \"A step names an unknown kind\",\n \"Use one of: page, route, mail, notification, job, event, outside service, affects.\",\n WRITE,\n ),\n define(\n \"GR1010\",\n \"structure\",\n \"error\",\n \"Steps are not numbered 1, 2, 3 in order\",\n \"Number the steps from 1 without gaps, in the order a user meets them.\",\n WRITE,\n ),\n define(\n \"GR1011\",\n \"structure\",\n \"error\",\n \"A case line has the wrong form\",\n \"Write cases as `- double submit two taps save once`: the question, spaces, then the answer.\",\n WRITE,\n ),\n define(\n \"GR1012\",\n \"structure\",\n \"warning\",\n \"A case question is not answered\",\n \"Answer the question under Cases (or `does not apply` and why), or list it under Not handled.\",\n WRITE,\n ),\n define(\n \"GR1013\",\n \"structure\",\n \"error\",\n \"A criterion line has the wrong form\",\n \"Write criteria as `- AC-3 a guest is sent to sign in`, optionally `- AC-4 [mobile] …`.\",\n WRITE,\n ),\n define(\n \"GR1014\",\n \"structure\",\n \"error\",\n \"A criterion id is used twice in one flow\",\n \"Give the new criterion the next free number. Never renumber existing criteria.\",\n WRITE,\n ),\n define(\n \"GR1015\",\n \"structure\",\n \"error\",\n \"A changelog line has the wrong form\",\n \"Write entries as `- 2.1 fixed new-arrivals: what changed (AC-2)`.\",\n RECORD,\n ),\n define(\n \"GR1016\",\n \"structure\",\n \"error\",\n \"A changelog entry uses an unknown word\",\n \"Use one of: added, changed, fixed, removed.\",\n RECORD,\n ),\n define(\n \"GR1017\",\n \"structure\",\n \"error\",\n \"A changelog heading has the wrong form\",\n \"Use `## Unreleased`, or `## <release> (<yyyy-mm-dd>)` for entries of a release.\",\n RECORD,\n ),\n define(\n \"GR1018\",\n \"structure\",\n \"error\",\n \"A blocks table has the wrong form\",\n \"Use the columns Block, Flow, Who sees it, Changes with; one row per part of the page.\",\n APP,\n ),\n define(\n \"GR1019\",\n \"structure\",\n \"error\",\n \"An id does not match its folder or file name\",\n \"Make the front matter `id` (or `release`) equal the folder or file name.\",\n WRITE,\n ),\n define(\n \"GR1020\",\n \"structure\",\n \"warning\",\n \"A file in the grimoire folder is not part of the layout\",\n \"Move the file to where the layout expects it, or remove it.\",\n USE,\n ),\n define(\n \"GR1021\",\n \"structure\",\n \"error\",\n \"A feature, app, page or screen folder has no README.md\",\n \"Add README.md with the front matter of its template.\",\n WRITE,\n ),\n define(\n \"GR1022\",\n \"structure\",\n \"error\",\n \"Two files use the same id\",\n \"Give each feature, app or task its own id.\",\n WRITE,\n ),\n define(\n \"GR1023\",\n \"structure\",\n \"error\",\n \"A task file is misnamed or misplaced\",\n \"Name tasks `T-<n>-<slug>.md`, in `tasks/open/` or `tasks/done/<yyyy-mm>/`.\",\n RECORD,\n ),\n define(\n \"GR1024\",\n \"structure\",\n \"error\",\n \"The collected-list markers of a release file are broken\",\n \"Keep the start and end markers in pairs, or remove both and run `warlock grimoire release` again.\",\n RECORD,\n ),\n define(\n \"GR1025\",\n \"structure\",\n \"error\",\n \"A written file cannot be read\",\n \"Save the file as UTF-8 text.\",\n USE,\n ),\n define(\n \"GR1026\",\n \"structure\",\n \"error\",\n \"The feature README lists a flow that has no file\",\n \"Add `flows/<flow>.md`, or remove the flow from the README's Flows list.\",\n WRITE,\n ),\n define(\n \"GR1027\",\n \"structure\",\n \"warning\",\n \"A flow file is not listed in the feature README\",\n \"Add the flow to the README's Flows list.\",\n WRITE,\n ),\n define(\n \"GR1028\",\n \"structure\",\n \"error\",\n \"A list line has the wrong form\",\n \"Write list lines as `- name text`: the name, spaces, then the text.\",\n WRITE,\n ),\n define(\n \"GR1029\",\n \"structure\",\n \"warning\",\n \"An image line points outside grimoire/screenshots\",\n \"Keep screenshots in `grimoire/screenshots/` and write the path relative to the Markdown file, like `![Product page](../../../screenshots/web/product.png)`.\",\n WRITE,\n ),\n define(\n \"GR1030\",\n \"structure\",\n \"warning\",\n \"A flow has no summary\",\n \"Write one or two plain sentences under the flow's `# Title`: who does what, and what they get.\",\n WRITE,\n ),\n\n // ── GR2xxx links ─────────────────────────────────────────────────────────\n define(\n \"GR2001\",\n \"links\",\n \"error\",\n \"A route step names a route that does not exist\",\n \"Fix the method and path in the flow, or add the route in code.\",\n RECORD,\n ),\n define(\n \"GR2002\",\n \"links\",\n \"error\",\n \"A page step names a page that does not exist\",\n \"Fix the route path in the flow, or add the page to one of the feature's apps. A step scoped like `page /support [web-admin]` looks only in that app.\",\n RECORD,\n ),\n define(\n \"GR2003\",\n \"links\",\n \"error\",\n \"A mail step names a mail that does not exist\",\n \"Use the mail's name as code defines it, or add the mail.\",\n RECORD,\n ),\n define(\n \"GR2004\",\n \"links\",\n \"error\",\n \"A notification step names a notification that does not exist\",\n \"Use the notification's name as code defines it, or add it.\",\n RECORD,\n ),\n define(\n \"GR2005\",\n \"links\",\n \"error\",\n \"A job step names a job that does not exist\",\n \"Use the job's name as code defines it, or add the job.\",\n RECORD,\n ),\n define(\n \"GR2006\",\n \"links\",\n \"error\",\n \"An event step names an event that does not exist\",\n \"Use the event's name as code emits it, or add the event.\",\n RECORD,\n ),\n define(\n \"GR2007\",\n \"links\",\n \"error\",\n \"An affects step names a feature or flow that does not exist\",\n \"Write `affects <feature>/<flow>` with an existing feature and flow.\",\n WRITE,\n ),\n define(\n \"GR2008\",\n \"links\",\n \"error\",\n \"A name refers to an app with no folder\",\n \"Add `grimoire/apps/<app>/README.md`, or fix the app id.\",\n APP,\n ),\n define(\n \"GR2009\",\n \"links\",\n \"warning\",\n \"A flow names an app its feature does not list\",\n \"Add the app to the feature's `apps`, or fix the app id in Differs by app or the criterion.\",\n WRITE,\n ),\n define(\n \"GR2010\",\n \"links\",\n \"error\",\n \"A changelog entry names a flow that does not exist\",\n \"Fix the flow id before the `:`, or add the flow.\",\n RECORD,\n ),\n define(\n \"GR2011\",\n \"links\",\n \"error\",\n \"A changelog entry names a criterion the flow does not have\",\n \"Fix the criterion id, or add the criterion to the flow.\",\n RECORD,\n ),\n define(\n \"GR2012\",\n \"links\",\n \"error\",\n \"A README relation names a flow that does not exist\",\n \"Fix the `<feature>/<flow>` reference in Affects and affected by.\",\n WRITE,\n ),\n define(\n \"GR2013\",\n \"links\",\n \"error\",\n \"A case names a criterion the flow does not have\",\n \"Fix the `(AC-n)` at the end of the case line, or add the criterion under Acceptance criteria.\",\n WRITE,\n ),\n define(\n \"GR2014\",\n \"links\",\n \"warning\",\n \"An image line names a screenshot file that does not exist\",\n \"Add the image under `grimoire/screenshots/`, or fix the path.\",\n WRITE,\n ),\n\n // ── GR3xxx files ─────────────────────────────────────────────────────────\n define(\n \"GR3001\",\n \"files\",\n \"warning\",\n \"A source file has no header sentence\",\n \"Start the file with a one-sentence comment saying why it exists.\",\n FILE,\n ),\n define(\n \"GR3002\",\n \"files\",\n \"warning\",\n \"A source file belongs to no feature\",\n \"Add its folder to a feature's `folders`, or tag it `@feature <id>` in its header.\",\n FILE,\n ),\n define(\n \"GR3003\",\n \"files\",\n \"error\",\n \"A source file has two owners\",\n \"Keep one owner: remove the duplicate folder from one feature, or keep one `@feature` tag.\",\n FILE,\n ),\n define(\n \"GR3004\",\n \"files\",\n \"error\",\n \"A `@feature` tag names a feature that does not exist\",\n \"Fix the tag, or write the feature.\",\n FILE,\n ),\n define(\n \"GR3005\",\n \"files\",\n \"error\",\n \"A feature's `folders` entry does not exist\",\n \"Fix the folder or file path, or remove it from `folders`.\",\n WRITE,\n ),\n define(\n \"GR3006\",\n \"files\",\n \"warning\",\n \"A file in a feature's folders is reached by no flow\",\n \"Describe the behaviour in a flow, or delete dead code.\",\n RECORD,\n ),\n\n // ── GR4xxx tests ─────────────────────────────────────────────────────────\n define(\n \"GR4001\",\n \"tests\",\n \"warning\",\n \"A criterion has no test\",\n \"Write a test with `// @proves <feature>/<flow> AC-<n>` above it, or say in the task why not.\",\n RECORD,\n ),\n define(\n \"GR4002\",\n \"tests\",\n \"error\",\n \"A `@proves` line names a flow or criterion that does not exist\",\n \"Fix the `@proves` line to name an existing `<feature>/<flow> AC-<n>`.\",\n RECORD,\n ),\n define(\n \"GR4003\",\n \"tests\",\n \"error\",\n \"A `@proves` line has the wrong form\",\n \"Write `// @proves <feature>/<flow> AC-<n>` on its own line.\",\n RECORD,\n ),\n define(\n \"GR4004\",\n \"tests\",\n \"error\",\n \"A `@proves` line is not directly above a test\",\n \"Move the line right above the `it(…)` or `test(…)` it describes.\",\n RECORD,\n ),\n define(\n \"GR4005\",\n \"tests\",\n \"warning\",\n \"One test proves two criteria\",\n \"Split the test so each proves one criterion.\",\n RECORD,\n ),\n define(\n \"GR4006\",\n \"tests\",\n \"error\",\n \"A test proving a criterion failed in its last run\",\n \"Fix the code or the test, then run the tests again.\",\n RECORD,\n ),\n define(\n \"GR4007\",\n \"tests\",\n \"warning\",\n \"A criterion's test result is older than the test file\",\n \"Run the tests again.\",\n RECORD,\n ),\n define(\n \"GR4008\",\n \"tests\",\n \"warning\",\n \"A criterion's test did not run in the last run\",\n \"Run the tests that prove the criterion.\",\n RECORD,\n ),\n define(\n \"GR4009\",\n \"tests\",\n \"warning\",\n \"Tests prove criteria but no test results are recorded\",\n \"Add `grimoireReporter()` from `@warlock.js/grimoire/vitest` to `test.reporters` in the Vitest config and run the tests; in production, ship the results file with the deploy.\",\n RECORD,\n ),\n define(\n \"GR4010\",\n \"tests\",\n \"warning\",\n \"The reporter could not match a proving test to its result\",\n \"Keep the `it(...)` or `test(...)` call on the line right under the `@proves` comment, with a plain string name.\",\n RECORD,\n ),\n\n // ── GR5xxx apps ──────────────────────────────────────────────────────────\n define(\n \"GR5001\",\n \"apps\",\n \"error\",\n \"A block points to a flow that does not exist\",\n \"Fix the `<feature>/<flow>` in the Flow column or the block file.\",\n APP,\n ),\n define(\n \"GR5002\",\n \"apps\",\n \"error\",\n \"A condition is not declared in the app README\",\n \"Add the condition under Conditions in the app README, or use a declared one.\",\n APP,\n ),\n define(\n \"GR5003\",\n \"apps\",\n \"error\",\n \"A page's route does not exist in its site\",\n \"Fix the `route` of the page file, or remove the page file if the page is gone.\",\n APP,\n ),\n define(\n \"GR5004\",\n \"apps\",\n \"error\",\n \"A page names a layout with no file\",\n \"Add `layouts/<layout>.md` to the app, or fix the page's `layout`.\",\n APP,\n ),\n define(\n \"GR5005\",\n \"apps\",\n \"error\",\n \"An app's root matches no site or mobile app\",\n \"Set `root` to the site folder (`src/web/$sites/<site>`) or the mobile app folder.\",\n APP,\n ),\n define(\n \"GR5006\",\n \"apps\",\n \"error\",\n \"A screen's route does not exist in the mobile app\",\n \"Fix the `route` of the screen file, or remove it if the screen is gone.\",\n APP,\n ),\n define(\n \"GR5007\",\n \"apps\",\n \"warning\",\n \"A block file has no row in its page's Blocks table\",\n \"Add the block to the page's Blocks table, or remove the block file.\",\n APP,\n ),\n define(\n \"GR5008\",\n \"apps\",\n \"error\",\n \"An entry point in Also reached from does not exist\",\n \"Fix the mail, notification or page name.\",\n APP,\n ),\n define(\n \"GR5009\",\n \"apps\",\n \"warning\",\n \"A site or mobile app has no folder in grimoire/apps\",\n \"Add `grimoire/apps/<app>/README.md` for it.\",\n APP,\n ),\n\n // ── GR6xxx changelog ─────────────────────────────────────────────────────\n define(\n \"GR6001\",\n \"changelog\",\n \"error\",\n \"A release lists a changelog entry that is not stamped with it\",\n \"Move the entry under `## <release> (<date>)` in the feature's CHANGELOG.md.\",\n RECORD,\n ),\n define(\n \"GR6002\",\n \"changelog\",\n \"error\",\n \"A changelog release section has no release file\",\n \"Write `grimoire/releases/<release>.md`, or fix the release in the heading.\",\n RECORD,\n ),\n define(\n \"GR6003\",\n \"changelog\",\n \"error\",\n \"A changelog release date differs from the release file\",\n \"Use the date in the release file's front matter.\",\n RECORD,\n ),\n define(\n \"GR6004\",\n \"changelog\",\n \"error\",\n \"The README `updated` is older than the newest changelog entry\",\n \"Reshape the README to describe the feature as it is now, and set `updated`.\",\n RECORD,\n ),\n define(\n \"GR6005\",\n \"changelog\",\n \"error\",\n \"The README `version` differs from the newest changelog entry\",\n \"Set `version` to the newest entry's version.\",\n RECORD,\n ),\n define(\n \"GR6006\",\n \"changelog\",\n \"warning\",\n \"A changelog word does not match its version step\",\n \"Use a whole-number version for added and removed, a decimal for changed and fixed.\",\n RECORD,\n ),\n define(\n \"GR6007\",\n \"changelog\",\n \"error\",\n \"A flow's `since` is newer than its feature's version\",\n \"Fix `since`, or the feature `version`.\",\n WRITE,\n ),\n define(\n \"GR6008\",\n \"changelog\",\n \"warning\",\n \"A new whole-number version has no brief\",\n \"Write `versions/v<n>.md` before building it.\",\n WRITE,\n ),\n\n // ── GR7xxx tasks ─────────────────────────────────────────────────────────\n define(\n \"GR7001\",\n \"tasks\",\n \"error\",\n \"A task names a feature that does not exist\",\n \"Fix the task's `feature`, or write the feature first.\",\n WRITE,\n ),\n define(\n \"GR7002\",\n \"tasks\",\n \"error\",\n \"A task names a flow that does not exist\",\n \"Fix the task's `flow`, or write the flow first.\",\n WRITE,\n ),\n define(\n \"GR7003\",\n \"tasks\",\n \"error\",\n \"A task's status does not match its folder\",\n \"Done tasks live in `tasks/done/<yyyy-mm>/` with `status: done` and `shipped`; open tasks in `tasks/open/`.\",\n RECORD,\n ),\n define(\n \"GR7004\",\n \"tasks\",\n \"error\",\n \"A task's `shipped` names a version the changelog does not have\",\n \"Fix `shipped: <feature> <version>`, or add the changelog entry.\",\n RECORD,\n ),\n define(\n \"GR7005\",\n \"tasks\",\n \"warning\",\n \"A task's brief does not exist\",\n \"Fix the `Brief:` path, or write the brief.\",\n WRITE,\n ),\n\n // ── GR8xxx book ──────────────────────────────────────────────────────────\n define(\n \"GR8001\",\n \"book\",\n \"error\",\n \"The project's source files could not be read\",\n \"Read the message; fix the file or folder it names, then build again.\",\n USE,\n ),\n define(\n \"GR8002\",\n \"book\",\n \"warning\",\n \"Route facts could not be read because the app did not boot\",\n \"Run `warlock doctor`, fix what stops the app from booting, then `warlock grimoire build`.\",\n USE,\n ),\n define(\n \"GR8003\",\n \"book\",\n \"warning\",\n \"Route facts are older than the routes files\",\n \"Run `warlock grimoire build` to refresh them.\",\n USE,\n ),\n define(\n \"GR8004\",\n \"book\",\n \"warning\",\n \"Pages or screens could not be read\",\n \"Read the message; fix the page file it names, then build again.\",\n USE,\n ),\n\n // ── GR9xxx usage ─────────────────────────────────────────────────────────\n define(\n \"GR9001\",\n \"usage\",\n \"error\",\n \"The file is not in the book\",\n \"Pass a code file under the source roots, as a project-relative path.\",\n USE,\n ),\n define(\n \"GR9002\",\n \"usage\",\n \"error\",\n \"No route matches\",\n 'Pass `\"<METHOD> <path>\"` as the route is registered; `warlock routes` lists them.',\n USE,\n ),\n define(\n \"GR9003\",\n \"usage\",\n \"error\",\n \"No feature has that id\",\n \"Use an id from `grimoire/features/`.\",\n USE,\n ),\n define(\n \"GR9004\",\n \"usage\",\n \"error\",\n \"No flow has that id\",\n \"Use `<feature>/<flow>` with a file in `grimoire/features/<feature>/flows/`.\",\n USE,\n ),\n define(\n \"GR9005\",\n \"usage\",\n \"error\",\n \"The release file has no brief yet\",\n \"Write `grimoire/releases/<release>.md` with `release` and `date` front matter and the brief, then run the command again.\",\n RECORD,\n ),\n define(\n \"GR9006\",\n \"usage\",\n \"error\",\n \"A query argument has the wrong form\",\n \"Read the command's help (`warlock scry --help`) and pass the argument in that form.\",\n USE,\n ),\n] as const;\n\n/** One registered code, as a union. */\nexport type GrimoireCode = (typeof GRIMOIRE_CODE_LIST)[number][\"code\"];\n\n/** The catalog, keyed by code. */\nexport const GRIMOIRE_CODES: Readonly<Record<GrimoireCode, GrimoireCodeDefinition>> =\n Object.fromEntries(\n GRIMOIRE_CODE_LIST.map((definition) => [definition.code, definition]),\n ) as Record<GrimoireCode, GrimoireCodeDefinition>;\n"],"mappings":";AAwBA,SAAS,OACP,MACA,MACA,UACA,OACA,KACA,OACkD;CAClD,OAAO;EAAE;EAAM;EAAM;EAAU;EAAO;EAAK;CAAM;AACnD;AAEA,MAAM,QAAQ;AACd,MAAM,SAAS;AACf,MAAM,MAAM;AACZ,MAAM,OAAO;AACb,MAAM,MAAM;;AAGZ,MAAa,qBAAqB;CAEhC,OACE,UACA,aACA,SACA,sCACA,2FACA,KACF;CACA,OACE,UACA,aACA,SACA,mCACA,sHACA,KACF;CACA,OACE,UACA,aACA,SACA,0CACA,yFACA,KACF;CACA,OACE,UACA,aACA,SACA,2CACA,iRACA,KACF;CACA,OACE,UACA,aACA,WACA,kDACA,mEACA,KACF;CACA,OACE,UACA,aACA,SACA,iCACA,qEACA,KACF;CACA,OACE,UACA,aACA,WACA,yCACA,6EACA,KACF;CACA,OACE,UACA,aACA,SACA,kCACA,6FACA,KACF;CACA,OACE,UACA,aACA,SACA,gCACA,sFACA,KACF;CACA,OACE,UACA,aACA,SACA,2CACA,yEACA,KACF;CACA,OACE,UACA,aACA,SACA,kCACA,iGACA,KACF;CACA,OACE,UACA,aACA,WACA,mCACA,gGACA,KACF;CACA,OACE,UACA,aACA,SACA,uCACA,8FACA,KACF;CACA,OACE,UACA,aACA,SACA,4CACA,kFACA,KACF;CACA,OACE,UACA,aACA,SACA,uCACA,wEACA,MACF;CACA,OACE,UACA,aACA,SACA,0CACA,+CACA,MACF;CACA,OACE,UACA,aACA,SACA,0CACA,mFACA,MACF;CACA,OACE,UACA,aACA,SACA,qCACA,yFACA,GACF;CACA,OACE,UACA,aACA,SACA,gDACA,4EACA,KACF;CACA,OACE,UACA,aACA,WACA,2DACA,+DACA,GACF;CACA,OACE,UACA,aACA,SACA,0DACA,wDACA,KACF;CACA,OACE,UACA,aACA,SACA,6BACA,8CACA,KACF;CACA,OACE,UACA,aACA,SACA,wCACA,8EACA,MACF;CACA,OACE,UACA,aACA,SACA,2DACA,qGACA,MACF;CACA,OACE,UACA,aACA,SACA,iCACA,gCACA,GACF;CACA,OACE,UACA,aACA,SACA,oDACA,2EACA,KACF;CACA,OACE,UACA,aACA,WACA,mDACA,4CACA,KACF;CACA,OACE,UACA,aACA,SACA,kCACA,yEACA,KACF;CACA,OACE,UACA,aACA,WACA,qDACA,+JACA,KACF;CACA,OACE,UACA,aACA,WACA,yBACA,kGACA,KACF;CAGA,OACE,UACA,SACA,SACA,kDACA,kEACA,MACF;CACA,OACE,UACA,SACA,SACA,gDACA,wJACA,MACF;CACA,OACE,UACA,SACA,SACA,gDACA,4DACA,MACF;CACA,OACE,UACA,SACA,SACA,gEACA,8DACA,MACF;CACA,OACE,UACA,SACA,SACA,8CACA,0DACA,MACF;CACA,OACE,UACA,SACA,SACA,oDACA,4DACA,MACF;CACA,OACE,UACA,SACA,SACA,+DACA,yEACA,KACF;CACA,OACE,UACA,SACA,SACA,0CACA,2DACA,GACF;CACA,OACE,UACA,SACA,WACA,iDACA,8FACA,KACF;CACA,OACE,UACA,SACA,SACA,sDACA,oDACA,MACF;CACA,OACE,UACA,SACA,SACA,8DACA,2DACA,MACF;CACA,OACE,UACA,SACA,SACA,sDACA,oEACA,KACF;CACA,OACE,UACA,SACA,SACA,mDACA,iGACA,KACF;CACA,OACE,UACA,SACA,WACA,6DACA,iEACA,KACF;CAGA,OACE,UACA,SACA,WACA,wCACA,oEACA,IACF;CACA,OACE,UACA,SACA,WACA,uCACA,qFACA,IACF;CACA,OACE,UACA,SACA,SACA,gCACA,6FACA,IACF;CACA,OACE,UACA,SACA,SACA,wDACA,sCACA,IACF;CACA,OACE,UACA,SACA,SACA,8CACA,6DACA,KACF;CACA,OACE,UACA,SACA,WACA,uDACA,0DACA,MACF;CAGA,OACE,UACA,SACA,WACA,2BACA,gGACA,MACF;CACA,OACE,UACA,SACA,SACA,kEACA,yEACA,MACF;CACA,OACE,UACA,SACA,SACA,uCACA,+DACA,MACF;CACA,OACE,UACA,SACA,SACA,iDACA,oEACA,MACF;CACA,OACE,UACA,SACA,WACA,gCACA,gDACA,MACF;CACA,OACE,UACA,SACA,SACA,qDACA,uDACA,MACF;CACA,OACE,UACA,SACA,WACA,yDACA,wBACA,MACF;CACA,OACE,UACA,SACA,WACA,kDACA,2CACA,MACF;CACA,OACE,UACA,SACA,WACA,yDACA,iLACA,MACF;CACA,OACE,UACA,SACA,WACA,6DACA,mHACA,MACF;CAGA,OACE,UACA,QACA,SACA,gDACA,oEACA,GACF;CACA,OACE,UACA,QACA,SACA,iDACA,gFACA,GACF;CACA,OACE,UACA,QACA,SACA,6CACA,kFACA,GACF;CACA,OACE,UACA,QACA,SACA,sCACA,qEACA,GACF;CACA,OACE,UACA,QACA,SACA,+CACA,qFACA,GACF;CACA,OACE,UACA,QACA,SACA,qDACA,2EACA,GACF;CACA,OACE,UACA,QACA,WACA,sDACA,uEACA,GACF;CACA,OACE,UACA,QACA,SACA,sDACA,4CACA,GACF;CACA,OACE,UACA,QACA,WACA,uDACA,+CACA,GACF;CAGA,OACE,UACA,aACA,SACA,iEACA,+EACA,MACF;CACA,OACE,UACA,aACA,SACA,mDACA,8EACA,MACF;CACA,OACE,UACA,aACA,SACA,0DACA,oDACA,MACF;CACA,OACE,UACA,aACA,SACA,iEACA,+EACA,MACF;CACA,OACE,UACA,aACA,SACA,gEACA,gDACA,MACF;CACA,OACE,UACA,aACA,WACA,oDACA,sFACA,MACF;CACA,OACE,UACA,aACA,SACA,wDACA,0CACA,KACF;CACA,OACE,UACA,aACA,WACA,2CACA,gDACA,KACF;CAGA,OACE,UACA,SACA,SACA,8CACA,yDACA,KACF;CACA,OACE,UACA,SACA,SACA,2CACA,mDACA,KACF;CACA,OACE,UACA,SACA,SACA,6CACA,8GACA,MACF;CACA,OACE,UACA,SACA,SACA,kEACA,mEACA,MACF;CACA,OACE,UACA,SACA,WACA,iCACA,8CACA,KACF;CAGA,OACE,UACA,QACA,SACA,gDACA,wEACA,GACF;CACA,OACE,UACA,QACA,WACA,8DACA,6FACA,GACF;CACA,OACE,UACA,QACA,WACA,+CACA,iDACA,GACF;CACA,OACE,UACA,QACA,WACA,sCACA,mEACA,GACF;CAGA,OACE,UACA,SACA,SACA,+BACA,wEACA,GACF;CACA,OACE,UACA,SACA,SACA,oBACA,uFACA,GACF;CACA,OACE,UACA,SACA,SACA,0BACA,wCACA,GACF;CACA,OACE,UACA,SACA,SACA,uBACA,+EACA,GACF;CACA,OACE,UACA,SACA,SACA,qCACA,4HACA,MACF;CACA,OACE,UACA,SACA,SACA,uCACA,uFACA,GACF;AACF;;AAMA,MAAa,iBACX,OAAO,YACL,mBAAmB,KAAK,eAAe,CAAC,WAAW,MAAM,UAAU,CAAC,CACtE"}
@@ -15,7 +15,7 @@
15
15
  * Warlock adapter passes `InspectFile.role` through unchanged; any other
16
16
  * string is allowed so a new role never breaks the book.
17
17
  */
18
- export type BookFileType = "controller" | "service" | "repository" | "model" | "use-case" | "seed" | "request" | "mail" | "job" | "event" | "client" | "migration" | "schema" | "resource" | "hook" | "component" | "util" | "type" | "config" | "locale" | "main" | "routes" | "worker" | "page" | "setup" | "layout" | "root" | "spec" | "source" | (string & {});
18
+ export type BookFileType = "controller" | "service" | "repository" | "model" | "use-case" | "seed" | "request" | "mail" | "job" | "event" | "client" | "migration" | "schema" | "resource" | "hook" | "component" | "util" | "type" | "config" | "locale" | "main" | "routes" | "worker" | "command" | "page" | "setup" | "layout" | "root" | "spec" | "source" | (string & {});
19
19
  /** One public export of a file. */
20
20
  export type BookExport = {
21
21
  /** Export name; `default` and `*` stand for default and star exports. */
@@ -29,6 +29,12 @@ export type BookImport = {
29
29
  specifier: string;
30
30
  /** The project file it resolves to, or `null` for a package or an unresolved alias. */
31
31
  file: string | null;
32
+ /**
33
+ * `true` when every import and re-export of the specifier in the file is
34
+ * type-only (`import type`, `export type`, `import { type A }`); erased at
35
+ * runtime. Absent for a value import, and in facts from older adapters.
36
+ */
37
+ typeOnly?: boolean;
32
38
  };
33
39
  /** Facts about one source file. Code files only (`.ts`, `.tsx`, `.js`, …). */
34
40
  export type BookFile = {
@@ -164,6 +170,25 @@ export type BookFacts = {
164
170
  /** Test files to scan for `@proves` lines (inside and outside the source roots). */
165
171
  tests: string[];
166
172
  };
173
+ /**
174
+ * The framework the book was read from, and the app it describes. The
175
+ * Grimoire view shows it in its header (framework logo and version) and at
176
+ * the bottom (the app's own name and version); an adapter that supplies no
177
+ * host shows nothing.
178
+ */
179
+ export type BookHost = {
180
+ /** Framework name (`Warlock.js`). */
181
+ name: string;
182
+ /** Installed framework version, or `null` when unknown. */
183
+ version: string | null;
184
+ /** Small logo as a `data:image/...` URI (kept inline so the static export stays one file), or `null`. */
185
+ logo: string | null;
186
+ /** The app's own name and version (its `package.json`), or `null`. */
187
+ app: {
188
+ name: string;
189
+ version: string | null;
190
+ } | null;
191
+ };
167
192
  /**
168
193
  * What a framework adapter provides. Only `files` and `sourceRoots` are
169
194
  * required; a missing method means "this framework has none of those".
@@ -204,6 +229,8 @@ export type BookAdapter = {
204
229
  named?(root: string): Promise<BookNamedThing[]>;
205
230
  /** Test files to scan for `@proves` lines. Static. */
206
231
  tests?(root: string): Promise<string[]>;
232
+ /** The framework brand and the app's own name and version, for the view's header and footer. Optional; never boots the app. */
233
+ host?(root: string): Promise<BookHost | null> | BookHost | null;
207
234
  };
208
235
  //#endregion
209
236
  //# sourceMappingURL=adapter.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"adapter.d.mts","names":[],"sources":["../../../../../../../../packages/grimoire/src/contracts/adapter.ts"],"mappings":";;;;;;;;;;;;;;;;;YAiBY;;YAiCA;;EAEV;;EAEA;;;YAIU;;EAEV;;EAEA;;;YAIU;EACV;;EAEA;EACA,MAAM;EACN;;EAEA;;EAEA,MAAM;EACN,SAAS;EACT,SAAS;;EAET;;EAEA;;;YAIU;;EAEV;;EAEA;EACA;;EAEA;;EAEA;;EAEA;EACA;;EAEA;;EAEA;;EAEA;IAAQ;IAAmB;;;EAE3B;EACA;;;;;;;YAQU;EACV;EACA;;EAEA;;;YAIU;EACV;;EAEA;EACA;;;YAIU;;EAEV;;EAEA;EACA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;;;;EAKA,aAAa;;;YAIH;;EAEV;EACA;;EAEA;;;YAIU;;EAEV;;EAEA;;;;;;EAMA;;EAEA;EACA,SAAS;;;YAIC;;YAGA;EACV,MAAM;;EAEN;;EAEA;;;YAIU;EACV,OAAO;;EAEP,QAAQ;EACR,OAAO;EACP,OAAO;EACP,QAAQ;EACR,OAAO;;EAEP;;;;;;;;;;YAWU;;EAEV;;EAEA;;EAEA,YAAY,eAAe;;EAE3B,MAAM,eAAe,QAAQ;;EAE7B,QAAQ,eAAe,QAAQ;;;;;;EAM/B,aAAa,cAAc,gBAAgB,aAAa;;EAExD,OAAO,eAAe,QAAQ;;EAE9B,OAAO,eAAe,QAAQ;;EAE9B,QAAQ,eAAe,QAAQ;;;;;;;EAO/B,OAAO,eAAe,QAAQ;;EAE9B,OAAO,eAAe"}
1
+ {"version":3,"file":"adapter.d.mts","names":[],"sources":["../../../../../../../../packages/grimoire/src/contracts/adapter.ts"],"mappings":";;;;;;;;;;;;;;;;;YAiBY;;YAkCA;;EAEV;;EAEA;;;YAIU;;EAEV;;EAEA;;;;;;EAMA;;;YAIU;EACV;;EAEA;EACA,MAAM;EACN;;EAEA;;EAEA,MAAM;EACN,SAAS;EACT,SAAS;;EAET;;EAEA;;;YAIU;;EAEV;;EAEA;EACA;;EAEA;;EAEA;;EAEA;EACA;;EAEA;;EAEA;;EAEA;IAAQ;IAAmB;;;EAE3B;EACA;;;;;;;YAQU;EACV;EACA;;EAEA;;;YAIU;EACV;;EAEA;EACA;;;YAIU;;EAEV;;EAEA;EACA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;;;;EAKA,aAAa;;;YAIH;;EAEV;EACA;;EAEA;;;YAIU;;EAEV;;EAEA;;;;;;EAMA;;EAEA;EACA,SAAS;;;YAIC;;YAGA;EACV,MAAM;;EAEN;;EAEA;;;YAIU;EACV,OAAO;;EAEP,QAAQ;EACR,OAAO;EACP,OAAO;EACP,QAAQ;EACR,OAAO;;EAEP;;;;;;;;YASU;;EAEV;;EAEA;;EAEA;;EAEA;IAAO;IAAc;;;;;;;;;;;YAWX;;EAEV;;EAEA;;EAEA,YAAY,eAAe;;EAE3B,MAAM,eAAe,QAAQ;;EAE7B,QAAQ,eAAe,QAAQ;;;;;;EAM/B,aAAa,cAAc,gBAAgB,aAAa;;EAExD,OAAO,eAAe,QAAQ;;EAE9B,OAAO,eAAe,QAAQ;;EAE9B,QAAQ,eAAe,QAAQ;;;;;;;EAO/B,OAAO,eAAe,QAAQ;;EAE9B,OAAO,eAAe;;EAEtB,MAAM,eAAe,QAAQ,mBAAmB"}
@@ -37,6 +37,8 @@ export type BookEntry = {
37
37
  packages: string[];
38
38
  /** Project files it imports. */
39
39
  imports: string[];
40
+ /** The part of `imports` that is type-only (erased at runtime), sorted. */
41
+ typeOnlyImports: string[];
40
42
  /** Project files that import it. */
41
43
  importedBy: string[];
42
44
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"book.d.mts","names":[],"sources":["../../../../../../../../packages/grimoire/src/contracts/book.ts"],"mappings":";;;;qBAoBa;;YAGD;EACV;EACA;EACA;;;;;;;YAQU;EACV,sBAAsB;;EAEtB;EACA;EACA,MAAM;EACN;;EAEA;;EAEA;;EAEA;;EAEA;EACA;IAAW;IAAc;;;EAEzB;;EAEA;;EAEA;;;;;;EAMA,SAAS;IAAiB;;;EAE1B;IAAS;IAAc;IAAe;;;EAEtC;IAAW;IAAa;IAAe;;;;YAI7B;EACV,sBAAsB;;EAEtB,SAAS,gBAAgB;IAAiB;;;;YAIhC;EACV,sBAAsB;EACtB,MAAM;EACN,OAAO;;;YAIG;EACV,sBAAsB;EACtB,KAAK,KAAK;EACV,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;YA2BC;EACV;;EAEA;EACA;IAAS;IAAc,MAAM;IAAc;IAAe;;EAC1D,QAAQ;;EAER;IAAU;IAAgB;;;;YAIhB;;EAEV;;EAEA;EACA;;EAEA;;;;;;;;YASU;EACV,sBAAsB;;EAEtB;EACA;IAAW;IAAc;;;EAEzB;EACA;;EAEA,OAAO,eAAe;;EAEtB,OAAO;;EAEP;;;;;;EAMA;;IAEE;IACA,QAAQ;;;;;;;;YASA;EACV,sBAAsB;EACtB,OAAO;;;YAIG;;EAEV;EACA,UAAU;EACV,OAAO;EACP,QAAQ;;;YAIE;;;;;;;EAOV;;EAEA;;EAEA,YAAY;;EAEZ;;;YAIU;EACV,MAAM;;EAEN;;EAEA;;;;;;;YAQU;;EAEV;;EAEA,OAAO;EACP,OAAO;IAAiB;IAAwB;IAAsB;;;;YAI5D;;EAEV;;EAEA"}
1
+ {"version":3,"file":"book.d.mts","names":[],"sources":["../../../../../../../../packages/grimoire/src/contracts/book.ts"],"mappings":";;;;qBAoBa;;YAGD;EACV;EACA;EACA;;;;;;;YAQU;EACV,sBAAsB;;EAEtB;EACA;EACA,MAAM;EACN;;EAEA;;EAEA;;EAEA;;EAEA;EACA;IAAW;IAAc;;;EAEzB;;EAEA;;EAEA;;EAEA;;;;;;EAMA,SAAS;IAAiB;;;EAE1B;IAAS;IAAc;IAAe;;;EAEtC;IAAW;IAAa;IAAe;;;;YAI7B;EACV,sBAAsB;;EAEtB,SAAS,gBAAgB;IAAiB;;;;YAIhC;EACV,sBAAsB;EACtB,MAAM;EACN,OAAO;;;YAIG;EACV,sBAAsB;EACtB,KAAK,KAAK;EACV,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;YA2BC;EACV;;EAEA;EACA;IAAS;IAAc,MAAM;IAAc;IAAe;;EAC1D,QAAQ;;EAER;IAAU;IAAgB;;;;YAIhB;;EAEV;;EAEA;EACA;;EAEA;;;;;;;;YASU;EACV,sBAAsB;;EAEtB;EACA;IAAW;IAAc;;;EAEzB;EACA;;EAEA,OAAO,eAAe;;EAEtB,OAAO;;EAEP;;;;;;EAMA;;IAEE;IACA,QAAQ;;;;;;;;YASA;EACV,sBAAsB;EACtB,OAAO;;;YAIG;;EAEV;EACA,UAAU;EACV,OAAO;EACP,QAAQ;;;YAIE;;;;;;;EAOV;;EAEA;;EAEA,YAAY;;EAEZ;;;YAIU;EACV,MAAM;;EAEN;;EAEA;;;;;;;YAQU;;EAEV;;EAEA,OAAO;EACP,OAAO;IAAiB;IAAwB;IAAsB;;;;YAI5D;;EAEV;;EAEA"}
@@ -1 +1 @@
1
- {"version":3,"file":"book.mjs","names":[],"sources":["../../../../../../../../packages/grimoire/src/contracts/book.ts"],"sourcesContent":["/**\n * The generated book under `grimoire/book/`. Warlock writes every file here;\n * the folder is ignored by git and rebuilt when sources or written files\n * change. Paths of the files are decided by `bookEntryPath()` and the\n * constants in `src/paths`.\n *\n * JSON files carry no timestamps except `manifest.json`, so an unchanged\n * project rewrites nothing and golden files stay stable.\n */\nimport type {\n BookFacts,\n BookFileType,\n BookMobileApp,\n BookPage,\n BookScreen,\n BookSite,\n} from \"./adapter\";\nimport type { RouteFreshness } from \"./findings\";\n\n/** The version of every book and collected JSON shape. Bumped only for a breaking change. */\nexport const BOOK_SCHEMA_VERSION = 1;\n\n/** A route as a book entry or list shows it. */\nexport type BookRouteRef = {\n method: string;\n path: string;\n name: string | null;\n};\n\n/**\n * `grimoire/book/<mirror path>.json`: one per code file.\n * `src/app/auth/controllers/login.controller.ts` →\n * `grimoire/book/app/auth/controllers/login.controller.json`.\n */\nexport type BookEntry = {\n schemaVersion: typeof BOOK_SCHEMA_VERSION;\n /** The source file. */\n file: string;\n module: string;\n type: BookFileType;\n lines: number;\n /** The header sentence, or `null`. */\n about: string | null;\n /** The feature that owns the file, or `null`. */\n feature: string | null;\n /** Features that import the file without owning it. */\n borrowedBy: string[];\n /** `<feature>/<flow>` of every flow whose steps reach the file. */\n flows: string[];\n exports: { name: string; about: string | null }[];\n /** External packages it imports (`@warlock.js/core`, `dayjs`), by package name. */\n packages: string[];\n /** Project files it imports. */\n imports: string[];\n /** Project files that import it. */\n importedBy: string[];\n /**\n * Routes this file registers (`via: \"registers\"`, a routes file) or handles\n * (`via: \"handles\"`, the handler's file). Routes that only reach the file\n * through imports are answered by `scry --impact`, not stored here.\n */\n routes: (BookRouteRef & { via: \"registers\" | \"handles\" })[];\n /** Pages this file is the page, setup or layout file of: `<site> <route>`. */\n pages: { site: string; route: string; via: \"page\" | \"setup\" | \"layout\" }[];\n /** Mobile screens this file is the screen or layout file of. */\n screens: { app: string; route: string; via: \"screen\" | \"layout\" }[];\n};\n\n/** `grimoire/book/app/routes.json`: every route, grouped by the module of its routes file. */\nexport type BookRoutesFile = {\n schemaVersion: typeof BOOK_SCHEMA_VERSION;\n /** Module (`src/app/catalog`) → routes, in registration order. `(none)` holds routes with no source file. */\n modules: Record<string, (BookRouteRef & { handlerFile: string | null })[]>;\n};\n\n/** `grimoire/book/web/<site>.pages.json`: the pages of one site. */\nexport type BookSitePagesFile = {\n schemaVersion: typeof BOOK_SCHEMA_VERSION;\n site: BookSite;\n pages: BookPage[];\n};\n\n/** `grimoire/book/mobile/<app>.screens.json`: one mobile app and its screens. */\nexport type BookMobileScreensFile = {\n schemaVersion: typeof BOOK_SCHEMA_VERSION;\n app: Omit<BookMobileApp, \"screens\">;\n screens: BookScreen[];\n};\n\n/**\n * The data behind `grimoire/book/<module>/index.md`, the module summary.\n *\n * The Markdown is:\n *\n * ```md\n * # src/app/catalog\n *\n * Feature: catalog. 14 files, 820 lines.\n *\n * ## Files\n * - controllers/new-arrivals.controller.ts controller Answers the new arrivals request.\n *\n * ## Routes\n * - GET /products/new-arrivals\n *\n * ## Used by\n * - src/app/orders (3 files)\n * ```\n *\n * Sections with nothing in them are left out. Files are listed by path\n * relative to the module, in path order; the header sentence is omitted when\n * the file has none.\n */\nexport type BookModuleSummary = {\n module: string;\n /** Owning features of the module's files, most files first. */\n features: string[];\n files: { file: string; type: BookFileType; lines: number; about: string | null }[];\n routes: BookRouteRef[];\n /** Other modules importing files of this one, with how many of their files do. */\n usedBy: { module: string; files: number }[];\n};\n\n/** One source file as the manifest remembers it. */\nexport type BookManifestFile = {\n /** sha256 of the content (hex). */\n hash: string;\n /** Size and modification time, to skip hashing unchanged files. */\n size: number;\n mtimeMs: number;\n /** The book entry path (`grimoire/book/...json`), or `null` for a file with no entry. */\n entry: string | null;\n};\n\n/**\n * `grimoire/book/manifest.json`: the fingerprint that says whether the book is\n * fresh. The book is fresh when the grimoire version, adapter name and version\n * and `schemaVersion` match, the set of files under the source roots is the\n * same, every file's hash matches, and the written-files hash matches.\n */\nexport type BookManifest = {\n schemaVersion: typeof BOOK_SCHEMA_VERSION;\n /** `@warlock.js/grimoire` version that wrote the book. */\n grimoireVersion: string;\n adapter: { name: string; version: string };\n /** ISO time of the last build that changed anything. */\n builtAt: string;\n sourceRoots: string[];\n /** Every file under the source roots (code or not), by project-relative path. */\n files: Record<string, BookManifestFile>;\n /** Test files scanned for `@proves`, with their hashes. */\n tests: Record<string, string>;\n /** `WrittenGrimoire.hash` the ownership and book maps were built from. */\n writtenHash: string;\n /**\n * The cache of facts that need the app booted (routes, named things). It is\n * stale when any input's hash differs from the one stored here, or an input\n * was added or removed.\n */\n boot: {\n /** ISO time the routes were read, or `null` when never. */\n collectedAt: string | null;\n inputs: Record<string, string>;\n };\n};\n\n/**\n * `grimoire/book/.cache/facts.json`: the adapter's last answer, so a file-only\n * question never calls the adapter's `routes()` and loading the book reads one\n * file. Machine use only.\n */\nexport type BookFactsCache = {\n schemaVersion: typeof BOOK_SCHEMA_VERSION;\n facts: BookFacts;\n};\n\n/** The book as `loadBook()` returns it. */\nexport type LoadedBook = {\n /** Absolute project root. */\n root: string;\n manifest: BookManifest;\n facts: BookFacts;\n routes: RouteFreshness;\n};\n\n/** Options of `buildBook()`. */\nexport type BuildBookOptions = {\n /**\n * `fresh`: refresh stale route facts (may boot the app through the adapter).\n * `cached`: never boot; reuse cached route facts, reported `stale` when their\n * inputs changed and `missing` when there are none.\n * Default `cached`. `warlock grimoire build` and `check` pass `fresh`.\n */\n routes?: \"fresh\" | \"cached\";\n /** Rebuild every entry even when the manifest says the book is fresh. */\n force?: boolean;\n /** Clock for `builtAt`. */\n now?: () => Date;\n /** `false` computes the book in memory only and writes nothing. Default `true`. */\n write?: boolean;\n};\n\n/** What `buildBook()` did. */\nexport type BuildBookResult = {\n book: LoadedBook;\n /** `false` when the manifest matched: the adapter was not called and nothing was written. */\n rebuilt: boolean;\n /** Source files added, changed or removed since the previous manifest. */\n changed: string[];\n};\n\n/**\n * What the book entries need from the written files: owner, borrowers and\n * flows per source file. `openGrimoire()` computes it (ownership and book\n * maps) and hands it to `writeBook()`.\n */\nexport type BookAnnotations = {\n /** `WrittenGrimoire.hash` it was computed from; stored in the manifest. */\n writtenHash: string;\n /** Test file → sha256, stored in the manifest. */\n tests: Record<string, string>;\n files: Record<string, { feature: string | null; borrowedBy: string[]; flows: string[] }>;\n};\n\n/** What `writeBook()` wrote. Unchanged files are not rewritten. */\nexport type WriteBookResult = {\n /** Book files created or changed (entries, summaries, lists), project-relative. */\n written: string[];\n /** Book files removed because their source is gone. */\n removed: string[];\n};\n"],"mappings":";;AAoBA,MAAa,sBAAsB"}
1
+ {"version":3,"file":"book.mjs","names":[],"sources":["../../../../../../../../packages/grimoire/src/contracts/book.ts"],"sourcesContent":["/**\n * The generated book under `grimoire/book/`. Warlock writes every file here;\n * the folder is ignored by git and rebuilt when sources or written files\n * change. Paths of the files are decided by `bookEntryPath()` and the\n * constants in `src/paths`.\n *\n * JSON files carry no timestamps except `manifest.json`, so an unchanged\n * project rewrites nothing and golden files stay stable.\n */\nimport type {\n BookFacts,\n BookFileType,\n BookMobileApp,\n BookPage,\n BookScreen,\n BookSite,\n} from \"./adapter\";\nimport type { RouteFreshness } from \"./findings\";\n\n/** The version of every book and collected JSON shape. Bumped only for a breaking change. */\nexport const BOOK_SCHEMA_VERSION = 1;\n\n/** A route as a book entry or list shows it. */\nexport type BookRouteRef = {\n method: string;\n path: string;\n name: string | null;\n};\n\n/**\n * `grimoire/book/<mirror path>.json`: one per code file.\n * `src/app/auth/controllers/login.controller.ts` →\n * `grimoire/book/app/auth/controllers/login.controller.json`.\n */\nexport type BookEntry = {\n schemaVersion: typeof BOOK_SCHEMA_VERSION;\n /** The source file. */\n file: string;\n module: string;\n type: BookFileType;\n lines: number;\n /** The header sentence, or `null`. */\n about: string | null;\n /** The feature that owns the file, or `null`. */\n feature: string | null;\n /** Features that import the file without owning it. */\n borrowedBy: string[];\n /** `<feature>/<flow>` of every flow whose steps reach the file. */\n flows: string[];\n exports: { name: string; about: string | null }[];\n /** External packages it imports (`@warlock.js/core`, `dayjs`), by package name. */\n packages: string[];\n /** Project files it imports. */\n imports: string[];\n /** The part of `imports` that is type-only (erased at runtime), sorted. */\n typeOnlyImports: string[];\n /** Project files that import it. */\n importedBy: string[];\n /**\n * Routes this file registers (`via: \"registers\"`, a routes file) or handles\n * (`via: \"handles\"`, the handler's file). Routes that only reach the file\n * through imports are answered by `scry --impact`, not stored here.\n */\n routes: (BookRouteRef & { via: \"registers\" | \"handles\" })[];\n /** Pages this file is the page, setup or layout file of: `<site> <route>`. */\n pages: { site: string; route: string; via: \"page\" | \"setup\" | \"layout\" }[];\n /** Mobile screens this file is the screen or layout file of. */\n screens: { app: string; route: string; via: \"screen\" | \"layout\" }[];\n};\n\n/** `grimoire/book/app/routes.json`: every route, grouped by the module of its routes file. */\nexport type BookRoutesFile = {\n schemaVersion: typeof BOOK_SCHEMA_VERSION;\n /** Module (`src/app/catalog`) → routes, in registration order. `(none)` holds routes with no source file. */\n modules: Record<string, (BookRouteRef & { handlerFile: string | null })[]>;\n};\n\n/** `grimoire/book/web/<site>.pages.json`: the pages of one site. */\nexport type BookSitePagesFile = {\n schemaVersion: typeof BOOK_SCHEMA_VERSION;\n site: BookSite;\n pages: BookPage[];\n};\n\n/** `grimoire/book/mobile/<app>.screens.json`: one mobile app and its screens. */\nexport type BookMobileScreensFile = {\n schemaVersion: typeof BOOK_SCHEMA_VERSION;\n app: Omit<BookMobileApp, \"screens\">;\n screens: BookScreen[];\n};\n\n/**\n * The data behind `grimoire/book/<module>/index.md`, the module summary.\n *\n * The Markdown is:\n *\n * ```md\n * # src/app/catalog\n *\n * Feature: catalog. 14 files, 820 lines.\n *\n * ## Files\n * - controllers/new-arrivals.controller.ts controller Answers the new arrivals request.\n *\n * ## Routes\n * - GET /products/new-arrivals\n *\n * ## Used by\n * - src/app/orders (3 files)\n * ```\n *\n * Sections with nothing in them are left out. Files are listed by path\n * relative to the module, in path order; the header sentence is omitted when\n * the file has none.\n */\nexport type BookModuleSummary = {\n module: string;\n /** Owning features of the module's files, most files first. */\n features: string[];\n files: { file: string; type: BookFileType; lines: number; about: string | null }[];\n routes: BookRouteRef[];\n /** Other modules importing files of this one, with how many of their files do. */\n usedBy: { module: string; files: number }[];\n};\n\n/** One source file as the manifest remembers it. */\nexport type BookManifestFile = {\n /** sha256 of the content (hex). */\n hash: string;\n /** Size and modification time, to skip hashing unchanged files. */\n size: number;\n mtimeMs: number;\n /** The book entry path (`grimoire/book/...json`), or `null` for a file with no entry. */\n entry: string | null;\n};\n\n/**\n * `grimoire/book/manifest.json`: the fingerprint that says whether the book is\n * fresh. The book is fresh when the grimoire version, adapter name and version\n * and `schemaVersion` match, the set of files under the source roots is the\n * same, every file's hash matches, and the written-files hash matches.\n */\nexport type BookManifest = {\n schemaVersion: typeof BOOK_SCHEMA_VERSION;\n /** `@warlock.js/grimoire` version that wrote the book. */\n grimoireVersion: string;\n adapter: { name: string; version: string };\n /** ISO time of the last build that changed anything. */\n builtAt: string;\n sourceRoots: string[];\n /** Every file under the source roots (code or not), by project-relative path. */\n files: Record<string, BookManifestFile>;\n /** Test files scanned for `@proves`, with their hashes. */\n tests: Record<string, string>;\n /** `WrittenGrimoire.hash` the ownership and book maps were built from. */\n writtenHash: string;\n /**\n * The cache of facts that need the app booted (routes, named things). It is\n * stale when any input's hash differs from the one stored here, or an input\n * was added or removed.\n */\n boot: {\n /** ISO time the routes were read, or `null` when never. */\n collectedAt: string | null;\n inputs: Record<string, string>;\n };\n};\n\n/**\n * `grimoire/book/.cache/facts.json`: the adapter's last answer, so a file-only\n * question never calls the adapter's `routes()` and loading the book reads one\n * file. Machine use only.\n */\nexport type BookFactsCache = {\n schemaVersion: typeof BOOK_SCHEMA_VERSION;\n facts: BookFacts;\n};\n\n/** The book as `loadBook()` returns it. */\nexport type LoadedBook = {\n /** Absolute project root. */\n root: string;\n manifest: BookManifest;\n facts: BookFacts;\n routes: RouteFreshness;\n};\n\n/** Options of `buildBook()`. */\nexport type BuildBookOptions = {\n /**\n * `fresh`: refresh stale route facts (may boot the app through the adapter).\n * `cached`: never boot; reuse cached route facts, reported `stale` when their\n * inputs changed and `missing` when there are none.\n * Default `cached`. `warlock grimoire build` and `check` pass `fresh`.\n */\n routes?: \"fresh\" | \"cached\";\n /** Rebuild every entry even when the manifest says the book is fresh. */\n force?: boolean;\n /** Clock for `builtAt`. */\n now?: () => Date;\n /** `false` computes the book in memory only and writes nothing. Default `true`. */\n write?: boolean;\n};\n\n/** What `buildBook()` did. */\nexport type BuildBookResult = {\n book: LoadedBook;\n /** `false` when the manifest matched: the adapter was not called and nothing was written. */\n rebuilt: boolean;\n /** Source files added, changed or removed since the previous manifest. */\n changed: string[];\n};\n\n/**\n * What the book entries need from the written files: owner, borrowers and\n * flows per source file. `openGrimoire()` computes it (ownership and book\n * maps) and hands it to `writeBook()`.\n */\nexport type BookAnnotations = {\n /** `WrittenGrimoire.hash` it was computed from; stored in the manifest. */\n writtenHash: string;\n /** Test file → sha256, stored in the manifest. */\n tests: Record<string, string>;\n files: Record<string, { feature: string | null; borrowedBy: string[]; flows: string[] }>;\n};\n\n/** What `writeBook()` wrote. Unchanged files are not rewritten. */\nexport type WriteBookResult = {\n /** Book files created or changed (entries, summaries, lists), project-relative. */\n written: string[];\n /** Book files removed because their source is gone. */\n removed: string[];\n};\n"],"mappings":";;AAoBA,MAAa,sBAAsB"}
@@ -74,8 +74,26 @@ export type FlowBookmapStep = {
74
74
  found: boolean | null;
75
75
  /** The file the step starts from (handler, page, mail file…), or `null`. */
76
76
  entry: string | null;
77
- /** The entry file and every project file it imports, transitively, sorted. */
77
+ /**
78
+ * Every file the step starts from, sorted: a page and its setup file, each
79
+ * matching route's handler file and routes file, each named file. Empty
80
+ * when nothing matched.
81
+ */
82
+ entries: string[];
83
+ /** Project files the entries import directly (any import, type-only included), minus the entries, sorted. */
84
+ direct: string[];
85
+ /**
86
+ * The entries and every project file they reach through imports that run
87
+ * (type-only imports are not followed), sorted.
88
+ */
78
89
  files: string[];
90
+ /**
91
+ * Files reached only through type-only imports (not in `files`), sorted.
92
+ * `files` plus these is the step's full reach: ownership coverage
93
+ * (`unreached`, `GR3006`), the book entries' `flows` and `scry --impact`
94
+ * count both.
95
+ */
96
+ typeOnlyFiles: string[];
79
97
  };
80
98
  /** One acceptance criterion with its tests and their last results. */
81
99
  export type FlowBookmapCriterion = {
@@ -1 +1 @@
1
- {"version":3,"file":"bookmap.d.mts","names":[],"sources":["../../../../../../../../packages/grimoire/src/contracts/bookmap.ts"],"mappings":";;;;;;;;;;;;;;YA8BY;EACV;EACA;;EAEA;;EAEA;;EAEA;IAAa;IAAiB;;;EAE9B;;;YAIU;EACV,OAAO,eAAe;;EAEtB,UAAU;IAAiB;IAAe;;;;YAMhC;EACV,sBAAsB;EACtB;;EAEA;;EAEA;IAAY;IAAc;IAAsB;;;EAEhD,SAAS;IAAiB;;;EAE1B,OAAO;IAAiB;IAAe;IAAc;;;EAErD;;;YAIU;EACV;EACA,MAAM;EACN;;;;;;EAMA;;EAEA;;EAEA;;;YAIU;EACV,IAAI;EACJ;EACA;EACA;IACE;IACA;IACA;;IAEA,QAAQ;IACR;;EAEF,QAAQ;;;YAIE;EACV,sBAAsB;EACtB;EACA;EACA,KAAK;EACL,OAAO;EACP,UAAU;;EAEV;IACE;IACA;;IAEA;IACA;;IAEA;;;;YAOQ;EACV,sBAAsB;EACtB;IACE;IACA;IACA,QAAQ;IACR,SAAS;;IAET;IACA;IACA,QAAQ;IACR;MAAS;MAAY,QAAQ;MAAe,OAAO;;;IAEnD;MAAY,SAAS;MAAgB;MAAiB;;;;;YAK9C;EACV;EACA;EACA,MAAM;EACN,QAAQ;EACR;EACA;EACA;EACA;EACA;IAAW;IAAiB,SAAS;;EACrC;;;;;;;YAQU;EACV,sBAAsB;EACtB,MAAM;EACN,SAAS;EACT,MAAM;;;YAII;EACV,UAAU,eAAe;;EAEzB,OAAO,eAAe;EACtB,eAAe;EACf,YAAY"}
1
+ {"version":3,"file":"bookmap.d.mts","names":[],"sources":["../../../../../../../../packages/grimoire/src/contracts/bookmap.ts"],"mappings":";;;;;;;;;;;;;;YA8BY;EACV;EACA;;EAEA;;EAEA;;EAEA;IAAa;IAAiB;;;EAE9B;;;YAIU;EACV,OAAO,eAAe;;EAEtB,UAAU;IAAiB;IAAe;;;;YAMhC;EACV,sBAAsB;EACtB;;EAEA;;EAEA;IAAY;IAAc;IAAsB;;;EAEhD,SAAS;IAAiB;;;EAE1B,OAAO;IAAiB;IAAe;IAAc;;;EAErD;;;YAIU;EACV;EACA,MAAM;EACN;;;;;;EAMA;;EAEA;;;;;;EAMA;;EAEA;;;;;EAKA;;;;;;;EAOA;;;YAIU;EACV,IAAI;EACJ;EACA;EACA;IACE;IACA;IACA;;IAEA,QAAQ;IACR;;EAEF,QAAQ;;;YAIE;EACV,sBAAsB;EACtB;EACA;EACA,KAAK;EACL,OAAO;EACP,UAAU;;EAEV;IACE;IACA;;IAEA;IACA;;IAEA;;;;YAOQ;EACV,sBAAsB;EACtB;IACE;IACA;IACA,QAAQ;IACR,SAAS;;IAET;IACA;IACA,QAAQ;IACR;MAAS;MAAY,QAAQ;MAAe,OAAO;;;IAEnD;MAAY,SAAS;MAAgB;MAAiB;;;;;YAK9C;EACV;EACA;EACA,MAAM;EACN,QAAQ;EACR;EACA;EACA;EACA;EACA;IAAW;IAAiB,SAAS;;EACrC;;;;;;;YAQU;EACV,sBAAsB;EACtB,MAAM;EACN,SAAS;EACT,MAAM;;;YAII;EACV,UAAU,eAAe;;EAEzB,OAAO,eAAe;EACtB,eAAe;EACf,YAAY"}
@@ -93,15 +93,27 @@ export type ScryRouteResult = ScryNotes & {
93
93
  /** Page whose route matches, for a page route. */
94
94
  page: BookPage | null;
95
95
  };
96
+ /** One flow of a feature answer, with the counts the flow cards show. */
97
+ export type ScryFeatureFlow = {
98
+ id: string;
99
+ status: string;
100
+ since: string;
101
+ heading: string | null;
102
+ /** Technical steps written in the flow file. */
103
+ steps: number;
104
+ /** Edge cases written in the flow (`## Cases`). */
105
+ cases: number;
106
+ /** Acceptance criteria written in the flow. */
107
+ criteria: number;
108
+ /** Criteria with at least one `@proves` test. */
109
+ tested: number;
110
+ /** Findings about the flow that are not expected (a `proposed` flow's findings are). */
111
+ findings: number;
112
+ };
96
113
  export type ScryFeatureResult = ScryNotes & {
97
114
  type: "feature";
98
115
  readme: WrittenFeatureReadme;
99
- flows: {
100
- id: string;
101
- status: string;
102
- since: string;
103
- heading: string | null;
104
- }[];
116
+ flows: ScryFeatureFlow[];
105
117
  bookmap: FeatureBookmap;
106
118
  /** Newest first, at most 10. */
107
119
  changes: WrittenChangelogEntry[];
@@ -132,10 +144,18 @@ export type ScryHit = {
132
144
  detail: string | null;
133
145
  /** Higher is better. Only the order is meaningful. */
134
146
  score: number;
147
+ /**
148
+ * For a feature or flow found by its written text: the part that matched
149
+ * (`AC-5: …`, `case duplicate: …`, `story 2: …`, `summary: …`). Absent when the name matched.
150
+ */
151
+ matched?: string;
135
152
  };
136
153
  export type ScrySearchResult = ScryNotes & {
137
154
  type: "search";
138
155
  text: string;
156
+ /** How many candidates matched, per type, before the limit cut the list. */
157
+ counts: Partial<Record<ScryHitType, number>>;
158
+ /** Grouped by type (features and flows first), best first inside a group. */
139
159
  hits: ScryHit[];
140
160
  };
141
161
  export type ScryResult = ScryFileResult | ScryImpactResult | ScryRouteResult | ScryFeatureResult | ScryFlowResult | ScrySearchResult;
@@ -1 +1 @@
1
- {"version":3,"file":"scry.d.mts","names":[],"sources":["../../../../../../../../packages/grimoire/src/contracts/scry.ts"],"mappings":";;;;;;YAWY;;;EAEN;EAAc;;;;EAEd;EAAgB;;;;EAEhB;EAAe;EAAgB;;;;EAE/B;EAAiB;;;;EAEjB;EAAc;EAAiB;;;;EAE/B;EAAgB;EAAc;;;YAGxB;EACV,QAAQ;EACR;;;YAIU;EAAgB;EAAa;EAAe;EAAc;;YAE1D,iBAAiB;EAC3B;EACA,OAAO;;EAEP;;YAIU,mBAAmB,KAAK;EAClC;EACA;;EAEA;IAAa;IAAkB;;;;;;EAK/B,QAAQ,KAAK;EACb,OAAO;;EAEP;;EAEA;IAAY;IAAY;;;EAExB;;YAGU,kBAAkB;EAC5B;EACA,OAAO;;EAEP;;EAEA;IAAS;IAAc;;;EAEvB,MAAM;;YAGI,oBAAoB;EAC9B;EACA,QAAQ;EACR;IAAS;IAAY;IAAgB;IAAe;;EACpD,SAAS;;EAET,SAAS;;EAET,OAAO;EACP,UAAU;;YAGA,iBAAiB;EAC3B;EACA,MAAM;EACN,SAAS;;EAET,SAAS;EACT,UAAU;;;YAIA;;YAcA;EACV,MAAM;;;;;;EAMN;;EAEA;;EAEA;;YAGU,mBAAmB;EAC7B;EACA;EACA,MAAM;;YAGI,aACR,iBACA,mBACA,kBACA,oBACA,iBACA"}
1
+ {"version":3,"file":"scry.d.mts","names":[],"sources":["../../../../../../../../packages/grimoire/src/contracts/scry.ts"],"mappings":";;;;;;YAWY;;;EAEN;EAAc;;;;EAEd;EAAgB;;;;EAEhB;EAAe;EAAgB;;;;EAE/B;EAAiB;;;;EAEjB;EAAc;EAAiB;;;;EAE/B;EAAgB;EAAc;;;YAGxB;EACV,QAAQ;EACR;;;YAIU;EAAgB;EAAa;EAAe;EAAc;;YAE1D,iBAAiB;EAC3B;EACA,OAAO;;EAEP;;YAIU,mBAAmB,KAAK;EAClC;EACA;;EAEA;IAAa;IAAkB;;;;;;EAK/B,QAAQ,KAAK;EACb,OAAO;;EAEP;;EAEA;IAAY;IAAY;;;EAExB;;YAGU,kBAAkB;EAC5B;EACA,OAAO;;EAEP;;EAEA;IAAS;IAAc;;;EAEvB,MAAM;;;YAII;EACV;EACA;EACA;EACA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;YAGU,oBAAoB;EAC9B;EACA,QAAQ;EACR,OAAO;EACP,SAAS;;EAET,SAAS;;EAET,OAAO;EACP,UAAU;;YAGA,iBAAiB;EAC3B;EACA,MAAM;EACN,SAAS;;EAET,SAAS;EACT,UAAU;;;YAIA;;YAcA;EACV,MAAM;;;;;;EAMN;;EAEA;;EAEA;;;;;EAKA;;YAGU,mBAAmB;EAC7B;EACA;;EAEA,QAAQ,QAAQ,OAAO;;EAEvB,MAAM;;YAGI,aACR,iBACA,mBACA,kBACA,oBACA,iBACA"}
@@ -1,4 +1,4 @@
1
- import { BookMobileApp, BookSite } from "./adapter.mjs";
1
+ import { BookHost, BookMobileApp, BookSite } from "./adapter.mjs";
2
2
  import { GrimoireFinding, RouteFreshness } from "./findings.mjs";
3
3
  import { BookAnnotations, LoadedBook } from "./book.mjs";
4
4
  import { WrittenGrimoire } from "./written.mjs";
@@ -20,9 +20,16 @@ export type GrimoireSnapshot = {
20
20
  proofFindings: GrimoireFinding[];
21
21
  /** `null` when no test run has written results. */
22
22
  results: TestResultsStore | null;
23
+ /**
24
+ * Project-relative path the results were read from (or would be): the
25
+ * `testResultsFile` option, else `grimoire/book/test-results.json`.
26
+ */
27
+ resultsFile: string;
23
28
  collected: CollectedFiles;
24
29
  annotations: BookAnnotations;
25
30
  routes: RouteFreshness;
31
+ /** What the adapter's `host()` reported (framework brand, app name and version); `null` or absent when it reports none. */
32
+ host?: BookHost | null;
26
33
  };
27
34
  /** Options of `openGrimoire()`. */
28
35
  export type OpenGrimoireOptions = {
@@ -32,6 +39,12 @@ export type OpenGrimoireOptions = {
32
39
  write?: boolean;
33
40
  /** Rebuild every book entry. */
34
41
  force?: boolean;
42
+ /**
43
+ * Where to read the test results from: a project-relative or absolute path.
44
+ * Default `grimoire/book/test-results.json` (what the Vitest reporter
45
+ * writes). A deploy that ships results from CI points here.
46
+ */
47
+ testResultsFile?: string;
35
48
  now?: () => Date;
36
49
  };
37
50
  /** A check rule: reads the snapshot, returns findings. Never writes. */
@@ -1 +1 @@
1
- {"version":3,"file":"snapshot.d.mts","names":[],"sources":["../../../../../../../../packages/grimoire/src/contracts/snapshot.ts"],"mappings":";;;;;;;YAYY;;EAEV;EACA,SAAS;;EAET,WAAW;EACX,MAAM;EACN,WAAW;;EAEX,MAAM,eAAe;EACrB,QAAQ;;EAER,eAAe;;EAEf,SAAS;EACT,WAAW;EACX,aAAa;EACb,QAAQ;;;YAIE;;EAEV;;EAEA;;EAEA;EACA,YAAY;;;YAIF,gBAAgB,UAAU,qBAAqB;;;;;;;YAQ/C;EACV;EACA;EACA,MAAM;EACN,QAAQ"}
1
+ {"version":3,"file":"snapshot.d.mts","names":[],"sources":["../../../../../../../../packages/grimoire/src/contracts/snapshot.ts"],"mappings":";;;;;;;YAYY;;EAEV;EACA,SAAS;;EAET,WAAW;EACX,MAAM;EACN,WAAW;;EAEX,MAAM,eAAe;EACrB,QAAQ;;EAER,eAAe;;EAEf,SAAS;;;;;EAKT;EACA,WAAW;EACX,aAAa;EACb,QAAQ;;EAER,OAAO;;;YAIG;;EAEV;;EAEA;;EAEA;;;;;;EAMA;EACA,YAAY;;;YAIF,gBAAgB,UAAU,qBAAqB;;;;;;;YAQ/C;EACV;EACA;EACA,MAAM;EACN,QAAQ"}
@@ -47,6 +47,40 @@ export type TestResultsStore = {
47
47
  updatedAt: string;
48
48
  runner: "vitest";
49
49
  results: ProofResult[];
50
+ /**
51
+ * `@proves` lines of the files the runs covered whose test the reporter
52
+ * could not match to a result (`GR4010`). Replaced per test file like
53
+ * `results`. Absent in stores written before 5.58.
54
+ */
55
+ unmatched?: UnmatchedProof[];
56
+ };
57
+ /** A proving test the reporter saw in a run file but could not match to a test result. */
58
+ export type UnmatchedProof = {
59
+ feature: string;
60
+ flow: string;
61
+ criterion: CriterionId;
62
+ testFile: string;
63
+ /** Line of the `@proves` comment. */
64
+ line: number;
65
+ };
66
+ /**
67
+ * What the readers know about the results store: whether one was read, from
68
+ * where, and how many proving tests have a result. The devtools answers carry
69
+ * it so a view can tell "never recorded" apart from "did not run".
70
+ */
71
+ export type TestResultsInfo = {
72
+ /** `true` when a results store was read. */
73
+ recorded: boolean;
74
+ /** Project-relative path the store was read from, or would be read from. */
75
+ file: string;
76
+ /** `updatedAt` of the store, or `null`. */
77
+ updatedAt: string | null;
78
+ /** `@proves` lines in the project. */
79
+ proofs: number;
80
+ /** Proving tests with a result in the store. */
81
+ withResult: number;
82
+ /** Entries of `unmatched` (0 when absent). */
83
+ unmatched: number;
50
84
  };
51
85
  /**
52
86
  * The status of one criterion, from its proving tests:
@@ -1 +1 @@
1
- {"version":3,"file":"test-results.d.mts","names":[],"sources":["../../../../../../../../packages/grimoire/src/contracts/test-results.ts"],"mappings":";;;;YAaY;EACV;EACA;;EAEA,KAAK;EACL,WAAW;;EAEX;IAAQ;IAAqB;;;EAE7B,IAAI;;;YAIM;;YAGA;EACV;EACA;EACA,WAAW;;EAEX;;EAEA;;EAEA;EACA,SAAS;EACT;;EAEA;;EAEA;;;;;;;YAQU;EACV;;EAEA;EACA;EACA,SAAS;;;;;;;;;;;;YAaC"}
1
+ {"version":3,"file":"test-results.d.mts","names":[],"sources":["../../../../../../../../packages/grimoire/src/contracts/test-results.ts"],"mappings":";;;;YAaY;EACV;EACA;;EAEA,KAAK;EACL,WAAW;;EAEX;IAAQ;IAAqB;;;EAE7B,IAAI;;;YAIM;;YAGA;EACV;EACA;EACA,WAAW;;EAEX;;EAEA;;EAEA;EACA,SAAS;EACT;;EAEA;;EAEA;;;;;;;YAQU;EACV;;EAEA;EACA;EACA,SAAS;;;;;;EAMT,YAAY;;;YAIF;EACV;EACA;EACA,WAAW;EACX;;EAEA;;;;;;;YAQU;;EAEV;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;;;;;;;;;;;YAaU"}
@@ -10,6 +10,20 @@ export type FeatureVersion = string;
10
10
  export type FlowRef = string;
11
11
  /** A criterion id: `AC-<n>`. */
12
12
  export type CriterionId = string;
13
+ /**
14
+ * An image line `![<alt>](<path>)` in a written file, outside code fences.
15
+ * The path is written relative to the Markdown file (so it renders on a git
16
+ * host) and must point inside `grimoire/screenshots/` (`GR1029` otherwise).
17
+ */
18
+ export type WrittenScreenshot = {
19
+ /** The alt text; `""` when none is written. */
20
+ alt: string;
21
+ /** As written in the file. */
22
+ written: string;
23
+ /** Path under `grimoire/screenshots/` (`web/product-page.png`), or `null` when it points elsewhere. */
24
+ path: string | null;
25
+ at: SourceLocation;
26
+ };
13
27
  /** One `- name text` line of a list section. */
14
28
  export type WrittenListLine = {
15
29
  /** The first word or phrase (a flow id, an app id, a condition name, a question). */
@@ -37,6 +51,14 @@ export type WrittenFeatureReadme = {
37
51
  heading: Located<string> | null;
38
52
  /** The paragraph under the heading, or `null`. */
39
53
  summary: string | null;
54
+ /**
55
+ * Front matter `audience`: who the feature is for, in the owner's words
56
+ * (`[shoppers, store staff]`). Empty when not written; readers then use the
57
+ * flows' `who` values.
58
+ */
59
+ audience: Located<string>[];
60
+ /** `## Why`: the paragraphs of the optional section, joined with a blank line, or `null`. */
61
+ why: string | null;
40
62
  /** `## Flows`: `- <flow-id> <what it does>`. */
41
63
  flows: WrittenListLine[];
42
64
  /** `## Affects and affected by`: free lines; references `<feature>/<flow>` are read from them. */
@@ -125,6 +147,20 @@ export type WrittenCase = {
125
147
  answer: string;
126
148
  /** The answer starts with `does not apply`. */
127
149
  doesNotApply: boolean;
150
+ /** Criteria named in a trailing `(AC-n[, AC-m])` of the answer (removed from `answer`). Empty when none. */
151
+ criteria: CriterionId[];
152
+ at: SourceLocation;
153
+ };
154
+ /**
155
+ * One `<n>. <sentence>` line of the optional `## Story` section: a step in
156
+ * the user's words, for readers who do not read code. Continuation lines are
157
+ * joined; image lines inside the item attach screenshots.
158
+ */
159
+ export type WrittenStoryStep = {
160
+ index: number;
161
+ /** The sentence, without image lines. */
162
+ text: string;
163
+ screenshots: WrittenScreenshot[];
128
164
  at: SourceLocation;
129
165
  };
130
166
  /** One `- AC-<n>[ [app-id]] <text>` line of `## Acceptance criteria`. */
@@ -151,6 +187,10 @@ export type WrittenFlow = {
151
187
  who: Located<string>;
152
188
  origin: Located<WrittenOrigin> | null;
153
189
  heading: Located<string> | null;
190
+ /** The paragraph under the `# Title`: what the flow does, in one or two sentences. `null` when not written (`GR1030`). */
191
+ summary: string | null;
192
+ /** `## Story`: the steps in the user's words. Empty when the section is not written. */
193
+ story: WrittenStoryStep[];
154
194
  steps: WrittenStep[];
155
195
  /** `## Differs by app`: `- <app-id> <what differs>`. */
156
196
  differs: WrittenListLine[];
@@ -225,6 +265,8 @@ export type WrittenBlockFile = {
225
265
  heading: Located<string> | null;
226
266
  /** `- <key> <value>` lines. */
227
267
  details: WrittenListLine[];
268
+ /** Image lines of the file (what the block looks like). */
269
+ screenshots: WrittenScreenshot[];
228
270
  };
229
271
  /** One `- <kind> <name>` line of `## Also reached from`. */
230
272
  export type WrittenEntryPoint = {
@@ -254,6 +296,8 @@ export type WrittenPage = {
254
296
  heading: Located<string> | null;
255
297
  /** The paragraph under the heading, or `null`. */
256
298
  purpose: string | null;
299
+ /** Image lines of the README (what the page or screen looks like). */
300
+ screenshots: WrittenScreenshot[];
257
301
  blocks: WrittenBlockRow[];
258
302
  alsoReachedFrom: WrittenEntryPoint[];
259
303
  blockFiles: WrittenBlockFile[];
@@ -1 +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;;;YAIM;EACV;EACA;;EAEA,IAAI;;EAEJ,KAAK;;EAEL,OAAO,QAAQ;EACf,QAAQ,QAAQ;;EAEhB,KAAK;EACL,QAAQ,QAAQ;EAChB,SAAS;EACT,OAAO;;EAEP,SAAS;EACT,OAAO;;EAEP,YAAY;;EAEZ;IAAY;IAAc,IAAI;;EAC9B,UAAU;;;YAIA;EACV;EACA;;EAEA;EACA,SAAS;;;YAIC;EACV;;EAEA;;EAEA,QAAQ;EACR,WAAW;EACX,OAAO;EACP,UAAU;;;YAMA;EACV;EACA;;;YAIU;EACV;EACA;;;YAIU;EACV;;EAEA,MAAM;EACN,KAAK;;EAEL,aAAa;EACb,IAAI;;;YAIM;EACV;EACA;;EAEA;;EAEA,QAAQ,QAAQ;EAChB,SAAS;EACT,QAAQ;;;YAIE;EACV;EACA;;EAEA;EACA;EACA,MAAM,QAAQ;EACd,SAAS;;EAET,SAAS;;;YAIC;;EAEV;EACA;EACA,IAAI;;;;;;YAOM;EACV;EACA;EACA;;EAEA;;EAEA,OAAO;;EAEP,QAAQ;;EAER,QAAQ;;EAER,QAAQ,QAAQ;EAChB,SAAS;;EAET;EACA,QAAQ;EACR,iBAAiB;EACjB,YAAY;;;YAIF;;EAEV;;EAEA;;EAEA,IAAI;EACJ,MAAM;;EAEN,MAAM;;EAEN,QAAQ,QAAQ;EAChB,SAAS;;EAET,YAAY;EACZ,SAAS;EACT,OAAO;EACP,SAAS;;YAKC;YAEA;;;;;YAaA;EACV;;EAEA;;EAEA;;EAEA,IAAI;EACJ,MAAM,QAAQ;EACd,SAAS;;EAET,MAAM;EACN,MAAM;EACN,QAAQ,QAAQ;;EAEhB,SAAS;IAAU;IAAiB,SAAS;;EAC7C,SAAS;;EAET;IAAU;IAAa;IAAe,IAAI;;;EAE1C;;;qBAMW;qBACA;;YAGD;EACV;EACA,SAAS;EACT,MAAM;EACN;EACA,UAAU;EACV;EACA,IAAI;;;YAIM;EACV;;EAEA,SAAS;;EAET,MAAM;EACN,SAAS;;EAET;;EAEA;IAAa,OAAO;IAAgB,KAAK;IAAgB,SAAS;;;;YAMxD;;EAEV;;EAEA;EACA,UAAU;EACV,MAAM;EACN,OAAO;EACP,UAAU;;;;;EAKV"}
1
+ {"version":3,"file":"written.d.mts","names":[],"sources":["../../../../../../../../packages/grimoire/src/contracts/written.ts"],"mappings":";;;YAeY;;YAGA;;YAGA;;YAGA;;YAGA;;;;;;YAOA;;EAEV;;EAEA;;EAEA;EACA,IAAI;;;YAIM;;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;;;;;;EAMA,UAAU;;EAEV;;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;;EAEA,UAAU;EACV,IAAI;;;;;;;YAQM;EACV;;EAEA;EACA,aAAa;EACb,IAAI;;;YAIM;EACV,IAAI;EACJ;;EAEA;EACA;EACA,IAAI;;;YAIM;EACV;EACA;;EAEA,IAAI;;EAEJ,KAAK;;EAEL,OAAO,QAAQ;EACf,QAAQ,QAAQ;;EAEhB,KAAK;EACL,QAAQ,QAAQ;EAChB,SAAS;;EAET;;EAEA,OAAO;EACP,OAAO;;EAEP,SAAS;EACT,OAAO;;EAEP,YAAY;;EAEZ;IAAY;IAAc,IAAI;;EAC9B,UAAU;;;YAIA;EACV;EACA;;EAEA;EACA,SAAS;;;YAIC;EACV;;EAEA;;EAEA,QAAQ;EACR,WAAW;EACX,OAAO;EACP,UAAU;;;YAMA;EACV;EACA;;;YAIU;EACV;EACA;;;YAIU;EACV;;EAEA,MAAM;EACN,KAAK;;EAEL,aAAa;EACb,IAAI;;;YAIM;EACV;EACA;;EAEA;;EAEA,QAAQ,QAAQ;EAChB,SAAS;EACT,QAAQ;;;YAIE;EACV;EACA;;EAEA;EACA;EACA,MAAM,QAAQ;EACd,SAAS;;EAET,SAAS;;EAET,aAAa;;;YAIH;;EAEV;EACA;EACA,IAAI;;;;;;YAOM;EACV;EACA;EACA;;EAEA;;EAEA,OAAO;;EAEP,QAAQ;;EAER,QAAQ;;EAER,QAAQ,QAAQ;EAChB,SAAS;;EAET;;EAEA,aAAa;EACb,QAAQ;EACR,iBAAiB;EACjB,YAAY;;;YAIF;;EAEV;;EAEA;;EAEA,IAAI;EACJ,MAAM;;EAEN,MAAM;;EAEN,QAAQ,QAAQ;EAChB,SAAS;;EAET,YAAY;EACZ,SAAS;EACT,OAAO;EACP,SAAS;;YAKC;YAEA;;;;;YAaA;EACV;;EAEA;;EAEA;;EAEA,IAAI;EACJ,MAAM,QAAQ;EACd,SAAS;;EAET,MAAM;EACN,MAAM;EACN,QAAQ,QAAQ;;EAEhB,SAAS;IAAU;IAAiB,SAAS;;EAC7C,SAAS;;EAET;IAAU;IAAa;IAAe,IAAI;;;EAE1C;;;qBAMW;qBACA;;YAGD;EACV;EACA,SAAS;EACT,MAAM;EACN;EACA,UAAU;EACV;EACA,IAAI;;;YAIM;EACV;;EAEA,SAAS;;EAET,MAAM;EACN,SAAS;;EAET;;EAEA;IAAa,OAAO;IAAgB,KAAK;IAAgB,SAAS;;;;YAMxD;;EAEV;;EAEA;EACA,UAAU;EACV,MAAM;EACN,OAAO;EACP,UAAU;;;;;EAKV"}