@superbee/core 0.2.0-pre.3 → 0.2.0-pre.30
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 +1082 -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 +19 -1
- package/dist/backend.d.ts.map +1 -1
- package/dist/backend.js +83 -36
- package/dist/backend.js.map +1 -1
- package/dist/blob-contract.d.ts +80 -0
- package/dist/blob-contract.d.ts.map +1 -0
- package/dist/blob-contract.js +131 -0
- package/dist/blob-contract.js.map +1 -0
- package/dist/blob-journal.d.ts +302 -0
- package/dist/blob-journal.d.ts.map +1 -0
- package/dist/blob-journal.js +540 -0
- package/dist/blob-journal.js.map +1 -0
- package/dist/body-replace-guards.d.ts +52 -0
- package/dist/body-replace-guards.d.ts.map +1 -0
- package/dist/body-replace-guards.js +176 -0
- package/dist/body-replace-guards.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.d.ts +10 -0
- package/dist/builtin-recipes.d.ts.map +1 -0
- package/dist/builtin-recipes.js +97 -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 +68 -0
- package/dist/bundle-health/kind-findings.js.map +1 -0
- package/dist/bundle-health/legacy-page.d.ts +39 -0
- package/dist/bundle-health/legacy-page.d.ts.map +1 -0
- package/dist/bundle-health/legacy-page.js +50 -0
- package/dist/bundle-health/legacy-page.js.map +1 -0
- package/dist/bundle-health/report.d.ts +202 -0
- package/dist/bundle-health/report.d.ts.map +1 -0
- package/dist/bundle-health/report.js +438 -0
- package/dist/bundle-health/report.js.map +1 -0
- package/dist/bundle-ops.d.ts +1 -1
- package/dist/bundle-ops.d.ts.map +1 -1
- package/dist/bundle-ops.js +2 -2
- package/dist/bundle-ops.js.map +1 -1
- package/dist/bundle.d.ts +2 -1
- package/dist/bundle.d.ts.map +1 -1
- package/dist/bundle.js +3 -3
- 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/connector-request.d.ts +87 -0
- package/dist/connector-request.d.ts.map +1 -0
- package/dist/connector-request.js +370 -0
- package/dist/connector-request.js.map +1 -0
- package/dist/connectors.d.ts +262 -0
- package/dist/connectors.d.ts.map +1 -0
- package/dist/connectors.js +1179 -0
- package/dist/connectors.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 +186 -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 +5 -1
- package/dist/document-codec.d.ts.map +1 -1
- package/dist/document-codec.js +7 -4
- 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 +22 -10
- package/dist/document-mutation.d.ts.map +1 -1
- package/dist/document-mutation.js +61 -27
- package/dist/document-mutation.js.map +1 -1
- 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 +16 -8
- package/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +42 -4
- package/dist/engine.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-host.d.ts +15 -0
- package/dist/filesystem-host.d.ts.map +1 -0
- package/dist/filesystem-host.js +20 -0
- package/dist/filesystem-host.js.map +1 -0
- package/dist/filesystem-identity.d.ts +86 -4
- package/dist/filesystem-identity.d.ts.map +1 -1
- package/dist/filesystem-identity.js +338 -102
- package/dist/filesystem-identity.js.map +1 -1
- package/dist/filesystem-lock.d.ts +16 -3
- package/dist/filesystem-lock.d.ts.map +1 -1
- package/dist/filesystem-lock.js +323 -77
- 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.d.ts +17 -0
- package/dist/filesystem.d.ts.map +1 -0
- package/dist/filesystem.js +18 -0
- package/dist/filesystem.js.map +1 -0
- package/dist/governed-body-write.d.ts +106 -0
- package/dist/governed-body-write.d.ts.map +1 -0
- package/dist/governed-body-write.js +251 -0
- package/dist/governed-body-write.js.map +1 -0
- package/dist/host-policy-snapshot.d.ts +9 -0
- package/dist/host-policy-snapshot.d.ts.map +1 -0
- package/dist/host-policy-snapshot.js +33 -0
- package/dist/host-policy-snapshot.js.map +1 -0
- 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 +67 -0
- package/dist/hosted-client/blob-delivery.d.ts.map +1 -0
- package/dist/hosted-client/blob-delivery.js +169 -0
- package/dist/hosted-client/blob-delivery.js.map +1 -0
- package/dist/hosted-client/blob-write.d.ts +386 -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 +219 -0
- package/dist/hosted-client/client.d.ts.map +1 -0
- package/dist/hosted-client/client.js +309 -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 +30 -0
- package/dist/hosted-client/index.d.ts.map +1 -0
- package/dist/hosted-client/index.js +32 -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/write.d.ts +217 -0
- package/dist/hosted-client/write.d.ts.map +1 -0
- package/dist/hosted-client/write.js +418 -0
- package/dist/hosted-client/write.js.map +1 -0
- package/dist/hosted-transport/answer-rows.d.ts +243 -0
- package/dist/hosted-transport/answer-rows.d.ts.map +1 -0
- package/dist/hosted-transport/answer-rows.js +454 -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 +151 -0
- package/dist/hosted-transport/carrier.d.ts.map +1 -0
- package/dist/hosted-transport/carrier.js +260 -0
- package/dist/hosted-transport/carrier.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 +18 -0
- package/dist/hosted-transport/index.d.ts.map +1 -0
- package/dist/hosted-transport/index.js +18 -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/read-adapter.d.ts +256 -0
- package/dist/hosted-transport/read-adapter.d.ts.map +1 -0
- package/dist/hosted-transport/read-adapter.js +568 -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 +171 -0
- package/dist/hosted-transport/root-write.js.map +1 -0
- package/dist/hosted-transport/whole-document-transport.d.ts +204 -0
- package/dist/hosted-transport/whole-document-transport.d.ts.map +1 -0
- package/dist/hosted-transport/whole-document-transport.js +447 -0
- package/dist/hosted-transport/whole-document-transport.js.map +1 -0
- package/dist/index.d.ts +34 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +26 -8
- package/dist/index.js.map +1 -1
- package/dist/indexeddb-backend.d.ts +28 -37
- package/dist/indexeddb-backend.d.ts.map +1 -1
- package/dist/indexeddb-backend.js +467 -113
- package/dist/indexeddb-backend.js.map +1 -1
- package/dist/journaled-backend.d.ts +232 -15
- package/dist/journaled-backend.d.ts.map +1 -1
- package/dist/journaled-backend.js +254 -55
- package/dist/journaled-backend.js.map +1 -1
- package/dist/kind-authoring.d.ts +170 -0
- package/dist/kind-authoring.d.ts.map +1 -0
- package/dist/kind-authoring.js +451 -0
- package/dist/kind-authoring.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 +99 -0
- package/dist/kind-coverage.d.ts.map +1 -0
- package/dist/kind-coverage.js +186 -0
- package/dist/kind-coverage.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/kinds-load.js +4 -4
- package/dist/kinds-load.js.map +1 -1
- package/dist/kinds.d.ts +65 -2
- package/dist/kinds.d.ts.map +1 -1
- package/dist/kinds.js +341 -21
- package/dist/kinds.js.map +1 -1
- package/dist/link-types.d.ts +26 -0
- package/dist/link-types.d.ts.map +1 -0
- package/dist/link-types.js +57 -0
- package/dist/link-types.js.map +1 -0
- package/dist/links.d.ts +21 -3
- package/dist/links.d.ts.map +1 -1
- package/dist/links.js +213 -14
- 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.map +1 -1
- package/dist/memory-backend.js +6 -2
- package/dist/memory-backend.js.map +1 -1
- package/dist/paths.d.ts +16 -0
- package/dist/paths.d.ts.map +1 -1
- package/dist/paths.js +25 -0
- package/dist/paths.js.map +1 -1
- package/dist/platform.d.ts +13 -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/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 -2
- package/dist/query-filter.d.ts.map +1 -1
- package/dist/query-filter.js +40 -1
- 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 +42 -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 +112 -0
- package/dist/recipe-lifecycle/evolution.d.ts.map +1 -0
- package/dist/recipe-lifecycle/evolution.js +941 -0
- package/dist/recipe-lifecycle/evolution.js.map +1 -0
- package/dist/recipe-lifecycle/index.d.ts +30 -0
- package/dist/recipe-lifecycle/index.d.ts.map +1 -0
- package/dist/recipe-lifecycle/index.js +26 -0
- package/dist/recipe-lifecycle/index.js.map +1 -0
- package/dist/recipe-lifecycle/install.d.ts +155 -0
- package/dist/recipe-lifecycle/install.d.ts.map +1 -0
- package/dist/recipe-lifecycle/install.js +594 -0
- package/dist/recipe-lifecycle/install.js.map +1 -0
- package/dist/recipe-lifecycle/legacy-aliases.d.ts +16 -0
- package/dist/recipe-lifecycle/legacy-aliases.d.ts.map +1 -0
- package/dist/recipe-lifecycle/legacy-aliases.js +51 -0
- package/dist/recipe-lifecycle/legacy-aliases.js.map +1 -0
- package/dist/recipe-lifecycle/stamp.d.ts +151 -0
- package/dist/recipe-lifecycle/stamp.d.ts.map +1 -0
- package/dist/recipe-lifecycle/stamp.js +364 -0
- package/dist/recipe-lifecycle/stamp.js.map +1 -0
- package/dist/recipes.d.ts +29 -1
- package/dist/recipes.d.ts.map +1 -1
- package/dist/recipes.js +137 -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 +527 -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 +83 -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 +69 -0
- package/dist/record-overlay/policy.d.ts.map +1 -0
- package/dist/record-overlay/policy.js +228 -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 +45 -0
- package/dist/record-overlay/signal-text.d.ts.map +1 -0
- package/dist/record-overlay/signal-text.js +116 -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/remote-backend.d.ts +67 -67
- package/dist/remote-backend.d.ts.map +1 -1
- package/dist/remote-backend.js +168 -201
- 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 +38 -0
- package/dist/remote-error.d.ts.map +1 -0
- package/dist/remote-error.js +59 -0
- package/dist/remote-error.js.map +1 -0
- package/dist/remote-operations.d.ts +0 -40
- package/dist/remote-operations.d.ts.map +1 -1
- package/dist/remote-operations.js +26 -6
- package/dist/remote-operations.js.map +1 -1
- package/dist/remote-parsers.d.ts +86 -0
- package/dist/remote-parsers.d.ts.map +1 -0
- package/dist/remote-parsers.js +181 -0
- package/dist/remote-parsers.js.map +1 -0
- package/dist/remote.d.ts +5 -2
- package/dist/remote.d.ts.map +1 -1
- package/dist/remote.js +5 -1
- package/dist/remote.js.map +1 -1
- 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 +33 -0
- package/dist/search/backend-source.js.map +1 -0
- package/dist/search/contract.d.ts +151 -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 +235 -0
- package/dist/search/memory-source.js.map +1 -0
- package/dist/search/rank.d.ts +34 -0
- package/dist/search/rank.d.ts.map +1 -0
- package/dist/search/rank.js +129 -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 +257 -0
- package/dist/search/search.js.map +1 -0
- package/dist/search/source.d.ts +67 -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/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/source-engine/guard.d.ts +78 -0
- package/dist/source-engine/guard.d.ts.map +1 -0
- package/dist/source-engine/guard.js +423 -0
- package/dist/source-engine/guard.js.map +1 -0
- package/dist/source-engine/index.d.ts +26 -0
- package/dist/source-engine/index.d.ts.map +1 -0
- package/dist/source-engine/index.js +21 -0
- package/dist/source-engine/index.js.map +1 -0
- package/dist/source-engine/machine-state.d.ts +74 -0
- package/dist/source-engine/machine-state.d.ts.map +1 -0
- package/dist/source-engine/machine-state.js +48 -0
- package/dist/source-engine/machine-state.js.map +1 -0
- package/dist/source-engine/observe.d.ts +18 -0
- package/dist/source-engine/observe.d.ts.map +1 -0
- package/dist/source-engine/observe.js +620 -0
- package/dist/source-engine/observe.js.map +1 -0
- package/dist/source-engine/overlay.d.ts +49 -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/types.d.ts +287 -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 +95 -0
- package/dist/source-harness/fixture.d.ts.map +1 -0
- package/dist/source-harness/fixture.js +273 -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 +6 -2
- package/dist/storage.d.ts.map +1 -1
- package/dist/storage.js +4 -1
- package/dist/storage.js.map +1 -1
- package/dist/types.d.ts +38 -5
- 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 +161 -19
- package/dist/uncertain-write.d.ts.map +1 -1
- package/dist/uncertain-write.js +90 -31
- package/dist/uncertain-write.js.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/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 +103 -2
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The search text rules, one owner: normalization, tokenization, the body scanner that keeps original
|
|
3
|
+
* byte offsets, query normalization and the automatic fallback's relaxation, plus the UTF-8 helpers
|
|
4
|
+
* excerpts need. Moved unchanged from portal-webmcp 0.3.1 (`search.ts`, `text.ts`).
|
|
5
|
+
*/
|
|
6
|
+
const encoder = new TextEncoder();
|
|
7
|
+
const decoder = new TextDecoder("utf-8", { fatal: false, ignoreBOM: false });
|
|
8
|
+
export function utf8(value) {
|
|
9
|
+
return encoder.encode(value);
|
|
10
|
+
}
|
|
11
|
+
export function utf8ByteLength(value) {
|
|
12
|
+
return encoder.encode(value).byteLength;
|
|
13
|
+
}
|
|
14
|
+
function continuation(byte) {
|
|
15
|
+
return byte !== undefined && (byte & 0b1100_0000) === 0b1000_0000;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Move an index forward until it starts a UTF-8 sequence. A slice that begins on
|
|
19
|
+
* a continuation byte would decode to a replacement character, so continuations
|
|
20
|
+
* are skipped rather than replaced.
|
|
21
|
+
*/
|
|
22
|
+
export function forwardBoundary(bytes, index) {
|
|
23
|
+
let cursor = Math.max(0, Math.min(index, bytes.byteLength));
|
|
24
|
+
while (cursor < bytes.byteLength && continuation(bytes[cursor]))
|
|
25
|
+
cursor += 1;
|
|
26
|
+
return cursor;
|
|
27
|
+
}
|
|
28
|
+
/** Move an index backward until it ends a complete UTF-8 sequence. */
|
|
29
|
+
export function backwardBoundary(bytes, index) {
|
|
30
|
+
let cursor = Math.max(0, Math.min(index, bytes.byteLength));
|
|
31
|
+
while (cursor > 0 && continuation(bytes[cursor]))
|
|
32
|
+
cursor -= 1;
|
|
33
|
+
return cursor;
|
|
34
|
+
}
|
|
35
|
+
export function decodeUtf8(bytes, start, end) {
|
|
36
|
+
return decoder.decode(bytes.subarray(start, end));
|
|
37
|
+
}
|
|
38
|
+
/** Collapse every maximal whitespace run to one ASCII space and trim both ends. */
|
|
39
|
+
export function collapseWhitespace(value) {
|
|
40
|
+
return value.replace(/\s+/gu, " ").trim();
|
|
41
|
+
}
|
|
42
|
+
const TOKEN = /[\p{L}\p{N}]+/gu;
|
|
43
|
+
const LETTER_OR_NUMBER = /[\p{L}\p{N}]/u;
|
|
44
|
+
const MARK = /\p{M}/u;
|
|
45
|
+
/** Locale-independent normalization: Unicode NFKC then `toLowerCase()`. */
|
|
46
|
+
export function normalize(value) {
|
|
47
|
+
return value.normalize("NFKC").toLowerCase();
|
|
48
|
+
}
|
|
49
|
+
/** Tokenization into maximal Unicode letter-or-number sequences of the normalized text. */
|
|
50
|
+
export function tokenize(value) {
|
|
51
|
+
return [...normalize(value).matchAll(TOKEN)].map((match) => match[0]);
|
|
52
|
+
}
|
|
53
|
+
/** A field's normalized phrase is its tokens joined by one ASCII space. */
|
|
54
|
+
export function phrase(value) {
|
|
55
|
+
return tokenize(value).join(" ");
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Whether an original character can belong to a token run.
|
|
59
|
+
*
|
|
60
|
+
* Body tokens must keep original byte offsets, so the body is segmented before
|
|
61
|
+
* normalization rather than after. A character joins a run when it is a letter
|
|
62
|
+
* or number, a combining mark (so a decomposed sequence composes inside its own
|
|
63
|
+
* run), or a compatibility character whose NFKC form contains a letter or
|
|
64
|
+
* number. NFKC never composes across a character outside that set, so run-wise
|
|
65
|
+
* tokenization yields the same terms as tokenizing the whole normalized field.
|
|
66
|
+
*/
|
|
67
|
+
const runMembership = new Map();
|
|
68
|
+
function inTokenRun(character) {
|
|
69
|
+
const cached = runMembership.get(character);
|
|
70
|
+
if (cached !== undefined)
|
|
71
|
+
return cached;
|
|
72
|
+
const member = LETTER_OR_NUMBER.test(character) || MARK.test(character) || LETTER_OR_NUMBER.test(character.normalize("NFKC"));
|
|
73
|
+
runMembership.set(character, member);
|
|
74
|
+
return member;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Visits every body token in document order with the original UTF-8 byte range of the run that
|
|
78
|
+
* produced it (every token of one run shares its range). `visit` returns `true` to stop the scan.
|
|
79
|
+
* The in-memory index and the excerpt both read the body through this one scanner, so a match's
|
|
80
|
+
* offsets are the same wherever they are computed.
|
|
81
|
+
*/
|
|
82
|
+
export function scanBody(body, visit) {
|
|
83
|
+
let byteOffset = 0;
|
|
84
|
+
let runStart = 0;
|
|
85
|
+
let run = "";
|
|
86
|
+
let stopped = false;
|
|
87
|
+
const flush = () => {
|
|
88
|
+
if (run.length === 0)
|
|
89
|
+
return;
|
|
90
|
+
for (const match of normalize(run).matchAll(TOKEN)) {
|
|
91
|
+
if (visit(match[0], runStart, byteOffset) === true) {
|
|
92
|
+
stopped = true;
|
|
93
|
+
break;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
run = "";
|
|
97
|
+
};
|
|
98
|
+
for (const character of body) {
|
|
99
|
+
if (inTokenRun(character)) {
|
|
100
|
+
if (run.length === 0)
|
|
101
|
+
runStart = byteOffset;
|
|
102
|
+
run += character;
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
flush();
|
|
106
|
+
if (stopped)
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
// for-of yields one code point; lone surrogates encode as the three-byte replacement character.
|
|
110
|
+
const point = character.codePointAt(0);
|
|
111
|
+
byteOffset += point <= 0x7f ? 1 : point <= 0x7ff ? 2 : point <= 0xffff ? 3 : 4;
|
|
112
|
+
}
|
|
113
|
+
flush();
|
|
114
|
+
}
|
|
115
|
+
/** Duplicate query tokens collapse after their first occurrence; the phrase is the remainder. */
|
|
116
|
+
export function normalizeQuery(query) {
|
|
117
|
+
const terms = [];
|
|
118
|
+
const seen = new Set();
|
|
119
|
+
for (const token of tokenize(query)) {
|
|
120
|
+
if (seen.has(token))
|
|
121
|
+
continue;
|
|
122
|
+
seen.add(token);
|
|
123
|
+
terms.push(token);
|
|
124
|
+
}
|
|
125
|
+
return { phrase: terms.join(" "), terms: Object.freeze(terms) };
|
|
126
|
+
}
|
|
127
|
+
// Fixed package text, deliberately not locale-sensitive. These words carry
|
|
128
|
+
// little retrieval signal in ordinary English questions. They are removed only
|
|
129
|
+
// by the automatic fallback, never by explicit `all` or `any` matching.
|
|
130
|
+
// prettier-ignore
|
|
131
|
+
const CONVERSATIONAL_TERMS = new Set([
|
|
132
|
+
"a", "an", "and", "are", "as", "at", "be", "by", "can", "did", "do", "does",
|
|
133
|
+
"for", "from", "how", "in", "is", "it", "of", "on", "or", "should", "that", "the",
|
|
134
|
+
"this", "to", "was", "what", "when", "where", "which", "who", "why", "will", "with",
|
|
135
|
+
]);
|
|
136
|
+
/**
|
|
137
|
+
* Removes fixed conversational terms for automatic any-term fallback. If that
|
|
138
|
+
* would remove the whole query, the original normalized query stays intact.
|
|
139
|
+
*/
|
|
140
|
+
export function relaxQuery(query) {
|
|
141
|
+
const terms = query.terms.filter((term) => !CONVERSATIONAL_TERMS.has(term));
|
|
142
|
+
if (terms.length === 0)
|
|
143
|
+
return { query, ignoredTerms: Object.freeze([]) };
|
|
144
|
+
const kept = new Set(terms);
|
|
145
|
+
return {
|
|
146
|
+
query: { phrase: terms.join(" "), terms: Object.freeze(terms) },
|
|
147
|
+
ignoredTerms: Object.freeze(query.terms.filter((term) => !kept.has(term))),
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
//# sourceMappingURL=text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text.js","sourceRoot":"","sources":["../../src/search/text.ts"],"names":[],"mappings":"AAAA;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,EAAE,MAAM,EAAE,MAAM;CACpF,CAAC,CAAC;AAOH;;;GAGG;AACH,MAAM,UAAU,UAAU,CAAC,KAAwB;IACjD,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,oBAAoB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;IAC5E,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC;IAC1E,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC;IAC5B,OAAO;QACL,KAAK,EAAE,EAAE,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;QAC/D,YAAY,EAAE,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;KAC3E,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP tool hints, plus Portal's `untrustedContentHint` and `privateInputHint`. Other keys pass
|
|
3
|
+
* through unchanged.
|
|
4
|
+
*
|
|
5
|
+
* These are self-declared: a capability states them about itself and nothing at runtime enforces
|
|
6
|
+
* them. `checkSiteCapability` tests recorded fixtures, and `composeSiteCapabilities` with
|
|
7
|
+
* `requireReadOnly` refuses a capability that does not declare `readOnlyHint: true`, but neither
|
|
8
|
+
* proves what the code does. They are acceptable as a control only for in-process code from the
|
|
9
|
+
* same reviewed deploy; never cite them as a control for code a host did not review.
|
|
10
|
+
*/
|
|
11
|
+
export interface SiteCapabilityAnnotations {
|
|
12
|
+
readonly readOnlyHint?: boolean;
|
|
13
|
+
readonly destructiveHint?: boolean;
|
|
14
|
+
readonly idempotentHint?: boolean;
|
|
15
|
+
readonly openWorldHint?: boolean;
|
|
16
|
+
/** The result carries text authored or copied by others: a model must treat it as data. */
|
|
17
|
+
readonly untrustedContentHint?: boolean;
|
|
18
|
+
/** The input may carry private data: a surface takes it only in a request body (POST) and never caches or stores it. */
|
|
19
|
+
readonly privateInputHint?: boolean;
|
|
20
|
+
readonly [hint: string]: unknown;
|
|
21
|
+
}
|
|
22
|
+
/** What a surface passes to `execute`. Every surface passes `signal`; a provider adapter also
|
|
23
|
+
* passes its `toolCallId`; a host that pins the clock (fixtures, evals) passes `now`. */
|
|
24
|
+
export interface SiteCapabilityInvocation {
|
|
25
|
+
readonly signal: AbortSignal;
|
|
26
|
+
readonly toolCallId?: string;
|
|
27
|
+
/** Milliseconds since the epoch. A capability reads the clock only through this when present. */
|
|
28
|
+
readonly now?: () => number;
|
|
29
|
+
}
|
|
30
|
+
/** A citable record in a successful result. The host mints source IDs from these; the tool never
|
|
31
|
+
* does (`siteRecordSource`). */
|
|
32
|
+
export interface SiteRecordCitation {
|
|
33
|
+
/** The record's stable ID, as it appears in the result. */
|
|
34
|
+
readonly recordId: string;
|
|
35
|
+
/** The record's same-origin page path, such as `/fairport/places/lift-bridge`. */
|
|
36
|
+
readonly path: string;
|
|
37
|
+
/** When the record's data was current (ISO 8601). */
|
|
38
|
+
readonly asOf: string;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* A tool a site or a recipe pack provides.
|
|
42
|
+
*
|
|
43
|
+
* How it maps onto the existing tool shapes (each mapping is a function below, so no caller relies
|
|
44
|
+
* on structural luck):
|
|
45
|
+
* - Portal `PortalWebMcpAdditionalToolV0` (`@superbee/portal-webmcp` 0.3.x `additionalTools`,
|
|
46
|
+
* restated here as `PortalAdditionalTool`): a `SiteCapability` is assignable to it, and Portal's
|
|
47
|
+
* registration keeps only the fields it binds. `toPortalAdditionalTool` makes that explicit;
|
|
48
|
+
* `siteCapabilityFromPortalTool` maps the other way.
|
|
49
|
+
* - The hosted provider port's `AgentProviderTool` (`name`, `description`, `inputSchema`,
|
|
50
|
+
* `execute(input, { signal, toolCallId })`): assignable; `toProviderTool` keeps only those fields.
|
|
51
|
+
* - The hosted `ToolDescriptor`, whose `execute` takes an optional invocation with an optional
|
|
52
|
+
* signal: NOT assignable, because a capability always receives a signal. `toToolDescriptor`
|
|
53
|
+
* supplies one.
|
|
54
|
+
*/
|
|
55
|
+
export interface SiteCapability<Result = unknown> {
|
|
56
|
+
/** `^[a-z][a-z0-9_]{2,63}$`: valid for MCP, WebMCP, the Messages API and Managed Agents. */
|
|
57
|
+
readonly name: string;
|
|
58
|
+
/** Stable identity of this implementation, as Portal's `implementationId`: a changed meaning
|
|
59
|
+
* behind an unchanged schema gets a new one. */
|
|
60
|
+
readonly implementationId: string;
|
|
61
|
+
readonly title?: string;
|
|
62
|
+
readonly description: string;
|
|
63
|
+
/** JSON Schema of the input, with `type: "object"`. */
|
|
64
|
+
readonly inputSchema: Readonly<Record<string, unknown>>;
|
|
65
|
+
readonly outputSchema?: Readonly<Record<string, unknown>>;
|
|
66
|
+
readonly annotations?: SiteCapabilityAnnotations;
|
|
67
|
+
/** Largest serialized result in UTF-8 bytes. Defaults to `DEFAULT_MAXIMUM_OUTPUT_BYTES`. */
|
|
68
|
+
readonly maximumOutputBytes?: number;
|
|
69
|
+
/** Runs the capability. Failures a caller can act on are results (`{ ok: false, error }`), not
|
|
70
|
+
* throws; a throw is a fault. */
|
|
71
|
+
execute(input: unknown, invocation: SiteCapabilityInvocation): Promise<Result>;
|
|
72
|
+
/** The citable records in a successful result. Never called on a failed result. */
|
|
73
|
+
mintSources?(result: Result): readonly SiteRecordCitation[];
|
|
74
|
+
}
|
|
75
|
+
/** Serializable capability identity, also used by deliberately trusted local actions.
|
|
76
|
+
* Read-only conformance remains the separate checkSiteCapability contract. */
|
|
77
|
+
export type SiteCapabilityMetadata = Omit<SiteCapability, "execute" | "mintSources">;
|
|
78
|
+
/** Portal's `PortalWebMcpAdditionalToolV0` (`@superbee/portal-webmcp` 0.3.1, `registration.d.ts`),
|
|
79
|
+
* restated so this package stays dependency-free. */
|
|
80
|
+
export interface PortalAdditionalTool {
|
|
81
|
+
readonly name: string;
|
|
82
|
+
readonly implementationId: string;
|
|
83
|
+
readonly description: string;
|
|
84
|
+
readonly inputSchema: Readonly<Record<string, unknown>>;
|
|
85
|
+
readonly annotations?: Readonly<Record<string, unknown>>;
|
|
86
|
+
execute(input: unknown, context: {
|
|
87
|
+
signal: AbortSignal;
|
|
88
|
+
}): Promise<unknown>;
|
|
89
|
+
}
|
|
90
|
+
/** A host-minted citation of one site record. Like a Portal document source it binds the
|
|
91
|
+
* publication the record was read from, so a citation names exact bytes, not only a date. */
|
|
92
|
+
export interface SiteRecordSourceRef {
|
|
93
|
+
readonly sourceId: string;
|
|
94
|
+
readonly kind: "site-record";
|
|
95
|
+
readonly siteId: string;
|
|
96
|
+
readonly recordId: string;
|
|
97
|
+
readonly path: string;
|
|
98
|
+
readonly asOf: string;
|
|
99
|
+
readonly artifactDigest: string;
|
|
100
|
+
readonly snapshotDigest: string;
|
|
101
|
+
}
|
|
102
|
+
export declare const SITE_CAPABILITY_NAME_PATTERN: RegExp;
|
|
103
|
+
/** Package-owned tools only (Portal's `PORTAL_WEBMCP_RESERVED_PREFIX_V0`). */
|
|
104
|
+
export declare const RESERVED_TOOL_PREFIX = "superbee_";
|
|
105
|
+
export declare const DEFAULT_MAXIMUM_OUTPUT_BYTES = 65536;
|
|
106
|
+
/** The closed error-code set a site capability's `{ ok: false }` results use by default. */
|
|
107
|
+
export declare const SITE_CAPABILITY_ERROR_CODES: readonly ["INVALID_INPUT", "NOT_FOUND", "AMBIGUOUS", "NOT_AVAILABLE"];
|
|
108
|
+
export declare const utf8Bytes: (text: string) => number;
|
|
109
|
+
/**
|
|
110
|
+
* JSON with object keys sorted at every depth, so equal values serialize to equal bytes. Throws on
|
|
111
|
+
* anything JSON cannot carry exactly: functions, symbols, `undefined` array items, non-finite
|
|
112
|
+
* numbers, bigints and cycles. Object properties whose value is `undefined` are omitted, as
|
|
113
|
+
* `JSON.stringify` does.
|
|
114
|
+
*/
|
|
115
|
+
export declare function canonicalJson(value: unknown): string;
|
|
116
|
+
/**
|
|
117
|
+
* Whether `path` is a plain same-origin page path: absolute, not protocol-relative, no query,
|
|
118
|
+
* fragment, backslash, control character, encoded slash or dot segment, and unchanged by URL
|
|
119
|
+
* normalization. The same checks as agent-surface's `portalAssistantRoute`. Syntax only: a path
|
|
120
|
+
* such as `/a/%252e%252e/b` or `/a/..;/b` passes, so the host's route-membership check
|
|
121
|
+
* (`admittedPath` in `siteRecordSource`) must still refuse any path it does not serve.
|
|
122
|
+
*/
|
|
123
|
+
export declare function isSafeSitePath(path: unknown): path is string;
|
|
124
|
+
/**
|
|
125
|
+
* The host-minted `site-record` source for one citation a capability returned, or `undefined`
|
|
126
|
+
* when the citation is malformed, its path is not a safe same-origin path, or the path is not one
|
|
127
|
+
* the host admits. `sourceId` is the host's own ID for this read; a model-produced ID or URL never
|
|
128
|
+
* mints a source. `admittedPath` is the host's route-membership check (the publication's
|
|
129
|
+
* digest-bound route list, or the build's route list): syntax alone does not admit a path.
|
|
130
|
+
*/
|
|
131
|
+
export declare function siteRecordSource(options: {
|
|
132
|
+
sourceId: string;
|
|
133
|
+
siteId: string;
|
|
134
|
+
/** The publication the capability read: its artifact and snapshot digests. */
|
|
135
|
+
publication: {
|
|
136
|
+
artifactDigest: string;
|
|
137
|
+
snapshotDigest: string;
|
|
138
|
+
};
|
|
139
|
+
citation: SiteRecordCitation;
|
|
140
|
+
admittedPath: (path: string) => boolean;
|
|
141
|
+
}): SiteRecordSourceRef | undefined;
|
|
142
|
+
/**
|
|
143
|
+
* Portal's `additionalTools` shape as a `SiteCapability`. The Portal tool keeps receiving exactly
|
|
144
|
+
* `{ signal }`; `extras` adds what Portal's shape has no field for. The reverse needs no adapter:
|
|
145
|
+
* a `SiteCapability` is already a valid `PortalAdditionalTool`.
|
|
146
|
+
*/
|
|
147
|
+
export declare function siteCapabilityFromPortalTool(tool: PortalAdditionalTool, extras?: Pick<SiteCapability, "title" | "outputSchema" | "maximumOutputBytes" | "mintSources">): SiteCapability;
|
|
148
|
+
/** Portal's `additionalTools` entry for a capability: exactly the fields Portal binds, with the
|
|
149
|
+
* capability receiving `{ signal }`. */
|
|
150
|
+
export declare function toPortalAdditionalTool(capability: SiteCapability): PortalAdditionalTool;
|
|
151
|
+
/** The provider port's tool shape (hosted `AgentProviderTool`): name, description, input schema
|
|
152
|
+
* and `execute(input, { signal, toolCallId })`. */
|
|
153
|
+
export declare function toProviderTool(capability: SiteCapability): {
|
|
154
|
+
name: string;
|
|
155
|
+
description: string;
|
|
156
|
+
inputSchema: Record<string, unknown>;
|
|
157
|
+
execute(input: unknown, invocation: {
|
|
158
|
+
signal: AbortSignal;
|
|
159
|
+
toolCallId: string;
|
|
160
|
+
}): Promise<unknown>;
|
|
161
|
+
};
|
|
162
|
+
/** The hosted `ToolDescriptor` shape, whose callers may omit the invocation or its signal; the
|
|
163
|
+
* capability then receives a signal that never aborts. */
|
|
164
|
+
export declare function toToolDescriptor(capability: SiteCapability): {
|
|
165
|
+
name: string;
|
|
166
|
+
description: string;
|
|
167
|
+
inputSchema: Record<string, unknown>;
|
|
168
|
+
annotations?: Record<string, unknown>;
|
|
169
|
+
execute(input: unknown, invocation?: {
|
|
170
|
+
signal?: AbortSignal;
|
|
171
|
+
}): Promise<unknown>;
|
|
172
|
+
};
|
|
173
|
+
/**
|
|
174
|
+
* One annotation set from several declarations of the same capability (for example a WebMCP
|
|
175
|
+
* declaration and an MCP declaration that each carry some hints). For the MCP hints the more
|
|
176
|
+
* cautious value wins: `readOnlyHint` and `idempotentHint` are true only if no set says false;
|
|
177
|
+
* `destructiveHint`, `openWorldHint`, `untrustedContentHint` and `privateInputHint` are true if any
|
|
178
|
+
* set says true. A hint a set leaves out does not count either way, so the result can carry a hint
|
|
179
|
+
* only some sets declared; MCP's defaults for absent hints (`readOnlyHint` false, `openWorldHint`
|
|
180
|
+
* true) apply only when no set declares it. Any other key must not disagree between sets; a
|
|
181
|
+
* disagreement throws.
|
|
182
|
+
*/
|
|
183
|
+
export declare function mergeAnnotations(...sets: readonly (SiteCapabilityAnnotations | undefined)[]): SiteCapabilityAnnotations;
|
|
184
|
+
/** The descriptor a surface shows a model: what the descriptor limits and the identity cover. */
|
|
185
|
+
export declare function siteCapabilityDescriptor(capability: SiteCapabilityMetadata): {
|
|
186
|
+
annotations?: SiteCapabilityAnnotations | undefined;
|
|
187
|
+
outputSchema?: Readonly<Record<string, unknown>> | undefined;
|
|
188
|
+
description: string;
|
|
189
|
+
inputSchema: Readonly<Record<string, unknown>>;
|
|
190
|
+
title?: string | undefined;
|
|
191
|
+
name: string;
|
|
192
|
+
};
|
|
193
|
+
/** Why a value is not a structurally valid `SiteCapability`, or `undefined` when it is. Checks the
|
|
194
|
+
* descriptor only; the name rules of a tier are compose's. */
|
|
195
|
+
export declare function siteCapabilityMetadataProblem(value: unknown): string | undefined;
|
|
196
|
+
/** The three tiers of site-capability design, composed in this order. */
|
|
197
|
+
export type SiteCapabilityTier = "generic" | "pack" | "site";
|
|
198
|
+
/** One declared list. `pack` and `site` lists own a namespace: each name starts with
|
|
199
|
+
* `<namespace>_` (`guide_open_now`, `hm_who_handles`). `generic` lists (the Portal snapshot reads,
|
|
200
|
+
* hosted reads) have none and alone may use the reserved `superbee_` prefix. */
|
|
201
|
+
export interface SiteCapabilityGroup {
|
|
202
|
+
readonly tier: SiteCapabilityTier;
|
|
203
|
+
readonly namespace?: string;
|
|
204
|
+
readonly capabilities: readonly SiteCapability[];
|
|
205
|
+
}
|
|
206
|
+
export interface SiteCapabilityLimits {
|
|
207
|
+
readonly maxTools: number;
|
|
208
|
+
/** Per descriptor (`siteCapabilityDescriptor`), canonical JSON in UTF-8 bytes. */
|
|
209
|
+
readonly maxDescriptorBytes: number;
|
|
210
|
+
/** All kept descriptors together. */
|
|
211
|
+
readonly maxTotalDescriptorBytes: number;
|
|
212
|
+
}
|
|
213
|
+
export declare const DEFAULT_SITE_CAPABILITY_LIMITS: SiteCapabilityLimits;
|
|
214
|
+
export interface ComposeSiteCapabilitiesOptions {
|
|
215
|
+
/** The surface this list is for (`hm-ask`, `webmcp`, `mcp`); part of the identity digest. */
|
|
216
|
+
readonly surface: string;
|
|
217
|
+
/** Names this surface does not offer. Applied after every conflict check, so a filter can never
|
|
218
|
+
* hide a conflict. Naming a capability that is not composed refuses. */
|
|
219
|
+
readonly exclude?: readonly string[];
|
|
220
|
+
/** Refuse any capability that does not declare `readOnlyHint: true`, or declares
|
|
221
|
+
* `destructiveHint: true`, in any tier (a static-site surface has no writes). Checked before
|
|
222
|
+
* `exclude`, so excluding a write tool does not make the list acceptable. The hints are
|
|
223
|
+
* self-declared (see `SiteCapabilityAnnotations`). */
|
|
224
|
+
readonly requireReadOnly?: boolean;
|
|
225
|
+
readonly limits?: Partial<SiteCapabilityLimits>;
|
|
226
|
+
}
|
|
227
|
+
export type SiteCapabilityCompositionRefusal =
|
|
228
|
+
/** The surface ID is empty or longer than 256 bytes. */
|
|
229
|
+
"invalid_surface"
|
|
230
|
+
/** A group has an unknown tier, a missing, invalid, reserved or repeated namespace, or a
|
|
231
|
+
* namespace on the generic tier. */
|
|
232
|
+
| "invalid_group"
|
|
233
|
+
/** A capability is not structurally valid (see `checkSiteCapability` for behavior). */
|
|
234
|
+
| "invalid_descriptor" | "duplicate_name"
|
|
235
|
+
/** A `superbee_` name outside the generic tier. */
|
|
236
|
+
| "reserved_prefix"
|
|
237
|
+
/** A pack or site name that does not start with its group's namespace. */
|
|
238
|
+
| "outside_namespace"
|
|
239
|
+
/** `requireReadOnly` and a capability that does not declare itself read-only. */
|
|
240
|
+
| "not_read_only" | "unknown_exclusion" | "too_many_tools" | "descriptor_too_large" | "total_too_large";
|
|
241
|
+
export type SiteCapabilityComposition = {
|
|
242
|
+
readonly ok: true;
|
|
243
|
+
readonly surface: string;
|
|
244
|
+
/** Frozen snapshots in composed order: generic, then packs, then site extras, each in
|
|
245
|
+
* declaration order. Pass them unchanged to a provider adapter, Portal registration or an
|
|
246
|
+
* MCP server. */
|
|
247
|
+
readonly capabilities: readonly SiteCapability[];
|
|
248
|
+
/** The tier of each entry of `capabilities`, index for index. */
|
|
249
|
+
readonly tiers: readonly SiteCapabilityTier[];
|
|
250
|
+
/** Names removed by `exclude`, in composed order. */
|
|
251
|
+
readonly dropped: readonly string[];
|
|
252
|
+
/** SHA-256 of the canonical JSON `{ schema: "superbee-site-capabilities/v1", surface, tools }`,
|
|
253
|
+
* where each tool is `{ tier, namespace, implementationId, maximumOutputBytes, descriptor }`
|
|
254
|
+
* for the kept capabilities in composed order. It identifies one surface's tool list: record
|
|
255
|
+
* it per session and compare it at provisioning. It is not Portal registration's
|
|
256
|
+
* `identityDigest`, which also binds the publication, owner and activation. */
|
|
257
|
+
readonly identityDigest: `sha256:${string}`;
|
|
258
|
+
} | {
|
|
259
|
+
readonly ok: false;
|
|
260
|
+
readonly refused: SiteCapabilityCompositionRefusal;
|
|
261
|
+
/** The names (or, for `invalid_group`, the namespaces) involved, when there are any. */
|
|
262
|
+
readonly names: readonly string[];
|
|
263
|
+
/** A fixed English explanation; never echoes descriptor text. */
|
|
264
|
+
readonly detail: string;
|
|
265
|
+
};
|
|
266
|
+
/**
|
|
267
|
+
* Composes the capabilities one surface offers. This is the one owner of the composition rule;
|
|
268
|
+
* Portal's registration applies the same reserved-prefix and duplicate refusals to its own
|
|
269
|
+
* additional tools and can call this instead. Conflicts refuse the whole
|
|
270
|
+
* composition, never shadow: a duplicate name, a `superbee_` name outside the generic tier, or a
|
|
271
|
+
* pack or site name outside its namespace. Order is deterministic (generic, packs, site extras,
|
|
272
|
+
* each in declaration order), which prompt caching and the Managed Agents byte check depend on.
|
|
273
|
+
* The surface's exclusions apply after the conflict checks; the limits apply to what is kept.
|
|
274
|
+
*/
|
|
275
|
+
export declare function composeSiteCapabilities(groups: readonly SiteCapabilityGroup[], options: ComposeSiteCapabilitiesOptions): SiteCapabilityComposition;
|
|
276
|
+
/** The requirements `checkSiteCapability` tests from fixtures. Whether each record carries its own
|
|
277
|
+
* sources with checked dates has no site-neutral shape; a site checks that, and anything else
|
|
278
|
+
* site-specific, with its own fixture assertions (`SiteCapabilityFixture.check`, reported as
|
|
279
|
+
* `site`). */
|
|
280
|
+
export type SiteCapabilityRequirement = "descriptor" | "read_only" | "dated" | "stable_ids" | "public_urls" | "errors" | "bounded" | "deterministic" | "input_checked" | "fixed_text" | "site";
|
|
281
|
+
/** One recorded input and what it must produce. */
|
|
282
|
+
export interface SiteCapabilityFixture {
|
|
283
|
+
/** Shown in problems; defaults to the fixture's index. */
|
|
284
|
+
readonly name?: string;
|
|
285
|
+
readonly input: unknown;
|
|
286
|
+
readonly expect: "ok" | "error";
|
|
287
|
+
/** For `expect: "error"`, the exact code. */
|
|
288
|
+
readonly errorCode?: string;
|
|
289
|
+
/** The pinned clock for this fixture, in milliseconds since the epoch. */
|
|
290
|
+
readonly now?: number;
|
|
291
|
+
/** A site's own assertion over the result (per-record sources, anything site-specific): return a
|
|
292
|
+
* problem description, or nothing when the result is acceptable. */
|
|
293
|
+
readonly check?: (result: unknown) => string | undefined | void;
|
|
294
|
+
}
|
|
295
|
+
export interface CheckSiteCapabilityOptions {
|
|
296
|
+
/** The site's own origin, such as `https://hereandmain.town`. Every absolute http(s) URL in a
|
|
297
|
+
* result must be on it, or on one of `externalHosts`. */
|
|
298
|
+
readonly origin: string;
|
|
299
|
+
/** Hosts whose pages a result may link to: a provider's own page for a feed-only item. */
|
|
300
|
+
readonly externalHosts?: readonly string[];
|
|
301
|
+
/** The closed error-code set; defaults to `SITE_CAPABILITY_ERROR_CODES`. */
|
|
302
|
+
readonly errorCodes?: readonly string[];
|
|
303
|
+
/** The pinned clock for fixtures without their own. Defaults to 2026-01-01T12:00:00Z. */
|
|
304
|
+
readonly now?: number;
|
|
305
|
+
/** Probe one successful fixture's input with an unknown argument, which must be refused
|
|
306
|
+
* with `{ ok: false }`. Default true. */
|
|
307
|
+
readonly probeUnknownArgument?: boolean;
|
|
308
|
+
}
|
|
309
|
+
export interface SiteCapabilityProblem {
|
|
310
|
+
readonly requirement: SiteCapabilityRequirement;
|
|
311
|
+
readonly fixture?: string;
|
|
312
|
+
readonly detail: string;
|
|
313
|
+
}
|
|
314
|
+
export interface SiteCapabilityCheck {
|
|
315
|
+
readonly ok: boolean;
|
|
316
|
+
readonly problems: readonly SiteCapabilityProblem[];
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* Tests one capability against recorded fixtures and the site capability requirements:
|
|
320
|
+
* a valid, read-only descriptor; results that are deterministic for a pinned clock, bounded,
|
|
321
|
+
* dated (`as_of`) when successful, and `{ ok: false, error: { code, message } }` with a closed code
|
|
322
|
+
* and a message that never echoes input when not; absolute URLs only on the site's origin or its
|
|
323
|
+
* declared external hosts; every citation from `mintSources` naming a record ID present in the
|
|
324
|
+
* result and a safe same-origin path; unknown arguments refused; and a descriptor that running
|
|
325
|
+
* the fixtures does not change. Runs each fixture twice. Never throws for a capability's fault.
|
|
326
|
+
*/
|
|
327
|
+
export declare function checkSiteCapability(capability: SiteCapability, fixtures: readonly SiteCapabilityFixture[], options: CheckSiteCapabilityOptions): Promise<SiteCapabilityCheck>;
|
|
328
|
+
/** One named conformance case. `run` resolves when the capability conforms and rejects with an
|
|
329
|
+
* `Error` naming every problem otherwise. Runner-neutral: wrap each case in `node:test`, Vitest or
|
|
330
|
+
* any other runner (`for (const c of cases) test(c.name, c.run)`). */
|
|
331
|
+
export interface SiteCapabilityConformanceCase {
|
|
332
|
+
readonly name: string;
|
|
333
|
+
run(): Promise<void>;
|
|
334
|
+
}
|
|
335
|
+
/**
|
|
336
|
+
* The reusable conformance suite for one capability: one case per requirement checked by
|
|
337
|
+
* `checkSiteCapability`, plus the composition and mapping cases every surface relies on (it
|
|
338
|
+
* composes alone in its own namespace on a read-only surface, and its provider, Portal and
|
|
339
|
+
* descriptor mappings carry the same name, description and schema). A site, a pack and any host
|
|
340
|
+
* run the same cases over the same fixtures.
|
|
341
|
+
*/
|
|
342
|
+
export declare function siteCapabilityConformanceCases(capability: SiteCapability, fixtures: readonly SiteCapabilityFixture[], options: CheckSiteCapabilityOptions & {
|
|
343
|
+
readonly namespace?: string;
|
|
344
|
+
}): readonly SiteCapabilityConformanceCase[];
|
|
345
|
+
//# sourceMappingURL=site-capabilities.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"site-capabilities.d.ts","sourceRoot":"","sources":["../src/site-capabilities.ts"],"names":[],"mappings":"AAcA;;;;;;;;;GASG;AACH,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC;IAChC,QAAQ,CAAC,eAAe,CAAC,EAAE,OAAO,CAAC;IACnC,QAAQ,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IAClC,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC;IACjC,2FAA2F;IAC3F,QAAQ,CAAC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IACxC,wHAAwH;IACxH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IACpC,QAAQ,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;CAClC;AAED;yFACyF;AACzF,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,iGAAiG;IACjG,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;CAC7B;AAED;gCACgC;AAChC,MAAM,WAAW,kBAAkB;IACjC,2DAA2D;IAC3D,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,kFAAkF;IAClF,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,qD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