@warpgogol/werkstatt-shared 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +352 -0
- package/src/checks/index.ts +24 -0
- package/src/checks/lib/astro-site-url.ts +30 -0
- package/src/checks/lib/i18n.ts +30 -0
- package/src/checks/result-helpers.ts +102 -0
- package/src/checks/suppressions-config.ts +195 -0
- package/src/index.ts +14 -0
- package/src/integration/README.md +38 -0
- package/src/integration/adapters.ts +143 -0
- package/src/integration/crm-buffer.ts +491 -0
- package/src/integration/dispatch.ts +106 -0
- package/src/integration/funnel.ts +379 -0
- package/src/integration/index.ts +56 -0
- package/src/integration/lifecycle.ts +155 -0
- package/src/integration/orchestration.ts +439 -0
- package/src/integration/port-barrel.ts +124 -0
- package/src/integration/port.ts +143 -0
- package/src/integration/qstash.ts +134 -0
- package/src/integration/sharding.ts +133 -0
- package/src/integration/tests/deliver-event.test.ts +52 -0
- package/src/integration/tests/dispatch.test.ts +88 -0
- package/src/integration/tests/funnel-bridge.test.ts +46 -0
- package/src/integration/tests/hub-runtime.test.ts +128 -0
- package/src/integration/tests/lifecycle.test.ts +69 -0
- package/src/integration/tests/qstash.test.ts +83 -0
- package/src/integration/tests/sharding.test.ts +64 -0
- package/src/integration/vitest.config.ts +8 -0
- package/src/integration-adapter-supabase-crm/adapter.ts +437 -0
- package/src/integration-adapter-supabase-crm/client.ts +605 -0
- package/src/integration-adapter-supabase-crm/index.ts +28 -0
- package/src/integration-adapter-supabase-crm/pipedrive-sync-target.ts +482 -0
- package/src/integration-adapter-supabase-crm/supabase-rest.ts +89 -0
- package/src/integration-adapter-supabase-crm/tenant-registry.ts +334 -0
- package/src/integration-adapter-supabase-crm/tests/change-balance.pbt.test.ts +83 -0
- package/src/integration-adapter-supabase-crm/tests/funnel-persistence.test.ts +409 -0
- package/src/integration-adapter-supabase-crm/tests/lifecycle-sync.test.ts +288 -0
- package/src/integration-adapter-supabase-crm/tests/stage-map.test.ts +80 -0
- package/src/integration-adapter-supabase-crm/vitest.config.ts +8 -0
- package/src/integration-adapter-supabase-crm/worker.ts +223 -0
- package/src/observability/conventions.ts +93 -0
- package/src/observability/env-resolver.ts +57 -0
- package/src/observability/index.ts +57 -0
- package/src/observability/metric-registry.ts +184 -0
- package/src/observability/otlp-converter.ts +125 -0
- package/src/observability/otlp-json.ts +135 -0
- package/src/observability/otlp-transport.ts +68 -0
- package/src/observability/pusher.ts +142 -0
- package/src/observability/redact.ts +27 -0
- package/src/observability/tests/conventions.test.ts +100 -0
- package/src/observability/tests/metric-registry.test.ts +117 -0
- package/src/observability/tests/otlp-converter.pbt.test.ts +77 -0
- package/src/observability/tests/otlp-converter.test.ts +157 -0
- package/src/observability/tests/otlp-json.test.ts +120 -0
- package/src/observability/tests/pusher.test.ts +75 -0
- package/src/observability/tests/redact.pbt.test.ts +71 -0
- package/src/observability/tests/redact.test.ts +37 -0
- package/src/observability/typed-refs.ts +137 -0
- package/src/observability/vitest.config.ts +8 -0
- package/src/ontology/analytics/matomo-binding.yaml +172 -0
- package/src/ontology/analytics/matomo-fleet.registry.yaml +26 -0
- package/src/ontology/analytics/messkanon.yaml +151 -0
- package/src/ontology/archetype-registry.ts +61 -0
- package/src/ontology/archetypes/components/brand-label.yaml +19 -0
- package/src/ontology/archetypes/components/copyright.yaml +19 -0
- package/src/ontology/archetypes/components/currency-aware-price-display.yaml +19 -0
- package/src/ontology/archetypes/components/currency-selector.yaml +19 -0
- package/src/ontology/archetypes/components/footer-promo.yaml +19 -0
- package/src/ontology/archetypes/components/lang-switcher.yaml +19 -0
- package/src/ontology/archetypes/components/layout.yaml +19 -0
- package/src/ontology/archetypes/components/live-photo.yaml +20 -0
- package/src/ontology/archetypes/components/material-credit.yaml +20 -0
- package/src/ontology/archetypes/components/media.yaml +21 -0
- package/src/ontology/archetypes/components/nachweis-card.yaml +34 -0
- package/src/ontology/archetypes/components/nachweis-detail.yaml +43 -0
- package/src/ontology/archetypes/components/nachweis-list.yaml +37 -0
- package/src/ontology/archetypes/components/nachweis-verify.yaml +31 -0
- package/src/ontology/archetypes/components/not-found.yaml +22 -0
- package/src/ontology/archetypes/components/offer-capacity.yaml +21 -0
- package/src/ontology/archetypes/components/passport-header.yaml +19 -0
- package/src/ontology/archetypes/components/passport-provenance.yaml +20 -0
- package/src/ontology/archetypes/components/passport-score-grid.yaml +20 -0
- package/src/ontology/archetypes/components/passport-star-map.yaml +20 -0
- package/src/ontology/archetypes/components/person-profile.yaml +20 -0
- package/src/ontology/archetypes/components/pulsar.yaml +20 -0
- package/src/ontology/archetypes/components/responsive-image.yaml +19 -0
- package/src/ontology/archetypes/components/scroll-to-top.yaml +22 -0
- package/src/ontology/archetypes/components/social-meta.yaml +20 -0
- package/src/ontology/archetypes/components/structured-data.yaml +19 -0
- package/src/ontology/archetypes/index.json +1003 -0
- package/src/ontology/archetypes/index.yaml +821 -0
- package/src/ontology/archetypes/sections/approach.yaml +23 -0
- package/src/ontology/archetypes/sections/article-list.yaml +30 -0
- package/src/ontology/archetypes/sections/audience-cards.yaml +30 -0
- package/src/ontology/archetypes/sections/breadcrumbs.yaml +21 -0
- package/src/ontology/archetypes/sections/chat-widget.yaml +37 -0
- package/src/ontology/archetypes/sections/comparison-cards.yaml +31 -0
- package/src/ontology/archetypes/sections/controlled-responsibility-block.yaml +34 -0
- package/src/ontology/archetypes/sections/credits.yaml +29 -0
- package/src/ontology/archetypes/sections/donation-card.yaml +53 -0
- package/src/ontology/archetypes/sections/donation-use.yaml +23 -0
- package/src/ontology/archetypes/sections/dynamic-status-block.yaml +35 -0
- package/src/ontology/archetypes/sections/faq-list.yaml +26 -0
- package/src/ontology/archetypes/sections/final-cta.yaml +53 -0
- package/src/ontology/archetypes/sections/hero-decision-card.yaml +65 -0
- package/src/ontology/archetypes/sections/hero.yaml +50 -0
- package/src/ontology/archetypes/sections/impact.yaml +23 -0
- package/src/ontology/archetypes/sections/markdown.yaml +43 -0
- package/src/ontology/archetypes/sections/mountain-journey.yaml +43 -0
- package/src/ontology/archetypes/sections/navigation.yaml +20 -0
- package/src/ontology/archetypes/sections/notausgang-block.yaml +41 -0
- package/src/ontology/archetypes/sections/open-source-registry.yaml +26 -0
- package/src/ontology/archetypes/sections/ownership-block.yaml +57 -0
- package/src/ontology/archetypes/sections/people.yaml +48 -0
- package/src/ontology/archetypes/sections/price-card.yaml +50 -0
- package/src/ontology/archetypes/sections/problem.yaml +23 -0
- package/src/ontology/archetypes/sections/send-message.yaml +63 -0
- package/src/ontology/archetypes/sections/service-metadata-block.yaml +40 -0
- package/src/ontology/archetypes/sections/social-proof.yaml +27 -0
- package/src/ontology/archetypes/sections/transparency.yaml +32 -0
- package/src/ontology/archetypes/sections/trust-strip.yaml +42 -0
- package/src/ontology/archetypes/sections/video-section.yaml +27 -0
- package/src/ontology/archetypes/sections/women.yaml +29 -0
- package/src/ontology/biome-token-projection.ts +229 -0
- package/src/ontology/biomes/check-concrete-blueprint.yaml +118 -0
- package/src/ontology/biomes/handwerk-material-warm.yaml +135 -0
- package/src/ontology/biomes/nonprofit-trust.yaml +123 -0
- package/src/ontology/blueprints/offer.yaml +39 -0
- package/src/ontology/blueprints/prompts/local-market-signal.md +13 -0
- package/src/ontology/blueprints/prompts/website-local-narrative.md +24 -0
- package/src/ontology/blueprints/ratgeber.yaml +62 -0
- package/src/ontology/blueprints/website-local.yaml +309 -0
- package/src/ontology/blueprints/website-service.yaml +84 -0
- package/src/ontology/capabilities/lead.submit.yaml +44 -0
- package/src/ontology/cosmic/index.ts +48 -0
- package/src/ontology/cosmic/moon-catalog.ts +173 -0
- package/src/ontology/cosmic/planet-catalog.ts +82 -0
- package/src/ontology/cosmic/star-catalog.ts +337 -0
- package/src/ontology/enums.ts +159 -0
- package/src/ontology/external-surfaces/index.ts +158 -0
- package/src/ontology/external-surfaces/jsonld-types.yaml +135 -0
- package/src/ontology/external-surfaces/sitemap-shape.yaml +6 -0
- package/src/ontology/external-surfaces/url-schema.yaml +95 -0
- package/src/ontology/growth/events/contact-email-click.yaml +21 -0
- package/src/ontology/growth/events/contact-form-submit.yaml +25 -0
- package/src/ontology/growth/events/contact-phone-click.yaml +21 -0
- package/src/ontology/growth/events/contact-route-click.yaml +21 -0
- package/src/ontology/growth/events/contact-submit.yaml +28 -0
- package/src/ontology/growth/events/contact-whatsapp-click.yaml +21 -0
- package/src/ontology/growth/events/cta-click.yaml +30 -0
- package/src/ontology/growth/events/donation-confirmed.yaml +32 -0
- package/src/ontology/growth/events/donation-form-start.yaml +21 -0
- package/src/ontology/growth/events/donation-form-submit.yaml +29 -0
- package/src/ontology/growth/events/donation-intent.yaml +29 -0
- package/src/ontology/growth/events/form-error.yaml +27 -0
- package/src/ontology/growth/events/form-start.yaml +21 -0
- package/src/ontology/growth/events/form-submit.yaml +21 -0
- package/src/ontology/growth/events/outbound-click.yaml +25 -0
- package/src/ontology/growth/events/page-view.yaml +24 -0
- package/src/ontology/growth/events/passport-view.yaml +28 -0
- package/src/ontology/growth/events/star-map-navigate.yaml +30 -0
- package/src/ontology/index.ts +165 -0
- package/src/ontology/manifest.ts +344 -0
- package/src/ontology/operations/index.ts +1 -0
- package/src/ontology/schemas/biome.ts +303 -0
- package/src/ontology/schemas/capability.ts +104 -0
- package/src/ontology/schemas/constellation.ts +114 -0
- package/src/ontology/schemas/dns-records.ts +53 -0
- package/src/ontology/schemas/index.ts +95 -0
- package/src/ontology/schemas/manifest-resolver.ts +123 -0
- package/src/ontology/schemas/page-entry.ts +213 -0
- package/src/ontology/schemas/section-archetype.ts +109 -0
- package/src/ontology/schemas/site-family.ts +98 -0
- package/src/ontology/schemas/system/growth.ts +80 -0
- package/src/ontology/schemas/system/integrations.ts +143 -0
- package/src/ontology/schemas/system/manifest.ts +492 -0
- package/src/ontology/schemas/system/page-output.ts +99 -0
- package/src/ontology/schemas/system/release.ts +58 -0
- package/src/ontology/schemas/system/text.ts +58 -0
- package/src/ontology/schemas/system.ts +53 -0
- package/src/ontology/shared-section-props/body-fragments.ts +182 -0
- package/src/ontology/shared-section-props/catalog.ts +195 -0
- package/src/ontology/shared-section-props/common.ts +178 -0
- package/src/ontology/shared-section-props/index.ts +34 -0
- package/src/ontology/shared-section-props/visual-header.ts +163 -0
- package/src/ontology/site-families/charity-donation-trust/cultural-rules.yaml +6 -0
- package/src/ontology/site-families/charity-donation-trust/family.yaml +44 -0
- package/src/ontology/site-families/charity-donation-trust/linguistic-rules.yaml +6 -0
- package/src/ontology/site-families/check-quality-operator/cultural-rules.yaml +6 -0
- package/src/ontology/site-families/check-quality-operator/family.yaml +40 -0
- package/src/ontology/site-families/check-quality-operator/linguistic-rules.yaml +6 -0
- package/src/ontology/site-families/handwerk-trust-engineering/cultural-rules.yaml +6 -0
- package/src/ontology/site-families/handwerk-trust-engineering/family.yaml +53 -0
- package/src/ontology/site-families/handwerk-trust-engineering/linguistic-rules.yaml +6 -0
- package/src/ontology/tests/catalogs.pbt.test.ts +89 -0
- package/src/ontology/tests/enums.test.ts +203 -0
- package/src/ontology/tests/sternsystem-owner.test.ts +63 -0
- package/src/ontology/vitest.config.ts +8 -0
- package/src/passport/dht-sign.test.ts +99 -0
- package/src/passport/dht-sign.ts +73 -0
- package/src/passport/identity-sign.test.ts +134 -0
- package/src/passport/identity-sign.ts +85 -0
- package/src/passport/index.ts +53 -0
- package/src/passport/key-rotate.ts +133 -0
- package/src/passport/schema.ts +198 -0
- package/src/passport/sign.ts +225 -0
- package/src/passport/tests/schema.pbt.test.ts +93 -0
- package/src/passport/tests/schema.test.ts +222 -0
- package/src/passport/vitest.config.ts +8 -0
- package/src/share/agent/api-catalog.ts +77 -0
- package/src/share/agent/capability.ts +68 -0
- package/src/share/agent/dns-aid.test.ts +74 -0
- package/src/share/agent/dns-aid.ts +53 -0
- package/src/share/agent/fleet-catalog.ts +149 -0
- package/src/share/agent/index.ts +29 -0
- package/src/share/agent/knowledge.ts +96 -0
- package/src/share/agent/manifest.ts +126 -0
- package/src/share/agent/mcp-card.ts +63 -0
- package/src/share/agent/omit-empty.ts +77 -0
- package/src/share/agent/openapi.ts +157 -0
- package/src/share/agent/proof.ts +61 -0
- package/src/share/attribution-display.ts +86 -0
- package/src/share/check-hints.ts +38 -0
- package/src/share/content/entity-id.ts +65 -0
- package/src/share/content/index.ts +16 -0
- package/src/share/content/merge.ts +86 -0
- package/src/share/content/resolve-field-path.ts +39 -0
- package/src/share/content/substitute-deep.ts +47 -0
- package/src/share/content-discipline/index.ts +14 -0
- package/src/share/content-discipline/parsers.ts +66 -0
- package/src/share/content-discipline/types.ts +118 -0
- package/src/share/content-reference.ts +333 -0
- package/src/share/counter-utils.ts +75 -0
- package/src/share/css-value-normalize.ts +48 -0
- package/src/share/dev-props-validator.ts +131 -0
- package/src/share/entitlement.ts +172 -0
- package/src/share/env.d.ts +73 -0
- package/src/share/feature-policy.ts +367 -0
- package/src/share/formula-eval.ts +364 -0
- package/src/share/fs/index.ts +96 -0
- package/src/share/i18n/localization.ts +57 -0
- package/src/share/image-provider.ts +314 -0
- package/src/share/index.ts +86 -0
- package/src/share/knowledge/claim.ts +129 -0
- package/src/share/knowledge/derivation.ts +55 -0
- package/src/share/knowledge/freshness.ts +127 -0
- package/src/share/knowledge/index.ts +23 -0
- package/src/share/knowledge/ledger.ts +222 -0
- package/src/share/knowledge/plan.ts +122 -0
- package/src/share/knowledge/source.ts +170 -0
- package/src/share/legal/translation-policy.ts +133 -0
- package/src/share/material-credits.ts +181 -0
- package/src/share/middleware/language-redirect.ts +49 -0
- package/src/share/offer-capacity.ts +149 -0
- package/src/share/onboarding-yaml/index.ts +162 -0
- package/src/share/page.ts +351 -0
- package/src/share/redirects.test.ts +62 -0
- package/src/share/redirects.ts +54 -0
- package/src/share/rfc0042-utils.ts +95 -0
- package/src/share/runtime-context.ts +70 -0
- package/src/share/schemas/claim-records.ts +69 -0
- package/src/share/schemas/claims.ts +150 -0
- package/src/share/schemas/effects.ts +212 -0
- package/src/share/schemas/features.ts +147 -0
- package/src/share/schemas/horizontal-align.ts +22 -0
- package/src/share/schemas/icon-color.ts +27 -0
- package/src/share/schemas/index.ts +43 -0
- package/src/share/schemas/live-photo.ts +53 -0
- package/src/share/schemas/material-credit.ts +292 -0
- package/src/share/schemas/media.ts +220 -0
- package/src/share/schemas/navigation.ts +74 -0
- package/src/share/schemas/page-base.ts +33 -0
- package/src/share/schemas/participant.ts +247 -0
- package/src/share/schemas/person.ts +24 -0
- package/src/share/schemas/print.ts +93 -0
- package/src/share/schemas/section-background.ts +106 -0
- package/src/share/schemas/section-body.ts +138 -0
- package/src/share/schemas/section-cards.ts +37 -0
- package/src/share/schemas/section-cta.ts +74 -0
- package/src/share/schemas/section-header.ts +77 -0
- package/src/share/schemas/section-image.ts +77 -0
- package/src/share/schemas/section-motion.ts +52 -0
- package/src/share/schemas/section-shell.ts +63 -0
- package/src/share/schemas/section-stats.ts +37 -0
- package/src/share/schemas/site-background.ts +78 -0
- package/src/share/schemas/standard-list-item.ts +38 -0
- package/src/share/scripts/external-links.ts +45 -0
- package/src/share/scripts/gsap-counter.ts +168 -0
- package/src/share/scripts/gsap-mountain-journey.ts +236 -0
- package/src/share/scripts/gsap-parallax.ts +50 -0
- package/src/share/scripts/gsap-reveal.ts +65 -0
- package/src/share/scripts/gsap-stagger.ts +54 -0
- package/src/share/scripts/index.ts +25 -0
- package/src/share/scripts/inline-number-animation.ts +120 -0
- package/src/share/scripts/lenis.ts +109 -0
- package/src/share/scripts/live-photos.ts +250 -0
- package/src/share/scripts/lordicon.ts +94 -0
- package/src/share/scripts/orchestrator.ts +138 -0
- package/src/share/scripts/scheduler.ts +53 -0
- package/src/share/scripts/video-player.ts +116 -0
- package/src/share/semantic/ai.ts +140 -0
- package/src/share/semantic/block-extraction.ts +52 -0
- package/src/share/semantic/block-extractors/index.ts +502 -0
- package/src/share/semantic/breadcrumbs.ts +120 -0
- package/src/share/semantic/build-page.ts +309 -0
- package/src/share/semantic/business-projection.ts +278 -0
- package/src/share/semantic/derived-prices-loader.ts +36 -0
- package/src/share/semantic/extract.ts +118 -0
- package/src/share/semantic/feed.ts +124 -0
- package/src/share/semantic/ids.ts +76 -0
- package/src/share/semantic/image-sitemap.ts +153 -0
- package/src/share/semantic/index.ts +36 -0
- package/src/share/semantic/jsonld/article.ts +47 -0
- package/src/share/semantic/jsonld/breadcrumb.ts +47 -0
- package/src/share/semantic/jsonld/collection-list.ts +30 -0
- package/src/share/semantic/jsonld/context.ts +46 -0
- package/src/share/semantic/jsonld/faq.ts +49 -0
- package/src/share/semantic/jsonld/initiative.ts +53 -0
- package/src/share/semantic/jsonld/organization.ts +101 -0
- package/src/share/semantic/jsonld/person.ts +71 -0
- package/src/share/semantic/jsonld/service.ts +80 -0
- package/src/share/semantic/jsonld/shared.ts +31 -0
- package/src/share/semantic/jsonld/types.ts +18 -0
- package/src/share/semantic/jsonld/webpage.ts +98 -0
- package/src/share/semantic/jsonld/website.ts +27 -0
- package/src/share/semantic/jsonld.ts +75 -0
- package/src/share/semantic/llms-policy.ts +74 -0
- package/src/share/semantic/llms.ts +394 -0
- package/src/share/semantic/markdown-hygiene.ts +68 -0
- package/src/share/semantic/markdown-twin-provenance.ts +242 -0
- package/src/share/semantic/models.ts +402 -0
- package/src/share/semantic/organization-profile.ts +160 -0
- package/src/share/semantic/output-projection.ts +131 -0
- package/src/share/semantic/page-builders/markdown-page.ts +84 -0
- package/src/share/semantic/page-markdown.ts +234 -0
- package/src/share/semantic/page-utils.ts +125 -0
- package/src/share/semantic/price-marker-resolver.ts +92 -0
- package/src/share/semantic/robots.ts +127 -0
- package/src/share/semantic/update-stamp.ts +136 -0
- package/src/share/shared-context.ts +177 -0
- package/src/share/string-utils.ts +19 -0
- package/src/share/tests/api-catalog.test.ts +97 -0
- package/src/share/tests/breadcrumbs.test.ts +126 -0
- package/src/share/tests/build-page-price-markers.test.ts +160 -0
- package/src/share/tests/capability.test.ts +107 -0
- package/src/share/tests/claim.test.ts +90 -0
- package/src/share/tests/content-ref-index.test.ts +328 -0
- package/src/share/tests/create-dev-props-validator.test.ts +38 -0
- package/src/share/tests/derivation.test.ts +39 -0
- package/src/share/tests/dev-props-validator.test.ts +88 -0
- package/src/share/tests/fleet-catalog.test.ts +134 -0
- package/src/share/tests/formula-eval.test.ts +619 -0
- package/src/share/tests/freshness.test.ts +60 -0
- package/src/share/tests/hero-section-numbering-parity.test.ts +51 -0
- package/src/share/tests/image-sitemap.test.ts +101 -0
- package/src/share/tests/jsonld-service.test.ts +282 -0
- package/src/share/tests/knowledge.test.ts +86 -0
- package/src/share/tests/ledger.test.ts +125 -0
- package/src/share/tests/llms-0789.test.ts +63 -0
- package/src/share/tests/manifest.test.ts +100 -0
- package/src/share/tests/markdown-twin-provenance.test.ts +108 -0
- package/src/share/tests/mcp-card.test.ts +57 -0
- package/src/share/tests/onboarding-yaml.test.ts +111 -0
- package/src/share/tests/ontology-role-by-cosmic-name.test.ts +28 -0
- package/src/share/tests/openapi.test.ts +116 -0
- package/src/share/tests/organization-jsonld.test.ts +74 -0
- package/src/share/tests/output-projection.test.ts +61 -0
- package/src/share/tests/plan.test.ts +97 -0
- package/src/share/tests/price-marker-resolver.test.ts +141 -0
- package/src/share/tests/proof.test.ts +72 -0
- package/src/share/tests/resolve-field-path.test.ts +52 -0
- package/src/share/tests/source.test.ts +81 -0
- package/src/share/tests/substitute-deep.test.ts +65 -0
- package/src/share/tests/text-normalize.pbt.test.ts +143 -0
- package/src/share/tests/text-normalize.test.ts +285 -0
- package/src/share/tests/twin-path.test.ts +43 -0
- package/src/share/text-normalize.ts +548 -0
- package/src/share/text-position.ts +19 -0
- package/src/share/types/hls-js-light.d.ts +16 -0
- package/src/share/visibility.ts +167 -0
- package/src/share/vitest.config.ts +8 -0
- package/src/share/wrap-inline-numbers.ts +139 -0
- package/src/surface/blueprint-schema.ts +314 -0
- package/src/surface/blueprint-types.ts +256 -0
- package/src/surface/blueprint.ts +300 -0
- package/src/surface/breaker.ts +57 -0
- package/src/surface/decision-composer.ts +156 -0
- package/src/surface/eligibility.ts +372 -0
- package/src/surface/evidence-records.ts +97 -0
- package/src/surface/fleet.ts +60 -0
- package/src/surface/geo.ts +170 -0
- package/src/surface/governance.ts +146 -0
- package/src/surface/index.ts +216 -0
- package/src/surface/io/index.ts +18 -0
- package/src/surface/io/surface-module-context-io.ts +60 -0
- package/src/surface/io/visibility-outcomes-io.ts +46 -0
- package/src/surface/module-context.ts +120 -0
- package/src/surface/substance.ts +161 -0
- package/src/surface/tests/eligibility.pbt.test.ts +137 -0
- package/src/surface/tests/eligibility.test.ts +302 -0
- package/src/surface/types.ts +289 -0
- package/src/surface/visibility.ts +57 -0
- package/src/surface/vitest.config.ts +8 -0
- package/tsconfig.json +17 -0
package/package.json
ADDED
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@warpgogol/werkstatt-shared",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"description": "Stack-agnostic shared infrastructure extracted from werkstatt-site (RFC-0868).",
|
|
7
|
+
"main": "./src/index.ts",
|
|
8
|
+
"types": "./src/index.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./src/index.ts",
|
|
12
|
+
"default": "./src/index.ts"
|
|
13
|
+
},
|
|
14
|
+
"./checks": {
|
|
15
|
+
"types": "./src/checks/index.ts",
|
|
16
|
+
"default": "./src/checks/index.ts"
|
|
17
|
+
},
|
|
18
|
+
"./checks/lib/astro-site-url": {
|
|
19
|
+
"types": "./src/checks/lib/astro-site-url.ts",
|
|
20
|
+
"default": "./src/checks/lib/astro-site-url.ts"
|
|
21
|
+
},
|
|
22
|
+
"./checks/lib/i18n": {
|
|
23
|
+
"types": "./src/checks/lib/i18n.ts",
|
|
24
|
+
"default": "./src/checks/lib/i18n.ts"
|
|
25
|
+
},
|
|
26
|
+
"./checks/result-helpers": {
|
|
27
|
+
"types": "./src/checks/result-helpers.ts",
|
|
28
|
+
"default": "./src/checks/result-helpers.ts"
|
|
29
|
+
},
|
|
30
|
+
"./checks/suppressions-config": {
|
|
31
|
+
"types": "./src/checks/suppressions-config.ts",
|
|
32
|
+
"default": "./src/checks/suppressions-config.ts"
|
|
33
|
+
},
|
|
34
|
+
"./integration": {
|
|
35
|
+
"types": "./src/integration/index.ts",
|
|
36
|
+
"default": "./src/integration/index.ts"
|
|
37
|
+
},
|
|
38
|
+
"./integration-adapter-supabase-crm": {
|
|
39
|
+
"types": "./src/integration-adapter-supabase-crm/index.ts",
|
|
40
|
+
"default": "./src/integration-adapter-supabase-crm/index.ts"
|
|
41
|
+
},
|
|
42
|
+
"./integration-adapter-supabase-crm/tenant-registry": {
|
|
43
|
+
"types": "./src/integration-adapter-supabase-crm/tenant-registry.ts",
|
|
44
|
+
"default": "./src/integration-adapter-supabase-crm/tenant-registry.ts"
|
|
45
|
+
},
|
|
46
|
+
"./integration-adapter-supabase-crm/worker": {
|
|
47
|
+
"types": "./src/integration-adapter-supabase-crm/worker.ts",
|
|
48
|
+
"default": "./src/integration-adapter-supabase-crm/worker.ts"
|
|
49
|
+
},
|
|
50
|
+
"./integration/crm-buffer": {
|
|
51
|
+
"types": "./src/integration/crm-buffer.ts",
|
|
52
|
+
"default": "./src/integration/crm-buffer.ts"
|
|
53
|
+
},
|
|
54
|
+
"./integration/port": {
|
|
55
|
+
"types": "./src/integration/port.ts",
|
|
56
|
+
"default": "./src/integration/port.ts"
|
|
57
|
+
},
|
|
58
|
+
"./observability": {
|
|
59
|
+
"types": "./src/observability/index.ts",
|
|
60
|
+
"default": "./src/observability/index.ts"
|
|
61
|
+
},
|
|
62
|
+
"./ontology": {
|
|
63
|
+
"types": "./src/ontology/index.ts",
|
|
64
|
+
"default": "./src/ontology/index.ts"
|
|
65
|
+
},
|
|
66
|
+
"./ontology/cosmic": {
|
|
67
|
+
"types": "./src/ontology/cosmic/index.ts",
|
|
68
|
+
"default": "./src/ontology/cosmic/index.ts"
|
|
69
|
+
},
|
|
70
|
+
"./ontology/external-surfaces": {
|
|
71
|
+
"types": "./src/ontology/external-surfaces/index.ts",
|
|
72
|
+
"default": "./src/ontology/external-surfaces/index.ts"
|
|
73
|
+
},
|
|
74
|
+
"./ontology/manifest": {
|
|
75
|
+
"types": "./src/ontology/manifest.ts",
|
|
76
|
+
"default": "./src/ontology/manifest.ts"
|
|
77
|
+
},
|
|
78
|
+
"./ontology/operations": {
|
|
79
|
+
"types": "./src/ontology/operations/index.ts",
|
|
80
|
+
"default": "./src/ontology/operations/index.ts"
|
|
81
|
+
},
|
|
82
|
+
"./ontology/archetypes": {
|
|
83
|
+
"types": "./src/ontology/archetype-registry.ts",
|
|
84
|
+
"default": "./src/ontology/archetype-registry.ts"
|
|
85
|
+
},
|
|
86
|
+
"./ontology/schemas": {
|
|
87
|
+
"types": "./src/ontology/schemas/index.ts",
|
|
88
|
+
"default": "./src/ontology/schemas/index.ts"
|
|
89
|
+
},
|
|
90
|
+
"./ontology/schemas/manifest-resolver": {
|
|
91
|
+
"types": "./src/ontology/schemas/manifest-resolver.ts",
|
|
92
|
+
"default": "./src/ontology/schemas/manifest-resolver.ts"
|
|
93
|
+
},
|
|
94
|
+
"./ontology/shared-section-props": {
|
|
95
|
+
"types": "./src/ontology/shared-section-props/index.ts",
|
|
96
|
+
"default": "./src/ontology/shared-section-props/index.ts"
|
|
97
|
+
},
|
|
98
|
+
"./passport": {
|
|
99
|
+
"types": "./src/passport/index.ts",
|
|
100
|
+
"default": "./src/passport/index.ts"
|
|
101
|
+
},
|
|
102
|
+
"./passport/dht-sign": {
|
|
103
|
+
"types": "./src/passport/dht-sign.ts",
|
|
104
|
+
"default": "./src/passport/dht-sign.ts"
|
|
105
|
+
},
|
|
106
|
+
"./passport/identity-sign": {
|
|
107
|
+
"types": "./src/passport/identity-sign.ts",
|
|
108
|
+
"default": "./src/passport/identity-sign.ts"
|
|
109
|
+
},
|
|
110
|
+
"./passport/key-rotate": {
|
|
111
|
+
"types": "./src/passport/key-rotate.ts",
|
|
112
|
+
"default": "./src/passport/key-rotate.ts"
|
|
113
|
+
},
|
|
114
|
+
"./passport/schema": {
|
|
115
|
+
"types": "./src/passport/schema.ts",
|
|
116
|
+
"default": "./src/passport/schema.ts"
|
|
117
|
+
},
|
|
118
|
+
"./passport/sign": {
|
|
119
|
+
"types": "./src/passport/sign.ts",
|
|
120
|
+
"default": "./src/passport/sign.ts"
|
|
121
|
+
},
|
|
122
|
+
"./share": {
|
|
123
|
+
"types": "./src/share/index.ts",
|
|
124
|
+
"default": "./src/share/index.ts"
|
|
125
|
+
},
|
|
126
|
+
"./share/agent": {
|
|
127
|
+
"types": "./src/share/agent/index.ts",
|
|
128
|
+
"default": "./src/share/agent/index.ts"
|
|
129
|
+
},
|
|
130
|
+
"./share/attribution-display": {
|
|
131
|
+
"types": "./src/share/attribution-display.ts",
|
|
132
|
+
"default": "./src/share/attribution-display.ts"
|
|
133
|
+
},
|
|
134
|
+
"./share/check-hints": {
|
|
135
|
+
"types": "./src/share/check-hints.ts",
|
|
136
|
+
"default": "./src/share/check-hints.ts"
|
|
137
|
+
},
|
|
138
|
+
"./share/content": {
|
|
139
|
+
"types": "./src/share/content/index.ts",
|
|
140
|
+
"default": "./src/share/content/index.ts"
|
|
141
|
+
},
|
|
142
|
+
"./share/content-discipline": {
|
|
143
|
+
"types": "./src/share/content-discipline/index.ts",
|
|
144
|
+
"default": "./src/share/content-discipline/index.ts"
|
|
145
|
+
},
|
|
146
|
+
"./share/content-reference": {
|
|
147
|
+
"types": "./src/share/content-reference.ts",
|
|
148
|
+
"default": "./src/share/content-reference.ts"
|
|
149
|
+
},
|
|
150
|
+
"./share/content/resolve-field-path": {
|
|
151
|
+
"types": "./src/share/content/resolve-field-path.ts",
|
|
152
|
+
"default": "./src/share/content/resolve-field-path.ts"
|
|
153
|
+
},
|
|
154
|
+
"./share/counter-utils": {
|
|
155
|
+
"types": "./src/share/counter-utils.ts",
|
|
156
|
+
"default": "./src/share/counter-utils.ts"
|
|
157
|
+
},
|
|
158
|
+
"./share/css-value-normalize": {
|
|
159
|
+
"types": "./src/share/css-value-normalize.ts",
|
|
160
|
+
"default": "./src/share/css-value-normalize.ts"
|
|
161
|
+
},
|
|
162
|
+
"./share/dev-props-validator": {
|
|
163
|
+
"types": "./src/share/dev-props-validator.ts",
|
|
164
|
+
"default": "./src/share/dev-props-validator.ts"
|
|
165
|
+
},
|
|
166
|
+
"./share/entitlement": {
|
|
167
|
+
"types": "./src/share/entitlement.ts",
|
|
168
|
+
"default": "./src/share/entitlement.ts"
|
|
169
|
+
},
|
|
170
|
+
"./share/feature-policy": {
|
|
171
|
+
"types": "./src/share/feature-policy.ts",
|
|
172
|
+
"default": "./src/share/feature-policy.ts"
|
|
173
|
+
},
|
|
174
|
+
"./share/formula-eval": {
|
|
175
|
+
"types": "./src/share/formula-eval.ts",
|
|
176
|
+
"default": "./src/share/formula-eval.ts"
|
|
177
|
+
},
|
|
178
|
+
"./share/fs": {
|
|
179
|
+
"types": "./src/share/fs/index.ts",
|
|
180
|
+
"default": "./src/share/fs/index.ts"
|
|
181
|
+
},
|
|
182
|
+
"./share/image-provider": {
|
|
183
|
+
"types": "./src/share/image-provider.ts",
|
|
184
|
+
"default": "./src/share/image-provider.ts"
|
|
185
|
+
},
|
|
186
|
+
"./share/knowledge": {
|
|
187
|
+
"types": "./src/share/knowledge/index.ts",
|
|
188
|
+
"default": "./src/share/knowledge/index.ts"
|
|
189
|
+
},
|
|
190
|
+
"./share/knowledge/claim": {
|
|
191
|
+
"types": "./src/share/knowledge/claim.ts",
|
|
192
|
+
"default": "./src/share/knowledge/claim.ts"
|
|
193
|
+
},
|
|
194
|
+
"./share/knowledge/derivation": {
|
|
195
|
+
"types": "./src/share/knowledge/derivation.ts",
|
|
196
|
+
"default": "./src/share/knowledge/derivation.ts"
|
|
197
|
+
},
|
|
198
|
+
"./share/knowledge/freshness": {
|
|
199
|
+
"types": "./src/share/knowledge/freshness.ts",
|
|
200
|
+
"default": "./src/share/knowledge/freshness.ts"
|
|
201
|
+
},
|
|
202
|
+
"./share/knowledge/ledger": {
|
|
203
|
+
"types": "./src/share/knowledge/ledger.ts",
|
|
204
|
+
"default": "./src/share/knowledge/ledger.ts"
|
|
205
|
+
},
|
|
206
|
+
"./share/knowledge/plan": {
|
|
207
|
+
"types": "./src/share/knowledge/plan.ts",
|
|
208
|
+
"default": "./src/share/knowledge/plan.ts"
|
|
209
|
+
},
|
|
210
|
+
"./share/knowledge/source": {
|
|
211
|
+
"types": "./src/share/knowledge/source.ts",
|
|
212
|
+
"default": "./src/share/knowledge/source.ts"
|
|
213
|
+
},
|
|
214
|
+
"./share/material-credits": {
|
|
215
|
+
"types": "./src/share/material-credits.ts",
|
|
216
|
+
"default": "./src/share/material-credits.ts"
|
|
217
|
+
},
|
|
218
|
+
"./share/middleware": {
|
|
219
|
+
"types": "./src/share/middleware/language-redirect.ts",
|
|
220
|
+
"default": "./src/share/middleware/language-redirect.ts"
|
|
221
|
+
},
|
|
222
|
+
"./share/offer-capacity": {
|
|
223
|
+
"types": "./src/share/offer-capacity.ts",
|
|
224
|
+
"default": "./src/share/offer-capacity.ts"
|
|
225
|
+
},
|
|
226
|
+
"./share/onboarding-yaml": {
|
|
227
|
+
"types": "./src/share/onboarding-yaml/index.ts",
|
|
228
|
+
"default": "./src/share/onboarding-yaml/index.ts"
|
|
229
|
+
},
|
|
230
|
+
"./share/page": {
|
|
231
|
+
"types": "./src/share/page.ts",
|
|
232
|
+
"default": "./src/share/page.ts"
|
|
233
|
+
},
|
|
234
|
+
"./share/redirects": {
|
|
235
|
+
"types": "./src/share/redirects.ts",
|
|
236
|
+
"default": "./src/share/redirects.ts"
|
|
237
|
+
},
|
|
238
|
+
"./share/rfc0042-utils": {
|
|
239
|
+
"types": "./src/share/rfc0042-utils.ts",
|
|
240
|
+
"default": "./src/share/rfc0042-utils.ts"
|
|
241
|
+
},
|
|
242
|
+
"./share/runtime-context": {
|
|
243
|
+
"types": "./src/share/runtime-context.ts",
|
|
244
|
+
"default": "./src/share/runtime-context.ts"
|
|
245
|
+
},
|
|
246
|
+
"./share/schemas": {
|
|
247
|
+
"types": "./src/share/schemas/index.ts",
|
|
248
|
+
"default": "./src/share/schemas/index.ts"
|
|
249
|
+
},
|
|
250
|
+
"./share/schemas/effects": {
|
|
251
|
+
"types": "./src/share/schemas/effects.ts",
|
|
252
|
+
"default": "./src/share/schemas/effects.ts"
|
|
253
|
+
},
|
|
254
|
+
"./share/schemas/features": {
|
|
255
|
+
"types": "./src/share/schemas/features.ts",
|
|
256
|
+
"default": "./src/share/schemas/features.ts"
|
|
257
|
+
},
|
|
258
|
+
"./share/schemas/material-credit": {
|
|
259
|
+
"types": "./src/share/schemas/material-credit.ts",
|
|
260
|
+
"default": "./src/share/schemas/material-credit.ts"
|
|
261
|
+
},
|
|
262
|
+
"./share/schemas/media": {
|
|
263
|
+
"types": "./src/share/schemas/media.ts",
|
|
264
|
+
"default": "./src/share/schemas/media.ts"
|
|
265
|
+
},
|
|
266
|
+
"./share/schemas/print": {
|
|
267
|
+
"types": "./src/share/schemas/print.ts",
|
|
268
|
+
"default": "./src/share/schemas/print.ts"
|
|
269
|
+
},
|
|
270
|
+
"./share/schemas/site-background": {
|
|
271
|
+
"types": "./src/share/schemas/site-background.ts",
|
|
272
|
+
"default": "./src/share/schemas/site-background.ts"
|
|
273
|
+
},
|
|
274
|
+
"./share/scripts/gsap-mountain-journey": {
|
|
275
|
+
"types": "./src/share/scripts/gsap-mountain-journey.ts",
|
|
276
|
+
"default": "./src/share/scripts/gsap-mountain-journey.ts"
|
|
277
|
+
},
|
|
278
|
+
"./share/semantic": {
|
|
279
|
+
"types": "./src/share/semantic/index.ts",
|
|
280
|
+
"default": "./src/share/semantic/index.ts"
|
|
281
|
+
},
|
|
282
|
+
"./share/semantic/derived-prices-loader": {
|
|
283
|
+
"types": "./src/share/semantic/derived-prices-loader.ts",
|
|
284
|
+
"default": "./src/share/semantic/derived-prices-loader.ts"
|
|
285
|
+
},
|
|
286
|
+
"./share/shared-context": {
|
|
287
|
+
"types": "./src/share/shared-context.ts",
|
|
288
|
+
"default": "./src/share/shared-context.ts"
|
|
289
|
+
},
|
|
290
|
+
"./share/string-utils": {
|
|
291
|
+
"types": "./src/share/string-utils.ts",
|
|
292
|
+
"default": "./src/share/string-utils.ts"
|
|
293
|
+
},
|
|
294
|
+
"./share/text-normalize": {
|
|
295
|
+
"types": "./src/share/text-normalize.ts",
|
|
296
|
+
"default": "./src/share/text-normalize.ts"
|
|
297
|
+
},
|
|
298
|
+
"./share/text-position": {
|
|
299
|
+
"types": "./src/share/text-position.ts",
|
|
300
|
+
"default": "./src/share/text-position.ts"
|
|
301
|
+
},
|
|
302
|
+
"./share/visibility": {
|
|
303
|
+
"types": "./src/share/visibility.ts",
|
|
304
|
+
"default": "./src/share/visibility.ts"
|
|
305
|
+
},
|
|
306
|
+
"./share/wrap-inline-numbers": {
|
|
307
|
+
"types": "./src/share/wrap-inline-numbers.ts",
|
|
308
|
+
"default": "./src/share/wrap-inline-numbers.ts"
|
|
309
|
+
},
|
|
310
|
+
"./surface": {
|
|
311
|
+
"types": "./src/surface/index.ts",
|
|
312
|
+
"default": "./src/surface/index.ts"
|
|
313
|
+
},
|
|
314
|
+
"./surface/io": {
|
|
315
|
+
"types": "./src/surface/io/index.ts",
|
|
316
|
+
"default": "./src/surface/io/index.ts"
|
|
317
|
+
}
|
|
318
|
+
},
|
|
319
|
+
"scripts": {
|
|
320
|
+
"build": "pnpm exec tsc -p tsconfig.json --noEmit",
|
|
321
|
+
"build:check": "pnpm exec tsc -p tsconfig.json --noEmit",
|
|
322
|
+
"prepublishOnly": "pnpm exec tsc -p tsconfig.json --noEmit",
|
|
323
|
+
"test": "vitest run",
|
|
324
|
+
"test:watch": "vitest"
|
|
325
|
+
},
|
|
326
|
+
"publishConfig": {
|
|
327
|
+
"access": "public"
|
|
328
|
+
},
|
|
329
|
+
"files": ["src", "tsconfig.json"],
|
|
330
|
+
"dependencies": {
|
|
331
|
+
"@lordicon/element": "^2.3.1",
|
|
332
|
+
"@noble/ed25519": "^3.1.0",
|
|
333
|
+
"ajv": "^8.20.0",
|
|
334
|
+
"bs58": "^6.0.0",
|
|
335
|
+
"expr-eval": "^2.0.2",
|
|
336
|
+
"hls.js": "^1.6.16",
|
|
337
|
+
"lenis": "^1.3.25",
|
|
338
|
+
"plyr": "^3.8.4",
|
|
339
|
+
"yaml": "^2.9.0",
|
|
340
|
+
"zod": "^4.4.3"
|
|
341
|
+
},
|
|
342
|
+
"optionalDependencies": {
|
|
343
|
+
"@syrokomskyi/axiom-study": "*"
|
|
344
|
+
},
|
|
345
|
+
"devDependencies": {
|
|
346
|
+
"@cloudflare/workers-types": "^5.20260801.1",
|
|
347
|
+
"@types/node": "^24.0.0",
|
|
348
|
+
"astro": "^7.2.0",
|
|
349
|
+
"fast-check": "^4.9.0",
|
|
350
|
+
"vitest": "^4.1.10"
|
|
351
|
+
}
|
|
352
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/*
|
|
2
|
+
<MODULE_CONTRACT>
|
|
3
|
+
<purpose>Shared check infrastructure barrel for @warpgogol/werkstatt-shared — exports diagnosticsResult, suppressions, i18n, and astro-site-url helpers (RFC-0868).</purpose>
|
|
4
|
+
<non-goals>
|
|
5
|
+
<item>Do not export site-specific validators or pipeline definitions.</item>
|
|
6
|
+
<item>Do not import from @warpgogol/werkstatt-site or any stack plugin.</item>
|
|
7
|
+
</non-goals>
|
|
8
|
+
</MODULE_CONTRACT>
|
|
9
|
+
<CHANGE_SUMMARY>
|
|
10
|
+
<item>RFC-0868: extracted from werkstatt-site/src/checks as shared infrastructure.</item>
|
|
11
|
+
</CHANGE_SUMMARY>
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
export {
|
|
15
|
+
diagnosticsResult,
|
|
16
|
+
passResult,
|
|
17
|
+
failResult,
|
|
18
|
+
resultFromViolations,
|
|
19
|
+
} from "./result-helpers.ts";
|
|
20
|
+
|
|
21
|
+
export * from "./suppressions-config.ts";
|
|
22
|
+
|
|
23
|
+
export { readAstroSiteUrl } from "./lib/astro-site-url.ts";
|
|
24
|
+
export { readDefaultLanguageCode } from "./lib/i18n.ts";
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/*
|
|
2
|
+
<MODULE_CONTRACT>
|
|
3
|
+
<purpose>Best-effort helper to read the canonical site URL from an app's astro.config.mjs.</purpose>
|
|
4
|
+
<non-goals>
|
|
5
|
+
<item>Do not introduce app-specific runtime composition or deployment behavior into this reusable package source file.</item>
|
|
6
|
+
</non-goals>
|
|
7
|
+
</MODULE_CONTRACT>
|
|
8
|
+
<CHANGE_SUMMARY>
|
|
9
|
+
<item>Added Compass scaffolding.</item>
|
|
10
|
+
</CHANGE_SUMMARY>
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import { readFile } from "node:fs/promises";
|
|
14
|
+
import { join } from "node:path";
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Read canonical site URL from astro.config.mjs.
|
|
18
|
+
* Best-effort regex — no AST parsing needed.
|
|
19
|
+
* Handles JS expressions like `site: process.env.X || "https://example.com"`.
|
|
20
|
+
*/
|
|
21
|
+
export async function readAstroSiteUrl(appDir: string): Promise<string | undefined> {
|
|
22
|
+
const configPath = join(appDir, "astro.config.mjs");
|
|
23
|
+
try {
|
|
24
|
+
const text = await readFile(configPath, "utf-8");
|
|
25
|
+
const match = text.match(/site:.*?["'](https?:\/\/[^"']+)["']/);
|
|
26
|
+
return match?.[1];
|
|
27
|
+
} catch {
|
|
28
|
+
return undefined;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { join } from "node:path";
|
|
2
|
+
import { readFile } from "node:fs/promises";
|
|
3
|
+
import { parse as parseYaml } from "yaml";
|
|
4
|
+
|
|
5
|
+
function parseFrontmatter(source: string): { data: Record<string, unknown> } {
|
|
6
|
+
const match = source.match(/^---\r?\n([\s\S]*?)\r?\n---\r?\n?([\s\S]*)$/);
|
|
7
|
+
if (!match) return { data: {} };
|
|
8
|
+
const data = parseYaml(match[1]) as Record<string, unknown>;
|
|
9
|
+
return { data };
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export async function readDefaultLanguageCode(contentRoot: string): Promise<string> {
|
|
13
|
+
const systemPath = join(contentRoot, "system.md");
|
|
14
|
+
const raw = await readFile(systemPath, "utf-8");
|
|
15
|
+
const { data } = parseFrontmatter(raw);
|
|
16
|
+
const i18n = (data as Record<string, unknown>).i18n as { default?: unknown } | undefined;
|
|
17
|
+
if (typeof i18n?.default === "string" && i18n.default.trim() !== "") {
|
|
18
|
+
return i18n.default.trim();
|
|
19
|
+
}
|
|
20
|
+
throw new Error("[i18n] src/content/system.md must declare i18n.default.");
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function defaultLanguageFromManifest(manifest: { i18n?: unknown }): string {
|
|
24
|
+
const i18n = manifest.i18n as { default?: unknown } | undefined;
|
|
25
|
+
const defaultLanguage = i18n?.default;
|
|
26
|
+
if (typeof defaultLanguage === "string" && defaultLanguage.trim() !== "") {
|
|
27
|
+
return defaultLanguage.trim();
|
|
28
|
+
}
|
|
29
|
+
throw new Error("[i18n] manifest must declare i18n.default.");
|
|
30
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/*
|
|
2
|
+
<MODULE_CONTRACT>
|
|
3
|
+
<purpose>
|
|
4
|
+
RFC-0203 canonical result builders. Every builder returns a CheckResult
|
|
5
|
+
(`{ command, status, diagnostics, summary }`) so non-zero exits propagate to CI
|
|
6
|
+
and the central failure printer renders findings uniformly. The string builders
|
|
7
|
+
(passResult/failResult/resultFromViolations) key each violation to a coarse
|
|
8
|
+
ruleId = command; diagnosticsResult takes rich Diagnostic[] with registered ids.
|
|
9
|
+
</purpose>
|
|
10
|
+
<non-goals>
|
|
11
|
+
<item>Do not interpret violation severity — string builders emit error-severity diagnostics; failResult always exits 1.</item>
|
|
12
|
+
</non-goals>
|
|
13
|
+
</MODULE_CONTRACT>
|
|
14
|
+
<CHANGE_SUMMARY>
|
|
15
|
+
<item>RFC-0029 review: Initial creation to fix systemic exit-code bug across check files.</item>
|
|
16
|
+
</CHANGE_SUMMARY>
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
import type { CheckResult, Diagnostic, KernelCommandResult } from "@warpgogol/werkstatt/kernel";
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* RFC-0203: canonical result builder. Migrated checks emit `Diagnostic[]` with
|
|
23
|
+
* registered rule ids instead of bare strings. Exit code is 1 when any
|
|
24
|
+
* diagnostic is an error; warnings and info do not fail the pipeline.
|
|
25
|
+
*/
|
|
26
|
+
export function diagnosticsResult(
|
|
27
|
+
command: string,
|
|
28
|
+
diagnostics: Diagnostic[],
|
|
29
|
+
): KernelCommandResult<CheckResult> {
|
|
30
|
+
const summary = {
|
|
31
|
+
error: diagnostics.filter((d) => d.severity === "error").length,
|
|
32
|
+
warning: diagnostics.filter((d) => d.severity === "warning").length,
|
|
33
|
+
info: diagnostics.filter((d) => d.severity === "info").length,
|
|
34
|
+
};
|
|
35
|
+
const status: CheckResult["status"] =
|
|
36
|
+
summary.error > 0 ? "fail" : summary.warning > 0 ? "warn" : "pass";
|
|
37
|
+
return {
|
|
38
|
+
data: { command, status, diagnostics, summary },
|
|
39
|
+
exitCode: summary.error > 0 ? 1 : 0,
|
|
40
|
+
summary: `${command}: ${summary.error} error(s), ${summary.warning} warning(s)`,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* RFC-0203: map bare violation strings into canonical error Diagnostics. The
|
|
46
|
+
* command name is the coarse, stable ruleId for these single-rule checks; checks
|
|
47
|
+
* that need finer ids or fixHints use {@link diagnosticsResult} directly.
|
|
48
|
+
*/
|
|
49
|
+
function violationsToDiagnostics(command: string, violations: string[]): Diagnostic[] {
|
|
50
|
+
return violations.map((message) => ({ ruleId: command, severity: "error" as const, message }));
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function emptySummary(): CheckResult["summary"] {
|
|
54
|
+
return { error: 0, warning: 0, info: 0 };
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Canonical success result. RFC-0203: emits an empty `CheckResult` (no
|
|
59
|
+
* diagnostics) rather than the legacy `{ command, status, violations }` shape.
|
|
60
|
+
*/
|
|
61
|
+
export function passResult(command: string, summary?: string): KernelCommandResult<CheckResult> {
|
|
62
|
+
return {
|
|
63
|
+
data: { command, status: "pass", diagnostics: [], summary: emptySummary() },
|
|
64
|
+
exitCode: 0,
|
|
65
|
+
summary: summary ?? `${command}: OK`,
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Canonical failure result — always exits 1 (preserving the historical
|
|
71
|
+
* failResult contract). RFC-0203: violation strings become error Diagnostics
|
|
72
|
+
* keyed by the command name.
|
|
73
|
+
*/
|
|
74
|
+
export function failResult(
|
|
75
|
+
command: string,
|
|
76
|
+
violations: string[],
|
|
77
|
+
): KernelCommandResult<CheckResult> {
|
|
78
|
+
const diagnostics = violationsToDiagnostics(command, violations);
|
|
79
|
+
return {
|
|
80
|
+
data: {
|
|
81
|
+
command,
|
|
82
|
+
status: "fail",
|
|
83
|
+
diagnostics,
|
|
84
|
+
summary: { error: diagnostics.length, warning: 0, info: 0 },
|
|
85
|
+
},
|
|
86
|
+
exitCode: 1,
|
|
87
|
+
summary: `${command}: ${violations.length} violation(s)`,
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Build a canonical result from a violations array — pass if empty, fail
|
|
93
|
+
* otherwise. RFC-0203: no longer a bare-string shim; it emits canonical
|
|
94
|
+
* Diagnostics (ruleId = command). Checks that need registered fine-grained
|
|
95
|
+
* ruleIds, locators, or fixHints use {@link diagnosticsResult} instead.
|
|
96
|
+
*/
|
|
97
|
+
export function resultFromViolations(
|
|
98
|
+
command: string,
|
|
99
|
+
violations: string[],
|
|
100
|
+
): KernelCommandResult<CheckResult> {
|
|
101
|
+
return violations.length > 0 ? failResult(command, violations) : passResult(command);
|
|
102
|
+
}
|