@superbee/core 0.2.0-pre.5 → 0.2.0-pre.50
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/README.md +1344 -0
- 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 +41 -2
- package/dist/backend.d.ts.map +1 -1
- package/dist/backend.js +281 -22
- 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 +78 -0
- package/dist/body-replace-guards.d.ts.map +1 -0
- package/dist/body-replace-guards.js +269 -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 +44 -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 +424 -0
- package/dist/bundle-health/report.js.map +1 -0
- package/dist/bundle-ops.d.ts +9 -3
- package/dist/bundle-ops.d.ts.map +1 -1
- package/dist/bundle-ops.js +13 -6
- 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 +94 -0
- package/dist/dependencies.d.ts.map +1 -0
- package/dist/dependencies.js +180 -0
- package/dist/dependencies.js.map +1 -0
- package/dist/document-codec.d.ts +9 -2
- package/dist/document-codec.d.ts.map +1 -1
- package/dist/document-codec.js +10 -5
- package/dist/document-codec.js.map +1 -1
- package/dist/document-field-actions.d.ts +31 -1
- package/dist/document-field-actions.d.ts.map +1 -1
- package/dist/document-field-actions.js +137 -34
- package/dist/document-field-actions.js.map +1 -1
- package/dist/document-mutation.d.ts +37 -13
- package/dist/document-mutation.d.ts.map +1 -1
- package/dist/document-mutation.js +161 -62
- package/dist/document-mutation.js.map +1 -1
- 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 +1414 -0
- package/dist/document-transfer.js.map +1 -0
- package/dist/document-write-policy.d.ts.map +1 -1
- package/dist/document-write-policy.js +4 -2
- 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/engine.d.ts +20 -19
- package/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +85 -44
- 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 +21 -0
- package/dist/file-journaled-backend-internal.d.ts.map +1 -0
- package/dist/file-journaled-backend-internal.js +12 -0
- package/dist/file-journaled-backend-internal.js.map +1 -0
- package/dist/file-journaled-backend.d.ts +160 -0
- package/dist/file-journaled-backend.d.ts.map +1 -0
- package/dist/file-journaled-backend.js +1345 -0
- package/dist/file-journaled-backend.js.map +1 -0
- package/dist/filesystem-identity.d.ts +106 -17
- package/dist/filesystem-identity.d.ts.map +1 -1
- package/dist/filesystem-identity.js +513 -51
- package/dist/filesystem-identity.js.map +1 -1
- package/dist/filesystem-lock.d.ts +16 -2
- package/dist/filesystem-lock.d.ts.map +1 -1
- package/dist/filesystem-lock.js +402 -27
- package/dist/filesystem-lock.js.map +1 -1
- package/dist/filesystem-push-role.d.ts +77 -0
- package/dist/filesystem-push-role.d.ts.map +1 -0
- package/dist/filesystem-push-role.js +165 -0
- package/dist/filesystem-push-role.js.map +1 -0
- 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/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 +16 -7
- package/dist/frontmatter.d.ts.map +1 -1
- package/dist/frontmatter.js +48 -11
- package/dist/frontmatter.js.map +1 -1
- package/dist/governed-body-write.d.ts +8 -1
- package/dist/governed-body-write.d.ts.map +1 -1
- package/dist/governed-body-write.js +22 -8
- 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/host-text.d.ts +31 -0
- package/dist/host-text.d.ts.map +1 -0
- package/dist/host-text.js +77 -0
- package/dist/host-text.js.map +1 -0
- 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 +341 -0
- package/dist/hosted-transport/answer-rows.d.ts.map +1 -0
- package/dist/hosted-transport/answer-rows.js +594 -0
- package/dist/hosted-transport/answer-rows.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 +153 -0
- package/dist/hosted-transport/carrier.d.ts.map +1 -0
- package/dist/hosted-transport/carrier.js +273 -0
- package/dist/hosted-transport/carrier.js.map +1 -0
- 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/history-pages.d.ts +55 -0
- package/dist/hosted-transport/history-pages.d.ts.map +1 -0
- package/dist/hosted-transport/history-pages.js +69 -0
- package/dist/hosted-transport/history-pages.js.map +1 -0
- package/dist/hosted-transport/index.d.ts +20 -0
- package/dist/hosted-transport/index.d.ts.map +1 -0
- package/dist/hosted-transport/index.js +20 -0
- package/dist/hosted-transport/index.js.map +1 -0
- package/dist/hosted-transport/operations.d.ts +85 -0
- package/dist/hosted-transport/operations.d.ts.map +1 -0
- package/dist/hosted-transport/operations.js +128 -0
- package/dist/hosted-transport/operations.js.map +1 -0
- package/dist/hosted-transport/paged-reads.d.ts +87 -0
- package/dist/hosted-transport/paged-reads.d.ts.map +1 -0
- package/dist/hosted-transport/paged-reads.js +238 -0
- package/dist/hosted-transport/paged-reads.js.map +1 -0
- 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 +266 -0
- package/dist/hosted-transport/read-adapter.d.ts.map +1 -0
- package/dist/hosted-transport/read-adapter.js +570 -0
- package/dist/hosted-transport/read-adapter.js.map +1 -0
- package/dist/hosted-transport/root-write.d.ts +114 -0
- package/dist/hosted-transport/root-write.d.ts.map +1 -0
- package/dist/hosted-transport/root-write.js +174 -0
- package/dist/hosted-transport/root-write.js.map +1 -0
- package/dist/hosted-transport/whole-document-transport.d.ts +216 -0
- package/dist/hosted-transport/whole-document-transport.d.ts.map +1 -0
- package/dist/hosted-transport/whole-document-transport.js +470 -0
- package/dist/hosted-transport/whole-document-transport.js.map +1 -0
- 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 +14 -5
- package/dist/index-projection.js.map +1 -1
- package/dist/index.d.ts +57 -18
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +46 -19
- package/dist/index.js.map +1 -1
- package/dist/indexeddb-backend.d.ts +6 -32
- package/dist/indexeddb-backend.d.ts.map +1 -1
- package/dist/indexeddb-backend.js +82 -8
- 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 +86 -8
- package/dist/journaled-backend.d.ts.map +1 -1
- package/dist/journaled-backend.js +64 -69
- 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 +502 -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 +15 -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 +4 -0
- 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 +70 -0
- package/dist/kind-undeclared-fields.d.ts.map +1 -0
- package/dist/kind-undeclared-fields.js +121 -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 +115 -6
- package/dist/kinds.d.ts.map +1 -1
- package/dist/kinds.js +400 -24
- package/dist/kinds.js.map +1 -1
- 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 +130 -0
- package/dist/link-findings.d.ts.map +1 -0
- package/dist/link-findings.js +274 -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 +52 -3
- package/dist/links.d.ts.map +1 -1
- package/dist/links.js +287 -24
- package/dist/links.js.map +1 -1
- package/dist/managed-document-metadata.d.ts +2 -0
- package/dist/managed-document-metadata.d.ts.map +1 -0
- package/dist/managed-document-metadata.js +9 -0
- package/dist/managed-document-metadata.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 +46 -4
- package/dist/memory-backend.js.map +1 -1
- package/dist/okf-actor.d.ts +1 -0
- package/dist/okf-actor.d.ts.map +1 -1
- package/dist/okf-actor.js +1 -0
- package/dist/okf-actor.js.map +1 -1
- package/dist/okf-authoring.d.ts +4 -0
- package/dist/okf-authoring.d.ts.map +1 -0
- package/dist/okf-authoring.js +12 -0
- package/dist/okf-authoring.js.map +1 -0
- package/dist/okf-standard-fields.d.ts +3 -0
- package/dist/okf-standard-fields.d.ts.map +1 -1
- package/dist/okf-standard-fields.js +3 -0
- package/dist/okf-standard-fields.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 +52 -0
- package/dist/path-fold.d.ts.map +1 -0
- package/dist/path-fold.js +54 -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 +22 -2
- 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.d.ts +119 -0
- package/dist/portable-export.d.ts.map +1 -0
- package/dist/portable-export.js +501 -0
- package/dist/portable-export.js.map +1 -0
- package/dist/portable-frontmatter.d.ts +6 -0
- package/dist/portable-frontmatter.d.ts.map +1 -1
- package/dist/portable-frontmatter.js +26 -2
- 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 +117 -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 +22 -0
- package/dist/query-order.d.ts.map +1 -0
- package/dist/query-order.js +43 -0
- package/dist/query-order.js.map +1 -0
- 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 +124 -0
- package/dist/recipe-lifecycle/evolution.d.ts.map +1 -0
- package/dist/recipe-lifecycle/evolution.js +988 -0
- package/dist/recipe-lifecycle/evolution.js.map +1 -0
- package/dist/recipe-lifecycle/index.d.ts +34 -0
- package/dist/recipe-lifecycle/index.d.ts.map +1 -0
- package/dist/recipe-lifecycle/index.js +28 -0
- package/dist/recipe-lifecycle/index.js.map +1 -0
- package/dist/recipe-lifecycle/install.d.ts +161 -0
- package/dist/recipe-lifecycle/install.d.ts.map +1 -0
- package/dist/recipe-lifecycle/install.js +632 -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/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 +358 -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 +47 -0
- package/dist/relationships.d.ts.map +1 -0
- package/dist/relationships.js +53 -0
- package/dist/relationships.js.map +1 -0
- package/dist/remote-backend.d.ts +67 -32
- package/dist/remote-backend.d.ts.map +1 -1
- package/dist/remote-backend.js +171 -39
- 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-error.d.ts +17 -1
- package/dist/remote-error.d.ts.map +1 -1
- package/dist/remote-error.js +32 -2
- package/dist/remote-error.js.map +1 -1
- package/dist/remote-operations.d.ts +0 -40
- package/dist/remote-operations.d.ts.map +1 -1
- package/dist/remote-operations.js +28 -6
- package/dist/remote-operations.js.map +1 -1
- package/dist/remote-parsers.d.ts +20 -1
- package/dist/remote-parsers.d.ts.map +1 -1
- package/dist/remote-parsers.js +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 +158 -0
- package/dist/search/contract.d.ts.map +1 -0
- package/dist/search/contract.js +78 -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 +47 -0
- package/dist/search/text.d.ts.map +1 -0
- package/dist/search/text.js +150 -0
- package/dist/search/text.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.d.ts +8 -1
- package/dist/storage.d.ts.map +1 -1
- package/dist/storage.js +6 -1
- 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 +52 -6
- 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 +157 -17
- package/dist/uncertain-write.d.ts.map +1 -1
- package/dist/uncertain-write.js +86 -30
- 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/versioning.d.ts +9 -4
- package/dist/versioning.d.ts.map +1 -1
- package/dist/versioning.js +9 -4
- package/dist/versioning.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 +163 -6
|
@@ -1,43 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The uncertain-write transport over a wire authority: one {@link OperationTransport} that
|
|
3
|
-
* delivers a `document.write` intent as an identified `PUT` through {@link RemoteBackend} and
|
|
4
|
-
* reads the authority's recorded outcome back through the lookup route.
|
|
5
|
-
*
|
|
6
|
-
* The intent's `base` becomes the write's compare-and-swap premise (`If-Match`, or
|
|
7
|
-
* `If-None-Match: *` for a create) and its `requestId` travels as `Idempotency-Key`, so the
|
|
8
|
-
* authority applies the write at most once under that identity and a duplicate delivery, a
|
|
9
|
-
* transient retry included, is answered from the record. The wire's three answers map onto the
|
|
10
|
-
* primitive's {@link Outcome}: a version is `committed`, a `412` is `conflict` with the
|
|
11
|
-
* authority's current version, and any other 4xx refusal is `refused` with the wire code. A
|
|
12
|
-
* carrier failure and a 5xx response both propagate unchanged: a 502 or 504 from an intermediary,
|
|
13
|
-
* or the authority's own runtime failure, says nothing about whether the write was applied, so
|
|
14
|
-
* the primitive classifies it as unknown and resolves it by lookup, which is the whole reason
|
|
15
|
-
* the identity exists. A 4xx is final because the authority answered and declined. A local
|
|
16
|
-
* metadata encoding refusal is also final because no PUT was sent, not because the authority
|
|
17
|
-
* recorded an outcome.
|
|
18
|
-
*
|
|
19
|
-
* The transport is only sound against an authority that implements identity. A host that
|
|
20
|
-
* predates it ignores the header, applies every retry as a fresh write, and answers the lookup
|
|
21
|
-
* route with a route-miss `404` the client reads as "never recorded". So the transport reads the
|
|
22
|
-
* authority's capabilities once before the first submission or lookup leaves and refuses both
|
|
23
|
-
* with {@link OperationsUnsupportedError} when `operations` is false; nothing identified is
|
|
24
|
-
* ever sent to a host that would apply it unidentified. The check is lazy so a working copy can
|
|
25
|
-
* attach to its authority while offline; a check that cannot reach the authority fails like any
|
|
26
|
-
* carrier error and is retried on the next call. {@link openRemoteOperationTransport} runs the
|
|
27
|
-
* same check eagerly for a caller that is online at construction and wants the answer up front.
|
|
28
|
-
*
|
|
29
|
-
* Two limits of the lazy check. The uncertain-write primitive classifies every thrown error
|
|
30
|
-
* from `submit` or `lookup` as unknown, so the lazy variant's negative verdict shows up as an
|
|
31
|
-
* intent that stays pending on every push, not as a named refusal; a product caller that wants
|
|
32
|
-
* the verdict visible uses {@link openRemoteOperationTransport} or reads `wireCapabilities()`
|
|
33
|
-
* itself. And the check is memoized on success: a host downgraded afterwards is not detected,
|
|
34
|
-
* so one unidentified resubmission can reach it. Because every identified write is guarded by
|
|
35
|
-
* its base, that exposure is bounded to a spurious conflict at a moved head, never a double
|
|
36
|
-
* application.
|
|
37
|
-
*
|
|
38
|
-
* This module imports nothing from Node so a browser working copy and a Node consumer share
|
|
39
|
-
* one transport over one client adapter.
|
|
40
|
-
*/
|
|
41
1
|
import { RemoteBackend } from "./remote-backend.js";
|
|
42
2
|
import type { OperationTransport } from "./uncertain-write.js";
|
|
43
3
|
export interface RemoteOperationTransportOptions {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote-operations.d.ts","sourceRoot":"","sources":["../src/remote-operations.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"remote-operations.d.ts","sourceRoot":"","sources":["../src/remote-operations.ts"],"names":[],"mappings":"AA+CA,OAAO,EAAE,aAAa,EAAe,MAAM,qBAAqB,CAAC;AAEjE,OAAO,KAAK,EAAmB,kBAAkB,EAAW,MAAM,sBAAsB,CAAC;AAGzF,MAAM,WAAW,+BAA+B;IAC9C,0GAA0G;IAC1G,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,kFAAkF;AAClF,qBAAa,0BAA2B,SAAQ,KAAK;IACnD,QAAQ,CAAC,IAAI,4BAA4B;gBAC7B,OAAO,EAAE,MAAM;CAI5B;AAED;;;GAGG;AACH,wBAAsB,4BAA4B,CAAC,MAAM,EAAE,aAAa,EAAE,OAAO,GAAE,+BAAoC,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAIpJ;AAED;;;GAGG;AACH,wBAAgB,8BAA8B,CAAC,MAAM,EAAE,aAAa,EAAE,OAAO,GAAE,+BAAoC,GAAG,kBAAkB,CAEvI"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import { captureBodyReplacePosture } from "./body-replace-guards.js";
|
|
1
2
|
/**
|
|
3
|
+
* Internal: not exported from any package entry point; a test client beside `remote-backend.ts`.
|
|
4
|
+
*
|
|
2
5
|
* The uncertain-write transport over a wire authority: one {@link OperationTransport} that
|
|
3
6
|
* delivers a `document.write` intent as an identified `PUT` through {@link RemoteBackend} and
|
|
4
7
|
* reads the authority's recorded outcome back through the lookup route.
|
|
@@ -13,8 +16,9 @@
|
|
|
13
16
|
* or the authority's own runtime failure, says nothing about whether the write was applied, so
|
|
14
17
|
* the primitive classifies it as unknown and resolves it by lookup, which is the whole reason
|
|
15
18
|
* the identity exists. A 4xx is final because the authority answered and declined. A local
|
|
16
|
-
*
|
|
17
|
-
*
|
|
19
|
+
* refusal is also final because no PUT was sent, not because the authority recorded an outcome:
|
|
20
|
+
* an intent kind other than `document.write`, content that does not parse, or metadata the wire
|
|
21
|
+
* cannot encode is refused `USAGE` without a PUT.
|
|
18
22
|
*
|
|
19
23
|
* The transport is only sound against an authority that implements identity. A host that
|
|
20
24
|
* predates it ignores the header, applies every retry as a fresh write, and answers the lookup
|
|
@@ -32,8 +36,8 @@
|
|
|
32
36
|
* the verdict visible uses {@link openRemoteOperationTransport} or reads `wireCapabilities()`
|
|
33
37
|
* itself. And the check is memoized on success: a host downgraded afterwards is not detected,
|
|
34
38
|
* so one unidentified resubmission can reach it. Because every identified write is guarded by
|
|
35
|
-
* its base, that exposure is bounded to a spurious conflict at a moved head,
|
|
36
|
-
* application.
|
|
39
|
+
* its base, that exposure is bounded to a spurious conflict at a moved head, or a second
|
|
40
|
+
* application when the head has returned to the base's exact content.
|
|
37
41
|
*
|
|
38
42
|
* This module imports nothing from Node so a browser working copy and a Node consumer share
|
|
39
43
|
* one transport over one client adapter.
|
|
@@ -79,13 +83,28 @@ function buildTransport(remote, options) {
|
|
|
79
83
|
};
|
|
80
84
|
const transport = {
|
|
81
85
|
async submit(intent) {
|
|
86
|
+
// Refused rather than thrown: the primitive classifies a throw as unknown, and an intent
|
|
87
|
+
// that can never be sent would then stay pending as possibly delivered on every push.
|
|
82
88
|
if (intent.kind !== "document.write") {
|
|
83
|
-
|
|
89
|
+
return { kind: "refused", code: "USAGE", message: `remote operation transport: unsupported intent kind '${intent.kind}'`, executed: false };
|
|
90
|
+
}
|
|
91
|
+
let parsed;
|
|
92
|
+
let posture;
|
|
93
|
+
try {
|
|
94
|
+
const descriptor = Object.getOwnPropertyDescriptor(intent, "bodyReplace");
|
|
95
|
+
if (descriptor && !("value" in descriptor))
|
|
96
|
+
throw new Error("bodyReplace must be an explicit data field.");
|
|
97
|
+
posture = captureBodyReplacePosture(descriptor?.value);
|
|
98
|
+
parsed = parseMarkdown(intent.content, pathFromConceptId(intent.target));
|
|
99
|
+
}
|
|
100
|
+
catch (error) {
|
|
101
|
+
return { kind: "refused", code: "USAGE", message: error instanceof Error ? error.message : String(error), executed: false };
|
|
84
102
|
}
|
|
85
|
-
const { frontmatter, body } =
|
|
103
|
+
const { frontmatter, body } = parsed;
|
|
86
104
|
const writeOptions = {
|
|
87
105
|
expectedVersion: intent.base,
|
|
88
106
|
requestId: intent.requestId,
|
|
107
|
+
...(posture === undefined ? {} : { bodyReplace: posture }),
|
|
89
108
|
...(options.actor === undefined ? {} : { actor: options.actor }),
|
|
90
109
|
};
|
|
91
110
|
try {
|
|
@@ -100,6 +119,9 @@ function buildTransport(remote, options) {
|
|
|
100
119
|
return { kind: "refused", code: "USAGE", message: error.message };
|
|
101
120
|
if (error instanceof VersionConflict)
|
|
102
121
|
return { kind: "conflict", actual: error.actual };
|
|
122
|
+
// The reference router authorizes before it claims a key: a 401 or 403 executed nothing.
|
|
123
|
+
if (error instanceof RemoteError && (error.status === 401 || error.status === 403))
|
|
124
|
+
return { kind: "refused", code: error.code, message: error.message, executed: false };
|
|
103
125
|
if (error instanceof RemoteError && error.status < 500)
|
|
104
126
|
return { kind: "refused", code: error.code, message: error.message };
|
|
105
127
|
throw error;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote-operations.js","sourceRoot":"","sources":["../src/remote-operations.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"remote-operations.js","sourceRoot":"","sources":["../src/remote-operations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAA2B,MAAM,0BAA0B,CAAC;AAC9F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,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ACD,KAAK,CAAC,MAAM,CAAC,SAAiB;YAC5B,MAAM,eAAe,EAAE,CAAC;YACxB,OAAO,MAAM,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;QAC3C,CAAC;KACF,CAAC;IACF,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;AACxC,CAAC"}
|
package/dist/remote-parsers.d.ts
CHANGED
|
@@ -22,6 +22,25 @@ export declare const SNAPSHOT_TRUNCATED = "SNAPSHOT_TRUNCATED";
|
|
|
22
22
|
*/
|
|
23
23
|
export declare const SNAPSHOT_DIGEST_MISMATCH = "SNAPSHOT_DIGEST_MISMATCH";
|
|
24
24
|
/** A `200` from `GET /heads`: every document id and version, and the digest over them. */
|
|
25
|
+
/** The deployment-scoped capability booleans a wire authority reports (`docs/WIRE-PROTOCOL.md`). */
|
|
26
|
+
export interface WireCapabilities {
|
|
27
|
+
history: boolean;
|
|
28
|
+
enforced_cas: boolean;
|
|
29
|
+
projections: boolean;
|
|
30
|
+
backlinks: boolean;
|
|
31
|
+
blobs: boolean;
|
|
32
|
+
/** Whether document writes carrying `Idempotency-Key` are recorded and readable by lookup. */
|
|
33
|
+
operations: boolean;
|
|
34
|
+
/** Whether `GET /heads` answers every document id and version under one digest, with `304`. */
|
|
35
|
+
heads: boolean;
|
|
36
|
+
/** Whether `GET /snapshot` streams every document as terminated NDJSON. */
|
|
37
|
+
snapshot: boolean;
|
|
38
|
+
}
|
|
39
|
+
/** Options for a wire authority's `heads` read. */
|
|
40
|
+
export interface HeadsOptions {
|
|
41
|
+
/** A digest from an earlier `heads` or `snapshot` answer; the authority answers `304` when it still holds it. */
|
|
42
|
+
ifNoneMatch?: string;
|
|
43
|
+
}
|
|
25
44
|
export interface HeadsResult {
|
|
26
45
|
digest: string;
|
|
27
46
|
heads: DocumentHead[];
|
|
@@ -66,7 +85,7 @@ export interface ReadSnapshotStreamOptions {
|
|
|
66
85
|
* The `200` body of `GET /heads`, admitted or refused as one: a well-formed digest, a `heads`
|
|
67
86
|
* array of `{ id, version }` rows, a `count` equal to the number of rows, and rows that digest
|
|
68
87
|
* by the documented recipe to the digest served. Anything else rejects as malformed (a
|
|
69
|
-
* {@link
|
|
88
|
+
* {@link MalformedAnswer}, code `MALFORMED_ANSWER`) rather than being trusted. The
|
|
70
89
|
* recomputation is what stops a listing that is whole by its own count but not the state its
|
|
71
90
|
* digest names (a shortened listing under the real digest) from being diffed as a mass
|
|
72
91
|
* deletion. Rows keep the order served: the recipe sorts for itself, so order does not decide
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote-parsers.d.ts","sourceRoot":"","sources":["../src/remote-parsers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAA8B,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAElF,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAElE,qGAAqG;AACrG,eAAO,MAAM,kBAAkB,uBAAuB,CAAC;AACvD;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,6BAA6B,CAAC;AAEnE,0FAA0F;AAC1F,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,YAAY,EAAE,CAAC;CACvB;AAED,+GAA+G;AAC/G,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,oCAAoC;AACpC,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,SAAS,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,WAAW,CAAC;IACzB,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;;;;;;GAUG;AACH,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,cAAc,CAAC;IACvB,IAAI,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC;CACvC;AAED,8CAA8C;AAC9C,MAAM,W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AAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,oCAAoC;AACpC,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,SAAS,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,WAAW,CAAC;IACzB,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;;;;;;GAUG;AACH,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,cAAc,CAAC;IACvB,IAAI,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC;CACvC;AAED,8CAA8C;AAC9C,MAAM,WAAW,yBAAyB;IACxC;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAQD;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,WAAW,CAe9D;AA6GD;;;;;;;;GAQG;AACH,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,cAAc,CAAC,UAAU,CAAC,EAAE,OAAO,GAAE,yBAA8B,GAAG,OAAO,CAAC,cAAc,CAAC,CAa3I"}
|
package/dist/remote-parsers.js
CHANGED
|
@@ -31,7 +31,7 @@ function isDocumentHead(value) {
|
|
|
31
31
|
* The `200` body of `GET /heads`, admitted or refused as one: a well-formed digest, a `heads`
|
|
32
32
|
* array of `{ id, version }` rows, a `count` equal to the number of rows, and rows that digest
|
|
33
33
|
* by the documented recipe to the digest served. Anything else rejects as malformed (a
|
|
34
|
-
* {@link
|
|
34
|
+
* {@link MalformedAnswer}, code `MALFORMED_ANSWER`) rather than being trusted. The
|
|
35
35
|
* recomputation is what stops a listing that is whole by its own count but not the state its
|
|
36
36
|
* digest names (a shortened listing under the real digest) from being diffed as a mass
|
|
37
37
|
* deletion. Rows keep the order served: the recipe sorts for itself, so order does not decide
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote-parsers.js","sourceRoot":"","sources":["../src/remote-parsers.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,CAAC,KAAK,mCAAmC,EAClF,kBAAkB,EAClB,MAAM,CACP,CAAC;AACJ,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,IAAgC,EAAE,UAAqC,EAAE;IAChH,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,GAAG,CAAC;IACrC,MAAM,KAAK,GAAG,WAAW,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACxC,MAAM,KAAK,GAAG,MAAM,KAAK,CAAC,IAAI,EAAE,CAAC;IACjC,IAAI,KAAK,CAAC,IAAI;QAAE,MAAM,IAAI,WAAW,CAAC,uCAAuC,EAAE,kBAAkB,EAAE,MAAM,CAAC,CAAC;IAC3G,IAAI,MAAsB,CAAC;IAC3B,IAAI,CAAC;QACH,MAAM,GAAG,mBAAmB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC5C,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QAC9B,MAAM,GAAG,CAAC;IACZ,CAAC;IACD,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC;AACpE,CAAC"}
|
package/dist/remote.d.ts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
/** Browser-safe
|
|
2
|
-
export { RemoteBackend } from "./remote-backend.js";
|
|
3
|
-
export type { FetchLike, HeadsOptions, RemoteBackendOptions, WireCapabilities } from "./remote-backend.js";
|
|
1
|
+
/** Browser-safe wire protocol answer shapes, parsers and typed rejection. */
|
|
4
2
|
export { RemoteError } from "./remote-error.js";
|
|
5
3
|
export { SNAPSHOT_DIGEST_MISMATCH, SNAPSHOT_TRUNCATED, parseHeadsAnswer, readSnapshotStream } from "./remote-parsers.js";
|
|
6
|
-
export type { HeadsResult, ReadSnapshotStreamOptions, RemoteSnapshot, SnapshotDocument, SnapshotHeader } from "./remote-parsers.js";
|
|
4
|
+
export type { HeadsOptions, WireCapabilities, HeadsResult, ReadSnapshotStreamOptions, RemoteSnapshot, SnapshotDocument, SnapshotHeader } from "./remote-parsers.js";
|
|
7
5
|
export { headsDigest, isHeadsDigest, sortHeads } from "./heads-digest.js";
|
|
8
6
|
export type { DocumentHead } from "./heads-digest.js";
|
|
9
7
|
//# sourceMappingURL=remote.d.ts.map
|
package/dist/remote.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote.d.ts","sourceRoot":"","sources":["../src/remote.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"remote.d.ts","sourceRoot":"","sources":["../src/remote.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAE7E,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGhD,OAAO,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzH,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,WAAW,EAAE,yBAAyB,EAAE,cAAc,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACpK,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC1E,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/remote.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
/** Browser-safe
|
|
2
|
-
export { RemoteBackend } from "./remote-backend.js";
|
|
1
|
+
/** Browser-safe wire protocol answer shapes, parsers and typed rejection. */
|
|
3
2
|
export { RemoteError } from "./remote-error.js";
|
|
4
3
|
// The heads and snapshot grammar's reference validators, for a host that serves the same grammar
|
|
5
|
-
// through routes of its own
|
|
4
|
+
// through routes of its own.
|
|
6
5
|
export { SNAPSHOT_DIGEST_MISMATCH, SNAPSHOT_TRUNCATED, parseHeadsAnswer, readSnapshotStream } from "./remote-parsers.js";
|
|
7
6
|
export { headsDigest, isHeadsDigest, sortHeads } from "./heads-digest.js";
|
|
8
7
|
//# sourceMappingURL=remote.js.map
|
package/dist/remote.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote.js","sourceRoot":"","sources":["../src/remote.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"remote.js","sourceRoot":"","sources":["../src/remote.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAE7E,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,iGAAiG;AACjG,6BAA6B;AAC7B,OAAO,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzH,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** The one admission check every backend applies before storing a reserved file. */
|
|
2
|
+
import type { ReservedFilename } from "./types.js";
|
|
3
|
+
/**
|
|
4
|
+
* Admit a reserved-file write: a safe directory and name, and for a markdown file, leading
|
|
5
|
+
* frontmatter within the frontmatter limits. Throws `InvalidInputError` for an unsafe location and
|
|
6
|
+
* `FrontmatterRefusedError` for frontmatter a limit refuses, before anything is stored.
|
|
7
|
+
*/
|
|
8
|
+
export declare function assertStorableReservedWrite(dir: string, name: unknown, content: string): asserts name is ReservedFilename;
|
|
9
|
+
//# sourceMappingURL=reserved-write.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reserved-write.d.ts","sourceRoot":"","sources":["../src/reserved-write.ts"],"names":[],"mappings":"AAAA,oFAAoF;AAIpF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEnD;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,IAAI,gBAAgB,CAIzH"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** The one admission check every backend applies before storing a reserved file. */
|
|
2
|
+
import { assertSafeReservedDir, assertSafeReservedFilename } from "./paths.js";
|
|
3
|
+
import { assertStorableFrontmatter } from "./portable-frontmatter.js";
|
|
4
|
+
/**
|
|
5
|
+
* Admit a reserved-file write: a safe directory and name, and for a markdown file, leading
|
|
6
|
+
* frontmatter within the frontmatter limits. Throws `InvalidInputError` for an unsafe location and
|
|
7
|
+
* `FrontmatterRefusedError` for frontmatter a limit refuses, before anything is stored.
|
|
8
|
+
*/
|
|
9
|
+
export function assertStorableReservedWrite(dir, name, content) {
|
|
10
|
+
assertSafeReservedDir(dir);
|
|
11
|
+
assertSafeReservedFilename(name);
|
|
12
|
+
if (name.endsWith(".md"))
|
|
13
|
+
assertStorableFrontmatter(content);
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=reserved-write.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reserved-write.js","sourceRoot":"","sources":["../src/reserved-write.ts"],"names":[],"mappings":"AAAA,oFAAoF;AAEpF,OAAO,EAAE,qBAAqB,EAAE,0BAA0B,EAAE,MAAM,YAAY,CAAC;AAC/E,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAGtE;;;;GAIG;AACH,MAAM,UAAU,2BAA2B,CAAC,GAAW,EAAE,IAAa,EAAE,OAAe;IACrF,qBAAqB,CAAC,GAAG,CAAC,CAAC;IAC3B,0BAA0B,CAAC,IAAI,CAAC,CAAC;IACjC,IAAI,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,yBAAyB,CAAC,OAAO,CAAC,CAAC;AAC/D,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { StorageBackend } from "../types.js";
|
|
2
|
+
import { type MemorySearchSourceOptionsV1, type MemorySearchSourceV1 } from "./memory-source.js";
|
|
3
|
+
/** Read bounded batches through Core's resilient scan policy. Unreadable documents are
|
|
4
|
+
* reported; storage failures and incomplete backend responses still refuse the search. */
|
|
5
|
+
export declare function searchSourceFromBackend(backend: StorageBackend, options?: Omit<MemorySearchSourceOptionsV1, "key">): Promise<MemorySearchSourceV1>;
|
|
6
|
+
//# sourceMappingURL=backend-source.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backend-source.d.ts","sourceRoot":"","sources":["../../src/search/backend-source.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAKlD,OAAO,EAA0C,KAAK,2BAA2B,EAAE,KAAK,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAKzI;0FAC0F;AAC1F,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,cAAc,EACvB,OAAO,GAAE,IAAI,CAAC,2BAA2B,EAAE,KAAK,CAAM,GACrD,OAAO,CAAC,oBAAoB,CAAC,CAyC/B"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { readManyExisting } from "../document-scan.js";
|
|
2
|
+
import { sha256HexOfUtf8 } from "../sha256.js";
|
|
3
|
+
import { canonicalJson, codeUnitCompare } from "./identity.js";
|
|
4
|
+
import { headsDigest } from "../heads-digest.js";
|
|
5
|
+
import { memorySearchSource, memorySearchBounds } from "./memory-source.js";
|
|
6
|
+
import { SearchLimitError, stopIfAsked } from "./errors.js";
|
|
7
|
+
import { documentSourceBytes } from "./row-text.js";
|
|
8
|
+
/** Read bounded batches through Core's resilient scan policy. Unreadable documents are
|
|
9
|
+
* reported; storage failures and incomplete backend responses still refuse the search. */
|
|
10
|
+
export async function searchSourceFromBackend(backend, options = {}) {
|
|
11
|
+
const { maxDocuments, maxSourceBytes } = memorySearchBounds(options);
|
|
12
|
+
stopIfAsked(options.stop);
|
|
13
|
+
const ids = await backend.list();
|
|
14
|
+
if (ids.length > maxDocuments.max)
|
|
15
|
+
throw new SearchLimitError(maxDocuments.name, maxDocuments.max, ids.length);
|
|
16
|
+
const documents = [];
|
|
17
|
+
let sourceBytes = 0;
|
|
18
|
+
const skipped = [];
|
|
19
|
+
for (let start = 0; start < ids.length; start += 128) {
|
|
20
|
+
stopIfAsked(options.stop);
|
|
21
|
+
const batch = ids.slice(start, start + 128);
|
|
22
|
+
const omitted = new Set();
|
|
23
|
+
const results = await readManyExisting(backend, batch, skip => { skipped.push(skip); omitted.add(skip.id); });
|
|
24
|
+
const expected = batch.filter(id => !omitted.has(id));
|
|
25
|
+
if (results.length !== expected.length)
|
|
26
|
+
throw new TypeError("Search backend returned an incomplete batch.");
|
|
27
|
+
for (const [index, { doc, version }] of results.entries()) {
|
|
28
|
+
if (doc.id !== expected[index])
|
|
29
|
+
throw new TypeError("Search backend returned a different document identity.");
|
|
30
|
+
const document = { ...doc, version };
|
|
31
|
+
sourceBytes += documentSourceBytes(document);
|
|
32
|
+
if (sourceBytes > maxSourceBytes.max)
|
|
33
|
+
throw new SearchLimitError(maxSourceBytes.name, maxSourceBytes.max, sourceBytes);
|
|
34
|
+
documents.push(document);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
skipped.sort((a, b) => codeUnitCompare(a.id, b.id));
|
|
38
|
+
const heads = headsDigest(documents);
|
|
39
|
+
const key = skipped.length === 0 ? heads : sha256HexOfUtf8(canonicalJson({ heads, skipped }));
|
|
40
|
+
const source = memorySearchSource(documents, { ...options, key });
|
|
41
|
+
if (skipped.length === 0)
|
|
42
|
+
return source;
|
|
43
|
+
const diagnostics = Object.freeze(skipped.map(row => Object.freeze({ ...row })));
|
|
44
|
+
return Object.freeze({
|
|
45
|
+
key,
|
|
46
|
+
get indexDigest() { return source.indexDigest; },
|
|
47
|
+
async evidence(...args) {
|
|
48
|
+
const batch = await source.evidence(...args);
|
|
49
|
+
return { ...batch, skipped: diagnostics, size: { ...batch.size,
|
|
50
|
+
documents: batch.size.documents + diagnostics.length,
|
|
51
|
+
skipped: batch.size.skipped + diagnostics.length,
|
|
52
|
+
} };
|
|
53
|
+
},
|
|
54
|
+
text: source.text,
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=backend-source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backend-source.js","sourceRoot":"","sources":["../../src/search/backend-source.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAmB,MAAM,qBAAqB,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAA+D,MAAM,oBAAoB,CAAC;AACzI,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAGpD;0FAC0F;AAC1F,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC3C,OAAuB,EACvB,UAAoD,EAAE;IAEtD,MAAM,EAAE,YAAY,EAAE,cAAc,EAAE,GAAG,kBAAkB,CAAC,OAAO,CAAC,CAAC;IACrE,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1B,MAAM,GAAG,GAAG,MAAM,OAAO,CAAC,IAAI,EAAE,CAAC;IACjC,IAAI,GAAG,CAAC,MAAM,GAAG,YAAY,CAAC,GAAG;QAAE,MAAM,IAAI,gBAAgB,CAAC,YAAY,CAAC,IAAI,EAAE,YAAY,CAAC,GAAG,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC/G,MAAM,SAAS,GAAuB,EAAE,CAAC;IACzC,IAAI,WAAW,GAAG,CAAC,CAAC;IACpB,M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BACpD,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,OAAO,GAAG,WAAW,CAAC,MAAM;iBACjD,EAAE,CAAC;QACN,CAAC;QACD,IAAI,EAAE,MAAM,CAAC,IAAI;KAClB,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import type { SkippedDoc } from "../document-scan.js";
|
|
2
|
+
/**
|
|
3
|
+
* The `documents.search.v1` contract: its constants, request and result types, and the frontmatter
|
|
4
|
+
* fields a search reads. Ranking and index limits are portal-webmcp 0.3.1's (algorithm
|
|
5
|
+
* `portal-webmcp-search/v1`, a long document indexed whole up to 65,536 body terms); the request
|
|
6
|
+
* limits are this contract's.
|
|
7
|
+
*/
|
|
8
|
+
export declare const SEARCH_OPERATION_ID = "documents.search.v1";
|
|
9
|
+
/** The ranking algorithm, shared with portal-webmcp 0.3.1's `superbee_search_documents`. */
|
|
10
|
+
export declare const SEARCH_ALGORITHM = "portal-webmcp-search/v1";
|
|
11
|
+
/** Bumped whenever normalize, tokenize or searchRowText change what a document contributes to an
|
|
12
|
+
* index; the row-text golden (`test/fixtures/search-row-text-v<revision>.json`) pins it. */
|
|
13
|
+
export declare const SEARCH_TEXT_REVISION = 1;
|
|
14
|
+
/** Largest answer, as JSON. A page of long hits can exceed it before 50 hits: the page then ends
|
|
15
|
+
* early with a cursor at the cut. */
|
|
16
|
+
export declare const SEARCH_MAX_OUTPUT_BYTES: number;
|
|
17
|
+
export declare const SEARCH_LIMITS: Readonly<{
|
|
18
|
+
/** Largest query, UTF-8 bytes. */
|
|
19
|
+
readonly maxQueryBytes: 1024;
|
|
20
|
+
/** Distinct normalized query terms. */
|
|
21
|
+
readonly maxQueryTerms: 16;
|
|
22
|
+
readonly defaultRows: 10;
|
|
23
|
+
readonly maxRows: 50;
|
|
24
|
+
/** Excerpt length, UTF-8 bytes. */
|
|
25
|
+
readonly excerptBytes: 512;
|
|
26
|
+
/** Largest exact `type` or `tag` filter, UTF-8 bytes (the kernel query's filter bound). */
|
|
27
|
+
readonly maxFilterBytes: 256;
|
|
28
|
+
/** Largest id `prefix` filter, UTF-8 bytes (a document id's bound). */
|
|
29
|
+
readonly maxPrefixBytes: 512;
|
|
30
|
+
/** Largest cursor, UTF-8 bytes. */
|
|
31
|
+
readonly maxCursorBytes: 2048;
|
|
32
|
+
/** Values per facet, most frequent first. */
|
|
33
|
+
readonly maxFacetValues: 50;
|
|
34
|
+
readonly maxIndexDocuments: 20000;
|
|
35
|
+
readonly maxIndexSourceBytes: 67108864;
|
|
36
|
+
/** portal-webmcp's V1 value: a long document is indexed whole, never truncated; one over it is
|
|
37
|
+
* left out of the index and counted as skipped. */
|
|
38
|
+
readonly maxTermsPerDocument: 65536;
|
|
39
|
+
/** The default and ceiling of `searchDocuments`' `maxEvidenceInstances`: the most capped term
|
|
40
|
+
* instances a request's terms may hold across a corpus before it is refused as too broad. */
|
|
41
|
+
readonly maxEvidenceInstances: 400000;
|
|
42
|
+
}>;
|
|
43
|
+
/** Body occurrences of one distinct query term that can still add score. */
|
|
44
|
+
export declare const BODY_OCCURRENCE_CAP = 20;
|
|
45
|
+
/** Bytes an excerpt may reach behind its first body match before the match starts. */
|
|
46
|
+
export declare const EXCERPT_LEAD_BYTES = 256;
|
|
47
|
+
/** Documents processed between cancellation checks. */
|
|
48
|
+
export declare const SIGNAL_INTERVAL = 128;
|
|
49
|
+
export declare const SEARCH_MATCHES: readonly ["auto", "all", "any"];
|
|
50
|
+
export type SearchMatchV1 = (typeof SEARCH_MATCHES)[number];
|
|
51
|
+
export type SearchMatchModeV1 = "all" | "any";
|
|
52
|
+
export declare const SEARCH_FACETS: readonly ["type", "tags"];
|
|
53
|
+
export type SearchFacetV1 = (typeof SEARCH_FACETS)[number];
|
|
54
|
+
export declare const SEARCH_MATCH_FIELDS: readonly ["title", "type", "tag", "description", "id", "body"];
|
|
55
|
+
export type SearchMatchFieldV1 = (typeof SEARCH_MATCH_FIELDS)[number];
|
|
56
|
+
export declare const SEARCH_GUIDANCE: Readonly<{
|
|
57
|
+
all: "No document contains every query term. Retry with match \"any\", fewer terms, or different exact filters.";
|
|
58
|
+
any: "No document contains any searchable query term. Try domain-specific keywords or remove exact type and tag filters.";
|
|
59
|
+
/** The refusal of a request whose terms occur too often to rank (`maxEvidenceInstances`). */
|
|
60
|
+
broad: "The query's terms occur too often in this corpus to rank. Retry with fewer or more specific terms.";
|
|
61
|
+
}>;
|
|
62
|
+
/** One document of a search corpus: a read model row, or a working copy's head and body. */
|
|
63
|
+
export interface SearchDocumentV1 {
|
|
64
|
+
readonly id: string;
|
|
65
|
+
readonly version: string;
|
|
66
|
+
readonly frontmatter: Readonly<Record<string, unknown>>;
|
|
67
|
+
readonly body: string;
|
|
68
|
+
}
|
|
69
|
+
/** Cancellation for a long build or ranking: a signal, a host check that throws, or both. */
|
|
70
|
+
export interface SearchStopV1 {
|
|
71
|
+
readonly signal?: AbortSignal;
|
|
72
|
+
/** Called every SIGNAL_INTERVAL documents; throws to stop (for example a deadline). */
|
|
73
|
+
readonly check?: () => void;
|
|
74
|
+
}
|
|
75
|
+
/** The exact filters a source applies before it answers evidence. */
|
|
76
|
+
export interface SearchFiltersV1 {
|
|
77
|
+
/** Exclude records of type Convention under the canonical conventions/ prefix. */
|
|
78
|
+
readonly excludeConventions?: boolean;
|
|
79
|
+
readonly type?: string;
|
|
80
|
+
readonly tag?: string;
|
|
81
|
+
/** Leading characters of the document id. */
|
|
82
|
+
readonly prefix?: string;
|
|
83
|
+
}
|
|
84
|
+
export interface SearchRequestV1 {
|
|
85
|
+
/** Free text, at most 1 KiB and 16 distinct terms after normalization. */
|
|
86
|
+
readonly query: string;
|
|
87
|
+
/** `auto` (default): every term, then any term without conversational words when nothing matched. */
|
|
88
|
+
readonly match?: SearchMatchV1;
|
|
89
|
+
/** Exclude records of type Convention under the canonical conventions/ prefix. */
|
|
90
|
+
readonly excludeConventions?: boolean;
|
|
91
|
+
/** Exact frontmatter `type`. */
|
|
92
|
+
readonly type?: string;
|
|
93
|
+
/** Exact declared tag. */
|
|
94
|
+
readonly tag?: string;
|
|
95
|
+
/** Leading characters of the document id, at most 512 bytes. */
|
|
96
|
+
readonly prefix?: string;
|
|
97
|
+
/** Hits per page, 1 to 50; default 10. */
|
|
98
|
+
readonly limit?: number;
|
|
99
|
+
/** A previous answer's `nextCursor`, for the same corpus, query, match and filters. */
|
|
100
|
+
readonly cursor?: string;
|
|
101
|
+
/** Value counts over every hit (not only this page), most frequent first, at most 50 each. */
|
|
102
|
+
readonly facets?: readonly SearchFacetV1[];
|
|
103
|
+
}
|
|
104
|
+
export interface SearchHitV1 {
|
|
105
|
+
readonly id: string;
|
|
106
|
+
readonly version: string;
|
|
107
|
+
readonly title?: string;
|
|
108
|
+
readonly type?: string;
|
|
109
|
+
readonly tags: readonly string[];
|
|
110
|
+
readonly score: number;
|
|
111
|
+
readonly matchedTerms: readonly {
|
|
112
|
+
readonly term: string;
|
|
113
|
+
readonly fields: readonly SearchMatchFieldV1[];
|
|
114
|
+
}[];
|
|
115
|
+
/** At most SEARCH_LIMITS.excerptBytes UTF-8 bytes: the body around the first match, else the description. */
|
|
116
|
+
readonly excerpt: string;
|
|
117
|
+
}
|
|
118
|
+
export interface SearchFacetValueV1 {
|
|
119
|
+
readonly value: string;
|
|
120
|
+
readonly count: number;
|
|
121
|
+
}
|
|
122
|
+
export interface SearchResultV1 {
|
|
123
|
+
readonly hits: readonly SearchHitV1[];
|
|
124
|
+
/** Unreadable documents omitted from this corpus; absent for a complete read. */
|
|
125
|
+
readonly skipped?: readonly SkippedDoc[];
|
|
126
|
+
readonly query: {
|
|
127
|
+
readonly requestedMatch: SearchMatchV1;
|
|
128
|
+
readonly effectiveMatch: SearchMatchModeV1;
|
|
129
|
+
readonly fallbackUsed: boolean;
|
|
130
|
+
/** The terms matched: normalized, deduplicated, and without ignoredTerms after a fallback. */
|
|
131
|
+
readonly terms: readonly string[];
|
|
132
|
+
/** Conversational terms the fallback left out; absent when none were. */
|
|
133
|
+
readonly ignoredTerms?: readonly string[];
|
|
134
|
+
};
|
|
135
|
+
/** Hits across every page. */
|
|
136
|
+
readonly total: number;
|
|
137
|
+
readonly facets?: {
|
|
138
|
+
readonly type?: readonly SearchFacetValueV1[];
|
|
139
|
+
readonly tags?: readonly SearchFacetValueV1[];
|
|
140
|
+
};
|
|
141
|
+
readonly nextCursor?: string;
|
|
142
|
+
/** What was searched: every document, those indexed (reindexPending included), those the index
|
|
143
|
+
* cannot hold, and indexed rows awaiting re-derivation. */
|
|
144
|
+
readonly corpus: {
|
|
145
|
+
readonly documents: number;
|
|
146
|
+
readonly indexed: number;
|
|
147
|
+
readonly skipped: number;
|
|
148
|
+
readonly reindexPending: number;
|
|
149
|
+
};
|
|
150
|
+
/** Fixed advice when nothing matched. */
|
|
151
|
+
readonly guidance?: string;
|
|
152
|
+
}
|
|
153
|
+
export declare function documentTitle(document: SearchDocumentV1): string | undefined;
|
|
154
|
+
export declare function documentType(document: SearchDocumentV1): string | undefined;
|
|
155
|
+
export declare function documentDescription(document: SearchDocumentV1): string | undefined;
|
|
156
|
+
/** Declared string tags only; a non-array or non-string member contributes nothing. */
|
|
157
|
+
export declare function documentTags(document: SearchDocumentV1): readonly string[];
|
|
158
|
+
//# sourceMappingURL=contract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../src/search/contract.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD;;;;;GAKG;AAEH,eAAO,MAAM,mBAAmB,wBAAwB,CAAC;AAEzD,4FAA4F;AAC5F,eAAO,MAAM,gBAAgB,4BAA4B,CAAC;AAE1D;4FAC4F;AAC5F,eAAO,MAAM,oBAAoB,IAAI,CAAC;AAEtC;qCACqC;AACrC,eAAO,MAAM,uBAAuB,QAAY,CAAC;AAEjD,eAAO,MAAM,aAAa;IACxB,kCAAkC;;IAElC,uCAAuC;;;;IAIv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B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;KACjC,CAAC;IACF,yCAAyC;IACzC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B;AAUD,wBAAgB,aAAa,CAAC,QAAQ,EAAE,gBAAgB,GAAG,MAAM,GAAG,SAAS,CAE5E;AAED,wBAAgB,YAAY,CAAC,QAAQ,EAAE,gBAAgB,GAAG,MAAM,GAAG,SAAS,CAE3E;AAED,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,MAAM,GAAG,SAAS,CAElF;AAED,uFAAuF;AACvF,wBAAgB,YAAY,CAAC,QAAQ,EAAE,gBAAgB,GAAG,SAAS,MAAM,EAAE,CAG1E"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `documents.search.v1` contract: its constants, request and result types, and the frontmatter
|
|
3
|
+
* fields a search reads. Ranking and index limits are portal-webmcp 0.3.1's (algorithm
|
|
4
|
+
* `portal-webmcp-search/v1`, a long document indexed whole up to 65,536 body terms); the request
|
|
5
|
+
* limits are this contract's.
|
|
6
|
+
*/
|
|
7
|
+
export const SEARCH_OPERATION_ID = "documents.search.v1";
|
|
8
|
+
/** The ranking algorithm, shared with portal-webmcp 0.3.1's `superbee_search_documents`. */
|
|
9
|
+
export const SEARCH_ALGORITHM = "portal-webmcp-search/v1";
|
|
10
|
+
/** Bumped whenever normalize, tokenize or searchRowText change what a document contributes to an
|
|
11
|
+
* index; the row-text golden (`test/fixtures/search-row-text-v<revision>.json`) pins it. */
|
|
12
|
+
export const SEARCH_TEXT_REVISION = 1;
|
|
13
|
+
/** Largest answer, as JSON. A page of long hits can exceed it before 50 hits: the page then ends
|
|
14
|
+
* early with a cursor at the cut. */
|
|
15
|
+
export const SEARCH_MAX_OUTPUT_BYTES = 64 * 1024;
|
|
16
|
+
export const SEARCH_LIMITS = Object.freeze({
|
|
17
|
+
/** Largest query, UTF-8 bytes. */
|
|
18
|
+
maxQueryBytes: 1_024,
|
|
19
|
+
/** Distinct normalized query terms. */
|
|
20
|
+
maxQueryTerms: 16,
|
|
21
|
+
defaultRows: 10,
|
|
22
|
+
maxRows: 50,
|
|
23
|
+
/** Excerpt length, UTF-8 bytes. */
|
|
24
|
+
excerptBytes: 512,
|
|
25
|
+
/** Largest exact `type` or `tag` filter, UTF-8 bytes (the kernel query's filter bound). */
|
|
26
|
+
maxFilterBytes: 256,
|
|
27
|
+
/** Largest id `prefix` filter, UTF-8 bytes (a document id's bound). */
|
|
28
|
+
maxPrefixBytes: 512,
|
|
29
|
+
/** Largest cursor, UTF-8 bytes. */
|
|
30
|
+
maxCursorBytes: 2_048,
|
|
31
|
+
/** Values per facet, most frequent first. */
|
|
32
|
+
maxFacetValues: 50,
|
|
33
|
+
// Index limits, enforced while an in-memory index is built.
|
|
34
|
+
maxIndexDocuments: 20_000,
|
|
35
|
+
maxIndexSourceBytes: 67_108_864,
|
|
36
|
+
/** portal-webmcp's V1 value: a long document is indexed whole, never truncated; one over it is
|
|
37
|
+
* left out of the index and counted as skipped. */
|
|
38
|
+
maxTermsPerDocument: 65_536,
|
|
39
|
+
/** The default and ceiling of `searchDocuments`' `maxEvidenceInstances`: the most capped term
|
|
40
|
+
* instances a request's terms may hold across a corpus before it is refused as too broad. */
|
|
41
|
+
maxEvidenceInstances: 400_000,
|
|
42
|
+
});
|
|
43
|
+
/** Body occurrences of one distinct query term that can still add score. */
|
|
44
|
+
export const BODY_OCCURRENCE_CAP = 20;
|
|
45
|
+
/** Bytes an excerpt may reach behind its first body match before the match starts. */
|
|
46
|
+
export const EXCERPT_LEAD_BYTES = 256;
|
|
47
|
+
/** Documents processed between cancellation checks. */
|
|
48
|
+
export const SIGNAL_INTERVAL = 128;
|
|
49
|
+
export const SEARCH_MATCHES = Object.freeze(["auto", "all", "any"]);
|
|
50
|
+
export const SEARCH_FACETS = Object.freeze(["type", "tags"]);
|
|
51
|
+
export const SEARCH_MATCH_FIELDS = Object.freeze(["title", "type", "tag", "description", "id", "body"]);
|
|
52
|
+
export const SEARCH_GUIDANCE = Object.freeze({
|
|
53
|
+
all: 'No document contains every query term. Retry with match "any", fewer terms, or different exact filters.',
|
|
54
|
+
any: "No document contains any searchable query term. Try domain-specific keywords or remove exact type and tag filters.",
|
|
55
|
+
/** The refusal of a request whose terms occur too often to rank (`maxEvidenceInstances`). */
|
|
56
|
+
broad: "The query's terms occur too often in this corpus to rank. Retry with fewer or more specific terms.",
|
|
57
|
+
});
|
|
58
|
+
// The one place that decides which frontmatter members become searchable or displayable fields;
|
|
59
|
+
// nothing here reinterprets Markdown or adds Kind semantics.
|
|
60
|
+
function stringMember(frontmatter, key) {
|
|
61
|
+
const value = frontmatter[key];
|
|
62
|
+
return typeof value === "string" ? value : undefined;
|
|
63
|
+
}
|
|
64
|
+
export function documentTitle(document) {
|
|
65
|
+
return stringMember(document.frontmatter, "title");
|
|
66
|
+
}
|
|
67
|
+
export function documentType(document) {
|
|
68
|
+
return stringMember(document.frontmatter, "type");
|
|
69
|
+
}
|
|
70
|
+
export function documentDescription(document) {
|
|
71
|
+
return stringMember(document.frontmatter, "description");
|
|
72
|
+
}
|
|
73
|
+
/** Declared string tags only; a non-array or non-string member contributes nothing. */
|
|
74
|
+
export function documentTags(document) {
|
|
75
|
+
const value = document.frontmatter["tags"];
|
|
76
|
+
return Array.isArray(value) ? value.filter((entry) => typeof entry === "string") : [];
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=contract.js.map
|