@superbee/core 0.2.0-pre.8 → 0.4.10-pre.11
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 +202 -0
- package/README.md +1345 -6
- package/dist/artifact-contract.d.ts +90 -0
- package/dist/artifact-contract.d.ts.map +1 -0
- package/dist/artifact-contract.js +205 -0
- package/dist/artifact-contract.js.map +1 -0
- package/dist/backend.d.ts +50 -2
- package/dist/backend.d.ts.map +1 -1
- package/dist/backend.js +311 -33
- package/dist/backend.js.map +1 -1
- package/dist/blob-contract.d.ts +82 -0
- package/dist/blob-contract.d.ts.map +1 -0
- package/dist/blob-contract.js +134 -0
- package/dist/blob-contract.js.map +1 -0
- package/dist/blob-journal.d.ts +303 -0
- package/dist/blob-journal.d.ts.map +1 -0
- package/dist/blob-journal.js +541 -0
- package/dist/blob-journal.js.map +1 -0
- package/dist/body-pages.d.ts +20 -0
- package/dist/body-pages.d.ts.map +1 -0
- package/dist/body-pages.js +56 -0
- package/dist/body-pages.js.map +1 -0
- package/dist/body-replace-guards.d.ts +81 -0
- package/dist/body-replace-guards.d.ts.map +1 -0
- package/dist/body-replace-guards.js +271 -0
- package/dist/body-replace-guards.js.map +1 -0
- package/dist/bounded-yaml.d.ts +28 -0
- package/dist/bounded-yaml.d.ts.map +1 -0
- package/dist/bounded-yaml.js +182 -0
- package/dist/bounded-yaml.js.map +1 -0
- package/dist/builtin-recipes/content.d.ts +93 -0
- package/dist/builtin-recipes/content.d.ts.map +1 -0
- package/dist/builtin-recipes/content.js +288 -0
- package/dist/builtin-recipes/content.js.map +1 -0
- package/dist/builtin-recipes/site.d.ts +5 -0
- package/dist/builtin-recipes/site.d.ts.map +1 -0
- package/dist/builtin-recipes/site.js +83 -0
- package/dist/builtin-recipes/site.js.map +1 -0
- package/dist/builtin-recipes.d.ts +13 -0
- package/dist/builtin-recipes.d.ts.map +1 -0
- package/dist/builtin-recipes.js +123 -0
- package/dist/builtin-recipes.js.map +1 -0
- package/dist/bundle-health/index.d.ts +14 -0
- package/dist/bundle-health/index.d.ts.map +1 -0
- package/dist/bundle-health/index.js +12 -0
- package/dist/bundle-health/index.js.map +1 -0
- package/dist/bundle-health/kind-findings.d.ts +45 -0
- package/dist/bundle-health/kind-findings.d.ts.map +1 -0
- package/dist/bundle-health/kind-findings.js +67 -0
- package/dist/bundle-health/kind-findings.js.map +1 -0
- package/dist/bundle-health/legacy-page.d.ts +21 -0
- package/dist/bundle-health/legacy-page.d.ts.map +1 -0
- package/dist/bundle-health/legacy-page.js +25 -0
- package/dist/bundle-health/legacy-page.js.map +1 -0
- package/dist/bundle-health/report.d.ts +191 -0
- package/dist/bundle-health/report.d.ts.map +1 -0
- package/dist/bundle-health/report.js +419 -0
- package/dist/bundle-health/report.js.map +1 -0
- package/dist/bundle-ops.d.ts +10 -4
- package/dist/bundle-ops.d.ts.map +1 -1
- package/dist/bundle-ops.js +15 -8
- package/dist/bundle-ops.js.map +1 -1
- package/dist/bundle.d.ts +2 -4
- package/dist/bundle.d.ts.map +1 -1
- package/dist/bundle.js +3 -12
- package/dist/bundle.js.map +1 -1
- package/dist/code-point-order.d.ts +8 -0
- package/dist/code-point-order.d.ts.map +1 -0
- package/dist/code-point-order.js +20 -0
- package/dist/code-point-order.js.map +1 -0
- package/dist/code-unit-order.d.ts +15 -0
- package/dist/code-unit-order.d.ts.map +1 -0
- package/dist/code-unit-order.js +17 -0
- package/dist/code-unit-order.js.map +1 -0
- package/dist/connector-request.d.ts +112 -0
- package/dist/connector-request.d.ts.map +1 -0
- package/dist/connector-request.js +495 -0
- package/dist/connector-request.js.map +1 -0
- package/dist/connectors.d.ts +297 -0
- package/dist/connectors.d.ts.map +1 -0
- package/dist/connectors.js +1233 -0
- package/dist/connectors.js.map +1 -0
- package/dist/convention-record.d.ts +9 -0
- package/dist/convention-record.d.ts.map +1 -0
- package/dist/convention-record.js +13 -0
- package/dist/convention-record.js.map +1 -0
- package/dist/cross-bundle.d.ts +135 -0
- package/dist/cross-bundle.d.ts.map +1 -0
- package/dist/cross-bundle.js +191 -0
- package/dist/cross-bundle.js.map +1 -0
- package/dist/dependencies.d.ts +208 -0
- package/dist/dependencies.d.ts.map +1 -0
- package/dist/dependencies.js +367 -0
- package/dist/dependencies.js.map +1 -0
- package/dist/document-codec.d.ts +4 -1
- package/dist/document-codec.d.ts.map +1 -1
- package/dist/document-codec.js +3 -1
- package/dist/document-codec.js.map +1 -1
- package/dist/document-field-actions.d.ts +34 -3
- package/dist/document-field-actions.d.ts.map +1 -1
- package/dist/document-field-actions.js +149 -43
- package/dist/document-field-actions.js.map +1 -1
- package/dist/document-mutation.d.ts +55 -18
- package/dist/document-mutation.d.ts.map +1 -1
- package/dist/document-mutation.js +210 -86
- package/dist/document-mutation.js.map +1 -1
- package/dist/document-persistence.d.ts +12 -0
- package/dist/document-persistence.d.ts.map +1 -0
- package/dist/document-persistence.js +44 -0
- package/dist/document-persistence.js.map +1 -0
- package/dist/document-replace-rules.d.ts +44 -0
- package/dist/document-replace-rules.d.ts.map +1 -0
- package/dist/document-replace-rules.js +41 -0
- package/dist/document-replace-rules.js.map +1 -0
- package/dist/document-scan.d.ts +26 -0
- package/dist/document-scan.d.ts.map +1 -0
- package/dist/document-scan.js +70 -0
- package/dist/document-scan.js.map +1 -0
- package/dist/document-transfer.d.ts +312 -0
- package/dist/document-transfer.d.ts.map +1 -0
- package/dist/document-transfer.js +1400 -0
- package/dist/document-transfer.js.map +1 -0
- package/dist/document-write-policy.d.ts +15 -4
- package/dist/document-write-policy.d.ts.map +1 -1
- package/dist/document-write-policy.js +41 -27
- package/dist/document-write-policy.js.map +1 -1
- package/dist/domain-model.d.ts +73 -0
- package/dist/domain-model.d.ts.map +1 -0
- package/dist/domain-model.js +169 -0
- package/dist/domain-model.js.map +1 -0
- package/dist/edge-harness/corpus.d.ts +9 -0
- package/dist/edge-harness/corpus.d.ts.map +1 -0
- package/dist/edge-harness/corpus.js +57 -0
- package/dist/edge-harness/corpus.js.map +1 -0
- package/dist/edge-harness/index.d.ts +21 -0
- package/dist/edge-harness/index.d.ts.map +1 -0
- package/dist/edge-harness/index.js +537 -0
- package/dist/edge-harness/index.js.map +1 -0
- package/dist/edges/find.d.ts +14 -0
- package/dist/edges/find.d.ts.map +1 -0
- package/dist/edges/find.js +46 -0
- package/dist/edges/find.js.map +1 -0
- package/dist/edges/index.d.ts +13 -0
- package/dist/edges/index.d.ts.map +1 -0
- package/dist/edges/index.js +5 -0
- package/dist/edges/index.js.map +1 -0
- package/dist/edges/memory-source.d.ts +8 -0
- package/dist/edges/memory-source.d.ts.map +1 -0
- package/dist/edges/memory-source.js +164 -0
- package/dist/edges/memory-source.js.map +1 -0
- package/dist/edges/read-bounds.d.ts +6 -0
- package/dist/edges/read-bounds.d.ts.map +1 -0
- package/dist/edges/read-bounds.js +13 -0
- package/dist/edges/read-bounds.js.map +1 -0
- package/dist/edges/source.d.ts +123 -0
- package/dist/edges/source.d.ts.map +1 -0
- package/dist/edges/source.js +2 -0
- package/dist/edges/source.js.map +1 -0
- package/dist/edges/walk.d.ts +7 -0
- package/dist/edges/walk.d.ts.map +1 -0
- package/dist/edges/walk.js +14 -0
- package/dist/edges/walk.js.map +1 -0
- package/dist/engine.d.ts +54 -18
- package/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +137 -108
- package/dist/engine.js.map +1 -1
- package/dist/errors.d.ts +37 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +75 -3
- package/dist/errors.js.map +1 -1
- package/dist/file-journaled-backend-internal.d.ts +2 -0
- package/dist/file-journaled-backend-internal.d.ts.map +1 -1
- package/dist/file-journaled-backend-internal.js +2 -0
- package/dist/file-journaled-backend-internal.js.map +1 -1
- package/dist/file-journaled-backend.d.ts +38 -40
- package/dist/file-journaled-backend.d.ts.map +1 -1
- package/dist/file-journaled-backend.js +284 -52
- package/dist/file-journaled-backend.js.map +1 -1
- package/dist/filesystem-identity.d.ts +116 -17
- package/dist/filesystem-identity.d.ts.map +1 -1
- package/dist/filesystem-identity.js +532 -51
- package/dist/filesystem-identity.js.map +1 -1
- package/dist/filesystem-lock.d.ts +9 -2
- package/dist/filesystem-lock.d.ts.map +1 -1
- package/dist/filesystem-lock.js +134 -17
- package/dist/filesystem-lock.js.map +1 -1
- package/dist/filesystem-temp-name.d.ts +9 -0
- package/dist/filesystem-temp-name.d.ts.map +1 -0
- package/dist/filesystem-temp-name.js +20 -0
- package/dist/filesystem-temp-name.js.map +1 -0
- package/dist/filesystem.d.ts +6 -0
- package/dist/filesystem.d.ts.map +1 -1
- package/dist/filesystem.js +2 -1
- package/dist/filesystem.js.map +1 -1
- package/dist/freshness.d.ts +16 -1
- package/dist/freshness.d.ts.map +1 -1
- package/dist/freshness.js +47 -17
- package/dist/freshness.js.map +1 -1
- package/dist/frontmatter-contract.d.ts +14 -0
- package/dist/frontmatter-contract.d.ts.map +1 -1
- package/dist/frontmatter-contract.js +22 -0
- package/dist/frontmatter-contract.js.map +1 -1
- package/dist/frontmatter-splitter.d.ts +6 -0
- package/dist/frontmatter-splitter.d.ts.map +1 -1
- package/dist/frontmatter-splitter.js +8 -0
- package/dist/frontmatter-splitter.js.map +1 -1
- package/dist/frontmatter.d.ts +17 -7
- package/dist/frontmatter.d.ts.map +1 -1
- package/dist/frontmatter.js +52 -11
- package/dist/frontmatter.js.map +1 -1
- package/dist/governed-body-write.d.ts.map +1 -1
- package/dist/governed-body-write.js +13 -6
- package/dist/governed-body-write.js.map +1 -1
- package/dist/heads-digest.d.ts.map +1 -1
- package/dist/heads-digest.js +2 -1
- package/dist/heads-digest.js.map +1 -1
- package/dist/hosted-client/binding.d.ts +7 -0
- package/dist/hosted-client/binding.d.ts.map +1 -0
- package/dist/hosted-client/binding.js +10 -0
- package/dist/hosted-client/binding.js.map +1 -0
- package/dist/hosted-client/blob-delivery.d.ts +68 -0
- package/dist/hosted-client/blob-delivery.d.ts.map +1 -0
- package/dist/hosted-client/blob-delivery.js +170 -0
- package/dist/hosted-client/blob-delivery.js.map +1 -0
- package/dist/hosted-client/blob-write.d.ts +387 -0
- package/dist/hosted-client/blob-write.d.ts.map +1 -0
- package/dist/hosted-client/blob-write.js +770 -0
- package/dist/hosted-client/blob-write.js.map +1 -0
- package/dist/hosted-client/bundle-listing.d.ts +46 -0
- package/dist/hosted-client/bundle-listing.d.ts.map +1 -0
- package/dist/hosted-client/bundle-listing.js +36 -0
- package/dist/hosted-client/bundle-listing.js.map +1 -0
- package/dist/hosted-client/client.d.ts +249 -0
- package/dist/hosted-client/client.d.ts.map +1 -0
- package/dist/hosted-client/client.js +381 -0
- package/dist/hosted-client/client.js.map +1 -0
- package/dist/hosted-client/directory.d.ts +46 -0
- package/dist/hosted-client/directory.d.ts.map +1 -0
- package/dist/hosted-client/directory.js +74 -0
- package/dist/hosted-client/directory.js.map +1 -0
- package/dist/hosted-client/errors.d.ts +26 -0
- package/dist/hosted-client/errors.d.ts.map +1 -0
- package/dist/hosted-client/errors.js +35 -0
- package/dist/hosted-client/errors.js.map +1 -0
- package/dist/hosted-client/inbox.d.ts +320 -0
- package/dist/hosted-client/inbox.d.ts.map +1 -0
- package/dist/hosted-client/inbox.js +379 -0
- package/dist/hosted-client/inbox.js.map +1 -0
- package/dist/hosted-client/index.d.ts +31 -0
- package/dist/hosted-client/index.d.ts.map +1 -0
- package/dist/hosted-client/index.js +33 -0
- package/dist/hosted-client/index.js.map +1 -0
- package/dist/hosted-client/journal.d.ts +103 -0
- package/dist/hosted-client/journal.d.ts.map +1 -0
- package/dist/hosted-client/journal.js +464 -0
- package/dist/hosted-client/journal.js.map +1 -0
- package/dist/hosted-client/node.d.ts +74 -0
- package/dist/hosted-client/node.d.ts.map +1 -0
- package/dist/hosted-client/node.js +219 -0
- package/dist/hosted-client/node.js.map +1 -0
- package/dist/hosted-client/reference.d.ts +12 -0
- package/dist/hosted-client/reference.d.ts.map +1 -0
- package/dist/hosted-client/reference.js +29 -0
- package/dist/hosted-client/reference.js.map +1 -0
- package/dist/hosted-client/view-content.d.ts +184 -0
- package/dist/hosted-client/view-content.d.ts.map +1 -0
- package/dist/hosted-client/view-content.js +268 -0
- package/dist/hosted-client/view-content.js.map +1 -0
- package/dist/hosted-client/write.d.ts +219 -0
- package/dist/hosted-client/write.d.ts.map +1 -0
- package/dist/hosted-client/write.js +419 -0
- package/dist/hosted-client/write.js.map +1 -0
- package/dist/hosted-transport/answer-rows.d.ts +132 -4
- package/dist/hosted-transport/answer-rows.d.ts.map +1 -1
- package/dist/hosted-transport/answer-rows.js +211 -11
- package/dist/hosted-transport/answer-rows.js.map +1 -1
- package/dist/hosted-transport/attribution.d.ts +32 -0
- package/dist/hosted-transport/attribution.d.ts.map +1 -0
- package/dist/hosted-transport/attribution.js +38 -0
- package/dist/hosted-transport/attribution.js.map +1 -0
- package/dist/hosted-transport/blob-reads.d.ts +35 -0
- package/dist/hosted-transport/blob-reads.d.ts.map +1 -0
- package/dist/hosted-transport/blob-reads.js +179 -0
- package/dist/hosted-transport/blob-reads.js.map +1 -0
- package/dist/hosted-transport/blob-write.d.ts +34 -0
- package/dist/hosted-transport/blob-write.d.ts.map +1 -0
- package/dist/hosted-transport/blob-write.js +115 -0
- package/dist/hosted-transport/blob-write.js.map +1 -0
- package/dist/hosted-transport/carrier.d.ts +35 -11
- package/dist/hosted-transport/carrier.d.ts.map +1 -1
- package/dist/hosted-transport/carrier.js +101 -57
- package/dist/hosted-transport/carrier.js.map +1 -1
- package/dist/hosted-transport/document-backend.d.ts +74 -0
- package/dist/hosted-transport/document-backend.d.ts.map +1 -0
- package/dist/hosted-transport/document-backend.js +160 -0
- package/dist/hosted-transport/document-backend.js.map +1 -0
- package/dist/hosted-transport/index.d.ts +7 -4
- package/dist/hosted-transport/index.d.ts.map +1 -1
- package/dist/hosted-transport/index.js +7 -4
- package/dist/hosted-transport/index.js.map +1 -1
- package/dist/hosted-transport/operations.d.ts +6 -0
- package/dist/hosted-transport/operations.d.ts.map +1 -1
- package/dist/hosted-transport/operations.js +2 -1
- package/dist/hosted-transport/operations.js.map +1 -1
- package/dist/hosted-transport/port-run.d.ts +41 -0
- package/dist/hosted-transport/port-run.d.ts.map +1 -0
- package/dist/hosted-transport/port-run.js +92 -0
- package/dist/hosted-transport/port-run.js.map +1 -0
- package/dist/hosted-transport/read-adapter.d.ts +19 -3
- package/dist/hosted-transport/read-adapter.d.ts.map +1 -1
- package/dist/hosted-transport/read-adapter.js +18 -5
- package/dist/hosted-transport/read-adapter.js.map +1 -1
- package/dist/hosted-transport/root-write.d.ts.map +1 -1
- package/dist/hosted-transport/root-write.js +5 -2
- package/dist/hosted-transport/root-write.js.map +1 -1
- package/dist/hosted-transport/whole-document-transport.d.ts +56 -7
- package/dist/hosted-transport/whole-document-transport.d.ts.map +1 -1
- package/dist/hosted-transport/whole-document-transport.js +120 -31
- package/dist/hosted-transport/whole-document-transport.js.map +1 -1
- package/dist/identity-fold.d.ts +16 -0
- package/dist/identity-fold.d.ts.map +1 -0
- package/dist/identity-fold.js +24 -0
- package/dist/identity-fold.js.map +1 -0
- package/dist/index-projection.d.ts +2 -1
- package/dist/index-projection.d.ts.map +1 -1
- package/dist/index-projection.js +38 -28
- package/dist/index-projection.js.map +1 -1
- package/dist/index.d.ts +61 -18
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +50 -21
- package/dist/index.js.map +1 -1
- package/dist/indexeddb-backend.d.ts +0 -31
- package/dist/indexeddb-backend.d.ts.map +1 -1
- package/dist/indexeddb-backend.js +5 -2
- package/dist/indexeddb-backend.js.map +1 -1
- package/dist/inventory-guard.d.ts +58 -0
- package/dist/inventory-guard.d.ts.map +1 -0
- package/dist/inventory-guard.js +169 -0
- package/dist/inventory-guard.js.map +1 -0
- package/dist/journaled-backend.d.ts +14 -4
- package/dist/journaled-backend.d.ts.map +1 -1
- package/dist/journaled-backend.js +19 -78
- package/dist/journaled-backend.js.map +1 -1
- package/dist/json-data.d.ts +3 -0
- package/dist/json-data.d.ts.map +1 -0
- package/dist/json-data.js +19 -0
- package/dist/json-data.js.map +1 -0
- package/dist/kind-authoring.d.ts +188 -0
- package/dist/kind-authoring.d.ts.map +1 -0
- package/dist/kind-authoring.js +520 -0
- package/dist/kind-authoring.js.map +1 -0
- package/dist/kind-changes.d.ts +45 -0
- package/dist/kind-changes.d.ts.map +1 -0
- package/dist/kind-changes.js +96 -0
- package/dist/kind-changes.js.map +1 -0
- package/dist/kind-conformance-error.d.ts +16 -0
- package/dist/kind-conformance-error.d.ts.map +1 -0
- package/dist/kind-conformance-error.js +20 -0
- package/dist/kind-conformance-error.js.map +1 -0
- package/dist/kind-coverage.d.ts +100 -0
- package/dist/kind-coverage.d.ts.map +1 -0
- package/dist/kind-coverage.js +185 -0
- package/dist/kind-coverage.js.map +1 -0
- package/dist/kind-deprecation.d.ts +32 -0
- package/dist/kind-deprecation.d.ts.map +1 -0
- package/dist/kind-deprecation.js +141 -0
- package/dist/kind-deprecation.js.map +1 -0
- package/dist/kind-field-mutation.d.ts +7 -2
- package/dist/kind-field-mutation.d.ts.map +1 -1
- package/dist/kind-field-mutation.js +28 -3
- package/dist/kind-field-mutation.js.map +1 -1
- package/dist/kind-undeclared-fields.d.ts +72 -0
- package/dist/kind-undeclared-fields.d.ts.map +1 -0
- package/dist/kind-undeclared-fields.js +124 -0
- package/dist/kind-undeclared-fields.js.map +1 -0
- package/dist/kinds-load.d.ts.map +1 -1
- package/dist/kinds-load.js +8 -5
- package/dist/kinds-load.js.map +1 -1
- package/dist/kinds.d.ts +105 -13
- package/dist/kinds.d.ts.map +1 -1
- package/dist/kinds.js +369 -30
- package/dist/kinds.js.map +1 -1
- package/dist/link-add.d.ts +81 -0
- package/dist/link-add.d.ts.map +1 -0
- package/dist/link-add.js +94 -0
- package/dist/link-add.js.map +1 -0
- package/dist/link-emit.d.ts +29 -0
- package/dist/link-emit.d.ts.map +1 -0
- package/dist/link-emit.js +39 -0
- package/dist/link-emit.js.map +1 -0
- package/dist/link-findings.d.ts +132 -0
- package/dist/link-findings.d.ts.map +1 -0
- package/dist/link-findings.js +263 -0
- package/dist/link-findings.js.map +1 -0
- package/dist/link-types.d.ts +34 -0
- package/dist/link-types.d.ts.map +1 -0
- package/dist/link-types.js +79 -0
- package/dist/link-types.js.map +1 -0
- package/dist/links.d.ts +68 -9
- package/dist/links.d.ts.map +1 -1
- package/dist/links.js +370 -57
- package/dist/links.js.map +1 -1
- package/dist/local-search-index.d.ts +86 -0
- package/dist/local-search-index.d.ts.map +1 -0
- package/dist/local-search-index.js +1055 -0
- package/dist/local-search-index.js.map +1 -0
- package/dist/managed-document-metadata.d.ts +5 -0
- package/dist/managed-document-metadata.d.ts.map +1 -0
- package/dist/managed-document-metadata.js +10 -0
- package/dist/managed-document-metadata.js.map +1 -0
- package/dist/markdown-syntax.d.ts +39 -0
- package/dist/markdown-syntax.d.ts.map +1 -0
- package/dist/markdown-syntax.js +10170 -0
- package/dist/markdown-syntax.js.map +1 -0
- package/dist/memory-backend.d.ts +3 -0
- package/dist/memory-backend.d.ts.map +1 -1
- package/dist/memory-backend.js +40 -2
- package/dist/memory-backend.js.map +1 -1
- package/dist/mutation-attribution.d.ts +2 -1
- package/dist/mutation-attribution.d.ts.map +1 -1
- package/dist/mutation-attribution.js.map +1 -1
- package/dist/okf-actor.d.ts +14 -3
- package/dist/okf-actor.d.ts.map +1 -1
- package/dist/okf-actor.js +25 -4
- package/dist/okf-actor.js.map +1 -1
- package/dist/okf-authored-values.d.ts +2 -0
- package/dist/okf-authored-values.d.ts.map +1 -1
- package/dist/okf-authored-values.js +4 -0
- package/dist/okf-authored-values.js.map +1 -1
- package/dist/okf-authoring.d.ts +7 -0
- package/dist/okf-authoring.d.ts.map +1 -0
- package/dist/okf-authoring.js +30 -0
- package/dist/okf-authoring.js.map +1 -0
- package/dist/okf-standard-fields.d.ts +4 -0
- package/dist/okf-standard-fields.d.ts.map +1 -1
- package/dist/okf-standard-fields.js +24 -14
- package/dist/okf-standard-fields.js.map +1 -1
- package/dist/okf-timestamps.d.ts +2 -2
- package/dist/okf-timestamps.d.ts.map +1 -1
- package/dist/okf-timestamps.js +25 -15
- package/dist/okf-timestamps.js.map +1 -1
- package/dist/page.d.ts +3 -7
- package/dist/page.d.ts.map +1 -1
- package/dist/page.js +3 -7
- package/dist/page.js.map +1 -1
- package/dist/path-fold.d.ts +67 -0
- package/dist/path-fold.d.ts.map +1 -0
- package/dist/path-fold.js +107 -0
- package/dist/path-fold.js.map +1 -0
- package/dist/paths.d.ts +46 -0
- package/dist/paths.d.ts.map +1 -1
- package/dist/paths.js +114 -1
- package/dist/paths.js.map +1 -1
- package/dist/platform.d.ts +13 -0
- package/dist/platform.d.ts.map +1 -1
- package/dist/platform.js +16 -0
- package/dist/platform.js.map +1 -1
- package/dist/portable-export-contract.d.ts +17 -0
- package/dist/portable-export-contract.d.ts.map +1 -0
- package/dist/portable-export-contract.js +59 -0
- package/dist/portable-export-contract.js.map +1 -0
- package/dist/portable-export.d.ts +115 -0
- package/dist/portable-export.d.ts.map +1 -0
- package/dist/portable-export.js +452 -0
- package/dist/portable-export.js.map +1 -0
- package/dist/portable-frontmatter.d.ts +17 -0
- package/dist/portable-frontmatter.d.ts.map +1 -1
- package/dist/portable-frontmatter.js +42 -5
- package/dist/portable-frontmatter.js.map +1 -1
- package/dist/publication-filesystem.d.ts +1 -1
- package/dist/publication-filesystem.d.ts.map +1 -1
- package/dist/publication-filesystem.js +1 -1
- package/dist/publication-filesystem.js.map +1 -1
- package/dist/qualified-links.d.ts +67 -0
- package/dist/qualified-links.d.ts.map +1 -0
- package/dist/qualified-links.js +121 -0
- package/dist/qualified-links.js.map +1 -0
- package/dist/query-filter.d.ts +16 -4
- package/dist/query-filter.d.ts.map +1 -1
- package/dist/query-filter.js +44 -2
- package/dist/query-filter.js.map +1 -1
- package/dist/query-order.d.ts.map +1 -1
- package/dist/query-order.js +2 -1
- package/dist/query-order.js.map +1 -1
- package/dist/recipe-lifecycle/errors.d.ts +96 -0
- package/dist/recipe-lifecycle/errors.d.ts.map +1 -0
- package/dist/recipe-lifecycle/errors.js +122 -0
- package/dist/recipe-lifecycle/errors.js.map +1 -0
- package/dist/recipe-lifecycle/evolution.d.ts +134 -0
- package/dist/recipe-lifecycle/evolution.d.ts.map +1 -0
- package/dist/recipe-lifecycle/evolution.js +1047 -0
- package/dist/recipe-lifecycle/evolution.js.map +1 -0
- package/dist/recipe-lifecycle/index.d.ts +38 -0
- package/dist/recipe-lifecycle/index.d.ts.map +1 -0
- package/dist/recipe-lifecycle/index.js +31 -0
- package/dist/recipe-lifecycle/index.js.map +1 -0
- package/dist/recipe-lifecycle/install.d.ts +172 -0
- package/dist/recipe-lifecycle/install.d.ts.map +1 -0
- package/dist/recipe-lifecycle/install.js +652 -0
- package/dist/recipe-lifecycle/install.js.map +1 -0
- package/dist/recipe-lifecycle/legacy-aliases.d.ts +4 -0
- package/dist/recipe-lifecycle/legacy-aliases.d.ts.map +1 -0
- package/dist/recipe-lifecycle/legacy-aliases.js +22 -0
- package/dist/recipe-lifecycle/legacy-aliases.js.map +1 -0
- package/dist/recipe-lifecycle/retirement-apply.d.ts +59 -0
- package/dist/recipe-lifecycle/retirement-apply.d.ts.map +1 -0
- package/dist/recipe-lifecycle/retirement-apply.js +165 -0
- package/dist/recipe-lifecycle/retirement-apply.js.map +1 -0
- package/dist/recipe-lifecycle/retirement.d.ts +89 -0
- package/dist/recipe-lifecycle/retirement.d.ts.map +1 -0
- package/dist/recipe-lifecycle/retirement.js +347 -0
- package/dist/recipe-lifecycle/retirement.js.map +1 -0
- package/dist/recipe-lifecycle/set-commit.d.ts +31 -0
- package/dist/recipe-lifecycle/set-commit.d.ts.map +1 -0
- package/dist/recipe-lifecycle/set-commit.js +37 -0
- package/dist/recipe-lifecycle/set-commit.js.map +1 -0
- package/dist/recipe-lifecycle/stamp.d.ts +146 -0
- package/dist/recipe-lifecycle/stamp.d.ts.map +1 -0
- package/dist/recipe-lifecycle/stamp.js +361 -0
- package/dist/recipe-lifecycle/stamp.js.map +1 -0
- package/dist/recipe-qualify.d.ts +80 -0
- package/dist/recipe-qualify.d.ts.map +1 -0
- package/dist/recipe-qualify.js +352 -0
- package/dist/recipe-qualify.js.map +1 -0
- package/dist/recipe-set-preflight.d.ts +139 -0
- package/dist/recipe-set-preflight.d.ts.map +1 -0
- package/dist/recipe-set-preflight.js +536 -0
- package/dist/recipe-set-preflight.js.map +1 -0
- package/dist/recipe-sources.d.ts +209 -0
- package/dist/recipe-sources.d.ts.map +1 -0
- package/dist/recipe-sources.js +607 -0
- package/dist/recipe-sources.js.map +1 -0
- package/dist/recipes.d.ts +45 -1
- package/dist/recipes.d.ts.map +1 -1
- package/dist/recipes.js +138 -1
- package/dist/recipes.js.map +1 -1
- package/dist/record-overlay/apply.d.ts +43 -0
- package/dist/record-overlay/apply.d.ts.map +1 -0
- package/dist/record-overlay/apply.js +523 -0
- package/dist/record-overlay/apply.js.map +1 -0
- package/dist/record-overlay/canonical.d.ts +22 -0
- package/dist/record-overlay/canonical.d.ts.map +1 -0
- package/dist/record-overlay/canonical.js +47 -0
- package/dist/record-overlay/canonical.js.map +1 -0
- package/dist/record-overlay/digest.d.ts +4 -0
- package/dist/record-overlay/digest.d.ts.map +1 -0
- package/dist/record-overlay/digest.js +11 -0
- package/dist/record-overlay/digest.js.map +1 -0
- package/dist/record-overlay/errors.d.ts +44 -0
- package/dist/record-overlay/errors.d.ts.map +1 -0
- package/dist/record-overlay/errors.js +55 -0
- package/dist/record-overlay/errors.js.map +1 -0
- package/dist/record-overlay/findings.d.ts +5 -0
- package/dist/record-overlay/findings.d.ts.map +1 -0
- package/dist/record-overlay/findings.js +86 -0
- package/dist/record-overlay/findings.js.map +1 -0
- package/dist/record-overlay/index.d.ts +23 -0
- package/dist/record-overlay/index.d.ts.map +1 -0
- package/dist/record-overlay/index.js +21 -0
- package/dist/record-overlay/index.js.map +1 -0
- package/dist/record-overlay/plan.d.ts +12 -0
- package/dist/record-overlay/plan.d.ts.map +1 -0
- package/dist/record-overlay/plan.js +285 -0
- package/dist/record-overlay/plan.js.map +1 -0
- package/dist/record-overlay/policy.d.ts +74 -0
- package/dist/record-overlay/policy.d.ts.map +1 -0
- package/dist/record-overlay/policy.js +235 -0
- package/dist/record-overlay/policy.js.map +1 -0
- package/dist/record-overlay/redact.d.ts +3 -0
- package/dist/record-overlay/redact.d.ts.map +1 -0
- package/dist/record-overlay/redact.js +27 -0
- package/dist/record-overlay/redact.js.map +1 -0
- package/dist/record-overlay/signal-kind.d.ts +30 -0
- package/dist/record-overlay/signal-kind.d.ts.map +1 -0
- package/dist/record-overlay/signal-kind.js +38 -0
- package/dist/record-overlay/signal-kind.js.map +1 -0
- package/dist/record-overlay/signal-text.d.ts +52 -0
- package/dist/record-overlay/signal-text.d.ts.map +1 -0
- package/dist/record-overlay/signal-text.js +126 -0
- package/dist/record-overlay/signal-text.js.map +1 -0
- package/dist/record-overlay/source-index.d.ts +19 -0
- package/dist/record-overlay/source-index.d.ts.map +1 -0
- package/dist/record-overlay/source-index.js +102 -0
- package/dist/record-overlay/source-index.js.map +1 -0
- package/dist/record-overlay/types.d.ts +291 -0
- package/dist/record-overlay/types.d.ts.map +1 -0
- package/dist/record-overlay/types.js +2 -0
- package/dist/record-overlay/types.js.map +1 -0
- package/dist/relationships.d.ts +71 -0
- package/dist/relationships.d.ts.map +1 -0
- package/dist/relationships.js +87 -0
- package/dist/relationships.js.map +1 -0
- package/dist/remote-backend.d.ts +11 -21
- package/dist/remote-backend.d.ts.map +1 -1
- package/dist/remote-backend.js +20 -15
- package/dist/remote-backend.js.map +1 -1
- package/dist/remote-document-codec.d.ts +2 -1
- package/dist/remote-document-codec.d.ts.map +1 -1
- package/dist/remote-document-codec.js +3 -2
- package/dist/remote-document-codec.js.map +1 -1
- package/dist/remote-operations.d.ts +0 -41
- package/dist/remote-operations.d.ts.map +1 -1
- package/dist/remote-operations.js +14 -2
- package/dist/remote-operations.js.map +1 -1
- package/dist/remote-parsers.d.ts +19 -0
- package/dist/remote-parsers.d.ts.map +1 -1
- package/dist/remote-parsers.js.map +1 -1
- package/dist/remote.d.ts +2 -4
- package/dist/remote.d.ts.map +1 -1
- package/dist/remote.js +2 -3
- package/dist/remote.js.map +1 -1
- package/dist/reserved-write.d.ts +9 -0
- package/dist/reserved-write.d.ts.map +1 -0
- package/dist/reserved-write.js +15 -0
- package/dist/reserved-write.js.map +1 -0
- package/dist/search/backend-source.d.ts +6 -0
- package/dist/search/backend-source.d.ts.map +1 -0
- package/dist/search/backend-source.js +57 -0
- package/dist/search/backend-source.js.map +1 -0
- package/dist/search/contract.d.ts +162 -0
- package/dist/search/contract.d.ts.map +1 -0
- package/dist/search/contract.js +82 -0
- package/dist/search/contract.js.map +1 -0
- package/dist/search/errors.d.ts +30 -0
- package/dist/search/errors.d.ts.map +1 -0
- package/dist/search/errors.js +50 -0
- package/dist/search/errors.js.map +1 -0
- package/dist/search/identity.d.ts +12 -0
- package/dist/search/identity.d.ts.map +1 -0
- package/dist/search/identity.js +90 -0
- package/dist/search/identity.js.map +1 -0
- package/dist/search/index.d.ts +16 -0
- package/dist/search/index.d.ts.map +1 -0
- package/dist/search/index.js +15 -0
- package/dist/search/index.js.map +1 -0
- package/dist/search/memory-source.d.ts +36 -0
- package/dist/search/memory-source.d.ts.map +1 -0
- package/dist/search/memory-source.js +238 -0
- package/dist/search/memory-source.js.map +1 -0
- package/dist/search/rank.d.ts +29 -0
- package/dist/search/rank.d.ts.map +1 -0
- package/dist/search/rank.js +132 -0
- package/dist/search/rank.js.map +1 -0
- package/dist/search/row-text.d.ts +38 -0
- package/dist/search/row-text.d.ts.map +1 -0
- package/dist/search/row-text.js +88 -0
- package/dist/search/row-text.js.map +1 -0
- package/dist/search/search.d.ts +28 -0
- package/dist/search/search.d.ts.map +1 -0
- package/dist/search/search.js +265 -0
- package/dist/search/search.js.map +1 -0
- package/dist/search/source.d.ts +70 -0
- package/dist/search/source.d.ts.map +1 -0
- package/dist/search/source.js +2 -0
- package/dist/search/source.js.map +1 -0
- package/dist/search/text.d.ts +49 -0
- package/dist/search/text.d.ts.map +1 -0
- package/dist/search/text.js +165 -0
- package/dist/search/text.js.map +1 -0
- package/dist/search-index.d.ts +9 -0
- package/dist/search-index.d.ts.map +1 -0
- package/dist/search-index.js +9 -0
- package/dist/search-index.js.map +1 -0
- package/dist/sha256.d.ts.map +1 -1
- package/dist/sha256.js +3 -2
- package/dist/sha256.js.map +1 -1
- package/dist/site-capabilities.d.ts +345 -0
- package/dist/site-capabilities.d.ts.map +1 -0
- package/dist/site-capabilities.js +724 -0
- package/dist/site-capabilities.js.map +1 -0
- package/dist/site-manifest.d.ts +51 -0
- package/dist/site-manifest.d.ts.map +1 -0
- package/dist/site-manifest.js +115 -0
- package/dist/site-manifest.js.map +1 -0
- package/dist/skip-reasons.d.ts +12 -0
- package/dist/skip-reasons.d.ts.map +1 -0
- package/dist/skip-reasons.js +15 -0
- package/dist/skip-reasons.js.map +1 -0
- package/dist/source-engine/driver.d.ts +40 -0
- package/dist/source-engine/driver.d.ts.map +1 -0
- package/dist/source-engine/driver.js +513 -0
- package/dist/source-engine/driver.js.map +1 -0
- package/dist/source-engine/evidence.d.ts +39 -0
- package/dist/source-engine/evidence.d.ts.map +1 -0
- package/dist/source-engine/evidence.js +54 -0
- package/dist/source-engine/evidence.js.map +1 -0
- package/dist/source-engine/guard.d.ts +87 -0
- package/dist/source-engine/guard.d.ts.map +1 -0
- package/dist/source-engine/guard.js +427 -0
- package/dist/source-engine/guard.js.map +1 -0
- package/dist/source-engine/index.d.ts +35 -0
- package/dist/source-engine/index.d.ts.map +1 -0
- package/dist/source-engine/index.js +27 -0
- package/dist/source-engine/index.js.map +1 -0
- package/dist/source-engine/machine-state.d.ts +87 -0
- package/dist/source-engine/machine-state.d.ts.map +1 -0
- package/dist/source-engine/machine-state.js +94 -0
- package/dist/source-engine/machine-state.js.map +1 -0
- package/dist/source-engine/observe.d.ts +10 -0
- package/dist/source-engine/observe.d.ts.map +1 -0
- package/dist/source-engine/observe.js +276 -0
- package/dist/source-engine/observe.js.map +1 -0
- package/dist/source-engine/overlay.d.ts +50 -0
- package/dist/source-engine/overlay.d.ts.map +1 -0
- package/dist/source-engine/overlay.js +114 -0
- package/dist/source-engine/overlay.js.map +1 -0
- package/dist/source-engine/robots.d.ts +53 -0
- package/dist/source-engine/robots.d.ts.map +1 -0
- package/dist/source-engine/robots.js +158 -0
- package/dist/source-engine/robots.js.map +1 -0
- package/dist/source-engine/snapshot.d.ts +104 -0
- package/dist/source-engine/snapshot.d.ts.map +1 -0
- package/dist/source-engine/snapshot.js +240 -0
- package/dist/source-engine/snapshot.js.map +1 -0
- package/dist/source-engine/target-consumer.d.ts +12 -0
- package/dist/source-engine/target-consumer.d.ts.map +1 -0
- package/dist/source-engine/target-consumer.js +15 -0
- package/dist/source-engine/target-consumer.js.map +1 -0
- package/dist/source-engine/target-descriptor.d.ts +3 -0
- package/dist/source-engine/target-descriptor.d.ts.map +1 -0
- package/dist/source-engine/target-descriptor.js +26 -0
- package/dist/source-engine/target-descriptor.js.map +1 -0
- package/dist/source-engine/target.d.ts +82 -0
- package/dist/source-engine/target.d.ts.map +1 -0
- package/dist/source-engine/target.js +213 -0
- package/dist/source-engine/target.js.map +1 -0
- package/dist/source-engine/types.d.ts +296 -0
- package/dist/source-engine/types.d.ts.map +1 -0
- package/dist/source-engine/types.js +2 -0
- package/dist/source-engine/types.js.map +1 -0
- package/dist/source-harness/conformance.d.ts +16 -0
- package/dist/source-harness/conformance.d.ts.map +1 -0
- package/dist/source-harness/conformance.js +266 -0
- package/dist/source-harness/conformance.js.map +1 -0
- package/dist/source-harness/fixture.d.ts +97 -0
- package/dist/source-harness/fixture.d.ts.map +1 -0
- package/dist/source-harness/fixture.js +276 -0
- package/dist/source-harness/fixture.js.map +1 -0
- package/dist/source-harness/index.d.ts +22 -0
- package/dist/source-harness/index.d.ts.map +1 -0
- package/dist/source-harness/index.js +19 -0
- package/dist/source-harness/index.js.map +1 -0
- package/dist/source-harness/peer.d.ts +74 -0
- package/dist/source-harness/peer.d.ts.map +1 -0
- package/dist/source-harness/peer.js +106 -0
- package/dist/source-harness/peer.js.map +1 -0
- package/dist/source-profiles/index.d.ts +31 -0
- package/dist/source-profiles/index.d.ts.map +1 -0
- package/dist/source-profiles/index.js +206 -0
- package/dist/source-profiles/index.js.map +1 -0
- package/dist/source-profiles/link-header.d.ts +6 -0
- package/dist/source-profiles/link-header.d.ts.map +1 -0
- package/dist/source-profiles/link-header.js +131 -0
- package/dist/source-profiles/link-header.js.map +1 -0
- package/dist/storage-harness/contract.d.ts +109 -0
- package/dist/storage-harness/contract.d.ts.map +1 -0
- package/dist/storage-harness/contract.js +853 -0
- package/dist/storage-harness/contract.js.map +1 -0
- package/dist/storage-harness/index.d.ts +39 -0
- package/dist/storage-harness/index.d.ts.map +1 -0
- package/dist/storage-harness/index.js +55 -0
- package/dist/storage-harness/index.js.map +1 -0
- package/dist/storage.d.ts +10 -2
- package/dist/storage.d.ts.map +1 -1
- package/dist/storage.js +10 -2
- package/dist/storage.js.map +1 -1
- package/dist/string-identity-agreement.d.ts +35 -0
- package/dist/string-identity-agreement.d.ts.map +1 -0
- package/dist/string-identity-agreement.js +78 -0
- package/dist/string-identity-agreement.js.map +1 -0
- package/dist/system-documents.d.ts +82 -0
- package/dist/system-documents.d.ts.map +1 -0
- package/dist/system-documents.js +127 -0
- package/dist/system-documents.js.map +1 -0
- package/dist/types.d.ts +45 -4
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +0 -10
- package/dist/types.js.map +1 -1
- package/dist/uncertain-write.d.ts +119 -6
- package/dist/uncertain-write.d.ts.map +1 -1
- package/dist/uncertain-write.js +67 -32
- package/dist/uncertain-write.js.map +1 -1
- package/dist/validation.d.ts +5 -0
- package/dist/validation.d.ts.map +1 -1
- package/dist/verification.d.ts +22 -10
- package/dist/verification.d.ts.map +1 -1
- package/dist/verification.js +87 -39
- package/dist/verification.js.map +1 -1
- package/dist/view-launch-contract.d.ts +14 -0
- package/dist/view-launch-contract.d.ts.map +1 -0
- package/dist/view-launch-contract.js +23 -0
- package/dist/view-launch-contract.js.map +1 -0
- package/dist/write-identity.d.ts +5 -0
- package/dist/write-identity.d.ts.map +1 -0
- package/dist/write-identity.js +9 -0
- package/dist/write-identity.js.map +1 -0
- package/package.json +188 -10
package/dist/kinds.js
CHANGED
|
@@ -20,23 +20,42 @@
|
|
|
20
20
|
* convention-doc (de)serialization) is dependency-free — this module carries ONLY that, and is
|
|
21
21
|
* exported as the browser-safe `@superbee/core/kinds` subpath (the ui shell's bridge
|
|
22
22
|
* `open` filter consumes `isTerminal` there; a browser bundler must never be dragged through the
|
|
23
|
-
* engine's node built-ins for a pure predicate). The
|
|
24
|
-
* `
|
|
23
|
+
* engine's node built-ins for a pure predicate). The bundle read, `loadKinds`, lives in
|
|
24
|
+
* `kinds-load.ts`, which reads through `bundle-ops.ts` and is browser-safe too: the split is
|
|
25
|
+
* between pure parsing and the bundle read, over the same ONE registry.
|
|
25
26
|
*/
|
|
27
|
+
import { parseKindDeprecation, kindDeprecationProblems } from "./kind-deprecation.js";
|
|
28
|
+
import { CONVENTION_TYPE } from "./convention-record.js";
|
|
29
|
+
export { CONVENTION_TYPE, CONVENTIONS_PREFIX, isConventionId, isConventionRecord } from "./convention-record.js";
|
|
30
|
+
export { inspectKindDeprecatedUsage, kindDeprecationTransition, kindDeprecationProblems } from "./kind-deprecation.js";
|
|
26
31
|
import { isOkfLifecycleStatus, OKF_LIFECYCLE_STATUSES } from "./okf-lifecycle.js";
|
|
27
32
|
import { isUsableTimestamp } from "./frontmatter.js";
|
|
28
|
-
|
|
29
|
-
export const CONVENTIONS_PREFIX = "conventions/";
|
|
33
|
+
import { parseIsoInstant } from "./verification.js";
|
|
30
34
|
/**
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
35
|
+
* The closed, domain-neutral value-type vocabulary a convention may declare in `fields.types`.
|
|
36
|
+
* Each type constrains a value's shape only; presence stays governed by `fields.required`.
|
|
37
|
+
* Domain composites (opening hours, money, addresses) belong to recipe tooling, not core.
|
|
34
38
|
*/
|
|
35
|
-
export
|
|
36
|
-
|
|
39
|
+
export const KIND_FIELD_TYPES = [
|
|
40
|
+
"date",
|
|
41
|
+
"datetime",
|
|
42
|
+
"https-url",
|
|
43
|
+
"https-url-list",
|
|
44
|
+
"integer",
|
|
45
|
+
"number",
|
|
46
|
+
"boolean",
|
|
47
|
+
"slug",
|
|
48
|
+
"string-list",
|
|
49
|
+
"latitude",
|
|
50
|
+
"longitude",
|
|
51
|
+
];
|
|
52
|
+
const KIND_FIELD_TYPE_SET = new Set(KIND_FIELD_TYPES);
|
|
53
|
+
/** True when `value` names a {@link KIND_FIELD_TYPES} member. */
|
|
54
|
+
export function isKindFieldType(value) {
|
|
55
|
+
return typeof value === "string" && KIND_FIELD_TYPE_SET.has(value);
|
|
37
56
|
}
|
|
38
|
-
/** The
|
|
39
|
-
export const
|
|
57
|
+
/** The two declared write policies for keys a kind does not declare. */
|
|
58
|
+
export const UNDECLARED_FIELDS_POLICIES = ["warn", "error"];
|
|
40
59
|
/**
|
|
41
60
|
* Build the one authoritative Kind registry from already-selected convention documents.
|
|
42
61
|
* Callers own discovery; this pure half owns parsing, warnings, and first-by-id duplicate
|
|
@@ -88,6 +107,8 @@ export function buildKindRegistry(docs, initialWarnings = [], options = {}) {
|
|
|
88
107
|
}
|
|
89
108
|
accepted.set(kind.governs, kind);
|
|
90
109
|
}
|
|
110
|
+
for (const kind of accepted.values())
|
|
111
|
+
warnings.push(...kindDeprecationProblems(kind, { kinds: accepted, warnings: [] }).filter(w => !warnings.includes(w)));
|
|
91
112
|
const kinds = new Map();
|
|
92
113
|
for (const kind of [...accepted.values()].sort(compareReadingOrder))
|
|
93
114
|
kinds.set(kind.governs, kind);
|
|
@@ -116,7 +137,7 @@ export function progressStatusStorageField(okfVersion) {
|
|
|
116
137
|
const version = okfVersion?.trim() || "0.1";
|
|
117
138
|
if (version === "0.1")
|
|
118
139
|
return "status";
|
|
119
|
-
if (version === "0.2")
|
|
140
|
+
if (version === "0.2" || version === "0.3")
|
|
120
141
|
return SUPERBEE_PROGRESS_STATUS_FIELD;
|
|
121
142
|
return undefined;
|
|
122
143
|
}
|
|
@@ -221,6 +242,7 @@ export function projectKindForAuthoring(okfVersion, kind) {
|
|
|
221
242
|
};
|
|
222
243
|
return {
|
|
223
244
|
...kind,
|
|
245
|
+
...(kind.deprecated ? { deprecated: { ...kind.deprecated, fields: kind.deprecated.fields.map(projectField), values: projectRecord(kind.deprecated.values) } } : {}),
|
|
224
246
|
fields: {
|
|
225
247
|
required: kind.fields.required.map(projectField),
|
|
226
248
|
optional: kind.fields.optional.map(projectField),
|
|
@@ -230,25 +252,81 @@ export function projectKindForAuthoring(okfVersion, kind) {
|
|
|
230
252
|
: undefined,
|
|
231
253
|
terminal: projectRecord(kind.fields.terminal),
|
|
232
254
|
descriptions: projectRecord(kind.fields.descriptions),
|
|
255
|
+
...(kind.fields.types ? { types: projectRecord(kind.fields.types) } : {}),
|
|
233
256
|
},
|
|
234
257
|
};
|
|
235
258
|
}
|
|
259
|
+
/** Whether a Kind finding names a frontmatter coordinate rather than a body heading. */
|
|
260
|
+
export function isKindFieldValidationWarning(warning) {
|
|
261
|
+
return warning.code === "KIND_FIELD_MISSING"
|
|
262
|
+
|| warning.code === "KIND_FIELD_VALUE"
|
|
263
|
+
|| warning.code === "KIND_FIELD_ARITY"
|
|
264
|
+
|| warning.code === "KIND_FIELD_TYPE";
|
|
265
|
+
}
|
|
266
|
+
/** The owning message grammar separates the field coordinate from Kind labels and value suffixes. */
|
|
267
|
+
function kindFieldWarningPrefix(code, kind, field) {
|
|
268
|
+
switch (code) {
|
|
269
|
+
case "KIND_FIELD_MISSING":
|
|
270
|
+
return `'${kind.governs}' requires a non-empty '${field}' field `;
|
|
271
|
+
case "KIND_FIELD_VALUE":
|
|
272
|
+
return `'${field}' value `;
|
|
273
|
+
case "KIND_FIELD_ARITY":
|
|
274
|
+
return `'${field}' is enum-restricted and takes exactly ONE value for '${kind.governs}'; `;
|
|
275
|
+
case "KIND_FIELD_TYPE":
|
|
276
|
+
return `'${field}' must be `;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
236
279
|
/** Project Kind-validation findings into the same authoring vocabulary as the Kind schema. */
|
|
237
280
|
export function projectKindValidationWarnings(okfVersion, kind, warnings) {
|
|
238
281
|
const progress = progressStatusCoordinate(okfVersion, kind);
|
|
239
282
|
if (!progress)
|
|
240
283
|
return warnings;
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
284
|
+
return warnings.map((warning) => {
|
|
285
|
+
if (!isKindFieldValidationWarning(warning) || warning.field !== progress.storageField)
|
|
286
|
+
return warning;
|
|
287
|
+
const storedPrefix = kindFieldWarningPrefix(warning.code, kind, progress.storageField);
|
|
288
|
+
const logicalPrefix = kindFieldWarningPrefix(warning.code, kind, progress.logicalField);
|
|
289
|
+
return {
|
|
245
290
|
...warning,
|
|
246
291
|
field: progress.logicalField,
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
292
|
+
message: warning.message.startsWith(storedPrefix)
|
|
293
|
+
? logicalPrefix + warning.message.slice(storedPrefix.length)
|
|
294
|
+
: warning.message,
|
|
295
|
+
};
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
/**
|
|
299
|
+
* Advisory write-time guidance: for each enum field whose governing Kind declares
|
|
300
|
+
* `fields.value_descriptions`, return the description of every value `after` carries that
|
|
301
|
+
* `before` did not. A create passes `before: undefined`, so every described value it sets applies.
|
|
302
|
+
* Unchanged values, undescribed values and ungoverned documents yield nothing. Field names are
|
|
303
|
+
* projected through the same progress coordinate as {@link projectKindValidationWarnings}.
|
|
304
|
+
*/
|
|
305
|
+
export function kindValueGuidance(okfVersion, kind, before, after) {
|
|
306
|
+
const described = kind?.fields.valueDescriptions;
|
|
307
|
+
if (!kind || !described)
|
|
308
|
+
return [];
|
|
309
|
+
const progress = progressStatusCoordinate(okfVersion, kind);
|
|
310
|
+
const valuesOf = (frontmatter, field) => {
|
|
311
|
+
const fm = frontmatter;
|
|
312
|
+
if (!fm || !hasOwn(fm, field))
|
|
313
|
+
return [];
|
|
314
|
+
const raw = fm[field];
|
|
315
|
+
if (raw === undefined || raw === null)
|
|
316
|
+
return [];
|
|
317
|
+
return (Array.isArray(raw) ? raw : [raw]).map((value) => String(value));
|
|
318
|
+
};
|
|
319
|
+
const guidance = [];
|
|
320
|
+
for (const [storageField, descriptions] of Object.entries(described)) {
|
|
321
|
+
const previous = new Set(valuesOf(before, storageField));
|
|
322
|
+
const field = progress && storageField === progress.storageField ? progress.logicalField : storageField;
|
|
323
|
+
for (const value of new Set(valuesOf(after, storageField))) {
|
|
324
|
+
if (previous.has(value) || !hasOwn(descriptions, value))
|
|
325
|
+
continue;
|
|
326
|
+
guidance.push({ field, value, description: descriptions[value] });
|
|
250
327
|
}
|
|
251
|
-
|
|
328
|
+
}
|
|
329
|
+
return guidance;
|
|
252
330
|
}
|
|
253
331
|
/** True for a plain YAML/JSON map (excludes arrays, `null`, dates, and other object instances). */
|
|
254
332
|
function isPlainObject(value) {
|
|
@@ -335,7 +413,18 @@ const VALID_FIELDS_KEYS = new Set([
|
|
|
335
413
|
"value_descriptions",
|
|
336
414
|
"terminal",
|
|
337
415
|
"descriptions",
|
|
416
|
+
"types",
|
|
338
417
|
]);
|
|
418
|
+
/** Replace the declarations understood by Core while retaining extension values. */
|
|
419
|
+
export function replaceConventionFieldDeclarations(current, draft) {
|
|
420
|
+
const extensions = isPlainObject(current)
|
|
421
|
+
? Object.entries(current).filter(([key]) => !VALID_FIELDS_KEYS.has(key))
|
|
422
|
+
: [];
|
|
423
|
+
return Object.fromEntries([
|
|
424
|
+
...extensions,
|
|
425
|
+
...(isPlainObject(draft) ? Object.entries(draft) : []),
|
|
426
|
+
]);
|
|
427
|
+
}
|
|
339
428
|
/**
|
|
340
429
|
* Top-level convention-doc keys that are near-misses for the ONE correct enum-constraint shape
|
|
341
430
|
* (`fields.values.<field>: [...]`) — the exact wrong shapes agents commonly reach for
|
|
@@ -409,7 +498,7 @@ export function parseConventionDoc(doc, options = {}) {
|
|
|
409
498
|
if (!VALID_FIELDS_KEYS.has(key)) {
|
|
410
499
|
warnings.push({
|
|
411
500
|
code: "KIND_CONVENTION_UNKNOWN_FIELDS_KEY",
|
|
412
|
-
message: `kind convention '${doc.id}' declares an unrecognized key 'fields.${key}' (valid keys: fields.required, fields.optional, fields.values, fields.value_descriptions, fields.terminal, fields.descriptions); ignoring it.`,
|
|
501
|
+
message: `kind convention '${doc.id}' declares an unrecognized key 'fields.${key}' (valid keys: fields.required, fields.optional, fields.values, fields.value_descriptions, fields.terminal, fields.descriptions, fields.types); ignoring it.`,
|
|
413
502
|
field: `fields.${key}`,
|
|
414
503
|
severity: "warning",
|
|
415
504
|
});
|
|
@@ -446,10 +535,10 @@ export function parseConventionDoc(doc, options = {}) {
|
|
|
446
535
|
}
|
|
447
536
|
}
|
|
448
537
|
}
|
|
449
|
-
if (options.okfVersion === "0.2" && values.status?.some(value => !isOkfLifecycleStatus(value))) {
|
|
538
|
+
if ((options.okfVersion === "0.2" || options.okfVersion === "0.3") && values.status?.some(value => !isOkfLifecycleStatus(value))) {
|
|
450
539
|
warnings.push({
|
|
451
540
|
code: "OKF_WORKFLOW_STATUS_COLLISION",
|
|
452
|
-
message: `kind convention '${doc.id}' declares 'fields.values.status' with values outside the OKF
|
|
541
|
+
message: `kind convention '${doc.id}' declares 'fields.values.status' with values outside the OKF v${options.okfVersion} lifecycle (${OKF_LIFECYCLE_STATUSES.join(", ")}); instance authoring rejects those values. Move workflow state to 'superbee_progress_status' (CLI '--progress_status') and migrate its required/optional, descriptions, values, value_descriptions, terminal declarations and instances.`,
|
|
453
542
|
field: "fields.values.status",
|
|
454
543
|
severity: "warning",
|
|
455
544
|
});
|
|
@@ -469,6 +558,60 @@ export function parseConventionDoc(doc, options = {}) {
|
|
|
469
558
|
});
|
|
470
559
|
}
|
|
471
560
|
}
|
|
561
|
+
// `fields.types` — declared value types from the closed KIND_FIELD_TYPES vocabulary. Same lenient
|
|
562
|
+
// posture as `fields.values`: a non-map shape warns and is ignored, an unknown type or a typed
|
|
563
|
+
// field the kind does not declare warns and is skipped. A definitions-only recipe therefore
|
|
564
|
+
// refuses a misspelled type instead of installing a constraint that can never fire.
|
|
565
|
+
const typesSource = fieldsRaw.types;
|
|
566
|
+
const types = {};
|
|
567
|
+
if (typesSource !== undefined) {
|
|
568
|
+
if (!isPlainObject(typesSource)) {
|
|
569
|
+
warnings.push({
|
|
570
|
+
code: "KIND_CONVENTION_BAD_SHAPE",
|
|
571
|
+
message: `kind convention '${doc.id}' has a non-map 'fields.types' (${describeShape(typesSource)}; expected a map of field name -> type); ignoring it.`,
|
|
572
|
+
field: "fields.types",
|
|
573
|
+
severity: "warning",
|
|
574
|
+
});
|
|
575
|
+
}
|
|
576
|
+
else {
|
|
577
|
+
for (const [field, declared] of Object.entries(typesSource)) {
|
|
578
|
+
if (dropReserved(field, `fields.types.${field}`))
|
|
579
|
+
continue;
|
|
580
|
+
if (!isKindFieldType(declared)) {
|
|
581
|
+
warnings.push({
|
|
582
|
+
code: "KIND_CONVENTION_UNKNOWN_FIELD_TYPE",
|
|
583
|
+
message: `kind convention '${doc.id}' declares 'fields.types.${field}' as ${isScalar(declared) ? `'${String(declared)}'` : describeShape(declared)}, which is not a field type (valid types: ${KIND_FIELD_TYPES.join(", ")}); ignoring it.`,
|
|
584
|
+
field: `fields.types.${field}`,
|
|
585
|
+
severity: "warning",
|
|
586
|
+
});
|
|
587
|
+
continue;
|
|
588
|
+
}
|
|
589
|
+
if (!declaredFieldNames.has(field)) {
|
|
590
|
+
warnings.push({
|
|
591
|
+
code: "KIND_CONVENTION_UNDECLARED_TYPES_FIELD",
|
|
592
|
+
message: `kind convention '${doc.id}' declares 'fields.types.${field}' but '${field}' is not in fields.required or fields.optional; ignoring it.`,
|
|
593
|
+
field: `fields.types.${field}`,
|
|
594
|
+
severity: "warning",
|
|
595
|
+
});
|
|
596
|
+
continue;
|
|
597
|
+
}
|
|
598
|
+
setOwn(types, field, declared);
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
// An enum over URLs is never meaningful, so values on an `https-url-list` field are skipped. Every
|
|
603
|
+
// other typed field may carry `fields.values`: a scalar picks one, a `string-list` checks each item.
|
|
604
|
+
for (const field of Object.keys(values)) {
|
|
605
|
+
if (types[field] !== "https-url-list")
|
|
606
|
+
continue;
|
|
607
|
+
warnings.push({
|
|
608
|
+
code: "KIND_CONVENTION_VALUES_TYPE_MISMATCH",
|
|
609
|
+
message: `kind convention '${doc.id}' declares 'fields.values.${field}' on a field of type 'https-url-list', which cannot carry an enum; ignoring the values.`,
|
|
610
|
+
field: `fields.values.${field}`,
|
|
611
|
+
severity: "warning",
|
|
612
|
+
});
|
|
613
|
+
delete values[field];
|
|
614
|
+
}
|
|
472
615
|
const valueDescriptionsSource = fieldsRaw.value_descriptions;
|
|
473
616
|
const valueDescriptions = {};
|
|
474
617
|
if (valueDescriptionsSource !== undefined) {
|
|
@@ -802,12 +945,28 @@ export function parseConventionDoc(doc, options = {}) {
|
|
|
802
945
|
});
|
|
803
946
|
}
|
|
804
947
|
}
|
|
948
|
+
let undeclaredFields;
|
|
949
|
+
if (fm.undeclared_fields !== undefined) {
|
|
950
|
+
if (UNDECLARED_FIELDS_POLICIES.includes(fm.undeclared_fields)) {
|
|
951
|
+
undeclaredFields = fm.undeclared_fields;
|
|
952
|
+
}
|
|
953
|
+
else {
|
|
954
|
+
warnings.push({
|
|
955
|
+
code: "KIND_CONVENTION_BAD_SHAPE",
|
|
956
|
+
message: `kind convention '${doc.id}' has an invalid 'undeclared_fields' (${describeShape(fm.undeclared_fields)}; expected warn or error); using warn.`,
|
|
957
|
+
field: "undeclared_fields",
|
|
958
|
+
severity: "warning",
|
|
959
|
+
});
|
|
960
|
+
}
|
|
961
|
+
}
|
|
805
962
|
const kind = {
|
|
806
963
|
id: doc.id,
|
|
807
964
|
title,
|
|
808
965
|
governs,
|
|
809
966
|
fields: { required, optional, values, valueDescriptions, terminal, descriptions },
|
|
810
967
|
};
|
|
968
|
+
if (Object.keys(types).length > 0)
|
|
969
|
+
kind.fields.types = types;
|
|
811
970
|
if (description !== undefined)
|
|
812
971
|
kind.description = description;
|
|
813
972
|
if (path !== undefined)
|
|
@@ -828,6 +987,12 @@ export function parseConventionDoc(doc, options = {}) {
|
|
|
828
987
|
kind.order = order;
|
|
829
988
|
if (claim !== undefined)
|
|
830
989
|
kind.claim = claim;
|
|
990
|
+
if (undeclaredFields !== undefined)
|
|
991
|
+
kind.undeclaredFields = undeclaredFields;
|
|
992
|
+
if (Object.hasOwn(fm, "deprecated")) {
|
|
993
|
+
kind.deprecated = parseKindDeprecation(fm.deprecated, kind, RESERVED_KIND_FIELD_NAMES, claimCoordinates(options.okfVersion, kind)?.fields ?? []);
|
|
994
|
+
warnings.push(...(kind.deprecated.problems ?? []));
|
|
995
|
+
}
|
|
831
996
|
return {
|
|
832
997
|
ok: true,
|
|
833
998
|
kind,
|
|
@@ -872,9 +1037,155 @@ export function isPresent(value) {
|
|
|
872
1037
|
return value.length > 0;
|
|
873
1038
|
return true;
|
|
874
1039
|
}
|
|
1040
|
+
/** Human phrase for each field type, used in warnings and authoring help. */
|
|
1041
|
+
export const KIND_FIELD_TYPE_DESCRIPTIONS = {
|
|
1042
|
+
date: "a YYYY-MM-DD calendar date",
|
|
1043
|
+
datetime: "an ISO-8601 date and time with an explicit UTC offset (Z or +/-HH:MM)",
|
|
1044
|
+
"https-url": "an absolute https URL of at most 2048 characters, without credentials",
|
|
1045
|
+
"https-url-list": "a list of distinct https URLs",
|
|
1046
|
+
integer: "a safe integer",
|
|
1047
|
+
number: "a finite number",
|
|
1048
|
+
boolean: "true or false",
|
|
1049
|
+
slug: "a lowercase slug (a-z, 0-9 and single hyphens) of at most 200 characters",
|
|
1050
|
+
"string-list": "a list of distinct non-empty strings",
|
|
1051
|
+
latitude: "a number from -90 to 90",
|
|
1052
|
+
longitude: "a number from -180 to 180",
|
|
1053
|
+
};
|
|
1054
|
+
const DATE_RE = /^(\d{4})-(\d{2})-(\d{2})$/;
|
|
1055
|
+
const SLUG_RE = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
|
|
1056
|
+
const SLUG_MAX_LENGTH = 200;
|
|
1057
|
+
const HTTPS_URL_MAX_LENGTH = 2048;
|
|
1058
|
+
const HTTPS_PREFIX_RE = /^https:\/\//i;
|
|
1059
|
+
const CONTROL_CHARACTER_RE = /[\u0000-\u001F\u007F]/;
|
|
1060
|
+
function describeValue(value) {
|
|
1061
|
+
if (typeof value === "string")
|
|
1062
|
+
return `got the string ${JSON.stringify(value.length > 60 ? `${value.slice(0, 57)}...` : value)}`;
|
|
1063
|
+
if (typeof value === "number")
|
|
1064
|
+
return `got the number ${Object.is(value, -0) ? "-0" : String(value)}`;
|
|
1065
|
+
if (typeof value === "boolean")
|
|
1066
|
+
return `got boolean ${String(value)}`;
|
|
1067
|
+
return `got ${describeShape(value)}`;
|
|
1068
|
+
}
|
|
1069
|
+
function httpsUrlProblem(value) {
|
|
1070
|
+
if (typeof value !== "string" || value.length > HTTPS_URL_MAX_LENGTH || /\s/.test(value))
|
|
1071
|
+
return describeValue(value);
|
|
1072
|
+
// WHATWG strips control characters and repairs `https:x`, `https:/x` and `https:\\x` into a host,
|
|
1073
|
+
// so the authored text must already be an absolute `https://` URL with no control characters.
|
|
1074
|
+
if (!HTTPS_PREFIX_RE.test(value) || CONTROL_CHARACTER_RE.test(value))
|
|
1075
|
+
return describeValue(value);
|
|
1076
|
+
// The WHATWG parser is the authority for the rest, so scheme case is irrelevant (`HTTPS://` is https).
|
|
1077
|
+
let parsed;
|
|
1078
|
+
try {
|
|
1079
|
+
parsed = new URL(value);
|
|
1080
|
+
}
|
|
1081
|
+
catch {
|
|
1082
|
+
return describeValue(value);
|
|
1083
|
+
}
|
|
1084
|
+
if (parsed.protocol !== "https:" || parsed.hostname === "")
|
|
1085
|
+
return describeValue(value);
|
|
1086
|
+
if (parsed.username !== "" || parsed.password !== "")
|
|
1087
|
+
return `${describeValue(value)} (credentials are not allowed)`;
|
|
1088
|
+
return undefined;
|
|
1089
|
+
}
|
|
1090
|
+
function listProblem(value, itemProblem) {
|
|
1091
|
+
if (!Array.isArray(value))
|
|
1092
|
+
return describeValue(value);
|
|
1093
|
+
const seen = new Set();
|
|
1094
|
+
for (const [index, item] of value.entries()) {
|
|
1095
|
+
const problem = itemProblem(item);
|
|
1096
|
+
if (problem !== undefined)
|
|
1097
|
+
return `item ${index} ${problem}`;
|
|
1098
|
+
if (seen.has(item))
|
|
1099
|
+
return `item ${index} repeats ${JSON.stringify(item)}`;
|
|
1100
|
+
seen.add(item);
|
|
1101
|
+
}
|
|
1102
|
+
return undefined;
|
|
1103
|
+
}
|
|
1104
|
+
/**
|
|
1105
|
+
* Why `value` does not satisfy `type`, or `undefined` when it does. Values are judged as decoded:
|
|
1106
|
+
* YAML numbers and booleans, and strings exactly as authored (core's decoder keeps dates and
|
|
1107
|
+
* instants as their source strings). `null` never satisfies a type. The ONE type predicate;
|
|
1108
|
+
* callers never re-implement it.
|
|
1109
|
+
*/
|
|
1110
|
+
export function kindFieldTypeProblem(type, value) {
|
|
1111
|
+
switch (type) {
|
|
1112
|
+
case "date": {
|
|
1113
|
+
const match = typeof value === "string" ? DATE_RE.exec(value) : null;
|
|
1114
|
+
if (!match)
|
|
1115
|
+
return describeValue(value);
|
|
1116
|
+
const probe = new Date(0);
|
|
1117
|
+
probe.setUTCFullYear(Number(match[1]), Number(match[2]), 0); // day 0 of the next month
|
|
1118
|
+
const month = Number(match[2]);
|
|
1119
|
+
const day = Number(match[3]);
|
|
1120
|
+
return month >= 1 && month <= 12 && day >= 1 && day <= probe.getUTCDate() ? undefined : describeValue(value);
|
|
1121
|
+
}
|
|
1122
|
+
case "datetime":
|
|
1123
|
+
// Exactly the OKF standard-timestamp instant grammar.
|
|
1124
|
+
return typeof value === "string" && parseIsoInstant(value) !== null ? undefined : describeValue(value);
|
|
1125
|
+
case "https-url":
|
|
1126
|
+
return httpsUrlProblem(value);
|
|
1127
|
+
case "https-url-list":
|
|
1128
|
+
return listProblem(value, httpsUrlProblem);
|
|
1129
|
+
case "integer":
|
|
1130
|
+
return Number.isSafeInteger(value) && !Object.is(value, -0) ? undefined : describeValue(value);
|
|
1131
|
+
case "number":
|
|
1132
|
+
return typeof value === "number" && Number.isFinite(value) ? undefined : describeValue(value);
|
|
1133
|
+
case "boolean":
|
|
1134
|
+
return typeof value === "boolean" ? undefined : describeValue(value);
|
|
1135
|
+
case "slug":
|
|
1136
|
+
return typeof value === "string" && value.length <= SLUG_MAX_LENGTH && SLUG_RE.test(value)
|
|
1137
|
+
? undefined
|
|
1138
|
+
: describeValue(value);
|
|
1139
|
+
case "string-list":
|
|
1140
|
+
return listProblem(value, (item) => (typeof item === "string" && item !== "" ? undefined : describeValue(item)));
|
|
1141
|
+
case "latitude":
|
|
1142
|
+
case "longitude": {
|
|
1143
|
+
const limit = type === "latitude" ? 90 : 180;
|
|
1144
|
+
return typeof value === "number" && Number.isFinite(value) && value >= -limit && value <= limit
|
|
1145
|
+
? undefined
|
|
1146
|
+
: describeValue(value);
|
|
1147
|
+
}
|
|
1148
|
+
}
|
|
1149
|
+
}
|
|
1150
|
+
/** Whether a Kind declares `field` (a storage name) as one of the two list types, `string-list` or `https-url-list`. */
|
|
1151
|
+
export function isKindListField(kind, field) {
|
|
1152
|
+
const types = kind?.fields.types;
|
|
1153
|
+
if (!types || !hasOwn(types, field))
|
|
1154
|
+
return false;
|
|
1155
|
+
return types[field] === "string-list" || types[field] === "https-url-list";
|
|
1156
|
+
}
|
|
1157
|
+
const NUMBER_INPUT_RE = /^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?$/;
|
|
1158
|
+
const INTEGER_INPUT_RE = /^[+-]?\d+$/;
|
|
1159
|
+
/**
|
|
1160
|
+
* Convert command-line flag text for a declared field into its typed value: numeric types become
|
|
1161
|
+
* numbers, `boolean` accepts exactly `true`/`false`, and both list types are always a list. Text that
|
|
1162
|
+
* does not parse is returned unchanged so {@link validateAgainstKind} reports it, never guessed.
|
|
1163
|
+
* Undeclared or untyped fields keep the historical one-value-scalar, repeated-flag-list shape.
|
|
1164
|
+
*/
|
|
1165
|
+
export function kindFieldInputValue(kind, field, inputs) {
|
|
1166
|
+
const type = kind.fields.types && hasOwn(kind.fields.types, field) ? kind.fields.types[field] : undefined;
|
|
1167
|
+
if (type === "string-list" || type === "https-url-list")
|
|
1168
|
+
return [...inputs];
|
|
1169
|
+
if (inputs.length !== 1)
|
|
1170
|
+
return [...inputs];
|
|
1171
|
+
const text = inputs[0];
|
|
1172
|
+
switch (type) {
|
|
1173
|
+
case "number":
|
|
1174
|
+
case "latitude":
|
|
1175
|
+
case "longitude":
|
|
1176
|
+
return NUMBER_INPUT_RE.test(text.trim()) ? Number(text.trim()) : text;
|
|
1177
|
+
case "integer":
|
|
1178
|
+
return INTEGER_INPUT_RE.test(text.trim()) ? Number(text.trim()) : text;
|
|
1179
|
+
case "boolean":
|
|
1180
|
+
return text === "true" ? true : text === "false" ? false : text;
|
|
1181
|
+
default:
|
|
1182
|
+
return text;
|
|
1183
|
+
}
|
|
1184
|
+
}
|
|
875
1185
|
/**
|
|
876
1186
|
* Validate `doc` against `kind`: required fields present + non-empty, enum-restricted
|
|
877
|
-
* field values within the declared allowed set,
|
|
1187
|
+
* field values within the declared allowed set, typed field values of their declared
|
|
1188
|
+
* `fields.types` type, and declared body `sections` present
|
|
878
1189
|
* (reusing the ONE heading splitter, {@link splitSections} — no second heading parser).
|
|
879
1190
|
* Returns core's EXISTING {@link ValidationWarning} shape; never throws. Purely
|
|
880
1191
|
* additive derivation — callers (the CLI) decide whether a warning blocks a write.
|
|
@@ -886,7 +1197,7 @@ export function validateAgainstKind(doc, kind) {
|
|
|
886
1197
|
if (!hasOwn(fm, field) || !isPresent(fm[field])) {
|
|
887
1198
|
warnings.push({
|
|
888
1199
|
code: "KIND_FIELD_MISSING",
|
|
889
|
-
message:
|
|
1200
|
+
message: kindFieldWarningPrefix("KIND_FIELD_MISSING", kind, field) + `(declared by ${kind.id}).`,
|
|
890
1201
|
field,
|
|
891
1202
|
severity: "warning",
|
|
892
1203
|
});
|
|
@@ -907,10 +1218,11 @@ export function validateAgainstKind(doc, kind) {
|
|
|
907
1218
|
// validation locus, every consumer inherits: `new`, `doc update`, `doc write
|
|
908
1219
|
// --strict`, `status`'s bundle lint). A future kind wanting a multi-select enum
|
|
909
1220
|
// needs declared arity in the convention schema — not silently via arrays.
|
|
910
|
-
|
|
1221
|
+
// A `string-list` field declares its arity, so its enum checks each item instead.
|
|
1222
|
+
if (Array.isArray(raw) && kind.fields.types?.[field] !== "string-list") {
|
|
911
1223
|
warnings.push({
|
|
912
1224
|
code: "KIND_FIELD_ARITY",
|
|
913
|
-
message:
|
|
1225
|
+
message: kindFieldWarningPrefix("KIND_FIELD_ARITY", kind, field) +
|
|
914
1226
|
`got ${raw.length} (${raw.map((v) => String(v)).join(", ")}).`,
|
|
915
1227
|
field,
|
|
916
1228
|
severity: "warning",
|
|
@@ -922,13 +1234,30 @@ export function validateAgainstKind(doc, kind) {
|
|
|
922
1234
|
if (!allowedStrs.includes(v)) {
|
|
923
1235
|
warnings.push({
|
|
924
1236
|
code: "KIND_FIELD_VALUE",
|
|
925
|
-
message:
|
|
1237
|
+
message: kindFieldWarningPrefix("KIND_FIELD_VALUE", kind, field) + `'${v}' is not one of the allowed values for '${kind.governs}': ${allowedStrs.join(", ")}.`,
|
|
926
1238
|
field,
|
|
927
1239
|
severity: "warning",
|
|
928
1240
|
});
|
|
929
1241
|
}
|
|
930
1242
|
}
|
|
931
1243
|
}
|
|
1244
|
+
for (const [field, type] of Object.entries(kind.fields.types ?? {})) {
|
|
1245
|
+
if (!hasOwn(fm, field))
|
|
1246
|
+
continue;
|
|
1247
|
+
const raw = fm[field];
|
|
1248
|
+
// An absent field is presence, owned by `fields.required`; an explicit `null` is a wrong type.
|
|
1249
|
+
if (raw === undefined)
|
|
1250
|
+
continue;
|
|
1251
|
+
const problem = kindFieldTypeProblem(type, raw);
|
|
1252
|
+
if (problem !== undefined) {
|
|
1253
|
+
warnings.push({
|
|
1254
|
+
code: "KIND_FIELD_TYPE",
|
|
1255
|
+
message: kindFieldWarningPrefix("KIND_FIELD_TYPE", kind, field) + `${KIND_FIELD_TYPE_DESCRIPTIONS[type]} for '${kind.governs}'; ${problem}.`,
|
|
1256
|
+
field,
|
|
1257
|
+
severity: "warning",
|
|
1258
|
+
});
|
|
1259
|
+
}
|
|
1260
|
+
}
|
|
932
1261
|
if (kind.sections && kind.sections.length > 0) {
|
|
933
1262
|
const sections = splitSections(doc.body ?? "");
|
|
934
1263
|
for (const heading of kind.sections) {
|
|
@@ -952,9 +1281,10 @@ export function validateAgainstKind(doc, kind) {
|
|
|
952
1281
|
*/
|
|
953
1282
|
export function defaultTimestampAndValidateAgainstRegistry(doc, registry, options = {}) {
|
|
954
1283
|
const kind = registry.kinds.get(String(doc.frontmatter.type));
|
|
955
|
-
const
|
|
1284
|
+
const hasGenerationClock = options.okfVersion === "0.2" || options.okfVersion === "0.3";
|
|
1285
|
+
const shouldDefaultTimestamp = !hasGenerationClock
|
|
956
1286
|
|| kind?.fields.required.includes("timestamp") === true;
|
|
957
|
-
if (shouldDefaultTimestamp && (
|
|
1287
|
+
if (shouldDefaultTimestamp && (hasGenerationClock
|
|
958
1288
|
? !Object.hasOwn(doc.frontmatter, "timestamp")
|
|
959
1289
|
: !isUsableTimestamp(doc.frontmatter.timestamp))) {
|
|
960
1290
|
doc.frontmatter.timestamp = (options.now ?? (() => new Date().toISOString()))();
|
|
@@ -1020,6 +1350,9 @@ export function kindConventionDoc(kind, prose, timestamp) {
|
|
|
1020
1350
|
.map(([field, description]) => [field, description.trim()]));
|
|
1021
1351
|
if (Object.keys(descriptions).length > 0)
|
|
1022
1352
|
fields.descriptions = descriptions;
|
|
1353
|
+
const types = Object.fromEntries(Object.entries(kind.fields.types ?? {}).filter(([, type]) => isKindFieldType(type)));
|
|
1354
|
+
if (Object.keys(types).length > 0)
|
|
1355
|
+
fields.types = types;
|
|
1023
1356
|
const frontmatter = { type: CONVENTION_TYPE, title: kind.title, governs: kind.governs, timestamp };
|
|
1024
1357
|
if (typeof kind.description === "string" && kind.description.trim() !== "") {
|
|
1025
1358
|
frontmatter.description = kind.description.trim();
|
|
@@ -1049,6 +1382,10 @@ export function kindConventionDoc(kind, prose, timestamp) {
|
|
|
1049
1382
|
frontmatter.claim = claim;
|
|
1050
1383
|
}
|
|
1051
1384
|
frontmatter.fields = fields;
|
|
1385
|
+
if (kind.deprecated)
|
|
1386
|
+
frontmatter.deprecated = kind.deprecated.problems?.length
|
|
1387
|
+
? structuredClone(kind.deprecated.raw)
|
|
1388
|
+
: { fields: kind.deprecated.fields, values: kind.deprecated.values, links: kind.deprecated.links };
|
|
1052
1389
|
if (kind.sections && kind.sections.length > 0)
|
|
1053
1390
|
frontmatter.sections = kind.sections;
|
|
1054
1391
|
if (kind.freshnessHorizon !== undefined)
|
|
@@ -1057,6 +1394,8 @@ export function kindConventionDoc(kind, prose, timestamp) {
|
|
|
1057
1394
|
frontmatter.browse_collapsed = true;
|
|
1058
1395
|
if (typeof kind.order === "number" && Number.isFinite(kind.order))
|
|
1059
1396
|
frontmatter.order = kind.order;
|
|
1397
|
+
if (kind.undeclaredFields !== undefined)
|
|
1398
|
+
frontmatter.undeclared_fields = kind.undeclaredFields;
|
|
1060
1399
|
return { id: kind.id, frontmatter, body: prose };
|
|
1061
1400
|
}
|
|
1062
1401
|
//# sourceMappingURL=kinds.js.map
|