@design-intelligence/ghost 0.0.0-next-20260715121453
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +89 -0
- package/dist/bin.d.ts +3 -0
- package/dist/bin.d.ts.map +1 -0
- package/dist/bin.js +19 -0
- package/dist/bin.js.map +1 -0
- package/dist/cli.d.ts +4 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +29 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/checks-command.d.ts +9 -0
- package/dist/commands/checks-command.d.ts.map +1 -0
- package/dist/commands/checks-command.js +52 -0
- package/dist/commands/checks-command.js.map +1 -0
- package/dist/commands/command-discovery.d.ts +57 -0
- package/dist/commands/command-discovery.d.ts.map +1 -0
- package/dist/commands/command-discovery.js +220 -0
- package/dist/commands/command-discovery.js.map +1 -0
- package/dist/commands/errors.d.ts +7 -0
- package/dist/commands/errors.d.ts.map +1 -0
- package/dist/commands/errors.js +19 -0
- package/dist/commands/errors.js.map +1 -0
- package/dist/commands/export-command.d.ts +3 -0
- package/dist/commands/export-command.d.ts.map +1 -0
- package/dist/commands/export-command.js +157 -0
- package/dist/commands/export-command.js.map +1 -0
- package/dist/commands/fingerprint-commands.d.ts +10 -0
- package/dist/commands/fingerprint-commands.d.ts.map +1 -0
- package/dist/commands/fingerprint-commands.js +69 -0
- package/dist/commands/fingerprint-commands.js.map +1 -0
- package/dist/commands/gather-command.d.ts +3 -0
- package/dist/commands/gather-command.d.ts.map +1 -0
- package/dist/commands/gather-command.js +214 -0
- package/dist/commands/gather-command.js.map +1 -0
- package/dist/commands/init-command.d.ts +3 -0
- package/dist/commands/init-command.d.ts.map +1 -0
- package/dist/commands/init-command.js +89 -0
- package/dist/commands/init-command.js.map +1 -0
- package/dist/commands/manifest-command.d.ts +9 -0
- package/dist/commands/manifest-command.d.ts.map +1 -0
- package/dist/commands/manifest-command.js +33 -0
- package/dist/commands/manifest-command.js.map +1 -0
- package/dist/commands/pull-command.d.ts +3 -0
- package/dist/commands/pull-command.d.ts.map +1 -0
- package/dist/commands/pull-command.js +230 -0
- package/dist/commands/pull-command.js.map +1 -0
- package/dist/commands/pulse-command.d.ts +3 -0
- package/dist/commands/pulse-command.d.ts.map +1 -0
- package/dist/commands/pulse-command.js +248 -0
- package/dist/commands/pulse-command.js.map +1 -0
- package/dist/commands/review-command.d.ts +3 -0
- package/dist/commands/review-command.d.ts.map +1 -0
- package/dist/commands/review-command.js +78 -0
- package/dist/commands/review-command.js.map +1 -0
- package/dist/commands/skill-command.d.ts +3 -0
- package/dist/commands/skill-command.d.ts.map +1 -0
- package/dist/commands/skill-command.js +96 -0
- package/dist/commands/skill-command.js.map +1 -0
- package/dist/fingerprint.d.ts +5 -0
- package/dist/fingerprint.d.ts.map +1 -0
- package/dist/fingerprint.js +3 -0
- package/dist/fingerprint.js.map +1 -0
- package/dist/ghost-core/catalog/assemble.d.ts +26 -0
- package/dist/ghost-core/catalog/assemble.d.ts.map +1 -0
- package/dist/ghost-core/catalog/assemble.js +29 -0
- package/dist/ghost-core/catalog/assemble.js.map +1 -0
- package/dist/ghost-core/catalog/closest.d.ts +16 -0
- package/dist/ghost-core/catalog/closest.d.ts.map +1 -0
- package/dist/ghost-core/catalog/closest.js +63 -0
- package/dist/ghost-core/catalog/closest.js.map +1 -0
- package/dist/ghost-core/catalog/index.d.ts +10 -0
- package/dist/ghost-core/catalog/index.d.ts.map +1 -0
- package/dist/ghost-core/catalog/index.js +9 -0
- package/dist/ghost-core/catalog/index.js.map +1 -0
- package/dist/ghost-core/catalog/menu.d.ts +28 -0
- package/dist/ghost-core/catalog/menu.d.ts.map +1 -0
- package/dist/ghost-core/catalog/menu.js +23 -0
- package/dist/ghost-core/catalog/menu.js.map +1 -0
- package/dist/ghost-core/catalog/types.d.ts +33 -0
- package/dist/ghost-core/catalog/types.d.ts.map +1 -0
- package/dist/ghost-core/catalog/types.js +2 -0
- package/dist/ghost-core/catalog/types.js.map +1 -0
- package/dist/ghost-core/check/index.d.ts +12 -0
- package/dist/ghost-core/check/index.d.ts.map +1 -0
- package/dist/ghost-core/check/index.js +12 -0
- package/dist/ghost-core/check/index.js.map +1 -0
- package/dist/ghost-core/check/lint.d.ts +9 -0
- package/dist/ghost-core/check/lint.d.ts.map +1 -0
- package/dist/ghost-core/check/lint.js +119 -0
- package/dist/ghost-core/check/lint.js.map +1 -0
- package/dist/ghost-core/check/load.d.ts +7 -0
- package/dist/ghost-core/check/load.d.ts.map +1 -0
- package/dist/ghost-core/check/load.js +44 -0
- package/dist/ghost-core/check/load.js.map +1 -0
- package/dist/ghost-core/check/parse.d.ts +12 -0
- package/dist/ghost-core/check/parse.d.ts.map +1 -0
- package/dist/ghost-core/check/parse.js +13 -0
- package/dist/ghost-core/check/parse.js.map +1 -0
- package/dist/ghost-core/check/source-ref.d.ts +27 -0
- package/dist/ghost-core/check/source-ref.d.ts.map +1 -0
- package/dist/ghost-core/check/source-ref.js +58 -0
- package/dist/ghost-core/check/source-ref.js.map +1 -0
- package/dist/ghost-core/check/types.d.ts +48 -0
- package/dist/ghost-core/check/types.d.ts.map +1 -0
- package/dist/ghost-core/check/types.js +4 -0
- package/dist/ghost-core/check/types.js.map +1 -0
- package/dist/ghost-core/errors.d.ts +30 -0
- package/dist/ghost-core/errors.d.ts.map +1 -0
- package/dist/ghost-core/errors.js +33 -0
- package/dist/ghost-core/errors.js.map +1 -0
- package/dist/ghost-core/glob.d.ts +5 -0
- package/dist/ghost-core/glob.d.ts.map +1 -0
- package/dist/ghost-core/glob.js +68 -0
- package/dist/ghost-core/glob.js.map +1 -0
- package/dist/ghost-core/glossary.d.ts +25 -0
- package/dist/ghost-core/glossary.d.ts.map +1 -0
- package/dist/ghost-core/glossary.js +69 -0
- package/dist/ghost-core/glossary.js.map +1 -0
- package/dist/ghost-core/index.d.ts +13 -0
- package/dist/ghost-core/index.d.ts.map +1 -0
- package/dist/ghost-core/index.js +19 -0
- package/dist/ghost-core/index.js.map +1 -0
- package/dist/ghost-core/markdown.d.ts +15 -0
- package/dist/ghost-core/markdown.d.ts.map +1 -0
- package/dist/ghost-core/markdown.js +30 -0
- package/dist/ghost-core/markdown.js.map +1 -0
- package/dist/ghost-core/material-transport.d.ts +43 -0
- package/dist/ghost-core/material-transport.d.ts.map +1 -0
- package/dist/ghost-core/material-transport.js +231 -0
- package/dist/ghost-core/material-transport.js.map +1 -0
- package/dist/ghost-core/materials.d.ts +14 -0
- package/dist/ghost-core/materials.d.ts.map +1 -0
- package/dist/ghost-core/materials.js +52 -0
- package/dist/ghost-core/materials.js.map +1 -0
- package/dist/ghost-core/node/index.d.ts +11 -0
- package/dist/ghost-core/node/index.d.ts.map +1 -0
- package/dist/ghost-core/node/index.js +11 -0
- package/dist/ghost-core/node/index.js.map +1 -0
- package/dist/ghost-core/node/parse.d.ts +16 -0
- package/dist/ghost-core/node/parse.d.ts.map +1 -0
- package/dist/ghost-core/node/parse.js +55 -0
- package/dist/ghost-core/node/parse.js.map +1 -0
- package/dist/ghost-core/node/schema.d.ts +17 -0
- package/dist/ghost-core/node/schema.d.ts.map +1 -0
- package/dist/ghost-core/node/schema.js +49 -0
- package/dist/ghost-core/node/schema.js.map +1 -0
- package/dist/ghost-core/node/serialize.d.ts +12 -0
- package/dist/ghost-core/node/serialize.d.ts.map +1 -0
- package/dist/ghost-core/node/serialize.js +39 -0
- package/dist/ghost-core/node/serialize.js.map +1 -0
- package/dist/ghost-core/node/steering.d.ts +19 -0
- package/dist/ghost-core/node/steering.d.ts.map +1 -0
- package/dist/ghost-core/node/steering.js +68 -0
- package/dist/ghost-core/node/steering.js.map +1 -0
- package/dist/ghost-core/node/types.d.ts +43 -0
- package/dist/ghost-core/node/types.d.ts.map +1 -0
- package/dist/ghost-core/node/types.js +2 -0
- package/dist/ghost-core/node/types.js.map +1 -0
- package/dist/ghost-core/package-manifest.d.ts +19 -0
- package/dist/ghost-core/package-manifest.d.ts.map +1 -0
- package/dist/ghost-core/package-manifest.js +24 -0
- package/dist/ghost-core/package-manifest.js.map +1 -0
- package/dist/ghost-core/skill-bundle-loader.d.ts +28 -0
- package/dist/ghost-core/skill-bundle-loader.d.ts.map +1 -0
- package/dist/ghost-core/skill-bundle-loader.js +51 -0
- package/dist/ghost-core/skill-bundle-loader.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/dist/init-payloads/median/cliche.median.md +86 -0
- package/dist/init-payloads/median/median-tells.md +117 -0
- package/dist/init-payloads/skeleton/brand.md +23 -0
- package/dist/init-payloads/skeleton/context.conversation.md +24 -0
- package/dist/init-payloads/skeleton/foundation.color.md +39 -0
- package/dist/init-payloads/skeleton/foundation.composition.md +30 -0
- package/dist/init-payloads/skeleton/foundation.controls.md +29 -0
- package/dist/init-payloads/skeleton/foundation.layout.md +45 -0
- package/dist/init-payloads/skeleton/foundation.motion.md +34 -0
- package/dist/init-payloads/skeleton/foundation.type.md +44 -0
- package/dist/init-payloads/skeleton/foundation.voice.md +29 -0
- package/dist/init-payloads/skeleton/glossary.md +39 -0
- package/dist/init-payloads/vessel-light/anti-goal.median.md +86 -0
- package/dist/init-payloads/vessel-light/anti-goal.tells.md +38 -0
- package/dist/init-payloads/vessel-light/checks/conversation-grammar.md +20 -0
- package/dist/init-payloads/vessel-light/checks/median-tells.md +103 -0
- package/dist/init-payloads/vessel-light/checks/motion-restraint.md +20 -0
- package/dist/init-payloads/vessel-light/checks/relationships.md +33 -0
- package/dist/init-payloads/vessel-light/checks/shape-matches-job.md +43 -0
- package/dist/init-payloads/vessel-light/checks/values.md +51 -0
- package/dist/init-payloads/vessel-light/glossary.md +44 -0
- package/dist/init-payloads/vessel-light/grammar.color-roles.md +30 -0
- package/dist/init-payloads/vessel-light/grammar.conversation.md +30 -0
- package/dist/init-payloads/vessel-light/grammar.deletion.md +35 -0
- package/dist/init-payloads/vessel-light/grammar.hierarchy.md +58 -0
- package/dist/init-payloads/vessel-light/grammar.job.md +54 -0
- package/dist/init-payloads/vessel-light/grammar.motion.md +27 -0
- package/dist/init-payloads/vessel-light/grammar.rhythm.md +27 -0
- package/dist/init-payloads/vessel-light/grammar.surfaces.md +35 -0
- package/dist/init-payloads/vessel-light/index.md +33 -0
- package/dist/init-payloads/vessel-light/manifest.yml +3 -0
- package/dist/init-payloads/vessel-light/materials/fonts/HKGrotesk-Black.woff2 +0 -0
- package/dist/init-payloads/vessel-light/materials/fonts/HKGrotesk-Bold.woff2 +0 -0
- package/dist/init-payloads/vessel-light/materials/fonts/HKGrotesk-ExtraBold.woff2 +0 -0
- package/dist/init-payloads/vessel-light/materials/fonts/HKGrotesk-Light.woff2 +0 -0
- package/dist/init-payloads/vessel-light/materials/fonts/HKGrotesk-Medium.woff2 +0 -0
- package/dist/init-payloads/vessel-light/materials/fonts/HKGrotesk-Regular.woff2 +0 -0
- package/dist/init-payloads/vessel-light/materials/fonts/HKGrotesk-SemiBold.woff2 +0 -0
- package/dist/init-payloads/vessel-light/materials/primitives.css +351 -0
- package/dist/init-payloads/vessel-light/materials/ref/composition.conversation.html +63 -0
- package/dist/init-payloads/vessel-light/materials/ref/composition.editorial.html +74 -0
- package/dist/init-payloads/vessel-light/materials/ref/composition.form.html +89 -0
- package/dist/init-payloads/vessel-light/materials/ref/composition.overlay.html +66 -0
- package/dist/init-payloads/vessel-light/materials/ref/composition.table.html +104 -0
- package/dist/init-payloads/vessel-light/materials/ref/email.html +80 -0
- package/dist/init-payloads/vessel-light/materials/tokens.css +191 -0
- package/dist/init-payloads/vessel-light/register.data-density.md +39 -0
- package/dist/init-payloads/vessel-light/register.editorial.md +41 -0
- package/dist/init-payloads/vessel-light/register.email.md +43 -0
- package/dist/init-payloads/vessel-light/signature.palette.md +45 -0
- package/dist/init-payloads/vessel-light/signature.shape.md +27 -0
- package/dist/init-payloads/vessel-light/signature.temperature.md +44 -0
- package/dist/init-payloads/vessel-light/signature.type.md +37 -0
- package/dist/internal/fs.d.ts +4 -0
- package/dist/internal/fs.d.ts.map +1 -0
- package/dist/internal/fs.js +24 -0
- package/dist/internal/fs.js.map +1 -0
- package/dist/observability-events.d.ts +34 -0
- package/dist/observability-events.d.ts.map +1 -0
- package/dist/observability-events.js +68 -0
- package/dist/observability-events.js.map +1 -0
- package/dist/package-version.d.ts +3 -0
- package/dist/package-version.d.ts.map +1 -0
- package/dist/package-version.js +10 -0
- package/dist/package-version.js.map +1 -0
- package/dist/review/baseline.d.ts +11 -0
- package/dist/review/baseline.d.ts.map +1 -0
- package/dist/review/baseline.js +35 -0
- package/dist/review/baseline.js.map +1 -0
- package/dist/review/diff.d.ts +7 -0
- package/dist/review/diff.d.ts.map +1 -0
- package/dist/review/diff.js +41 -0
- package/dist/review/diff.js.map +1 -0
- package/dist/review/glob.d.ts +2 -0
- package/dist/review/glob.d.ts.map +1 -0
- package/dist/review/glob.js +2 -0
- package/dist/review/glob.js.map +1 -0
- package/dist/review/probes.d.ts +13 -0
- package/dist/review/probes.d.ts.map +1 -0
- package/dist/review/probes.js +45 -0
- package/dist/review/probes.js.map +1 -0
- package/dist/review/resolve.d.ts +28 -0
- package/dist/review/resolve.d.ts.map +1 -0
- package/dist/review/resolve.js +90 -0
- package/dist/review/resolve.js.map +1 -0
- package/dist/review/review-packet.d.ts +41 -0
- package/dist/review/review-packet.d.ts.map +1 -0
- package/dist/review/review-packet.js +128 -0
- package/dist/review/review-packet.js.map +1 -0
- package/dist/scan/check-files.d.ts +23 -0
- package/dist/scan/check-files.d.ts.map +1 -0
- package/dist/scan/check-files.js +75 -0
- package/dist/scan/check-files.js.map +1 -0
- package/dist/scan/check-scaffold.d.ts +8 -0
- package/dist/scan/check-scaffold.d.ts.map +1 -0
- package/dist/scan/check-scaffold.js +53 -0
- package/dist/scan/check-scaffold.js.map +1 -0
- package/dist/scan/constants.d.ts +21 -0
- package/dist/scan/constants.d.ts.map +1 -0
- package/dist/scan/constants.js +21 -0
- package/dist/scan/constants.js.map +1 -0
- package/dist/scan/file-kind.d.ts +12 -0
- package/dist/scan/file-kind.d.ts.map +1 -0
- package/dist/scan/file-kind.js +114 -0
- package/dist/scan/file-kind.js.map +1 -0
- package/dist/scan/fingerprint-package-lint.d.ts +8 -0
- package/dist/scan/fingerprint-package-lint.d.ts.map +1 -0
- package/dist/scan/fingerprint-package-lint.js +284 -0
- package/dist/scan/fingerprint-package-lint.js.map +1 -0
- package/dist/scan/fingerprint-package-loader.d.ts +5 -0
- package/dist/scan/fingerprint-package-loader.d.ts.map +1 -0
- package/dist/scan/fingerprint-package-loader.js +78 -0
- package/dist/scan/fingerprint-package-loader.js.map +1 -0
- package/dist/scan/fingerprint-package.d.ts +66 -0
- package/dist/scan/fingerprint-package.d.ts.map +1 -0
- package/dist/scan/fingerprint-package.js +101 -0
- package/dist/scan/fingerprint-package.js.map +1 -0
- package/dist/scan/index.d.ts +3 -0
- package/dist/scan/index.d.ts.map +1 -0
- package/dist/scan/index.js +3 -0
- package/dist/scan/index.js.map +1 -0
- package/dist/scan/lint.d.ts +15 -0
- package/dist/scan/lint.d.ts.map +1 -0
- package/dist/scan/lint.js +2 -0
- package/dist/scan/lint.js.map +1 -0
- package/dist/scan/node-files.d.ts +25 -0
- package/dist/scan/node-files.d.ts.map +1 -0
- package/dist/scan/node-files.js +112 -0
- package/dist/scan/node-files.js.map +1 -0
- package/dist/scan/package-paths.d.ts +10 -0
- package/dist/scan/package-paths.d.ts.map +1 -0
- package/dist/scan/package-paths.js +49 -0
- package/dist/scan/package-paths.js.map +1 -0
- package/dist/scan/packed-payloads.d.ts +4 -0
- package/dist/scan/packed-payloads.d.ts.map +1 -0
- package/dist/scan/packed-payloads.js +55 -0
- package/dist/scan/packed-payloads.js.map +1 -0
- package/dist/scan/tarball.d.ts +23 -0
- package/dist/scan/tarball.d.ts.map +1 -0
- package/dist/scan/tarball.js +145 -0
- package/dist/scan/tarball.js.map +1 -0
- package/dist/scan/templates.d.ts +42 -0
- package/dist/scan/templates.d.ts.map +1 -0
- package/dist/scan/templates.js +375 -0
- package/dist/scan/templates.js.map +1 -0
- package/dist/skill-bundle/SKILL.md +146 -0
- package/dist/skill-bundle/references/adapting-a-starter.md +104 -0
- package/dist/skill-bundle/references/authoring-scenarios.md +184 -0
- package/dist/skill-bundle/references/blocks.md +179 -0
- package/dist/skill-bundle/references/brief.md +50 -0
- package/dist/skill-bundle/references/capture.md +392 -0
- package/dist/skill-bundle/references/concrete-tiers.md +95 -0
- package/dist/skill-bundle/references/recall.md +36 -0
- package/dist/skill-bundle/references/schema.md +114 -0
- package/dist/skill-bundle/references/self-check.md +65 -0
- package/dist/skill-bundle/references/steering-audit.md +60 -0
- package/package.json +79 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"closest.js","sourceRoot":"","sources":["../../../src/ghost-core/catalog/closest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH;;;GAGG;AACH,MAAM,UAAU,UAAU,CACxB,KAAa,EACb,GAAqB,EACrB,GAAG,GAAG,CAAC;IAEP,MAAM,MAAM,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAC1C,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAEnC,MAAM,MAAM,GAAqD,EAAE,CAAC;IACpE,KAAK,MAAM,EAAE,IAAI,GAAG,EAAE,CAAC;QACrB,MAAM,KAAK,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC;QAC/B,MAAM,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,IAAI,KAAK,CAAC;QAChD,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CACvB,WAAW,CAAC,MAAM,EAAE,KAAK,CAAC,EAC1B,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,CAC7B,CAAC;QACF,MAAM,SAAS,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,QAAQ,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int catalog — a flat map of prose
|
|
3
|
+
* nodes assembled from the package's markdown files. No edges, no cascade, no
|
|
4
|
+
* traversal: the agent selects from the menu (`gather`).
|
|
5
|
+
*/
|
|
6
|
+
export { type AssembleCatalogInput, assembleCatalog, type PlacedNode, } from "./assemble.js";
|
|
7
|
+
export { closestIds } from "./closest.js";
|
|
8
|
+
export { buildCatalogMenu, type CatalogMenuEntry } from "./menu.js";
|
|
9
|
+
export type { GhostCatalog, GhostCatalogNode } from "./types.js";
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ghost-core/catalog/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,KAAK,oBAAoB,EACzB,eAAe,EACf,KAAK,UAAU,GAChB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,KAAK,gBAAgB,EAAE,MAAM,WAAW,CAAC;AACpE,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public surface for the in-memory fingerprint catalog — a flat map of prose
|
|
3
|
+
* nodes assembled from the package's markdown files. No edges, no cascade, no
|
|
4
|
+
* traversal: the agent selects from the menu (`gather`).
|
|
5
|
+
*/
|
|
6
|
+
export { assembleCatalog, } from "./assemble.js";
|
|
7
|
+
export { closestIds } from "./closest.js";
|
|
8
|
+
export { buildCatalogMenu } from "./menu.js";
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ghost-core/catalog/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAEL,eAAe,GAEhB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAyB,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { GhostCatalog } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* One entry in the gather menu: a node presented as `id` + `kind` +
|
|
4
|
+
* `description`, the retrieval payload the agent selects against. The agent
|
|
5
|
+
* matches a natural-language ask against these and pulls applicable nodes;
|
|
6
|
+
* Ghost does no NLP and no selection.
|
|
7
|
+
*/
|
|
8
|
+
export interface CatalogMenuEntry {
|
|
9
|
+
id: string;
|
|
10
|
+
/** The node's kind (filename prefix), when it declares one. */
|
|
11
|
+
kind?: string;
|
|
12
|
+
description?: string;
|
|
13
|
+
/** Count of material locators available after pulling this node. */
|
|
14
|
+
materials?: number;
|
|
15
|
+
/** True when this entry carries a material locator, fenced example, or Skeleton. */
|
|
16
|
+
concrete: boolean;
|
|
17
|
+
/** True when this entry includes a substantial fenced example. */
|
|
18
|
+
hasFencedExample?: true;
|
|
19
|
+
/** True when this entry includes a Skeleton section. */
|
|
20
|
+
hasSkeleton?: true;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Build the gather menu: every authored node, with its kind and description,
|
|
24
|
+
* sorted by id for stable output. A flat catalog — no anchor, no hierarchy;
|
|
25
|
+
* the agent selects from it.
|
|
26
|
+
*/
|
|
27
|
+
export declare function buildCatalogMenu(catalog: GhostCatalog): CatalogMenuEntry[];
|
|
28
|
+
//# sourceMappingURL=menu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menu.d.ts","sourceRoot":"","sources":["../../../src/ghost-core/catalog/menu.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,+DAA+D;IAC/D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oEAAoE;IACpE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oFAAoF;IACpF,QAAQ,EAAE,OAAO,CAAC;IAClB,kEAAkE;IAClE,gBAAgB,CAAC,EAAE,IAAI,CAAC;IACxB,wDAAwD;IACxD,WAAW,CAAC,EAAE,IAAI,CAAC;CACpB;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,YAAY,GAAG,gBAAgB,EAAE,CAkB1E"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build the gather menu: every authored node, with its kind and description,
|
|
3
|
+
* sorted by id for stable output. A flat catalog — no anchor, no hierarchy;
|
|
4
|
+
* the agent selects from it.
|
|
5
|
+
*/
|
|
6
|
+
export function buildCatalogMenu(catalog) {
|
|
7
|
+
const entries = [];
|
|
8
|
+
for (const node of catalog.nodes.values()) {
|
|
9
|
+
entries.push({
|
|
10
|
+
id: node.id,
|
|
11
|
+
...(node.kind !== undefined ? { kind: node.kind } : {}),
|
|
12
|
+
...(node.description ? { description: node.description } : {}),
|
|
13
|
+
...(node.materials !== undefined && node.materials.length > 0
|
|
14
|
+
? { materials: node.materials.length }
|
|
15
|
+
: {}),
|
|
16
|
+
concrete: node.concrete,
|
|
17
|
+
...(node.hasFencedExample ? { hasFencedExample: true } : {}),
|
|
18
|
+
...(node.hasSkeleton ? { hasSkeleton: true } : {}),
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
return entries.sort((a, b) => a.id.localeCompare(b.id));
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=menu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menu.js","sourceRoot":"","sources":["../../../src/ghost-core/catalog/menu.ts"],"names":[],"mappings":"AAuBA;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,OA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; there are no structured content
|
|
4
|
+
* fields. Kind comes from the filename prefix; there is no traversal or
|
|
5
|
+
* containment model — the catalog is a flat map the agent selects from.
|
|
6
|
+
*/
|
|
7
|
+
export interface GhostCatalogNode {
|
|
8
|
+
id: string;
|
|
9
|
+
/** Optional filename prefix before the first dot (`principle.density`). */
|
|
10
|
+
kind?: string;
|
|
11
|
+
/** Filename slug: bare name, or the part after the first dot. */
|
|
12
|
+
slug: string;
|
|
13
|
+
/** Retrieval payload shown in gather: what applies, when, and what it contributes. */
|
|
14
|
+
description?: string;
|
|
15
|
+
/** Optional material locators carried by the authored node. */
|
|
16
|
+
materials?: string[];
|
|
17
|
+
/** True when the node carries a material locator, substantial fence, or Skeleton. */
|
|
18
|
+
concrete: boolean;
|
|
19
|
+
/** True when the node body carries a fenced block of at least 3 lines. */
|
|
20
|
+
hasFencedExample: boolean;
|
|
21
|
+
/** True when the node declares a `## Skeleton` section. */
|
|
22
|
+
hasSkeleton: boolean;
|
|
23
|
+
body: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* The in-memory fingerprint catalog: prose nodes indexed by id. A flat map —
|
|
27
|
+
* no edges, no cascade, no traversal. Identity comes from each file's path.
|
|
28
|
+
*/
|
|
29
|
+
export interface GhostCatalog {
|
|
30
|
+
/** Every node, indexed by id. */
|
|
31
|
+
nodes: Map<string, GhostCatalogNode>;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/ghost-core/catalog/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,2EAA2E;IAC3E,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,iEAAiE;IACjE,IAAI,EAAE,MAAM,CAAC;IACb,sFAAsF;IACtF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,+DAA+D;IAC/D,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,qFAAqF;IACrF,QAAQ,EAAE,OAAO,CAAC;IAClB,0EAA0E;IAC1E,gBAAgB,EAAE,OAAO,CAAC;IAC1B,2DAA2D;IAC3D,WAAW,EAAE,OAAO,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,iCAAiC;IACjC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;CACtC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/ghost-core/catalog/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public surface for `ghost.check/v1` — markdown + frontmatter checks an agent
|
|
3
|
+
* evaluates (Ghost never runs them). Every check is offered to the reviewer;
|
|
4
|
+
* the agent judges relevance against the diff and the grounded prose. A check's
|
|
5
|
+
* optional `source:` names the fingerprint prose it enforces.
|
|
6
|
+
*/
|
|
7
|
+
export { lintGhostCheck } from "./lint.js";
|
|
8
|
+
export { loadGhostCheck } from "./load.js";
|
|
9
|
+
export { type ParsedCheckMarkdown, parseCheckMarkdown } from "./parse.js";
|
|
10
|
+
export { type ParsedSourceRef, parseSourceRef, sliceNodeSection, } from "./source-ref.js";
|
|
11
|
+
export { GHOST_CHECK_SCHEMA, GHOST_CHECK_SEVERITIES, type GhostCheckDocument, type GhostCheckFrontmatter, type GhostCheckLintIssue, type GhostCheckLintReport, type GhostCheckLintSeverity, type GhostCheckMarkdownSeverity, } from "./types.js";
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ghost-core/check/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,KAAK,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAC1E,OAAO,EACL,KAAK,eAAe,EACpB,cAAc,EACd,gBAAgB,GACjB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAC3B,KAAK,0BAA0B,GAChC,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public surface for `ghost.check/v1` — markdown + frontmatter checks an agent
|
|
3
|
+
* evaluates (Ghost never runs them). Every check is offered to the reviewer;
|
|
4
|
+
* the agent judges relevance against the diff and the grounded prose. A check's
|
|
5
|
+
* optional `source:` names the fingerprint prose it enforces.
|
|
6
|
+
*/
|
|
7
|
+
export { lintGhostCheck } from "./lint.js";
|
|
8
|
+
export { loadGhostCheck } from "./load.js";
|
|
9
|
+
export { parseCheckMarkdown } from "./parse.js";
|
|
10
|
+
export { parseSourceRef, sliceNodeSection, } from "./source-ref.js";
|
|
11
|
+
export { GHOST_CHECK_SCHEMA, GHOST_CHECK_SEVERITIES, } from "./types.js";
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ghost-core/check/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAA4B,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAC1E,OAAO,EAEL,cAAc,EACd,gBAAgB,GACjB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,kBAAkB,EAClB,sBAAsB,GAOvB,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type GhostCheckLintReport } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Lint a Ghost check markdown file (`ghost.check/v1`): required frontmatter
|
|
4
|
+
* (`name`, `description`, `severity`), an optional `source:` provenance pointer,
|
|
5
|
+
* and a non-empty body. Ghost never executes the check — this only validates
|
|
6
|
+
* that it is well-formed.
|
|
7
|
+
*/
|
|
8
|
+
export declare function lintGhostCheck(raw: string): GhostCheckLintReport;
|
|
9
|
+
//# sourceMappingURL=lint.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lint.d.ts","sourceRoot":"","sources":["../../../src/ghost-core/check/lint.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,oBAAoB,EAC1B,MAAM,YAAY,CAAC;AAEpB;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,oBAAoB,CAwGhE"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { parseCheckMarkdown } from "./parse.js";
|
|
2
|
+
import { parseSourceRef } from "./source-ref.js";
|
|
3
|
+
import { GHOST_CHECK_SEVERITIES, } from "./types.js";
|
|
4
|
+
/**
|
|
5
|
+
* Lint a Ghost check markdown file (`ghost.check/v1`): required frontmatter
|
|
6
|
+
* (`name`, `description`, `severity`), an optional `source:` provenance pointer,
|
|
7
|
+
* and a non-empty body. Ghost never executes the check — this only validates
|
|
8
|
+
* that it is well-formed.
|
|
9
|
+
*/
|
|
10
|
+
export function lintGhostCheck(raw) {
|
|
11
|
+
const issues = [];
|
|
12
|
+
const { frontmatter, body } = parseCheckMarkdown(raw);
|
|
13
|
+
if (frontmatter === null) {
|
|
14
|
+
issues.push({
|
|
15
|
+
severity: "error",
|
|
16
|
+
rule: "check-frontmatter-missing",
|
|
17
|
+
message: "check must begin with a YAML frontmatter block delimited by `---` lines",
|
|
18
|
+
path: "<frontmatter>",
|
|
19
|
+
});
|
|
20
|
+
return finalize(issues);
|
|
21
|
+
}
|
|
22
|
+
requireString(frontmatter, "name", issues);
|
|
23
|
+
requireString(frontmatter, "description", issues);
|
|
24
|
+
const severity = frontmatter.severity;
|
|
25
|
+
if (severity === undefined) {
|
|
26
|
+
issues.push({
|
|
27
|
+
severity: "error",
|
|
28
|
+
rule: "check-severity-missing",
|
|
29
|
+
message: "frontmatter must declare a severity",
|
|
30
|
+
path: "severity",
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
else if (typeof severity !== "string" ||
|
|
34
|
+
!GHOST_CHECK_SEVERITIES.includes(severity)) {
|
|
35
|
+
issues.push({
|
|
36
|
+
severity: "error",
|
|
37
|
+
rule: "check-severity-invalid",
|
|
38
|
+
message: `severity must be one of: ${GHOST_CHECK_SEVERITIES.join(", ")}`,
|
|
39
|
+
path: "severity",
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
const references = frontmatter.references;
|
|
43
|
+
if (references !== undefined) {
|
|
44
|
+
if (!Array.isArray(references)) {
|
|
45
|
+
issues.push({
|
|
46
|
+
severity: "error",
|
|
47
|
+
rule: "check-references-invalid",
|
|
48
|
+
message: "references must be an array of node refs",
|
|
49
|
+
path: "references",
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
references.forEach((reference, index) => {
|
|
54
|
+
if (typeof reference !== "string" ||
|
|
55
|
+
parseSourceRef(reference) === null) {
|
|
56
|
+
issues.push({
|
|
57
|
+
severity: "warning",
|
|
58
|
+
rule: "check-reference-malformed",
|
|
59
|
+
message: "references entries should be node path ids with optional `> Heading` anchors (e.g. 'checkout/payment > Confirmation')",
|
|
60
|
+
path: `references[${index}]`,
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
const probe = frontmatter.probe;
|
|
67
|
+
if (probe !== undefined &&
|
|
68
|
+
(typeof probe !== "string" || probe.trim() === "")) {
|
|
69
|
+
issues.push({
|
|
70
|
+
severity: "error",
|
|
71
|
+
rule: "check-probe-invalid",
|
|
72
|
+
message: "probe must be a non-empty shell command string",
|
|
73
|
+
path: "probe",
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
const source = frontmatter.source;
|
|
77
|
+
if (source !== undefined) {
|
|
78
|
+
// `source:` is a deprecated soft provenance pointer: `<node-id>` with an
|
|
79
|
+
// optional `> <heading>` anchor. Keep linting it so older standalone check
|
|
80
|
+
// files still get useful feedback.
|
|
81
|
+
if (typeof source !== "string" || parseSourceRef(source) === null) {
|
|
82
|
+
issues.push({
|
|
83
|
+
severity: "warning",
|
|
84
|
+
rule: "check-source-malformed",
|
|
85
|
+
message: "source should be a node path id with an optional `> Heading` anchor (e.g. 'checkout/payment > Confirmation')",
|
|
86
|
+
path: "source",
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
if (body.trim().length === 0) {
|
|
91
|
+
issues.push({
|
|
92
|
+
severity: "error",
|
|
93
|
+
rule: "check-body-empty",
|
|
94
|
+
message: "check body must contain instructions for the evaluating agent",
|
|
95
|
+
path: "<body>",
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
return finalize(issues);
|
|
99
|
+
}
|
|
100
|
+
function requireString(frontmatter, key, issues) {
|
|
101
|
+
const value = frontmatter[key];
|
|
102
|
+
if (typeof value !== "string" || value.trim().length === 0) {
|
|
103
|
+
issues.push({
|
|
104
|
+
severity: "error",
|
|
105
|
+
rule: `check-${key}-missing`,
|
|
106
|
+
message: `frontmatter must declare a non-empty ${key}`,
|
|
107
|
+
path: key,
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
function finalize(issues) {
|
|
112
|
+
return {
|
|
113
|
+
issues,
|
|
114
|
+
errors: issues.filter((issue) => issue.severity === "error").length,
|
|
115
|
+
warnings: issues.filter((issue) => issue.severity === "warning").length,
|
|
116
|
+
info: issues.filter((issue) => issue.severity === "info").length,
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
//# sourceMappingURL=lint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lint.js","sourceRoot":"","sources":["../../../src/ghost-core/check/lint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EACL,sBAAsB,GAGvB,MAAM,YAAY,CAAC;AAEpB;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,GAAW;IACxC,MAAM,MAAM,GAA0B,EAAE,CAAC;IACzC,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC;IAEtD,IAAI,WAAW,KAAK,IAAI,EAAE,CAAC;QACzB,MAAM,CAAC,IAAI,CAAC;YACV,QAAQ,EAAE,OAAO;YACjB,IAAI,EAAE,2BAA2B;YACjC,OAAO,EACL,yEAAyE;YAC3E,IAAI,EAAE,eAAe;SACtB,CAAC,CAAC;QACH,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC1B,CAAC;IAED,aAAa,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAC3C,aAAa,CAAC,WAAW,EAAE,aAAa,EAAE,MAAM,CAAC,CAAC;IAElD,MAAM,QAAQ,GAAG,WAAW,CAAC,QAAQ,CAAC;IACtC,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC3B,MAAM,CAAC,IAAI,CAAC;YACV,QAAQ,EAAE,OAAO;YACjB,IAAI,EAAE,wBAAwB;YAC9B,OAAO,EAAE,qCAAqC;YAC9C,IAAI,EAAE,UAAU;SACjB,CAAC,CAAC;IACL,CAAC;SAAM,IACL,OAAO,QAAQ,KAAK,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AAO;QACL,MAAM;QACN,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,MAAM;QACnE,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,MAAM;QACvE,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,KAAK,MAAM,CAAC,CAAC,MAAM;KACjE,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { GhostCheckDocument } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Parse a well-formed Ghost check into a typed document. Assumes the input has
|
|
4
|
+
* already passed `lintGhostCheck` (throws on missing required frontmatter).
|
|
5
|
+
*/
|
|
6
|
+
export declare function loadGhostCheck(raw: string): GhostCheckDocument;
|
|
7
|
+
//# sourceMappingURL=load.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load.d.ts","sourceRoot":"","sources":["../../../src/ghost-core/check/load.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,kBAAkB,EAEnB,MAAM,YAAY,CAAC;AAEpB;;;GAGG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,kBAAkB,CA+C9D"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { parseCheckMarkdown } from "./parse.js";
|
|
2
|
+
/**
|
|
3
|
+
* Parse a well-formed Ghost check into a typed document. Assumes the input has
|
|
4
|
+
* already passed `lintGhostCheck` (throws on missing required frontmatter).
|
|
5
|
+
*/
|
|
6
|
+
export function loadGhostCheck(raw) {
|
|
7
|
+
const { frontmatter, body } = parseCheckMarkdown(raw);
|
|
8
|
+
if (frontmatter === null) {
|
|
9
|
+
throw new Error("Ghost check is missing a YAML frontmatter block.");
|
|
10
|
+
}
|
|
11
|
+
const name = frontmatter.name;
|
|
12
|
+
const description = frontmatter.description;
|
|
13
|
+
const severity = frontmatter.severity;
|
|
14
|
+
if (typeof name !== "string" || typeof description !== "string") {
|
|
15
|
+
throw new Error("Ghost check frontmatter is missing name or description.");
|
|
16
|
+
}
|
|
17
|
+
const tools = Array.isArray(frontmatter.tools)
|
|
18
|
+
? frontmatter.tools.filter((tool) => typeof tool === "string")
|
|
19
|
+
: undefined;
|
|
20
|
+
const turnLimit = typeof frontmatter["turn-limit"] === "number"
|
|
21
|
+
? frontmatter["turn-limit"]
|
|
22
|
+
: typeof frontmatter.turn_limit === "number"
|
|
23
|
+
? frontmatter.turn_limit
|
|
24
|
+
: undefined;
|
|
25
|
+
const references = Array.isArray(frontmatter.references)
|
|
26
|
+
? frontmatter.references.filter((reference) => typeof reference === "string")
|
|
27
|
+
: undefined;
|
|
28
|
+
const source = typeof frontmatter.source === "string" ? frontmatter.source : undefined;
|
|
29
|
+
const probe = typeof frontmatter.probe === "string" ? frontmatter.probe : undefined;
|
|
30
|
+
return {
|
|
31
|
+
frontmatter: {
|
|
32
|
+
name,
|
|
33
|
+
description,
|
|
34
|
+
severity: severity,
|
|
35
|
+
...(tools ? { tools } : {}),
|
|
36
|
+
...(turnLimit !== undefined ? { turn_limit: turnLimit } : {}),
|
|
37
|
+
...(references ? { references } : {}),
|
|
38
|
+
...(source ? { source } : {}),
|
|
39
|
+
...(probe ? { probe } : {}),
|
|
40
|
+
},
|
|
41
|
+
body,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=load.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load.js","sourceRoot":"","sources":["../../../src/ghost-core/check/load.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAMhD;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,GAAW;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AC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;IAC1E,MAAM,KAAK,GACT,OAAO,WAAW,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;IAExE,OAAO;QACL,WAAW,EAAE;YACX,IAAI;YACJ,WAAW;YACX,QAAQ,EAAE,QAAsC;YAChD,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAC3B,GAAG,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAC7D,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACrC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAC7B,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAC5B;QACD,IAAI;KACL,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type ParsedMarkdown } from "../markdown.js";
|
|
2
|
+
export type ParsedCheckMarkdown = ParsedMarkdown;
|
|
3
|
+
/**
|
|
4
|
+
* Split a markdown check into its YAML frontmatter and body. A check file is
|
|
5
|
+
* `---\n<yaml>\n---\n<body>`. Returns `frontmatter: null` when there is no
|
|
6
|
+
* leading frontmatter block (the caller's lint reports it as an error).
|
|
7
|
+
*
|
|
8
|
+
* Thin alias over the shared {@link splitMarkdownFrontmatter}; checks and nodes
|
|
9
|
+
* share one envelope splitter.
|
|
10
|
+
*/
|
|
11
|
+
export declare function parseCheckMarkdown(raw: string): ParsedCheckMarkdown;
|
|
12
|
+
//# sourceMappingURL=parse.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../../src/ghost-core/check/parse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAA4B,MAAM,gBAAgB,CAAC;AAE/E,MAAM,MAAM,mBAAmB,GAAG,cAAc,CAAC;AAEjD;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,mBAAmB,CAEnE"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { splitMarkdownFrontmatter } from "../markdown.js";
|
|
2
|
+
/**
|
|
3
|
+
* Split a markdown check into its YAML frontmatter and body. A check file is
|
|
4
|
+
* `---\n<yaml>\n---\n<body>`. Returns `frontmatter: null` when there is no
|
|
5
|
+
* leading frontmatter block (the caller's lint reports it as an error).
|
|
6
|
+
*
|
|
7
|
+
* Thin alias over the shared {@link splitMarkdownFrontmatter}; checks and nodes
|
|
8
|
+
* share one envelope splitter.
|
|
9
|
+
*/
|
|
10
|
+
export function parseCheckMarkdown(raw) {
|
|
11
|
+
return splitMarkdownFrontmatter(raw);
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=parse.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse.js","sourceRoot":"","sources":["../../../src/ghost-core/check/parse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAI/E;;;;;;;GAOG;AACH,MAAM,UAAU,kBAAkB,CAAC,GAAW;IAC5C,OAAO,wBAAwB,CAAC,GAAG,CAAC,CAAC;AACvC,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A parsed `source:` reference: the node path id it points at, plus the
|
|
3
|
+
* optional heading anchor (`checkout/payment > Confirmation` → nodeId
|
|
4
|
+
* `checkout/payment`, heading `Confirmation`).
|
|
5
|
+
*/
|
|
6
|
+
export interface ParsedSourceRef {
|
|
7
|
+
nodeId: string;
|
|
8
|
+
heading?: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Parse the check `source:` reference grammar — `<node-id> > <Heading>`.
|
|
12
|
+
* Splits on the *first* `>` and trims both parts. Returns `null` when the
|
|
13
|
+
* node-id part is not a valid node path id (or the input is empty); the
|
|
14
|
+
* heading is present only when a non-empty anchor follows the `>`. This is
|
|
15
|
+
* shape validation only — whether the node (or heading) exists is the
|
|
16
|
+
* caller's concern: an unresolved ref may name not-yet-written prose.
|
|
17
|
+
*/
|
|
18
|
+
export declare function parseSourceRef(raw: string): ParsedSourceRef | null;
|
|
19
|
+
/**
|
|
20
|
+
* Slice the section a heading anchor points at out of a node body. Matches the
|
|
21
|
+
* first markdown heading line (any level) whose text equals `heading`
|
|
22
|
+
* case-insensitively, then returns everything up to the next heading of the
|
|
23
|
+
* same or higher level (or end of body), trimmed. Returns `null` when no
|
|
24
|
+
* heading matches.
|
|
25
|
+
*/
|
|
26
|
+
export declare function sliceNodeSection(body: string, heading: string): string | null;
|
|
27
|
+
//# sourceMappingURL=source-ref.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source-ref.d.ts","sourceRoot":"","sources":["../../../src/ghost-core/check/source-ref.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,eAAe,GAAG,IAAI,CAUlE;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAgC7E"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { NodeIdSchema } from "../node/schema.js";
|
|
2
|
+
/**
|
|
3
|
+
* Parse the check `source:` reference grammar — `<node-id> > <Heading>`.
|
|
4
|
+
* Splits on the *first* `>` and trims both parts. Returns `null` when the
|
|
5
|
+
* node-id part is not a valid node path id (or the input is empty); the
|
|
6
|
+
* heading is present only when a non-empty anchor follows the `>`. This is
|
|
7
|
+
* shape validation only — whether the node (or heading) exists is the
|
|
8
|
+
* caller's concern: an unresolved ref may name not-yet-written prose.
|
|
9
|
+
*/
|
|
10
|
+
export function parseSourceRef(raw) {
|
|
11
|
+
const splitAt = raw.indexOf(">");
|
|
12
|
+
const nodePart = (splitAt === -1 ? raw : raw.slice(0, splitAt)).trim();
|
|
13
|
+
if (!NodeIdSchema.safeParse(nodePart).success) {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
const heading = splitAt === -1 ? "" : raw.slice(splitAt + 1).trim();
|
|
17
|
+
return heading.length > 0
|
|
18
|
+
? { nodeId: nodePart, heading }
|
|
19
|
+
: { nodeId: nodePart };
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Slice the section a heading anchor points at out of a node body. Matches the
|
|
23
|
+
* first markdown heading line (any level) whose text equals `heading`
|
|
24
|
+
* case-insensitively, then returns everything up to the next heading of the
|
|
25
|
+
* same or higher level (or end of body), trimmed. Returns `null` when no
|
|
26
|
+
* heading matches.
|
|
27
|
+
*/
|
|
28
|
+
export function sliceNodeSection(body, heading) {
|
|
29
|
+
const wanted = heading.trim().toLowerCase();
|
|
30
|
+
const lines = body.split("\n");
|
|
31
|
+
const headingPattern = /^(#{1,6})\s+(.*)$/;
|
|
32
|
+
let startLine = -1;
|
|
33
|
+
let level = 0;
|
|
34
|
+
for (let i = 0; i < lines.length; i += 1) {
|
|
35
|
+
const match = headingPattern.exec(lines[i]);
|
|
36
|
+
if (match && match[2].trim().toLowerCase() === wanted) {
|
|
37
|
+
startLine = i;
|
|
38
|
+
level = match[1].length;
|
|
39
|
+
break;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
if (startLine === -1) {
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
let endLine = lines.length;
|
|
46
|
+
for (let i = startLine + 1; i < lines.length; i += 1) {
|
|
47
|
+
const match = headingPattern.exec(lines[i]);
|
|
48
|
+
if (match && match[1].length <= level) {
|
|
49
|
+
endLine = i;
|
|
50
|
+
break;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return lines
|
|
54
|
+
.slice(startLine + 1, endLine)
|
|
55
|
+
.join("\n")
|
|
56
|
+
.trim();
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=source-ref.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source-ref.js","sourceRoot":"","sources":["../../../src/ghost-core/check/source-ref.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAYjD;;;;;;;GAOG;AACH,MAAM,UAAU,cAAc,CAAC,GAAW;IACxC,MAAM,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACjC,MAAM,QAAQ,GAAG,CAAC,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IACvE,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,OAAO,EAAE,CAAC;QAC9C,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,OAAO,GAAG,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IACpE,OAAO,OAAO,CAAC,MAAM,GAAG,CAAC;QACvB,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE;QAC/B,CAAC,CAA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O,GAAG,CAAC,CAAC;YACZ,MAAM;QACR,CAAC;IACH,CAAC;IAED,OAAO,KAAK;SACT,KAAK,CAAC,SAAS,GAAG,CAAC,EAAE,OAAO,CAAC;SAC7B,IAAI,CAAC,IAAI,CAAC;SACV,IAAI,EAAE,CAAC;AACZ,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export declare const GHOST_CHECK_SCHEMA: "ghost.check/v1";
|
|
2
|
+
/** Severity vocabulary, matching the established agent-check format. */
|
|
3
|
+
export declare const GHOST_CHECK_SEVERITIES: readonly ["high", "medium", "low"];
|
|
4
|
+
export type GhostCheckMarkdownSeverity = (typeof GHOST_CHECK_SEVERITIES)[number];
|
|
5
|
+
/**
|
|
6
|
+
* A Ghost check: markdown + frontmatter, evaluated by an agent — never run by
|
|
7
|
+
* Ghost. Shape-compatible with the established `.agents/checks` format, plus the
|
|
8
|
+
* Ghost addition `source:` (the fingerprint prose the check enforces). Every
|
|
9
|
+
* check is offered to the reviewer; the agent judges relevance.
|
|
10
|
+
*/
|
|
11
|
+
export interface GhostCheckFrontmatter {
|
|
12
|
+
name: string;
|
|
13
|
+
description: string;
|
|
14
|
+
severity: GhostCheckMarkdownSeverity;
|
|
15
|
+
/** Tools the check is allowed to use (passthrough for the review pipeline). */
|
|
16
|
+
tools?: string[];
|
|
17
|
+
/** Max tool-use turns the check should spend (passthrough). */
|
|
18
|
+
turn_limit?: number;
|
|
19
|
+
/**
|
|
20
|
+
* The fingerprint prose this check enforces, as node path ids with optional
|
|
21
|
+
* `> Heading` anchors (`checkout/payment > Confirmation`). Unresolved refs are
|
|
22
|
+
* tolerated by validation as warnings: they may name not-yet-written prose.
|
|
23
|
+
*/
|
|
24
|
+
references?: string[];
|
|
25
|
+
/** Deprecated single-reference alias retained for artifact-level linting. */
|
|
26
|
+
source?: string;
|
|
27
|
+
/** Optional repo-owned shell probe run by `ghost review` as evidence only. */
|
|
28
|
+
probe?: string;
|
|
29
|
+
}
|
|
30
|
+
export interface GhostCheckDocument {
|
|
31
|
+
frontmatter: GhostCheckFrontmatter;
|
|
32
|
+
/** The markdown body: prose instructions for the evaluating agent. */
|
|
33
|
+
body: string;
|
|
34
|
+
}
|
|
35
|
+
export type GhostCheckLintSeverity = "error" | "warning" | "info";
|
|
36
|
+
export interface GhostCheckLintIssue {
|
|
37
|
+
severity: GhostCheckLintSeverity;
|
|
38
|
+
rule: string;
|
|
39
|
+
message: string;
|
|
40
|
+
path: string;
|
|
41
|
+
}
|
|
42
|
+
export interface GhostCheckLintReport {
|
|
43
|
+
issues: GhostCheckLintIssue[];
|
|
44
|
+
errors: number;
|
|
45
|
+
warnings: number;
|
|
46
|
+
info: number;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/ghost-core/check/types.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB,EAAG,gBAAyB,CAAC;AAE5D,wEAAwE;AACxE,eAAO,MAAM,sBAAsB,oCAAqC,CAAC;AACzE,MAAM,MAAM,0BAA0B,GACpC,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE1C;;;;;GAKG;AACH,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,0BAA0B,CAAC;IACrC,+EAA+E;IAC/E,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,+DAA+D;IAC/D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,6EAA6E;IAC7E,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,8EAA8E;IAC9E,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,kBAAkB;IACjC,WAAW,EAAE,qBAAqB,CAAC;IACnC,sEAAsE;IACtE,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,MAAM,sBAAsB,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;AAElE,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,sBAAsB,CAAC;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,mBAAmB,EAAE,CAAC;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CACd"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/ghost-core/check/types.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,kBAAkB,GAAG,gBAAyB,CAAC;AAE5D,wEAAwE;AACxE,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,CAAU,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The CLI exit-code contract, in one place so every command agrees and an agent
|
|
3
|
+
* can branch on the code:
|
|
4
|
+
*
|
|
5
|
+
* - `0` success
|
|
6
|
+
* - `1` ran, but unhappy: a lint/validate finding, or an unexpected error
|
|
7
|
+
* - `2` called wrong: a bad flag or argument, a missing package, an unknown
|
|
8
|
+
* node or surface
|
|
9
|
+
* - `3` a command-specific refusal (e.g. `skill install` without `--force`)
|
|
10
|
+
*
|
|
11
|
+
* Usage errors (`2`) are often surfaced by throwing from deep in a helper
|
|
12
|
+
* (path validation, byte budgets, overwrite guards). Throwing `UsageError`
|
|
13
|
+
* instead of a plain `Error` lets the shared catch tell those apart from a
|
|
14
|
+
* genuine crash, so the contract holds without each call site picking a code.
|
|
15
|
+
*/
|
|
16
|
+
export declare const EXIT: {
|
|
17
|
+
readonly ok: 0;
|
|
18
|
+
readonly failure: 1;
|
|
19
|
+
readonly usage: 2;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* A caller-facing "you used it wrong" error: bad flag or argument, missing
|
|
23
|
+
* package, invalid environment, or a refused overwrite. Reported at exit code
|
|
24
|
+
* 2, distinct from an unexpected crash (1).
|
|
25
|
+
*/
|
|
26
|
+
export declare class UsageError extends Error {
|
|
27
|
+
readonly exitCode: 2;
|
|
28
|
+
constructor(message: string);
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/ghost-core/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,IAAI;;;;CAIP,CAAC;AAEX;;;;GAIG;AACH,qBAAa,UAAW,SAAQ,KAAK;IACnC,QAAQ,CAAC,QAAQ,IAAc;gBACnB,OAAO,EAAE,MAAM;CAI5B"}
|