@codemem/core 0.49.0 → 0.50.0-beta.1
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/dist/api-types.d.ts +7 -0
- package/dist/api-types.d.ts.map +1 -1
- package/dist/better-sqlite-coordinator-runtime.d.ts.map +1 -1
- package/dist/better-sqlite-coordinator-store.d.ts +56 -3
- package/dist/better-sqlite-coordinator-store.d.ts.map +1 -1
- package/dist/boundary-readiness-inventory.d.ts +27 -0
- package/dist/boundary-readiness-inventory.d.ts.map +1 -0
- package/dist/coordinator-account-link-receiver.d.ts +15 -0
- package/dist/coordinator-account-link-receiver.d.ts.map +1 -1
- package/dist/coordinator-account-link-status-client.d.ts +1 -1
- package/dist/coordinator-account-link-status-client.d.ts.map +1 -1
- package/dist/coordinator-actions.d.ts +12 -0
- package/dist/coordinator-actions.d.ts.map +1 -1
- package/dist/coordinator-api.d.ts +7 -0
- package/dist/coordinator-api.d.ts.map +1 -1
- package/dist/coordinator-auth-historical-store-test-fixture.d.ts.map +1 -1
- package/dist/coordinator-auth-link-revocation-test-harness.d.ts.map +1 -1
- package/dist/coordinator-auth-schema-stage.d.ts +14 -2
- package/dist/coordinator-auth-schema-stage.d.ts.map +1 -1
- package/dist/coordinator-block-tombstone-test-harness.d.ts +3 -0
- package/dist/coordinator-block-tombstone-test-harness.d.ts.map +1 -0
- package/dist/coordinator-bootstrap-authorization-api-test-harness.d.ts.map +1 -1
- package/dist/coordinator-bootstrap-authorization-test-harness.d.ts.map +1 -1
- package/dist/coordinator-bootstrap-revocation-test-harness.d.ts.map +1 -1
- package/dist/coordinator-boundary-readiness-client.d.ts +35 -0
- package/dist/coordinator-boundary-readiness-client.d.ts.map +1 -0
- package/dist/coordinator-boundary-readiness-route.d.ts +52 -0
- package/dist/coordinator-boundary-readiness-route.d.ts.map +1 -0
- package/dist/coordinator-boundary-readiness-test-harness.d.ts +15 -0
- package/dist/coordinator-boundary-readiness-test-harness.d.ts.map +1 -0
- package/dist/coordinator-boundary-readiness.d.ts +161 -0
- package/dist/coordinator-boundary-readiness.d.ts.map +1 -0
- package/dist/coordinator-browser-auth-app.d.ts +1 -1
- package/dist/coordinator-browser-auth-app.d.ts.map +1 -1
- package/dist/coordinator-browser-auth-callback.d.ts +2 -1
- package/dist/coordinator-browser-auth-callback.d.ts.map +1 -1
- package/dist/coordinator-controller-revocation-test-harness.d.ts.map +1 -1
- package/dist/coordinator-d1-schema-inventory.d.ts +2 -0
- package/dist/coordinator-d1-schema-inventory.d.ts.map +1 -1
- package/dist/coordinator-d1-scope-authorization-test-harness.d.ts.map +1 -1
- package/dist/coordinator-device-auth-link.d.ts +1 -0
- package/dist/coordinator-device-auth-link.d.ts.map +1 -1
- package/dist/coordinator-device-rejoin-browser-evidence.d.ts +28 -0
- package/dist/coordinator-device-rejoin-browser-evidence.d.ts.map +1 -0
- package/dist/coordinator-device-rejoin-browser-transaction-test-harness.d.ts +8 -0
- package/dist/coordinator-device-rejoin-browser-transaction-test-harness.d.ts.map +1 -0
- package/dist/coordinator-device-rejoin-browser-transaction.d.ts +43 -0
- package/dist/coordinator-device-rejoin-browser-transaction.d.ts.map +1 -0
- package/dist/coordinator-device-rejoin-browser-view.d.ts +30 -0
- package/dist/coordinator-device-rejoin-browser-view.d.ts.map +1 -0
- package/dist/coordinator-device-rejoin-browser.d.ts +26 -0
- package/dist/coordinator-device-rejoin-browser.d.ts.map +1 -0
- package/dist/coordinator-device-rejoin-client-requests.d.ts +70 -0
- package/dist/coordinator-device-rejoin-client-requests.d.ts.map +1 -0
- package/dist/coordinator-device-rejoin-client.d.ts +15 -0
- package/dist/coordinator-device-rejoin-client.d.ts.map +1 -0
- package/dist/coordinator-device-rejoin-confirmation-test-harness.d.ts +22 -0
- package/dist/coordinator-device-rejoin-confirmation-test-harness.d.ts.map +1 -0
- package/dist/coordinator-device-rejoin-confirmation.d.ts +18 -0
- package/dist/coordinator-device-rejoin-confirmation.d.ts.map +1 -0
- package/dist/coordinator-device-rejoin-destinations-test-harness.d.ts +7 -0
- package/dist/coordinator-device-rejoin-destinations-test-harness.d.ts.map +1 -0
- package/dist/coordinator-device-rejoin-destinations.d.ts +25 -0
- package/dist/coordinator-device-rejoin-destinations.d.ts.map +1 -0
- package/dist/coordinator-device-rejoin-display.d.ts +14 -0
- package/dist/coordinator-device-rejoin-display.d.ts.map +1 -0
- package/dist/coordinator-device-rejoin-event-client.d.ts +30 -0
- package/dist/coordinator-device-rejoin-event-client.d.ts.map +1 -0
- package/dist/coordinator-device-rejoin-events.d.ts +7 -0
- package/dist/coordinator-device-rejoin-events.d.ts.map +1 -0
- package/dist/coordinator-device-rejoin-finalize-test-harness.d.ts +14 -0
- package/dist/coordinator-device-rejoin-finalize-test-harness.d.ts.map +1 -0
- package/dist/coordinator-device-rejoin-finalize.d.ts +36 -0
- package/dist/coordinator-device-rejoin-finalize.d.ts.map +1 -0
- package/dist/coordinator-device-rejoin-http.d.ts +11 -0
- package/dist/coordinator-device-rejoin-http.d.ts.map +1 -0
- package/dist/coordinator-device-rejoin-link-evidence-test-harness.d.ts +17 -0
- package/dist/coordinator-device-rejoin-link-evidence-test-harness.d.ts.map +1 -0
- package/dist/coordinator-device-rejoin-link-evidence.d.ts +29 -0
- package/dist/coordinator-device-rejoin-link-evidence.d.ts.map +1 -0
- package/dist/coordinator-device-rejoin-link-lineage.d.ts +7 -0
- package/dist/coordinator-device-rejoin-link-lineage.d.ts.map +1 -0
- package/dist/coordinator-device-rejoin-oidc-pins.d.ts +14 -0
- package/dist/coordinator-device-rejoin-oidc-pins.d.ts.map +1 -0
- package/dist/coordinator-device-rejoin-proof.d.ts +41 -0
- package/dist/coordinator-device-rejoin-proof.d.ts.map +1 -0
- package/dist/coordinator-device-rejoin-schema-test-harness.d.ts +8 -0
- package/dist/coordinator-device-rejoin-schema-test-harness.d.ts.map +1 -0
- package/dist/coordinator-device-rejoin-schema.d.ts +9 -0
- package/dist/coordinator-device-rejoin-schema.d.ts.map +1 -0
- package/dist/coordinator-device-rejoin-start-evidence-test-harness.d.ts +40 -0
- package/dist/coordinator-device-rejoin-start-evidence-test-harness.d.ts.map +1 -0
- package/dist/coordinator-device-rejoin-start-evidence.d.ts +25 -0
- package/dist/coordinator-device-rejoin-start-evidence.d.ts.map +1 -0
- package/dist/coordinator-device-rejoin-start-http.d.ts +12 -0
- package/dist/coordinator-device-rejoin-start-http.d.ts.map +1 -0
- package/dist/coordinator-device-rejoin-start-input.d.ts +23 -0
- package/dist/coordinator-device-rejoin-start-input.d.ts.map +1 -0
- package/dist/coordinator-device-rejoin-start-write.d.ts +38 -0
- package/dist/coordinator-device-rejoin-start-write.d.ts.map +1 -0
- package/dist/coordinator-device-rejoin-status-http.d.ts +10 -0
- package/dist/coordinator-device-rejoin-status-http.d.ts.map +1 -0
- package/dist/coordinator-device-rejoin-status-live-test-harness.d.ts +33 -0
- package/dist/coordinator-device-rejoin-status-live-test-harness.d.ts.map +1 -0
- package/dist/coordinator-device-rejoin-status-projection.d.ts +28 -0
- package/dist/coordinator-device-rejoin-status-projection.d.ts.map +1 -0
- package/dist/coordinator-device-rejoin-status-test-harness.d.ts +8 -0
- package/dist/coordinator-device-rejoin-status-test-harness.d.ts.map +1 -0
- package/dist/coordinator-device-rejoin-status.d.ts +39 -0
- package/dist/coordinator-device-rejoin-status.d.ts.map +1 -0
- package/dist/coordinator-device-removal-commands.d.ts +13 -0
- package/dist/coordinator-device-removal-commands.d.ts.map +1 -0
- package/dist/coordinator-device-removal-commit-test-harness.d.ts +3 -0
- package/dist/coordinator-device-removal-commit-test-harness.d.ts.map +1 -0
- package/dist/coordinator-device-removal-commit.d.ts +44 -0
- package/dist/coordinator-device-removal-commit.d.ts.map +1 -0
- package/dist/coordinator-device-removal-dependents-test-harness.d.ts +9 -0
- package/dist/coordinator-device-removal-dependents-test-harness.d.ts.map +1 -0
- package/dist/coordinator-device-removal-dependents.d.ts +34 -0
- package/dist/coordinator-device-removal-dependents.d.ts.map +1 -0
- package/dist/coordinator-device-removal-list-test-harness.d.ts +4 -0
- package/dist/coordinator-device-removal-list-test-harness.d.ts.map +1 -0
- package/dist/coordinator-device-removal-list.d.ts +40 -0
- package/dist/coordinator-device-removal-list.d.ts.map +1 -0
- package/dist/coordinator-device-removal-preview-test-harness.d.ts +9 -0
- package/dist/coordinator-device-removal-preview-test-harness.d.ts.map +1 -0
- package/dist/coordinator-device-removal-routes.d.ts +13 -0
- package/dist/coordinator-device-removal-routes.d.ts.map +1 -0
- package/dist/coordinator-device-removal-target.d.ts +98 -0
- package/dist/coordinator-device-removal-target.d.ts.map +1 -0
- package/dist/coordinator-device-removal-test-harness.d.ts +70 -0
- package/dist/coordinator-device-removal-test-harness.d.ts.map +1 -0
- package/dist/coordinator-device-removal-writer-test-harness.d.ts +8 -0
- package/dist/coordinator-device-removal-writer-test-harness.d.ts.map +1 -0
- package/dist/coordinator-device-removal.d.ts +233 -0
- package/dist/coordinator-device-removal.d.ts.map +1 -0
- package/dist/coordinator-device-revocation-client.d.ts +2 -0
- package/dist/coordinator-device-revocation-client.d.ts.map +1 -1
- package/dist/coordinator-device-revocation-handler-test-harness.d.ts.map +1 -1
- package/dist/coordinator-device-revocation-handler.d.ts +1 -1
- package/dist/coordinator-device-revocation-handler.d.ts.map +1 -1
- package/dist/coordinator-device-revocation-route.d.ts.map +1 -1
- package/dist/coordinator-device-revocation-test-harness.d.ts.map +1 -1
- package/dist/coordinator-device-revocation.d.ts +20 -2
- package/dist/coordinator-device-revocation.d.ts.map +1 -1
- package/dist/coordinator-enrollment-reconciler.d.ts.map +1 -1
- package/dist/coordinator-enrollment-test-fixtures.d.ts +126 -0
- package/dist/coordinator-enrollment-test-fixtures.d.ts.map +1 -0
- package/dist/coordinator-history-sql-equivalence-test-fixtures.d.ts +1 -1
- package/dist/coordinator-history-sql-equivalence-test-fixtures.d.ts.map +1 -1
- package/dist/coordinator-identity-grant-revocation-test-harness.d.ts.map +1 -1
- package/dist/coordinator-identity-group-grant-test-harness.d.ts.map +1 -1
- package/dist/coordinator-invitation-lift-test-harness.d.ts +6 -0
- package/dist/coordinator-invitation-lift-test-harness.d.ts.map +1 -0
- package/dist/coordinator-invitation-removal.d.ts +71 -0
- package/dist/coordinator-invitation-removal.d.ts.map +1 -0
- package/dist/coordinator-join-review-guards.d.ts +2 -0
- package/dist/coordinator-join-review-guards.d.ts.map +1 -1
- package/dist/coordinator-join-revocation-test-harness.d.ts.map +1 -1
- package/dist/coordinator-key-id-fill-api-test-harness.d.ts +12 -0
- package/dist/coordinator-key-id-fill-api-test-harness.d.ts.map +1 -0
- package/dist/coordinator-key-id-fill-api.d.ts +19 -0
- package/dist/coordinator-key-id-fill-api.d.ts.map +1 -0
- package/dist/coordinator-legacy-device-ownership.d.ts +66 -5
- package/dist/coordinator-legacy-device-ownership.d.ts.map +1 -1
- package/dist/coordinator-legacy-owner-compatibility.d.ts +3 -0
- package/dist/coordinator-legacy-owner-compatibility.d.ts.map +1 -1
- package/dist/coordinator-membership-enrollment-test-harness.d.ts +4 -0
- package/dist/coordinator-membership-enrollment-test-harness.d.ts.map +1 -0
- package/dist/coordinator-membership-enrollment.d.ts +15 -0
- package/dist/coordinator-membership-enrollment.d.ts.map +1 -0
- package/dist/coordinator-owner-enrollment-commit.d.ts +1 -1
- package/dist/coordinator-owner-enrollment-commit.d.ts.map +1 -1
- package/dist/coordinator-owner-enrollment-qualification-test-harness.d.ts.map +1 -1
- package/dist/coordinator-owner-enrollment-qualification.d.ts +1 -0
- package/dist/coordinator-owner-enrollment-qualification.d.ts.map +1 -1
- package/dist/coordinator-owner-resolution-review-test-fixtures.d.ts.map +1 -1
- package/dist/coordinator-peer-discovery-revocation-test-harness.d.ts.map +1 -1
- package/dist/coordinator-peer-removal-api-test-harness.d.ts +29 -0
- package/dist/coordinator-peer-removal-api-test-harness.d.ts.map +1 -0
- package/dist/coordinator-peer-removal-query-test-harness.d.ts +4 -0
- package/dist/coordinator-peer-removal-query-test-harness.d.ts.map +1 -0
- package/dist/coordinator-peer-removal-query.d.ts +32 -0
- package/dist/coordinator-peer-removal-query.d.ts.map +1 -0
- package/dist/coordinator-peer-revocation-route.d.ts +45 -0
- package/dist/coordinator-peer-revocation-route.d.ts.map +1 -0
- package/dist/coordinator-peer-revocation.d.ts +61 -0
- package/dist/coordinator-peer-revocation.d.ts.map +1 -0
- package/dist/coordinator-presence-capabilities.d.ts +10 -0
- package/dist/coordinator-presence-capabilities.d.ts.map +1 -0
- package/dist/coordinator-project-revocation-test-harness.d.ts +1 -1
- package/dist/coordinator-project-revocation-test-harness.d.ts.map +1 -1
- package/dist/coordinator-recipient-revocation-test-harness.d.ts.map +1 -1
- package/dist/coordinator-refresh-lifecycle.d.ts +11 -0
- package/dist/coordinator-refresh-lifecycle.d.ts.map +1 -0
- package/dist/coordinator-rejoin-discovery.d.ts +16 -0
- package/dist/coordinator-rejoin-discovery.d.ts.map +1 -0
- package/dist/coordinator-rejoin-timestamp.d.ts +3 -0
- package/dist/coordinator-rejoin-timestamp.d.ts.map +1 -0
- package/dist/coordinator-removal-notice.d.ts +21 -0
- package/dist/coordinator-removal-notice.d.ts.map +1 -0
- package/dist/coordinator-removal-progress-listing-test-harness.d.ts +3 -0
- package/dist/coordinator-removal-progress-listing-test-harness.d.ts.map +1 -0
- package/dist/coordinator-runtime-ynLTJI6d.js +1712 -0
- package/dist/coordinator-runtime-ynLTJI6d.js.map +1 -0
- package/dist/coordinator-runtime.d.ts +20 -1
- package/dist/coordinator-runtime.d.ts.map +1 -1
- package/dist/coordinator-scope-authorization-api-test-harness.d.ts.map +1 -1
- package/dist/coordinator-store-contract.d.ts +21 -3
- package/dist/coordinator-store-contract.d.ts.map +1 -1
- package/dist/coordinator-store-test-harness.d.ts.map +1 -1
- package/dist/coordinator-sync-config.d.ts +14 -0
- package/dist/coordinator-sync-config.d.ts.map +1 -1
- package/dist/d1-coordinator-runtime.d.ts +3 -1
- package/dist/d1-coordinator-runtime.d.ts.map +1 -1
- package/dist/d1-coordinator-store.d.ts +63 -3
- package/dist/d1-coordinator-store.d.ts.map +1 -1
- package/dist/database-runtime-primitives.d.ts +1 -1
- package/dist/db.d.ts.map +1 -1
- package/dist/device-identity-binding.d.ts +24 -0
- package/dist/device-identity-binding.d.ts.map +1 -1
- package/dist/device-identity-inventory.d.ts +19 -1
- package/dist/device-identity-inventory.d.ts.map +1 -1
- package/dist/device-retirement.d.ts +43 -0
- package/dist/device-retirement.d.ts.map +1 -0
- package/dist/distill-draft.d.ts +6 -0
- package/dist/distill-draft.d.ts.map +1 -1
- package/dist/distill-judge.d.ts +1 -1
- package/dist/distill-judge.d.ts.map +1 -1
- package/dist/identity-device-assignment.d.ts +8 -0
- package/dist/identity-device-assignment.d.ts.map +1 -1
- package/dist/index.d.ts +34 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11664 -10635
- package/dist/index.js.map +1 -1
- package/dist/internal/cloudflare-coordinator.js +2317 -1542
- package/dist/internal/cloudflare-coordinator.js.map +1 -1
- package/dist/internal/relay-runtime.js +29 -29
- package/dist/legacy-pairing-assignment-conversion.d.ts +46 -0
- package/dist/legacy-pairing-assignment-conversion.d.ts.map +1 -0
- package/dist/legacy-pairing-assignment-state.d.ts +11 -0
- package/dist/legacy-pairing-assignment-state.d.ts.map +1 -0
- package/dist/legacy-team-setup-errors.d.ts +2 -1
- package/dist/legacy-team-setup-errors.d.ts.map +1 -1
- package/dist/local-origin-claim.d.ts +48 -0
- package/dist/local-origin-claim.d.ts.map +1 -0
- package/dist/maintenance/ai-structured.d.ts +2 -0
- package/dist/maintenance/ai-structured.d.ts.map +1 -1
- package/dist/observer-config.d.ts.map +1 -1
- package/dist/owned-recipient-d1-test-harness.d.ts.map +1 -1
- package/dist/owner-enrollment-link-authority.d.ts +1 -0
- package/dist/owner-enrollment-link-authority.d.ts.map +1 -1
- package/dist/{owner-enrollment-start-BsDwgxAh.js → owner-enrollment-start-D8QzF1Ar.js} +5548 -3637
- package/dist/owner-enrollment-start-D8QzF1Ar.js.map +1 -0
- package/dist/pairing-removal.d.ts +57 -0
- package/dist/pairing-removal.d.ts.map +1 -0
- package/dist/peer-project-filter-change.d.ts +33 -0
- package/dist/peer-project-filter-change.d.ts.map +1 -0
- package/dist/peer-project-filter-management.d.ts +7 -0
- package/dist/peer-project-filter-management.d.ts.map +1 -0
- package/dist/peer-project-filter-retention.d.ts +17 -0
- package/dist/peer-project-filter-retention.d.ts.map +1 -0
- package/dist/peer-removal-check-state.d.ts +24 -0
- package/dist/peer-removal-check-state.d.ts.map +1 -0
- package/dist/peer-removal.d.ts +34 -0
- package/dist/peer-removal.d.ts.map +1 -0
- package/dist/peer-traversal-coordinator-attempt-write-test-fixtures.d.ts.map +1 -1
- package/dist/peer-traversal-coordinator-decision-test-fixtures.d.ts.map +1 -1
- package/dist/policy-team-device-eligibility.d.ts +10 -0
- package/dist/policy-team-device-eligibility.d.ts.map +1 -1
- package/dist/project-boundary-migration-hold.d.ts +50 -0
- package/dist/project-boundary-migration-hold.d.ts.map +1 -0
- package/dist/project-boundary-migration-records.d.ts +46 -0
- package/dist/project-boundary-migration-records.d.ts.map +1 -0
- package/dist/project-filters-narrowing.d.ts +11 -0
- package/dist/project-filters-narrowing.d.ts.map +1 -0
- package/dist/project-scope-resume.d.ts +26 -0
- package/dist/project-scope-resume.d.ts.map +1 -0
- package/dist/project-scope-settings.d.ts +7 -0
- package/dist/project-scope-settings.d.ts.map +1 -1
- package/dist/project-scope-withdrawal.d.ts +48 -0
- package/dist/project-scope-withdrawal.d.ts.map +1 -0
- package/dist/project-withdrawal-state.d.ts +36 -0
- package/dist/project-withdrawal-state.d.ts.map +1 -0
- package/dist/{recipient-policy-contract-Ca40IBUh.js → recipient-policy-contract-BHxfaQZ2.js} +12 -5
- package/dist/recipient-policy-contract-BHxfaQZ2.js.map +1 -0
- package/dist/recipient-policy-contract.d.ts +7 -0
- package/dist/recipient-policy-contract.d.ts.map +1 -1
- package/dist/recipient-policy-contract.js +2 -2
- package/dist/recipient-policy-edges.d.ts.map +1 -1
- package/dist/recipient-policy-intent.d.ts +1 -0
- package/dist/recipient-policy-intent.d.ts.map +1 -1
- package/dist/recipient-policy-onboarding.d.ts.map +1 -1
- package/dist/recipient-policy-reconciler.d.ts.map +1 -1
- package/dist/recipient-policy-reconciliation.d.ts.map +1 -1
- package/dist/recipient-policy-team-create.d.ts +22 -0
- package/dist/recipient-policy-team-create.d.ts.map +1 -0
- package/dist/{relay-health-CeyhVeuq.js → relay-health-B8BpHFaE.js} +14 -14
- package/dist/{relay-health-CeyhVeuq.js.map → relay-health-B8BpHFaE.js.map} +1 -1
- package/dist/{relay-peer-client-j0rOyeuZ.js → relay-peer-client-w7WdS1AP.js} +3083 -2634
- package/dist/relay-peer-client-w7WdS1AP.js.map +1 -0
- package/dist/relay-server-test-fixtures.d.ts.map +1 -1
- package/dist/replication-cursor-orphan-cleanup.d.ts +14 -0
- package/dist/replication-cursor-orphan-cleanup.d.ts.map +1 -0
- package/dist/retired-device-aliases.d.ts +28 -0
- package/dist/retired-device-aliases.d.ts.map +1 -0
- package/dist/same-actor-peers.d.ts +5 -1
- package/dist/same-actor-peers.d.ts.map +1 -1
- package/dist/schema-bootstrap.d.ts +1 -0
- package/dist/schema-bootstrap.d.ts.map +1 -1
- package/dist/schema.d.ts +4456 -3623
- package/dist/schema.d.ts.map +1 -1
- package/dist/{scope-membership-cache-read-B6z47l2W.js → scope-resolution-B7FK15hx.js} +2242 -1608
- package/dist/scope-resolution-B7FK15hx.js.map +1 -0
- package/dist/semantic-worker-entry.js +1 -1
- package/dist/{semantic-worker-job-BLaC4xRY.js → semantic-worker-job-BjujlM4-.js} +3 -3
- package/dist/{semantic-worker-job-BLaC4xRY.js.map → semantic-worker-job-BjujlM4-.js.map} +1 -1
- package/dist/{semantic-worker-ranking-5-VSzEmx.js → semantic-worker-ranking-WaUCapnY.js} +66 -60
- package/dist/semantic-worker-ranking-WaUCapnY.js.map +1 -0
- package/dist/share-provisioning.d.ts +4 -0
- package/dist/share-provisioning.d.ts.map +1 -1
- package/dist/shared-owned-device-enrollment-test-harness.d.ts.map +1 -1
- package/dist/shared-owned-project-invites-test-harness.d.ts.map +1 -1
- package/dist/shared-owned-recipient-invites-test-harness.d.ts.map +1 -1
- package/dist/shared-ownership-writer-lifecycle-test-harness.d.ts.map +1 -1
- package/dist/snapshot-cross-scope-reconcile.d.ts +25 -0
- package/dist/snapshot-cross-scope-reconcile.d.ts.map +1 -0
- package/dist/{sync-auth-constants-BVzVfSmn.js → sync-auth-constants-DNUSV-Tn.js} +4482 -2842
- package/dist/sync-auth-constants-DNUSV-Tn.js.map +1 -0
- package/dist/sync-bootstrap.d.ts +2 -0
- package/dist/sync-bootstrap.d.ts.map +1 -1
- package/dist/sync-capability.d.ts +1 -1
- package/dist/sync-capability.d.ts.map +1 -1
- package/dist/sync-channel-pass.d.ts.map +1 -1
- package/dist/sync-channel-progress.d.ts +7 -0
- package/dist/sync-channel-progress.d.ts.map +1 -1
- package/dist/sync-daemon.d.ts +4 -1
- package/dist/sync-daemon.d.ts.map +1 -1
- package/dist/sync-pass.d.ts +3 -7
- package/dist/sync-pass.d.ts.map +1 -1
- package/dist/sync-peer-addresses.d.ts +4 -2
- package/dist/sync-peer-addresses.d.ts.map +1 -1
- package/dist/sync-reachability-pass-BpTtRqcV.js +2 -0
- package/dist/{sync-reachability-pass-Co6WjaUD.js → sync-reachability-pass-DKEORTbs.js} +2934 -2865
- package/dist/sync-reachability-pass-DKEORTbs.js.map +1 -0
- package/dist/sync-reachability-pass.d.ts.map +1 -1
- package/dist/sync-replication.d.ts +21 -3
- package/dist/sync-replication.d.ts.map +1 -1
- package/dist/sync-scope-protocol.d.ts.map +1 -1
- package/dist/test-environment-isolation.d.ts +2 -0
- package/dist/test-environment-isolation.d.ts.map +1 -0
- package/dist/test-schema.generated.d.ts +1 -1
- package/dist/test-schema.generated.d.ts.map +1 -1
- package/dist/test-utils.d.ts +4 -0
- package/dist/test-utils.d.ts.map +1 -1
- package/dist/{validated-vector-index-audit-B64yhEBF.js → validated-vector-index-audit-BtUovYuM.js} +269 -637
- package/dist/validated-vector-index-audit-BtUovYuM.js.map +1 -0
- package/dist/viewer-device-removal-commit.d.ts +56 -0
- package/dist/viewer-device-removal-commit.d.ts.map +1 -0
- package/dist/viewer-device-removal-evidence.d.ts +17 -0
- package/dist/viewer-device-removal-evidence.d.ts.map +1 -0
- package/dist/{scope-membership-semantics-B8qXaMqx.js → workspace-identity-C7EPmSZe.js} +121 -49
- package/dist/workspace-identity-C7EPmSZe.js.map +1 -0
- package/package.json +3 -3
- package/dist/coordinator-runtime-BYCjEE7A.js +0 -594
- package/dist/coordinator-runtime-BYCjEE7A.js.map +0 -1
- package/dist/owner-enrollment-start-BsDwgxAh.js.map +0 -1
- package/dist/recipient-policy-contract-Ca40IBUh.js.map +0 -1
- package/dist/relay-peer-client-j0rOyeuZ.js.map +0 -1
- package/dist/scope-membership-cache-read-B6z47l2W.js.map +0 -1
- package/dist/scope-membership-semantics-B8qXaMqx.js.map +0 -1
- package/dist/semantic-worker-ranking-5-VSzEmx.js.map +0 -1
- package/dist/sync-auth-constants-BVzVfSmn.js.map +0 -1
- package/dist/sync-reachability-pass-5bOMxdoW.js +0 -2
- package/dist/sync-reachability-pass-Co6WjaUD.js.map +0 -1
- package/dist/validated-vector-index-audit-B64yhEBF.js.map +0 -1
- package/dist/workspace-identity-DI8bBR0Y.js +0 -76
- package/dist/workspace-identity-DI8bBR0Y.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"scope-membership-semantics-B8qXaMqx.js","names":[],"sources":["../src/coordinator-ed25519-key-id.ts","../src/coordinator-ed25519-key-id-compat.ts","../src/sync-fingerprint.ts","../src/coordinator-scope-authorization.ts","../src/scope-membership-semantics.ts"],"sourcesContent":["export type SshEd25519Parse =\n\t| { kind: \"ed25519\"; blob: Uint8Array }\n\t| { kind: \"malformed_ed25519\" }\n\t| { kind: \"other\" };\n\nfunction decodeWire(encoded: string): Uint8Array | null {\n\ttry {\n\t\tconst binary = atob(encoded);\n\t\treturn Uint8Array.from(binary, (character) => character.charCodeAt(0));\n\t} catch {\n\t\treturn null;\n\t}\n}\n\nfunction readRawKey(wire: Uint8Array): Uint8Array | null {\n\tif (wire.length < 4) return null;\n\tconst view = new DataView(wire.buffer, wire.byteOffset, wire.byteLength);\n\tconst typeEnd = 4 + view.getUint32(0);\n\tif (wire.length < typeEnd + 4) return null;\n\tconst keyLength = view.getUint32(typeEnd);\n\tconst keyStart = typeEnd + 4;\n\tif (keyLength !== 32 || wire.length < keyStart + keyLength) return null;\n\treturn wire.subarray(keyStart, keyStart + keyLength);\n}\n\nfunction canonicalBlob(rawKey: Uint8Array): Uint8Array {\n\tconst blob = new Uint8Array(51);\n\tconst view = new DataView(blob.buffer);\n\tview.setUint32(0, 11);\n\tblob.set(new TextEncoder().encode(\"ssh-ed25519\"), 4);\n\tview.setUint32(15, 32);\n\tblob.set(rawKey, 19);\n\treturn blob;\n}\n\n/**\n * Internal string contract, not an authentication acceptance check. Like the\n * Worker verifier, skip the inner type bytes and ignore trailing wire bytes.\n * atob rejects some encodings accepted by Node's Buffer base64 decoder.\n */\nexport function parseSshEd25519PublicKey(publicKey: string): SshEd25519Parse {\n\treturn parseSshEd25519PublicKeyWithDecoder(publicKey, decodeWire);\n}\n\n/** Internal trusted decoder seam; callers must not use it to decide authentication acceptance. */\nexport function parseSshEd25519PublicKeyWithDecoder(\n\tpublicKey: string,\n\tdecode: (encoded: string) => Uint8Array | null,\n): SshEd25519Parse {\n\tif (typeof publicKey !== \"string\") return { kind: \"other\" };\n\tconst [keyType, keyData] = publicKey.trim().split(/\\s+/);\n\tif (keyType !== \"ssh-ed25519\") return { kind: \"other\" };\n\tif (!keyData) return { kind: \"malformed_ed25519\" };\n\tlet wire: Uint8Array | null;\n\ttry {\n\t\twire = decode(keyData);\n\t} catch {\n\t\treturn { kind: \"malformed_ed25519\" };\n\t}\n\tif (!wire) return { kind: \"malformed_ed25519\" };\n\tconst rawKey = readRawKey(wire);\n\tif (!rawKey) return { kind: \"malformed_ed25519\" };\n\treturn { kind: \"ed25519\", blob: canonicalBlob(rawKey) };\n}\n\n/** SHA-256 hex of the canonical SSH blob; leaves legacy text fingerprints unchanged. */\nexport async function ed25519KeyId(publicKey: string): Promise<string | null> {\n\treturn hashEd25519KeyId(parseSshEd25519PublicKey(publicKey));\n}\n\n/** Internal canonical identity hash, not proof of key possession or authorization. */\nexport async function hashEd25519KeyId(parsed: SshEd25519Parse): Promise<string | null> {\n\tif (parsed.kind !== \"ed25519\") return null;\n\t// Copy to an owned ArrayBuffer for the portable Web Crypto BufferSource API.\n\tconst bytes = new Uint8Array(parsed.blob);\n\tconst digest = await globalThis.crypto.subtle.digest(\"SHA-256\", bytes.buffer);\n\treturn Array.from(new Uint8Array(digest), (byte) => byte.toString(16).padStart(2, \"0\")).join(\"\");\n}\n","import { Buffer } from \"node:buffer\";\nimport {\n\thashEd25519KeyId,\n\tparseSshEd25519PublicKeyWithDecoder,\n\ttype SshEd25519Parse,\n} from \"./coordinator-ed25519-key-id.js\";\n\nfunction decodeWireForRevocation(encoded: string): Uint8Array | null {\n\ttry {\n\t\treturn Buffer.from(encoded, \"base64\");\n\t} catch {\n\t\treturn null;\n\t}\n}\n\n/** Metadata only: Buffer aliases do not expand signature acceptance or prove key possession. */\nexport function parseSshEd25519PublicKeyForRevocation(publicKey: string): SshEd25519Parse {\n\treturn parseSshEd25519PublicKeyWithDecoder(publicKey, decodeWireForRevocation);\n}\n\n/** Canonical SSH identity for revocation metadata, not an authorization check. */\nexport async function ed25519KeyIdForRevocation(publicKey: string): Promise<string | null> {\n\treturn hashEd25519KeyId(parseSshEd25519PublicKeyForRevocation(publicKey));\n}\n","import { createHash } from \"node:crypto\";\n\n/** SHA-256 hex digest of a public key string. */\nexport function fingerprintPublicKey(publicKey: string): string {\n\treturn createHash(\"sha256\").update(publicKey, \"utf-8\").digest(\"hex\");\n}\n","import type {\n\tCoordinatorEnrollment,\n\tCoordinatorScope,\n\tCoordinatorScopeAuthorizationInput,\n\tCoordinatorScopeAuthorizationResult,\n\tCoordinatorScopeMembership,\n} from \"./coordinator-store-contract.js\";\n\nexport const SCOPE_FIELDS = [\n\t\"scope_id\",\n\t\"label\",\n\t\"kind\",\n\t\"authority_type\",\n\t\"coordinator_id\",\n\t\"group_id\",\n\t\"manifest_issuer_device_id\",\n\t\"membership_epoch\",\n\t\"manifest_hash\",\n\t\"status\",\n\t\"created_at\",\n\t\"updated_at\",\n] as const;\nexport const MEMBERSHIP_FIELDS = [\n\t\"scope_id\",\n\t\"device_id\",\n\t\"role\",\n\t\"status\",\n\t\"membership_epoch\",\n\t\"coordinator_id\",\n\t\"group_id\",\n\t\"manifest_issuer_device_id\",\n\t\"manifest_hash\",\n\t\"signed_manifest_json\",\n\t\"updated_at\",\n] as const;\nexport const ENROLLMENT_FIELDS = [\n\t\"group_id\",\n\t\"device_id\",\n\t\"public_key\",\n\t\"fingerprint\",\n\t\"identity_id\",\n\t\"display_name\",\n\t\"enabled\",\n\t\"created_at\",\n] as const;\n\nconst NULLABLE_FIELDS = new Set([\n\t\"coordinator_id\",\n\t\"group_id\",\n\t\"manifest_issuer_device_id\",\n\t\"manifest_hash\",\n\t\"signed_manifest_json\",\n\t\"identity_id\",\n\t\"display_name\",\n]);\nfunction text(value: unknown): value is string {\n\treturn typeof value === \"string\" && value.length > 0 && !value.includes(\"\\0\");\n}\n\nexport function captureScopeAuthorizationInput(\n\traw: CoordinatorScopeAuthorizationInput,\n): CoordinatorScopeAuthorizationInput {\n\tconst group = Object.getOwnPropertyDescriptor(raw, \"groupId\");\n\tconst scope = Object.getOwnPropertyDescriptor(raw, \"scopeId\");\n\tif (\n\t\t!group ||\n\t\t!scope ||\n\t\t!(\"value\" in group) ||\n\t\t!(\"value\" in scope) ||\n\t\t!text(group.value) ||\n\t\t!text(scope.value)\n\t)\n\t\tthrow new Error(\"scope_authorization_unavailable\");\n\treturn { groupId: group.value, scopeId: scope.value };\n}\n\n/** Reject malformed storage instead of treating it as an empty snapshot. */\nexport function requireScopeAuthorizationRecord(row: unknown, fields: readonly string[]): void {\n\tif (!row || typeof row !== \"object\" || Array.isArray(row))\n\t\tthrow new Error(\"scope_authorization_unavailable\");\n\tconst record = row as Record<string, unknown>;\n\tfor (const field of fields) {\n\t\tif (!validField(field, record[field])) throw new Error(\"scope_authorization_unavailable\");\n\t}\n}\n\nfunction validField(field: string, value: unknown): boolean {\n\tif (field === \"membership_epoch\" || field === \"enabled\")\n\t\treturn Number.isSafeInteger(value) && (value as number) >= 0;\n\t// Key parsing decides whether string evidence is usable, including empty legacy text.\n\tif (field === \"public_key\") return typeof value === \"string\";\n\tif (field === \"display_name\" || field === \"identity_id\")\n\t\treturn value === null || (typeof value === \"string\" && !value.includes(\"\\0\"));\n\tif (NULLABLE_FIELDS.has(field) && value === null) return true;\n\treturn text(value);\n}\n\nexport function scopeAuthorizationError(\n\tscope: CoordinatorScope,\n\tgroupId: string,\n): Extract<CoordinatorScopeAuthorizationResult, { kind: \"rejected\" }>[\"error\"] | null {\n\tif (scope.group_id !== groupId || scope.authority_type !== \"coordinator\")\n\t\treturn \"scope_source_mismatch\";\n\tif (scope.status !== \"active\") return \"scope_inactive\";\n\treturn null;\n}\n\n/** Null legacy member source fields inherit the explicit scope source, never owner/issuer authority.\n * An unbound scope group cannot authorize; a null coordinator ID preserves group-bound legacy rows.\n * Neither source metadata nor roles and labels infer tenant ownership or account-session proof. */\nexport function isCurrentScopeMember(\n\tscope: CoordinatorScope,\n\tmember: CoordinatorScopeMembership,\n): boolean {\n\tif (\n\t\tmember.scope_id !== scope.scope_id ||\n\t\tmember.status !== \"active\" ||\n\t\tmember.membership_epoch < scope.membership_epoch\n\t)\n\t\treturn false;\n\treturn (\n\t\t[\"group_id\", \"coordinator_id\", \"manifest_issuer_device_id\", \"manifest_hash\"] as const\n\t).every((field) => member[field] === null || member[field] === scope[field]);\n}\n\nexport interface CapturedScopeMember {\n\tmembership: CoordinatorScopeMembership;\n\tenrollment: CoordinatorEnrollment;\n\tkeyId: string;\n}\n\nexport function parseScopeAuthorizationMembers(\n\traw: unknown,\n\tcaptured: CapturedScopeMember[],\n): CapturedScopeMember[] {\n\tif (typeof raw !== \"string\") throw new Error(\"scope_authorization_unavailable\");\n\tconst members: unknown = JSON.parse(raw);\n\tif (!Array.isArray(members)) throw new Error(\"scope_authorization_unavailable\");\n\tconst expected = new Set(captured.map((member) => JSON.stringify(member)));\n\tfor (const member of members) {\n\t\tconst encoded = JSON.stringify(member);\n\t\tif (!expected.delete(encoded)) throw new Error(\"scope_authorization_unavailable\");\n\t}\n\treturn (members as CapturedScopeMember[]).sort(compareMemberDeviceIds);\n}\n\nfunction compareMemberDeviceIds(left: CapturedScopeMember, right: CapturedScopeMember): number {\n\tconst leftId = left.membership.device_id;\n\tconst rightId = right.membership.device_id;\n\tif (leftId < rightId) return -1;\n\tif (leftId > rightId) return 1;\n\treturn 0;\n}\n\nfunction pinned(alias: string, fields: readonly string[], path: string): string {\n\treturn fields\n\t\t.map((field) => `${alias}.${field} IS json_extract(captured.value, '$.${path}${field}')`)\n\t\t.join(\" AND \");\n}\n\n/** Final reads pin every captured DTO field and canonical revocation subject; no replacement key is promoted. */\nexport const READ_CURRENT_SCOPE_SQL = `SELECT s.* FROM json_each(?) captured\nJOIN coordinator_scopes s ON ${pinned(\"s\", SCOPE_FIELDS, \"\")}\nJOIN groups g ON g.group_id = s.group_id WHERE g.archived_at IS NULL AND s.status = 'active'\nAND s.authority_type = 'coordinator'`;\nexport const READ_CURRENT_SCOPE_MEMBERS_SQL = `SELECT captured.value FROM json_each(?) captured\nJOIN coordinator_scope_memberships m ON ${pinned(\"m\", MEMBERSHIP_FIELDS, \"membership.\")}\nJOIN enrolled_devices e ON ${pinned(\"e\", ENROLLMENT_FIELDS, \"enrollment.\")}\nWHERE e.enabled = 1 AND m.status = 'active'\nAND NOT EXISTS (SELECT 1 FROM coordinator_device_revocations r WHERE\n(r.subject_kind = 'device_id' AND r.subject_value = e.device_id) OR\n(r.subject_kind = 'ed25519_key' AND r.subject_value = json_extract(captured.value, '$.keyId')))\nORDER BY m.device_id ASC`;\n\nexport const READ_SCOPE_AUTHORIZATION_SQL = `WITH current_scope AS (${READ_CURRENT_SCOPE_SQL})\nSELECT current_scope.*, (SELECT json_group_array(json(value)) FROM\n(${READ_CURRENT_SCOPE_MEMBERS_SQL})) AS members_json FROM current_scope`;\n","export const SCOPE_MEMBERSHIP_REVOCATION_LIMITATION =\n\t\"Revocation blocks future sync for this Space. It does not remove data already copied to the revoked device; offline devices, backups, copied databases, malicious peers, or old versions may retain data.\";\n\nexport interface ScopeMembershipRevocationNotice {\n\tscope_id: string;\n\tdevice_id: string;\n\tmembership_epoch: number | null;\n\tprevents_future_sync: true;\n\tdeletes_already_copied_data: false;\n\tmessage: string;\n}\n\nexport interface ScopeMembershipEpochStatus {\n\tmembership_epoch: number | null;\n\trequired_epoch: number | null;\n\tstale: boolean;\n\treason: \"current\" | \"stale_epoch\" | \"unknown_epoch\";\n}\n\nexport function scopeMembershipEpochStatus(input: {\n\tmembershipEpoch?: number | null;\n\trequiredEpoch?: number | null;\n}): ScopeMembershipEpochStatus {\n\tconst membershipEpoch = Number.isFinite(input.membershipEpoch)\n\t\t? Number(input.membershipEpoch)\n\t\t: null;\n\tconst requiredEpoch = Number.isFinite(input.requiredEpoch) ? Number(input.requiredEpoch) : null;\n\tif (membershipEpoch == null || requiredEpoch == null) {\n\t\treturn {\n\t\t\tmembership_epoch: membershipEpoch,\n\t\t\trequired_epoch: requiredEpoch,\n\t\t\tstale: false,\n\t\t\treason: \"unknown_epoch\",\n\t\t};\n\t}\n\treturn {\n\t\tmembership_epoch: membershipEpoch,\n\t\trequired_epoch: requiredEpoch,\n\t\tstale: membershipEpoch < requiredEpoch,\n\t\treason: membershipEpoch < requiredEpoch ? \"stale_epoch\" : \"current\",\n\t};\n}\n\nexport function explainScopeMembershipRevocation(input: {\n\tscopeId: string;\n\tdeviceId: string;\n\tmembershipEpoch?: number | null;\n}): ScopeMembershipRevocationNotice {\n\treturn {\n\t\tscope_id: input.scopeId,\n\t\tdevice_id: input.deviceId,\n\t\tmembership_epoch: Number.isFinite(input.membershipEpoch) ? Number(input.membershipEpoch) : null,\n\t\tprevents_future_sync: true,\n\t\tdeletes_already_copied_data: false,\n\t\tmessage: SCOPE_MEMBERSHIP_REVOCATION_LIMITATION,\n\t};\n}\n"],"mappings":";;;AAKA,SAAS,EAAW,GAAoC;CACvD,IAAI;EACH,IAAM,IAAS,KAAK,CAAO;EAC3B,OAAO,WAAW,KAAK,IAAS,MAAc,EAAU,WAAW,CAAC,CAAC;CACtE,QAAQ;EACP,OAAO;CACR;AACD;AAEA,SAAS,EAAW,GAAqC;CACxD,IAAI,EAAK,SAAS,GAAG,OAAO;CAC5B,IAAM,IAAO,IAAI,SAAS,EAAK,QAAQ,EAAK,YAAY,EAAK,UAAU,GACjE,IAAU,IAAI,EAAK,UAAU,CAAC;CACpC,IAAI,EAAK,SAAS,IAAU,GAAG,OAAO;CACtC,IAAM,IAAY,EAAK,UAAU,CAAO,GAClC,IAAW,IAAU;CAE3B,OADI,MAAc,MAAM,EAAK,SAAS,IAAW,IAAkB,OAC5D,EAAK,SAAS,GAAU,IAAW,CAAS;AACpD;AAEA,SAAS,EAAc,GAAgC;CACtD,IAAM,oBAAO,IAAI,WAAW,EAAE,GACxB,IAAO,IAAI,SAAS,EAAK,MAAM;CAKrC,OAJA,EAAK,UAAU,GAAG,EAAE,GACpB,EAAK,IAAI,IAAI,YAAY,CAAC,CAAC,OAAO,aAAa,GAAG,CAAC,GACnD,EAAK,UAAU,IAAI,EAAE,GACrB,EAAK,IAAI,GAAQ,EAAE,GACZ;AACR;AAOA,SAAgB,EAAyB,GAAoC;CAC5E,OAAO,EAAoC,GAAW,CAAU;AACjE;AAGA,SAAgB,EACf,GACA,GACkB;CAClB,IAAI,OAAO,KAAc,UAAU,OAAO,EAAE,MAAM,QAAQ;CAC1D,IAAM,CAAC,GAAS,KAAW,EAAU,KAAK,CAAC,C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,SAAS,EAAM,eAAe,IAC1D,OAAO,EAAM,eAAe,IAC5B,MACG,IAAgB,OAAO,SAAS,EAAM,aAAa,IAAI,OAAO,EAAM,aAAa,IAAI;CAS3F,OARI,KAAmB,QAAQ,KAAiB,OACxC;EACN,kBAAkB;EAClB,gBAAgB;EAChB,OAAO;EACP,QAAQ;CACT,IAEM;EACN,kBAAkB;EAClB,gBAAgB;EAChB,OAAO,IAAkB;EACzB,QAAQ,IAAkB,IAAgB,gBAAgB;CAC3D;AACD;AAEA,SAAgB,EAAiC,GAIb;CACnC,OAAO;EACN,UAAU,EAAM;EAChB,WAAW,EAAM;EACjB,kBAAkB,OAAO,SAAS,EAAM,eAAe,IAAI,OAAO,EAAM,eAAe,IAAI;EAC3F,sBAAsB;EACtB,6BAA6B;EAC7B,SAAS;CACV;AACD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"semantic-worker-ranking-5-VSzEmx.js","names":[],"sources":["../src/automatic-continuity.ts","../src/same-actor-peers.ts","../src/semantic/validated-vector-index.ts","../src/semantic/semantic-worker-ranking.ts"],"sourcesContent":["import type { Database } from \"./db.js\";\nimport { projectColumnClause } from \"./project.js\";\nimport { summaryLikeSqlPredicate } from \"./summary-memory.js\";\nimport type { AutomaticContext } from \"./types.js\";\n\n/** Select continuity within the current project when a host session has moved. */\nexport function automaticSummarySession(\n\tdb: Database,\n\tcontext: AutomaticContext | null | undefined,\n\tproject?: string | null,\n): number | null | undefined {\n\tif (context === undefined) return undefined;\n\tif (context === null) return null;\n\tconst source = context.source.trim().toLowerCase();\n\tconst hostId = context.hostSessionId.trim();\n\tif (!source || !hostId || hostId.toLowerCase() === \"unknown\") return null;\n\tconst filter = projectColumnClause(\"s.project\", project ?? \"\");\n\tconst rows = db\n\t\t.prepare(`\n\t\tSELECT os.session_id FROM opencode_sessions os JOIN sessions s ON s.id = os.session_id\n\t\tWHERE os.source = ? AND os.opencode_session_id = ?\n\t\t${filter.clause ? `AND ${filter.clause}` : \"\"}\n\t\tORDER BY (SELECT MAX(memory_items.created_at) FROM memory_items\n\t\t\tWHERE memory_items.session_id = os.session_id AND memory_items.active = 1\n\t\t\tAND ${summaryLikeSqlPredicate()}) DESC, s.started_at DESC, s.id DESC LIMIT 2\n\t`)\n\t\t.all(source, hostId, ...filter.params) as Array<{ session_id: number }>;\n\tif (!filter.clause && rows.length > 1) return null;\n\treturn rows[0]?.session_id ?? null;\n}\n","import { eq, or } from \"drizzle-orm\";\nimport { drizzle } from \"drizzle-orm/better-sqlite3\";\nimport { columnExists, type Database, tableExists } from \"./db.js\";\nimport * as schema from \"./schema.js\";\nimport { fingerprintPublicKey } from \"./sync-fingerprint.js\";\n\nconst SAME_PERSON_BINDING_PROVENANCE = new Set([\n\t\"user_confirmed_identity_setup\",\n\t\"recipient_invite\",\n\t\"exact_project_invite\",\n\t\"review_resolution\",\n]);\n\n/** Shared read-only resolver; authoritative bindings take precedence over legacy claims. */\nexport function resolveSameActorPeerIds(db: Database, actorId: string): string[] {\n\tconst sets = resolveBindings(db, actorId);\n\tif (!sets) return [];\n\tif (!tableExists(db, \"sync_peers\")) return [...sets.deviceIds].sort();\n\tconst hasAliasEvidence = [\"peer_device_id\", \"public_key\", \"pinned_fingerprint\"].every((column) =>\n\t\tcolumnExists(db, \"sync_peers\", column),\n\t);\n\tif (sets.boundDeviceIds.size > 0 && !hasAliasEvidence) return [...sets.deviceIds].sort();\n\tif (sets.boundDeviceIds.size > 0) resolveAliases(db, sets);\n\tconst legacyRows = drizzle(db, { schema })\n\t\t.select({ peer_device_id: schema.syncPeers.peer_device_id })\n\t\t.from(schema.syncPeers)\n\t\t.where(or(eq(schema.syncPeers.claimed_local_actor, 1), eq(schema.syncPeers.actor_id, actorId)))\n\t\t.all();\n\tfor (const row of legacyRows) {\n\t\tconst deviceId = String(row.peer_device_id ?? \"\").trim();\n\t\tif (deviceId && !sets.boundDeviceIds.has(deviceId)) sets.deviceIds.add(deviceId);\n\t}\n\treturn [...sets.deviceIds].sort();\n}\n\ntype BindingSets = {\n\tdeviceIds: Set<string>;\n\tboundDeviceIds: Set<string>;\n\tlocallyBoundDeviceIds: Set<string>;\n};\n\nfunction activeActor(db: Database, actorId: string, bindingCount: number): boolean {\n\tif (bindingCount === 0 || !tableExists(db, \"actors\")) return false;\n\tif (\n\t\t![\"actor_id\", \"status\", \"merged_into_actor_id\"].every((column) =>\n\t\t\tcolumnExists(db, \"actors\", column),\n\t\t)\n\t)\n\t\treturn false;\n\tconst actor = db\n\t\t.prepare(\"SELECT status, merged_into_actor_id FROM actors WHERE actor_id = ?\")\n\t\t.get(actorId) as { status: string; merged_into_actor_id: string | null } | undefined;\n\treturn actor?.status === \"active\" && !actor.merged_into_actor_id;\n}\n\nfunction resolveBindings(db: Database, actorId: string): BindingSets | null {\n\tconst sets: BindingSets = {\n\t\tdeviceIds: new Set(),\n\t\tboundDeviceIds: new Set(),\n\t\tlocallyBoundDeviceIds: new Set(),\n\t};\n\tconst hasIdentityBindings =\n\t\ttableExists(db, \"identity_devices\") &&\n\t\t[\"device_id\", \"identity_id\", \"status\", \"provenance\"].every((column) =>\n\t\t\tcolumnExists(db, \"identity_devices\", column),\n\t\t);\n\tif (tableExists(db, \"identity_devices\") && !hasIdentityBindings) return null;\n\tif (!hasIdentityBindings) return sets;\n\tconst bindings = db\n\t\t.prepare(\"SELECT device_id, identity_id, status, provenance FROM identity_devices\")\n\t\t.all() as Array<{\n\t\tdevice_id: string;\n\t\tidentity_id: string;\n\t\tstatus: string;\n\t\tprovenance: string;\n\t}>;\n\tconst localActorIsActive = activeActor(db, actorId, bindings.length);\n\tfor (const binding of bindings) {\n\t\tconst deviceId = String(binding.device_id ?? \"\").trim();\n\t\tif (!deviceId) continue;\n\t\tsets.boundDeviceIds.add(deviceId);\n\t\tif (\n\t\t\tlocalActorIsActive &&\n\t\t\tString(binding.identity_id ?? \"\").trim() === actorId &&\n\t\t\tbinding.status === \"active\" &&\n\t\t\tSAME_PERSON_BINDING_PROVENANCE.has(binding.provenance)\n\t\t) {\n\t\t\tsets.deviceIds.add(deviceId);\n\t\t\tsets.locallyBoundDeviceIds.add(deviceId);\n\t\t}\n\t}\n\treturn sets;\n}\n\ntype PeerEvidence = {\n\tpeer_device_id: string;\n\tpublic_key: string | null;\n\tpinned_fingerprint: string | null;\n};\n\nfunction validatedFingerprint(row: PeerEvidence): string | null {\n\tconst publicKey = String(row.public_key ?? \"\").trim();\n\tconst pinned = String(row.pinned_fingerprint ?? \"\").trim();\n\tif (!publicKey) return pinned || null;\n\tconst derived = fingerprintPublicKey(publicKey);\n\treturn pinned && pinned !== derived ? null : pinned || derived;\n}\n\nfunction provenFingerprint(row: PeerEvidence): string | null {\n\treturn String(row.public_key ?? \"\").trim() ? validatedFingerprint(row) : null;\n}\n\nfunction resolveAliases(db: Database, sets: BindingSets): void {\n\tconst { deviceIds, boundDeviceIds } = sets;\n\tconst peerEvidence = db\n\t\t.prepare(\"SELECT peer_device_id, public_key, pinned_fingerprint FROM sync_peers\")\n\t\t.all() as PeerEvidence[];\n\tconst { boundFingerprints, locallyBoundFingerprints } = resolveBoundFingerprints(\n\t\tpeerEvidence,\n\t\tsets,\n\t);\n\tfor (const row of peerEvidence) {\n\t\tconst deviceId = String(row.peer_device_id ?? \"\").trim();\n\t\tconst fingerprint = validatedFingerprint(row);\n\t\tif (!deviceId || !fingerprint || !boundFingerprints.has(fingerprint)) continue;\n\t\tconst hasAuthoritativeBinding = boundDeviceIds.has(deviceId);\n\t\tboundDeviceIds.add(deviceId);\n\t\tif (\n\t\t\t!hasAuthoritativeBinding &&\n\t\t\tlocallyBoundFingerprints.has(fingerprint) &&\n\t\t\tprovenFingerprint(row)\n\t\t) {\n\t\t\tdeviceIds.add(deviceId);\n\t\t}\n\t}\n}\n\nfunction resolveBoundFingerprints(peerEvidence: PeerEvidence[], sets: BindingSets) {\n\tconst { boundDeviceIds, locallyBoundDeviceIds } = sets;\n\tconst boundFingerprints = new Set<string>();\n\tconst locallyBoundFingerprints = new Set<string>();\n\tconst conflictingBoundFingerprints = new Set<string>();\n\tfor (const row of peerEvidence) {\n\t\tconst deviceId = String(row.peer_device_id ?? \"\").trim();\n\t\tconst fingerprint = validatedFingerprint(row);\n\t\tif (!deviceId || !fingerprint || !boundDeviceIds.has(deviceId)) continue;\n\t\tboundFingerprints.add(fingerprint);\n\t\tif (locallyBoundDeviceIds.has(deviceId)) {\n\t\t\tif (provenFingerprint(row)) locallyBoundFingerprints.add(fingerprint);\n\t\t} else {\n\t\t\tconflictingBoundFingerprints.add(fingerprint);\n\t\t}\n\t}\n\tfor (const fingerprint of conflictingBoundFingerprints)\n\t\tlocallyBoundFingerprints.delete(fingerprint);\n\treturn { boundFingerprints, locallyBoundFingerprints };\n}\n","/** Persisted vector writer contract and readiness-gated semantic ranking. */\nimport type { Database } from \"../db.js\";\nimport {\n\ttype RankingRequest,\n\ttype RankingResult,\n\trankPrevalidatedSnapshot,\n\tresolveCatalogModels,\n} from \"./semantic-ranking.js\";\nimport {\n\ttype CandidateVersion,\n\tisSearchableVectorCatalog,\n\treadCandidateVersions,\n\treadCatalog,\n\treadSearchableModelLabels,\n\tsnapshot,\n} from \"./validated-vector-index-state.js\";\n\nexport { auditBatch, startAudit } from \"./validated-vector-index-audit.js\";\nexport {\n\tdeleteValidatedVectors,\n\ttype ValidatedBatch,\n\twriteValidatedBatch,\n} from \"./validated-vector-index-mutations.js\";\nexport {\n\ttype AuditProgress,\n\ttype CandidateVersion,\n\tinitializeValidatedIndex,\n\tinvalidateValidatedIndex,\n\tisSearchableVectorCatalog,\n\treadCandidateVersions,\n\treadCatalog,\n\treadSearchableModelLabels,\n\ttype VectorCatalog,\n} from \"./validated-vector-index-state.js\";\n\nexport interface IndexedRanking extends RankingResult {\n\tgenerationId: string;\n\trevision: number;\n\tmodels: string[];\n\tcandidateVersions: CandidateVersion[];\n}\n\n/** Reuses a caller-owned read transaction; no DDL, audit, BLOB hashes or model-catalog vec0 scan. */\nexport function rankValidatedIndex(db: Database, request: RankingRequest): IndexedRanking | null {\n\treturn snapshot(db, () => {\n\t\tconst catalog = readCatalog(db);\n\t\tif (!isSearchableVectorCatalog(db, catalog)) return null;\n\t\tconst models = resolveCatalogModels(\n\t\t\trequest.query.model,\n\t\t\treadSearchableModelLabels(db, catalog),\n\t\t\tcatalog.migration,\n\t\t);\n\t\tif (!models.length) return null;\n\t\tconst ranked = rankPrevalidatedSnapshot(db, request, {\n\t\t\tmodels,\n\t\t\tacceptedIds: null,\n\t\t\tindexedRows: true,\n\t\t});\n\t\tconst candidateVersions = readCandidateVersions(db, {\n\t\t\tmemoryIds: ranked.results.map((row) => row.id),\n\t\t\tmodels,\n\t\t});\n\t\treturn {\n\t\t\t...ranked,\n\t\t\tgenerationId: catalog.generationId,\n\t\t\trevision: catalog.revision,\n\t\t\tmodels,\n\t\t\tcandidateVersions,\n\t\t};\n\t});\n}\n","import { createHash } from \"node:crypto\";\nimport { automaticSummarySession } from \"../automatic-continuity.js\";\nimport type { Database } from \"../db.js\";\nimport { resolveSameActorPeerIds } from \"../same-actor-peers.js\";\nimport type { AutomaticContext } from \"../types.js\";\nimport type { RankInput, RankOutput } from \"./semantic-worker-protocol.js\";\nimport {\n\tisSearchableVectorCatalog,\n\trankValidatedIndex,\n\treadCatalog,\n} from \"./validated-vector-index.js\";\n\nexport function contentIdentity(row: Record<string, unknown>): string {\n\treturn createHash(\"sha256\").update(JSON.stringify(row)).digest(\"hex\");\n}\n\nexport function summarySessionId(\n\tdb: Database,\n\tcontext: AutomaticContext | null | undefined,\n\tproject?: string | null,\n): number | null | undefined {\n\treturn automaticSummarySession(db, context, project);\n}\n\n/** Authorization, continuity, model selection, ranking and identities share one short read snapshot. */\nexport function rankWorkerInput(db: Database, input: RankInput): RankOutput | null {\n\treturn db.transaction(() => {\n\t\tconst catalog = readCatalog(db);\n\t\tif (!isSearchableVectorCatalog(db, catalog) || catalog.generationId !== input.generationId)\n\t\t\treturn null;\n\t\tconst claimedDeviceIds = resolveSameActorPeerIds(db, input.proof.actorId);\n\t\tconst ranked = rankValidatedIndex(db, {\n\t\t\tquery: { model: input.embeddingIdentity, vectors: [input.embedding] },\n\t\t\tlimit: input.limit,\n\t\t\tfilters: input.filters,\n\t\t\tcontext: {\n\t\t\t\t...input.proof,\n\t\t\t\tclaimedDeviceIds,\n\t\t\t\tlegacyActorIds: claimedDeviceIds.map((id) => `legacy-sync:${id}`),\n\t\t\t\tscopeVisibilityDb: db,\n\t\t\t},\n\t\t\tsummarySessionId: summarySessionId(db, input.automaticContext, input.filters?.project),\n\t\t});\n\t\tif (!ranked || ranked.generationId !== input.generationId) return null;\n\t\treturn {\n\t\t\tgenerationId: ranked.generationId,\n\t\t\trevision: ranked.revision,\n\t\t\tmodels: ranked.models,\n\t\t\tcandidateVersions: ranked.candidateVersions,\n\t\t\tcandidates: ranked.results.map((row) => {\n\t\t\t\tconst raw = db.prepare(\"SELECT * FROM memory_items WHERE id = ?\").get(row.id) as Record<\n\t\t\t\t\tstring,\n\t\t\t\t\tunknown\n\t\t\t\t>;\n\t\t\t\treturn {\n\t\t\t\t\tid: row.id,\n\t\t\t\t\tdistance: row.distance,\n\t\t\t\t\tcontentIdentity: contentIdentity(raw),\n\t\t\t\t};\n\t\t\t}),\n\t\t};\n\t})();\n}\n"],"mappings":";;;;;;;AAMA,SAAgB,EACf,GACA,GACA,GAC4B;CAC5B,IAAI,MAAY,KAAA,GAAW;CAC3B,IAAI,MAAY,MAAM,OAAO;CAC7B,IAAM,IAAS,EAAQ,OAAO,KAAK,CAAC,CAAC,YAAY,GAC3C,IAAS,EAAQ,cAAc,KAAK;CAC1C,IAAI,CAAC,KAAU,CAAC,KAAU,EAAO,YAAY,MAAM,WAAW,OAAO;CACrE,IAAM,IAAS,EAAoB,aAAa,KAAW,EAAE,GACvD,IAAO,EACX,QAAQ;;;IAGP,EAAO,SAAS,OAAO,EAAO,WAAW,GAAG;;;SAGvC,EAAwB,EAAE;EACjC,CAAC,CACA,IAAI,GAAQ,GAAQ,GAAG,EAAO,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