@remnic/core 10.0.4 → 10.0.6
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/access-admin-ops-surface.js +49 -49
- package/dist/access-authorization-probe.js +50 -50
- package/dist/access-boundary.js +49 -49
- package/dist/access-cli.d.ts.map +1 -1
- package/dist/access-cli.js +120 -115
- package/dist/access-cli.js.map +1 -1
- package/dist/access-extraction-force-flush.js +49 -49
- package/dist/access-http-briefing.js +50 -50
- package/dist/access-http-query.js +51 -51
- package/dist/access-http.d.ts.map +1 -1
- package/dist/access-http.js +72 -71
- package/dist/access-identity-continuity-surface.js +49 -49
- package/dist/access-lcm-surface.js +49 -49
- package/dist/access-mcp-correction-tools.d.ts +10 -0
- package/dist/access-mcp-correction-tools.d.ts.map +1 -0
- package/dist/access-mcp-correction-tools.js +8 -0
- package/dist/access-mcp.d.ts.map +1 -1
- package/dist/access-mcp.js +63 -62
- package/dist/access-namespace-preflight.js +49 -49
- package/dist/access-observe-write-category.js +3 -3
- package/dist/access-observe-write-surface.js +49 -49
- package/dist/access-offline-manifest.js +5 -5
- package/dist/access-operations-batch.js +52 -52
- package/dist/access-operations.d.ts +1 -0
- package/dist/access-operations.d.ts.map +1 -1
- package/dist/access-operations.js +59 -59
- package/dist/access-recall-concurrency.js +49 -49
- package/dist/access-recall-diagnostics.js +2 -2
- package/dist/access-recall-response.js +49 -49
- package/dist/access-recall-surface.js +49 -49
- package/dist/access-service.d.ts.map +1 -1
- package/dist/access-service.js +49 -49
- package/dist/access-surface-catalog.js +51 -51
- package/dist/active-recall.js +22 -22
- package/dist/adapters/index.js +4 -4
- package/dist/adapters/registry.js +2 -2
- package/dist/auto-sync-FN7E3OTO.js +2 -2
- package/dist/briefing.js +18 -18
- package/dist/buffer.js +1 -1
- package/dist/calibration.d.ts +31 -3
- package/dist/calibration.d.ts.map +1 -1
- package/dist/calibration.js +67 -16
- package/dist/calibration.js.map +1 -1
- package/dist/causal-consolidation.js +18 -18
- package/dist/{chunk-5YDWSWBU.js → chunk-2CP577K6.js} +2 -2
- package/dist/{chunk-QVBB2CLG.js → chunk-2UF42WXV.js} +27 -26
- package/dist/chunk-2UF42WXV.js.map +1 -0
- package/dist/{chunk-ABET5LA5.js → chunk-37HCPM56.js} +23 -23
- package/dist/{chunk-HSZBALHV.js → chunk-4JNTGPBR.js} +2 -2
- package/dist/{chunk-H6FA36LC.js → chunk-4K2H4KTR.js} +5 -5
- package/dist/{chunk-H7BZBSP6.js → chunk-52II7PB6.js} +4 -4
- package/dist/{chunk-RH6MQ5NG.js → chunk-5BPXMAUP.js} +17 -68
- package/dist/chunk-5BPXMAUP.js.map +1 -0
- package/dist/{chunk-U3LVARGV.js → chunk-5X4ZJESN.js} +2 -2
- package/dist/{chunk-SNGNGH53.js → chunk-63UNVGZW.js} +4 -4
- package/dist/{chunk-2KB7TTAP.js → chunk-64S6X4IU.js} +4 -4
- package/dist/{chunk-MEMH5NKJ.js → chunk-6C76FZRM.js} +2 -2
- package/dist/{chunk-3QAIX7TV.js → chunk-6KHF6PAB.js} +2 -2
- package/dist/{chunk-MYBCB4AT.js → chunk-6T42L5FI.js} +2 -2
- package/dist/{chunk-XTWF5XR6.js → chunk-7CZIKCJR.js} +69 -69
- package/dist/{chunk-R6EOFKZG.js → chunk-7LYRFI5A.js} +2 -2
- package/dist/{chunk-4NFRYOHT.js → chunk-ANZXWOYD.js} +2 -2
- package/dist/{chunk-5XXTZ4Y7.js → chunk-B657ZGDH.js} +2 -2
- package/dist/{chunk-5QHTQMRL.js → chunk-CCMXCZLT.js} +8 -6
- package/dist/chunk-CCMXCZLT.js.map +1 -0
- package/dist/{chunk-NSQ3GUVO.js → chunk-CYEK6Z3P.js} +4 -4
- package/dist/{chunk-4DXVWBDB.js → chunk-D6M3VKMY.js} +4 -10
- package/dist/chunk-D6M3VKMY.js.map +1 -0
- package/dist/{chunk-IRYKRBEX.js → chunk-DJMVSUPK.js} +3 -3
- package/dist/{chunk-7OOW72QA.js → chunk-DTXN4NVD.js} +307 -138
- package/dist/chunk-DTXN4NVD.js.map +1 -0
- package/dist/{chunk-UCCB7RKF.js → chunk-EMVJU7WC.js} +2 -2
- package/dist/{chunk-IY7ZISXV.js → chunk-ENNC3RZ6.js} +2 -2
- package/dist/{chunk-QLK3SL7Q.js → chunk-ETSJD5IV.js} +131 -12
- package/dist/chunk-ETSJD5IV.js.map +1 -0
- package/dist/{chunk-PTFL3INS.js → chunk-FC6RCOIU.js} +2 -2
- package/dist/{chunk-CQQTEDHS.js → chunk-FLV7M7CT.js} +2 -2
- package/dist/{chunk-3SL52JKD.js → chunk-FZVROZKC.js} +5 -5
- package/dist/{chunk-Z2EVKNZR.js → chunk-GEGUBU3D.js} +2 -2
- package/dist/{chunk-LIGP5M2C.js → chunk-GF4H3B3R.js} +8 -8
- package/dist/{chunk-FMIVV5SV.js → chunk-I56MTWE7.js} +2 -2
- package/dist/{chunk-EUL3S3LE.js → chunk-J5WI4QRP.js} +4 -4
- package/dist/{chunk-436IRJUD.js → chunk-JA54KIYD.js} +2 -2
- package/dist/{chunk-QWNBQ2T5.js → chunk-JMF5Q4JY.js} +10 -10
- package/dist/{chunk-IDSSDL4W.js → chunk-JXSYWTFK.js} +21 -4
- package/dist/{chunk-IDSSDL4W.js.map → chunk-JXSYWTFK.js.map} +1 -1
- package/dist/{chunk-ABDTBGI2.js → chunk-KCCZFDJD.js} +2 -2
- package/dist/chunk-KIUVEMBI.js +49 -0
- package/dist/chunk-KIUVEMBI.js.map +1 -0
- package/dist/{chunk-IINXHPCV.js → chunk-KQI2PKYP.js} +2 -2
- package/dist/{chunk-ZOGZMAGI.js → chunk-KQT4DRKF.js} +2 -2
- package/dist/{chunk-RGPPNNDJ.js → chunk-KSUOM3YU.js} +9 -9
- package/dist/{chunk-CXG2T7BJ.js → chunk-KZEMFD6E.js} +3 -3
- package/dist/{chunk-O57VUN4U.js → chunk-L2VS27PZ.js} +2 -2
- package/dist/{chunk-IVGJXS5F.js → chunk-L34W4W4I.js} +2 -2
- package/dist/{chunk-MEP3POVW.js → chunk-L3PWXD73.js} +2 -2
- package/dist/{chunk-NQHSXHJP.js → chunk-L6GNS5GB.js} +2 -2
- package/dist/{chunk-QDKABMUE.js → chunk-MH2DXDN6.js} +2 -2
- package/dist/{chunk-DQJCQHII.js → chunk-MQNOIH2C.js} +6 -6
- package/dist/{chunk-IDSZNHIP.js → chunk-MULNBSPP.js} +4 -4
- package/dist/{chunk-BDHWKFGM.js → chunk-OFEHITAZ.js} +2 -2
- package/dist/{chunk-RYN4AIRM.js → chunk-OZABSIOV.js} +4 -4
- package/dist/{chunk-IXF7TRMQ.js → chunk-Q562GF7J.js} +2 -2
- package/dist/{chunk-H2XCCUOT.js → chunk-QEPL7KIZ.js} +15 -15
- package/dist/{chunk-WLC6XA6C.js → chunk-QGLEM46C.js} +16 -53
- package/dist/chunk-QGLEM46C.js.map +1 -0
- package/dist/{chunk-Y7CXM7UM.js → chunk-QMFKW4OU.js} +3 -3
- package/dist/{chunk-Z63GU5NN.js → chunk-QWWMS4AE.js} +1 -1
- package/dist/chunk-QWWMS4AE.js.map +1 -0
- package/dist/{chunk-R4O2G6ML.js → chunk-RSMIRLKM.js} +2 -2
- package/dist/{chunk-6AH2DDHI.js → chunk-S5TGRZWY.js} +2 -2
- package/dist/{chunk-TYOBAFCY.js → chunk-SNXBXYUE.js} +3 -3
- package/dist/{chunk-IHIP7TJ3.js → chunk-SWRN6U7Q.js} +2 -2
- package/dist/{chunk-DBA2W6VV.js → chunk-SZXPKUMN.js} +6 -6
- package/dist/{chunk-WQUGCOKF.js → chunk-TFA6HPOA.js} +4 -4
- package/dist/{chunk-DYRXRQHV.js → chunk-TL4PM7PC.js} +2 -2
- package/dist/{chunk-TSEUVMJL.js → chunk-TRBLJU6Y.js} +39 -39
- package/dist/{chunk-VWCFR4NR.js → chunk-U6OXJQEH.js} +5 -5
- package/dist/{chunk-YMXCJ7SE.js → chunk-VUEG3TZ4.js} +2 -2
- package/dist/{chunk-ORAL4HJC.js → chunk-WG4TMZJ2.js} +2 -2
- package/dist/{chunk-CV5AMCPX.js → chunk-XPRAOTJY.js} +2 -2
- package/dist/{chunk-RZCRXCLI.js → chunk-XQSJXNWC.js} +2 -2
- package/dist/{chunk-GLS3A4SQ.js → chunk-YGPXV546.js} +2 -2
- package/dist/{chunk-P22M3DX3.js → chunk-YJAOYEWI.js} +2 -2
- package/dist/{chunk-OAFRMLL4.js → chunk-YJEUHGZZ.js} +2 -2
- package/dist/cli.js +92 -91
- package/dist/coding/export-okf-codegraph.js +16 -16
- package/dist/compounding/engine.d.ts.map +1 -1
- package/dist/compounding/engine.js +17 -17
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +22 -22
- package/dist/connectors/codex-materialize-runner.js +17 -17
- package/dist/connectors/index.js +17 -17
- package/dist/consolidation-provenance-check.js +2 -2
- package/dist/contradiction/index.js +7 -7
- package/dist/convergence-refresh.js +19 -19
- package/dist/conversation-index/backend.js +2 -2
- package/dist/corpus-watermark.js +19 -19
- package/dist/correction/correction-access-wiring.d.ts +6 -6
- package/dist/correction/correction-access-wiring.d.ts.map +1 -1
- package/dist/correction/correction-classify.d.ts +25 -0
- package/dist/correction/correction-classify.d.ts.map +1 -0
- package/dist/correction/correction-config.d.ts +11 -0
- package/dist/correction/correction-config.d.ts.map +1 -0
- package/dist/correction/correction-contract.d.ts +13 -1
- package/dist/correction/correction-contract.d.ts.map +1 -1
- package/dist/correction/correction-executor.d.ts +2 -0
- package/dist/correction/correction-executor.d.ts.map +1 -1
- package/dist/correction/correction-planner.d.ts +24 -3
- package/dist/correction/correction-planner.d.ts.map +1 -1
- package/dist/entity-retrieval.js +17 -17
- package/dist/event-order-recall.js +2 -2
- package/dist/explicit-capture.js +2 -2
- package/dist/external-wiki-access.js +50 -50
- package/dist/extraction-span-materialize.js +2 -2
- package/dist/extraction.js +25 -25
- package/dist/harmonic-retrieval.js +17 -17
- package/dist/index.js +192 -191
- package/dist/lcm/index.js +3 -3
- package/dist/local-llm.d.ts.map +1 -1
- package/dist/local-llm.js +1 -1
- package/dist/location/index.js +19 -19
- package/dist/maintenance/memory-governance.js +17 -17
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +17 -17
- package/dist/maintenance/rebuild-memory-projection-runner.js +19 -19
- package/dist/maintenance/rebuild-memory-projection.js +18 -18
- package/dist/memory-browse-operations.js +50 -50
- package/dist/memory-browse.js +1 -1
- package/dist/memory-subject.js +1 -1
- package/dist/namespaces/migrate.js +18 -18
- package/dist/namespaces/search.js +6 -6
- package/dist/namespaces/storage.js +17 -17
- package/dist/operator-doctor-corpus.js +20 -20
- package/dist/operator-toolkit.js +32 -32
- package/dist/orchestration/maintenance.js +28 -28
- package/dist/orchestration/session-context.d.ts.map +1 -1
- package/dist/orchestrator.js +116 -115
- package/dist/recall-explain-renderer.js +3 -3
- package/dist/recall-navigate-access.js +2 -2
- package/dist/recall-navigate-disclosure.js +2 -2
- package/dist/recall-navigate.js +2 -2
- package/dist/recall-navigation-operations.js +50 -50
- package/dist/recall-navigation.js +49 -49
- package/dist/recall-why-service.js +2 -2
- package/dist/recall-xray-cli.js +4 -4
- package/dist/recall-xray-renderer.js +3 -3
- package/dist/recall-xray.js +2 -2
- package/dist/reconcile/manifest.js +3 -3
- package/dist/{resolution-RSG4HZTL.js → resolution-TV3F7ZTH.js} +7 -7
- package/dist/resolution-TV3F7ZTH.js.map +1 -0
- package/dist/resume-bundles.js +23 -23
- package/dist/salvage-envelope.js +1 -1
- package/dist/search/factory.js +5 -5
- package/dist/search/index.js +9 -9
- package/dist/semantic-consolidation.js +23 -23
- package/dist/semantic-rule-promotion.js +17 -17
- package/dist/semantic-rule-verifier.js +17 -17
- package/dist/source-agent-qualifier.js +17 -17
- package/dist/standup/build.js +17 -17
- package/dist/storage.js +16 -16
- package/dist/subject-config.js +1 -1
- package/dist/summarizer.js +3 -3
- package/dist/support-passport/index.js +66 -66
- package/dist/transfer/export-okf.js +17 -17
- package/dist/types.d.ts +6 -23
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +1 -1
- package/dist/verified-recall.js +17 -17
- package/dist/who-knows-cli.js +18 -18
- package/dist/who-knows.js +17 -17
- package/dist/write-envelope.js +1 -1
- package/package.json +2 -2
- package/src/access-cli.ts +4 -0
- package/src/access-http.ts +1 -0
- package/src/access-mcp-correction-tools.ts +56 -0
- package/src/access-mcp.ts +4 -49
- package/src/access-operations.ts +3 -0
- package/src/access-service.ts +12 -21
- package/src/calibration-local-llm.test.ts +361 -0
- package/src/calibration.ts +109 -26
- package/src/compounding/engine.ts +2 -8
- package/src/config.test.ts +26 -0
- package/src/config.ts +4 -60
- package/src/correction/correction-access-wiring.ts +56 -16
- package/src/correction/correction-classify.test.ts +185 -0
- package/src/correction/correction-classify.ts +157 -0
- package/src/correction/correction-config.ts +93 -0
- package/src/correction/correction-contract.ts +61 -14
- package/src/correction/correction-executor.test.ts +102 -2
- package/src/correction/correction-executor.ts +19 -1
- package/src/correction/correction-planner.test.ts +141 -0
- package/src/correction/correction-planner.ts +117 -11
- package/src/correction/correction-surfaces.test.ts +22 -1
- package/src/local-llm-qos.test.ts +36 -0
- package/src/local-llm.ts +20 -3
- package/src/orchestration/session-context.ts +0 -15
- package/src/recall-handles-wiring.test.ts +24 -0
- package/src/types.ts +6 -23
- package/dist/chunk-4DXVWBDB.js.map +0 -1
- package/dist/chunk-5QHTQMRL.js.map +0 -1
- package/dist/chunk-7OOW72QA.js.map +0 -1
- package/dist/chunk-QLK3SL7Q.js.map +0 -1
- package/dist/chunk-QVBB2CLG.js.map +0 -1
- package/dist/chunk-RH6MQ5NG.js.map +0 -1
- package/dist/chunk-WLC6XA6C.js.map +0 -1
- package/dist/chunk-Z63GU5NN.js.map +0 -1
- /package/dist/{resolution-RSG4HZTL.js.map → access-mcp-correction-tools.js.map} +0 -0
- /package/dist/{chunk-5YDWSWBU.js.map → chunk-2CP577K6.js.map} +0 -0
- /package/dist/{chunk-ABET5LA5.js.map → chunk-37HCPM56.js.map} +0 -0
- /package/dist/{chunk-HSZBALHV.js.map → chunk-4JNTGPBR.js.map} +0 -0
- /package/dist/{chunk-H6FA36LC.js.map → chunk-4K2H4KTR.js.map} +0 -0
- /package/dist/{chunk-H7BZBSP6.js.map → chunk-52II7PB6.js.map} +0 -0
- /package/dist/{chunk-U3LVARGV.js.map → chunk-5X4ZJESN.js.map} +0 -0
- /package/dist/{chunk-SNGNGH53.js.map → chunk-63UNVGZW.js.map} +0 -0
- /package/dist/{chunk-2KB7TTAP.js.map → chunk-64S6X4IU.js.map} +0 -0
- /package/dist/{chunk-MEMH5NKJ.js.map → chunk-6C76FZRM.js.map} +0 -0
- /package/dist/{chunk-3QAIX7TV.js.map → chunk-6KHF6PAB.js.map} +0 -0
- /package/dist/{chunk-MYBCB4AT.js.map → chunk-6T42L5FI.js.map} +0 -0
- /package/dist/{chunk-XTWF5XR6.js.map → chunk-7CZIKCJR.js.map} +0 -0
- /package/dist/{chunk-R6EOFKZG.js.map → chunk-7LYRFI5A.js.map} +0 -0
- /package/dist/{chunk-4NFRYOHT.js.map → chunk-ANZXWOYD.js.map} +0 -0
- /package/dist/{chunk-5XXTZ4Y7.js.map → chunk-B657ZGDH.js.map} +0 -0
- /package/dist/{chunk-NSQ3GUVO.js.map → chunk-CYEK6Z3P.js.map} +0 -0
- /package/dist/{chunk-IRYKRBEX.js.map → chunk-DJMVSUPK.js.map} +0 -0
- /package/dist/{chunk-UCCB7RKF.js.map → chunk-EMVJU7WC.js.map} +0 -0
- /package/dist/{chunk-IY7ZISXV.js.map → chunk-ENNC3RZ6.js.map} +0 -0
- /package/dist/{chunk-PTFL3INS.js.map → chunk-FC6RCOIU.js.map} +0 -0
- /package/dist/{chunk-CQQTEDHS.js.map → chunk-FLV7M7CT.js.map} +0 -0
- /package/dist/{chunk-3SL52JKD.js.map → chunk-FZVROZKC.js.map} +0 -0
- /package/dist/{chunk-Z2EVKNZR.js.map → chunk-GEGUBU3D.js.map} +0 -0
- /package/dist/{chunk-LIGP5M2C.js.map → chunk-GF4H3B3R.js.map} +0 -0
- /package/dist/{chunk-FMIVV5SV.js.map → chunk-I56MTWE7.js.map} +0 -0
- /package/dist/{chunk-EUL3S3LE.js.map → chunk-J5WI4QRP.js.map} +0 -0
- /package/dist/{chunk-436IRJUD.js.map → chunk-JA54KIYD.js.map} +0 -0
- /package/dist/{chunk-QWNBQ2T5.js.map → chunk-JMF5Q4JY.js.map} +0 -0
- /package/dist/{chunk-ABDTBGI2.js.map → chunk-KCCZFDJD.js.map} +0 -0
- /package/dist/{chunk-IINXHPCV.js.map → chunk-KQI2PKYP.js.map} +0 -0
- /package/dist/{chunk-ZOGZMAGI.js.map → chunk-KQT4DRKF.js.map} +0 -0
- /package/dist/{chunk-RGPPNNDJ.js.map → chunk-KSUOM3YU.js.map} +0 -0
- /package/dist/{chunk-CXG2T7BJ.js.map → chunk-KZEMFD6E.js.map} +0 -0
- /package/dist/{chunk-O57VUN4U.js.map → chunk-L2VS27PZ.js.map} +0 -0
- /package/dist/{chunk-IVGJXS5F.js.map → chunk-L34W4W4I.js.map} +0 -0
- /package/dist/{chunk-MEP3POVW.js.map → chunk-L3PWXD73.js.map} +0 -0
- /package/dist/{chunk-NQHSXHJP.js.map → chunk-L6GNS5GB.js.map} +0 -0
- /package/dist/{chunk-QDKABMUE.js.map → chunk-MH2DXDN6.js.map} +0 -0
- /package/dist/{chunk-DQJCQHII.js.map → chunk-MQNOIH2C.js.map} +0 -0
- /package/dist/{chunk-IDSZNHIP.js.map → chunk-MULNBSPP.js.map} +0 -0
- /package/dist/{chunk-BDHWKFGM.js.map → chunk-OFEHITAZ.js.map} +0 -0
- /package/dist/{chunk-RYN4AIRM.js.map → chunk-OZABSIOV.js.map} +0 -0
- /package/dist/{chunk-IXF7TRMQ.js.map → chunk-Q562GF7J.js.map} +0 -0
- /package/dist/{chunk-H2XCCUOT.js.map → chunk-QEPL7KIZ.js.map} +0 -0
- /package/dist/{chunk-Y7CXM7UM.js.map → chunk-QMFKW4OU.js.map} +0 -0
- /package/dist/{chunk-R4O2G6ML.js.map → chunk-RSMIRLKM.js.map} +0 -0
- /package/dist/{chunk-6AH2DDHI.js.map → chunk-S5TGRZWY.js.map} +0 -0
- /package/dist/{chunk-TYOBAFCY.js.map → chunk-SNXBXYUE.js.map} +0 -0
- /package/dist/{chunk-IHIP7TJ3.js.map → chunk-SWRN6U7Q.js.map} +0 -0
- /package/dist/{chunk-DBA2W6VV.js.map → chunk-SZXPKUMN.js.map} +0 -0
- /package/dist/{chunk-WQUGCOKF.js.map → chunk-TFA6HPOA.js.map} +0 -0
- /package/dist/{chunk-DYRXRQHV.js.map → chunk-TL4PM7PC.js.map} +0 -0
- /package/dist/{chunk-TSEUVMJL.js.map → chunk-TRBLJU6Y.js.map} +0 -0
- /package/dist/{chunk-VWCFR4NR.js.map → chunk-U6OXJQEH.js.map} +0 -0
- /package/dist/{chunk-YMXCJ7SE.js.map → chunk-VUEG3TZ4.js.map} +0 -0
- /package/dist/{chunk-ORAL4HJC.js.map → chunk-WG4TMZJ2.js.map} +0 -0
- /package/dist/{chunk-CV5AMCPX.js.map → chunk-XPRAOTJY.js.map} +0 -0
- /package/dist/{chunk-RZCRXCLI.js.map → chunk-XQSJXNWC.js.map} +0 -0
- /package/dist/{chunk-GLS3A4SQ.js.map → chunk-YGPXV546.js.map} +0 -0
- /package/dist/{chunk-P22M3DX3.js.map → chunk-YJAOYEWI.js.map} +0 -0
- /package/dist/{chunk-OAFRMLL4.js.map → chunk-YJEUHGZZ.js.map} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
parseFrontmatter
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-37HCPM56.js";
|
|
4
4
|
import {
|
|
5
5
|
activityDigestPath,
|
|
6
6
|
isValidActivityDate
|
|
@@ -199,4 +199,4 @@ export {
|
|
|
199
199
|
buildStandup,
|
|
200
200
|
standupHelp
|
|
201
201
|
};
|
|
202
|
-
//# sourceMappingURL=chunk-
|
|
202
|
+
//# sourceMappingURL=chunk-EMVJU7WC.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
StorageManager
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-37HCPM56.js";
|
|
4
4
|
import {
|
|
5
5
|
getCachedRuleMemories,
|
|
6
6
|
setCachedRuleMemories
|
|
@@ -119,4 +119,4 @@ export {
|
|
|
119
119
|
compareVerifiedSemanticRuleResults,
|
|
120
120
|
searchVerifiedSemanticRules
|
|
121
121
|
};
|
|
122
|
-
//# sourceMappingURL=chunk-
|
|
122
|
+
//# sourceMappingURL=chunk-ENNC3RZ6.js.map
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import {
|
|
2
|
+
coerceBool,
|
|
3
|
+
coerceNumber
|
|
4
|
+
} from "./chunk-PQVCH2AE.js";
|
|
5
|
+
|
|
1
6
|
// src/correction/correction-contract.ts
|
|
2
7
|
var MEMORY_CATEGORIES = [
|
|
3
8
|
"fact",
|
|
@@ -23,6 +28,7 @@ var CORRECTION_ACTION_KINDS = [
|
|
|
23
28
|
];
|
|
24
29
|
var CORRECTION_TEXT_MAX = 1e4;
|
|
25
30
|
var REDACTION_PATTERN_MAX = 256;
|
|
31
|
+
var CORRECTION_MEMORY_ID_MAX = 512;
|
|
26
32
|
function validateCorrectionRequest(request) {
|
|
27
33
|
if (!request || typeof request !== "object") {
|
|
28
34
|
throw new CorrectionContractError("CorrectionRequest must be an object.");
|
|
@@ -37,22 +43,45 @@ function validateCorrectionRequest(request) {
|
|
|
37
43
|
);
|
|
38
44
|
}
|
|
39
45
|
const targetIds = Array.isArray(request.targetIds) ? request.targetIds.filter((id) => typeof id === "string" && id.length > 0) : void 0;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
46
|
+
const normalizedTargets = targetIds !== void 0 && targetIds.length === 0 ? void 0 : targetIds;
|
|
47
|
+
const duplicateOf = readDuplicateOf(request.duplicateOf);
|
|
48
|
+
if (duplicateOf) {
|
|
49
|
+
if (!normalizedTargets || normalizedTargets.length !== 1) {
|
|
50
|
+
throw new CorrectionContractError(
|
|
51
|
+
"CorrectionRequest.duplicateOf requires exactly one targetIds entry (the duplicate memory)."
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
if (normalizedTargets[0] === duplicateOf) {
|
|
55
|
+
throw new CorrectionContractError(
|
|
56
|
+
"CorrectionRequest.duplicateOf must be a different memory from targetIds."
|
|
57
|
+
);
|
|
58
|
+
}
|
|
47
59
|
}
|
|
48
60
|
return {
|
|
49
61
|
text,
|
|
50
|
-
...
|
|
62
|
+
...normalizedTargets ? { targetIds: normalizedTargets } : {},
|
|
63
|
+
...duplicateOf ? { duplicateOf } : {},
|
|
51
64
|
...request.sessionKey ? { sessionKey: request.sessionKey } : {},
|
|
52
65
|
...request.principal ? { principal: request.principal } : {},
|
|
53
66
|
...request.namespace ? { namespace: request.namespace } : {}
|
|
54
67
|
};
|
|
55
68
|
}
|
|
69
|
+
function readDuplicateOf(value) {
|
|
70
|
+
if (value === void 0 || value === null) return void 0;
|
|
71
|
+
if (typeof value !== "string") {
|
|
72
|
+
throw new CorrectionContractError("CorrectionRequest.duplicateOf must be a memory id string.");
|
|
73
|
+
}
|
|
74
|
+
const id = value.trim();
|
|
75
|
+
if (id.length === 0 || id !== value) {
|
|
76
|
+
throw new CorrectionContractError("CorrectionRequest.duplicateOf must be a non-empty memory id.");
|
|
77
|
+
}
|
|
78
|
+
if (id.length > CORRECTION_MEMORY_ID_MAX) {
|
|
79
|
+
throw new CorrectionContractError(
|
|
80
|
+
`CorrectionRequest.duplicateOf exceeds the ${CORRECTION_MEMORY_ID_MAX}-character limit (${id.length}).`
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
return id;
|
|
84
|
+
}
|
|
56
85
|
function validateRedactionPattern(pattern) {
|
|
57
86
|
if (typeof pattern !== "string") {
|
|
58
87
|
throw new CorrectionContractError("redaction_rule.pattern must be a string.");
|
|
@@ -145,8 +174,21 @@ function validateCorrectionAction(action) {
|
|
|
145
174
|
if (typeof a.loserId !== "string" || a.loserId.length === 0) {
|
|
146
175
|
throw new CorrectionContractError("supersede.loserId is required.");
|
|
147
176
|
}
|
|
148
|
-
|
|
149
|
-
|
|
177
|
+
{
|
|
178
|
+
const hasReplacement = a.replacement !== void 0 && a.replacement !== null;
|
|
179
|
+
const hasWinner = a.winnerId !== void 0 && a.winnerId !== null;
|
|
180
|
+
if (hasWinner) {
|
|
181
|
+
if (typeof a.winnerId !== "string" || a.winnerId.trim().length === 0 || a.winnerId !== a.winnerId.trim()) {
|
|
182
|
+
throw new CorrectionContractError("supersede.winnerId must be a non-empty memory id.");
|
|
183
|
+
}
|
|
184
|
+
if (a.winnerId === a.loserId) {
|
|
185
|
+
throw new CorrectionContractError("supersede.winnerId must differ from loserId.");
|
|
186
|
+
}
|
|
187
|
+
if (hasReplacement) {
|
|
188
|
+
throw new CorrectionContractError("supersede.winnerId cannot be combined with a replacement draft.");
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
if (hasReplacement) validateMemoryDraft(a.replacement);
|
|
150
192
|
}
|
|
151
193
|
break;
|
|
152
194
|
case "edit":
|
|
@@ -229,6 +271,80 @@ var CorrectionContractError = class extends Error {
|
|
|
229
271
|
}
|
|
230
272
|
};
|
|
231
273
|
|
|
274
|
+
// src/correction/correction-config.ts
|
|
275
|
+
var DEFAULT_CORRECTION_CLASSIFY_TIMEOUT_MS = 45e3;
|
|
276
|
+
var MAX_CORRECTION_CLASSIFY_TIMEOUT_MS = 3e5;
|
|
277
|
+
function parseCorrectionConfig(cfg) {
|
|
278
|
+
return {
|
|
279
|
+
correctionEnabled: (() => {
|
|
280
|
+
const nested = cfg.correction?.enabled;
|
|
281
|
+
const raw = nested !== void 0 ? nested : cfg.correctionEnabled;
|
|
282
|
+
if (raw === void 0 || raw === null) return true;
|
|
283
|
+
const value = coerceBool(raw);
|
|
284
|
+
if (value === void 0) {
|
|
285
|
+
throw new Error(`Invalid correction.enabled: expected a boolean, got ${JSON.stringify(raw)}`);
|
|
286
|
+
}
|
|
287
|
+
return value;
|
|
288
|
+
})(),
|
|
289
|
+
correctionApplyRequiresConfirm: (() => {
|
|
290
|
+
const nested = cfg.correction?.applyRequiresConfirm;
|
|
291
|
+
const raw = nested !== void 0 ? nested : cfg.correctionApplyRequiresConfirm;
|
|
292
|
+
if (raw === void 0 || raw === null) return true;
|
|
293
|
+
const value = coerceBool(raw);
|
|
294
|
+
if (value === void 0) {
|
|
295
|
+
throw new Error(`Invalid correction.applyRequiresConfirm: expected a boolean, got ${JSON.stringify(raw)}`);
|
|
296
|
+
}
|
|
297
|
+
return value;
|
|
298
|
+
})(),
|
|
299
|
+
correctionMaxAffected: (() => {
|
|
300
|
+
const rawNested = cfg.correction?.maxAffected;
|
|
301
|
+
const raw = rawNested !== void 0 ? rawNested : cfg.correctionMaxAffected;
|
|
302
|
+
if (raw === void 0 || raw === null) return 10;
|
|
303
|
+
const n = coerceNumber(raw);
|
|
304
|
+
if (n === void 0 || !Number.isFinite(n) || n < 1 || !Number.isInteger(n)) {
|
|
305
|
+
throw new Error(`Invalid correction.maxAffected: expected an integer >= 1, got ${JSON.stringify(raw)}`);
|
|
306
|
+
}
|
|
307
|
+
return n;
|
|
308
|
+
})(),
|
|
309
|
+
correctionPlanTtlHours: (() => {
|
|
310
|
+
const nested = cfg.correction?.planTtlHours;
|
|
311
|
+
const fromNested = nested !== void 0 ? coerceNumber(nested) : void 0;
|
|
312
|
+
if (fromNested !== void 0 && fromNested >= 1) return fromNested;
|
|
313
|
+
if (nested !== void 0 && fromNested === void 0) {
|
|
314
|
+
throw new Error(`Invalid correction.planTtlHours: expected a number >= 1, got ${JSON.stringify(nested)}`);
|
|
315
|
+
}
|
|
316
|
+
if (fromNested !== void 0 && fromNested < 1) {
|
|
317
|
+
throw new Error(`Invalid correction.planTtlHours: expected a number >= 1, got ${JSON.stringify(nested)}`);
|
|
318
|
+
}
|
|
319
|
+
const fromFlat = coerceNumber(cfg.correctionPlanTtlHours);
|
|
320
|
+
if (fromFlat !== void 0 && fromFlat >= 1) return fromFlat;
|
|
321
|
+
if (cfg.correctionPlanTtlHours !== void 0 && fromFlat === void 0) {
|
|
322
|
+
throw new Error(
|
|
323
|
+
`Invalid correction.planTtlHours: expected a number >= 1, got ${JSON.stringify(cfg.correctionPlanTtlHours)}`
|
|
324
|
+
);
|
|
325
|
+
}
|
|
326
|
+
if (fromFlat !== void 0 && fromFlat < 1) {
|
|
327
|
+
throw new Error(
|
|
328
|
+
`Invalid correction.planTtlHours: expected a number >= 1, got ${JSON.stringify(cfg.correctionPlanTtlHours)}`
|
|
329
|
+
);
|
|
330
|
+
}
|
|
331
|
+
return 24;
|
|
332
|
+
})(),
|
|
333
|
+
correctionClassifyTimeoutMs: (() => {
|
|
334
|
+
const nested = cfg.correction?.classifyTimeoutMs;
|
|
335
|
+
const raw = nested !== void 0 ? nested : cfg.correctionClassifyTimeoutMs;
|
|
336
|
+
if (raw === void 0 || raw === null) return DEFAULT_CORRECTION_CLASSIFY_TIMEOUT_MS;
|
|
337
|
+
const n = coerceNumber(raw);
|
|
338
|
+
if (n === void 0 || !Number.isInteger(n) || n < 1 || n > MAX_CORRECTION_CLASSIFY_TIMEOUT_MS) {
|
|
339
|
+
throw new Error(
|
|
340
|
+
`Invalid correction.classifyTimeoutMs: expected an integer from 1 to ${MAX_CORRECTION_CLASSIFY_TIMEOUT_MS}, got ${JSON.stringify(raw)}`
|
|
341
|
+
);
|
|
342
|
+
}
|
|
343
|
+
return n;
|
|
344
|
+
})()
|
|
345
|
+
};
|
|
346
|
+
}
|
|
347
|
+
|
|
232
348
|
export {
|
|
233
349
|
MEMORY_CATEGORIES,
|
|
234
350
|
CORRECTION_TEXT_MAX,
|
|
@@ -237,6 +353,9 @@ export {
|
|
|
237
353
|
validateCorrectionAction,
|
|
238
354
|
deterministicFallbackPlan,
|
|
239
355
|
newPlanId,
|
|
240
|
-
CorrectionContractError
|
|
356
|
+
CorrectionContractError,
|
|
357
|
+
DEFAULT_CORRECTION_CLASSIFY_TIMEOUT_MS,
|
|
358
|
+
MAX_CORRECTION_CLASSIFY_TIMEOUT_MS,
|
|
359
|
+
parseCorrectionConfig
|
|
241
360
|
};
|
|
242
|
-
//# sourceMappingURL=chunk-
|
|
361
|
+
//# sourceMappingURL=chunk-ETSJD5IV.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/correction/correction-contract.ts","../src/correction/correction-config.ts"],"sourcesContent":["/**\n * correction/correction-contract.ts — Types for the Correction Contract\n * (issue #1580).\n *\n * The Correction Contract is the SINGLE plan/apply pipeline every memory\n * correction flows through: supersession, invalidation, tombstone, edit,\n * rescope, redaction. A correction arrives as a plain-language statement\n * (\"we migrated to MySQL in March\"); the planner turns it into a structured\n * {@link CorrectionPlan}; the executor applies the plan in non-destructive\n * order through the existing storage/orchestrator chokepoints.\n *\n * This module is PURE types + validation helpers — no I/O, no side effects.\n * The planner and executor live in sibling modules and inject their own\n * collaborators so the contract is testable in isolation (rule 33).\n *\n * Design rules honored (issue #1580 design section):\n * - Plans are per-request state on disk, never module-level (rules 11/47).\n * - Caller-supplied namespaces are NEVER trusted raw — the service\n * resolves them through the normal namespace policy (rule 42).\n * - Bulk operations refuse past maxAffected (no silent truncation, §39).\n * - `never_store` redaction patterns must be bounded and safe (§34).\n */\n\nimport type { MemoryCategory, MemoryFrontmatter } from \"../types.js\";\n\n// ---------------------------------------------------------------------------\n// Request\n// ---------------------------------------------------------------------------\n\n/**\n * The user-facing input: a plain-language correction plus optional explicit\n * targets. This is what every surface (MCP / HTTP / CLI) collects before\n * handing off to the planner.\n */\nexport interface CorrectionRequest {\n /** Natural-language correction statement. Required, non-empty. */\n text: string;\n /**\n * Explicit target memory ids (or handles via #1582). When present the\n * planner resolves these directly; an unknown id is an explicit error\n * (rule 34), never a silent empty plan. When absent the planner searches.\n */\n targetIds?: string[];\n /** Session key for namespace/principal resolution. */\n sessionKey?: string;\n /** Authenticated principal (resolved by the service, never trusted raw). */\n principal?: string;\n /**\n * Caller-suggested namespace. ALWAYS re-resolved through the namespace\n * policy by the service before reaching the planner (rule 42). The\n * planner only sees the ALREADY-AUTHORIZED namespace.\n */\n namespace?: string;\n /**\n * Winner memory id. When set, `targetIds` must be exactly the duplicate\n * (the loser). The planner skips classification and drafts one recoverable\n * supersede — no hard delete, no replacement write.\n */\n duplicateOf?: string;\n}\n\n// ---------------------------------------------------------------------------\n// Classification + actions\n// ---------------------------------------------------------------------------\n\nexport type CorrectionClassification =\n | \"wrong\"\n | \"outdated\"\n | \"incomplete\"\n | \"wrong_scope\"\n | \"never_store\";\n\nexport const CORRECTION_CLASSIFICATIONS: readonly CorrectionClassification[] = [\n \"wrong\",\n \"outdated\",\n \"incomplete\",\n \"wrong_scope\",\n \"never_store\",\n];\n\n/**\n * A draft for a replacement memory (supersede action). Mirrors the subset of\n * {@link MemoryFrontmatter} a correction caller may legitimately set; the\n * executor fills in id/created/updated/source.\n */\nexport interface MemoryDraft {\n content: string;\n category?: MemoryCategory;\n confidence?: number;\n tags?: string[];\n entityRef?: string;\n /** Optional event-time anchor for bi-temporal supersession (#1578). */\n validAt?: string;\n /** Optional observed-at anchor for bi-temporal supersession (#1578). */\n observedAt?: string;\n structuredAttributes?: Record<string, string>;\n}\n\n/**\n * The known {@link MemoryCategory} values. A replacement/rescope category must\n * be one of these — rejecting path-like or unexpected strings before they reach\n * `StorageManager.writeMemory`, which incorporates the category into the\n * generated memory id/path (review thread Of-XJ).\n */\nexport const MEMORY_CATEGORIES: readonly MemoryCategory[] = [\n \"fact\", \"preference\", \"correction\", \"entity\", \"decision\",\n \"relationship\", \"principle\", \"commitment\", \"moment\",\n \"skill\", \"rule\", \"procedure\", \"reasoning_trace\",\n];\n\nexport type CorrectionAction =\n /**\n * Outdated: a new fact replaces the loser, or `winnerId` records an\n * existing memory as the replacement without writing a new one.\n */\n | { kind: \"supersede\"; loserId: string; replacement?: MemoryDraft; winnerId?: string }\n /** Incomplete / minor-wrong: a versioned edit to an existing memory. */\n | { kind: \"edit\"; memoryId: string; patch: string }\n /** Wrong: retire + tombstone. */\n | { kind: \"retract\"; memoryId: string }\n /** Wrong scope: move to a different namespace. */\n | { kind: \"rescope\"; memoryId: string; toNamespace: string }\n /** Never-store: a future-extraction redaction rule. */\n | { kind: \"redaction_rule\"; pattern: string };\n\nexport const CORRECTION_ACTION_KINDS: readonly CorrectionAction[\"kind\"][] = [\n \"supersede\",\n \"edit\",\n \"retract\",\n \"rescope\",\n \"redaction_rule\",\n];\n\n// ---------------------------------------------------------------------------\n// Plan + outcome\n// ---------------------------------------------------------------------------\n\n/**\n * One affected memory in a plan: where it lives, an excerpt, why it is\n * affected, and (when available) the source quote that supports the\n * correction (#1575 provenance).\n */\nexport interface CorrectionAffectedEntry {\n memoryId: string;\n /** File path relative to the storage dir, for diff rendering. */\n path: string;\n excerpt: string;\n why: string;\n sourceQuote?: string;\n}\n\n/**\n * A persisted, expiring correction plan. Read-only artifact produced by the\n * planner; consumed (once) by the executor.\n */\nexport interface CorrectionPlan {\n planId: string;\n request: CorrectionRequest;\n /** Authorized namespace the plan is scoped to (resolved by the service). */\n namespace: string;\n affected: CorrectionAffectedEntry[];\n classification: CorrectionClassification;\n actions: CorrectionAction[];\n /** Human-readable diff preview rendered via page-versioning. */\n diff: string;\n /** Planner confidence in [0, 1]. `0` means manual selection required. */\n confidence: number;\n warnings: string[];\n createdAt: string;\n /** ISO timestamp after which apply rejects the plan as expired. */\n expiresAt: string;\n /**\n * Lifecycle: `pending` → `applying` → `applied`|`partial` (or `discarded`).\n * The executor flips a plan to `applying` BEFORE running any mutation\n * (review thread OgIqt): if the process dies mid-apply, the plan stays\n * `applying` and is NOT silently retryable — a partially-applied plan must\n * never be re-applied wholesale (it would duplicate succeeded actions).\n */\n status?: \"pending\" | \"applying\" | \"applied\" | \"discarded\" | \"partial\";\n /**\n * ISO timestamp recorded when the plan transitioned to `applying` (#1713\n * Item 2). Startup recovery uses this to detect plans stuck in `applying`\n * past the stale-applying TTL (process died mid-apply) and discard+scrub\n * them. Absent on plans that never entered `applying`.\n */\n applyingAt?: string;\n}\n\n/**\n * Per-action outcome recorded by the executor. An action whose new-state\n * write failed is `failed`; the executor never destroys old state for a\n * failed action (rule 25 / checklist §14).\n */\nexport interface CorrectionActionResult {\n action: CorrectionAction;\n status: \"applied\" | \"failed\" | \"skipped\";\n /** For supersede: the new memory id. For edit: the memory id. */\n memoryId?: string;\n /** For supersede/retract: the emitted tombstone id (if any). */\n tombstoneId?: string;\n error?: string;\n}\n\nexport interface CorrectionOutcome {\n planId: string;\n status: \"applied\" | \"partial\";\n results: CorrectionActionResult[];\n /** Audit-record memory id (corrections are themselves memories). */\n auditMemoryId: string;\n /** ISO timestamp of the apply. */\n appliedAt: string;\n}\n\n// ---------------------------------------------------------------------------\n// Validation helpers (pure) — shared by planner, executor, and surface tests\n// ---------------------------------------------------------------------------\n\n/** Maximum supported `text` length. Surfaces bound this earlier; the planner\n * re-validates so a direct-service caller cannot bypass. */\nexport const CORRECTION_TEXT_MAX = 10_000;\n\n/** Maximum supported redaction pattern length (§34 — bounded patterns). */\nexport const REDACTION_PATTERN_MAX = 256;\n\n/** Maximum memory-id length for `duplicateOf` / explicit targets. */\nexport const CORRECTION_MEMORY_ID_MAX = 512;\n\n/**\n * Validate a {@link CorrectionRequest}'s invariants. Returns the cleaned\n * request or throws with a field-specific message (rule 51 — list valid\n * options, never silently default).\n */\nexport function validateCorrectionRequest(request: CorrectionRequest): CorrectionRequest {\n if (!request || typeof request !== \"object\") {\n throw new CorrectionContractError(\"CorrectionRequest must be an object.\");\n }\n const text = typeof request.text === \"string\" ? request.text.trim() : \"\";\n if (text.length === 0) {\n throw new CorrectionContractError(\"CorrectionRequest.text is required and must be non-empty.\");\n }\n if (text.length > CORRECTION_TEXT_MAX) {\n throw new CorrectionContractError(\n `CorrectionRequest.text exceeds the ${CORRECTION_TEXT_MAX}-character limit (${text.length}).`,\n );\n }\n const targetIds = Array.isArray(request.targetIds)\n ? request.targetIds.filter((id): id is string => typeof id === \"string\" && id.length > 0)\n : undefined;\n const normalizedTargets = targetIds !== undefined && targetIds.length === 0 ? undefined : targetIds;\n const duplicateOf = readDuplicateOf(request.duplicateOf);\n if (duplicateOf) {\n if (!normalizedTargets || normalizedTargets.length !== 1) {\n throw new CorrectionContractError(\n \"CorrectionRequest.duplicateOf requires exactly one targetIds entry (the duplicate memory).\",\n );\n }\n if (normalizedTargets[0] === duplicateOf) {\n throw new CorrectionContractError(\n \"CorrectionRequest.duplicateOf must be a different memory from targetIds.\",\n );\n }\n }\n return {\n text,\n ...(normalizedTargets ? { targetIds: normalizedTargets } : {}),\n ...(duplicateOf ? { duplicateOf } : {}),\n ...(request.sessionKey ? { sessionKey: request.sessionKey } : {}),\n ...(request.principal ? { principal: request.principal } : {}),\n ...(request.namespace ? { namespace: request.namespace } : {}),\n };\n}\n\nfunction readDuplicateOf(value: unknown): string | undefined {\n if (value === undefined || value === null) return undefined;\n if (typeof value !== \"string\") {\n throw new CorrectionContractError(\"CorrectionRequest.duplicateOf must be a memory id string.\");\n }\n const id = value.trim();\n if (id.length === 0 || id !== value) {\n throw new CorrectionContractError(\"CorrectionRequest.duplicateOf must be a non-empty memory id.\");\n }\n if (id.length > CORRECTION_MEMORY_ID_MAX) {\n throw new CorrectionContractError(\n `CorrectionRequest.duplicateOf exceeds the ${CORRECTION_MEMORY_ID_MAX}-character limit (${id.length}).`,\n );\n }\n return id;\n}\n\n/**\n * Validate a redaction pattern (§34 — bounded, literal-or-safe-regex; reject\n * catastrophic patterns). Returns the cleaned pattern or throws.\n */\nexport function validateRedactionPattern(pattern: string): string {\n if (typeof pattern !== \"string\") {\n throw new CorrectionContractError(\"redaction_rule.pattern must be a string.\");\n }\n const trimmed = pattern.trim();\n if (trimmed.length === 0) {\n throw new CorrectionContractError(\"redaction_rule.pattern is required.\");\n }\n if (trimmed.length > REDACTION_PATTERN_MAX) {\n throw new CorrectionContractError(\n `redaction_rule.pattern exceeds the ${REDACTION_PATTERN_MAX}-character bound.`,\n );\n }\n // Reject patterns that could match an unbounded string (overly-broad) OR\n // exhibit catastrophic backtracking (nested quantifiers like `(a+)+`). We do\n // NOT execute the regex (that would be ReDoS itself); we only inspect shape.\n if (isRegexLike(trimmed) && isUnsafeRedactionRegex(trimmed)) {\n throw new CorrectionContractError(\n \"redaction_rule.pattern is unsafe — use a bounded literal or a regex without nested quantifiers / overlapping alternation.\",\n );\n }\n // #1669 P2: reject zero-width regex (empty body or matches empty string)\n // that would withhold every fact.\n if (isRegexLike(trimmed)) {\n const regexBody = trimmed.slice(1, -1);\n if (regexBody.length === 0) {\n throw new CorrectionContractError(\"redaction_rule.pattern body is empty — use a non-empty regex.\");\n }\n try {\n if (new RegExp(regexBody).test(\"\")) {\n throw new CorrectionContractError(\n \"redaction_rule.pattern matches the empty string — it would withhold every fact.\",\n );\n }\n } catch (e) {\n if (e instanceof CorrectionContractError) throw e;\n // Compilation failed — the extraction-time defense handles it.\n }\n }\n return trimmed;\n}\n\n/** Only `/.../`-wrapped patterns are treated as regex; everything else is a\n * literal (review thread P1 — consistent with extraction-redaction-rules.ts). */\nfunction isRegexLike(pattern: string): boolean {\n return pattern.startsWith(\"/\") && pattern.endsWith(\"/\") && pattern.length >= 2;\n}\n\n/**\n * Reject a regex that would either match an arbitrary-length run of any\n * character (overly-broad) OR exhibit catastrophic backtracking (ReDoS).\n * Mirrors the safe-regex heuristic in extraction-redaction-rules.ts so the\n * apply-time chokepoint and the extraction-time defense agree on what is\n * pathological — intentionally not imported to keep the two modules decoupled\n * (contract owns validation; extraction owns consultation).\n */\nfunction isUnsafeRedactionRegex(pattern: string): boolean {\n const body = pattern.startsWith(\"/\") && pattern.endsWith(\"/\")\n ? pattern.slice(1, -1)\n : pattern;\n // `.*`, `.+`, `.`, or `(.*)` etc. anywhere → overly broad.\n if (/(?:^|[^\\\\])\\(\\.\\*\\)|(?:^|[^\\\\])\\.\\*|(?:^|[^\\\\])\\.\\+|^\\.([^*+]?)$/.test(body)) {\n return true;\n }\n // Nested quantifier: a group (...) whose body ends with a quantifier and\n // which is itself quantified → exponential blowup on near-miss inputs\n // (classic ReDoS shapes: (a+)+, (a*)*, (a?)+). Also catches overlapping\n // alternation under repetition: (a|a)+ where branches share a prefix.\n if (body.length > 512) return true;\n for (let i = 0; i < body.length; i++) {\n if (body[i] !== \"(\") continue;\n let depth = 1;\n let j = i + 1;\n while (j < body.length && depth > 0) {\n if (body[j] === \"\\\\\") { j += 2; continue; }\n if (body[j] === \"(\") depth++;\n else if (body[j] === \")\") depth--;\n j++;\n }\n if (depth !== 0) continue;\n const afterGroup = body[j];\n if (afterGroup !== \"+\" && afterGroup !== \"*\" && afterGroup !== \"{\") continue;\n const groupBody = body.slice(i + 1, j - 1);\n if (/[+*?]$/.test(groupBody) || /\\{\\d+,?\\d*\\}[+*?]?$/.test(groupBody)) {\n return true;\n }\n if (groupBody.includes(\"|\")) {\n const branches = groupBody.split(\"|\");\n if (branches.length >= 2) {\n const firstChars = new Set(branches.map((b) => b[0]).filter(Boolean));\n if (firstChars.size < branches.filter((b) => b.length > 0).length) {\n return true;\n }\n }\n }\n i = j;\n }\n return false;\n}\n\n/**\n * Validate the shape of a {@link CorrectionAction}. Used by the executor\n * before applying and by the surface layer to reject malformed client input\n * (rule 51 — list valid kinds).\n */\nexport function validateCorrectionAction(action: unknown): asserts action is CorrectionAction {\n if (!action || typeof action !== \"object\") {\n throw new CorrectionContractError(\"CorrectionAction must be an object.\");\n }\n const a = action as Record<string, unknown>;\n if (typeof a.kind !== \"string\" || !CORRECTION_ACTION_KINDS.includes(a.kind as CorrectionAction[\"kind\"])) {\n throw new CorrectionContractError(\n `CorrectionAction.kind must be one of: ${CORRECTION_ACTION_KINDS.join(\", \")}.`,\n );\n }\n switch (a.kind) {\n case \"supersede\":\n if (typeof a.loserId !== \"string\" || a.loserId.length === 0) {\n throw new CorrectionContractError(\"supersede.loserId is required.\");\n }\n {\n const hasReplacement = a.replacement !== undefined && a.replacement !== null;\n const hasWinner = a.winnerId !== undefined && a.winnerId !== null;\n if (hasWinner) {\n if (typeof a.winnerId !== \"string\" || a.winnerId.trim().length === 0 || a.winnerId !== a.winnerId.trim()) {\n throw new CorrectionContractError(\"supersede.winnerId must be a non-empty memory id.\");\n }\n if (a.winnerId === a.loserId) {\n throw new CorrectionContractError(\"supersede.winnerId must differ from loserId.\");\n }\n if (hasReplacement) {\n throw new CorrectionContractError(\"supersede.winnerId cannot be combined with a replacement draft.\");\n }\n }\n if (hasReplacement) validateMemoryDraft(a.replacement);\n }\n break;\n case \"edit\":\n if (typeof a.memoryId !== \"string\" || a.memoryId.length === 0) {\n throw new CorrectionContractError(\"edit.memoryId is required.\");\n }\n if (typeof a.patch !== \"string\" || a.patch.length === 0) {\n throw new CorrectionContractError(\"edit.patch is required and must be non-empty.\");\n }\n break;\n case \"retract\":\n if (typeof a.memoryId !== \"string\" || a.memoryId.length === 0) {\n throw new CorrectionContractError(\"retract.memoryId is required.\");\n }\n break;\n case \"rescope\":\n if (typeof a.memoryId !== \"string\" || a.memoryId.length === 0) {\n throw new CorrectionContractError(\"rescope.memoryId is required.\");\n }\n if (typeof a.toNamespace !== \"string\" || a.toNamespace.trim().length === 0) {\n throw new CorrectionContractError(\"rescope.toNamespace is required.\");\n }\n break;\n case \"redaction_rule\":\n if (typeof a.pattern !== \"string\") {\n throw new CorrectionContractError(\"redaction_rule.pattern is required.\");\n }\n validateRedactionPattern(a.pattern);\n break;\n }\n}\n\n/** Validate a {@link MemoryDraft}. Throws on invalid shape. */\nexport function validateMemoryDraft(draft: unknown): asserts draft is MemoryDraft {\n if (!draft || typeof draft !== \"object\") {\n throw new CorrectionContractError(\"MemoryDraft must be an object.\");\n }\n const d = draft as Record<string, unknown>;\n if (typeof d.content !== \"string\" || d.content.trim().length === 0) {\n throw new CorrectionContractError(\"MemoryDraft.content is required and must be non-empty.\");\n }\n if (d.category !== undefined) {\n if (typeof d.category !== \"string\" || !(MEMORY_CATEGORIES as readonly string[]).includes(d.category)) {\n throw new CorrectionContractError(\n `MemoryDraft.category must be one of: ${MEMORY_CATEGORIES.join(\", \")}.`,\n );\n }\n }\n if (d.confidence !== undefined && (typeof d.confidence !== \"number\" || d.confidence < 0 || d.confidence > 1)) {\n throw new CorrectionContractError(\"MemoryDraft.confidence must be a number in [0, 1].\");\n }\n if (d.tags !== undefined && !Array.isArray(d.tags)) {\n throw new CorrectionContractError(\"MemoryDraft.tags must be an array.\");\n }\n if (d.structuredAttributes !== undefined && (typeof d.structuredAttributes !== \"object\" || d.structuredAttributes === null)) {\n throw new CorrectionContractError(\"MemoryDraft.structuredAttributes must be an object.\");\n }\n}\n\n/**\n * Deterministic fallback plan (rule 13): when the planner's LLM is\n * unavailable, the plan degrades to a search result, never an error page.\n * Classification `outdated`, confidence `0`, actions empty.\n */\nexport function deterministicFallbackPlan(args: {\n request: CorrectionRequest;\n namespace: string;\n affected: CorrectionAffectedEntry[];\n warnings: string[];\n createdAt: string;\n expiresAt: string;\n}): CorrectionPlan {\n return {\n planId: newPlanId(),\n request: args.request,\n namespace: args.namespace,\n affected: args.affected,\n classification: \"outdated\",\n actions: [],\n diff: \"\",\n confidence: 0,\n warnings: [...args.warnings, \"planner LLM unavailable — manual action selection required\"],\n createdAt: args.createdAt,\n expiresAt: args.expiresAt,\n status: \"pending\",\n };\n}\n\n/** Generate a stable plan id. Exposed for tests + deterministic fallback. */\nexport function newPlanId(): string {\n return `corr-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 10)}`;\n}\n\n/** Error class for contract violations. Surfaces map it to a 400 / input error. */\nexport class CorrectionContractError extends Error {\n constructor(message: string) {\n super(message);\n this.name = \"CorrectionContractError\";\n }\n}\n","/**\n * Correction-contract config (issue #1580 plus classify timeout).\n *\n * Extracted from config.ts so the grandfathered parser file does not grow.\n * Nested `correction.<key>` wins over the flat `correction<Key>` legacy key.\n * Invalid values throw — they are never clamped or silently defaulted.\n *\n * Reads stay inline on `cfg` so the parsed-key extractor records the same\n * paths the plugin schema declares.\n */\nimport { coerceBool, coerceNumber } from \"../connectors/coerce.js\";\n\nexport const DEFAULT_CORRECTION_CLASSIFY_TIMEOUT_MS = 45_000;\nexport const MAX_CORRECTION_CLASSIFY_TIMEOUT_MS = 300_000;\n\nexport interface ParsedCorrectionConfig {\n correctionEnabled: boolean;\n correctionApplyRequiresConfirm: boolean;\n correctionMaxAffected: number;\n correctionPlanTtlHours: number;\n correctionClassifyTimeoutMs: number;\n}\n\nexport function parseCorrectionConfig(cfg: Record<string, unknown>): ParsedCorrectionConfig {\n return {\n correctionEnabled: (() => {\n const nested = (cfg.correction as Record<string, unknown> | undefined)?.enabled;\n const raw = nested !== undefined ? nested : cfg.correctionEnabled;\n if (raw === undefined || raw === null) return true;\n const value = coerceBool(raw);\n if (value === undefined) {\n throw new Error(`Invalid correction.enabled: expected a boolean, got ${JSON.stringify(raw)}`);\n }\n return value;\n })(),\n correctionApplyRequiresConfirm: (() => {\n const nested = (cfg.correction as Record<string, unknown> | undefined)?.applyRequiresConfirm;\n const raw = nested !== undefined ? nested : cfg.correctionApplyRequiresConfirm;\n if (raw === undefined || raw === null) return true;\n const value = coerceBool(raw);\n if (value === undefined) {\n throw new Error(`Invalid correction.applyRequiresConfirm: expected a boolean, got ${JSON.stringify(raw)}`);\n }\n return value;\n })(),\n correctionMaxAffected: (() => {\n const rawNested = (cfg.correction as Record<string, unknown> | undefined)?.maxAffected;\n const raw = rawNested !== undefined ? rawNested : cfg.correctionMaxAffected;\n if (raw === undefined || raw === null) return 10;\n const n = coerceNumber(raw);\n if (n === undefined || !Number.isFinite(n) || n < 1 || !Number.isInteger(n)) {\n throw new Error(`Invalid correction.maxAffected: expected an integer >= 1, got ${JSON.stringify(raw)}`);\n }\n return n;\n })(),\n correctionPlanTtlHours: (() => {\n const nested = (cfg.correction as Record<string, unknown> | undefined)?.planTtlHours;\n const fromNested = nested !== undefined ? coerceNumber(nested) : undefined;\n if (fromNested !== undefined && fromNested >= 1) return fromNested;\n if (nested !== undefined && fromNested === undefined) {\n throw new Error(`Invalid correction.planTtlHours: expected a number >= 1, got ${JSON.stringify(nested)}`);\n }\n if (fromNested !== undefined && fromNested < 1) {\n throw new Error(`Invalid correction.planTtlHours: expected a number >= 1, got ${JSON.stringify(nested)}`);\n }\n const fromFlat = coerceNumber(cfg.correctionPlanTtlHours);\n if (fromFlat !== undefined && fromFlat >= 1) return fromFlat;\n if (cfg.correctionPlanTtlHours !== undefined && fromFlat === undefined) {\n throw new Error(\n `Invalid correction.planTtlHours: expected a number >= 1, got ${JSON.stringify(cfg.correctionPlanTtlHours)}`\n );\n }\n if (fromFlat !== undefined && fromFlat < 1) {\n throw new Error(\n `Invalid correction.planTtlHours: expected a number >= 1, got ${JSON.stringify(cfg.correctionPlanTtlHours)}`\n );\n }\n return 24;\n })(),\n correctionClassifyTimeoutMs: (() => {\n const nested = (cfg.correction as Record<string, unknown> | undefined)?.classifyTimeoutMs;\n const raw = nested !== undefined ? nested : cfg.correctionClassifyTimeoutMs;\n if (raw === undefined || raw === null) return DEFAULT_CORRECTION_CLASSIFY_TIMEOUT_MS;\n const n = coerceNumber(raw);\n if (n === undefined || !Number.isInteger(n) || n < 1 || n > MAX_CORRECTION_CLASSIFY_TIMEOUT_MS) {\n throw new Error(\n `Invalid correction.classifyTimeoutMs: expected an integer from 1 to ${MAX_CORRECTION_CLASSIFY_TIMEOUT_MS}, got ${JSON.stringify(raw)}`\n );\n }\n return n;\n })(),\n };\n}\n"],"mappings":";;;;;;AAwGO,IAAM,oBAA+C;AAAA,EAC1D;AAAA,EAAQ;AAAA,EAAc;AAAA,EAAc;AAAA,EAAU;AAAA,EAC9C;AAAA,EAAgB;AAAA,EAAa;AAAA,EAAc;AAAA,EAC3C;AAAA,EAAS;AAAA,EAAQ;AAAA,EAAa;AAChC;AAiBO,IAAM,0BAA+D;AAAA,EAC1E;AA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,KAAK,UAAU,IAAI,sBAAsB,CAAC;AAAA,QAC5G;AAAA,MACF;AACA,aAAO;AAAA,IACT,GAAG;AAAA,IACH,8BAA8B,MAAM;AAClC,YAAM,SAAU,IAAI,YAAoD;AACxE,YAAM,MAAM,WAAW,SAAY,SAAS,IAAI;AAChD,UAAI,QAAQ,UAAa,QAAQ,KAAM,QAAO;AAC9C,YAAM,IAAI,aAAa,GAAG;AAC1B,UAAI,MAAM,UAAa,CAAC,OAAO,UAAU,CAAC,KAAK,IAAI,KAAK,IAAI,oCAAoC;AAC9F,cAAM,IAAI;AAAA,UACR,uEAAuE,kCAAkC,SAAS,KAAK,UAAU,GAAG,CAAC;AAAA,QACvI;AAAA,MACF;AACA,aAAO;AAAA,IACT,GAAG;AAAA,EACL;AACF;","names":[]}
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
WHO_KNOWS_DEFAULT_LIMIT,
|
|
3
3
|
WHO_KNOWS_MAX_LIMIT,
|
|
4
4
|
validateWhoKnowsInput
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-XQSJXNWC.js";
|
|
6
6
|
|
|
7
7
|
// src/who-knows-cli.ts
|
|
8
8
|
function extractWhoKnowsRawArgs(rest) {
|
|
@@ -74,4 +74,4 @@ export {
|
|
|
74
74
|
renderWhoKnowsText,
|
|
75
75
|
renderWhoKnows
|
|
76
76
|
};
|
|
77
|
-
//# sourceMappingURL=chunk-
|
|
77
|
+
//# sourceMappingURL=chunk-FC6RCOIU.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
rebuildMemoryProjection
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-SZXPKUMN.js";
|
|
4
4
|
|
|
5
5
|
// src/convergence-refresh.ts
|
|
6
6
|
async function refreshConvergedNamespaces(namespaces, namespaceSearchRouter, getStorage, searchEnabled) {
|
|
@@ -32,4 +32,4 @@ async function refreshConvergedNamespaces(namespaces, namespaceSearchRouter, get
|
|
|
32
32
|
export {
|
|
33
33
|
refreshConvergedNamespaces
|
|
34
34
|
};
|
|
35
|
-
//# sourceMappingURL=chunk-
|
|
35
|
+
//# sourceMappingURL=chunk-FLV7M7CT.js.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
+
import {
|
|
2
|
+
stampSpanSource,
|
|
3
|
+
verifySpanSource
|
|
4
|
+
} from "./chunk-A6CXG5WI.js";
|
|
1
5
|
import {
|
|
2
6
|
validateSpanOffsets
|
|
3
7
|
} from "./chunk-QJ2AX6DU.js";
|
|
4
8
|
import {
|
|
5
9
|
sliceSpanText
|
|
6
10
|
} from "./chunk-JE26AUX6.js";
|
|
7
|
-
import {
|
|
8
|
-
stampSpanSource,
|
|
9
|
-
verifySpanSource
|
|
10
|
-
} from "./chunk-A6CXG5WI.js";
|
|
11
11
|
import {
|
|
12
12
|
log
|
|
13
13
|
} from "./chunk-3WCASNQZ.js";
|
|
@@ -157,4 +157,4 @@ export {
|
|
|
157
157
|
spanAgreesWithContent,
|
|
158
158
|
applyExtractionSpanMaterialization
|
|
159
159
|
};
|
|
160
|
-
//# sourceMappingURL=chunk-
|
|
160
|
+
//# sourceMappingURL=chunk-FZVROZKC.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveDefaultNamespaceRoot,
|
|
3
3
|
resolveNamespaceStorageRoot
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-6KHF6PAB.js";
|
|
5
5
|
import {
|
|
6
6
|
MutationSerializer,
|
|
7
7
|
withHeldFileLock
|
|
@@ -1473,4 +1473,4 @@ export {
|
|
|
1473
1473
|
isNamespaceKind,
|
|
1474
1474
|
NamespaceCatalog
|
|
1475
1475
|
};
|
|
1476
|
-
//# sourceMappingURL=chunk-
|
|
1476
|
+
//# sourceMappingURL=chunk-GEGUBU3D.js.map
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
safeReadMemories
|
|
3
|
-
} from "./chunk-6JMQR72P.js";
|
|
4
1
|
import {
|
|
5
2
|
withBriefingFollowupTimeout
|
|
6
3
|
} from "./chunk-GZFKCLRC.js";
|
|
4
|
+
import {
|
|
5
|
+
safeReadMemories
|
|
6
|
+
} from "./chunk-6JMQR72P.js";
|
|
7
7
|
import {
|
|
8
8
|
StorageManager
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-37HCPM56.js";
|
|
10
10
|
import {
|
|
11
11
|
normalizeEntityName
|
|
12
12
|
} from "./chunk-YXZG5TVN.js";
|
|
13
|
-
import {
|
|
14
|
-
serializeMutations
|
|
15
|
-
} from "./chunk-FFAZ2XFU.js";
|
|
16
13
|
import {
|
|
17
14
|
extractJsonCandidates
|
|
18
15
|
} from "./chunk-YBA52OKG.js";
|
|
19
16
|
import {
|
|
20
17
|
excludeSupportPassportPrivateMemories
|
|
21
18
|
} from "./chunk-PWPIERBM.js";
|
|
19
|
+
import {
|
|
20
|
+
serializeMutations
|
|
21
|
+
} from "./chunk-FFAZ2XFU.js";
|
|
22
22
|
import {
|
|
23
23
|
readEnvVar,
|
|
24
24
|
resolveHomeDir
|
|
@@ -962,4 +962,4 @@ export {
|
|
|
962
962
|
resolveBriefingSaveDir,
|
|
963
963
|
briefingFilename
|
|
964
964
|
};
|
|
965
|
-
//# sourceMappingURL=chunk-
|
|
965
|
+
//# sourceMappingURL=chunk-GF4H3B3R.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
rebuildMemoryProjection,
|
|
3
3
|
watchProjectionRebuildParent
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-SZXPKUMN.js";
|
|
5
5
|
import {
|
|
6
6
|
initLogger,
|
|
7
7
|
log
|
|
@@ -77,4 +77,4 @@ if (invokedAsRunner) {
|
|
|
77
77
|
export {
|
|
78
78
|
PROJECTION_REBUILD_RUNNER_FLAG
|
|
79
79
|
};
|
|
80
|
-
//# sourceMappingURL=chunk-
|
|
80
|
+
//# sourceMappingURL=chunk-I56MTWE7.js.map
|
|
@@ -5,13 +5,13 @@ import {
|
|
|
5
5
|
coerceBooleanLike,
|
|
6
6
|
coerceNumber
|
|
7
7
|
} from "./chunk-PQVCH2AE.js";
|
|
8
|
+
import {
|
|
9
|
+
extractJsonCandidates
|
|
10
|
+
} from "./chunk-YBA52OKG.js";
|
|
8
11
|
import {
|
|
9
12
|
assertValidTimezone,
|
|
10
13
|
isValidActivityDate
|
|
11
14
|
} from "./chunk-353C5UNV.js";
|
|
12
|
-
import {
|
|
13
|
-
extractJsonCandidates
|
|
14
|
-
} from "./chunk-YBA52OKG.js";
|
|
15
15
|
import {
|
|
16
16
|
expandTildePath
|
|
17
17
|
} from "./chunk-6KH5NLQS.js";
|
|
@@ -1527,4 +1527,4 @@ export {
|
|
|
1527
1527
|
parseActivityConfig,
|
|
1528
1528
|
parseTimelineVaultConfig
|
|
1529
1529
|
};
|
|
1530
|
-
//# sourceMappingURL=chunk-
|
|
1530
|
+
//# sourceMappingURL=chunk-J5WI4QRP.js.map
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
} from "./chunk-3UXOZBHV.js";
|
|
15
15
|
import {
|
|
16
16
|
StorageManager
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-37HCPM56.js";
|
|
18
18
|
import {
|
|
19
19
|
OKF_PROFILE_TYPE,
|
|
20
20
|
okfTypeForMemory
|
|
@@ -272,4 +272,4 @@ export {
|
|
|
272
272
|
exportOkfBundle,
|
|
273
273
|
firstHeading
|
|
274
274
|
};
|
|
275
|
-
//# sourceMappingURL=chunk-
|
|
275
|
+
//# sourceMappingURL=chunk-JA54KIYD.js.map
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PROJECTION_REBUILD_RUNNER_FLAG
|
|
3
|
+
} from "./chunk-I56MTWE7.js";
|
|
1
4
|
import {
|
|
2
5
|
ensureContradictionScanCron,
|
|
3
6
|
ensureDaySummaryCron,
|
|
@@ -7,22 +10,19 @@ import {
|
|
|
7
10
|
ensureProceduralMiningCron,
|
|
8
11
|
graphEdgeDecayCadenceToCronExpr
|
|
9
12
|
} from "./chunk-666A3MOW.js";
|
|
10
|
-
import {
|
|
11
|
-
PROJECTION_REBUILD_RUNNER_FLAG
|
|
12
|
-
} from "./chunk-FMIVV5SV.js";
|
|
13
13
|
import {
|
|
14
14
|
startLocationAutoSync
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-SWRN6U7Q.js";
|
|
16
16
|
import {
|
|
17
17
|
rebuildMemoryLifecycleLedger
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-L2VS27PZ.js";
|
|
19
19
|
import {
|
|
20
20
|
planNamespaceMaintenance,
|
|
21
21
|
runNamespaceMaintenanceBatchPlan
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-QMFKW4OU.js";
|
|
23
23
|
import {
|
|
24
24
|
rebuildMemoryProjection
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-SZXPKUMN.js";
|
|
26
26
|
import {
|
|
27
27
|
DEFAULT_TIMELINE_CATEGORIES,
|
|
28
28
|
TIMELINE_RESERVED_IDLE,
|
|
@@ -33,13 +33,13 @@ import {
|
|
|
33
33
|
timelineAnalysisCompleteFromClients,
|
|
34
34
|
validateActivityBaseUrl,
|
|
35
35
|
validateTimelineCategories
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-J5WI4QRP.js";
|
|
37
37
|
import {
|
|
38
38
|
DEFAULT_PROJECTION_REBUILD_HEAP_USAGE_LIMIT
|
|
39
39
|
} from "./chunk-EWMRFW3F.js";
|
|
40
40
|
import {
|
|
41
41
|
LocalLlmClient
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-JXSYWTFK.js";
|
|
43
43
|
import {
|
|
44
44
|
FallbackLlmClient
|
|
45
45
|
} from "./chunk-TKC5LZ43.js";
|
|
@@ -2647,4 +2647,4 @@ export {
|
|
|
2647
2647
|
ActivitySyncScheduler,
|
|
2648
2648
|
MaintenanceScheduler
|
|
2649
2649
|
};
|
|
2650
|
-
//# sourceMappingURL=chunk-
|
|
2650
|
+
//# sourceMappingURL=chunk-JMF5Q4JY.js.map
|
|
@@ -1003,13 +1003,30 @@ var LocalLlmClient = class _LocalLlmClient {
|
|
|
1003
1003
|
if (options.priority) {
|
|
1004
1004
|
const priority = options.priority;
|
|
1005
1005
|
return await new Promise((resolve) => {
|
|
1006
|
-
|
|
1006
|
+
let settled = false;
|
|
1007
|
+
let onAbort;
|
|
1008
|
+
const finish = (value) => {
|
|
1009
|
+
if (settled) return;
|
|
1010
|
+
settled = true;
|
|
1011
|
+
if (onAbort) options.signal?.removeEventListener("abort", onAbort);
|
|
1012
|
+
resolve(value);
|
|
1013
|
+
};
|
|
1014
|
+
const queued = {
|
|
1007
1015
|
messages,
|
|
1008
1016
|
options,
|
|
1009
1017
|
priority,
|
|
1010
1018
|
enqueuedAtMs: Date.now(),
|
|
1011
|
-
resolve
|
|
1012
|
-
}
|
|
1019
|
+
resolve: finish
|
|
1020
|
+
};
|
|
1021
|
+
onAbort = () => {
|
|
1022
|
+
const queue = this.requestQueues[priority];
|
|
1023
|
+
const index = queue.indexOf(queued);
|
|
1024
|
+
if (index >= 0) queue.splice(index, 1);
|
|
1025
|
+
finish(null);
|
|
1026
|
+
};
|
|
1027
|
+
this.requestQueues[priority].push(queued);
|
|
1028
|
+
if (options.signal?.aborted) onAbort();
|
|
1029
|
+
else if (options.signal) options.signal.addEventListener("abort", onAbort, { once: true });
|
|
1013
1030
|
this.scheduleQueueDrain();
|
|
1014
1031
|
});
|
|
1015
1032
|
}
|
|
@@ -1050,4 +1067,4 @@ var LocalLlmClient = class _LocalLlmClient {
|
|
|
1050
1067
|
export {
|
|
1051
1068
|
LocalLlmClient
|
|
1052
1069
|
};
|
|
1053
|
-
//# sourceMappingURL=chunk-
|
|
1070
|
+
//# sourceMappingURL=chunk-JXSYWTFK.js.map
|