@noy-db/hub 0.7.0-pre.9 → 0.7.1-pre.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1327 -0
- package/README.md +29 -11
- package/dist/api-WYW4YEQG.js +19 -0
- package/dist/as/index.js +14 -14
- package/dist/at/index.js +9 -10
- package/dist/attestation/index.js +18 -19
- package/dist/attestation/index.js.map +1 -1
- package/dist/{backup-QZQEP5RO.js → backup-XKCXVKV3.js} +23 -18
- package/dist/backup-XKCXVKV3.js.map +1 -0
- package/dist/blobs/index.js +13 -14
- package/dist/blobs/index.js.map +1 -1
- package/dist/broker/index.js +12 -13
- package/dist/broker/index.js.map +1 -1
- package/dist/by/index.js +2 -3
- package/dist/cargo/index.js +33 -34
- package/dist/{chunk-5UKIZIO3.js → chunk-2577DKXB.js} +2 -2
- package/dist/{chunk-SWFIXQF5.js → chunk-2ENE6445.js} +6 -6
- package/dist/{chunk-HLFLJCDX.js → chunk-2N5ML6HT.js} +7 -7
- package/dist/{chunk-X6YRP5EC.js → chunk-334WSVOW.js} +5 -5
- package/dist/{chunk-5EC7X5QA.js → chunk-3BVH633C.js} +5 -5
- package/dist/chunk-3BZZJJMQ.js +176 -0
- package/dist/chunk-3BZZJJMQ.js.map +1 -0
- package/dist/{chunk-7XT7KZTN.js → chunk-3PGS7TYR.js} +10 -10
- package/dist/{chunk-OHGCRKWA.js → chunk-3V4KWFX7.js} +18 -8
- package/dist/chunk-3V4KWFX7.js.map +1 -0
- package/dist/{chunk-AHIIBDNH.js → chunk-3VF3WQ4F.js} +7 -7
- package/dist/{chunk-GM4IM7TC.js → chunk-453F654R.js} +2 -2
- package/dist/{chunk-5W5CEHLA.js → chunk-4GFX6MPA.js} +6 -6
- package/dist/{chunk-JUBWUJY5.js → chunk-4GVM6QZA.js} +2 -2
- package/dist/{chunk-2DGBRE4K.js → chunk-4OZNXTO4.js} +2 -2
- package/dist/{chunk-DOPZWTMJ.js → chunk-4ZS56W5S.js} +8 -8
- package/dist/{chunk-P2RJAVMR.js → chunk-5VCRVKOZ.js} +4 -4
- package/dist/chunk-66TQOPFM.js +37 -0
- package/dist/chunk-66TQOPFM.js.map +1 -0
- package/dist/{chunk-FN26SFGH.js → chunk-6LKOJBV6.js} +2 -2
- package/dist/{chunk-P7KJME6C.js → chunk-6YXCPL4T.js} +2 -2
- package/dist/{chunk-IS5LFHV2.js → chunk-7APJ6CO6.js} +7 -7
- package/dist/{chunk-LAI7ENPW.js → chunk-7MG2LHO5.js} +3 -3
- package/dist/{chunk-N4CHCXDL.js → chunk-7MG7SJT7.js} +1 -1
- package/dist/{chunk-N4CHCXDL.js.map → chunk-7MG7SJT7.js.map} +1 -1
- package/dist/{chunk-SW4TOSJL.js → chunk-7O3Y4PPD.js} +1 -1
- package/dist/chunk-7O3Y4PPD.js.map +1 -0
- package/dist/{chunk-MU74BYOD.js → chunk-A2HKRLPV.js} +3 -3
- package/dist/{chunk-357ECVLE.js → chunk-A66I4JOA.js} +3 -3
- package/dist/{chunk-VT4DTCK5.js → chunk-ACAQ2DSG.js} +3 -3
- package/dist/chunk-ACAQ2DSG.js.map +1 -0
- package/dist/{chunk-TAJZ7GXO.js → chunk-AYX7AINO.js} +3 -3
- package/dist/{chunk-RPX2H2OL.js → chunk-BLN54W3L.js} +3 -3
- package/dist/{chunk-XGXVPCYW.js → chunk-BRLKZUBT.js} +3 -3
- package/dist/{chunk-CWFH36SI.js → chunk-BTDR2PXY.js} +2 -2
- package/dist/{chunk-65ZYRK7O.js → chunk-BUE2D7PX.js} +26 -3
- package/dist/chunk-BUE2D7PX.js.map +1 -0
- package/dist/{chunk-RCONOOVF.js → chunk-BVN6KXL2.js} +5 -5
- package/dist/chunk-BVN6KXL2.js.map +1 -0
- package/dist/{chunk-UTFY6W6X.js → chunk-BZ3534YM.js} +2 -2
- package/dist/{chunk-KZTPL7NL.js → chunk-CHQCZZWC.js} +2 -2
- package/dist/chunk-CUQPWYRX.js +1652 -0
- package/dist/chunk-CUQPWYRX.js.map +1 -0
- package/dist/{chunk-MQPHKJ74.js → chunk-DFMWUOU5.js} +12 -12
- package/dist/{chunk-3GIA3HJ2.js → chunk-DGOZ4UZD.js} +2 -2
- package/dist/{chunk-NMDMSHBF.js → chunk-EQEYOJBM.js} +3 -3
- package/dist/{chunk-OQDHIAR2.js → chunk-F3W6YMDC.js} +80 -8
- package/dist/chunk-F3W6YMDC.js.map +1 -0
- package/dist/{chunk-Q2ZN5DWZ.js → chunk-FAHMLERK.js} +2 -2
- package/dist/{chunk-PCIBCL26.js → chunk-FET5XCAT.js} +7 -5
- package/dist/{chunk-PCIBCL26.js.map → chunk-FET5XCAT.js.map} +1 -1
- package/dist/chunk-FFWI7UH7.js +53 -0
- package/dist/chunk-FFWI7UH7.js.map +1 -0
- package/dist/{chunk-GKOJR53Y.js → chunk-G73UVHCA.js} +5 -5
- package/dist/{chunk-H5GVPOB4.js → chunk-GPNTB4Y7.js} +5 -5
- package/dist/{chunk-DNMTN46H.js → chunk-GY4WYNNG.js} +2 -2
- package/dist/{chunk-HS3LEVT4.js → chunk-HIWCKBEY.js} +7 -7
- package/dist/{chunk-UL7TLJ54.js → chunk-HJUWN7JN.js} +6 -4
- package/dist/{chunk-UL7TLJ54.js.map → chunk-HJUWN7JN.js.map} +1 -1
- package/dist/{chunk-USKHHOIV.js → chunk-HPVZCW43.js} +30 -2
- package/dist/chunk-HPVZCW43.js.map +1 -0
- package/dist/{chunk-PV7XXAXK.js → chunk-JBDFMYKQ.js} +2 -2
- package/dist/{chunk-IZTU6RKH.js → chunk-JMGDHKQF.js} +2 -2
- package/dist/{chunk-P22XPNFW.js → chunk-JVIBCBC7.js} +2 -2
- package/dist/{chunk-OLUTCM23.js → chunk-K23VKTN4.js} +7 -7
- package/dist/{chunk-3SWP2FYA.js → chunk-KKEESNPE.js} +8 -8
- package/dist/{chunk-ZB2K3FV7.js → chunk-KTFRCC5C.js} +2 -2
- package/dist/{chunk-IAHDSFFA.js → chunk-LH5A3ZPG.js} +10 -10
- package/dist/{chunk-QOHGWFAW.js → chunk-LWBCUYZW.js} +2 -2
- package/dist/{chunk-5NKHCJU5.js → chunk-M4YPHYEH.js} +8 -8
- package/dist/{chunk-JFSUYGNE.js → chunk-MVMXZYXT.js} +2 -2
- package/dist/{chunk-FKQCC4C5.js → chunk-NQKIUNW5.js} +2 -2
- package/dist/{chunk-Q2OAAREU.js → chunk-OTQZ7ZWU.js} +6 -6
- package/dist/{chunk-MOQ6OGKS.js → chunk-P3MG6QCN.js} +4 -4
- package/dist/{chunk-75WNTBZL.js → chunk-PPTHY5QO.js} +3 -3
- package/dist/{chunk-TQGT5BZE.js → chunk-Q2MPFCQ7.js} +4 -4
- package/dist/{chunk-MTTPHBIE.js → chunk-Q2PU57HC.js} +2 -2
- package/dist/{chunk-FLRLZ4XZ.js → chunk-Q7HZX3IF.js} +2 -2
- package/dist/{chunk-KQIDBIZL.js → chunk-QIZPZMUI.js} +2 -2
- package/dist/{chunk-JRWLUWDM.js → chunk-QPQUVOZ2.js} +3 -3
- package/dist/{chunk-7YVSWPZB.js → chunk-QTQUH4DS.js} +7 -7
- package/dist/{chunk-2MQ2D5OZ.js → chunk-R42NSZI6.js} +5 -5
- package/dist/{chunk-FRIVOR5N.js → chunk-R7BX2NB3.js} +5 -172
- package/dist/chunk-R7BX2NB3.js.map +1 -0
- package/dist/{chunk-HOIWW2LV.js → chunk-RF6D3Y5E.js} +4 -4
- package/dist/{chunk-OEJ4R52I.js → chunk-RMS3NEA3.js} +2 -2
- package/dist/{chunk-FPN5D4JX.js → chunk-RSGLUIO6.js} +6 -6
- package/dist/chunk-RTBJ5IOO.js +87 -0
- package/dist/chunk-RTBJ5IOO.js.map +1 -0
- package/dist/chunk-RXLYKVTF.js +17 -0
- package/dist/chunk-RXLYKVTF.js.map +1 -0
- package/dist/{chunk-XKA6UH5V.js → chunk-SFAWCTEM.js} +2 -2
- package/dist/{chunk-I5LSKXT6.js → chunk-SGZAIJCV.js} +4 -4
- package/dist/{chunk-FYT3DXPN.js → chunk-SKGMN35F.js} +2 -2
- package/dist/chunk-SMH6SRX7.js +87 -0
- package/dist/chunk-SMH6SRX7.js.map +1 -0
- package/dist/{chunk-JILOSL4O.js → chunk-SPYWXKJN.js} +3 -3
- package/dist/{chunk-4RUFYGWG.js → chunk-SZJ3DLZA.js} +2 -2
- package/dist/chunk-TFMM5DBB.js +20 -0
- package/dist/chunk-TFMM5DBB.js.map +1 -0
- package/dist/{chunk-O3SNM66K.js → chunk-TFR7DSOV.js} +2 -2
- package/dist/{chunk-DIVY2CJZ.js → chunk-TRGTKX5E.js} +3 -3
- package/dist/{chunk-JY4U6CYV.js → chunk-TUFM4UZP.js} +2 -2
- package/dist/{chunk-LUVGSKXE.js → chunk-UDHWDSRL.js} +6 -6
- package/dist/{chunk-DZPMKY3J.js → chunk-UGTBXF5U.js} +3 -3
- package/dist/{chunk-K432FT7T.js → chunk-UHHPLO3I.js} +4 -4
- package/dist/{chunk-THNJ3IKU.js → chunk-ULUMAZ5S.js} +2 -2
- package/dist/{chunk-QJLOWGOU.js → chunk-UP4BECPY.js} +12 -82
- package/dist/chunk-UP4BECPY.js.map +1 -0
- package/dist/{chunk-YHIAWECL.js → chunk-UXVWEX5L.js} +2 -2
- package/dist/{chunk-NO272T7Q.js → chunk-V4PXLYWM.js} +2 -31
- package/dist/chunk-V4PXLYWM.js.map +1 -0
- package/dist/{chunk-OKCQNMO6.js → chunk-V7ZRRCRJ.js} +6 -6
- package/dist/{chunk-GHADG5QZ.js → chunk-VTFVLCUH.js} +2 -2
- package/dist/{chunk-U3RMWOXY.js → chunk-VXANTWBJ.js} +3 -3
- package/dist/{chunk-KHKKD62N.js → chunk-VYYM3MEN.js} +2 -16
- package/dist/chunk-VYYM3MEN.js.map +1 -0
- package/dist/{chunk-VTTDPGEK.js → chunk-WQBG4SZS.js} +26 -57
- package/dist/chunk-WQBG4SZS.js.map +1 -0
- package/dist/{chunk-MV2OEK3K.js → chunk-XKWGNJ26.js} +5 -5
- package/dist/{chunk-2E2LT37H.js → chunk-XLMEZIAJ.js} +2 -2
- package/dist/{chunk-RHTPGS56.js → chunk-YJRT5UQM.js} +3 -3
- package/dist/{chunk-FZWAGG5T.js → chunk-YJX7EOJD.js} +6 -6
- package/dist/{chunk-ZQGRZN5L.js → chunk-YYP7WSEB.js} +2 -2
- package/dist/{chunk-MENI33ZV.js → chunk-ZHKOPKE3.js} +3 -3
- package/dist/{chunk-4U52PMEL.js → chunk-ZN4FD4PE.js} +4 -4
- package/dist/{chunk-AW4KTQA4.js → chunk-ZORTV6NH.js} +2 -2
- package/dist/{chunk-6L5IMNJX.js → chunk-ZYIYHJ5R.js} +236 -1333
- package/dist/chunk-ZYIYHJ5R.js.map +1 -0
- package/dist/classified/index.js +5 -6
- package/dist/{classified-marker-R37XW5PC.js → classified-marker-BWOFVYAC.js} +3 -5
- package/dist/{classified-marker-R37XW5PC.js.map → classified-marker-BWOFVYAC.js.map} +1 -1
- package/dist/collection-facade-JSJYIKS4.js +45 -0
- package/dist/computed-VPOKQK4N.js +10 -0
- package/dist/consent/index.js +9 -10
- package/dist/consent/index.js.map +1 -1
- package/dist/cover/index.js +9 -10
- package/dist/crdt/index.js +0 -1
- package/dist/crdt/index.js.map +1 -1
- package/dist/custody/index.js +12 -13
- package/dist/{dead-filter-GRT6RAML.js → dead-filter-PKQDLOT4.js} +2 -3
- package/dist/{dead-filter-GRT6RAML.js.map → dead-filter-PKQDLOT4.js.map} +1 -1
- package/dist/debug/index.js +1 -2
- package/dist/debug/index.js.map +1 -1
- package/dist/{delegation-6QRAYSK6.js → delegation-DS5NRILW.js} +11 -12
- package/dist/{delegation-6QRAYSK6.js.map → delegation-DS5NRILW.js.map} +1 -1
- package/dist/derivations/index.js +30 -16
- package/dist/derive-E642AOUB.js +21 -0
- package/dist/directory/index.js +10 -11
- package/dist/{dispatch-QCF7KPIP.js → dispatch-IEPAVQUM.js} +5 -7
- package/dist/{dispatch-QCF7KPIP.js.map → dispatch-IEPAVQUM.js.map} +1 -1
- package/dist/dispatch-Q6MWLOJY.js +302 -0
- package/dist/dispatch-Q6MWLOJY.js.map +1 -0
- package/dist/{enclave-OXZY3NOP.js → enclave-55PAM4YO.js} +15 -10
- package/dist/executor-5NIMLSKZ.js +8 -0
- package/dist/executor-7UQ3BZ4F.js +29 -0
- package/dist/executor-AQVXV5GZ.js +8 -0
- package/dist/export-accessible-ORMKLA3E.js +22 -0
- package/dist/extract-partition-NKYO3WNG.js +37 -0
- package/dist/{fanout-sidecar-KGQCUJ7P.js → fanout-sidecar-S3QL53YX.js} +9 -10
- package/dist/{fanout-sidecar-KGQCUJ7P.js.map → fanout-sidecar-S3QL53YX.js.map} +1 -1
- package/dist/{fence-watcher-ZVSMLKQD.js → fence-watcher-U2PW6JU5.js} +1 -3
- package/dist/{fence-watcher-ZVSMLKQD.js.map → fence-watcher-U2PW6JU5.js.map} +1 -1
- package/dist/find-NOGJ25VX.js +10 -0
- package/dist/forget/index.js +9 -10
- package/dist/forget/index.js.map +1 -1
- package/dist/guards/index.js +4 -5
- package/dist/history/index.js +13 -14
- package/dist/history/index.js.map +1 -1
- package/dist/i18n/index.js +14 -15
- package/dist/i18n/index.js.map +1 -1
- package/dist/index.d.ts +21 -4
- package/dist/index.js +122 -115
- package/dist/index.js.map +1 -1
- package/dist/indexing/index.js +2 -3
- package/dist/indexing/index.js.map +1 -1
- package/dist/introspection/index.js +13 -13
- package/dist/issue-3DTQ7VJJ.js +18 -0
- package/dist/{json-schema-I22JCYCG.js → json-schema-V3M5MUCM.js} +1 -3
- package/dist/{json-schema-I22JCYCG.js.map → json-schema-V3M5MUCM.js.map} +1 -1
- package/dist/kernel/collection-config.d.ts +34 -0
- package/dist/kernel/collection.d.ts +11 -6
- package/dist/kernel/enclave/crypto.d.ts +16 -0
- package/dist/kernel/enclave/index.d.ts +1 -1
- package/dist/kernel/errors.d.ts +28 -0
- package/dist/kernel/match-pairs.d.ts +30 -0
- package/dist/kernel/memory-store.d.ts +35 -7
- package/dist/kernel/types.d.ts +39 -0
- package/dist/lazy/index.js +3 -3
- package/dist/{ledger-ZAFULLAF.js → ledger-EDXFFZQL.js} +11 -12
- package/dist/liberate-V35QUHJP.js +24 -0
- package/dist/link-set-2TTM3IZC.js +30 -0
- package/dist/{managed-secret-7OH7HKXV.js → managed-secret-NCWEMPUQ.js} +10 -11
- package/dist/materialized-views/index.js +21 -21
- package/dist/{migrate-cek-QHZ75E6E.js → migrate-cek-5ENH64AA.js} +2 -3
- package/dist/{migrate-cek-QHZ75E6E.js.map → migrate-cek-5ENH64AA.js.map} +1 -1
- package/dist/money/index.js +4 -5
- package/dist/noydb-62MX4QUG.js +90 -0
- package/dist/overlay-views/index.js +4 -5
- package/dist/periods/index.js +12 -13
- package/dist/pod/index.js +64 -60
- package/dist/{pod-handle-BLOI4IFY.js → pod-handle-ECVCDIXW.js} +10 -11
- package/dist/{pod-handle-BLOI4IFY.js.map → pod-handle-ECVCDIXW.js.map} +1 -1
- package/dist/policy/index.js +10 -11
- package/dist/port/to/index.d.ts +40 -0
- package/dist/portability/index.js +8 -9
- package/dist/portability/index.js.map +1 -1
- package/dist/{post-register-R33EKJQR.js → post-register-3IPCSG6Q.js} +6 -7
- package/dist/{post-register-R33EKJQR.js.map → post-register-3IPCSG6Q.js.map} +1 -1
- package/dist/{purge-scope-FGNNLWHD.js → purge-scope-4HEFPDOW.js} +1 -3
- package/dist/{purge-scope-FGNNLWHD.js.map → purge-scope-4HEFPDOW.js.map} +1 -1
- package/dist/query/index.js +3 -4
- package/dist/{read-only-facade-CHCKSEPD.js → read-only-facade-BIGO37U3.js} +1 -2
- package/dist/reduce/index.js +4 -5
- package/dist/reduce/index.js.map +1 -1
- package/dist/register-HHLXEQDN.js +31 -0
- package/dist/registry-23WF3TGH.js +8 -0
- package/dist/registry-4AYVUNXK.js +8 -0
- package/dist/registry-JS3YFQQM.js +18 -0
- package/dist/registry-XX2Z7B46.js +32 -0
- package/dist/request-withdrawal-CHPATE4G.js +30 -0
- package/dist/{reveal-PI6ADRQU.js → reveal-QZDHSGD4.js} +6 -7
- package/dist/{reveal-PI6ADRQU.js.map → reveal-QZDHSGD4.js.map} +1 -1
- package/dist/revoke-7M2VW4ON.js +23 -0
- package/dist/satellites/index.js +1 -2
- package/dist/schema-update/index.js +2 -3
- package/dist/sealed-record/index.js +12 -13
- package/dist/sealed-record/index.js.map +1 -1
- package/dist/search/index.js +4 -5
- package/dist/{seed-CG7JMJNY.js → seed-X5CC22CQ.js} +12 -13
- package/dist/{seed-CG7JMJNY.js.map → seed-X5CC22CQ.js.map} +1 -1
- package/dist/sequence/index.js +9 -10
- package/dist/session/index.js +9 -10
- package/dist/session/index.js.map +1 -1
- package/dist/shadow/index.js +2 -3
- package/dist/shadow/index.js.map +1 -1
- package/dist/share-link/index.js +0 -1
- package/dist/share-link/index.js.map +1 -1
- package/dist/signer-SJQJVSM6.js +24 -0
- package/dist/snapshots/index.js +10 -11
- package/dist/snapshots/index.js.map +1 -1
- package/dist/{stale-HZR7745Y.js → stale-BZS6H2RY.js} +10 -11
- package/dist/storage-RW4QBS23.js +22 -0
- package/dist/store/index.js +0 -1
- package/dist/{store-coordination-provider-MYIHSZXT.js → store-coordination-provider-4WZAIRHC.js} +10 -11
- package/dist/{store-coordination-provider-MYIHSZXT.js.map → store-coordination-provider-4WZAIRHC.js.map} +1 -1
- package/dist/sync/index.js +10 -11
- package/dist/sync/index.js.map +1 -1
- package/dist/team/index.js +15 -16
- package/dist/tiers/index.js +11 -12
- package/dist/to/index.js +2 -3
- package/dist/to/index.js.map +1 -1
- package/dist/transactions/index.js +3 -4
- package/dist/transactions/index.js.map +1 -1
- package/dist/{ulid-VQW6ERQN.js → ulid-4MKXG325.js} +1 -2
- package/dist/util/index.js +1 -2
- package/dist/util/index.js.map +1 -1
- package/dist/{vault-diff-FE5J35NJ.js → vault-diff-C6WUJFNP.js} +1 -2
- package/dist/vault-head/index.js +8 -9
- package/dist/vault-head/index.js.map +1 -1
- package/dist/{verify-R6CCBUA3.js → verify-6MDTIUEV.js} +5 -6
- package/dist/{verify-R6CCBUA3.js.map → verify-6MDTIUEV.js.map} +1 -1
- package/dist/walk-ZURCH6RZ.js +21 -0
- package/dist/with-formula/derivations/dispatch.d.ts +16 -1
- package/dist/with-formula/derivations/registry.d.ts +20 -0
- package/dist/with-formula/derivations/trigger-match.d.ts +104 -0
- package/dist/with-formula/derivations/types.d.ts +61 -0
- package/dist/with-party/team/keyring.d.ts +12 -5
- package/dist/with-party/team/wrapped-deks.d.ts +4 -4
- package/dist/with-pod/pod.d.ts +4 -4
- package/dist/with-shape/introspection/behaviors.d.ts +7 -0
- package/dist/with-shape/introspection/describe.d.ts +10 -1
- package/dist/with-shape/introspection/field-meta.d.ts +86 -0
- package/dist/withdraw-accessible-PXR4IXDX.js +27 -0
- package/package.json +8 -3
- package/dist/api-GJQF7OAJ.js +0 -20
- package/dist/backup-QZQEP5RO.js.map +0 -1
- package/dist/chunk-65ZYRK7O.js.map +0 -1
- package/dist/chunk-6L5IMNJX.js.map +0 -1
- package/dist/chunk-FRIVOR5N.js.map +0 -1
- package/dist/chunk-J6FXVDKC.js +0 -81
- package/dist/chunk-J6FXVDKC.js.map +0 -1
- package/dist/chunk-KHKKD62N.js.map +0 -1
- package/dist/chunk-NO272T7Q.js.map +0 -1
- package/dist/chunk-OHGCRKWA.js.map +0 -1
- package/dist/chunk-OQDHIAR2.js.map +0 -1
- package/dist/chunk-PZ5AY32C.js +0 -10
- package/dist/chunk-QJLOWGOU.js.map +0 -1
- package/dist/chunk-RCONOOVF.js.map +0 -1
- package/dist/chunk-SW4TOSJL.js.map +0 -1
- package/dist/chunk-USKHHOIV.js.map +0 -1
- package/dist/chunk-VT4DTCK5.js.map +0 -1
- package/dist/chunk-VTTDPGEK.js.map +0 -1
- package/dist/chunk-XJP66QEN.js +0 -344
- package/dist/chunk-XJP66QEN.js.map +0 -1
- package/dist/collection-facade-OPJ3EC4L.js +0 -45
- package/dist/computed-HW6IG5UH.js +0 -11
- package/dist/derive-AAIXSQIE.js +0 -22
- package/dist/dispatch-DR3XITEC.js +0 -194
- package/dist/dispatch-DR3XITEC.js.map +0 -1
- package/dist/executor-67NA4KPO.js +0 -29
- package/dist/executor-7JDP7UBK.js +0 -9
- package/dist/executor-CRH5OB4V.js +0 -9
- package/dist/export-accessible-K4GJAU7U.js +0 -23
- package/dist/extract-partition-YJFL5OKK.js +0 -38
- package/dist/find-SVZHMEQI.js +0 -11
- package/dist/issue-64N6OG7U.js +0 -19
- package/dist/liberate-XL6NSGOL.js +0 -25
- package/dist/link-set-LQI2IJX6.js +0 -31
- package/dist/noydb-SWUGPFBK.js +0 -86
- package/dist/register-AYBQNTM3.js +0 -32
- package/dist/registry-CQWWOBO4.js +0 -9
- package/dist/registry-JCZ4BNLV.js +0 -18
- package/dist/registry-JFFENZ44.js +0 -9
- package/dist/registry-ZA4HACYR.js +0 -19
- package/dist/request-withdrawal-7IKUIAEB.js +0 -31
- package/dist/revoke-PUJKRYJF.js +0 -24
- package/dist/signer-5TA7FUC3.js +0 -25
- package/dist/storage-J2QHNJCB.js +0 -23
- package/dist/walk-3PA4ZOKS.js +0 -21
- package/dist/withdraw-accessible-62VI4W7D.js +0 -28
- package/dist/withdraw-accessible-62VI4W7D.js.map +0 -1
- package/dist/zod-HAJM7LMS.js +0 -14763
- package/dist/zod-HAJM7LMS.js.map +0 -1
- /package/dist/{api-GJQF7OAJ.js.map → api-WYW4YEQG.js.map} +0 -0
- /package/dist/{chunk-5UKIZIO3.js.map → chunk-2577DKXB.js.map} +0 -0
- /package/dist/{chunk-SWFIXQF5.js.map → chunk-2ENE6445.js.map} +0 -0
- /package/dist/{chunk-HLFLJCDX.js.map → chunk-2N5ML6HT.js.map} +0 -0
- /package/dist/{chunk-X6YRP5EC.js.map → chunk-334WSVOW.js.map} +0 -0
- /package/dist/{chunk-5EC7X5QA.js.map → chunk-3BVH633C.js.map} +0 -0
- /package/dist/{chunk-7XT7KZTN.js.map → chunk-3PGS7TYR.js.map} +0 -0
- /package/dist/{chunk-AHIIBDNH.js.map → chunk-3VF3WQ4F.js.map} +0 -0
- /package/dist/{chunk-GM4IM7TC.js.map → chunk-453F654R.js.map} +0 -0
- /package/dist/{chunk-5W5CEHLA.js.map → chunk-4GFX6MPA.js.map} +0 -0
- /package/dist/{chunk-JUBWUJY5.js.map → chunk-4GVM6QZA.js.map} +0 -0
- /package/dist/{chunk-2DGBRE4K.js.map → chunk-4OZNXTO4.js.map} +0 -0
- /package/dist/{chunk-DOPZWTMJ.js.map → chunk-4ZS56W5S.js.map} +0 -0
- /package/dist/{chunk-P2RJAVMR.js.map → chunk-5VCRVKOZ.js.map} +0 -0
- /package/dist/{chunk-FN26SFGH.js.map → chunk-6LKOJBV6.js.map} +0 -0
- /package/dist/{chunk-P7KJME6C.js.map → chunk-6YXCPL4T.js.map} +0 -0
- /package/dist/{chunk-IS5LFHV2.js.map → chunk-7APJ6CO6.js.map} +0 -0
- /package/dist/{chunk-LAI7ENPW.js.map → chunk-7MG2LHO5.js.map} +0 -0
- /package/dist/{chunk-MU74BYOD.js.map → chunk-A2HKRLPV.js.map} +0 -0
- /package/dist/{chunk-357ECVLE.js.map → chunk-A66I4JOA.js.map} +0 -0
- /package/dist/{chunk-TAJZ7GXO.js.map → chunk-AYX7AINO.js.map} +0 -0
- /package/dist/{chunk-RPX2H2OL.js.map → chunk-BLN54W3L.js.map} +0 -0
- /package/dist/{chunk-XGXVPCYW.js.map → chunk-BRLKZUBT.js.map} +0 -0
- /package/dist/{chunk-CWFH36SI.js.map → chunk-BTDR2PXY.js.map} +0 -0
- /package/dist/{chunk-UTFY6W6X.js.map → chunk-BZ3534YM.js.map} +0 -0
- /package/dist/{chunk-KZTPL7NL.js.map → chunk-CHQCZZWC.js.map} +0 -0
- /package/dist/{chunk-MQPHKJ74.js.map → chunk-DFMWUOU5.js.map} +0 -0
- /package/dist/{chunk-3GIA3HJ2.js.map → chunk-DGOZ4UZD.js.map} +0 -0
- /package/dist/{chunk-NMDMSHBF.js.map → chunk-EQEYOJBM.js.map} +0 -0
- /package/dist/{chunk-Q2ZN5DWZ.js.map → chunk-FAHMLERK.js.map} +0 -0
- /package/dist/{chunk-GKOJR53Y.js.map → chunk-G73UVHCA.js.map} +0 -0
- /package/dist/{chunk-H5GVPOB4.js.map → chunk-GPNTB4Y7.js.map} +0 -0
- /package/dist/{chunk-DNMTN46H.js.map → chunk-GY4WYNNG.js.map} +0 -0
- /package/dist/{chunk-HS3LEVT4.js.map → chunk-HIWCKBEY.js.map} +0 -0
- /package/dist/{chunk-PV7XXAXK.js.map → chunk-JBDFMYKQ.js.map} +0 -0
- /package/dist/{chunk-IZTU6RKH.js.map → chunk-JMGDHKQF.js.map} +0 -0
- /package/dist/{chunk-P22XPNFW.js.map → chunk-JVIBCBC7.js.map} +0 -0
- /package/dist/{chunk-OLUTCM23.js.map → chunk-K23VKTN4.js.map} +0 -0
- /package/dist/{chunk-3SWP2FYA.js.map → chunk-KKEESNPE.js.map} +0 -0
- /package/dist/{chunk-ZB2K3FV7.js.map → chunk-KTFRCC5C.js.map} +0 -0
- /package/dist/{chunk-IAHDSFFA.js.map → chunk-LH5A3ZPG.js.map} +0 -0
- /package/dist/{chunk-QOHGWFAW.js.map → chunk-LWBCUYZW.js.map} +0 -0
- /package/dist/{chunk-5NKHCJU5.js.map → chunk-M4YPHYEH.js.map} +0 -0
- /package/dist/{chunk-JFSUYGNE.js.map → chunk-MVMXZYXT.js.map} +0 -0
- /package/dist/{chunk-FKQCC4C5.js.map → chunk-NQKIUNW5.js.map} +0 -0
- /package/dist/{chunk-Q2OAAREU.js.map → chunk-OTQZ7ZWU.js.map} +0 -0
- /package/dist/{chunk-MOQ6OGKS.js.map → chunk-P3MG6QCN.js.map} +0 -0
- /package/dist/{chunk-75WNTBZL.js.map → chunk-PPTHY5QO.js.map} +0 -0
- /package/dist/{chunk-TQGT5BZE.js.map → chunk-Q2MPFCQ7.js.map} +0 -0
- /package/dist/{chunk-MTTPHBIE.js.map → chunk-Q2PU57HC.js.map} +0 -0
- /package/dist/{chunk-FLRLZ4XZ.js.map → chunk-Q7HZX3IF.js.map} +0 -0
- /package/dist/{chunk-KQIDBIZL.js.map → chunk-QIZPZMUI.js.map} +0 -0
- /package/dist/{chunk-JRWLUWDM.js.map → chunk-QPQUVOZ2.js.map} +0 -0
- /package/dist/{chunk-7YVSWPZB.js.map → chunk-QTQUH4DS.js.map} +0 -0
- /package/dist/{chunk-2MQ2D5OZ.js.map → chunk-R42NSZI6.js.map} +0 -0
- /package/dist/{chunk-HOIWW2LV.js.map → chunk-RF6D3Y5E.js.map} +0 -0
- /package/dist/{chunk-OEJ4R52I.js.map → chunk-RMS3NEA3.js.map} +0 -0
- /package/dist/{chunk-FPN5D4JX.js.map → chunk-RSGLUIO6.js.map} +0 -0
- /package/dist/{chunk-XKA6UH5V.js.map → chunk-SFAWCTEM.js.map} +0 -0
- /package/dist/{chunk-I5LSKXT6.js.map → chunk-SGZAIJCV.js.map} +0 -0
- /package/dist/{chunk-FYT3DXPN.js.map → chunk-SKGMN35F.js.map} +0 -0
- /package/dist/{chunk-JILOSL4O.js.map → chunk-SPYWXKJN.js.map} +0 -0
- /package/dist/{chunk-4RUFYGWG.js.map → chunk-SZJ3DLZA.js.map} +0 -0
- /package/dist/{chunk-O3SNM66K.js.map → chunk-TFR7DSOV.js.map} +0 -0
- /package/dist/{chunk-DIVY2CJZ.js.map → chunk-TRGTKX5E.js.map} +0 -0
- /package/dist/{chunk-JY4U6CYV.js.map → chunk-TUFM4UZP.js.map} +0 -0
- /package/dist/{chunk-LUVGSKXE.js.map → chunk-UDHWDSRL.js.map} +0 -0
- /package/dist/{chunk-DZPMKY3J.js.map → chunk-UGTBXF5U.js.map} +0 -0
- /package/dist/{chunk-K432FT7T.js.map → chunk-UHHPLO3I.js.map} +0 -0
- /package/dist/{chunk-THNJ3IKU.js.map → chunk-ULUMAZ5S.js.map} +0 -0
- /package/dist/{chunk-YHIAWECL.js.map → chunk-UXVWEX5L.js.map} +0 -0
- /package/dist/{chunk-OKCQNMO6.js.map → chunk-V7ZRRCRJ.js.map} +0 -0
- /package/dist/{chunk-GHADG5QZ.js.map → chunk-VTFVLCUH.js.map} +0 -0
- /package/dist/{chunk-U3RMWOXY.js.map → chunk-VXANTWBJ.js.map} +0 -0
- /package/dist/{chunk-MV2OEK3K.js.map → chunk-XKWGNJ26.js.map} +0 -0
- /package/dist/{chunk-2E2LT37H.js.map → chunk-XLMEZIAJ.js.map} +0 -0
- /package/dist/{chunk-RHTPGS56.js.map → chunk-YJRT5UQM.js.map} +0 -0
- /package/dist/{chunk-FZWAGG5T.js.map → chunk-YJX7EOJD.js.map} +0 -0
- /package/dist/{chunk-ZQGRZN5L.js.map → chunk-YYP7WSEB.js.map} +0 -0
- /package/dist/{chunk-MENI33ZV.js.map → chunk-ZHKOPKE3.js.map} +0 -0
- /package/dist/{chunk-4U52PMEL.js.map → chunk-ZN4FD4PE.js.map} +0 -0
- /package/dist/{chunk-AW4KTQA4.js.map → chunk-ZORTV6NH.js.map} +0 -0
- /package/dist/{chunk-PZ5AY32C.js.map → collection-facade-JSJYIKS4.js.map} +0 -0
- /package/dist/{collection-facade-OPJ3EC4L.js.map → computed-VPOKQK4N.js.map} +0 -0
- /package/dist/{computed-HW6IG5UH.js.map → derive-E642AOUB.js.map} +0 -0
- /package/dist/{derive-AAIXSQIE.js.map → enclave-55PAM4YO.js.map} +0 -0
- /package/dist/{enclave-OXZY3NOP.js.map → executor-5NIMLSKZ.js.map} +0 -0
- /package/dist/{executor-67NA4KPO.js.map → executor-7UQ3BZ4F.js.map} +0 -0
- /package/dist/{executor-7JDP7UBK.js.map → executor-AQVXV5GZ.js.map} +0 -0
- /package/dist/{executor-CRH5OB4V.js.map → export-accessible-ORMKLA3E.js.map} +0 -0
- /package/dist/{export-accessible-K4GJAU7U.js.map → extract-partition-NKYO3WNG.js.map} +0 -0
- /package/dist/{extract-partition-YJFL5OKK.js.map → find-NOGJ25VX.js.map} +0 -0
- /package/dist/{find-SVZHMEQI.js.map → issue-3DTQ7VJJ.js.map} +0 -0
- /package/dist/{issue-64N6OG7U.js.map → ledger-EDXFFZQL.js.map} +0 -0
- /package/dist/{ledger-ZAFULLAF.js.map → liberate-V35QUHJP.js.map} +0 -0
- /package/dist/{liberate-XL6NSGOL.js.map → link-set-2TTM3IZC.js.map} +0 -0
- /package/dist/{link-set-LQI2IJX6.js.map → managed-secret-NCWEMPUQ.js.map} +0 -0
- /package/dist/{managed-secret-7OH7HKXV.js.map → noydb-62MX4QUG.js.map} +0 -0
- /package/dist/{noydb-SWUGPFBK.js.map → read-only-facade-BIGO37U3.js.map} +0 -0
- /package/dist/{read-only-facade-CHCKSEPD.js.map → register-HHLXEQDN.js.map} +0 -0
- /package/dist/{register-AYBQNTM3.js.map → registry-23WF3TGH.js.map} +0 -0
- /package/dist/{registry-CQWWOBO4.js.map → registry-4AYVUNXK.js.map} +0 -0
- /package/dist/{registry-JCZ4BNLV.js.map → registry-JS3YFQQM.js.map} +0 -0
- /package/dist/{registry-JFFENZ44.js.map → registry-XX2Z7B46.js.map} +0 -0
- /package/dist/{registry-ZA4HACYR.js.map → request-withdrawal-CHPATE4G.js.map} +0 -0
- /package/dist/{request-withdrawal-7IKUIAEB.js.map → revoke-7M2VW4ON.js.map} +0 -0
- /package/dist/{revoke-PUJKRYJF.js.map → signer-SJQJVSM6.js.map} +0 -0
- /package/dist/{signer-5TA7FUC3.js.map → stale-BZS6H2RY.js.map} +0 -0
- /package/dist/{stale-HZR7745Y.js.map → storage-RW4QBS23.js.map} +0 -0
- /package/dist/{storage-J2QHNJCB.js.map → ulid-4MKXG325.js.map} +0 -0
- /package/dist/{ulid-VQW6ERQN.js.map → vault-diff-C6WUJFNP.js.map} +0 -0
- /package/dist/{vault-diff-FE5J35NJ.js.map → walk-ZURCH6RZ.js.map} +0 -0
- /package/dist/{walk-3PA4ZOKS.js.map → withdraw-accessible-PXR4IXDX.js.map} +0 -0
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getAtPath
|
|
3
|
+
} from "./chunk-TRGTKX5E.js";
|
|
4
|
+
import {
|
|
5
|
+
EmbeddingModelMismatchError
|
|
6
|
+
} from "./chunk-7O3Y4PPD.js";
|
|
7
|
+
|
|
8
|
+
// src/with-lookup/embeddings/descriptor.ts
|
|
9
|
+
function embeddingSourceText(record, source) {
|
|
10
|
+
const fields = typeof source === "string" ? [source] : source;
|
|
11
|
+
const parts = [];
|
|
12
|
+
for (const f of fields) {
|
|
13
|
+
for (const leaf of getAtPath(record, f)) {
|
|
14
|
+
if (typeof leaf === "string" && leaf !== "") parts.push(leaf);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
return parts.join(" ");
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// src/with-lookup/embeddings/vec-id.ts
|
|
21
|
+
function encodeVecId(collection, recordId) {
|
|
22
|
+
if (collection.includes("/")) {
|
|
23
|
+
throw new Error(
|
|
24
|
+
`encodeVecId: collection name "${collection}" must not contain "/" \u2014 it would make the "${collection}/${recordId}" _vec id ambiguous against another collection's rows.`
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
return `${collection}/${recordId}`;
|
|
28
|
+
}
|
|
29
|
+
function decodeVecId(collection, vecId) {
|
|
30
|
+
const prefix = `${collection}/`;
|
|
31
|
+
if (!vecId.startsWith(prefix)) return null;
|
|
32
|
+
return vecId.slice(prefix.length);
|
|
33
|
+
}
|
|
34
|
+
function isVecIdFor(collection, vecId) {
|
|
35
|
+
return vecId.startsWith(`${collection}/`);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// src/with-lookup/embeddings/cosine.ts
|
|
39
|
+
function cosine(a, b) {
|
|
40
|
+
if (a.length !== b.length) return 0;
|
|
41
|
+
let dot = 0, na = 0, nb = 0;
|
|
42
|
+
for (let i = 0; i < a.length; i++) {
|
|
43
|
+
const x = a[i], y = b[i];
|
|
44
|
+
dot += x * y;
|
|
45
|
+
na += x * x;
|
|
46
|
+
nb += y * y;
|
|
47
|
+
}
|
|
48
|
+
if (na === 0 || nb === 0) return 0;
|
|
49
|
+
return dot / (Math.sqrt(na) * Math.sqrt(nb));
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// src/with-lookup/embeddings/vector-set.ts
|
|
53
|
+
var VectorSet = class {
|
|
54
|
+
vectors;
|
|
55
|
+
get loaded() {
|
|
56
|
+
return this.vectors !== void 0;
|
|
57
|
+
}
|
|
58
|
+
async ensureLoaded(load) {
|
|
59
|
+
if (this.vectors === void 0) this.vectors = await load();
|
|
60
|
+
}
|
|
61
|
+
markDirty() {
|
|
62
|
+
this.vectors = void 0;
|
|
63
|
+
}
|
|
64
|
+
cosineTopK(query, k, opts = {}) {
|
|
65
|
+
const all = this.vectors ?? [];
|
|
66
|
+
const minScore = opts.minScore ?? -Infinity;
|
|
67
|
+
const hits = [];
|
|
68
|
+
for (const v of all) {
|
|
69
|
+
if (opts.expectModel !== void 0 && v.model !== opts.expectModel) {
|
|
70
|
+
throw new EmbeddingModelMismatchError(opts.expectModel, v.model);
|
|
71
|
+
}
|
|
72
|
+
const score = cosine(query, v.vec);
|
|
73
|
+
if (score >= minScore) hits.push({ id: v.id, score });
|
|
74
|
+
}
|
|
75
|
+
hits.sort((a, b) => b.score - a.score);
|
|
76
|
+
return hits.slice(0, k);
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export {
|
|
81
|
+
embeddingSourceText,
|
|
82
|
+
VectorSet,
|
|
83
|
+
encodeVecId,
|
|
84
|
+
decodeVecId,
|
|
85
|
+
isVecIdFor
|
|
86
|
+
};
|
|
87
|
+
//# sourceMappingURL=chunk-RTBJ5IOO.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/with-lookup/embeddings/descriptor.ts","../src/with-lookup/embeddings/vec-id.ts","../src/with-lookup/embeddings/cosine.ts","../src/with-lookup/embeddings/vector-set.ts"],"sourcesContent":["/** Per-collection embedding config (L2). The encode hook is host/remote — no bundled model. */\nimport { getAtPath } from '../../via/i18n/core.js'\n\nexport interface EmbeddingDescriptor {\n readonly source: string | readonly string[]\n readonly encode: (text: string) => Promise<Float32Array>\n readonly dim: number\n readonly model: string\n}\n\n/** Concatenate the record's source-field text (skips empties; supports nested/[]-wildcard paths). */\nexport function embeddingSourceText(record: Record<string, unknown>, source: string | readonly string[]): string {\n const fields = typeof source === 'string' ? [source] : source\n const parts: string[] = []\n for (const f of fields) {\n for (const leaf of getAtPath(record, f)) {\n if (typeof leaf === 'string' && leaf !== '') parts.push(leaf)\n }\n }\n return parts.join(' ')\n}\n","/**\n * Collection-namespaced `_vec` side-car ids (#726).\n *\n * `_vec` embedding side-cars used to be keyed by the bare record id,\n * vault-wide — two collections sharing a record id shared one `_vec` row.\n * This was verified to be a clobber/crash bug, NOT a confidentiality leak:\n * every collection has its own DEK, and AES-GCM auth-tag verification means\n * decrypting a foreign collection's `_vec` row under the wrong DEK throws\n * `TamperedError` rather than returning wrong plaintext — no disclosure\n * mechanism exists. The real bug was id collision: a same-id write/forget in\n * one collection could clobber or delete the other collection's row, and a\n * collection whose `similarTo()` / cold semantic `retrieve()` encountered a\n * foreign same-id row crashed with an uncaught `TamperedError` (a DoS). The\n * store-collection bucket stays the literal `'_vec'`; the id becomes\n * composite: `${collection}/${recordId}`. Mirrors `encodeIdxId`\n * (`../indexing/persisted-indexes.js`).\n *\n * Decode is deliberately NOT split-on-`/`: the collection is always known\n * at the decode site (`ctx.name`), so `decodeVecId` strips that known\n * prefix — correct even when `recordId` itself contains `/`.\n *\n * Precondition: `collection` itself must not contain `/` — otherwise\n * `${collection}/${recordId}` is ambiguous (e.g. collection `'a'` would\n * misattribute collection `'a/b'`'s rows via prefix match in `isVecIdFor`).\n * Collection names are NOT currently restricted to a `/`-free charset by\n * `vault.collection()`, so `encodeVecId` enforces the precondition itself,\n * failing loud at the write boundary rather than silently misencoding.\n */\n\n/**\n * Encode the `_vec` side-car id for a (collection, recordId) pair.\n * Format: `<collection>/<recordId>` — no escaping; `recordId` may contain `/`.\n *\n * Throws if `collection` contains `/`: that would make the composite id\n * ambiguous against `isVecIdFor`'s prefix match (collection `'a'` would\n * appear to own collection `'a/b'`'s rows), reintroducing the clobber/crash\n * risk the namespacing fix exists to close.\n */\nexport function encodeVecId(collection: string, recordId: string): string {\n if (collection.includes('/')) {\n throw new Error(\n `encodeVecId: collection name \"${collection}\" must not contain \"/\" — ` +\n `it would make the \"${collection}/${recordId}\" _vec id ambiguous against another collection's rows.`,\n )\n }\n return `${collection}/${recordId}`\n}\n\n/**\n * Decode a `_vec` id back to the bare record id, given the KNOWN owning\n * collection — strips the `<collection>/` prefix rather than splitting on\n * `/`, so a `recordId` containing `/` round-trips correctly. Returns `null`\n * if `vecId` does not belong to `collection`.\n */\nexport function decodeVecId(collection: string, vecId: string): string | null {\n const prefix = `${collection}/`\n if (!vecId.startsWith(prefix)) return null\n return vecId.slice(prefix.length)\n}\n\n/** Predicate form of {@link decodeVecId} — used to filter `list()` results. */\nexport function isVecIdFor(collection: string, vecId: string): boolean {\n return vecId.startsWith(`${collection}/`)\n}\n","/** Cosine similarity in [-1,1]; 0 on zero-norm or length mismatch (no NaN). (L2) */\nexport function cosine(a: Float32Array | number[], b: Float32Array | number[]): number {\n if (a.length !== b.length) return 0\n let dot = 0, na = 0, nb = 0\n for (let i = 0; i < a.length; i++) {\n const x = a[i]!, y = b[i]!\n dot += x * y; na += x * x; nb += y * y\n }\n if (na === 0 || nb === 0) return 0\n return dot / (Math.sqrt(na) * Math.sqrt(nb))\n}\n","/** In-memory vector set for L2 semantic retrieval. Loaded once per session from\n * decrypted _vec sidecars (injected loader), brute-force cosine kNN, model-guarded. */\nimport { cosine } from './cosine.js'\nimport { EmbeddingModelMismatchError } from '../../kernel/errors.js'\n\nexport interface StoredVector { readonly id: string; readonly vec: Float32Array; readonly model: string }\nexport interface VectorHit { readonly id: string; readonly score: number }\n\nexport class VectorSet {\n private vectors: StoredVector[] | undefined\n get loaded(): boolean { return this.vectors !== undefined }\n\n async ensureLoaded(load: () => Promise<StoredVector[]>): Promise<void> {\n if (this.vectors === undefined) this.vectors = await load()\n }\n\n markDirty(): void { this.vectors = undefined }\n\n cosineTopK(query: Float32Array, k: number, opts: { minScore?: number; expectModel?: string } = {}): VectorHit[] {\n const all = this.vectors ?? []\n const minScore = opts.minScore ?? -Infinity\n const hits: VectorHit[] = []\n for (const v of all) {\n if (opts.expectModel !== undefined && v.model !== opts.expectModel) {\n throw new EmbeddingModelMismatchError(opts.expectModel, v.model)\n }\n const score = cosine(query, v.vec)\n if (score >= minScore) hits.push({ id: v.id, score })\n }\n hits.sort((a, b) => b.score - a.score)\n return hits.slice(0, k)\n }\n}\n"],"mappings":";;;;;;;;AAWO,SAAS,oBAAoB,QAAiC,QAA4C;AAC/G,QAAM,SAAS,OAAO,WAAW,WAAW,CAAC,MAAM,IAAI;AACvD,QAAM,QAAkB,CAAC;AACzB,aAAW,KAAK,QAAQ;AACtB,eAAW,QAAQ,UAAU,QAAQ,CAAC,GAAG;AACvC,UAAI,OAAO,SAAS,YAAY,SAAS,GAAI,OAAM,KAAK,IAAI;AAAA,IAC9D;AAAA,EACF;AACA,SAAO,MAAM,KAAK,GAAG;AACvB;;;ACkBO,SAAS,YAAY,YAAoB,UAA0B;AACxE,MAAI,WAAW,SAAS,GAAG,GAAG;AAC5B,UAAM,IAAI;AAAA,MACR,iCAAiC,UAAU,oDACnB,UAAU,IAAI,QAAQ;AAAA,IAChD;AAAA,EACF;AACA,SAAO,GAAG,UAAU,IAAI,QAAQ;AAClC;AAQO,SAAS,YAAY,YAAoB,OAA8B;AAC5E,QAAM,SAAS,GAAG,UAAU;AAC5B,MAAI,CAAC,MAAM,WAAW,MAAM,EAAG,QAAO;AACtC,SAAO,MAAM,MAAM,OAAO,MAAM;AAClC;AAGO,SAAS,WAAW,YAAoB,OAAwB;AACrE,SAAO,MAAM,WAAW,GAAG,UAAU,GAAG;AAC1C;;;AC9DO,SAAS,OAAO,GAA4B,GAAoC;AACrF,MAAI,EAAE,WAAW,EAAE,OAAQ,QAAO;AAClC,MAAI,MAAM,GAAG,KAAK,GAAG,KAAK;AAC1B,WAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,KAAK;AACjC,UAAM,IAAI,EAAE,CAAC,GAAI,IAAI,EAAE,CAAC;AACxB,WAAO,IAAI;AAAG,UAAM,IAAI;AAAG,UAAM,IAAI;AAAA,EACvC;AACA,MAAI,OAAO,KAAK,OAAO,EAAG,QAAO;AACjC,SAAO,OAAO,KAAK,KAAK,EAAE,IAAI,KAAK,KAAK,EAAE;AAC5C;;;ACFO,IAAM,YAAN,MAAgB;AAAA,EACb;AAAA,EACR,IAAI,SAAkB;AAAE,WAAO,KAAK,YAAY;AAAA,EAAU;AAAA,EAE1D,MAAM,aAAa,MAAoD;AACrE,QAAI,KAAK,YAAY,OAAW,MAAK,UAAU,MAAM,KAAK;AAAA,EAC5D;AAAA,EAEA,YAAkB;AAAE,SAAK,UAAU;AAAA,EAAU;AAAA,EAE7C,WAAW,OAAqB,GAAW,OAAoD,CAAC,GAAgB;AAC9G,UAAM,MAAM,KAAK,WAAW,CAAC;AAC7B,UAAM,WAAW,KAAK,YAAY;AAClC,UAAM,OAAoB,CAAC;AAC3B,eAAW,KAAK,KAAK;AACnB,UAAI,KAAK,gBAAgB,UAAa,EAAE,UAAU,KAAK,aAAa;AAClE,cAAM,IAAI,4BAA4B,KAAK,aAAa,EAAE,KAAK;AAAA,MACjE;AACA,YAAM,QAAQ,OAAO,OAAO,EAAE,GAAG;AACjC,UAAI,SAAS,SAAU,MAAK,KAAK,EAAE,IAAI,EAAE,IAAI,MAAM,CAAC;AAAA,IACtD;AACA,SAAK,KAAK,CAAC,GAAG,MAAM,EAAE,QAAQ,EAAE,KAAK;AACrC,WAAO,KAAK,MAAM,GAAG,CAAC;AAAA,EACxB;AACF;","names":[]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// src/with-shape/introspection/derivation-key.ts
|
|
2
|
+
function fallbackDerivationName(outputCollections, source, used) {
|
|
3
|
+
const base = outputCollections.length > 0 ? [...outputCollections].sort().join("+") : source;
|
|
4
|
+
if (!used.has(base)) return base;
|
|
5
|
+
let occurrence = 1;
|
|
6
|
+
let candidate = `${base}#${occurrence}`;
|
|
7
|
+
while (used.has(candidate)) {
|
|
8
|
+
occurrence++;
|
|
9
|
+
candidate = `${base}#${occurrence}`;
|
|
10
|
+
}
|
|
11
|
+
return candidate;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export {
|
|
15
|
+
fallbackDerivationName
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=chunk-RXLYKVTF.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/with-shape/introspection/derivation-key.ts"],"sourcesContent":["/**\n * The deterministic fallback key for an UNNAMED derivation, shared by\n * `dumpSchema`'s `describeDerivations` (walk.ts) and `listBehaviors`'s\n * `buildDerivationEntries` (behaviors.ts) so the two surfaces always key the\n * same unnamed derivation identically.\n *\n * Base key = the derivation's output-collection names, sorted and joined by\n * `+` (or `source` when it has no outputs). On collision with any key already\n * assigned in this enumeration (named or fallback, passed in `used`), a\n * deterministic `#occurrence` suffix is appended (`base`, `base#1`, `base#2`, …)\n * so two derivations with the same output set both appear.\n *\n * Takes the already-extracted output-collection list + source (rather than a\n * `DerivationSpec`) so both the typed builder and walk.ts's duck-typed registry\n * walk can call it without a shared concrete type.\n */\nexport function fallbackDerivationName(\n outputCollections: readonly string[],\n source: string,\n used: ReadonlySet<string>,\n): string {\n const base = outputCollections.length > 0 ? [...outputCollections].sort().join('+') : source\n if (!used.has(base)) return base\n let occurrence = 1\n let candidate = `${base}#${occurrence}`\n while (used.has(candidate)) {\n occurrence++\n candidate = `${base}#${occurrence}`\n }\n return candidate\n}\n"],"mappings":";AAgBO,SAAS,uBACd,mBACA,QACA,MACQ;AACR,QAAM,OAAO,kBAAkB,SAAS,IAAI,CAAC,GAAG,iBAAiB,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI;AACtF,MAAI,CAAC,KAAK,IAAI,IAAI,EAAG,QAAO;AAC5B,MAAI,aAAa;AACjB,MAAI,YAAY,GAAG,IAAI,IAAI,UAAU;AACrC,SAAO,KAAK,IAAI,SAAS,GAAG;AAC1B;AACA,gBAAY,GAAG,IAAI,IAAI,UAAU;AAAA,EACnC;AACA,SAAO;AACT;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ValidationError
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-7O3Y4PPD.js";
|
|
4
4
|
|
|
5
5
|
// src/with-formula/overlay-views/with-overlayed-view.ts
|
|
6
6
|
function withOverlayedView(spec) {
|
|
@@ -33,4 +33,4 @@ function withOverlayedView(spec) {
|
|
|
33
33
|
export {
|
|
34
34
|
withOverlayedView
|
|
35
35
|
};
|
|
36
|
-
//# sourceMappingURL=chunk-
|
|
36
|
+
//# sourceMappingURL=chunk-SFAWCTEM.js.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
buildRecordAad,
|
|
3
3
|
openEnvelopeJson
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-4ZS56W5S.js";
|
|
5
5
|
import {
|
|
6
6
|
buildRecordEnvelope
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-SZJ3DLZA.js";
|
|
8
8
|
import {
|
|
9
9
|
encrypt
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-HPVZCW43.js";
|
|
11
11
|
|
|
12
12
|
// src/with-shape/persisted-schemas/storage.ts
|
|
13
13
|
var SCHEMAS_COLLECTION = "_schemas";
|
|
@@ -45,4 +45,4 @@ export {
|
|
|
45
45
|
loadPersistedSchema,
|
|
46
46
|
savePersistedSchema
|
|
47
47
|
};
|
|
48
|
-
//# sourceMappingURL=chunk-
|
|
48
|
+
//# sourceMappingURL=chunk-SGZAIJCV.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
OverlayIdMismatchError
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-7O3Y4PPD.js";
|
|
4
4
|
|
|
5
5
|
// src/with-formula/overlay-views/virtual-collection.ts
|
|
6
6
|
var OverlayedCollection = class {
|
|
@@ -206,4 +206,4 @@ var OverlayedCollection = class {
|
|
|
206
206
|
export {
|
|
207
207
|
OverlayedCollection
|
|
208
208
|
};
|
|
209
|
-
//# sourceMappingURL=chunk-
|
|
209
|
+
//# sourceMappingURL=chunk-SKGMN35F.js.map
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import {
|
|
2
|
+
lazy
|
|
3
|
+
} from "./chunk-5D2ALSM5.js";
|
|
4
|
+
|
|
5
|
+
// src/with-formula/derivations/stale.ts
|
|
6
|
+
var loadDerivationExecutor = lazy(() => import("./executor-5NIMLSKZ.js"));
|
|
7
|
+
var _staleByRegistry = /* @__PURE__ */ new WeakMap();
|
|
8
|
+
var keyFor = (source, sourceId) => `${source}/${sourceId}`;
|
|
9
|
+
async function markStale(registry, strategy, sourceId) {
|
|
10
|
+
let map = _staleByRegistry.get(registry);
|
|
11
|
+
if (!map) {
|
|
12
|
+
map = /* @__PURE__ */ new Map();
|
|
13
|
+
_staleByRegistry.set(registry, map);
|
|
14
|
+
}
|
|
15
|
+
const k = keyFor(strategy.source, sourceId);
|
|
16
|
+
let set = map.get(k);
|
|
17
|
+
if (!set) {
|
|
18
|
+
set = /* @__PURE__ */ new Set();
|
|
19
|
+
map.set(k, set);
|
|
20
|
+
}
|
|
21
|
+
set.add(strategy);
|
|
22
|
+
}
|
|
23
|
+
async function resolveStaleOnRead(accessor, outputCollection, id) {
|
|
24
|
+
const registry = accessor.registry();
|
|
25
|
+
const producers = registry.strategiesProducingOutput(outputCollection);
|
|
26
|
+
if (producers.length === 0) return;
|
|
27
|
+
const map = _staleByRegistry.get(registry);
|
|
28
|
+
if (!map) return;
|
|
29
|
+
let DerivationExecutor = null;
|
|
30
|
+
for (const { spec, strategyHash } of producers) {
|
|
31
|
+
const k = keyFor(spec.source, id);
|
|
32
|
+
const pending = map.get(k);
|
|
33
|
+
if (!pending || !pending.has(spec)) continue;
|
|
34
|
+
pending.delete(spec);
|
|
35
|
+
let failedNonStrict = false;
|
|
36
|
+
try {
|
|
37
|
+
const sourceColl = accessor.getCollection(spec.source);
|
|
38
|
+
const source = await sourceColl.get(id);
|
|
39
|
+
if (!source) {
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
const sourceWithId = { ...source, id };
|
|
43
|
+
DerivationExecutor ??= (await loadDerivationExecutor()).DerivationExecutor;
|
|
44
|
+
const ctx = { vault: accessor.getReadOnlyFacade() };
|
|
45
|
+
const result = await DerivationExecutor.run(spec, sourceWithId, 0, strategyHash, ctx);
|
|
46
|
+
for (const key of Object.keys(spec.outputs)) {
|
|
47
|
+
const out = result.outputs[key];
|
|
48
|
+
if (!out) continue;
|
|
49
|
+
if (out.kind === "failed") {
|
|
50
|
+
const err = out.error;
|
|
51
|
+
if (spec.strict) throw err;
|
|
52
|
+
console.warn(
|
|
53
|
+
`[derivation] lazy output "${key}" for source "${spec.source}" id="${id}" failed:`,
|
|
54
|
+
err
|
|
55
|
+
);
|
|
56
|
+
failedNonStrict = true;
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
if (out.kind === "array") {
|
|
60
|
+
console.warn(
|
|
61
|
+
`[derivation] unexpected array-shape output "${key}" in lazy resolve path; array-shape derivations require lifecycle: "eager".`
|
|
62
|
+
);
|
|
63
|
+
continue;
|
|
64
|
+
}
|
|
65
|
+
const outSpec = spec.outputs[key];
|
|
66
|
+
if (!outSpec) continue;
|
|
67
|
+
const outputColl = accessor.getCollection(outSpec.collection);
|
|
68
|
+
if (out.skipped === true) {
|
|
69
|
+
await outputColl._internalDelete(id, accessor.getActiveTxContext());
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
72
|
+
await outputColl.put(id, out.value);
|
|
73
|
+
}
|
|
74
|
+
if (failedNonStrict) pending.add(spec);
|
|
75
|
+
else pending.delete(spec);
|
|
76
|
+
} catch (e) {
|
|
77
|
+
pending.add(spec);
|
|
78
|
+
throw e;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export {
|
|
84
|
+
markStale,
|
|
85
|
+
resolveStaleOnRead
|
|
86
|
+
};
|
|
87
|
+
//# sourceMappingURL=chunk-SMH6SRX7.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/with-formula/derivations/stale.ts"],"sourcesContent":["import type { Collection } from '../../kernel/collection.js'\nimport type { DerivationExecutor as DerivationExecutorType } from './executor.js'\nimport type { ReadOnlyVaultFacade } from '../../with-audit/guards/types.js'\nimport type { TxContext } from '../../with-commit/tx/transaction.js'\nimport type { DerivationRegistry } from './registry.js'\n// Type-only — runtime class loaded via dynamic import in\n// `resolveStaleOnRead` only when a stale flag actually fires. Keeps\n// the executor chunk out of the floor bundle.\nimport type { DerivationSpec } from './types.js'\n\nimport { lazy } from '../../kernel/lazy.js'\n\n/** #846c — one memoized binding instead of a cast at the call site. */\nconst loadDerivationExecutor = lazy(() => import('./executor.js'))\n\n/**\n * Accessor shape passed through from the owning Vault. Provides the\n * registry (used to look up strategies and as the WeakMap key) and a\n * resolver from collection name to the live `Collection` instance.\n * Same shape as `Collection.derivationSource` so callers can pass it\n * through directly.\n */\nexport interface DerivationStaleAccessor {\n registry(): DerivationRegistry\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n getCollection(name: string): Collection<any>\n /**\n * Read-only vault facade handed to `derive(source, ctx)` on the lazy\n * resolve-on-read path. Same instance/shape as the eager path uses.\n */\n getReadOnlyFacade(): ReadOnlyVaultFacade\n /**\n * Active multi-record TxContext or `null`. The lazy resolve-on-read\n * path uses this to register tombstone deletes on `_executed` so a\n * later rollback restores the prior emission. Mirrors the eager\n * path's rollback tracking; the lazy `put` was historically\n * unregistered but the tombstone delete (a NEW write path)\n * matches the eager registration for symmetry.\n */\n getActiveTxContext(): TxContext | null\n}\n\n/**\n * In-memory stale map keyed by `DerivationRegistry` instance (stable\n * per vault). Maps `${source}/${sourceId}` → set of pending strategies.\n *\n * Persistence across vault close is NOT implemented in v1 (concern\n * flagged in the dim14 spec). On vault re-open, derived records'\n * `_derivedFrom.strategyHash` will still match the registered\n * strategies' hash, so an unset stale flag is interpreted as \"fresh.\"\n * `vault.deriveAll()` (Task D13) is the explicit recompute escape\n * hatch.\n *\n * @internal\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst _staleByRegistry = new WeakMap<DerivationRegistry, Map<string, Set<DerivationSpec<any, any>>>>()\n\nconst keyFor = (source: string, sourceId: string): string => `${source}/${sourceId}`\n\n/** Mark every output of (strategy, sourceId) as stale. */\nexport async function markStale(\n registry: DerivationRegistry,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n strategy: DerivationSpec<any, any>,\n sourceId: string,\n): Promise<void> {\n let map = _staleByRegistry.get(registry)\n if (!map) {\n map = new Map()\n _staleByRegistry.set(registry, map)\n }\n const k = keyFor(strategy.source, sourceId)\n let set = map.get(k)\n if (!set) {\n set = new Set()\n map.set(k, set)\n }\n set.add(strategy)\n}\n\n/**\n * Called from `Collection.get` on lazy-mode output collections. If the\n * id has a pending stale flag for any strategy producing this output\n * collection, re-derive before returning the record. No-op when there\n * is no pending work — keeps the read fast path negligible.\n */\nexport async function resolveStaleOnRead(\n accessor: DerivationStaleAccessor,\n outputCollection: string,\n id: string,\n): Promise<void> {\n const registry = accessor.registry()\n const producers = registry.strategiesProducingOutput(outputCollection)\n if (producers.length === 0) return\n\n const map = _staleByRegistry.get(registry)\n if (!map) return\n\n // Dynamic-import the executor only when at least one stale flag\n // actually fires. Vaults with no derivation strategies never call\n // this function (gated on `derivationSource` in `Collection.get`);\n // vaults with strategies but no pending stale ids reach the\n // `pending.has(spec)` short-circuit below without ever touching\n // the executor chunk.\n let DerivationExecutor: typeof DerivationExecutorType | null = null\n\n for (const { spec, strategyHash } of producers) {\n const k = keyFor(spec.source, id)\n const pending = map.get(k)\n if (!pending || !pending.has(spec)) continue\n\n // Consume the pending flag BEFORE the source read, not after: for a\n // self-write output (output.collection === spec.source, e.g. a\n // reverse-denorm patch), `sourceColl.get(id)` below re-enters this\n // same collection/id and would otherwise still see this spec pending\n // — infinite recursion. Restored on a strict failure below so a\n // future read still retries.\n pending.delete(spec)\n\n // Everything from here on can throw (source read, executor, output\n // put/delete) — restore the consumed flag on ANY throw so a later\n // read still retries, not just on the strict-failure branch below\n // (which throws through this same catch, so it does not also\n // re-add — `Set.add` is idempotent, but the branch no longer needs\n // its own restore).\n // #1258 — a NON-STRICT output failure must not launder staleness into\n // freshness. `strict: false` means \"a failed derivation must not break the\n // read\", NOT \"report this output as current\". Tracked across the output\n // loop and re-marked below, so the record is still served (no throw) and\n // the next read retries — strict-mode behaviour minus the throw.\n let failedNonStrict = false\n try {\n // Read the source record from the source collection and re-derive.\n // We use the same getCollection accessor that eager dispatch uses\n // — it returns the live `Collection<any>` instance with full\n // crypto / keyring wiring.\n const sourceColl = accessor.getCollection(spec.source)\n const source = await sourceColl.get(id)\n if (!source) {\n continue\n }\n const sourceWithId = { ...(source as Record<string, unknown>), id } as Record<string, unknown> & { id: string }\n // sourceVersion: not tracked in v1 stale map; pass 0 — matches the\n // forthcoming v0 semantics, `_derivedFrom.sourceVersion` is\n // informational, not load-bearing for correctness.\n DerivationExecutor ??= (await loadDerivationExecutor()).DerivationExecutor\n const ctx = { vault: accessor.getReadOnlyFacade() }\n const result = await DerivationExecutor.run(spec, sourceWithId, 0, strategyHash, ctx)\n for (const key of Object.keys(spec.outputs)) {\n const out = result.outputs[key]\n if (!out) continue\n if (out.kind === 'failed') {\n const err = out.error\n if (spec.strict) throw err\n console.warn(\n `[derivation] lazy output \"${key}\" for source \"${spec.source}\" id=\"${id}\" failed:`,\n err,\n )\n failedNonStrict = true\n continue\n }\n if (out.kind === 'array') {\n // Defensive — array-shape requires `lifecycle: 'eager'`\n // (validated at withDerivation registration).\n // Reaching the lazy-resolve path for array-shape would mean\n // a registration check was bypassed. Log and skip.\n console.warn(\n `[derivation] unexpected array-shape output \"${key}\" in lazy resolve path; `\n + 'array-shape derivations require lifecycle: \"eager\".',\n )\n continue\n }\n const outSpec = spec.outputs[key]\n if (!outSpec) continue\n const outputColl = accessor.getCollection(outSpec.collection)\n if (out.skipped === true) {\n // Optional output skipped on lazy resolve — delete any\n // prior emission so the read returns null (matches eager-path\n // tombstone semantics). Routed through `_internalDelete` so a\n // user-registered `onDelete` on the output collection\n // does NOT fire. The active TxContext (if any) is forwarded:\n // `resolveStaleOnRead` is reachable from `Collection.get()`\n // which can be called from inside a transaction, so the\n // tombstone must be observable to `revertExecuted` on\n // rollback.\n await outputColl._internalDelete(id, accessor.getActiveTxContext())\n continue\n }\n await outputColl.put(id, out.value)\n }\n // Deliberate cost, stated so nobody \"optimises\" it away: a\n // permanently-failing non-strict derivation now re-runs on every read of\n // this id rather than once. Louder and more expensive than serving a\n // stale value forever, and the trade this project makes everywhere else.\n if (failedNonStrict) pending.add(spec)\n else pending.delete(spec)\n } catch (e) {\n // Restore the stale flag consumed above so a future read retries.\n pending.add(spec)\n throw e\n }\n }\n}\n"],"mappings":";;;;;AAaA,IAAM,yBAAyB,KAAK,MAAM,OAAO,wBAAe,CAAC;AA2CjE,IAAM,mBAAmB,oBAAI,QAAwE;AAErG,IAAM,SAAS,CAAC,QAAgB,aAA6B,GAAG,MAAM,IAAI,QAAQ;AAGlF,eAAsB,UACpB,UAEA,UACA,UACe;AACf,MAAI,MAAM,iBAAiB,IAAI,QAAQ;AACvC,MAAI,CAAC,KAAK;AACR,UAAM,oBAAI,IAAI;AACd,qBAAiB,IAAI,UAAU,GAAG;AAAA,EACpC;AACA,QAAM,IAAI,OAAO,SAAS,QAAQ,QAAQ;AAC1C,MAAI,MAAM,IAAI,IAAI,CAAC;AACnB,MAAI,CAAC,KAAK;AACR,UAAM,oBAAI,IAAI;AACd,QAAI,IAAI,GAAG,GAAG;AAAA,EAChB;AACA,MAAI,IAAI,QAAQ;AAClB;AAQA,eAAsB,mBACpB,UACA,kBACA,IACe;AACf,QAAM,WAAW,SAAS,SAAS;AACnC,QAAM,YAAY,SAAS,0BAA0B,gBAAgB;AACrE,MAAI,UAAU,WAAW,EAAG;AAE5B,QAAM,MAAM,iBAAiB,IAAI,QAAQ;AACzC,MAAI,CAAC,IAAK;AAQV,MAAI,qBAA2D;AAE/D,aAAW,EAAE,MAAM,aAAa,KAAK,WAAW;AAC9C,UAAM,IAAI,OAAO,KAAK,QAAQ,EAAE;AAChC,UAAM,UAAU,IAAI,IAAI,CAAC;AACzB,QAAI,CAAC,WAAW,CAAC,QAAQ,IAAI,IAAI,EAAG;AAQpC,YAAQ,OAAO,IAAI;AAanB,QAAI,kBAAkB;AACtB,QAAI;AAKF,YAAM,aAAa,SAAS,cAAc,KAAK,MAAM;AACrD,YAAM,SAAS,MAAM,WAAW,IAAI,EAAE;AACtC,UAAI,CAAC,QAAQ;AACX;AAAA,MACF;AACA,YAAM,eAAe,EAAE,GAAI,QAAoC,GAAG;AAIlE,8BAAwB,MAAM,uBAAuB,GAAG;AACxD,YAAM,MAAM,EAAE,OAAO,SAAS,kBAAkB,EAAE;AAClD,YAAM,SAAS,MAAM,mBAAmB,IAAI,MAAM,cAAc,GAAG,cAAc,GAAG;AACpF,iBAAW,OAAO,OAAO,KAAK,KAAK,OAAO,GAAG;AAC3C,cAAM,MAAM,OAAO,QAAQ,GAAG;AAC9B,YAAI,CAAC,IAAK;AACV,YAAI,IAAI,SAAS,UAAU;AACzB,gBAAM,MAAM,IAAI;AAChB,cAAI,KAAK,OAAQ,OAAM;AACvB,kBAAQ;AAAA,YACN,6BAA6B,GAAG,iBAAiB,KAAK,MAAM,SAAS,EAAE;AAAA,YACvE;AAAA,UACF;AACA,4BAAkB;AAClB;AAAA,QACF;AACA,YAAI,IAAI,SAAS,SAAS;AAKxB,kBAAQ;AAAA,YACN,+CAA+C,GAAG;AAAA,UAEpD;AACA;AAAA,QACF;AACA,cAAM,UAAU,KAAK,QAAQ,GAAG;AAChC,YAAI,CAAC,QAAS;AACd,cAAM,aAAa,SAAS,cAAc,QAAQ,UAAU;AAC5D,YAAI,IAAI,YAAY,MAAM;AAUxB,gBAAM,WAAW,gBAAgB,IAAI,SAAS,mBAAmB,CAAC;AAClE;AAAA,QACF;AACA,cAAM,WAAW,IAAI,IAAI,IAAI,KAAK;AAAA,MACpC;AAKA,UAAI,gBAAiB,SAAQ,IAAI,IAAI;AAAA,UAChC,SAAQ,OAAO,IAAI;AAAA,IAC1B,SAAS,GAAG;AAEV,cAAQ,IAAI,IAAI;AAChB,YAAM;AAAA,IACR;AAAA,EACF;AACF;","names":[]}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
loadVaultPolicy,
|
|
3
3
|
saveVaultPolicy
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-2577DKXB.js";
|
|
5
5
|
import {
|
|
6
6
|
PolicyDeniedError,
|
|
7
7
|
ValidationError
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-7O3Y4PPD.js";
|
|
9
9
|
|
|
10
10
|
// src/with-party/policy/presets.ts
|
|
11
11
|
var PERSONAL_POLICY = Object.freeze({
|
|
@@ -364,4 +364,4 @@ export {
|
|
|
364
364
|
describeGate,
|
|
365
365
|
createNoydbPolicy
|
|
366
366
|
};
|
|
367
|
-
//# sourceMappingURL=chunk-
|
|
367
|
+
//# sourceMappingURL=chunk-SPYWXKJN.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
NOYDB_FORMAT_VERSION
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-7MG7SJT7.js";
|
|
4
4
|
|
|
5
5
|
// src/kernel/enclave/record-envelope.ts
|
|
6
6
|
function buildRecordEnvelope(identity, body) {
|
|
@@ -63,4 +63,4 @@ export {
|
|
|
63
63
|
isDeleteMarker,
|
|
64
64
|
buildDeleteMarker
|
|
65
65
|
};
|
|
66
|
-
//# sourceMappingURL=chunk-
|
|
66
|
+
//# sourceMappingURL=chunk-SZJ3DLZA.js.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// src/kernel/match-pairs.ts
|
|
2
|
+
var scalar = (v) => typeof v === "string" || typeof v === "number" ? String(v) : null;
|
|
3
|
+
function recordMatchesPairs(rec, pairs) {
|
|
4
|
+
return pairs.every((p) => scalar(rec[p.field]) === p.value);
|
|
5
|
+
}
|
|
6
|
+
async function findMatchingIdsByPairs(residualPairs, io) {
|
|
7
|
+
if (io.indexCandidates !== null && residualPairs.length === 0) return [...io.indexCandidates];
|
|
8
|
+
const ids = io.indexCandidates ?? await io.listIds();
|
|
9
|
+
const out = [];
|
|
10
|
+
for (const id of ids) {
|
|
11
|
+
const rec = await io.getRecord(id);
|
|
12
|
+
if (rec !== null && recordMatchesPairs(rec, residualPairs)) out.push(id);
|
|
13
|
+
}
|
|
14
|
+
return out;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export {
|
|
18
|
+
findMatchingIdsByPairs
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=chunk-TFMM5DBB.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/kernel/match-pairs.ts"],"sourcesContent":["/**\n * Kernel-side matching primitives for composite `triggerBy` fan-out (#1249).\n *\n * Lives in the kernel (not `with-formula/derivations/`) so `collection.ts` can\n * import it statically without dragging derivations code into the floor\n * bundle — the module used to be dynamically imported from `collection.ts`\n * while also being statically imported by `registry.ts`/`dispatch.ts`,\n * which merged it into a chunk that `dist/index.js` ended up pulling in\n * statically.\n * @module\n */\n\nconst scalar = (v: unknown): string | null =>\n (typeof v === 'string' || typeof v === 'number') ? String(v) : null\n\n/** Conjunction over one candidate record, same coercion as tupleFromWritten. */\nexport function recordMatchesPairs(\n rec: Record<string, unknown>,\n pairs: ReadonlyArray<{ field: string; value: string }>,\n): boolean {\n return pairs.every((p) => scalar(rec[p.field]) === p.value)\n}\n\n/** Scan/filter core for composite fan-out. `residualPairs` are the pairs NOT\n * already decided by `indexCandidates` (the id set from an equality index for\n * ONE pair, or null when no pair is indexed). When the index alone decides\n * membership (`indexCandidates` non-null and no residual pairs left), this\n * returns the index's answer verbatim with ZERO record reads — matching the\n * old single-field `_findMatchingIds`' `[...hit]` fast path exactly. */\nexport async function findMatchingIdsByPairs(\n residualPairs: ReadonlyArray<{ field: string; value: string }>,\n io: {\n indexCandidates: ReadonlyArray<string> | null\n listIds: () => Promise<ReadonlyArray<string>>\n getRecord: (id: string) => Promise<Record<string, unknown> | null>\n },\n): Promise<string[]> {\n if (io.indexCandidates !== null && residualPairs.length === 0) return [...io.indexCandidates]\n const ids = io.indexCandidates ?? await io.listIds()\n const out: string[] = []\n for (const id of ids) {\n const rec = await io.getRecord(id)\n if (rec !== null && recordMatchesPairs(rec, residualPairs)) out.push(id)\n }\n return out\n}\n"],"mappings":";AAYA,IAAM,SAAS,CAAC,MACb,OAAO,MAAM,YAAY,OAAO,MAAM,WAAY,OAAO,CAAC,IAAI;AAG1D,SAAS,mBACd,KACA,OACS;AACT,SAAO,MAAM,MAAM,CAAC,MAAM,OAAO,IAAI,EAAE,KAAK,CAAC,MAAM,EAAE,KAAK;AAC5D;AAQA,eAAsB,uBACpB,eACA,IAKmB;AACnB,MAAI,GAAG,oBAAoB,QAAQ,cAAc,WAAW,EAAG,QAAO,CAAC,GAAG,GAAG,eAAe;AAC5F,QAAM,MAAM,GAAG,mBAAmB,MAAM,GAAG,QAAQ;AACnD,QAAM,MAAgB,CAAC;AACvB,aAAW,MAAM,KAAK;AACpB,UAAM,MAAM,MAAM,GAAG,UAAU,EAAE;AACjC,QAAI,QAAQ,QAAQ,mBAAmB,KAAK,aAAa,EAAG,KAAI,KAAK,EAAE;AAAA,EACzE;AACA,SAAO;AACT;","names":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DerivationCapExceededError,
|
|
3
3
|
DerivationOutputShapeError
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-7O3Y4PPD.js";
|
|
5
5
|
|
|
6
6
|
// src/with-formula/derivations/executor.ts
|
|
7
7
|
var DerivationExecutor = {
|
|
@@ -121,4 +121,4 @@ var DerivationExecutor = {
|
|
|
121
121
|
export {
|
|
122
122
|
DerivationExecutor
|
|
123
123
|
};
|
|
124
|
-
//# sourceMappingURL=chunk-
|
|
124
|
+
//# sourceMappingURL=chunk-TFR7DSOV.js.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
installViaBinder
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-UXVWEX5L.js";
|
|
4
4
|
import {
|
|
5
5
|
LocaleNotSpecifiedError,
|
|
6
6
|
MissingTranslationError,
|
|
7
7
|
ScriptViolationError,
|
|
8
8
|
TranslatorNotConfiguredError
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-7O3Y4PPD.js";
|
|
10
10
|
|
|
11
11
|
// src/port/with/i18n-strategy.ts
|
|
12
12
|
function notEnabled(op) {
|
|
@@ -618,4 +618,4 @@ export {
|
|
|
618
618
|
presentI18nForJoin,
|
|
619
619
|
stripI18nFilled
|
|
620
620
|
};
|
|
621
|
-
//# sourceMappingURL=chunk-
|
|
621
|
+
//# sourceMappingURL=chunk-TRGTKX5E.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SatelliteConfigError
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-7O3Y4PPD.js";
|
|
4
4
|
|
|
5
5
|
// src/with-shape/satellites/validate.ts
|
|
6
6
|
function validateSatelliteDeclaration(input) {
|
|
@@ -47,4 +47,4 @@ export {
|
|
|
47
47
|
validateSatelliteDeclaration,
|
|
48
48
|
hashFields
|
|
49
49
|
};
|
|
50
|
-
//# sourceMappingURL=chunk-
|
|
50
|
+
//# sourceMappingURL=chunk-TUFM4UZP.js.map
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ATTESTATIONS_COLLECTION,
|
|
3
3
|
loadOrCreateSigner
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-G73UVHCA.js";
|
|
5
5
|
import {
|
|
6
6
|
generateULID
|
|
7
7
|
} from "./chunk-4AOERLTV.js";
|
|
8
8
|
import {
|
|
9
9
|
buildRecordAad
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-4ZS56W5S.js";
|
|
11
11
|
import {
|
|
12
12
|
buildRecordEnvelope
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-SZJ3DLZA.js";
|
|
14
14
|
import {
|
|
15
15
|
encrypt
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-HPVZCW43.js";
|
|
17
17
|
import {
|
|
18
18
|
AttestationError
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-7O3Y4PPD.js";
|
|
20
20
|
|
|
21
21
|
// src/with-audit/attestation/issue.ts
|
|
22
22
|
import {
|
|
@@ -63,4 +63,4 @@ async function issueAttestationCore(ctx, args) {
|
|
|
63
63
|
export {
|
|
64
64
|
issueAttestationCore
|
|
65
65
|
};
|
|
66
|
-
//# sourceMappingURL=chunk-
|
|
66
|
+
//# sourceMappingURL=chunk-UDHWDSRL.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
dekKey
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-JMGDHKQF.js";
|
|
4
4
|
import {
|
|
5
5
|
TierNotGrantedError
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-7O3Y4PPD.js";
|
|
7
7
|
|
|
8
8
|
// src/with-party/team/tiers.ts
|
|
9
9
|
function assertTierAccess(keyring, collection, tier) {
|
|
@@ -17,4 +17,4 @@ function assertTierAccess(keyring, collection, tier) {
|
|
|
17
17
|
export {
|
|
18
18
|
assertTierAccess
|
|
19
19
|
};
|
|
20
|
-
//# sourceMappingURL=chunk-
|
|
20
|
+
//# sourceMappingURL=chunk-UGTBXF5U.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
grant,
|
|
3
3
|
revoke
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-3V4KWFX7.js";
|
|
5
5
|
import {
|
|
6
6
|
CustodyNotEnabledError
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-7O3Y4PPD.js";
|
|
8
8
|
|
|
9
9
|
// src/with-party/custody/active.ts
|
|
10
10
|
function withCustody() {
|
|
@@ -16,7 +16,7 @@ function withCustody() {
|
|
|
16
16
|
return host._revokeCustodianImpl(revoke, vault, options, factors);
|
|
17
17
|
},
|
|
18
18
|
async liberate(vault, opts) {
|
|
19
|
-
const { liberateVault } = await import("./liberate-
|
|
19
|
+
const { liberateVault } = await import("./liberate-V35QUHJP.js");
|
|
20
20
|
return liberateVault(vault, opts);
|
|
21
21
|
}
|
|
22
22
|
};
|
|
@@ -74,4 +74,4 @@ export {
|
|
|
74
74
|
withCustody,
|
|
75
75
|
CustodyApi
|
|
76
76
|
};
|
|
77
|
-
//# sourceMappingURL=chunk-
|
|
77
|
+
//# sourceMappingURL=chunk-UHHPLO3I.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
buildLazyCache
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-66TQOPFM.js";
|
|
4
4
|
|
|
5
5
|
// src/with-store/lazy/active.ts
|
|
6
6
|
function withLazy() {
|
|
@@ -14,4 +14,4 @@ function withLazy() {
|
|
|
14
14
|
export {
|
|
15
15
|
withLazy
|
|
16
16
|
};
|
|
17
|
-
//# sourceMappingURL=chunk-
|
|
17
|
+
//# sourceMappingURL=chunk-ULUMAZ5S.js.map
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
import {
|
|
2
|
+
decodeVecId,
|
|
3
|
+
embeddingSourceText,
|
|
4
|
+
encodeVecId,
|
|
5
|
+
isVecIdFor
|
|
6
|
+
} from "./chunk-RTBJ5IOO.js";
|
|
1
7
|
import {
|
|
2
8
|
buildBlobFieldEntries,
|
|
3
9
|
buildDictKeyFieldEntries,
|
|
@@ -5,94 +11,20 @@ import {
|
|
|
5
11
|
buildStringFieldEntries,
|
|
6
12
|
extractSnippet,
|
|
7
13
|
searchScan
|
|
8
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-LH5A3ZPG.js";
|
|
9
15
|
import {
|
|
10
16
|
fuseRetrieval
|
|
11
17
|
} from "./chunk-AURFOK3D.js";
|
|
12
18
|
import {
|
|
13
|
-
getAtPath,
|
|
14
19
|
isStaticDictDescriptor,
|
|
15
20
|
stripI18nFilled
|
|
16
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-TRGTKX5E.js";
|
|
17
22
|
import {
|
|
18
23
|
liveRecordIsElevated
|
|
19
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-JMGDHKQF.js";
|
|
20
25
|
import {
|
|
21
|
-
EmbeddingDimMismatchError
|
|
22
|
-
|
|
23
|
-
} from "./chunk-SW4TOSJL.js";
|
|
24
|
-
|
|
25
|
-
// src/with-lookup/embeddings/cosine.ts
|
|
26
|
-
function cosine(a, b) {
|
|
27
|
-
if (a.length !== b.length) return 0;
|
|
28
|
-
let dot = 0, na = 0, nb = 0;
|
|
29
|
-
for (let i = 0; i < a.length; i++) {
|
|
30
|
-
const x = a[i], y = b[i];
|
|
31
|
-
dot += x * y;
|
|
32
|
-
na += x * x;
|
|
33
|
-
nb += y * y;
|
|
34
|
-
}
|
|
35
|
-
if (na === 0 || nb === 0) return 0;
|
|
36
|
-
return dot / (Math.sqrt(na) * Math.sqrt(nb));
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
// src/with-lookup/embeddings/descriptor.ts
|
|
40
|
-
function embeddingSourceText(record, source) {
|
|
41
|
-
const fields = typeof source === "string" ? [source] : source;
|
|
42
|
-
const parts = [];
|
|
43
|
-
for (const f of fields) {
|
|
44
|
-
for (const leaf of getAtPath(record, f)) {
|
|
45
|
-
if (typeof leaf === "string" && leaf !== "") parts.push(leaf);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
return parts.join(" ");
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
// src/with-lookup/embeddings/vector-set.ts
|
|
52
|
-
var VectorSet = class {
|
|
53
|
-
vectors;
|
|
54
|
-
get loaded() {
|
|
55
|
-
return this.vectors !== void 0;
|
|
56
|
-
}
|
|
57
|
-
async ensureLoaded(load) {
|
|
58
|
-
if (this.vectors === void 0) this.vectors = await load();
|
|
59
|
-
}
|
|
60
|
-
markDirty() {
|
|
61
|
-
this.vectors = void 0;
|
|
62
|
-
}
|
|
63
|
-
cosineTopK(query, k, opts = {}) {
|
|
64
|
-
const all = this.vectors ?? [];
|
|
65
|
-
const minScore = opts.minScore ?? -Infinity;
|
|
66
|
-
const hits = [];
|
|
67
|
-
for (const v of all) {
|
|
68
|
-
if (opts.expectModel !== void 0 && v.model !== opts.expectModel) {
|
|
69
|
-
throw new EmbeddingModelMismatchError(opts.expectModel, v.model);
|
|
70
|
-
}
|
|
71
|
-
const score = cosine(query, v.vec);
|
|
72
|
-
if (score >= minScore) hits.push({ id: v.id, score });
|
|
73
|
-
}
|
|
74
|
-
hits.sort((a, b) => b.score - a.score);
|
|
75
|
-
return hits.slice(0, k);
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
// src/with-lookup/embeddings/vec-id.ts
|
|
80
|
-
function encodeVecId(collection, recordId) {
|
|
81
|
-
if (collection.includes("/")) {
|
|
82
|
-
throw new Error(
|
|
83
|
-
`encodeVecId: collection name "${collection}" must not contain "/" \u2014 it would make the "${collection}/${recordId}" _vec id ambiguous against another collection's rows.`
|
|
84
|
-
);
|
|
85
|
-
}
|
|
86
|
-
return `${collection}/${recordId}`;
|
|
87
|
-
}
|
|
88
|
-
function decodeVecId(collection, vecId) {
|
|
89
|
-
const prefix = `${collection}/`;
|
|
90
|
-
if (!vecId.startsWith(prefix)) return null;
|
|
91
|
-
return vecId.slice(prefix.length);
|
|
92
|
-
}
|
|
93
|
-
function isVecIdFor(collection, vecId) {
|
|
94
|
-
return vecId.startsWith(`${collection}/`);
|
|
95
|
-
}
|
|
26
|
+
EmbeddingDimMismatchError
|
|
27
|
+
} from "./chunk-7O3Y4PPD.js";
|
|
96
28
|
|
|
97
29
|
// src/with-lookup/search/collection-facade.ts
|
|
98
30
|
async function search(ctx, field, query, opts = {}) {
|
|
@@ -380,8 +312,6 @@ async function syncTierSearch(ctx, id, record, version) {
|
|
|
380
312
|
}
|
|
381
313
|
|
|
382
314
|
export {
|
|
383
|
-
VectorSet,
|
|
384
|
-
encodeVecId,
|
|
385
315
|
search,
|
|
386
316
|
buildRetrievalDocs,
|
|
387
317
|
hasIndexedBlobFields,
|
|
@@ -394,4 +324,4 @@ export {
|
|
|
394
324
|
rebuildEmbeddings,
|
|
395
325
|
syncTierSearch
|
|
396
326
|
};
|
|
397
|
-
//# sourceMappingURL=chunk-
|
|
327
|
+
//# sourceMappingURL=chunk-UP4BECPY.js.map
|