@wildo-ai/framework-knowledge 1.1.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/LICENSE +34 -0
- package/dist/esm/.builder.pid +9 -0
- package/dist/esm/framework-knowledge.definitions.d.ts +51 -0
- package/dist/esm/framework-knowledge.definitions.d.ts.map +1 -0
- package/dist/esm/framework-knowledge.definitions.js +1571 -0
- package/dist/esm/framework-knowledge.definitions.js.map +1 -0
- package/dist/esm/framework-knowledge.loader.d.ts +72 -0
- package/dist/esm/framework-knowledge.loader.d.ts.map +1 -0
- package/dist/esm/framework-knowledge.loader.js +258 -0
- package/dist/esm/framework-knowledge.loader.js.map +1 -0
- package/dist/esm/framework-knowledge.schemas.d.ts +236 -0
- package/dist/esm/framework-knowledge.schemas.d.ts.map +1 -0
- package/dist/esm/framework-knowledge.schemas.js +23 -0
- package/dist/esm/framework-knowledge.schemas.js.map +1 -0
- package/dist/esm/index.d.ts +4 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +4 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/playbooks/bottom_up.build-decompose/playbook.definition.d.ts +53 -0
- package/dist/esm/playbooks/bottom_up.build-decompose/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/bottom_up.build-decompose/playbook.definition.js +56 -0
- package/dist/esm/playbooks/bottom_up.build-decompose/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/bottom_up.build-dispatch/playbook.definition.d.ts +200 -0
- package/dist/esm/playbooks/bottom_up.build-dispatch/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/bottom_up.build-dispatch/playbook.definition.js +228 -0
- package/dist/esm/playbooks/bottom_up.build-dispatch/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/bottom_up.build-scale/playbook.definition.d.ts +39 -0
- package/dist/esm/playbooks/bottom_up.build-scale/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/bottom_up.build-scale/playbook.definition.js +39 -0
- package/dist/esm/playbooks/bottom_up.build-scale/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/bottom_up.domain-plan/playbook.definition.d.ts +261 -0
- package/dist/esm/playbooks/bottom_up.domain-plan/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/bottom_up.domain-plan/playbook.definition.js +412 -0
- package/dist/esm/playbooks/bottom_up.domain-plan/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/bottom_up.foundation/playbook.definition.d.ts +61 -0
- package/dist/esm/playbooks/bottom_up.foundation/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/bottom_up.foundation/playbook.definition.js +65 -0
- package/dist/esm/playbooks/bottom_up.foundation/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/bottom_up.placement-plan/playbook.definition.d.ts +53 -0
- package/dist/esm/playbooks/bottom_up.placement-plan/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/bottom_up.placement-plan/playbook.definition.js +54 -0
- package/dist/esm/playbooks/bottom_up.placement-plan/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/refinement.compliance-document-candidate/playbook.definition.d.ts +43 -0
- package/dist/esm/playbooks/refinement.compliance-document-candidate/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/refinement.compliance-document-candidate/playbook.definition.js +73 -0
- package/dist/esm/playbooks/refinement.compliance-document-candidate/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/refinement.document-facts/playbook.definition.d.ts +53 -0
- package/dist/esm/playbooks/refinement.document-facts/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/refinement.document-facts/playbook.definition.js +114 -0
- package/dist/esm/playbooks/refinement.document-facts/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/top_down.brand-identity/playbook.definition.d.ts +95 -0
- package/dist/esm/playbooks/top_down.brand-identity/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/top_down.brand-identity/playbook.definition.js +102 -0
- package/dist/esm/playbooks/top_down.brand-identity/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/top_down.business-model/playbook.definition.d.ts +258 -0
- package/dist/esm/playbooks/top_down.business-model/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/top_down.business-model/playbook.definition.js +241 -0
- package/dist/esm/playbooks/top_down.business-model/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/top_down.capability-map/playbook.definition.d.ts +241 -0
- package/dist/esm/playbooks/top_down.capability-map/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/top_down.capability-map/playbook.definition.js +202 -0
- package/dist/esm/playbooks/top_down.capability-map/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/top_down.compliance-posture/playbook.definition.d.ts +82 -0
- package/dist/esm/playbooks/top_down.compliance-posture/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/top_down.compliance-posture/playbook.definition.js +89 -0
- package/dist/esm/playbooks/top_down.compliance-posture/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/top_down.market-analysis/playbook.definition.d.ts +56 -0
- package/dist/esm/playbooks/top_down.market-analysis/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/top_down.market-analysis/playbook.definition.js +76 -0
- package/dist/esm/playbooks/top_down.market-analysis/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/top_down.market-evidence-adequacy/playbook.definition.d.ts +30 -0
- package/dist/esm/playbooks/top_down.market-evidence-adequacy/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/top_down.market-evidence-adequacy/playbook.definition.js +27 -0
- package/dist/esm/playbooks/top_down.market-evidence-adequacy/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/top_down.market-research/playbook.definition.d.ts +31 -0
- package/dist/esm/playbooks/top_down.market-research/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/top_down.market-research/playbook.definition.js +26 -0
- package/dist/esm/playbooks/top_down.market-research/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/top_down.market-snapshot-produce/playbook.definition.d.ts +254 -0
- package/dist/esm/playbooks/top_down.market-snapshot-produce/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/top_down.market-snapshot-produce/playbook.definition.js +219 -0
- package/dist/esm/playbooks/top_down.market-snapshot-produce/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/top_down.phase-gate/playbook.definition.d.ts +180 -0
- package/dist/esm/playbooks/top_down.phase-gate/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/top_down.phase-gate/playbook.definition.js +302 -0
- package/dist/esm/playbooks/top_down.phase-gate/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/top_down.requirements-definition/playbook.definition.d.ts +249 -0
- package/dist/esm/playbooks/top_down.requirements-definition/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/top_down.requirements-definition/playbook.definition.js +286 -0
- package/dist/esm/playbooks/top_down.requirements-definition/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/top_down.scope-roadmap/playbook.definition.d.ts +248 -0
- package/dist/esm/playbooks/top_down.scope-roadmap/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/top_down.scope-roadmap/playbook.definition.js +227 -0
- package/dist/esm/playbooks/top_down.scope-roadmap/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/top_down.value-proposition/playbook.definition.d.ts +45 -0
- package/dist/esm/playbooks/top_down.value-proposition/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/top_down.value-proposition/playbook.definition.js +48 -0
- package/dist/esm/playbooks/top_down.value-proposition/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/top_down.vision-elicitation/playbook.definition.d.ts +250 -0
- package/dist/esm/playbooks/top_down.vision-elicitation/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/top_down.vision-elicitation/playbook.definition.js +218 -0
- package/dist/esm/playbooks/top_down.vision-elicitation/playbook.definition.js.map +1 -0
- package/dist/knowledge/assurance-authority-bases/wildo-safe-baseline-v1/authority-basis.json +1 -0
- package/dist/knowledge/manifest.json +45 -0
- package/dist/knowledge/playbooks/bottom_up.build-decompose/method.md +407 -0
- package/dist/knowledge/playbooks/bottom_up.build-decompose/playbook.json +69 -0
- package/dist/knowledge/playbooks/bottom_up.build-dispatch/evaluation-protocol.json +1 -0
- package/dist/knowledge/playbooks/bottom_up.build-dispatch/evaluation-treatment.json +1 -0
- package/dist/knowledge/playbooks/bottom_up.build-dispatch/method.md +556 -0
- package/dist/knowledge/playbooks/bottom_up.build-dispatch/playbook.json +47 -0
- package/dist/knowledge/playbooks/bottom_up.build-scale/method.md +344 -0
- package/dist/knowledge/playbooks/bottom_up.build-scale/playbook.json +43 -0
- package/dist/knowledge/playbooks/bottom_up.domain-plan/evaluation-protocol.json +1 -0
- package/dist/knowledge/playbooks/bottom_up.domain-plan/evaluation-treatment.json +1 -0
- package/dist/knowledge/playbooks/bottom_up.domain-plan/method.md +259 -0
- package/dist/knowledge/playbooks/bottom_up.domain-plan/playbook.json +83 -0
- package/dist/knowledge/playbooks/bottom_up.domain-plan/structured-artifact-action.json +1 -0
- package/dist/knowledge/playbooks/bottom_up.foundation/method.md +321 -0
- package/dist/knowledge/playbooks/bottom_up.foundation/playbook.json +79 -0
- package/dist/knowledge/playbooks/bottom_up.placement-plan/method.md +185 -0
- package/dist/knowledge/playbooks/bottom_up.placement-plan/playbook.json +66 -0
- package/dist/knowledge/playbooks/refinement.compliance-document-candidate/method.md +737 -0
- package/dist/knowledge/playbooks/refinement.compliance-document-candidate/playbook.json +44 -0
- package/dist/knowledge/playbooks/refinement.document-facts/method.md +261 -0
- package/dist/knowledge/playbooks/refinement.document-facts/playbook.json +57 -0
- package/dist/knowledge/playbooks/top_down.brand-identity/method.md +151 -0
- package/dist/knowledge/playbooks/top_down.brand-identity/playbook.json +124 -0
- package/dist/knowledge/playbooks/top_down.business-model/evaluation-protocol.json +1 -0
- package/dist/knowledge/playbooks/top_down.business-model/evaluation-treatment.json +1 -0
- package/dist/knowledge/playbooks/top_down.business-model/method.md +128 -0
- package/dist/knowledge/playbooks/top_down.business-model/playbook.json +102 -0
- package/dist/knowledge/playbooks/top_down.business-model/structured-artifact-action.json +1 -0
- package/dist/knowledge/playbooks/top_down.capability-map/evaluation-protocol.json +1 -0
- package/dist/knowledge/playbooks/top_down.capability-map/evaluation-treatment.json +1 -0
- package/dist/knowledge/playbooks/top_down.capability-map/method.md +239 -0
- package/dist/knowledge/playbooks/top_down.capability-map/playbook.json +73 -0
- package/dist/knowledge/playbooks/top_down.capability-map/structured-artifact-action.json +1 -0
- package/dist/knowledge/playbooks/top_down.compliance-posture/method.md +177 -0
- package/dist/knowledge/playbooks/top_down.compliance-posture/playbook.json +95 -0
- package/dist/knowledge/playbooks/top_down.market-analysis/method.md +64 -0
- package/dist/knowledge/playbooks/top_down.market-analysis/playbook.json +49 -0
- package/dist/knowledge/playbooks/top_down.market-evidence-adequacy/method.md +56 -0
- package/dist/knowledge/playbooks/top_down.market-evidence-adequacy/playbook.json +40 -0
- package/dist/knowledge/playbooks/top_down.market-research/method.md +68 -0
- package/dist/knowledge/playbooks/top_down.market-research/playbook.json +42 -0
- package/dist/knowledge/playbooks/top_down.market-snapshot-produce/evaluation-protocol.json +1 -0
- package/dist/knowledge/playbooks/top_down.market-snapshot-produce/evaluation-treatment.json +1 -0
- package/dist/knowledge/playbooks/top_down.market-snapshot-produce/method.md +239 -0
- package/dist/knowledge/playbooks/top_down.market-snapshot-produce/playbook.json +69 -0
- package/dist/knowledge/playbooks/top_down.market-snapshot-produce/structured-artifact-action.json +1 -0
- package/dist/knowledge/playbooks/top_down.phase-gate/evaluation-protocol.json +1 -0
- package/dist/knowledge/playbooks/top_down.phase-gate/evaluation-treatment.json +1 -0
- package/dist/knowledge/playbooks/top_down.phase-gate/method.md +96 -0
- package/dist/knowledge/playbooks/top_down.phase-gate/playbook.json +77 -0
- package/dist/knowledge/playbooks/top_down.requirements-definition/evaluation-protocol.json +1 -0
- package/dist/knowledge/playbooks/top_down.requirements-definition/evaluation-treatment.json +1 -0
- package/dist/knowledge/playbooks/top_down.requirements-definition/method.md +53 -0
- package/dist/knowledge/playbooks/top_down.requirements-definition/playbook.json +61 -0
- package/dist/knowledge/playbooks/top_down.requirements-definition/structured-artifact-action.json +1 -0
- package/dist/knowledge/playbooks/top_down.scope-roadmap/evaluation-protocol.json +1 -0
- package/dist/knowledge/playbooks/top_down.scope-roadmap/evaluation-treatment.json +1 -0
- package/dist/knowledge/playbooks/top_down.scope-roadmap/method.md +280 -0
- package/dist/knowledge/playbooks/top_down.scope-roadmap/playbook.json +87 -0
- package/dist/knowledge/playbooks/top_down.scope-roadmap/structured-artifact-action.json +1 -0
- package/dist/knowledge/playbooks/top_down.value-proposition/method.md +204 -0
- package/dist/knowledge/playbooks/top_down.value-proposition/playbook.json +54 -0
- package/dist/knowledge/playbooks/top_down.vision-elicitation/evaluation-protocol.json +1 -0
- package/dist/knowledge/playbooks/top_down.vision-elicitation/evaluation-treatment.json +1 -0
- package/dist/knowledge/playbooks/top_down.vision-elicitation/method.md +146 -0
- package/dist/knowledge/playbooks/top_down.vision-elicitation/playbook.json +120 -0
- package/dist/knowledge/playbooks/top_down.vision-elicitation/structured-artifact-action.json +1 -0
- package/dist/knowledge/references/application.database.migration-change-risk.md +28 -0
- package/dist/knowledge/references/assertions.authored-metadata.config.md +90 -0
- package/dist/knowledge/references/assertions.behaviors.wire-contracts.md +223 -0
- package/dist/knowledge/references/assertions.references.conventions.md +92 -0
- package/dist/knowledge/references/assertions.snapshot.validation.md +317 -0
- package/dist/knowledge/references/assertions.specification.config.md +287 -0
- package/dist/knowledge/references/brand.asset.config.md +167 -0
- package/dist/knowledge/references/brand.authored-metadata.config.md +51 -0
- package/dist/knowledge/references/brand.logo-direction.config.md +88 -0
- package/dist/knowledge/references/brand.name.config.md +46 -0
- package/dist/knowledge/references/brand.snapshot.config.md +76 -0
- package/dist/knowledge/references/brand.snapshot.validation.md +446 -0
- package/dist/knowledge/references/brand.visual-tone.config.md +56 -0
- package/dist/knowledge/references/build-plan.task-graph.config.md +198 -0
- package/dist/knowledge/references/business-model.authored-metadata.config.md +65 -0
- package/dist/knowledge/references/business-model.pricing-plan.config.md +122 -0
- package/dist/knowledge/references/business-model.references.conventions.md +99 -0
- package/dist/knowledge/references/business-model.snapshot.config.md +121 -0
- package/dist/knowledge/references/business-model.snapshot.validation.md +325 -0
- package/dist/knowledge/references/cli.market.generate-command.md +230 -0
- package/dist/knowledge/references/cli.market.utils.md +147 -0
- package/dist/knowledge/references/companion.introspection.behaviors.market.md +90 -0
- package/dist/knowledge/references/companion.introspection.handlers.market.md +42 -0
- package/dist/knowledge/references/companion.market.generation-service.md +270 -0
- package/dist/knowledge/references/companion.market.prompt-renderer.md +244 -0
- package/dist/knowledge/references/companion.technical-doc.service.md +809 -0
- package/dist/knowledge/references/engine.client-bundle.allow-list.md +125 -0
- package/dist/knowledge/references/engine.client-bundle.discipline.md +130 -0
- package/dist/knowledge/references/engine.client-bundle.external-connectors-public.discipline.md +55 -0
- package/dist/knowledge/references/engine.saas-technical-doc.config.md +215 -0
- package/dist/knowledge/references/engine.saas-website.config.md +331 -0
- package/dist/knowledge/references/example.authorization.unit-narrowing.declaration.md +24 -0
- package/dist/knowledge/references/example.backend.addon-wiring.module.md +55 -0
- package/dist/knowledge/references/example.backend.custom-operation.create-postfix.md +35 -0
- package/dist/knowledge/references/example.backend.operation.error-throw.md +17 -0
- package/dist/knowledge/references/example.config.app-shell.command-menu-items.md +63 -0
- package/dist/knowledge/references/example.config.app-shell.full.md +147 -0
- package/dist/knowledge/references/example.config.app-shell.hosted-components.md +45 -0
- package/dist/knowledge/references/example.config.app-shell.quick-switcher-fields.md +37 -0
- package/dist/knowledge/references/example.config.backend.billing-enable.md +20 -0
- package/dist/knowledge/references/example.config.backend.required-floors.md +46 -0
- package/dist/knowledge/references/example.config.design-system.full.md +162 -0
- package/dist/knowledge/references/example.config.navigation.full.md +71 -0
- package/dist/knowledge/references/example.config.provider.backend-scope-billing.md +27 -0
- package/dist/knowledge/references/example.data-seeding.minimal.md +114 -0
- package/dist/knowledge/references/example.email.template.minimal.md +54 -0
- package/dist/knowledge/references/example.engine.component-registration.lazy-load.md +16 -0
- package/dist/knowledge/references/example.engine.product-definitions.feature-and-profiles.md +146 -0
- package/dist/knowledge/references/example.flows-actors.chat-assistant.md +196 -0
- package/dist/knowledge/references/example.flows-actors.llm-agent-one-shot.md +174 -0
- package/dist/knowledge/references/example.i18n.label-generation.engine-barrel.md +15 -0
- package/dist/knowledge/references/example.infra.cdn.cloudflare.md +23 -0
- package/dist/knowledge/references/example.infra.cdn.generic.md +17 -0
- package/dist/knowledge/references/example.infra.environment-config.local.md +250 -0
- package/dist/knowledge/references/example.market.alternative.in-house-build.md +49 -0
- package/dist/knowledge/references/example.market.authored-metadata.md +32 -0
- package/dist/knowledge/references/example.market.buying-journey.core-icp.md +140 -0
- package/dist/knowledge/references/example.market.category.config.md +71 -0
- package/dist/knowledge/references/example.market.channel.community.md +39 -0
- package/dist/knowledge/references/example.market.feature-benefit.kano-threshold.md +67 -0
- package/dist/knowledge/references/example.market.feature-benefit.pain-reliever.md +65 -0
- package/dist/knowledge/references/example.market.icp.anti-target.md +47 -0
- package/dist/knowledge/references/example.market.icp.individual.md +82 -0
- package/dist/knowledge/references/example.market.icp.legal-entity-with-geographies.md +95 -0
- package/dist/knowledge/references/example.market.is-benefit-available.composition.md +40 -0
- package/dist/knowledge/references/example.market.job.emotional.md +27 -0
- package/dist/knowledge/references/example.market.job.functional.md +28 -0
- package/dist/knowledge/references/example.market.message-template.seeds.md +106 -0
- package/dist/knowledge/references/example.market.objection.pricing.md +39 -0
- package/dist/knowledge/references/example.market.persona.dmu-with-inheritance.md +62 -0
- package/dist/knowledge/references/example.market.persona.individual-self.md +51 -0
- package/dist/knowledge/references/example.market.positioning.per-icp.md +103 -0
- package/dist/knowledge/references/example.market.proof.metric.md +39 -0
- package/dist/knowledge/references/example.market.scoring.golden-case.md +46 -0
- package/dist/knowledge/references/example.market.scoring.no-coverage-zero.md +40 -0
- package/dist/knowledge/references/example.market.snapshot-validation.duplicate-journey-stage.md +36 -0
- package/dist/knowledge/references/example.market.snapshot-validation.errors-by-kind.md +55 -0
- package/dist/knowledge/references/example.market.snapshot-validation.objection-proof-benefit-mismatch.md +74 -0
- package/dist/knowledge/references/example.market.snapshot-validation.proof-without-support.md +32 -0
- package/dist/knowledge/references/example.market.snapshot-validation.threshold-without-job.md +44 -0
- package/dist/knowledge/references/example.market.snapshot.assembled.md +49 -0
- package/dist/knowledge/references/example.market.tone-of-voice.config.md +41 -0
- package/dist/knowledge/references/example.market.trigger.growth-milestone.md +43 -0
- package/dist/knowledge/references/example.module.companion-exports.full.md +142 -0
- package/dist/knowledge/references/example.module.registration.shared.md +16 -0
- package/dist/knowledge/references/example.module.relationships.actor-edge-back-to-scope-owner.md +47 -0
- package/dist/knowledge/references/example.module.relationships.discriminator.md +25 -0
- package/dist/knowledge/references/example.module.relationships.scope-membership-junction.md +25 -0
- package/dist/knowledge/references/example.provider.backend-module-shape.md +110 -0
- package/dist/knowledge/references/example.provider.contribution.backend-billing.md +12 -0
- package/dist/knowledge/references/example.provider.frontend-file-picker.contribution.md +30 -0
- package/dist/knowledge/references/example.provider.frontend-file-picker.module.md +21 -0
- package/dist/knowledge/references/example.rag.source-fields.declaration.md +83 -0
- package/dist/knowledge/references/example.rate-limit.custom-controller-surface.md +25 -0
- package/dist/knowledge/references/example.rate-limit.resource-operation-surface.md +24 -0
- package/dist/knowledge/references/example.resource.add-field.priority-enum.md +19 -0
- package/dist/knowledge/references/example.resource.add-resource.module-factory-map.md +21 -0
- package/dist/knowledge/references/example.resource.config-wiring.fk-relationship.md +33 -0
- package/dist/knowledge/references/example.resource.custom-view.read-host.md +28 -0
- package/dist/knowledge/references/example.resource.mcp-exposure.md +65 -0
- package/dist/knowledge/references/example.resource.reference-constraints.role-constrained.md +27 -0
- package/dist/knowledge/references/example.resource.ui-behavior.enum-badge.md +22 -0
- package/dist/knowledge/references/example.resource.ui-behavior.operation-icon.md +43 -0
- package/dist/knowledge/references/example.spec.composite-view.workspace.md +72 -0
- package/dist/knowledge/references/example.spec.feature.flag-with-codehandling.md +64 -0
- package/dist/knowledge/references/example.spec.frontend-component.prop-vocabulary.md +88 -0
- package/dist/knowledge/references/example.spec.resource.semantic-field.md +23 -0
- package/dist/knowledge/references/example.views.app-level.composite-views-config.md +19 -0
- package/dist/knowledge/references/example.views.chart-view.resource-owned.md +69 -0
- package/dist/knowledge/references/example.views.composite-view.host-embeds.md +31 -0
- package/dist/knowledge/references/example.views.composite-view.workspace.md +65 -0
- package/dist/knowledge/references/example.views.custom-view.execution-host.md +41 -0
- package/dist/knowledge/references/example.views.execution-view.resource-owned.md +25 -0
- package/dist/knowledge/references/external-connectors.app.frontend-provider-module.md +42 -0
- package/dist/knowledge/references/market.alternative.config.md +68 -0
- package/dist/knowledge/references/market.alternative.kind.md +32 -0
- package/dist/knowledge/references/market.authored-metadata.config.md +64 -0
- package/dist/knowledge/references/market.buying-journey.config.md +43 -0
- package/dist/knowledge/references/market.buying-journey.stage.md +33 -0
- package/dist/knowledge/references/market.category.config.md +63 -0
- package/dist/knowledge/references/market.channel.config.md +59 -0
- package/dist/knowledge/references/market.channel.kind.md +49 -0
- package/dist/knowledge/references/market.context-block.builder.md +544 -0
- package/dist/knowledge/references/market.context-block.response.md +57 -0
- package/dist/knowledge/references/market.feature-benefit.config.md +84 -0
- package/dist/knowledge/references/market.feature-benefit.kano.md +41 -0
- package/dist/knowledge/references/market.gain.config.md +50 -0
- package/dist/knowledge/references/market.generation.response.md +108 -0
- package/dist/knowledge/references/market.icp.config.md +162 -0
- package/dist/knowledge/references/market.icp.geographic-targeting.md +57 -0
- package/dist/knowledge/references/market.inherit-from.md +74 -0
- package/dist/knowledge/references/market.is-benefit-available.md +58 -0
- package/dist/knowledge/references/market.job.config.md +48 -0
- package/dist/knowledge/references/market.message-template.config.md +86 -0
- package/dist/knowledge/references/market.objection.config.md +56 -0
- package/dist/knowledge/references/market.objection.kind.md +34 -0
- package/dist/knowledge/references/market.pain.config.md +50 -0
- package/dist/knowledge/references/market.persona.config.md +64 -0
- package/dist/knowledge/references/market.positioning.config.md +84 -0
- package/dist/knowledge/references/market.proof.config.md +48 -0
- package/dist/knowledge/references/market.proof.kind.md +34 -0
- package/dist/knowledge/references/market.references.weighted-edges.md +105 -0
- package/dist/knowledge/references/market.scoring.fit.md +215 -0
- package/dist/knowledge/references/market.snapshot.config.md +34 -0
- package/dist/knowledge/references/market.snapshot.validation.md +1171 -0
- package/dist/knowledge/references/market.tone-of-voice.config.md +80 -0
- package/dist/knowledge/references/market.trigger.config.md +45 -0
- package/dist/knowledge/references/market.trigger.kind.md +35 -0
- package/dist/knowledge/references/placement-plan.config.md +330 -0
- package/dist/knowledge/references/platform.config.application-database.md +74 -0
- package/dist/knowledge/references/platform.config.application-modules.md +30 -0
- package/dist/knowledge/references/platform.config.backing-services.md +266 -0
- package/dist/knowledge/references/platform.config.cdn.md +167 -0
- package/dist/knowledge/references/platform.config.environment.deployment.md +263 -0
- package/dist/knowledge/references/platform.config.saas.md +405 -0
- package/dist/knowledge/references/presets.models.design-system.configuration.md +59 -0
- package/dist/knowledge/references/presets.models.design-system.source-config.md +72 -0
- package/dist/knowledge/references/presets.models.labelling.sections.md +64 -0
- package/dist/knowledge/references/presets.models.material.profile-contract.md +192 -0
- package/dist/knowledge/references/presets.models.material.runtime-policy.md +60 -0
- package/dist/knowledge/references/presets.models.surface-policy.defaults.md +613 -0
- package/dist/knowledge/references/presets.models.surface-policy.md +534 -0
- package/dist/knowledge/references/presets.models.surface-variant.md +56 -0
- package/dist/knowledge/references/requirements.authored-metadata.config.md +64 -0
- package/dist/knowledge/references/requirements.functional-requirement.config.md +68 -0
- package/dist/knowledge/references/requirements.non-functional-requirement.config.md +100 -0
- package/dist/knowledge/references/requirements.references.conventions.md +125 -0
- package/dist/knowledge/references/requirements.snapshot.config.md +73 -0
- package/dist/knowledge/references/requirements.snapshot.validation.md +333 -0
- package/dist/knowledge/references/roadmap.authored-metadata.config.md +64 -0
- package/dist/knowledge/references/roadmap.phase.config.md +149 -0
- package/dist/knowledge/references/roadmap.references.conventions.md +89 -0
- package/dist/knowledge/references/roadmap.snapshot.config.md +65 -0
- package/dist/knowledge/references/roadmap.snapshot.validation.md +325 -0
- package/dist/knowledge/references/saas.backend.app-config.backend-authored.md +32 -0
- package/dist/knowledge/references/saas.backend.application-initialization.assembly.md +38 -0
- package/dist/knowledge/references/saas.backend.billing.resolution-failure-reasons.md +45 -0
- package/dist/knowledge/references/saas.backend.custom-operation.authoritative-fields.md +53 -0
- package/dist/knowledge/references/saas.backend.custom-operation.transactional-core.md +120 -0
- package/dist/knowledge/references/saas.backend.domain-module.md +237 -0
- package/dist/knowledge/references/saas.backend.email-template.definition.md +69 -0
- package/dist/knowledge/references/saas.backend.flows-actors.a2a-agent-card.md +89 -0
- package/dist/knowledge/references/saas.backend.flows-actors.a2a-task-surface.md +118 -0
- package/dist/knowledge/references/saas.backend.flows-actors.function-tool.md +82 -0
- package/dist/knowledge/references/saas.backend.flows-actors.invoke-agent.md +48 -0
- package/dist/knowledge/references/saas.backend.flows-actors.resource-read-tool.md +39 -0
- package/dist/knowledge/references/saas.backend.flows-actors.resource-write-tool.md +67 -0
- package/dist/knowledge/references/saas.backend.pdf-template.bindings.md +52 -0
- package/dist/knowledge/references/saas.backend.pdf-template.definition.md +113 -0
- package/dist/knowledge/references/saas.backend.rate-limit-service.check-policy.md +75 -0
- package/dist/knowledge/references/saas.backend.system-access-service.md +994 -0
- package/dist/knowledge/references/saas.data-seeding.admin-endpoints.md +59 -0
- package/dist/knowledge/references/saas.data-seeding.bootstrap-wiring.md +184 -0
- package/dist/knowledge/references/saas.data-seeding.definition-input.md +95 -0
- package/dist/knowledge/references/saas.data-seeding.modes.md +72 -0
- package/dist/knowledge/references/saas.data-seeding.run-ledger.md +198 -0
- package/dist/knowledge/references/saas.data-seeding.run-status.md +35 -0
- package/dist/knowledge/references/saas.data-seeding.schedule.md +91 -0
- package/dist/knowledge/references/saas.data-seeding.scope-iteration-strategy.md +46 -0
- package/dist/knowledge/references/saas.external-providers.backend-provider-registry.runtime-filter.md +55 -0
- package/dist/knowledge/references/saas.external-providers.document-extraction.applicability.md +26 -0
- package/dist/knowledge/references/saas.external-providers.embeddings.applicability.md +30 -0
- package/dist/knowledge/references/saas.external-providers.llm.model-configuration.md +124 -0
- package/dist/knowledge/references/saas.external-providers.llm.operation-key.md +49 -0
- package/dist/knowledge/references/saas.frontend.app-level-component.configuration.md +265 -0
- package/dist/knowledge/references/saas.frontend.app-level-component.vocabulary.md +148 -0
- package/dist/knowledge/references/saas.frontend.app-shell.hosted-components.md +145 -0
- package/dist/knowledge/references/saas.frontend.chart-view.inserted-declaration.md +80 -0
- package/dist/knowledge/references/saas.frontend.command-menu.omnibox.md +88 -0
- package/dist/knowledge/references/saas.frontend.command-menu.search-resource.md +109 -0
- package/dist/knowledge/references/saas.frontend.component-registration.entry.md +21 -0
- package/dist/knowledge/references/saas.frontend.composite-view.authoring.md +102 -0
- package/dist/knowledge/references/saas.frontend.composite-view.define-helper.md +31 -0
- package/dist/knowledge/references/saas.frontend.domain-module.md +31 -0
- package/dist/knowledge/references/saas.frontend.embedded-resource-descent.md +37 -0
- package/dist/knowledge/references/saas.frontend.execution-view.action-status-contract.md +172 -0
- package/dist/knowledge/references/saas.frontend.execution-view.action-status-contract.per-action-retry-loop.md +115 -0
- package/dist/knowledge/references/saas.frontend.execution-view.definition.md +172 -0
- package/dist/knowledge/references/saas.frontend.execution-view.dirty-bridge-contract.local-pane.md +109 -0
- package/dist/knowledge/references/saas.frontend.execution-view.dirty-bridge-contract.md +55 -0
- package/dist/knowledge/references/saas.frontend.execution-view.dirty-state-contract.md +151 -0
- package/dist/knowledge/references/saas.frontend.execution-view.failure-handling-contract.md +302 -0
- package/dist/knowledge/references/saas.frontend.execution-view.loading-aggregation.md +89 -0
- package/dist/knowledge/references/saas.frontend.execution-view.loading-aggregation.participation-prefetch.md +231 -0
- package/dist/knowledge/references/saas.frontend.execution-view.loading-aggregation.participation-prefetch.shell-data-hydrator.md +174 -0
- package/dist/knowledge/references/saas.frontend.execution-view.navigation-handling-and-embedding.md +96 -0
- package/dist/knowledge/references/saas.frontend.execution-view.navigation-handling-and-embedding.resolution.md +45 -0
- package/dist/knowledge/references/saas.frontend.execution-view.outcome-emission-contract.md +71 -0
- package/dist/knowledge/references/saas.frontend.execution-view.participation-and-anchor.md +80 -0
- package/dist/knowledge/references/saas.frontend.execution-view.three-zone-contract.md +147 -0
- package/dist/knowledge/references/saas.frontend.flows-actors-view.md +40 -0
- package/dist/knowledge/references/saas.frontend.form-fields.file-provider-constraints.md +80 -0
- package/dist/knowledge/references/saas.frontend.full-custom-view.definition.md +64 -0
- package/dist/knowledge/references/saas.frontend.inserted-view.identity-bindings-descriptor.md +149 -0
- package/dist/knowledge/references/saas.frontend.operation-key-and-resource-config-like.md +63 -0
- package/dist/knowledge/references/saas.frontend.quick-switcher.scope-field.md +102 -0
- package/dist/knowledge/references/saas.frontend.related-resource-embeds.md +86 -0
- package/dist/knowledge/references/saas.frontend.related-resource-preview.md +23 -0
- package/dist/knowledge/references/saas.frontend.related-resource-sections.md +28 -0
- package/dist/knowledge/references/saas.frontend.resource-header-title.md +43 -0
- package/dist/knowledge/references/saas.frontend.resource-layout-templates.md +215 -0
- package/dist/knowledge/references/saas.frontend.resource-operation-frontend-config.md +531 -0
- package/dist/knowledge/references/saas.frontend.resource-ui-behavior-config.md +210 -0
- package/dist/knowledge/references/saas.frontend.resource-ui-behavior-preset-map.md +39 -0
- package/dist/knowledge/references/saas.frontend.settings-hub.engine-destinations.md +58 -0
- package/dist/knowledge/references/saas.frontend.settings-hub.placement.md +118 -0
- package/dist/knowledge/references/saas.frontend.view-definition-scope.md +42 -0
- package/dist/knowledge/references/saas.market.generation-agent.md +104 -0
- package/dist/knowledge/references/saas.models.core-resource-operation.md +86 -0
- package/dist/knowledge/references/saas.models.data-mode-read-list.md +395 -0
- package/dist/knowledge/references/saas.models.engine-capabilities.md +114 -0
- package/dist/knowledge/references/saas.models.error-type.md +45 -0
- package/dist/knowledge/references/saas.models.external-data-pipeline.md +162 -0
- package/dist/knowledge/references/saas.models.feature-limit-semantic.md +51 -0
- package/dist/knowledge/references/saas.models.flows-actors.agent-configuration.md +127 -0
- package/dist/knowledge/references/saas.models.flows-actors.agent-definition.md +115 -0
- package/dist/knowledge/references/saas.models.flows-actors.agent-invocation.md +52 -0
- package/dist/knowledge/references/saas.models.flows-actors.agent-prompt-spec.md +188 -0
- package/dist/knowledge/references/saas.models.http-api-binding.md +237 -0
- package/dist/knowledge/references/saas.models.navigation.layout.md +149 -0
- package/dist/knowledge/references/saas.models.organization-unit-narrowing-containment.md +22 -0
- package/dist/knowledge/references/saas.models.organization-unit-narrowing-declaration.md +42 -0
- package/dist/knowledge/references/saas.models.polymorphism.optout-business-key.md +62 -0
- package/dist/knowledge/references/saas.models.polymorphism.variant-definition.md +74 -0
- package/dist/knowledge/references/saas.models.provider-capabilities.md +97 -0
- package/dist/knowledge/references/saas.models.rate-limit-configuration.md +67 -0
- package/dist/knowledge/references/saas.models.relationship-handling-contract.md +30 -0
- package/dist/knowledge/references/saas.models.relationship-handling-settings.md +62 -0
- package/dist/knowledge/references/saas.models.relationship-nature-and-models.md +112 -0
- package/dist/knowledge/references/saas.models.resource-config.builder-parameters.md +431 -0
- package/dist/knowledge/references/saas.models.resource-config.forwarded-label.md +88 -0
- package/dist/knowledge/references/saas.models.resource-config.operation-api-call.md +89 -0
- package/dist/knowledge/references/saas.models.resource-config.operation-base.md +79 -0
- package/dist/knowledge/references/saas.models.resource-config.operation-mcp-exposure.md +49 -0
- package/dist/knowledge/references/saas.models.resource-config.operation-path.md +27 -0
- package/dist/knowledge/references/saas.models.resource-config.operation-union.md +26 -0
- package/dist/knowledge/references/saas.models.resource-config.operation-variant-for-key.md +62 -0
- package/dist/knowledge/references/saas.models.resource-config.resource-configuration.md +124 -0
- package/dist/knowledge/references/saas.models.resource-config.resource-relationships-buckets.md +38 -0
- package/dist/knowledge/references/saas.models.resource-config.resources-registry.md +69 -0
- package/dist/knowledge/references/saas.models.resource-config.searchable-relation.md +89 -0
- package/dist/knowledge/references/saas.models.resource-config.system-access-policy.md +121 -0
- package/dist/knowledge/references/saas.models.resource-config.token-generation.md +145 -0
- package/dist/knowledge/references/saas.models.resource-field-identifier.md +25 -0
- package/dist/knowledge/references/saas.models.resource-operation-display-risk.md +77 -0
- package/dist/knowledge/references/saas.models.resource-operation-variant-runtime.md +58 -0
- package/dist/knowledge/references/saas.models.resource-primary-scope.md +36 -0
- package/dist/knowledge/references/saas.models.resource-relationship-access-scope.md +26 -0
- package/dist/knowledge/references/saas.models.resource-relationship-builder-parameters.md +100 -0
- package/dist/knowledge/references/saas.models.resource-relationship-cardinality.md +57 -0
- package/dist/knowledge/references/saas.models.resource-relationship-declaration.md +69 -0
- package/dist/knowledge/references/saas.models.resource-relationship-resolved-semantics.md +60 -0
- package/dist/knowledge/references/saas.models.resource-relationship-schema.md +172 -0
- package/dist/knowledge/references/saas.models.resource-server-instance.md +109 -0
- package/dist/knowledge/references/saas.models.resource-type.md +24 -0
- package/dist/knowledge/references/saas.models.schema-family-builder.md +242 -0
- package/dist/knowledge/references/saas.models.scope-membership.md +143 -0
- package/dist/knowledge/references/saas.models.shared-domain-module.md +36 -0
- package/dist/knowledge/references/saas.models.shared-saas-module.md +36 -0
- package/dist/knowledge/references/saas.public-runtime.contract.md +229 -0
- package/dist/knowledge/references/saas.rag.retrieval-bounds.md +106 -0
- package/dist/knowledge/references/saas.rag.retrieval-refusals.md +89 -0
- package/dist/knowledge/references/saas.rag.retrieval-request.md +130 -0
- package/dist/knowledge/references/saas.rag.retrieval-result.md +147 -0
- package/dist/knowledge/references/saas.rag.retrieval-scores.md +54 -0
- package/dist/knowledge/references/saas.specifications.application-document-fact-specification.contract.md +59 -0
- package/dist/knowledge/references/saas.specifications.application-document-publication.contract.md +74 -0
- package/dist/knowledge/references/saas.specifications.assurance-document-blueprint.contract.md +1158 -0
- package/dist/knowledge/references/saas.specifications.assurance-program.contract.md +2602 -0
- package/dist/knowledge/references/saas.specifications.catalogs.schema-org.catalog-spec-shared.md +180 -0
- package/dist/knowledge/references/saas.specifications.catalogs.schema-org.discriminated-union.md +138 -0
- package/dist/knowledge/references/saas.specifications.catalogs.schema-org.entity-aggregate-offer.md +46 -0
- package/dist/knowledge/references/saas.specifications.catalogs.schema-org.entity-aggregate-rating.md +47 -0
- package/dist/knowledge/references/saas.specifications.catalogs.schema-org.entity-article.md +49 -0
- package/dist/knowledge/references/saas.specifications.catalogs.schema-org.entity-blog-posting.md +62 -0
- package/dist/knowledge/references/saas.specifications.catalogs.schema-org.entity-breadcrumb-list.md +46 -0
- package/dist/knowledge/references/saas.specifications.catalogs.schema-org.entity-faq-page.md +51 -0
- package/dist/knowledge/references/saas.specifications.catalogs.schema-org.entity-offer.md +46 -0
- package/dist/knowledge/references/saas.specifications.catalogs.schema-org.entity-organization.md +48 -0
- package/dist/knowledge/references/saas.specifications.catalogs.schema-org.entity-product.md +59 -0
- package/dist/knowledge/references/saas.specifications.catalogs.schema-org.entity-review.md +46 -0
- package/dist/knowledge/references/saas.specifications.catalogs.schema-org.entity-website.md +46 -0
- package/dist/knowledge/references/saas.specifications.companion-exports.contract.md +530 -0
- package/dist/knowledge/references/saas.specifications.composite-view-specification.md +49 -0
- package/dist/knowledge/references/saas.specifications.error-message-specification.md +92 -0
- package/dist/knowledge/references/saas.specifications.family-specifications.md +109 -0
- package/dist/knowledge/references/saas.specifications.feature-specification.md +93 -0
- package/dist/knowledge/references/saas.specifications.frontend-component-spec-factory.md +113 -0
- package/dist/knowledge/references/saas.specifications.frontend-component-spec-model.md +366 -0
- package/dist/knowledge/references/saas.specifications.resource-frontend-configuration-aspect.md +41 -0
- package/dist/knowledge/references/saas.specifications.resource-operation-spec.md +1978 -0
- package/dist/knowledge/references/saas.specifications.resource-pdf-template-spec.md +58 -0
- package/dist/knowledge/references/saas.specifications.resource-spec-code-handling.md +49 -0
- package/dist/knowledge/references/saas.specifications.resource-spec-config.md +156 -0
- package/dist/knowledge/references/saas.specifications.resource-spec-factory.md +171 -0
- package/dist/knowledge/references/saas.specifications.resource-spec-frontend-config-type.md +54 -0
- package/dist/knowledge/references/saas.specifications.resource-spec-frontend-prose.md +171 -0
- package/dist/knowledge/references/saas.website.astro.bridge.md +262 -0
- package/dist/knowledge/references/saas.website.astro.head-renderer.md +271 -0
- package/dist/knowledge/references/saas.website.astro.headers-renderer.md +41 -0
- package/dist/knowledge/references/saas.website.astro.i18n-helper.md +121 -0
- package/dist/knowledge/references/saas.website.astro.label-key-collector.md +117 -0
- package/dist/knowledge/references/saas.website.astro.label-loader.md +377 -0
- package/dist/knowledge/references/saas.website.astro.llms-txt-server.md +46 -0
- package/dist/knowledge/references/saas.website.astro.pick-labels-for-page.md +90 -0
- package/dist/knowledge/references/saas.website.astro.robots-renderer.md +174 -0
- package/dist/knowledge/references/saas.website.astro.runtime-helper.md +187 -0
- package/dist/knowledge/references/saas.website.astro.site-context.md +141 -0
- package/dist/knowledge/references/saas.website.astro.sitemap-coverage.md +188 -0
- package/dist/knowledge/references/saas.website.astro.structured-data-renderer.md +174 -0
- package/dist/knowledge/references/saas.website.blog.bridge.md +396 -0
- package/dist/knowledge/references/saas.website.blog.collection-config.md +180 -0
- package/dist/knowledge/references/saas.website.blog.frontmatter.md +116 -0
- package/dist/knowledge/references/saas.website.blog.head-renderer.md +292 -0
- package/dist/knowledge/references/saas.website.blog.mdx-provider.md +100 -0
- package/dist/knowledge/references/saas.website.blog.post-renderer.md +291 -0
- package/dist/knowledge/references/saas.website.design-tokens.bundle.md +29 -0
- package/dist/knowledge/references/saas.website.design-tokens.colors.md +64 -0
- package/dist/knowledge/references/saas.website.design-tokens.radius.md +38 -0
- package/dist/knowledge/references/saas.website.factories.define-page-manifest.md +98 -0
- package/dist/knowledge/references/saas.website.factories.define-section.md +128 -0
- package/dist/knowledge/references/saas.website.label-keys.compose-helper.md +36 -0
- package/dist/knowledge/references/saas.website.label-keys.format.md +67 -0
- package/dist/knowledge/references/saas.website.label-pack.validator.md +206 -0
- package/dist/knowledge/references/saas.website.page-layout.component.md +217 -0
- package/dist/knowledge/references/saas.website.page-manifest.meta-label-keys.md +47 -0
- package/dist/knowledge/references/saas.website.page-manifest.route-path.md +49 -0
- package/dist/knowledge/references/saas.website.page-manifest.schema.md +186 -0
- package/dist/knowledge/references/saas.website.page-manifest.seo.md +46 -0
- package/dist/knowledge/references/saas.website.page.context.md +57 -0
- package/dist/knowledge/references/saas.website.primitives.button.md +123 -0
- package/dist/knowledge/references/saas.website.primitives.heading.md +103 -0
- package/dist/knowledge/references/saas.website.primitives.image.md +103 -0
- package/dist/knowledge/references/saas.website.primitives.internal-button.md +151 -0
- package/dist/knowledge/references/saas.website.primitives.internal-link.md +193 -0
- package/dist/knowledge/references/saas.website.primitives.link.md +78 -0
- package/dist/knowledge/references/saas.website.primitives.text.md +82 -0
- package/dist/knowledge/references/saas.website.refs.page.md +56 -0
- package/dist/knowledge/references/saas.website.refs.section.md +57 -0
- package/dist/knowledge/references/saas.website.root-config.navigation.md +37 -0
- package/dist/knowledge/references/saas.website.root-config.schema.md +192 -0
- package/dist/knowledge/references/saas.website.root-config.seo.md +98 -0
- package/dist/knowledge/references/saas.website.routing.localized-path.md +84 -0
- package/dist/knowledge/references/saas.website.runtime.context.md +174 -0
- package/dist/knowledge/references/saas.website.section.component.md +138 -0
- package/dist/knowledge/references/saas.website.section.context.md +63 -0
- package/dist/knowledge/references/saas.website.sections.category-enum.md +72 -0
- package/dist/knowledge/references/saas.website.sections.definition-schema.md +121 -0
- package/dist/knowledge/references/saas.website.seo.llms-txt-config.md +37 -0
- package/dist/knowledge/references/saas.website.seo.robots-config.md +106 -0
- package/dist/knowledge/references/saas.website.seo.sitemap-config.md +73 -0
- package/dist/knowledge/references/saas.website.structured-data.payload-shape.md +71 -0
- package/dist/knowledge/references/saas.website.use-label-by-key.hook.md +45 -0
- package/dist/knowledge/references/saas.website.use-label.hook.md +82 -0
- package/dist/knowledge/references/saas.website.use-page.hook.md +30 -0
- package/dist/knowledge/references/saas.website.use-runtime.hook.md +36 -0
- package/dist/knowledge/references/saas.website.use-section.hook.md +30 -0
- package/dist/knowledge/references/saas.website.use-tokens.hook.md +32 -0
- package/dist/knowledge/references/vision.authored-metadata.config.md +64 -0
- package/dist/knowledge/references/vision.constraint.config.md +66 -0
- package/dist/knowledge/references/vision.idea.config.md +45 -0
- package/dist/knowledge/references/vision.mission.config.md +46 -0
- package/dist/knowledge/references/vision.problem.config.md +51 -0
- package/dist/knowledge/references/vision.references.conventions.md +115 -0
- package/dist/knowledge/references/vision.snapshot.config.md +85 -0
- package/dist/knowledge/references/vision.snapshot.validation.md +226 -0
- package/dist/knowledge/references/vision.success-criterion.config.md +60 -0
- package/dist/knowledge/references/zod.decorators.chainable-runtime.md +550 -0
- package/dist/knowledge/references/zod.decorators.conditional-visibility.md +104 -0
- package/dist/knowledge/references/zod.decorators.data-categories.md +197 -0
- package/dist/knowledge/references/zod.decorators.decorator-vocabulary.md +436 -0
- package/dist/knowledge/references/zod.decorators.display-edit-modes.md +174 -0
- package/dist/knowledge/references/zod.decorators.enums.frontend-handling.md +101 -0
- package/dist/knowledge/references/zod.decorators.field-spec-params.md +317 -0
- package/dist/knowledge/references/zod.decorators.file-generation.md +36 -0
- package/dist/knowledge/references/zod.decorators.file-rag-source.md +56 -0
- package/dist/knowledge/references/zod.decorators.file-schema.md +319 -0
- package/dist/knowledge/references/zod.decorators.foreign-key-display-mode.md +83 -0
- package/dist/knowledge/references/zod.decorators.per-primitive-ui.md +459 -0
- package/dist/knowledge/references/zod.decorators.primitive-ui.md +123 -0
- package/dist/knowledge/references/zod.decorators.rag-source.md +164 -0
- package/dist/knowledge/references/zod.decorators.schema-metadata.md +122 -0
- package/dist/knowledge/references/zod.decorators.shared-structural-methods.md +152 -0
- package/dist/knowledge/references/zod.decorators.shared-structural-params.md +314 -0
- package/dist/knowledge/references/zod.decorators.structural-lifecycle-params.md +529 -0
- package/dist/knowledge/references/zod.factories.bigdecimal.md +155 -0
- package/dist/knowledge/references/zod.factories.code.md +127 -0
- package/dist/knowledge/references/zod.factories.duration.md +246 -0
- package/dist/knowledge/references/zod.factories.money.md +166 -0
- package/dist/knowledge/references/zod.factories.phone.md +88 -0
- package/dist/knowledge/references/zod.factories.range.md +174 -0
- package/dist/knowledge/registries/assurance-authority-bases.json +15 -0
- package/dist/knowledge/registries/framework-topics.json +5212 -0
- package/dist/knowledge/registries/playbooks.json +488 -0
- package/dist/knowledge/registries/source-tags.json +7664 -0
- package/dist/knowledge/rules/resource-schema-awareness.md +77 -0
- package/dist/knowledge/skills/INDEX.md +349 -0
- package/dist/knowledge/skills/application-consumer-documentation-authoring/SKILL.md +415 -0
- package/dist/knowledge/skills/application-consumer-documentation-authoring/examples/domain-use-case-and-admin-task.example.md +49 -0
- package/dist/knowledge/skills/application-consumer-documentation-authoring/references/source-and-ownership-routing.md +52 -0
- package/dist/knowledge/skills/application-database-migrations/SKILL.md +218 -0
- package/dist/knowledge/skills/application-database-migrations/references/framework-application-database-api.md +84 -0
- package/dist/knowledge/skills/application-database-migrations/references/framework-migration-change-risk-api.md +37 -0
- package/dist/knowledge/skills/application-database-migrations/references/migration-refusals.md +64 -0
- package/dist/knowledge/skills/application-database-migrations/references/postgresql-vs-mongodb-obligations.md +34 -0
- package/dist/knowledge/skills/authorization-unit-narrowing/SKILL.md +323 -0
- package/dist/knowledge/skills/authorization-unit-narrowing/references/framework-unit-narrowing-declaration-api.md +84 -0
- package/dist/knowledge/skills/backend-addon-wiring/SKILL.md +324 -0
- package/dist/knowledge/skills/backend-addon-wiring/references/backend-di-routing.md +7 -0
- package/dist/knowledge/skills/backend-addon-wiring/references/framework-backend-bootstrap-api.md +276 -0
- package/dist/knowledge/skills/backend-custom-operation/SKILL.md +374 -0
- package/dist/knowledge/skills/backend-custom-operation/references/framework-error-handling-api.md +118 -0
- package/dist/knowledge/skills/backend-custom-operation/references/framework-operation-base-and-path-api.md +107 -0
- package/dist/knowledge/skills/backend-custom-operation/references/framework-transactional-core-api.md +134 -0
- package/dist/knowledge/skills/backend-custom-operation/references/operation-file-conventions.md +10 -0
- package/dist/knowledge/skills/brand-logo-authoring/SKILL.md +192 -0
- package/dist/knowledge/skills/brand-logo-authoring/references/brand-authoring-decisions.md +55 -0
- package/dist/knowledge/skills/brand-logo-authoring/references/framework-brand-asset-api.md +184 -0
- package/dist/knowledge/skills/brand-logo-authoring/references/framework-brand-snapshot-api.md +279 -0
- package/dist/knowledge/skills/compliance-document-authoring/SKILL.md +346 -0
- package/dist/knowledge/skills/compliance-document-authoring/references/document-composition-governance.md +160 -0
- package/dist/knowledge/skills/compliance-document-authoring/references/document-composition-privacy-notice.md +518 -0
- package/dist/knowledge/skills/compliance-document-authoring/references/document-composition-service-terms.md +158 -0
- package/dist/knowledge/skills/compliance-document-authoring/references/framework-application-document-fact-specification-contract.md +95 -0
- package/dist/knowledge/skills/compliance-document-authoring/references/framework-application-document-publication-contract.md +100 -0
- package/dist/knowledge/skills/compliance-document-authoring/references/framework-assurance-document-blueprint-contract.md +1210 -0
- package/dist/knowledge/skills/compliance-document-authoring/references/framework-governed-document-after-drafting.md +40 -0
- package/dist/knowledge/skills/config-app-shell/SKILL.md +698 -0
- package/dist/knowledge/skills/config-app-shell/references/app-shell-surfaces.md +5 -0
- package/dist/knowledge/skills/config-app-shell/references/framework-app-shell-api.md +415 -0
- package/dist/knowledge/skills/config-app-shell/references/framework-app-shell-hosted-components-api.md +170 -0
- package/dist/knowledge/skills/config-app-shell/references/framework-command-menu-omnibox-api.md +212 -0
- package/dist/knowledge/skills/config-app-shell/references/framework-quick-switcher-scope-field-api.md +178 -0
- package/dist/knowledge/skills/config-design-system/SKILL.md +424 -0
- package/dist/knowledge/skills/config-design-system/references/design-system-file.md +10 -0
- package/dist/knowledge/skills/config-design-system/references/framework-design-system-configuration-api.md +77 -0
- package/dist/knowledge/skills/config-design-system/references/framework-material-profile-api.md +200 -0
- package/dist/knowledge/skills/config-design-system/references/framework-material-runtime-policy-api.md +68 -0
- package/dist/knowledge/skills/config-design-system/references/framework-surface-policy-api.md +1212 -0
- package/dist/knowledge/skills/config-design-system/references/surface-policy-authoring.md +92 -0
- package/dist/knowledge/skills/config-navigation/SKILL.md +249 -0
- package/dist/knowledge/skills/config-navigation/references/framework-navigation-layout-api.md +152 -0
- package/dist/knowledge/skills/config-navigation/references/navigation-zones.md +5 -0
- package/dist/knowledge/skills/config-saas/SKILL.md +209 -0
- package/dist/knowledge/skills/config-saas/references/framework-provider-capabilities-api.md +221 -0
- package/dist/knowledge/skills/config-saas/references/framework-wildo-saas-config-api.md +408 -0
- package/dist/knowledge/skills/config-saas/references/saas-config-scope.md +9 -0
- package/dist/knowledge/skills/config-saas-backend/SKILL.md +183 -0
- package/dist/knowledge/skills/config-saas-backend/references/framework-backend-authored-config-api.md +40 -0
- package/dist/knowledge/skills/configure-billing/SKILL.md +261 -0
- package/dist/knowledge/skills/configure-billing/references/config-chain-and-failure-map.md +90 -0
- package/dist/knowledge/skills/configure-billing/references/example-backend-provider-module-shape.md +122 -0
- package/dist/knowledge/skills/configure-billing/references/example-provider-contribution-and-backend-config.md +48 -0
- package/dist/knowledge/skills/configure-billing/references/framework-backend-provider-reachability-api.md +69 -0
- package/dist/knowledge/skills/configure-billing/references/framework-billing-resolution-failure-api.md +57 -0
- package/dist/knowledge/skills/email-add-template/SKILL.md +439 -0
- package/dist/knowledge/skills/email-add-template/references/email-artifact-paths.md +9 -0
- package/dist/knowledge/skills/email-add-template/references/framework-email-template-api.md +72 -0
- package/dist/knowledge/skills/email-definition-wiring/SKILL.md +62 -0
- package/dist/knowledge/skills/email-labels-authoring/SKILL.md +64 -0
- package/dist/knowledge/skills/email-template-authoring/SKILL.md +62 -0
- package/dist/knowledge/skills/engine-component-registration/SKILL.md +257 -0
- package/dist/knowledge/skills/engine-component-registration/references/component-registration-file.md +7 -0
- package/dist/knowledge/skills/engine-component-registration/references/framework-component-registration-api.md +24 -0
- package/dist/knowledge/skills/engine-product-definitions/SKILL.md +429 -0
- package/dist/knowledge/skills/engine-product-definitions/references/framework-engine-product-definitions-api.md +287 -0
- package/dist/knowledge/skills/engine-product-definitions/references/product-registry-scope.md +5 -0
- package/dist/knowledge/skills/flows-actors-a2a-exposure/SKILL.md +491 -0
- package/dist/knowledge/skills/flows-actors-a2a-exposure/references/framework-flows-actors-a2a-contract.md +227 -0
- package/dist/knowledge/skills/flows-actors-a2a-exposure/references/framework-named-a2a-agents-contract.md +143 -0
- package/dist/knowledge/skills/flows-actors-chat-assistant/SKILL.md +368 -0
- package/dist/knowledge/skills/flows-actors-chat-assistant/examples/todo-assistant.example.md +226 -0
- package/dist/knowledge/skills/flows-actors-chat-assistant/references/framework-flows-actors-tool-api.md +208 -0
- package/dist/knowledge/skills/flows-actors-chat-assistant/references/framework-flows-actors-view-api.md +286 -0
- package/dist/knowledge/skills/flows-actors-llm-agent-invocation/SKILL.md +376 -0
- package/dist/knowledge/skills/flows-actors-llm-agent-invocation/references/framework-llm-agent-definition-api.md +262 -0
- package/dist/knowledge/skills/flows-actors-llm-agent-invocation/references/framework-llm-agent-invocation-api.md +130 -0
- package/dist/knowledge/skills/flows-actors-llm-agent-invocation/references/framework-llm-agent-prompt-spec-api.md +214 -0
- package/dist/knowledge/skills/flows-actors-llm-agent-invocation/references/framework-llm-operation-and-model-api.md +195 -0
- package/dist/knowledge/skills/flows-actors-llm-agent-invocation/references/operation-key-selection.md +60 -0
- package/dist/knowledge/skills/frontend-cdn-publish/SKILL.md +237 -0
- package/dist/knowledge/skills/frontend-cdn-publish/references/cloudflare-and-operator-setup.md +56 -0
- package/dist/knowledge/skills/frontend-cdn-publish/references/framework-cdn-config-api.md +176 -0
- package/dist/knowledge/skills/i18n-label-generation/SKILL.md +261 -0
- package/dist/knowledge/skills/i18n-label-generation/references/framework-labelling-sections-api.md +67 -0
- package/dist/knowledge/skills/i18n-label-generation/references/label-placement.md +7 -0
- package/dist/knowledge/skills/i18n-rerun-pipeline/SKILL.md +269 -0
- package/dist/knowledge/skills/i18n-rerun-pipeline/references/framework-labelling-sections-api.md +67 -0
- package/dist/knowledge/skills/i18n-rerun-pipeline/references/i18n-routing.md +9 -0
- package/dist/knowledge/skills/i18n-translation-rerun/SKILL.md +245 -0
- package/dist/knowledge/skills/i18n-translation-rerun/references/framework-labelling-sections-api.md +67 -0
- package/dist/knowledge/skills/i18n-translation-rerun/references/translation-workflow.md +17 -0
- package/dist/knowledge/skills/infra-environment-config/SKILL.md +646 -0
- package/dist/knowledge/skills/infra-environment-config/references/framework-application-database-api.md +77 -0
- package/dist/knowledge/skills/infra-environment-config/references/framework-backing-services-api.md +282 -0
- package/dist/knowledge/skills/infra-environment-config/references/framework-environment-deployment-api.md +265 -0
- package/dist/knowledge/skills/infra-environment-config/references/infra-config-files.md +7 -0
- package/dist/knowledge/skills/journey-approve/SKILL.md +43 -0
- package/dist/knowledge/skills/journey-bootstrap-scope/SKILL.md +42 -0
- package/dist/knowledge/skills/journey-next/SKILL.md +42 -0
- package/dist/knowledge/skills/journey-report/SKILL.md +43 -0
- package/dist/knowledge/skills/journey-run/SKILL.md +55 -0
- package/dist/knowledge/skills/journey-status/SKILL.md +50 -0
- package/dist/knowledge/skills/local-environment-bootstrap/SKILL.md +370 -0
- package/dist/knowledge/skills/local-environment-bootstrap/references/initialization-recovery-recipe.md +50 -0
- package/dist/knowledge/skills/local-environment-bootstrap/references/local-environment-troubleshooting.md +409 -0
- package/dist/knowledge/skills/local-environment-bootstrap/references/wildo-cli-bootstrap-commands.md +247 -0
- package/dist/knowledge/skills/market-add-feature-benefit/SKILL.md +474 -0
- package/dist/knowledge/skills/market-add-feature-benefit/references/framework-feature-benefit-api.md +139 -0
- package/dist/knowledge/skills/market-alternatives/SKILL.md +543 -0
- package/dist/knowledge/skills/market-authoring-overview/SKILL.md +354 -0
- package/dist/knowledge/skills/market-authoring-overview/references/framework-market-references-api.md +138 -0
- package/dist/knowledge/skills/market-authoring-overview/references/framework-market-snapshot-api.md +129 -0
- package/dist/knowledge/skills/market-category/SKILL.md +290 -0
- package/dist/knowledge/skills/market-channels/SKILL.md +361 -0
- package/dist/knowledge/skills/market-companion-prompt-enrichment/SKILL.md +2752 -0
- package/dist/knowledge/skills/market-companion-prompt-enrichment/references/framework-companion-behavior-api.md +2443 -0
- package/dist/knowledge/skills/market-generation-cli/SKILL.md +1484 -0
- package/dist/knowledge/skills/market-generation-cli/references/framework-market-generation-cli.md +1230 -0
- package/dist/knowledge/skills/market-icp/SKILL.md +625 -0
- package/dist/knowledge/skills/market-jobs-pains-gains/SKILL.md +352 -0
- package/dist/knowledge/skills/market-message-templates-authoring/SKILL.md +415 -0
- package/dist/knowledge/skills/market-message-templates-authoring/references/framework-message-template-api.md +1439 -0
- package/dist/knowledge/skills/market-persona/SKILL.md +407 -0
- package/dist/knowledge/skills/market-positioning-authoring/SKILL.md +392 -0
- package/dist/knowledge/skills/market-positioning-authoring/references/framework-positioning-api.md +97 -0
- package/dist/knowledge/skills/market-proof-and-objection/SKILL.md +665 -0
- package/dist/knowledge/skills/market-scoring-interpretation/SKILL.md +620 -0
- package/dist/knowledge/skills/market-scoring-interpretation/references/framework-scoring-api.md +291 -0
- package/dist/knowledge/skills/market-snapshot-validation/SKILL.md +1706 -0
- package/dist/knowledge/skills/market-snapshot-validation/references/framework-snapshot-validation-api.md +1228 -0
- package/dist/knowledge/skills/market-tone-of-voice/SKILL.md +260 -0
- package/dist/knowledge/skills/market-triggers-and-journey/SKILL.md +579 -0
- package/dist/knowledge/skills/module-companion-exports/SKILL.md +318 -0
- package/dist/knowledge/skills/module-companion-exports/references/companion-exports-by-package.md +544 -0
- package/dist/knowledge/skills/module-registration/SKILL.md +212 -0
- package/dist/knowledge/skills/module-registration/references/framework-domain-modules-api.md +366 -0
- package/dist/knowledge/skills/module-registration/references/registry-files.md +9 -0
- package/dist/knowledge/skills/module-relationships/SKILL.md +523 -0
- package/dist/knowledge/skills/module-relationships/references/cross-resource-fk-checklist.md +7 -0
- package/dist/knowledge/skills/module-relationships/references/framework-resource-relationship-authoring-api.md +738 -0
- package/dist/knowledge/skills/pdf-template-authoring/SKILL.md +174 -0
- package/dist/knowledge/skills/pdf-template-authoring/references/framework-pdf-template-api.md +203 -0
- package/dist/knowledge/skills/pdf-template-authoring/references/framework-pdf-template-spec-api.md +62 -0
- package/dist/knowledge/skills/provider-frontend-file-picker/SKILL.md +239 -0
- package/dist/knowledge/skills/provider-frontend-file-picker/references/framework-file-provider-constraints-api.md +90 -0
- package/dist/knowledge/skills/provider-frontend-file-picker/references/framework-frontend-provider-module-api.md +50 -0
- package/dist/knowledge/skills/rate-limit-authoring/SKILL.md +652 -0
- package/dist/knowledge/skills/rate-limit-authoring/references/framework-rate-limit-policy-api.md +182 -0
- package/dist/knowledge/skills/rate-limit-authoring/references/scope-key-and-bucket-conventions.md +137 -0
- package/dist/knowledge/skills/resource-add-field/SKILL.md +272 -0
- package/dist/knowledge/skills/resource-add-field/examples/add-priority-field-to-todos.example.md +153 -0
- package/dist/knowledge/skills/resource-add-field/references/framework-field-cross-layer-api.md +845 -0
- package/dist/knowledge/skills/resource-add-module/SKILL.md +322 -0
- package/dist/knowledge/skills/resource-add-module/references/framework-new-module-wiring-api.md +67 -0
- package/dist/knowledge/skills/resource-add-module/references/module-scaffold-layout.md +15 -0
- package/dist/knowledge/skills/resource-add-resource/SKILL.md +222 -0
- package/dist/knowledge/skills/resource-add-resource/references/framework-new-resource-core-config-api.md +540 -0
- package/dist/knowledge/skills/resource-add-resource/references/scaffold-surfaces-checklist.md +25 -0
- package/dist/knowledge/skills/resource-config-wiring/SKILL.md +370 -0
- package/dist/knowledge/skills/resource-config-wiring/references/config-change-routing.md +11 -0
- package/dist/knowledge/skills/resource-config-wiring/references/framework-personal-data-declaration-api.md +622 -0
- package/dist/knowledge/skills/resource-config-wiring/references/framework-saas-models-operation-scope-enums-api.md +248 -0
- package/dist/knowledge/skills/resource-config-wiring/references/framework-saas-models-resource-config-api.md +1769 -0
- package/dist/knowledge/skills/resource-config-wiring/references/framework-system-access-reads-api.md +1209 -0
- package/dist/knowledge/skills/resource-custom-view/SKILL.md +228 -0
- package/dist/knowledge/skills/resource-custom-view/references/custom-view-contracts.md +693 -0
- package/dist/knowledge/skills/resource-external-data/SKILL.md +349 -0
- package/dist/knowledge/skills/resource-external-data/references/framework-external-data-pipeline-api.md +187 -0
- package/dist/knowledge/skills/resource-external-data/references/framework-http-api-binding-api.md +261 -0
- package/dist/knowledge/skills/resource-external-data/references/lane-selection.md +49 -0
- package/dist/knowledge/skills/resource-external-data/references/pipeline-destination-schema.md +43 -0
- package/dist/knowledge/skills/resource-mcp-tool-exposure/SKILL.md +308 -0
- package/dist/knowledge/skills/resource-mcp-tool-exposure/references/framework-named-mcp-servers-contract.md +166 -0
- package/dist/knowledge/skills/resource-mcp-tool-exposure/references/framework-resource-mcp-exposure-contract.md +63 -0
- package/dist/knowledge/skills/resource-mcp-tool-exposure/references/mcp-catalogue-withdrawal-and-verification.md +77 -0
- package/dist/knowledge/skills/resource-mcp-tool-exposure/references/mcp-client-registration-postures.md +90 -0
- package/dist/knowledge/skills/resource-rag-source-fields/SKILL.md +424 -0
- package/dist/knowledge/skills/resource-rag-source-fields/references/corpus-field-selection.md +90 -0
- package/dist/knowledge/skills/resource-rag-source-fields/references/framework-embeddings-capability-api.md +261 -0
- package/dist/knowledge/skills/resource-rag-source-fields/references/framework-file-rag-source-api.md +117 -0
- package/dist/knowledge/skills/resource-rag-source-fields/references/framework-rag-retrieval-api.md +597 -0
- package/dist/knowledge/skills/resource-rag-source-fields/references/framework-rag-source-decorator-api.md +181 -0
- package/dist/knowledge/skills/resource-schema-authoring/SKILL.md +318 -0
- package/dist/knowledge/skills/resource-schema-authoring/examples/add-enum-field-with-ui.example.md +132 -0
- package/dist/knowledge/skills/resource-schema-authoring/examples/basic-resource-schema.example.md +62 -0
- package/dist/knowledge/skills/resource-schema-authoring/references/decorator-layer-map.md +63 -0
- package/dist/knowledge/skills/resource-schema-authoring/references/field-type-selection.md +70 -0
- package/dist/knowledge/skills/resource-schema-authoring/references/framework-decorator-vocabulary-api.md +559 -0
- package/dist/knowledge/skills/resource-schema-authoring/references/framework-personal-data-category-api.md +245 -0
- package/dist/knowledge/skills/resource-schema-authoring/references/framework-polymorphic-resources-api.md +147 -0
- package/dist/knowledge/skills/resource-schema-authoring/references/framework-schema-family-api.md +247 -0
- package/dist/knowledge/skills/resource-schema-authoring/references/framework-shared-decorator-methods-api.md +164 -0
- package/dist/knowledge/skills/resource-schema-authoring/references/framework-shared-structural-params-api.md +327 -0
- package/dist/knowledge/skills/resource-schema-authoring/references/framework-special-factories-api.md +1286 -0
- package/dist/knowledge/skills/resource-schema-authoring/references/framework-zod-lifecycle-and-chainable-api.md +1080 -0
- package/dist/knowledge/skills/resource-schema-authoring/references/polymorphic-per-scope-resources.md +75 -0
- package/dist/knowledge/skills/resource-schema-authoring/references/schema-variants-and-discriminators.md +62 -0
- package/dist/knowledge/skills/resource-schema-authoring/references/shared-layer-decorator-checklist.md +69 -0
- package/dist/knowledge/skills/resource-schema-authoring/references/special-factories.md +45 -0
- package/dist/knowledge/skills/resource-ui-behavior/SKILL.md +389 -0
- package/dist/knowledge/skills/resource-ui-behavior/references/framework-conditional-visibility-api.md +106 -0
- package/dist/knowledge/skills/resource-ui-behavior/references/framework-display-edit-modes-api.md +176 -0
- package/dist/knowledge/skills/resource-ui-behavior/references/framework-enum-frontend-handling-api.md +103 -0
- package/dist/knowledge/skills/resource-ui-behavior/references/framework-foreign-key-ui-api.md +97 -0
- package/dist/knowledge/skills/resource-ui-behavior/references/framework-frontend-resource-ui-contracts-api.md +839 -0
- package/dist/knowledge/skills/resource-ui-behavior/references/framework-per-primitive-ui-api.md +461 -0
- package/dist/knowledge/skills/resource-ui-behavior/references/framework-primitive-ui-api.md +125 -0
- package/dist/knowledge/skills/resource-ui-behavior/references/framework-related-resource-embeds-api.md +245 -0
- package/dist/knowledge/skills/resource-ui-behavior/references/framework-resource-layout-templates-api.md +302 -0
- package/dist/knowledge/skills/resource-ui-behavior/references/ui-layer-boundaries.md +13 -0
- package/dist/knowledge/skills/seeding-authoring/SKILL.md +569 -0
- package/dist/knowledge/skills/seeding-authoring/references/data-seeding-mode-picker.md +154 -0
- package/dist/knowledge/skills/seeding-authoring/references/framework-data-seeding-api.md +176 -0
- package/dist/knowledge/skills/seeding-operations/SKILL.md +505 -0
- package/dist/knowledge/skills/seeding-operations/references/data-seeding-admin-runbook.md +337 -0
- package/dist/knowledge/skills/seeding-operations/references/data-seeding-cron-scheduler.md +171 -0
- package/dist/knowledge/skills/seeding-operations/references/framework-data-seeding-operations-api.md +662 -0
- package/dist/knowledge/skills/settings-placement-authoring/SKILL.md +134 -0
- package/dist/knowledge/skills/settings-placement-authoring/references/framework-settings-destinations-catalog.md +65 -0
- package/dist/knowledge/skills/settings-placement-authoring/references/framework-settings-placement-api.md +127 -0
- package/dist/knowledge/skills/spec-catalog-authoring/SKILL.md +726 -0
- package/dist/knowledge/skills/spec-catalog-authoring/references/catalog-spec-pattern-overview.md +242 -0
- package/dist/knowledge/skills/spec-companion-exports/SKILL.md +362 -0
- package/dist/knowledge/skills/spec-companion-exports/references/companion-export-checklist.md +8 -0
- package/dist/knowledge/skills/spec-companion-exports/references/framework-companion-exports-contract-api.md +533 -0
- package/dist/knowledge/skills/spec-component-update/SKILL.md +315 -0
- package/dist/knowledge/skills/spec-component-update/references/component-spec-props.md +8 -0
- package/dist/knowledge/skills/spec-component-update/references/framework-frontend-component-spec-api.md +481 -0
- package/dist/knowledge/skills/spec-composite-view-update/SKILL.md +283 -0
- package/dist/knowledge/skills/spec-composite-view-update/references/composite-spec-sections.md +5 -0
- package/dist/knowledge/skills/spec-composite-view-update/references/framework-composite-view-specification-api.md +51 -0
- package/dist/knowledge/skills/spec-family-update/SKILL.md +300 -0
- package/dist/knowledge/skills/spec-family-update/references/family-spec-routing.md +13 -0
- package/dist/knowledge/skills/spec-family-update/references/framework-error-message-specifications-api.md +108 -0
- package/dist/knowledge/skills/spec-family-update/references/framework-family-specifications-api.md +111 -0
- package/dist/knowledge/skills/spec-feature-update/SKILL.md +306 -0
- package/dist/knowledge/skills/spec-feature-update/references/feature-spec-scope.md +5 -0
- package/dist/knowledge/skills/spec-feature-update/references/framework-feature-specification-api.md +95 -0
- package/dist/knowledge/skills/spec-resource-update/SKILL.md +220 -0
- package/dist/knowledge/skills/spec-resource-update/references/framework-field-spec-params-api.md +319 -0
- package/dist/knowledge/skills/spec-resource-update/references/framework-spec-resource-contracts-api.md +2610 -0
- package/dist/knowledge/skills/spec-resource-update/references/resource-spec-field-routing.md +12 -0
- package/dist/knowledge/skills/spec-update-after-change/SKILL.md +195 -0
- package/dist/knowledge/skills/spec-update-after-change/references/framework-spec-factory-api.md +173 -0
- package/dist/knowledge/skills/spec-update-after-change/references/spec-maintenance-by-surface.md +33 -0
- package/dist/knowledge/skills/spec-update-after-change/references/surface-to-spec-routing.md +14 -0
- package/dist/knowledge/skills/views-add-composite-view/SKILL.md +259 -0
- package/dist/knowledge/skills/views-add-composite-view/references/composite-view-routing.md +10 -0
- package/dist/knowledge/skills/views-add-composite-view/references/framework-inserted-view-identity-api.md +151 -0
- package/dist/knowledge/skills/views-add-custom-view/SKILL.md +225 -0
- package/dist/knowledge/skills/views-add-custom-view/references/custom-view-routing.md +10 -0
- package/dist/knowledge/skills/views-add-custom-view/references/framework-view-scope-and-full-custom-api.md +107 -0
- package/dist/knowledge/skills/views-app-level/SKILL.md +201 -0
- package/dist/knowledge/skills/views-app-level/references/app-level-views-routing.md +9 -0
- package/dist/knowledge/skills/views-app-level/references/framework-view-scope-and-full-custom-api.md +107 -0
- package/dist/knowledge/skills/views-chart-authoring/SKILL.md +264 -0
- package/dist/knowledge/skills/views-chart-authoring/references/chart-view-checklist.md +7 -0
- package/dist/knowledge/skills/views-chart-authoring/references/framework-chart-view-contracts-api.md +82 -0
- package/dist/knowledge/skills/views-chart-authoring/references/framework-inserted-view-identity-api.md +152 -0
- package/dist/knowledge/skills/views-composite-authoring/SKILL.md +302 -0
- package/dist/knowledge/skills/views-composite-authoring/references/composite-embedding-checklist.md +23 -0
- package/dist/knowledge/skills/views-composite-authoring/references/framework-composite-view-contracts-api.md +133 -0
- package/dist/knowledge/skills/views-composite-authoring/references/framework-inserted-view-identity-api.md +152 -0
- package/dist/knowledge/skills/views-execution-authoring/SKILL.md +209 -0
- package/dist/knowledge/skills/views-execution-authoring/references/execution-view-checklist.md +7 -0
- package/dist/knowledge/skills/views-execution-authoring/references/framework-execution-view-contracts-api.md +389 -0
- package/dist/knowledge/skills/views-execution-authoring/references/framework-inserted-view-identity-api.md +152 -0
- package/dist/knowledge/skills/website-anonymous-session/SKILL.md +444 -0
- package/dist/knowledge/skills/website-blog-authoring/SKILL.md +587 -0
- package/dist/knowledge/skills/website-blog-authoring/references/blog-adapter-api.md +1426 -0
- package/dist/knowledge/skills/website-bundle-discipline/SKILL.md +553 -0
- package/dist/knowledge/skills/website-bundle-discipline/references/example-website-button-override.md +52 -0
- package/dist/knowledge/skills/website-bundle-discipline/references/website-bundle-rules.md +357 -0
- package/dist/knowledge/skills/website-consent-gate-overrides/SKILL.md +511 -0
- package/dist/knowledge/skills/website-factory-advanced/SKILL.md +376 -0
- package/dist/knowledge/skills/website-inbound-contact-forms/SKILL.md +304 -0
- package/dist/knowledge/skills/website-label-pack/SKILL.md +390 -0
- package/dist/knowledge/skills/website-layout-overrides/SKILL.md +461 -0
- package/dist/knowledge/skills/website-marketing-metadata-extension/SKILL.md +264 -0
- package/dist/knowledge/skills/website-navigation-authoring/SKILL.md +414 -0
- package/dist/knowledge/skills/website-navigation-authoring/references/worked-examples-header-footer.md +366 -0
- package/dist/knowledge/skills/website-page-authoring/SKILL.md +420 -0
- package/dist/knowledge/skills/website-page-variants/SKILL.md +256 -0
- package/dist/knowledge/skills/website-primitive-overrides/SKILL.md +302 -0
- package/dist/knowledge/skills/website-section-contact/SKILL.md +950 -0
- package/dist/knowledge/skills/website-section-contact/references/define-website-section-api.md +579 -0
- package/dist/knowledge/skills/website-section-cta/SKILL.md +822 -0
- package/dist/knowledge/skills/website-section-cta/references/define-website-section-api.md +579 -0
- package/dist/knowledge/skills/website-section-faq/SKILL.md +917 -0
- package/dist/knowledge/skills/website-section-faq/references/define-website-section-api.md +579 -0
- package/dist/knowledge/skills/website-section-feature-benefit-summary/SKILL.md +878 -0
- package/dist/knowledge/skills/website-section-feature-benefit-summary/references/define-website-section-api.md +579 -0
- package/dist/knowledge/skills/website-section-feature-detail/SKILL.md +895 -0
- package/dist/knowledge/skills/website-section-feature-detail/references/define-website-section-api.md +579 -0
- package/dist/knowledge/skills/website-section-footer-cta/SKILL.md +814 -0
- package/dist/knowledge/skills/website-section-footer-cta/references/define-website-section-api.md +579 -0
- package/dist/knowledge/skills/website-section-hero/SKILL.md +944 -0
- package/dist/knowledge/skills/website-section-hero/references/define-website-section-api.md +583 -0
- package/dist/knowledge/skills/website-section-pricing/SKILL.md +934 -0
- package/dist/knowledge/skills/website-section-pricing/references/define-website-section-api.md +579 -0
- package/dist/knowledge/skills/website-section-social-proof/SKILL.md +912 -0
- package/dist/knowledge/skills/website-section-social-proof/references/define-website-section-api.md +579 -0
- package/dist/knowledge/skills/website-seo-aeo-geo/SKILL.md +624 -0
- package/dist/knowledge/skills/website-seo-aeo-geo/references/aeo-api.md +633 -0
- package/dist/knowledge/skills/website-seo-aeo-geo/references/geo-api.md +193 -0
- package/dist/knowledge/skills/website-seo-aeo-geo/references/seo-api.md +790 -0
- package/dist/knowledge/topic-index.json +17510 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +49 -0
|
@@ -0,0 +1,1080 @@
|
|
|
1
|
+
# Zod — lifecycle params & chainable runtime (source)
|
|
2
|
+
|
|
3
|
+
- **`structural-lifecycle-params`** — shared structural params for field lifecycle (create/update/read visibility, exclusions, etc.) in `zod-decorators.types`.
|
|
4
|
+
- **`chainable-runtime`** — chainable decorator runtime surface in `zod.module-override` used after `initZodDecorators(z)`.
|
|
5
|
+
|
|
6
|
+
## Import Origins
|
|
7
|
+
|
|
8
|
+
- `@wildo-ai/zod-decorators`
|
|
9
|
+
|
|
10
|
+
## Source Excerpts
|
|
11
|
+
|
|
12
|
+
### Origin Package: `@wildo-ai/zod-decorators`
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
*
|
|
16
|
+
* Structural and lifecycle decorator parameter types for shared resource
|
|
17
|
+
* schemas.
|
|
18
|
+
*
|
|
19
|
+
* These shapes belong to the shared schema layer:
|
|
20
|
+
* `shared-lib/src/modules/<module>/resources/<resource>/<resource>.schemas.ts`.
|
|
21
|
+
*
|
|
22
|
+
* They describe field behavior that affects persistence, DTO derivation,
|
|
23
|
+
* security boundaries, discriminated variants, validation lifecycle, and other
|
|
24
|
+
* cross-layer mechanics. They are appropriate in the shared Zod schema because
|
|
25
|
+
* backend and frontend consumers both depend on the resulting metadata.
|
|
26
|
+
*
|
|
27
|
+
* Do NOT place per-field UI rendering configuration here. UI decorators such as
|
|
28
|
+
* `.stringUI()` / `.enumUI()` belong in frontend `*.ui-behavior.tsx` files.
|
|
29
|
+
* Do NOT place business-semantics prose here. `{primitive}Spec()` decorators
|
|
30
|
+
* belong in specification overlays.
|
|
31
|
+
*
|
|
32
|
+
* When framework knowledge is generated, this anchored block is intended to be
|
|
33
|
+
* inserted as the deterministic source-of-truth reference for structural
|
|
34
|
+
* decorator parameters instead of maintaining parallel markdown tables.
|
|
35
|
+
*/
|
|
36
|
+
// Parameters for the IS_HIDDEN decorator. Controls field visibility based on context.
|
|
37
|
+
export interface HiddenFieldParams {
|
|
38
|
+
display?: boolean; // Hide in display/read mode
|
|
39
|
+
edit?: boolean; // Hide in edit/form mode
|
|
40
|
+
operations?: string[]; // Hide for specific operations (e.g., 'create', 'update')
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// Parameters for the IS_NOT_EDITABLE decorator. Controls when a field is read-only in forms.
|
|
44
|
+
export interface NotEditableFieldParams {
|
|
45
|
+
operations?: string[]; // Make not editable only for specific operations (e.g., 'update'). If not provided, applies to all operations.
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// HiddenFieldParams, NotEditableFieldParams
|
|
49
|
+
// are imported from @wildo-ai/presets-components-models
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Inline edit mode options
|
|
53
|
+
*/
|
|
54
|
+
export const InlineEditMode = {
|
|
55
|
+
DIRECT: 'direct',
|
|
56
|
+
BUTTON: 'button',
|
|
57
|
+
} as const;
|
|
58
|
+
export type InlineEditMode = typeof InlineEditMode[keyof typeof InlineEditMode];
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* P10: When to trigger save in inline editing mode
|
|
62
|
+
*/
|
|
63
|
+
export const InlineEditSaveOn = {
|
|
64
|
+
/** Save on blur (when user clicks away) */
|
|
65
|
+
BLUR: 'blur',
|
|
66
|
+
/** Save only on explicit button click */
|
|
67
|
+
EXPLICIT: 'explicit',
|
|
68
|
+
} as const;
|
|
69
|
+
export type InlineEditSaveOn = typeof InlineEditSaveOn[keyof typeof InlineEditSaveOn];
|
|
70
|
+
|
|
71
|
+
//------------------------------------------------------------------------------------------------
|
|
72
|
+
// BACKEND-ONLY FIELD PARAMS
|
|
73
|
+
//------------------------------------------------------------------------------------------------
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
*
|
|
77
|
+
* Parameters for the isBackendOnly decorator.
|
|
78
|
+
* Marks fields that should only exist on the backend and be stripped from API responses.
|
|
79
|
+
*/
|
|
80
|
+
export interface BackendOnlyFieldParams {
|
|
81
|
+
/**
|
|
82
|
+
* If true, the field will be included in the response for CREATE operations only,
|
|
83
|
+
* then stripped from all subsequent READ operations.
|
|
84
|
+
* Useful for secrets, API keys, etc. that should only be returned once.
|
|
85
|
+
*
|
|
86
|
+
* This is also the framework's ONLY disclosure-audit trigger: a field that carries it emits one
|
|
87
|
+
* `FIELD_ACCESS` audit event at the moment it is first (and last) exposed. That pairing is not a
|
|
88
|
+
* coincidence — first exposure is the only point at which a backend-only field crosses the client
|
|
89
|
+
* boundary at all, so it is the only point at which "this value left the system" is a true claim.
|
|
90
|
+
*
|
|
91
|
+
* Scope limit worth knowing before relying on it: the audit event is raised from the TOP-LEVEL
|
|
92
|
+
* shape of the response DTO. A single `CREATE` is the reliably covered case; do not assume a
|
|
93
|
+
* bulk-create response gives you the same guarantee without checking.
|
|
94
|
+
*
|
|
95
|
+
* assurance-control: WILDO.SECRETS.DISCLOSURE_AUDIT — first disclosure of server-minted secret
|
|
96
|
+
* material is attributable.
|
|
97
|
+
*/
|
|
98
|
+
isReturnedAtCreation?: boolean;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Parameters for the isWriteOnlySecret decorator.
|
|
103
|
+
* Marks a user-provided secret that stays in CREATE/UPDATE request DTOs
|
|
104
|
+
* (client-writable) but is masked to a placeholder on every client-facing
|
|
105
|
+
* response DTO; the real value is retained for backend internal reads.
|
|
106
|
+
* Read-side masking and the write-back sentinel are enforced by the framework
|
|
107
|
+
* at the client-serialization boundary — no per-resource custom implementation
|
|
108
|
+
* needed.
|
|
109
|
+
*
|
|
110
|
+
* Pick the right secret posture by **who owns the value and which direction it
|
|
111
|
+
* flows** — the three are mutually exclusive on a field:
|
|
112
|
+
* - `.isWriteOnlySecret()` — the CLIENT supplies the secret and the server keeps
|
|
113
|
+
* it (e.g. a webhook signing key, an SSO client secret). Client-writable,
|
|
114
|
+
* masked on read, real value kept for backend use. Re-submitting the mask is
|
|
115
|
+
* a no-op (the stored value is preserved).
|
|
116
|
+
* - `.isEphemeral()` — the SERVER mints the secret and hands it to the client
|
|
117
|
+
* exactly once at creation (e.g. an API key shown in a one-time reveal). Not
|
|
118
|
+
* client-writable, not re-readable afterwards. A composite decorator (secret
|
|
119
|
+
* display + one-time reveal + not-editable).
|
|
120
|
+
* - `.isBackendOnly()` — the field never crosses the client boundary in EITHER
|
|
121
|
+
* direction. Do NOT use it for a client-provided secret: it strips the field
|
|
122
|
+
* from the write DTOs too, so the client could never set the value.
|
|
123
|
+
*/
|
|
124
|
+
export interface WriteOnlySecretFieldParams {
|
|
125
|
+
/**
|
|
126
|
+
* Intentionally empty.
|
|
127
|
+
*
|
|
128
|
+
* A write-only secret is masked on EVERY client-facing response, so there is no disclosure to
|
|
129
|
+
* audit — the real value never crosses the boundary. The parameter bag is kept so the decorator
|
|
130
|
+
* can gain options later without changing its call shape.
|
|
131
|
+
*/
|
|
132
|
+
readonly _reserved?: never;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
//------------------------------------------------------------------------------------------------
|
|
136
|
+
// IMPERSONALIZATION SCRUB PARAMS
|
|
137
|
+
//------------------------------------------------------------------------------------------------
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Stored metadata for the impersonalization scrub treatment (`.impersonalizeWith()` /
|
|
141
|
+
* `addImpersonalizeWith()`).
|
|
142
|
+
*
|
|
143
|
+
* This metadata deliberately stays outside the `shared-structural-params` subsection, mirroring
|
|
144
|
+
* the decorator method itself. Impersonalization has distinct lifecycle and retention semantics,
|
|
145
|
+
* so it needs dedicated application-facing guidance when the installed runtime exposes it.
|
|
146
|
+
*/
|
|
147
|
+
export interface ImpersonalizeFieldParams {
|
|
148
|
+
/**
|
|
149
|
+
* The scrub treatment — a `RedactionType` value carried as an opaque string (zod-decorators sits
|
|
150
|
+
* below saas-models and cannot reference the enum type). REQUIRED and non-empty: a field either
|
|
151
|
+
* declares how it is scrubbed, or carries no treatment at all.
|
|
152
|
+
*/
|
|
153
|
+
treatment: string;
|
|
154
|
+
/**
|
|
155
|
+
* `MASK` only — the literal value written in place of this field, overriding the framework's
|
|
156
|
+
* default mask constant.
|
|
157
|
+
*
|
|
158
|
+
* **Why this exists.** The default mask is an UNCONSTRAINED string, so it cannot be written into
|
|
159
|
+
* exactly the fields most likely to need masking: a CONSTRAINED string — `z.email()`, `z.uuid()`,
|
|
160
|
+
* `.min(n)` — rejects it and the boot guard fails the config. Without an override, such a field
|
|
161
|
+
* can only be erased by widening it to `.nullish()` for a `REMOVE` scrub. For a unique identity
|
|
162
|
+
* anchor (`User.email` is the motivating case) that trades a permanently weaker type on every
|
|
163
|
+
* consumer for a state only the audited see-through reader can ever observe, since a retained row
|
|
164
|
+
* is hidden from every normal read. The override keeps the authored type intact.
|
|
165
|
+
*
|
|
166
|
+
* **Contract.** The value must satisfy the field's OWN schema — the boot guard `safeParse`s it
|
|
167
|
+
* against that schema and fails loud otherwise. It is STATIC: the same value is written to every
|
|
168
|
+
* row of a scrub batch (the scrub is one `$set`), so choose something meaningless as data and
|
|
169
|
+
* safe to collide on. For an email, an RFC 2606 reserved `.invalid` address is the honest choice —
|
|
170
|
+
* that TLD can never be registered or delivered to.
|
|
171
|
+
*
|
|
172
|
+
* **Collision is not a concern**, even on a `.isUnique()` field: every unique index on a
|
|
173
|
+
* retention-governed resource is scoped to NON-RETAINED rows, and the scrub flips the row to
|
|
174
|
+
* `RETAINED` in the same write, so scrubbed rows leave the index.
|
|
175
|
+
*
|
|
176
|
+
* Declaring it alongside a non-`MASK` treatment is a config error — nothing would ever write it.
|
|
177
|
+
* That check lives in the saas-models boot guard, which is the layer that knows `RedactionType`.
|
|
178
|
+
*/
|
|
179
|
+
maskValue?: string;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
//------------------------------------------------------------------------------------------------
|
|
183
|
+
// VIRTUAL FIELD PARAMS
|
|
184
|
+
//------------------------------------------------------------------------------------------------
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Parameters passed to virtual field calculation functions.
|
|
188
|
+
* The `utils` is typed as `any` in shared-lib but will be properly typed at runtime in backend-lib.
|
|
189
|
+
*/
|
|
190
|
+
export interface VirtualFieldCalculationParams<TObject = any, TContext = any, TUserContext = any> {
|
|
191
|
+
/** The current resource object */
|
|
192
|
+
currentObject: TObject;
|
|
193
|
+
/** The resource context (parent/child relationships) - only if needsObjectContext is true */
|
|
194
|
+
objectContext?: TContext;
|
|
195
|
+
/** The user context - only if needsUserContext is true */
|
|
196
|
+
userContext?: TUserContext;
|
|
197
|
+
/** The execution context containing user, organization, etc. */
|
|
198
|
+
executionContext: any;
|
|
199
|
+
/**
|
|
200
|
+
* Utility services for calculations.
|
|
201
|
+
* Typed as `any` in shared-lib, but at runtime provides:
|
|
202
|
+
* - repositories: RepositoryRegistry
|
|
203
|
+
* - logger: LoggerService
|
|
204
|
+
* - errorBuilder: ErrorBuilderBackendService
|
|
205
|
+
* - dateService: DateService
|
|
206
|
+
* - getService: <T>(symbol: symbol) => T
|
|
207
|
+
*/
|
|
208
|
+
utils: any;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Parameters for the isVirtual decorator.
|
|
213
|
+
* Virtual fields are computed at runtime and not stored in the database.
|
|
214
|
+
*/
|
|
215
|
+
export interface VirtualFieldParams<TObject = any, TResult = any> {
|
|
216
|
+
/**
|
|
217
|
+
* The calculation function that computes this virtual field's value.
|
|
218
|
+
* Called at runtime by VirtualFieldsBackendService with injected utilities.
|
|
219
|
+
*/
|
|
220
|
+
calculate: (params: VirtualFieldCalculationParams<TObject>) => TResult | Promise<TResult>;
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* If true, the objectContext (parent/child relationships) will be passed to calculate().
|
|
224
|
+
* Setting this to true has a performance cost as it requires fetching related resources.
|
|
225
|
+
*/
|
|
226
|
+
needsObjectContext?: boolean;
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* If true, the userContext will be passed to calculate().
|
|
230
|
+
* Setting this to true requires additional context resolution.
|
|
231
|
+
*/
|
|
232
|
+
needsUserContext?: boolean;
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* Optional list of field names this virtual field depends on.
|
|
236
|
+
* Used for documentation and potential future optimizations.
|
|
237
|
+
*/
|
|
238
|
+
dependencies?: string[];
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
//------------------------------------------------------------------------------------------------
|
|
242
|
+
// DISCRIMINATOR FIELD PARAMS
|
|
243
|
+
//------------------------------------------------------------------------------------------------
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
*
|
|
247
|
+
* Parameters for the isDiscriminator decorator.
|
|
248
|
+
* Marks a field as the discriminator for a discriminated union schema.
|
|
249
|
+
*/
|
|
250
|
+
export interface DiscriminatorFieldParams {
|
|
251
|
+
/**
|
|
252
|
+
* Values for which the base schema is used (no extended variant).
|
|
253
|
+
* If not provided, auto-detected from enum values not covered by variants.
|
|
254
|
+
*/
|
|
255
|
+
baseValues?: string[];
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
//------------------------------------------------------------------------------------------------
|
|
259
|
+
// UNIQUE FIELD PARAMS
|
|
260
|
+
//------------------------------------------------------------------------------------------------
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
*
|
|
264
|
+
* Scope for unique constraint enforcement.
|
|
265
|
+
* - 'global': Unique across the entire collection (default)
|
|
266
|
+
* - 'organization': Unique within an organization (compound index with organizationId)
|
|
267
|
+
* - 'user': Unique per user (compound index with createdByUserId)
|
|
268
|
+
*/
|
|
269
|
+
export const UniqueScope = {
|
|
270
|
+
GLOBAL: 'global',
|
|
271
|
+
ORGANIZATION: 'organization',
|
|
272
|
+
USER: 'user',
|
|
273
|
+
} as const;
|
|
274
|
+
export type UniqueScope = typeof UniqueScope[keyof typeof UniqueScope];
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* Parameters for the isUnique decorator.
|
|
278
|
+
* Marks a field as unique in the database with unique index.
|
|
279
|
+
* MongoDB will enforce uniqueness and throw E11000 duplicate key error on violations.
|
|
280
|
+
*/
|
|
281
|
+
export interface UniqueFieldParams {
|
|
282
|
+
/**
|
|
283
|
+
* Scope for uniqueness constraint.
|
|
284
|
+
* - 'global': Unique across the entire collection (default)
|
|
285
|
+
* - 'organization': Unique per organization (compound index with organizationId)
|
|
286
|
+
* - 'user': Unique per user (compound index with createdByUserId)
|
|
287
|
+
*/
|
|
288
|
+
scope?: UniqueScope;
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* Create a compound unique index with another field in the same schema.
|
|
292
|
+
* The referenced field name is resolved against the actual schema fields,
|
|
293
|
+
* handling polymorphic field renames automatically.
|
|
294
|
+
*
|
|
295
|
+
* @example poolKey: z.string().isUnique({ compoundWith: 'billingAccountId' })
|
|
296
|
+
* // Creates compound unique index: { billingAccountId: 1, poolKey: 1 }
|
|
297
|
+
* // For polymorphic variants, resolves e.g. to: { organizationBillingAccountId: 1, poolKey: 1 }
|
|
298
|
+
*/
|
|
299
|
+
compoundWith?: string;
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
* Whether to allow null values without triggering uniqueness.
|
|
303
|
+
* MongoDB unique indexes exclude null by default when sparse is true.
|
|
304
|
+
* @default true
|
|
305
|
+
*/
|
|
306
|
+
sparse?: boolean;
|
|
307
|
+
|
|
308
|
+
/**
|
|
309
|
+
* Custom error message to show when uniqueness is violated.
|
|
310
|
+
* Supports placeholder {fieldName} which is replaced with the actual field name.
|
|
311
|
+
* @example "This {fieldName} is already taken"
|
|
312
|
+
*/
|
|
313
|
+
errorMessage?: string;
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* The custom message reference the API returns when THIS field's unique index is violated.
|
|
317
|
+
*
|
|
318
|
+
* Without it, every duplicate-key rejection collapses to one generic conflict code, so an
|
|
319
|
+
* integrator cannot tell "that slug is taken" from "that invoice number is taken" without
|
|
320
|
+
* parsing a message. Naming the reference here — next to the constraint that produces it —
|
|
321
|
+
* keeps one authority: the key and the error it raises cannot drift apart.
|
|
322
|
+
*
|
|
323
|
+
* Pass a member of the framework's error-reference vocabulary, never a bare literal.
|
|
324
|
+
*
|
|
325
|
+
* @example slug: z.string().isUnique({ conflictMessageReference: ErrorCustomMessageReference.ORGANIZATION_SLUG_EXISTS })
|
|
326
|
+
*/
|
|
327
|
+
conflictMessageReference?: string;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
/**
|
|
331
|
+
* Parameters for the object-level `businessKeySet([...])` decorator.
|
|
332
|
+
*
|
|
333
|
+
* Declares a **composite business key**: the ordered list of `fields` is the stable identity of a
|
|
334
|
+
* row, used both by seeding upsert / upgrade / sync passes to find an existing row independently
|
|
335
|
+
* from its random `_id`, and by the storage adapter to materialize a compound UNIQUE index so the
|
|
336
|
+
* identity is enforced by the database rather than by a race-prone read-then-write.
|
|
337
|
+
*
|
|
338
|
+
* - `fields` must be non-empty and every entry must be a key declared on the
|
|
339
|
+
* underlying `ZodObject` shape (validated at decoration time).
|
|
340
|
+
* - This decorator is **mutually exclusive** with field-level `isBusinessKey()`
|
|
341
|
+
* on the same schema — pick one identity model.
|
|
342
|
+
*
|
|
343
|
+
* @example
|
|
344
|
+
* // "one membership per user per organization"
|
|
345
|
+
* z.object({ userId: z.string(), organizationId: z.string(), roles: z.array(z.string()) })
|
|
346
|
+
* .businessKeySet(['userId', 'organizationId'])
|
|
347
|
+
*/
|
|
348
|
+
export interface BusinessKeySetParams {
|
|
349
|
+
fields: string[];
|
|
350
|
+
|
|
351
|
+
/**
|
|
352
|
+
* Fields whose ABSENCE takes a row out of the uniqueness constraint entirely.
|
|
353
|
+
*
|
|
354
|
+
* By default a missing member counts as a real value, so two rows that both omit it COLLIDE.
|
|
355
|
+
* That is the correct default for an identity whose members are always meaningful — two rows
|
|
356
|
+
* that are "unscoped" in the same way really are the same row.
|
|
357
|
+
*
|
|
358
|
+
* It is wrong when a member is optional in the domain sense: "unit code, unique among siblings"
|
|
359
|
+
* must still allow any number of siblings that carry NO code. Listing that field here scopes the
|
|
360
|
+
* constraint to the rows that actually have it.
|
|
361
|
+
*
|
|
362
|
+
* Every entry must also appear in `fields`. List only the members whose absence means "this row
|
|
363
|
+
* has no key", never merely "this member happens to be optional" — a field left out of the list
|
|
364
|
+
* keeps the default null-collides behaviour, which is what most composite keys want.
|
|
365
|
+
*
|
|
366
|
+
* @example
|
|
367
|
+
* // many code-less siblings are fine; two siblings sharing a code are not
|
|
368
|
+
* .businessKeySet(['organizationId', 'parentUnitId', 'code'], { skipRowsMissing: ['code'] })
|
|
369
|
+
*/
|
|
370
|
+
skipRowsMissing?: string[];
|
|
371
|
+
|
|
372
|
+
/**
|
|
373
|
+
* The custom message reference the API returns when THIS key's unique index is violated.
|
|
374
|
+
*
|
|
375
|
+
* Without it, every duplicate-key rejection collapses to one generic conflict code, so an
|
|
376
|
+
* integrator cannot tell which identity was violated without parsing a message. Naming the
|
|
377
|
+
* reference here — next to the key that produces it — keeps one authority: the key and the error
|
|
378
|
+
* it raises cannot drift apart.
|
|
379
|
+
*
|
|
380
|
+
* Pass a member of the framework's error-reference vocabulary, never a bare literal.
|
|
381
|
+
*/
|
|
382
|
+
conflictMessageReference?: string;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
//------------------------------------------------------------------------------------------------
|
|
386
|
+
// TTL FIELD PARAMS
|
|
387
|
+
//------------------------------------------------------------------------------------------------
|
|
388
|
+
|
|
389
|
+
/**
|
|
390
|
+
*
|
|
391
|
+
* Parameters for the ttl decorator.
|
|
392
|
+
* Marks a Date field for TTL (Time To Live) expiration in MongoDB.
|
|
393
|
+
* MongoDB will automatically delete documents when the TTL expires.
|
|
394
|
+
*
|
|
395
|
+
* @example
|
|
396
|
+
* createdAt: z.date().ttl({ expireAfterSeconds: 3600 }) // Expire 1 hour after createdAt
|
|
397
|
+
*
|
|
398
|
+
* @example
|
|
399
|
+
* expiresAt: z.date().ttl({ expireAfterSeconds: 0 }) // Expire at the exact date value
|
|
400
|
+
*/
|
|
401
|
+
export interface TtlFieldParams {
|
|
402
|
+
/**
|
|
403
|
+
* Number of seconds after the field's date value when the document should be deleted.
|
|
404
|
+
* - 0: Document expires at the exact date/time stored in the field
|
|
405
|
+
* - N > 0: Document expires N seconds after the date/time stored in the field
|
|
406
|
+
*
|
|
407
|
+
* @example
|
|
408
|
+
* // Expire documents 24 hours after createdAt
|
|
409
|
+
* createdAt: z.date().ttl({ expireAfterSeconds: 86400 })
|
|
410
|
+
*
|
|
411
|
+
* @example
|
|
412
|
+
* // Expire documents at the exact expiresAt date
|
|
413
|
+
* expiresAt: z.date().ttl({ expireAfterSeconds: 0 })
|
|
414
|
+
*/
|
|
415
|
+
expireAfterSeconds: number;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
//------------------------------------------------------------------------------------------------
|
|
419
|
+
// OTP FIELD PARAMS
|
|
420
|
+
//------------------------------------------------------------------------------------------------
|
|
421
|
+
|
|
422
|
+
/**
|
|
423
|
+
* Parameters for the isOtp decorator.
|
|
424
|
+
* Configures the OTP (One-Time Password) input field behavior.
|
|
425
|
+
*/
|
|
426
|
+
export interface OtpFieldParams {
|
|
427
|
+
/**
|
|
428
|
+
* Maximum length of the OTP code.
|
|
429
|
+
* Determines how many input slots are rendered.
|
|
430
|
+
*
|
|
431
|
+
* @default 6
|
|
432
|
+
*
|
|
433
|
+
* @example
|
|
434
|
+
* // 6-digit OTP code
|
|
435
|
+
* otpCode: z.string().isOtp()
|
|
436
|
+
*
|
|
437
|
+
* @example
|
|
438
|
+
* // 4-digit PIN
|
|
439
|
+
* pin: z.string().isOtp({ maxLength: 4 })
|
|
440
|
+
*/
|
|
441
|
+
maxLength?: number;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
//------------------------------------------------------------------------------------------------
|
|
445
|
+
// SUMMARY FIELD PARAMS
|
|
446
|
+
//------------------------------------------------------------------------------------------------
|
|
447
|
+
|
|
448
|
+
/**
|
|
449
|
+
*
|
|
450
|
+
* Parameters for the isSummaryField decorator.
|
|
451
|
+
* Controls how summary fields are handled, particularly for foreign key population.
|
|
452
|
+
*/
|
|
453
|
+
export interface SummaryFieldParams {
|
|
454
|
+
/**
|
|
455
|
+
* Whether to populate this foreign key field with the related resource's summary data.
|
|
456
|
+
* Only applicable when the field also has isForeignKey() decorator.
|
|
457
|
+
*
|
|
458
|
+
* When true:
|
|
459
|
+
* - The related resource will be fetched using the resourceIdentifier naming convention
|
|
460
|
+
* - Only the related resource's isSummaryField fields will be included
|
|
461
|
+
* - The populated data is optional (null if the related resource doesn't exist)
|
|
462
|
+
*
|
|
463
|
+
* @default false
|
|
464
|
+
*
|
|
465
|
+
* @example
|
|
466
|
+
* // Field definition:
|
|
467
|
+
* userId: z.string().isForeignKey().isSummaryField({ populate: true })
|
|
468
|
+
*
|
|
469
|
+
* // LIST/SEARCH response will include:
|
|
470
|
+
* {
|
|
471
|
+
* _id: "123",
|
|
472
|
+
* userId: "user-456",
|
|
473
|
+
* user: { _id: "user-456", email: "...", displayName: "..." } // populated summary
|
|
474
|
+
* }
|
|
475
|
+
*/
|
|
476
|
+
populate?: boolean;
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
//------------------------------------------------------------------------------------------------
|
|
480
|
+
// FORM VALIDATION DECORATOR PARAMS
|
|
481
|
+
//------------------------------------------------------------------------------------------------
|
|
482
|
+
|
|
483
|
+
/**
|
|
484
|
+
* Validation mode for form fields.
|
|
485
|
+
* Configures when field validation is triggered.
|
|
486
|
+
* - ON_CHANGE: Validate on every change (with debounce for text fields)
|
|
487
|
+
* - ON_BLUR: Validate when field loses focus (default for text fields)
|
|
488
|
+
* - ON_TOUCHED: Validate on blur initially, then on every change once touched
|
|
489
|
+
* - ON_SUBMIT: Validate only on form submission
|
|
490
|
+
*/
|
|
491
|
+
export enum ValidationMode {
|
|
492
|
+
ON_CHANGE = 'onChange',
|
|
493
|
+
ON_BLUR = 'onBlur',
|
|
494
|
+
ON_TOUCHED = 'onTouched',
|
|
495
|
+
ON_SUBMIT = 'onSubmit',
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
/**
|
|
499
|
+
* Trigger mechanism for autosave.
|
|
500
|
+
* - DEBOUNCE: Save after a delay following the last change
|
|
501
|
+
* - BLUR: Save when field loses focus
|
|
502
|
+
* - NONE: Disable autosave for this field
|
|
503
|
+
*/
|
|
504
|
+
export enum AutosaveTrigger {
|
|
505
|
+
DEBOUNCE = 'debounce',
|
|
506
|
+
BLUR = 'blur',
|
|
507
|
+
NONE = 'none',
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
export interface AutosaveFieldParams {
|
|
511
|
+
/**
|
|
512
|
+
* Whether autosave is enabled for this field.
|
|
513
|
+
* @default true
|
|
514
|
+
*/
|
|
515
|
+
enabled?: boolean;
|
|
516
|
+
|
|
517
|
+
/**
|
|
518
|
+
* Trigger mechanism for autosave.
|
|
519
|
+
* - AutosaveTrigger.DEBOUNCE: Save after a delay following the last change
|
|
520
|
+
* - AutosaveTrigger.BLUR: Save when field loses focus
|
|
521
|
+
* - AutosaveTrigger.NONE: Disable autosave for this field
|
|
522
|
+
* @default AutosaveTrigger.DEBOUNCE
|
|
523
|
+
*/
|
|
524
|
+
trigger?: AutosaveTrigger;
|
|
525
|
+
|
|
526
|
+
/**
|
|
527
|
+
* Debounce delay in milliseconds (only for DEBOUNCE trigger).
|
|
528
|
+
* @default 500
|
|
529
|
+
*/
|
|
530
|
+
debounceMs?: number;
|
|
531
|
+
}
|
|
532
|
+
```
|
|
533
|
+
## Import Origins
|
|
534
|
+
|
|
535
|
+
- `@wildo-ai/zod-decorators`
|
|
536
|
+
|
|
537
|
+
## Source Excerpts
|
|
538
|
+
|
|
539
|
+
### Origin Package: `@wildo-ai/zod-decorators`
|
|
540
|
+
|
|
541
|
+
```typescript
|
|
542
|
+
*
|
|
543
|
+
* Deep-merge mergeable decorator params with special handling for the `values` key.
|
|
544
|
+
*
|
|
545
|
+
* - Nested plain objects are merged recursively so later decorator calls can
|
|
546
|
+
* augment `display`, `edit`, and similar buckets without dropping earlier data.
|
|
547
|
+
* - `values` is merged per key, preserving existing enum/spec entries while still
|
|
548
|
+
* letting later calls override a nested property of the same entry.
|
|
549
|
+
* - Arrays and non-object values remain atomic and are replaced by the incoming value.
|
|
550
|
+
* - Additive only — to clear a nested property, set it to `undefined` explicitly.
|
|
551
|
+
*/
|
|
552
|
+
function deepMergeDecoratorParams(
|
|
553
|
+
existing: Record<string, unknown>,
|
|
554
|
+
incoming: Record<string, unknown>,
|
|
555
|
+
): Record<string, unknown> {
|
|
556
|
+
const result = { ...existing };
|
|
557
|
+
for (const [key, value] of Object.entries(incoming)) {
|
|
558
|
+
const existingValue = result[key];
|
|
559
|
+
|
|
560
|
+
if (key === 'values' && isPlainObject(value) && isPlainObject(existingValue)) {
|
|
561
|
+
const existingValues = existingValue as Record<string, Record<string, unknown>>;
|
|
562
|
+
const incomingValues = value as Record<string, Record<string, unknown>>;
|
|
563
|
+
result[key] = { ...existingValues };
|
|
564
|
+
for (const [enumValue, enumConfig] of Object.entries(incomingValues)) {
|
|
565
|
+
const existingEnumConfig = existingValues[enumValue];
|
|
566
|
+
(result[key] as Record<string, unknown>)[enumValue] =
|
|
567
|
+
isPlainObject(existingEnumConfig) && isPlainObject(enumConfig)
|
|
568
|
+
? deepMergeDecoratorParams(existingEnumConfig, enumConfig)
|
|
569
|
+
: enumConfig;
|
|
570
|
+
}
|
|
571
|
+
} else if (isPlainObject(value) && isPlainObject(existingValue)) {
|
|
572
|
+
result[key] = deepMergeDecoratorParams(existingValue, value);
|
|
573
|
+
} else {
|
|
574
|
+
result[key] = value;
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
return result;
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
|
|
581
|
+
/**
|
|
582
|
+
* Decorators that can never share a field with {@link ZodDecorator.RAG_SOURCE}, each with the one
|
|
583
|
+
* sentence that justifies refusing it. ONE table, keyed by the companion, consulted in BOTH
|
|
584
|
+
* application orders by `assertRagSourceCompanionAdmissible` below — the alternative (a check
|
|
585
|
+
* inside each of the five companion methods plus one inside `ragSource`) is six hand-applied
|
|
586
|
+
* copies of one invariant — the failure shape where a fix lands at one of an invariant's N call
|
|
587
|
+
* sites and the other N-1 drift. Because the check lives in
|
|
588
|
+
* `applySingleDecorator`, it also covers every escape hatch (`addRagSource`, `addDecorators`,
|
|
589
|
+
* `z_file({ ragSource })`) for free: there is no door into decorator metadata that bypasses it.
|
|
590
|
+
*
|
|
591
|
+
* ## `TTL` is the one entry this table cannot actually enforce — do not read it as closing DL3
|
|
592
|
+
*
|
|
593
|
+
* Corrected 2026-08-27. `.ttl()`'s applicable types are `['ZodDate','ZodOptional']` and
|
|
594
|
+
* `.ragSource()`'s are `['ZodString','ZodOptional','ZodNullable','ZodDefault']`, so the two
|
|
595
|
+
* essentially cannot land on the SAME field — this row defends a type-impossible pair. The
|
|
596
|
+
* REACHABLE configuration is `expiresAt: z.date().ttl(...)` beside `notes: z.string().ragSource()`:
|
|
597
|
+
* two fields, one resource, one row that MongoDB's TTL monitor deletes whole with no application
|
|
598
|
+
* code running. That is a RESOURCE-level fact and is refused at resource level, at boot, by
|
|
599
|
+
* `ApplicationStartupConfigValidatorService.collectRagSourceRetentionRefusal` (which reads both
|
|
600
|
+
* existing authorities — the RAG field walker and `collectResourceRetentionPolicies` — rather than
|
|
601
|
+
* re-deriving either). The row below is KEPT because it is cheap, correct, and reports the
|
|
602
|
+
* single-field case at authoring time instead of at boot; it is not the control.
|
|
603
|
+
*/
|
|
604
|
+
const RAG_SOURCE_REFUSED_COMPANIONS: ReadonlyMap<ZodDecorator, string> = new Map([
|
|
605
|
+
[ZodDecorator.IS_PASSWORD, 'a password must never enter a retrieval corpus.'],
|
|
606
|
+
[ZodDecorator.IS_OTP, 'a one-time code must never enter a retrieval corpus.'],
|
|
607
|
+
[ZodDecorator.IS_WRITE_ONLY_SECRET, 'a write-only secret must never enter a retrieval corpus.'],
|
|
608
|
+
[ZodDecorator.IS_EPHEMERAL, 'an ephemeral shown-once value must never enter a retrieval corpus.'],
|
|
609
|
+
[
|
|
610
|
+
ZodDecorator.TTL,
|
|
611
|
+
'MongoDB honours .ttl() natively — rows vanish with no application code running, so derived chunks could never be erased with their parent (resource-rag-capability DL3). ' +
|
|
612
|
+
'The pair is normally declared on two DIFFERENT fields of one resource, which this field-level check cannot see: that case is refused at boot, per resource, by the startup RAG capability probe. ' +
|
|
613
|
+
'Both refusals lift when a sweep-cascade reconciles chunk rows against vanished parents.',
|
|
614
|
+
],
|
|
615
|
+
]);
|
|
616
|
+
|
|
617
|
+
/**
|
|
618
|
+
* Enforce the RAG-source refusal pairs in BOTH orders at the single decorator chokepoint:
|
|
619
|
+
* applying `RAG_SOURCE` to a schema already carrying a refused companion throws, and applying a
|
|
620
|
+
* refused companion to a schema already carrying `RAG_SOURCE` throws the same sentence. Reading
|
|
621
|
+
* `currentMetadata` (the bag this very application is about to write into) is what makes the check
|
|
622
|
+
* order-symmetric: wrapper chains carry their inner metadata forward (`wrapInstanceMethod` copies
|
|
623
|
+
* `SCHEMA_METADATA` across `.optional()` / `.nullable()` / `.default()`), so the earlier
|
|
624
|
+
* declaration is visible from wherever the later one lands.
|
|
625
|
+
*/
|
|
626
|
+
function assertRagSourceCompanionAdmissible(decorator: ZodDecorator, currentMetadata: CustomFieldMetadata): void {
|
|
627
|
+
if (decorator === ZodDecorator.RAG_SOURCE) {
|
|
628
|
+
for (const [companion, reason] of RAG_SOURCE_REFUSED_COMPANIONS) {
|
|
629
|
+
if (currentMetadata[companion] !== undefined) {
|
|
630
|
+
throw new Error(`ragSource() cannot be combined with ${companion}(): ${reason}`);
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
return;
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
const reason = RAG_SOURCE_REFUSED_COMPANIONS.get(decorator);
|
|
637
|
+
if (reason !== undefined && currentMetadata[ZodDecorator.RAG_SOURCE] !== undefined) {
|
|
638
|
+
throw new Error(`${decorator}() cannot be combined with ragSource(): ${reason}`);
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
function applySingleDecorator<T extends z.ZodTypeAny>(
|
|
643
|
+
schema: T,
|
|
644
|
+
decorator: ZodDecorator,
|
|
645
|
+
params?: ZodDecorator_ParamsType[ZodDecorator]
|
|
646
|
+
): T {
|
|
647
|
+
// Ensure schema exists before accessing Symbol property
|
|
648
|
+
if (!schema) {
|
|
649
|
+
throw new Error('Invalid schema provided to applySingleDecorator');
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
// Get existing metadata from Symbol property with proper type casting
|
|
653
|
+
const currentMetadata: CustomFieldMetadata = (schema as any)[SCHEMA_METADATA] || {};
|
|
654
|
+
|
|
655
|
+
// Refused RAG-source companions, both orders, before any metadata is written — a refusal that
|
|
656
|
+
// fired after a partial write would leave the schema carrying half of a rejected combination.
|
|
657
|
+
assertRagSourceCompanionAdmissible(decorator, currentMetadata);
|
|
658
|
+
|
|
659
|
+
// Generic updater function resolution: if params is a function, call it with
|
|
660
|
+
// the current metadata value and use the result. Works for any decorator.
|
|
661
|
+
let resolvedFromUpdater = false;
|
|
662
|
+
if (typeof params === 'function') {
|
|
663
|
+
const existing = currentMetadata[decorator];
|
|
664
|
+
const currentValue = (existing && typeof existing === 'object') ? existing : undefined;
|
|
665
|
+
params = (params as (current: unknown) => unknown)(currentValue) as typeof params;
|
|
666
|
+
resolvedFromUpdater = true;
|
|
667
|
+
}
|
|
668
|
+
// After function resolution, params is a concrete value (never a function).
|
|
669
|
+
// TypeScript can't narrow this from control flow. Use `rp<D>()` for typed
|
|
670
|
+
// access in cases that read properties; use `p` for simple assignments.
|
|
671
|
+
const p = params as any;
|
|
672
|
+
function rp<D extends ZodDecorator>(): Exclude<ZodDecorator_ParamsType[D], Function> {
|
|
673
|
+
return params as Exclude<ZodDecorator_ParamsType[D], Function>;
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
// Handle each decorator explicitly.
|
|
677
|
+
// `p` is used instead of `params` for assignments — it's the same value
|
|
678
|
+
// but typed as `any` since TypeScript can't narrow the function union away
|
|
679
|
+
// after the generic resolution above.
|
|
680
|
+
switch (decorator) {
|
|
681
|
+
case ZodDecorator.IS_DB_INDEXED:
|
|
682
|
+
currentMetadata[ZodDecorator.IS_DB_INDEXED] = true;
|
|
683
|
+
break;
|
|
684
|
+
case ZodDecorator.IS_FOREIGN_KEY:
|
|
685
|
+
currentMetadata[ZodDecorator.IS_FOREIGN_KEY] = p ?? true;
|
|
686
|
+
break;
|
|
687
|
+
case ZodDecorator.IS_HIDDEN:
|
|
688
|
+
currentMetadata[ZodDecorator.IS_HIDDEN] = p ?? true;
|
|
689
|
+
break;
|
|
690
|
+
case ZodDecorator.IS_NOT_EDITABLE:
|
|
691
|
+
currentMetadata[ZodDecorator.IS_NOT_EDITABLE] = p ?? true;
|
|
692
|
+
break;
|
|
693
|
+
case ZodDecorator.IS_SUMMARY_FIELD:
|
|
694
|
+
currentMetadata[ZodDecorator.IS_SUMMARY_FIELD] = p ?? true;
|
|
695
|
+
break;
|
|
696
|
+
case ZodDecorator.IS_BACKEND_ONLY:
|
|
697
|
+
currentMetadata[ZodDecorator.IS_BACKEND_ONLY] = p ?? true;
|
|
698
|
+
break;
|
|
699
|
+
case ZodDecorator.IS_WRITE_ONLY_SECRET:
|
|
700
|
+
currentMetadata[ZodDecorator.IS_WRITE_ONLY_SECRET] = p ?? true;
|
|
701
|
+
break;
|
|
702
|
+
case ZodDecorator.IMPERSONALIZE_WITH: {
|
|
703
|
+
// Fail LOUD on a missing / blank treatment. This is the single chokepoint shared by the fluent
|
|
704
|
+
// `.impersonalizeWith(t)` method and the `addImpersonalizeWith(schema, t)` helper, so both doors
|
|
705
|
+
// reject the same inputs. Without it a bare `.impersonalizeWith()` (JS caller, or a TS caller
|
|
706
|
+
// whose value widened to undefined) would store `undefined`, `getImpersonalizeTreatment` would
|
|
707
|
+
// return `undefined`, and the field would read as UNTREATED — a silently unscrubbed personal
|
|
708
|
+
// field, i.e. exactly the PII-leak class this decorator exists to prevent.
|
|
709
|
+
//
|
|
710
|
+
// NORMALIZE HERE, not in the doors. Both authoring forms — the bare `RedactionType` string
|
|
711
|
+
// (the common case) and the `{ treatment, maskValue }` object (a MASK needing a field-specific
|
|
712
|
+
// value) — collapse to the params object before storage, so every reader sees ONE shape and
|
|
713
|
+
// the doors stay dumb pass-throughs. A raw `addDecorators()` caller lands here too.
|
|
714
|
+
const raw = p as unknown;
|
|
715
|
+
const normalized: ImpersonalizeFieldParams | undefined =
|
|
716
|
+
typeof raw === 'string'
|
|
717
|
+
? { treatment: raw }
|
|
718
|
+
: (raw !== null && typeof raw === 'object' && !Array.isArray(raw))
|
|
719
|
+
? { ...(raw as ImpersonalizeFieldParams) }
|
|
720
|
+
: undefined;
|
|
721
|
+
if (normalized === undefined || typeof normalized.treatment !== 'string' || normalized.treatment.trim().length === 0) {
|
|
722
|
+
throw new Error(
|
|
723
|
+
`impersonalizeWith(treatment) requires a non-empty RedactionType value (received ${JSON.stringify(raw)}). ` +
|
|
724
|
+
`An untreated field is left intact by the impersonalize writer — declare a treatment or omit the decorator.`,
|
|
725
|
+
);
|
|
726
|
+
}
|
|
727
|
+
// A blank override would write an empty string and erase the distinction between "masked" and
|
|
728
|
+
// "never had a value" — the same class of silent lie the treatment check above prevents.
|
|
729
|
+
// WHETHER a maskValue is legal for this treatment (MASK only) and whether the field's schema
|
|
730
|
+
// ACCEPTS it are both checked by the saas-models boot guard: this layer knows neither
|
|
731
|
+
// `RedactionType` nor the resource's mainSchema.
|
|
732
|
+
if (normalized.maskValue !== undefined && (typeof normalized.maskValue !== 'string' || normalized.maskValue.length === 0)) {
|
|
733
|
+
throw new Error(
|
|
734
|
+
`impersonalizeWith({ maskValue }) requires a non-empty string (received ${JSON.stringify(normalized.maskValue)}). ` +
|
|
735
|
+
`The mask value is written verbatim in place of the field — omit it to use the framework mask constant.`,
|
|
736
|
+
);
|
|
737
|
+
}
|
|
738
|
+
currentMetadata[ZodDecorator.IMPERSONALIZE_WITH] = normalized;
|
|
739
|
+
break;
|
|
740
|
+
}
|
|
741
|
+
case ZodDecorator.PORTABILITY_PROVENANCE: {
|
|
742
|
+
// Fail LOUD on a missing / blank provenance — the single chokepoint shared by the fluent
|
|
743
|
+
// `.portabilityProvenance(p)` method and the `addPortabilityProvenance(schema, p)` helper.
|
|
744
|
+
//
|
|
745
|
+
// Storing a blank would be worse here than for most decorators. An Art. 20 export treats an
|
|
746
|
+
// UNDECLARED field as a REFUSAL precisely because neither guess is safe (excluding
|
|
747
|
+
// under-delivers a legal right, including over-shares controller-derived data). A silently
|
|
748
|
+
// stored empty string would read back as declared-but-meaningless, converting that deliberate
|
|
749
|
+
// refusal into a fabricated answer about a disclosure boundary.
|
|
750
|
+
//
|
|
751
|
+
// WHETHER the value is a real `DataPortabilityProvenance` member is checked by the saas-models
|
|
752
|
+
// layer, which owns the enum — this layer knows only that a non-empty string was declared.
|
|
753
|
+
const raw = p as unknown;
|
|
754
|
+
if (typeof raw !== 'string' || raw.trim().length === 0) {
|
|
755
|
+
throw new Error(
|
|
756
|
+
`portabilityProvenance(provenance) requires a non-empty DataPortabilityProvenance value (received ${JSON.stringify(raw)}). ` +
|
|
757
|
+
`An undeclared field makes an Art. 20 export refuse rather than guess — declare a provenance or omit the decorator ` +
|
|
758
|
+
`to inherit the resource's portabilityPolicy.defaultProvenance.`,
|
|
759
|
+
);
|
|
760
|
+
}
|
|
761
|
+
currentMetadata[ZodDecorator.PORTABILITY_PROVENANCE] = raw;
|
|
762
|
+
break;
|
|
763
|
+
}
|
|
764
|
+
case ZodDecorator.DATA_CATEGORIES: {
|
|
765
|
+
// NORMALIZE HERE, not in the doors — the impersonalizeWith discipline. A single value (the
|
|
766
|
+
// common case) and an array both store a deduped ARRAY, so every reader sees one shape and
|
|
767
|
+
// `getDataCategories` answers "is this field categorized?" by presence alone.
|
|
768
|
+
//
|
|
769
|
+
// Fail LOUD on an empty declaration. An UNCATEGORIZED field is a legitimate, common state —
|
|
770
|
+
// most fields are not personal data — and the gap report is built on ABSENCE. A stored empty
|
|
771
|
+
// array would read back as declared-with-no-categories, which is invisible to a report
|
|
772
|
+
// looking for absence: the field would be silently excluded from the notice while looking
|
|
773
|
+
// annotated to anyone reading the schema.
|
|
774
|
+
//
|
|
775
|
+
// WHETHER each value is a real `PersonalDataCategory` member is checked by the resource
|
|
776
|
+
// factory's boot guard, which owns the enum — this layer knows only that non-empty strings
|
|
777
|
+
// were declared.
|
|
778
|
+
const raw = p as unknown;
|
|
779
|
+
const authored: readonly unknown[] = Array.isArray(raw) ? raw : [raw];
|
|
780
|
+
if (authored.length === 0 || authored.some((value) => typeof value !== 'string' || value.trim().length === 0)) {
|
|
781
|
+
throw new Error(
|
|
782
|
+
`dataCategories(categories) requires at least one non-empty PersonalDataCategory value (received ${JSON.stringify(raw)}). ` +
|
|
783
|
+
`A field that holds no personal data carries NO declaration — absence is what a category gap report reads. ` +
|
|
784
|
+
`An empty declaration looks annotated and discloses nothing.`,
|
|
785
|
+
);
|
|
786
|
+
}
|
|
787
|
+
currentMetadata[ZodDecorator.DATA_CATEGORIES] = [...new Set(authored as readonly string[])];
|
|
788
|
+
break;
|
|
789
|
+
}
|
|
790
|
+
case ZodDecorator.IS_AUDIT_EVIDENCE:
|
|
791
|
+
currentMetadata[ZodDecorator.IS_AUDIT_EVIDENCE] = true;
|
|
792
|
+
break;
|
|
793
|
+
case ZodDecorator.RAG_SOURCE: {
|
|
794
|
+
// NORMALIZE HERE, not in the doors — the impersonalizeWith discipline. A bare `.ragSource()`
|
|
795
|
+
// (the common case) stores `{}` rather than `true`/`undefined`, so every reader sees ONE
|
|
796
|
+
// shape and `getRagSourceConfig` answers "is this field a source?" by presence alone. The
|
|
797
|
+
// knobs are validated at decoration time because every one of them is otherwise a SILENT
|
|
798
|
+
// runtime misconfiguration: a zero chunkSize or an overlap >= size does not fail — it chunks
|
|
799
|
+
// pathologically (empty chunks, or every chunk repeating its predecessor), which surfaces
|
|
800
|
+
// as bad retrieval quality nobody traces back to the schema.
|
|
801
|
+
const raw = p as unknown;
|
|
802
|
+
if (raw !== undefined && (raw === null || typeof raw !== 'object' || Array.isArray(raw))) {
|
|
803
|
+
throw new Error(`ragSource(config?) accepts an optional RagSourceConfiguration object (received ${JSON.stringify(raw)}).`);
|
|
804
|
+
}
|
|
805
|
+
const normalized: RagSourceConfiguration = raw === undefined ? {} : { ...(raw as RagSourceConfiguration) };
|
|
806
|
+
const { chunkingStrategy, chunkSize, chunkOverlap } = normalized;
|
|
807
|
+
const knownStrategies = Object.values(RAGChunkingStrategy) as string[];
|
|
808
|
+
if (chunkingStrategy !== undefined && !knownStrategies.includes(chunkingStrategy)) {
|
|
809
|
+
throw new Error(
|
|
810
|
+
`ragSource({ chunkingStrategy }) must be a RAGChunkingStrategy member (received ${JSON.stringify(chunkingStrategy)}; known: ${knownStrategies.join(', ')}).`,
|
|
811
|
+
);
|
|
812
|
+
}
|
|
813
|
+
if (chunkSize !== undefined && (!Number.isInteger(chunkSize) || chunkSize <= 0)) {
|
|
814
|
+
throw new Error(`ragSource({ chunkSize }) must be a positive integer (received ${JSON.stringify(chunkSize)}).`);
|
|
815
|
+
}
|
|
816
|
+
if (chunkOverlap !== undefined && (!Number.isInteger(chunkOverlap) || chunkOverlap < 0)) {
|
|
817
|
+
throw new Error(`ragSource({ chunkOverlap }) must be a non-negative integer (received ${JSON.stringify(chunkOverlap)}).`);
|
|
818
|
+
}
|
|
819
|
+
if (chunkSize !== undefined && chunkOverlap !== undefined && chunkOverlap >= chunkSize) {
|
|
820
|
+
throw new Error(
|
|
821
|
+
`ragSource({ chunkSize, chunkOverlap }) requires chunkOverlap < chunkSize (received overlap ${chunkOverlap} >= size ${chunkSize}) — ` +
|
|
822
|
+
`an overlap that reaches the chunk size makes every chunk repeat its predecessor.`,
|
|
823
|
+
);
|
|
824
|
+
}
|
|
825
|
+
currentMetadata[ZodDecorator.RAG_SOURCE] = normalized;
|
|
826
|
+
break;
|
|
827
|
+
}
|
|
828
|
+
case ZodDecorator.IS_VIRTUAL: {
|
|
829
|
+
const vp = rp<ZodDecorator.IS_VIRTUAL>();
|
|
830
|
+
if (!vp?.calculate) {
|
|
831
|
+
throw new Error('isVirtual decorator requires a calculate function');
|
|
832
|
+
}
|
|
833
|
+
currentMetadata[ZodDecorator.IS_VIRTUAL] = vp;
|
|
834
|
+
break;
|
|
835
|
+
}
|
|
836
|
+
case ZodDecorator.IS_DISCRIMINATOR:
|
|
837
|
+
currentMetadata[ZodDecorator.IS_DISCRIMINATOR] = p ?? true;
|
|
838
|
+
break;
|
|
839
|
+
case ZodDecorator.EXCLUDE_FROM_CREATE:
|
|
840
|
+
currentMetadata[ZodDecorator.EXCLUDE_FROM_CREATE] = true;
|
|
841
|
+
break;
|
|
842
|
+
case ZodDecorator.EXCLUDE_FROM_UPDATE:
|
|
843
|
+
currentMetadata[ZodDecorator.EXCLUDE_FROM_UPDATE] = true;
|
|
844
|
+
break;
|
|
845
|
+
case ZodDecorator.IS_UNIQUE:
|
|
846
|
+
currentMetadata[ZodDecorator.IS_UNIQUE] = p ?? true;
|
|
847
|
+
break;
|
|
848
|
+
case ZodDecorator.IS_PRIMARY_KEY:
|
|
849
|
+
currentMetadata[ZodDecorator.IS_PRIMARY_KEY] = true;
|
|
850
|
+
break;
|
|
851
|
+
case ZodDecorator.IS_BUSINESS_KEY:
|
|
852
|
+
currentMetadata[ZodDecorator.IS_BUSINESS_KEY] = true;
|
|
853
|
+
break;
|
|
854
|
+
case ZodDecorator.OBJECT_BUSINESS_KEY_SET:
|
|
855
|
+
currentMetadata[ZodDecorator.OBJECT_BUSINESS_KEY_SET] = p;
|
|
856
|
+
break;
|
|
857
|
+
case ZodDecorator.TTL:
|
|
858
|
+
currentMetadata[ZodDecorator.TTL] = p;
|
|
859
|
+
break;
|
|
860
|
+
case ZodDecorator.IS_PASSWORD:
|
|
861
|
+
currentMetadata[ZodDecorator.IS_PASSWORD] = true;
|
|
862
|
+
break;
|
|
863
|
+
case ZodDecorator.IS_OTP:
|
|
864
|
+
currentMetadata[ZodDecorator.IS_OTP] = p ?? true;
|
|
865
|
+
break;
|
|
866
|
+
case ZodDecorator.IS_COLOR:
|
|
867
|
+
currentMetadata[ZodDecorator.IS_COLOR] = true;
|
|
868
|
+
break;
|
|
869
|
+
case ZodDecorator.IS_DRAFT_RELAXED:
|
|
870
|
+
currentMetadata[ZodDecorator.IS_DRAFT_RELAXED] = true;
|
|
871
|
+
break;
|
|
872
|
+
case ZodDecorator.SHOW_WHEN:
|
|
873
|
+
currentMetadata[ZodDecorator.SHOW_WHEN] = p;
|
|
874
|
+
break;
|
|
875
|
+
case ZodDecorator.SYSTEM_ENUM:
|
|
876
|
+
currentMetadata[ZodDecorator.SYSTEM_ENUM] = p;
|
|
877
|
+
break;
|
|
878
|
+
case ZodDecorator.IS_EPHEMERAL:
|
|
879
|
+
currentMetadata[ZodDecorator.IS_EPHEMERAL] = true;
|
|
880
|
+
break;
|
|
881
|
+
case ZodDecorator.IS_CRDT:
|
|
882
|
+
currentMetadata[ZodDecorator.IS_CRDT] = true;
|
|
883
|
+
break;
|
|
884
|
+
// Mergeable decorator buckets: primitive UI/spec decorators deep-merge
|
|
885
|
+
// plain-object params by default, while updater functions still replace
|
|
886
|
+
// exactly with what they return.
|
|
887
|
+
case ZodDecorator.ENUM_UI: {
|
|
888
|
+
const existing = currentMetadata[decorator];
|
|
889
|
+
if (p === undefined) {
|
|
890
|
+
(currentMetadata as Record<string, unknown>)[decorator] = existing ?? true;
|
|
891
|
+
} else if (resolvedFromUpdater) {
|
|
892
|
+
(currentMetadata as Record<string, unknown>)[decorator] = p;
|
|
893
|
+
} else {
|
|
894
|
+
(currentMetadata as Record<string, unknown>)[decorator] =
|
|
895
|
+
isPlainObject(existing) && isPlainObject(p)
|
|
896
|
+
? deepMergeDecoratorParams(existing, p)
|
|
897
|
+
: p;
|
|
898
|
+
}
|
|
899
|
+
break;
|
|
900
|
+
}
|
|
901
|
+
case ZodDecorator.BOOLEAN_UI:
|
|
902
|
+
case ZodDecorator.STRING_UI:
|
|
903
|
+
case ZodDecorator.NUMBER_UI:
|
|
904
|
+
case ZodDecorator.DATE_UI:
|
|
905
|
+
case ZodDecorator.DATETIME_UI:
|
|
906
|
+
case ZodDecorator.TIME_UI:
|
|
907
|
+
case ZodDecorator.MONEY_UI:
|
|
908
|
+
case ZodDecorator.CODE_UI:
|
|
909
|
+
case ZodDecorator.FILE_UI:
|
|
910
|
+
case ZodDecorator.DURATION_UI:
|
|
911
|
+
case ZodDecorator.PHONE_UI:
|
|
912
|
+
case ZodDecorator.BIGDECIMAL_UI:
|
|
913
|
+
case ZodDecorator.FOREIGN_KEY_UI:
|
|
914
|
+
case ZodDecorator.ARRAY_UI:
|
|
915
|
+
case ZodDecorator.OBJECT_UI:
|
|
916
|
+
case ZodDecorator.STRING_SPEC:
|
|
917
|
+
case ZodDecorator.NUMBER_SPEC:
|
|
918
|
+
case ZodDecorator.BOOLEAN_SPEC:
|
|
919
|
+
case ZodDecorator.DATE_SPEC:
|
|
920
|
+
case ZodDecorator.DATETIME_SPEC:
|
|
921
|
+
case ZodDecorator.TIME_SPEC:
|
|
922
|
+
case ZodDecorator.ENUM_SPEC:
|
|
923
|
+
case ZodDecorator.MONEY_SPEC:
|
|
924
|
+
case ZodDecorator.CODE_SPEC:
|
|
925
|
+
case ZodDecorator.FILE_SPEC:
|
|
926
|
+
case ZodDecorator.DURATION_SPEC:
|
|
927
|
+
case ZodDecorator.PHONE_SPEC:
|
|
928
|
+
case ZodDecorator.BIGDECIMAL_SPEC:
|
|
929
|
+
case ZodDecorator.FOREIGN_KEY_SPEC:
|
|
930
|
+
case ZodDecorator.ARRAY_SPEC:
|
|
931
|
+
case ZodDecorator.OBJECT_SPEC: {
|
|
932
|
+
const existing = currentMetadata[decorator];
|
|
933
|
+
if (p === undefined) {
|
|
934
|
+
(currentMetadata as Record<string, unknown>)[decorator] = existing ?? true;
|
|
935
|
+
} else if (resolvedFromUpdater) {
|
|
936
|
+
(currentMetadata as Record<string, unknown>)[decorator] = p;
|
|
937
|
+
} else {
|
|
938
|
+
(currentMetadata as Record<string, unknown>)[decorator] =
|
|
939
|
+
isPlainObject(existing) && isPlainObject(p)
|
|
940
|
+
? deepMergeDecoratorParams(existing, p)
|
|
941
|
+
: p;
|
|
942
|
+
}
|
|
943
|
+
break;
|
|
944
|
+
}
|
|
945
|
+
}
|
|
946
|
+
|
|
947
|
+
// Store updated metadata using Symbol
|
|
948
|
+
(schema as any)[SCHEMA_METADATA] = currentMetadata;
|
|
949
|
+
propagateWrapperDecoratorMetadataToInnerSchema(schema, currentMetadata);
|
|
950
|
+
|
|
951
|
+
return addChainableMethods(schema) as T;
|
|
952
|
+
}
|
|
953
|
+
```
|
|
954
|
+
|
|
955
|
+
### Origin Package: `@wildo-ai/zod-decorators`
|
|
956
|
+
|
|
957
|
+
```typescript
|
|
958
|
+
*
|
|
959
|
+
* Wraps an instance method to preserve SCHEMA_METADATA when it returns a new instance.
|
|
960
|
+
* In Zod v4, methods are on instances not prototypes, so we wrap them individually.
|
|
961
|
+
* Also wraps the result's methods to ensure metadata persists through the entire chain.
|
|
962
|
+
*/
|
|
963
|
+
function wrapInstanceMethod(instance: any, methodName: string): void {
|
|
964
|
+
const originalMethod = instance[methodName];
|
|
965
|
+
if (typeof originalMethod !== 'function') return;
|
|
966
|
+
|
|
967
|
+
// Skip if already wrapped
|
|
968
|
+
if ((originalMethod as any).__metadataWrapped) return;
|
|
969
|
+
|
|
970
|
+
// Use special wrapper for field-transform methods on ZodObject
|
|
971
|
+
const isObjectFieldTransform = OBJECT_FIELD_TRANSFORM_METHODS_SET.has(methodName) &&
|
|
972
|
+
instance.constructor?.name === 'ZodObject';
|
|
973
|
+
|
|
974
|
+
const wrappedMethod = function(this: any, ...args: any[]) {
|
|
975
|
+
// Get original shape before transformation (for field-transform methods)
|
|
976
|
+
const originalShape = isObjectFieldTransform ? this.shape : null;
|
|
977
|
+
const originalSchemaMetadata = (this as any)[SCHEMA_METADATA];
|
|
978
|
+
|
|
979
|
+
const result = originalMethod.apply(this, args);
|
|
980
|
+
|
|
981
|
+
// Copy metadata from original to result if it exists and result is different
|
|
982
|
+
if (result && result !== this) {
|
|
983
|
+
// Preserve all decorator metadata (including rangeConfig and currencyConfig)
|
|
984
|
+
if (originalSchemaMetadata && Object.keys(originalSchemaMetadata).length > 0) {
|
|
985
|
+
(result as any)[SCHEMA_METADATA] = { ...originalSchemaMetadata };
|
|
986
|
+
}
|
|
987
|
+
|
|
988
|
+
// For field-transform methods, copy field-level metadata to new wrapped fields
|
|
989
|
+
if (isObjectFieldTransform && originalShape && result.shape) {
|
|
990
|
+
copyFieldMetadata(originalShape, result.shape);
|
|
991
|
+
}
|
|
992
|
+
|
|
993
|
+
// Also wrap the result's methods so metadata persists through subsequent chains
|
|
994
|
+
wrapInstanceMethodsForMetadata(result);
|
|
995
|
+
}
|
|
996
|
+
return result;
|
|
997
|
+
};
|
|
998
|
+
|
|
999
|
+
// Mark as wrapped to avoid double-wrapping
|
|
1000
|
+
(wrappedMethod as any).__metadataWrapped = true;
|
|
1001
|
+
|
|
1002
|
+
instance[methodName] = wrappedMethod;
|
|
1003
|
+
}
|
|
1004
|
+
|
|
1005
|
+
/**
|
|
1006
|
+
* Copy field-level metadata from original shape to new shape.
|
|
1007
|
+
* Used for methods like .partial() that wrap fields in new types.
|
|
1008
|
+
*/
|
|
1009
|
+
function copyFieldMetadata(originalShape: Record<string, any>, newShape: Record<string, any>): void {
|
|
1010
|
+
for (const fieldName of Object.keys(originalShape)) {
|
|
1011
|
+
const originalField = originalShape[fieldName];
|
|
1012
|
+
const newField = newShape[fieldName];
|
|
1013
|
+
|
|
1014
|
+
if (originalField && newField && originalField !== newField) {
|
|
1015
|
+
const fieldMetadata = (originalField as any)[SCHEMA_METADATA];
|
|
1016
|
+
|
|
1017
|
+
if (fieldMetadata && Object.keys(fieldMetadata).length > 0) {
|
|
1018
|
+
(newField as any)[SCHEMA_METADATA] = deepCloneValue(fieldMetadata);
|
|
1019
|
+
|
|
1020
|
+
// Also wrap the new field's methods for future chaining
|
|
1021
|
+
wrapInstanceMethodsForMetadata(newField);
|
|
1022
|
+
}
|
|
1023
|
+
}
|
|
1024
|
+
}
|
|
1025
|
+
}
|
|
1026
|
+
|
|
1027
|
+
/**
|
|
1028
|
+
* Wrap only the instance methods (not decorator methods) for metadata preservation.
|
|
1029
|
+
* Used when copying metadata to a new schema instance.
|
|
1030
|
+
*/
|
|
1031
|
+
function wrapInstanceMethodsForMetadata(schema: any): void {
|
|
1032
|
+
for (const methodName of ZOD_INSTANCE_METHODS_TO_WRAP) {
|
|
1033
|
+
if (typeof schema[methodName] === 'function') {
|
|
1034
|
+
wrapInstanceMethod(schema, methodName);
|
|
1035
|
+
}
|
|
1036
|
+
}
|
|
1037
|
+
}
|
|
1038
|
+
|
|
1039
|
+
|
|
1040
|
+
|
|
1041
|
+
export function addChainableMethods<T extends z.ZodTypeAny>(schema: T): T {
|
|
1042
|
+
const decoratedSchema = schema as DecoratedPrimitiveZodType<T>;
|
|
1043
|
+
|
|
1044
|
+
// CRITICAL: Wrap instance methods that return new instances to preserve metadata
|
|
1045
|
+
// In Zod v4, methods are on instances not prototypes
|
|
1046
|
+
for (const methodName of ZOD_INSTANCE_METHODS_TO_WRAP) {
|
|
1047
|
+
if (typeof (decoratedSchema as any)[methodName] === 'function') {
|
|
1048
|
+
wrapInstanceMethod(decoratedSchema, methodName);
|
|
1049
|
+
}
|
|
1050
|
+
}
|
|
1051
|
+
|
|
1052
|
+
const ctorName = (decoratedSchema as any)?.constructor?.name as string | undefined;
|
|
1053
|
+
|
|
1054
|
+
for (const decorator of Object.values(ZodDecorator)) {
|
|
1055
|
+
const applyable = ZodDecorator_ApplyableType[decorator];
|
|
1056
|
+
if (!applyable || !ctorName) continue;
|
|
1057
|
+
if (!applyable.includes(ctorName)) continue;
|
|
1058
|
+
if (Object.prototype.hasOwnProperty.call(decoratedSchema, decorator)) continue;
|
|
1059
|
+
|
|
1060
|
+
// Use the actual function from ZodDecorator_FunctionType to preserve composite
|
|
1061
|
+
// decorator behavior (e.g., isPrimaryKey sets 5 decorators, isPassword sets 2).
|
|
1062
|
+
// Falling back to a generic wrapper should never happen if the table is complete.
|
|
1063
|
+
const registeredFn = ZodDecorator_FunctionType[decorator];
|
|
1064
|
+
const value = registeredFn
|
|
1065
|
+
? (...args: any[]) => registeredFn.apply(decoratedSchema, args)
|
|
1066
|
+
: (params: any) => addDecorators(decoratedSchema, [{ ref: decorator, params }]);
|
|
1067
|
+
|
|
1068
|
+
Object.defineProperty(decoratedSchema, decorator, { value, ...defaultZodDecoSchemaProperties});
|
|
1069
|
+
}
|
|
1070
|
+
|
|
1071
|
+
if (!decoratedSchema.hasOwnProperty('addDecorators')) {
|
|
1072
|
+
Object.defineProperty(decoratedSchema, 'addDecorators', {
|
|
1073
|
+
value: (decorators: DecoratorInput[]) => addDecorators(decoratedSchema, decorators),
|
|
1074
|
+
...defaultZodDecoSchemaProperties
|
|
1075
|
+
});
|
|
1076
|
+
}
|
|
1077
|
+
|
|
1078
|
+
return decoratedSchema as T;
|
|
1079
|
+
}
|
|
1080
|
+
```
|