@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
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/*
|
|
2
|
+
<MODULE_CONTRACT>
|
|
3
|
+
<purpose>Text and semantic page type schemas for the system manifest: defines page type enums and text-related configuration.</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>RFC-0303 Phase 3: extracted from schemas/system.ts as part of the domain split.</item>
|
|
10
|
+
</CHANGE_SUMMARY>
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import { z } from "zod";
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* The `text.normalize` block in system.yaml (RFC-0235). Controls the egress
|
|
17
|
+
* adapter that strips AI-authorship typographic signals from public output
|
|
18
|
+
* (rendered HTML, llms.txt, Markdown twins, feed.xml, sitemap*.xml, JSON-LD,
|
|
19
|
+
* OG preview text). It is an adapter, not a source rewrite — authored content
|
|
20
|
+
* is never modified.
|
|
21
|
+
*
|
|
22
|
+
* Default-all-on: an absent block, an absent `enabled`, or an absent signal key
|
|
23
|
+
* all resolve to ON. A site owner disables any single signal here.
|
|
24
|
+
* CLIENT-WRITABLE.
|
|
25
|
+
*/
|
|
26
|
+
export const systemTextNormalizeSignalsSchema = z
|
|
27
|
+
.object({
|
|
28
|
+
/** Special dashes (figure/en/em/horizontal-bar/non-breaking-hyphen/minus) → '-'. */
|
|
29
|
+
dashes: z.boolean().optional(),
|
|
30
|
+
/** Curly + guillemet quotes (U+00AB/U+00BB, U+2018–U+201F) → straight " / '. */
|
|
31
|
+
quotes: z.boolean().optional(),
|
|
32
|
+
/** Special spaces (nbsp, en/em/thin/hair, narrow-nbsp, ideographic…) → regular space. */
|
|
33
|
+
spaces: z.boolean().optional(),
|
|
34
|
+
/** Zero-width / invisible characters (ZWSP, ZWNJ, word-joiner, BOM, soft-hyphen…) → removed. */
|
|
35
|
+
zeroWidth: z.boolean().optional(),
|
|
36
|
+
/** Typographic HTML entities ( — … …) → decoded then char-normalized. */
|
|
37
|
+
htmlEntities: z.boolean().optional(),
|
|
38
|
+
/** Single-character ellipsis U+2026 … → three dots '...'. */
|
|
39
|
+
ellipsis: z.boolean().optional(),
|
|
40
|
+
})
|
|
41
|
+
.strict();
|
|
42
|
+
|
|
43
|
+
export const systemTextNormalizeSchema = z
|
|
44
|
+
.object({
|
|
45
|
+
/** Master switch. Absent ⇒ true. */
|
|
46
|
+
enabled: z.boolean().optional(),
|
|
47
|
+
/** Per-signal toggles. Each absent key ⇒ true (everything on by default). */
|
|
48
|
+
signals: systemTextNormalizeSignalsSchema.optional(),
|
|
49
|
+
})
|
|
50
|
+
.strict();
|
|
51
|
+
|
|
52
|
+
export const systemTextSchema = z
|
|
53
|
+
.object({
|
|
54
|
+
normalize: systemTextNormalizeSchema.optional(),
|
|
55
|
+
})
|
|
56
|
+
.strict();
|
|
57
|
+
|
|
58
|
+
export type SystemText = z.infer<typeof systemTextSchema>;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/*
|
|
2
|
+
<MODULE_CONTRACT>
|
|
3
|
+
<purpose>
|
|
4
|
+
Zod schema for per-app system.yaml — the top-level manifest that binds a client
|
|
5
|
+
application to a cosmic identity, a single Biome, and an optional set of
|
|
6
|
+
Constellations (DNA-23, RFC-0025). Also declares the growth block (RFC-0027).
|
|
7
|
+
Stored at apps/<app-slug>/system.yaml.
|
|
8
|
+
</purpose>
|
|
9
|
+
<non-goals>
|
|
10
|
+
<item>Do not parse YAML here; the caller is responsible for parsing.</item>
|
|
11
|
+
<item>Do not reference app business logic or client-specific content.</item>
|
|
12
|
+
<item>Do not add rendering logic.</item>
|
|
13
|
+
</non-goals>
|
|
14
|
+
</MODULE_CONTRACT>
|
|
15
|
+
<CHANGE_SUMMARY>
|
|
16
|
+
<item>Wave 1 (RFC-0025): Initial creation.</item>
|
|
17
|
+
<item>Wave 1 (RFC-0027): Added growth block — vendor adapter binding, active funnels, active experiments.</item>
|
|
18
|
+
<item>RFC-0328: Added "legal" to semanticPageTypeSchema.</item>
|
|
19
|
+
<item>RFC-0303 Phase 3: split the flat 822-line file into sub-modules under system/; this file is now the re-export shim.</item>
|
|
20
|
+
</CHANGE_SUMMARY>
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
export {
|
|
24
|
+
systemSharedContextSchema,
|
|
25
|
+
systemGrowthSchema,
|
|
26
|
+
growthVendorSchema,
|
|
27
|
+
} from "./system/growth.ts";
|
|
28
|
+
export type { SystemGrowth, GrowthVendor } from "./system/growth.ts";
|
|
29
|
+
|
|
30
|
+
export { systemPassportSchema, systemReleaseSchema } from "./system/release.ts";
|
|
31
|
+
export type { SystemPassport, SystemRelease } from "./system/release.ts";
|
|
32
|
+
|
|
33
|
+
export {
|
|
34
|
+
systemTextNormalizeSignalsSchema,
|
|
35
|
+
systemTextNormalizeSchema,
|
|
36
|
+
systemTextSchema,
|
|
37
|
+
} from "./system/text.ts";
|
|
38
|
+
export type { SystemText } from "./system/text.ts";
|
|
39
|
+
|
|
40
|
+
export { systemIntegrationsSchema } from "./system/integrations.ts";
|
|
41
|
+
export type { SystemIntegrations } from "./system/integrations.ts";
|
|
42
|
+
|
|
43
|
+
export {
|
|
44
|
+
semanticPageTypeSchema,
|
|
45
|
+
articleMetadataSchema,
|
|
46
|
+
llmsPolicySchema,
|
|
47
|
+
sitemapProjectionSchema,
|
|
48
|
+
robotsProjectionSchema,
|
|
49
|
+
pageOutputSchema,
|
|
50
|
+
} from "./system/page-output.ts";
|
|
51
|
+
|
|
52
|
+
export { systemManifestSchema } from "./system/manifest.ts";
|
|
53
|
+
export type { SystemManifest, SystemPagePin, SystemPlanetPin } from "./system/manifest.ts";
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
/*
|
|
2
|
+
<MODULE_CONTRACT>
|
|
3
|
+
<purpose>Body kind JSON Schema fragments for RFC-0103: one fragment per body kind (list, split-list, stats, cards, paragraphs, comparison, rich) that adds the entire body object at section root.</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>RFC-0303 Phase 3: extracted from shared-section-props/index.ts as part of the domain split.</item>
|
|
10
|
+
</CHANGE_SUMMARY>
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import {
|
|
14
|
+
STANDARD_LIST_ITEM_SCHEMA,
|
|
15
|
+
STANDARD_CARD_SCHEMA,
|
|
16
|
+
STAT_ITEM_SCHEMA,
|
|
17
|
+
ALIGN_ENUM,
|
|
18
|
+
ICON_COLOR_ENUM,
|
|
19
|
+
EFFECTS_ARRAY_SCHEMA,
|
|
20
|
+
type JsonSchemaFragment,
|
|
21
|
+
} from "./common.ts";
|
|
22
|
+
|
|
23
|
+
/** RFC-0103 — body.kind: "list". */
|
|
24
|
+
export const BODY_LIST_FRAGMENT: JsonSchemaFragment = {
|
|
25
|
+
properties: {
|
|
26
|
+
body: {
|
|
27
|
+
type: "object",
|
|
28
|
+
additionalProperties: false,
|
|
29
|
+
required: ["kind", "items"],
|
|
30
|
+
properties: {
|
|
31
|
+
kind: { const: "list" },
|
|
32
|
+
items: { type: "array", minItems: 1, items: STANDARD_LIST_ITEM_SCHEMA },
|
|
33
|
+
note: { type: "string" },
|
|
34
|
+
iconColor: ICON_COLOR_ENUM,
|
|
35
|
+
align: ALIGN_ENUM,
|
|
36
|
+
effects: EFFECTS_ARRAY_SCHEMA,
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
/** RFC-0103 — body.kind: "split-list". */
|
|
43
|
+
export const BODY_SPLIT_LIST_FRAGMENT: JsonSchemaFragment = {
|
|
44
|
+
properties: {
|
|
45
|
+
body: {
|
|
46
|
+
type: "object",
|
|
47
|
+
additionalProperties: false,
|
|
48
|
+
required: ["kind", "primaryItems"],
|
|
49
|
+
properties: {
|
|
50
|
+
kind: { const: "split-list" },
|
|
51
|
+
primaryItems: { type: "array", minItems: 1, items: STANDARD_LIST_ITEM_SCHEMA },
|
|
52
|
+
secondaryItems: { type: "array", items: STANDARD_LIST_ITEM_SCHEMA },
|
|
53
|
+
labels: {
|
|
54
|
+
type: "object",
|
|
55
|
+
additionalProperties: false,
|
|
56
|
+
required: ["primary", "secondary"],
|
|
57
|
+
properties: {
|
|
58
|
+
primary: { type: "string", minLength: 1 },
|
|
59
|
+
secondary: { type: "string", minLength: 1 },
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
iconColors: {
|
|
63
|
+
type: "object",
|
|
64
|
+
additionalProperties: false,
|
|
65
|
+
properties: {
|
|
66
|
+
primary: ICON_COLOR_ENUM,
|
|
67
|
+
secondary: ICON_COLOR_ENUM,
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
align: ALIGN_ENUM,
|
|
71
|
+
effects: EFFECTS_ARRAY_SCHEMA,
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
/** RFC-0103 — body.kind: "stats". */
|
|
78
|
+
export const BODY_STATS_FRAGMENT: JsonSchemaFragment = {
|
|
79
|
+
properties: {
|
|
80
|
+
body: {
|
|
81
|
+
type: "object",
|
|
82
|
+
additionalProperties: false,
|
|
83
|
+
required: ["kind", "stats"],
|
|
84
|
+
properties: {
|
|
85
|
+
kind: { const: "stats" },
|
|
86
|
+
stats: { type: "array", minItems: 1, items: STAT_ITEM_SCHEMA },
|
|
87
|
+
animated: { type: "boolean" },
|
|
88
|
+
align: ALIGN_ENUM,
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
/** RFC-0103 — body.kind: "cards". */
|
|
95
|
+
export const BODY_CARDS_FRAGMENT: JsonSchemaFragment = {
|
|
96
|
+
properties: {
|
|
97
|
+
body: {
|
|
98
|
+
type: "object",
|
|
99
|
+
additionalProperties: false,
|
|
100
|
+
required: ["kind", "cards"],
|
|
101
|
+
properties: {
|
|
102
|
+
kind: { const: "cards" },
|
|
103
|
+
cards: { type: "array", minItems: 1, items: STANDARD_CARD_SCHEMA },
|
|
104
|
+
layout: { enum: ["grid", "list"] },
|
|
105
|
+
columns: { enum: [2, 3, 4] },
|
|
106
|
+
align: ALIGN_ENUM,
|
|
107
|
+
effects: EFFECTS_ARRAY_SCHEMA,
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
/** RFC-0103 — body.kind: "paragraphs". */
|
|
114
|
+
export const BODY_PARAGRAPHS_FRAGMENT: JsonSchemaFragment = {
|
|
115
|
+
properties: {
|
|
116
|
+
body: {
|
|
117
|
+
type: "object",
|
|
118
|
+
additionalProperties: false,
|
|
119
|
+
required: ["kind", "paragraphs"],
|
|
120
|
+
properties: {
|
|
121
|
+
kind: { const: "paragraphs" },
|
|
122
|
+
paragraphs: { type: "array", minItems: 1, items: { type: "string", minLength: 1 } },
|
|
123
|
+
align: ALIGN_ENUM,
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
/** RFC-0103 — body.kind: "comparison". */
|
|
130
|
+
export const BODY_COMPARISON_FRAGMENT: JsonSchemaFragment = {
|
|
131
|
+
properties: {
|
|
132
|
+
body: {
|
|
133
|
+
type: "object",
|
|
134
|
+
additionalProperties: false,
|
|
135
|
+
required: ["kind", "rows"],
|
|
136
|
+
properties: {
|
|
137
|
+
kind: { const: "comparison" },
|
|
138
|
+
rows: {
|
|
139
|
+
type: "array",
|
|
140
|
+
minItems: 1,
|
|
141
|
+
items: {
|
|
142
|
+
type: "object",
|
|
143
|
+
additionalProperties: false,
|
|
144
|
+
required: ["left", "right"],
|
|
145
|
+
properties: {
|
|
146
|
+
left: { type: "string", minLength: 1 },
|
|
147
|
+
right: { type: "string", minLength: 1 },
|
|
148
|
+
},
|
|
149
|
+
},
|
|
150
|
+
},
|
|
151
|
+
labels: {
|
|
152
|
+
type: "object",
|
|
153
|
+
additionalProperties: false,
|
|
154
|
+
required: ["left", "right"],
|
|
155
|
+
properties: {
|
|
156
|
+
left: { type: "string", minLength: 1 },
|
|
157
|
+
right: { type: "string", minLength: 1 },
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
align: ALIGN_ENUM,
|
|
161
|
+
effects: EFFECTS_ARRAY_SCHEMA,
|
|
162
|
+
},
|
|
163
|
+
},
|
|
164
|
+
},
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
/** RFC-0103 — body.kind: "rich". */
|
|
168
|
+
export const BODY_RICH_FRAGMENT: JsonSchemaFragment = {
|
|
169
|
+
properties: {
|
|
170
|
+
body: {
|
|
171
|
+
type: "object",
|
|
172
|
+
additionalProperties: false,
|
|
173
|
+
required: ["kind", "contentRef"],
|
|
174
|
+
properties: {
|
|
175
|
+
kind: { const: "rich" },
|
|
176
|
+
contentRef: { type: "string", minLength: 1 },
|
|
177
|
+
animateNumbers: { type: "boolean" },
|
|
178
|
+
align: ALIGN_ENUM,
|
|
179
|
+
},
|
|
180
|
+
},
|
|
181
|
+
},
|
|
182
|
+
};
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
/*
|
|
2
|
+
<MODULE_CONTRACT>
|
|
3
|
+
<purpose>Catalog and composition helpers for shared section prop fragments: defines SHARED_SECTION_PROPS catalog with versioned fragments and provides resolution/changelog/composition functions.</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>RFC-0303 Phase 3: extracted from shared-section-props/index.ts as part of the domain split.</item>
|
|
10
|
+
</CHANGE_SUMMARY>
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import type { JsonSchemaFragment } from "./common.ts";
|
|
14
|
+
import { SECTION_VISUAL_FRAGMENT, SECTION_HEADER_FRAGMENT } from "./visual-header.ts";
|
|
15
|
+
import {
|
|
16
|
+
BODY_LIST_FRAGMENT,
|
|
17
|
+
BODY_SPLIT_LIST_FRAGMENT,
|
|
18
|
+
BODY_STATS_FRAGMENT,
|
|
19
|
+
BODY_CARDS_FRAGMENT,
|
|
20
|
+
BODY_PARAGRAPHS_FRAGMENT,
|
|
21
|
+
BODY_COMPARISON_FRAGMENT,
|
|
22
|
+
BODY_RICH_FRAGMENT,
|
|
23
|
+
} from "./body-fragments.ts";
|
|
24
|
+
|
|
25
|
+
// RFC-0119: every fragment carries `schemaVersion: number` (starts at 1) and
|
|
26
|
+
// optional `changelog`. The catalog stores versions under `latest` and
|
|
27
|
+
// optionally `prior` so consumers can pin to the prior shape during a
|
|
28
|
+
// migration window. Bare ids (without `@version`) resolve to `latest`.
|
|
29
|
+
|
|
30
|
+
type FragmentVersion = JsonSchemaFragment & {
|
|
31
|
+
schemaVersion: number;
|
|
32
|
+
changelog?: string;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
type FragmentEntry = {
|
|
36
|
+
latest: FragmentVersion;
|
|
37
|
+
prior?: FragmentVersion;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
function v1(fragment: JsonSchemaFragment, changelog: string): FragmentVersion {
|
|
41
|
+
return { schemaVersion: 1, ...fragment, changelog };
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export const SHARED_SECTION_PROPS: Record<string, FragmentEntry> = {
|
|
45
|
+
"section-visual": {
|
|
46
|
+
latest: v1(
|
|
47
|
+
SECTION_VISUAL_FRAGMENT,
|
|
48
|
+
"Initial release with background, effects, density, tone, containerVariant, motion.",
|
|
49
|
+
),
|
|
50
|
+
},
|
|
51
|
+
"section-header": {
|
|
52
|
+
latest: v1(
|
|
53
|
+
SECTION_HEADER_FRAGMENT,
|
|
54
|
+
"Heading (string or tone-segmented array), eyebrow, subheading, align, level, hideSectionNumber. RFC-0567 added eyebrow.",
|
|
55
|
+
),
|
|
56
|
+
},
|
|
57
|
+
"body-list": {
|
|
58
|
+
latest: v1(
|
|
59
|
+
BODY_LIST_FRAGMENT,
|
|
60
|
+
"Initial release of body.kind: list with items + note + iconColor + align + effects.",
|
|
61
|
+
),
|
|
62
|
+
},
|
|
63
|
+
"body-split-list": {
|
|
64
|
+
latest: v1(
|
|
65
|
+
BODY_SPLIT_LIST_FRAGMENT,
|
|
66
|
+
"Initial release of body.kind: split-list with primary/secondary items, labels, iconColors + effects.",
|
|
67
|
+
),
|
|
68
|
+
},
|
|
69
|
+
"body-stats": {
|
|
70
|
+
latest: v1(
|
|
71
|
+
BODY_STATS_FRAGMENT,
|
|
72
|
+
"Initial release of body.kind: stats with stats[] + animated + align.",
|
|
73
|
+
),
|
|
74
|
+
},
|
|
75
|
+
"body-cards": {
|
|
76
|
+
latest: v1(
|
|
77
|
+
BODY_CARDS_FRAGMENT,
|
|
78
|
+
"Initial release of body.kind: cards with cards[] + layout + columns + align + effects. Added optional number field to cards for numbered lists.",
|
|
79
|
+
),
|
|
80
|
+
},
|
|
81
|
+
"body-paragraphs": {
|
|
82
|
+
latest: v1(
|
|
83
|
+
BODY_PARAGRAPHS_FRAGMENT,
|
|
84
|
+
"Initial release of body.kind: paragraphs with paragraphs[] + align.",
|
|
85
|
+
),
|
|
86
|
+
},
|
|
87
|
+
"body-comparison": {
|
|
88
|
+
latest: v1(
|
|
89
|
+
BODY_COMPARISON_FRAGMENT,
|
|
90
|
+
"Initial release of body.kind: comparison with rows + labels + align + effects.",
|
|
91
|
+
),
|
|
92
|
+
},
|
|
93
|
+
"body-rich": {
|
|
94
|
+
latest: v1(
|
|
95
|
+
BODY_RICH_FRAGMENT,
|
|
96
|
+
"Initial release of body.kind: rich with contentRef + animateNumbers + align.",
|
|
97
|
+
),
|
|
98
|
+
},
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
export type SharedSectionPropsId = keyof typeof SHARED_SECTION_PROPS;
|
|
102
|
+
|
|
103
|
+
/** RFC-0119: pinned reference syntax `<id>@<version>` or bare `<id>` (latest). */
|
|
104
|
+
export type SharedSectionPropsRef = string;
|
|
105
|
+
|
|
106
|
+
export function isSharedSectionPropsId(id: string): id is SharedSectionPropsId {
|
|
107
|
+
const baseId = id.split("@")[0];
|
|
108
|
+
return Object.prototype.hasOwnProperty.call(SHARED_SECTION_PROPS, baseId);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* RFC-0119: resolve a fragment reference (`<id>` or `<id>@<version>`) to the
|
|
113
|
+
* matching fragment payload. Unknown ids or pinned versions raise with the
|
|
114
|
+
* catalog of valid ids in the message.
|
|
115
|
+
*/
|
|
116
|
+
function resolveFragment(ref: string): FragmentVersion {
|
|
117
|
+
const [baseId, pinned] = ref.split("@");
|
|
118
|
+
const entry = SHARED_SECTION_PROPS[baseId];
|
|
119
|
+
if (!entry) {
|
|
120
|
+
throw new Error(
|
|
121
|
+
`[shared-section-props] Unknown fragment id "${baseId}". ` +
|
|
122
|
+
`Valid ids: ${Object.keys(SHARED_SECTION_PROPS).join(", ")}`,
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
if (!pinned) return entry.latest;
|
|
126
|
+
const pinnedVersion = Number.parseInt(pinned, 10);
|
|
127
|
+
if (Number.isNaN(pinnedVersion)) {
|
|
128
|
+
throw new Error(`[shared-section-props] Invalid pinned version "${pinned}" on "${baseId}".`);
|
|
129
|
+
}
|
|
130
|
+
if (entry.latest.schemaVersion === pinnedVersion) return entry.latest;
|
|
131
|
+
if (entry.prior?.schemaVersion === pinnedVersion) return entry.prior;
|
|
132
|
+
throw new Error(
|
|
133
|
+
`[shared-section-props] Fragment "${baseId}" version ${pinnedVersion} not available ` +
|
|
134
|
+
`(latest: ${entry.latest.schemaVersion}${entry.prior ? `, prior: ${entry.prior.schemaVersion}` : ""}).`,
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* RFC-0119: machine-readable changelog snapshot. Used by
|
|
140
|
+
* shared.section-props.changelog.report.
|
|
141
|
+
*/
|
|
142
|
+
export function sharedSectionPropsChangelog(): Array<{
|
|
143
|
+
id: string;
|
|
144
|
+
schemaVersion: number;
|
|
145
|
+
changelog?: string;
|
|
146
|
+
}> {
|
|
147
|
+
return Object.entries(SHARED_SECTION_PROPS).map(([id, entry]) => ({
|
|
148
|
+
id,
|
|
149
|
+
schemaVersion: entry.latest.schemaVersion,
|
|
150
|
+
changelog: entry.latest.changelog,
|
|
151
|
+
}));
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Compose fragments + the manifest's local propsSchema into one draft-07
|
|
156
|
+
* JSON Schema object. Properties of later inputs override earlier ones;
|
|
157
|
+
* `additionalProperties: false` is enforced unless the manifest explicitly
|
|
158
|
+
* opts out. Fragment ids accept both `<id>` and `<id>@<version>` forms
|
|
159
|
+
* (RFC-0119).
|
|
160
|
+
*/
|
|
161
|
+
export function composeManifestPropsSchema(input: {
|
|
162
|
+
compose?: readonly string[];
|
|
163
|
+
local?: Record<string, unknown>;
|
|
164
|
+
}): Record<string, unknown> {
|
|
165
|
+
const properties: Record<string, unknown> = {};
|
|
166
|
+
const required = new Set<string>();
|
|
167
|
+
|
|
168
|
+
for (const ref of input.compose ?? []) {
|
|
169
|
+
const frag = resolveFragment(ref);
|
|
170
|
+
Object.assign(properties, frag.properties);
|
|
171
|
+
for (const r of frag.required ?? []) required.add(r);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
if (input.local) {
|
|
175
|
+
const localProps = (input.local.properties as Record<string, unknown> | undefined) ?? {};
|
|
176
|
+
Object.assign(properties, localProps);
|
|
177
|
+
const localRequired = Array.isArray(input.local.required)
|
|
178
|
+
? (input.local.required as string[])
|
|
179
|
+
: [];
|
|
180
|
+
for (const r of localRequired) required.add(r);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
const additionalProperties =
|
|
184
|
+
input.local && Object.prototype.hasOwnProperty.call(input.local, "additionalProperties")
|
|
185
|
+
? input.local.additionalProperties
|
|
186
|
+
: false;
|
|
187
|
+
|
|
188
|
+
const result: Record<string, unknown> = {
|
|
189
|
+
type: "object",
|
|
190
|
+
additionalProperties,
|
|
191
|
+
properties,
|
|
192
|
+
};
|
|
193
|
+
if (required.size > 0) result.required = Array.from(required);
|
|
194
|
+
return result;
|
|
195
|
+
}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
/*
|
|
2
|
+
<MODULE_CONTRACT>
|
|
3
|
+
<purpose>Shared types and reusable JSON Schema building blocks for section prop fragments: standard list items, cards, stats, enums, and effect stack items.</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>RFC-0303 Phase 3: extracted from shared-section-props/index.ts as part of the domain split.</item>
|
|
10
|
+
</CHANGE_SUMMARY>
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
export type JsonSchemaFragment = {
|
|
14
|
+
properties: Record<string, unknown>;
|
|
15
|
+
required?: string[];
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const STANDARD_LIST_ITEM_SCHEMA = {
|
|
19
|
+
type: "object",
|
|
20
|
+
additionalProperties: false,
|
|
21
|
+
required: ["text"],
|
|
22
|
+
properties: {
|
|
23
|
+
text: { type: "string", minLength: 1 },
|
|
24
|
+
icon: {
|
|
25
|
+
type: "object",
|
|
26
|
+
additionalProperties: false,
|
|
27
|
+
required: ["vendor", "collection", "name"],
|
|
28
|
+
properties: {
|
|
29
|
+
vendor: { type: "string" },
|
|
30
|
+
collection: { type: "string" },
|
|
31
|
+
name: { type: "string" },
|
|
32
|
+
size: { type: "number" },
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export const STANDARD_CARD_SCHEMA = {
|
|
39
|
+
type: "object",
|
|
40
|
+
additionalProperties: false,
|
|
41
|
+
required: ["title"],
|
|
42
|
+
properties: {
|
|
43
|
+
title: { type: "string", minLength: 1 },
|
|
44
|
+
description: { type: "string" },
|
|
45
|
+
image: { type: "string" },
|
|
46
|
+
imageAlt: { type: "string" },
|
|
47
|
+
icon: {
|
|
48
|
+
type: "object",
|
|
49
|
+
additionalProperties: false,
|
|
50
|
+
required: ["vendor", "collection", "name"],
|
|
51
|
+
properties: {
|
|
52
|
+
vendor: { type: "string" },
|
|
53
|
+
collection: { type: "string" },
|
|
54
|
+
name: { type: "string" },
|
|
55
|
+
size: { type: "number" },
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
href: { type: "string" },
|
|
59
|
+
badge: { type: "string" },
|
|
60
|
+
number: { type: "string" },
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export const STAT_ITEM_SCHEMA = {
|
|
65
|
+
type: "object",
|
|
66
|
+
additionalProperties: false,
|
|
67
|
+
required: ["value", "label"],
|
|
68
|
+
properties: {
|
|
69
|
+
value: { type: "string", minLength: 1 },
|
|
70
|
+
label: { type: "string", minLength: 1 },
|
|
71
|
+
numericValue: { type: "number" },
|
|
72
|
+
prefix: { type: "string" },
|
|
73
|
+
suffix: { type: "string" },
|
|
74
|
+
decimals: { type: "number", minimum: 0 },
|
|
75
|
+
duration: { type: "number", minimum: 0.1 },
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
export const ALIGN_ENUM = { type: "string", enum: ["left", "center", "right"] };
|
|
80
|
+
export const ICON_COLOR_ENUM = {
|
|
81
|
+
type: "string",
|
|
82
|
+
enum: ["primary", "accent", "success", "warning", "error", "muted"],
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export const EFFECT_COLOR_SCHEMA = { type: "string", minLength: 1 };
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* RFC-0134 + RFC-0151 — one effect stack item is a discriminated union over
|
|
89
|
+
* every supported effect kind. Target × kind admissibility (e.g. glass only on
|
|
90
|
+
* surfaces, text kinds only on `heading`) is enforced by effects.contract.validate,
|
|
91
|
+
* not by this shape schema. Mirrors packages/share/src/schemas/effects.ts.
|
|
92
|
+
*/
|
|
93
|
+
export const EFFECT_STACK_ITEM_SCHEMA = {
|
|
94
|
+
oneOf: [
|
|
95
|
+
{
|
|
96
|
+
type: "object",
|
|
97
|
+
additionalProperties: false,
|
|
98
|
+
required: ["kind", "enabled"],
|
|
99
|
+
properties: {
|
|
100
|
+
kind: { const: "glass" },
|
|
101
|
+
enabled: { type: "boolean" },
|
|
102
|
+
blur: { type: "number", minimum: 0, maximum: 64 },
|
|
103
|
+
saturate: { type: "number", minimum: 0, maximum: 400 },
|
|
104
|
+
tint: { type: "string", minLength: 1 },
|
|
105
|
+
tintOpacity: { type: "number", minimum: 0, maximum: 1 },
|
|
106
|
+
border: { enum: ["hairline", "none"] },
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
type: "object",
|
|
111
|
+
additionalProperties: false,
|
|
112
|
+
required: ["kind", "enabled"],
|
|
113
|
+
properties: {
|
|
114
|
+
kind: { const: "shadow" },
|
|
115
|
+
enabled: { type: "boolean" },
|
|
116
|
+
offsetX: { type: "number", minimum: -64, maximum: 64 },
|
|
117
|
+
offsetY: { type: "number", minimum: -64, maximum: 64 },
|
|
118
|
+
blur: { type: "number", minimum: 0, maximum: 64 },
|
|
119
|
+
color: EFFECT_COLOR_SCHEMA,
|
|
120
|
+
opacity: { type: "number", minimum: 0, maximum: 1 },
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
type: "object",
|
|
125
|
+
additionalProperties: false,
|
|
126
|
+
required: ["kind", "enabled"],
|
|
127
|
+
properties: {
|
|
128
|
+
kind: { const: "glow" },
|
|
129
|
+
enabled: { type: "boolean" },
|
|
130
|
+
blur: { type: "number", minimum: 0, maximum: 96 },
|
|
131
|
+
color: EFFECT_COLOR_SCHEMA,
|
|
132
|
+
opacity: { type: "number", minimum: 0, maximum: 1 },
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
type: "object",
|
|
137
|
+
additionalProperties: false,
|
|
138
|
+
required: ["kind", "enabled"],
|
|
139
|
+
properties: {
|
|
140
|
+
kind: { const: "bulge" },
|
|
141
|
+
enabled: { type: "boolean" },
|
|
142
|
+
depth: { type: "number", minimum: 0, maximum: 16 },
|
|
143
|
+
highlight: { type: "number", minimum: 0, maximum: 1 },
|
|
144
|
+
shade: { type: "number", minimum: 0, maximum: 1 },
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
type: "object",
|
|
149
|
+
additionalProperties: false,
|
|
150
|
+
required: ["kind", "enabled"],
|
|
151
|
+
properties: {
|
|
152
|
+
kind: { const: "tilt" },
|
|
153
|
+
enabled: { type: "boolean" },
|
|
154
|
+
rotate: { type: "number", minimum: -15, maximum: 15 },
|
|
155
|
+
skewX: { type: "number", minimum: -15, maximum: 15 },
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
],
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
/** Shared effects array schema used by multiple body fragments. */
|
|
162
|
+
export const EFFECTS_ARRAY_SCHEMA = {
|
|
163
|
+
type: "array",
|
|
164
|
+
minItems: 1,
|
|
165
|
+
items: {
|
|
166
|
+
type: "object",
|
|
167
|
+
additionalProperties: false,
|
|
168
|
+
required: ["target", "stack"],
|
|
169
|
+
properties: {
|
|
170
|
+
target: { type: "string", minLength: 1 },
|
|
171
|
+
stack: {
|
|
172
|
+
type: "array",
|
|
173
|
+
minItems: 1,
|
|
174
|
+
items: EFFECT_STACK_ITEM_SCHEMA,
|
|
175
|
+
},
|
|
176
|
+
},
|
|
177
|
+
},
|
|
178
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/*
|
|
2
|
+
<MODULE_CONTRACT>
|
|
3
|
+
<purpose>
|
|
4
|
+
[RFC-0101 + RFC-0102 + RFC-0103] Canonical catalog of JSON Schema fragments
|
|
5
|
+
that section manifests compose via the `propsSchemaCompose: [...]` field.
|
|
6
|
+
|
|
7
|
+
Two families of fragments:
|
|
8
|
+
- section-visual / section-header — visual + header sub-schemas applied
|
|
9
|
+
at section root.
|
|
10
|
+
- body-{kind} — one fragment per RFC-0103 body kind that adds the entire
|
|
11
|
+
`body: { kind: ..., ... }` object at section root.
|
|
12
|
+
|
|
13
|
+
Section manifests reference these by id instead of duplicating the same 60+
|
|
14
|
+
lines of JSON Schema in every file.
|
|
15
|
+
</purpose>
|
|
16
|
+
<non-goals>
|
|
17
|
+
<item>Do not introduce app-specific runtime composition or deployment behavior into this reusable package source file.</item>
|
|
18
|
+
</non-goals>
|
|
19
|
+
</MODULE_CONTRACT>
|
|
20
|
+
<CHANGE_SUMMARY>
|
|
21
|
+
<item>RFC-0133: backfilled MODULE_MAP and CHANGE_SUMMARY markers for compass.validate compliance.</item>
|
|
22
|
+
<item>RFC-0303 Phase 3: split the flat 719-line file into sub-modules; this file is now the re-export shim.</item>
|
|
23
|
+
</CHANGE_SUMMARY>
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
export type { JsonSchemaFragment } from "./common.ts";
|
|
27
|
+
|
|
28
|
+
export {
|
|
29
|
+
SHARED_SECTION_PROPS,
|
|
30
|
+
isSharedSectionPropsId,
|
|
31
|
+
sharedSectionPropsChangelog,
|
|
32
|
+
composeManifestPropsSchema,
|
|
33
|
+
} from "./catalog.ts";
|
|
34
|
+
export type { SharedSectionPropsId, SharedSectionPropsRef } from "./catalog.ts";
|