@remnic/core 1.1.2 → 1.1.4
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/abort-error.js +1 -0
- package/dist/abstraction-nodes.js +1 -0
- package/dist/access-audit.js +1 -0
- package/dist/access-cli.js +72 -47
- package/dist/access-cli.js.map +1 -1
- package/dist/access-http.d.ts +50 -5
- package/dist/access-http.js +39 -16
- package/dist/access-idempotency.js +1 -0
- package/dist/access-mcp.d.ts +10 -5
- package/dist/access-mcp.js +38 -14
- package/dist/access-schema.d.ts +133 -13
- package/dist/access-schema.js +20 -1
- package/dist/access-service-CtXFnprR.d.ts +2033 -0
- package/dist/access-service.d.ts +11 -6
- package/dist/access-service.js +40 -15
- package/dist/active-memory-bridge.js +1 -0
- package/dist/active-recall.js +1 -0
- package/dist/active-recall.js.map +1 -1
- package/dist/behavior-learner.js +1 -0
- package/dist/behavior-learner.js.map +1 -1
- package/dist/behavior-signals.js +1 -0
- package/dist/bootstrap.d.ts +6 -4
- package/dist/bootstrap.js +1 -0
- package/dist/boxes.js +1 -0
- package/dist/briefing.d.ts +9 -5
- package/dist/briefing.js +10 -7
- package/dist/buffer-surprise-report.js +1 -0
- package/dist/buffer-surprise.js +1 -0
- package/dist/buffer.d.ts +1 -1
- package/dist/buffer.js +1 -0
- package/dist/calibration.d.ts +8 -1
- package/dist/calibration.js +10 -2
- package/dist/calibration.js.map +1 -1
- package/dist/capsule-cli.d.ts +137 -0
- package/dist/capsule-cli.js +34 -0
- package/dist/capsule-crypto-5CYAGVC5.js +18 -0
- package/dist/capsule-export-NZQPOTQ4.js +17 -0
- package/dist/capsule-export-NZQPOTQ4.js.map +1 -0
- package/dist/capsule-import-SDCUXLEV.js +16 -0
- package/dist/capsule-import-SDCUXLEV.js.map +1 -0
- package/dist/capsule-merge-DI7PNQ2H.js +189 -0
- package/dist/capsule-merge-DI7PNQ2H.js.map +1 -0
- package/dist/causal-behavior.js +1 -0
- package/dist/causal-behavior.js.map +1 -1
- package/dist/causal-chain.js +1 -0
- package/dist/causal-consolidation.js +12 -9
- package/dist/causal-consolidation.js.map +1 -1
- package/dist/causal-retrieval.js +2 -1
- package/dist/causal-retrieval.js.map +1 -1
- package/dist/causal-trajectory-graph.js +4 -1
- package/dist/causal-trajectory-graph.js.map +1 -1
- package/dist/causal-trajectory.js +2 -1
- package/dist/chunk-2LSZVONP.js +67 -0
- package/dist/chunk-2LSZVONP.js.map +1 -0
- package/dist/chunk-32KD5IHZ.js +245 -0
- package/dist/chunk-32KD5IHZ.js.map +1 -0
- package/dist/chunk-3KIS4VGT.js +228 -0
- package/dist/chunk-3KIS4VGT.js.map +1 -0
- package/dist/chunk-3LCWFNVS.js +350 -0
- package/dist/chunk-3LCWFNVS.js.map +1 -0
- package/dist/chunk-43EKP2UK.js +26 -0
- package/dist/chunk-43EKP2UK.js.map +1 -0
- package/dist/chunk-457A4P3L.js +119 -0
- package/dist/chunk-457A4P3L.js.map +1 -0
- package/dist/{chunk-TMYO7B5P.js → chunk-47WOM4YW.js} +2 -2
- package/dist/{chunk-FVA6TGI3.js → chunk-52PDY6GD.js} +42 -2
- package/dist/chunk-52PDY6GD.js.map +1 -0
- package/dist/{chunk-ULYOGL6R.js → chunk-5HRY2WRF.js} +7 -3
- package/dist/chunk-5HRY2WRF.js.map +1 -0
- package/dist/{chunk-BOUYNNYD.js → chunk-67YLUWLG.js} +32 -13
- package/dist/{chunk-BOUYNNYD.js.map → chunk-67YLUWLG.js.map} +1 -1
- package/dist/chunk-6TBWYBJ3.js +236 -0
- package/dist/chunk-6TBWYBJ3.js.map +1 -0
- package/dist/chunk-74EMIVE4.js +329 -0
- package/dist/chunk-74EMIVE4.js.map +1 -0
- package/dist/chunk-74WWN7ZW.js +82 -0
- package/dist/chunk-74WWN7ZW.js.map +1 -0
- package/dist/chunk-A6XUJE5D.js +126 -0
- package/dist/chunk-A6XUJE5D.js.map +1 -0
- package/dist/{chunk-STGWEHYR.js → chunk-AEMBDV7M.js} +1187 -62
- package/dist/chunk-AEMBDV7M.js.map +1 -0
- package/dist/{chunk-PVICZTKG.js → chunk-AGZHRWPT.js} +5 -5
- package/dist/{chunk-PVICZTKG.js.map → chunk-AGZHRWPT.js.map} +1 -1
- package/dist/chunk-AJA46VX5.js +393 -0
- package/dist/chunk-AJA46VX5.js.map +1 -0
- package/dist/chunk-ASIQZXYO.js +277 -0
- package/dist/chunk-ASIQZXYO.js.map +1 -0
- package/dist/{chunk-DG6YMRDC.js → chunk-B2TL6GA2.js} +2 -2
- package/dist/chunk-BJMBJZ2Y.js +290 -0
- package/dist/chunk-BJMBJZ2Y.js.map +1 -0
- package/dist/chunk-BT7NVCML.js +79 -0
- package/dist/chunk-BT7NVCML.js.map +1 -0
- package/dist/chunk-CK5NTM2S.js +454 -0
- package/dist/chunk-CK5NTM2S.js.map +1 -0
- package/dist/{chunk-AYXIPSZO.js → chunk-CRU27Q4J.js} +2 -2
- package/dist/{chunk-UWB5LMWY.js → chunk-CUI2STX6.js} +526 -24
- package/dist/chunk-CUI2STX6.js.map +1 -0
- package/dist/{chunk-CUPFXL3J.js → chunk-EGEPUGN4.js} +4 -4
- package/dist/chunk-EGEPUGN4.js.map +1 -0
- package/dist/{chunk-3OGMS3PE.js → chunk-F5VQOQ2E.js} +3 -2
- package/dist/chunk-F5VQOQ2E.js.map +1 -0
- package/dist/chunk-FP2373TW.js +149 -0
- package/dist/chunk-FP2373TW.js.map +1 -0
- package/dist/{chunk-RBBWYEFJ.js → chunk-G2WADRQ3.js} +1 -1
- package/dist/chunk-G7D6GZ5J.js +48 -0
- package/dist/chunk-G7D6GZ5J.js.map +1 -0
- package/dist/chunk-H7XKCNR6.js +60 -0
- package/dist/chunk-H7XKCNR6.js.map +1 -0
- package/dist/{chunk-LOIMBRDE.js → chunk-HIRKCQGF.js} +1994 -412
- package/dist/chunk-HIRKCQGF.js.map +1 -0
- package/dist/chunk-IXEJRKCZ.js +18 -0
- package/dist/chunk-IXEJRKCZ.js.map +1 -0
- package/dist/chunk-IYY4MCPG.js +275 -0
- package/dist/chunk-IYY4MCPG.js.map +1 -0
- package/dist/{chunk-BECYBZLX.js → chunk-JWSENLQI.js} +502 -22
- package/dist/chunk-JWSENLQI.js.map +1 -0
- package/dist/chunk-KNKUID7G.js +183 -0
- package/dist/chunk-KNKUID7G.js.map +1 -0
- package/dist/chunk-L2IO2QPY.js +2036 -0
- package/dist/chunk-L2IO2QPY.js.map +1 -0
- package/dist/{chunk-ZAIM4TUE.js → chunk-LW2NMHDW.js} +46 -1
- package/dist/chunk-LW2NMHDW.js.map +1 -0
- package/dist/chunk-MDYG7VI7.js +48 -0
- package/dist/chunk-MDYG7VI7.js.map +1 -0
- package/dist/{chunk-VDX363PS.js → chunk-MUELDH4F.js} +10 -3
- package/dist/chunk-MUELDH4F.js.map +1 -0
- package/dist/chunk-MXC3AP5I.js +74 -0
- package/dist/chunk-MXC3AP5I.js.map +1 -0
- package/dist/chunk-NN3TS5BM.js +147 -0
- package/dist/chunk-NN3TS5BM.js.map +1 -0
- package/dist/{chunk-3YGHKTBF.js → chunk-NZS2BLTP.js} +963 -326
- package/dist/chunk-NZS2BLTP.js.map +1 -0
- package/dist/chunk-OA3L7BFR.js +183 -0
- package/dist/chunk-OA3L7BFR.js.map +1 -0
- package/dist/chunk-OZHRDTDX.js +240 -0
- package/dist/chunk-OZHRDTDX.js.map +1 -0
- package/dist/chunk-PCUKNJAZ.js +165 -0
- package/dist/chunk-PCUKNJAZ.js.map +1 -0
- package/dist/{chunk-6PFRXT4K.js → chunk-PFV5C235.js} +11 -6
- package/dist/chunk-PFV5C235.js.map +1 -0
- package/dist/chunk-PZ5AY32C.js +10 -0
- package/dist/chunk-PZ5AY32C.js.map +1 -0
- package/dist/{chunk-Y7R2XJ5Q.js → chunk-Q7FJ5ZHM.js} +6 -2
- package/dist/chunk-Q7FJ5ZHM.js.map +1 -0
- package/dist/{chunk-WCLICCGB.js → chunk-RILIVK4O.js} +91 -4
- package/dist/chunk-RILIVK4O.js.map +1 -0
- package/dist/{chunk-C2EFFULQ.js → chunk-RK2Y4XOM.js} +163 -20
- package/dist/chunk-RK2Y4XOM.js.map +1 -0
- package/dist/{chunk-TP4FZJIZ.js → chunk-RULE4VG5.js} +5 -1
- package/dist/chunk-RULE4VG5.js.map +1 -0
- package/dist/{chunk-PVPWZSSI.js → chunk-SMA4IMHV.js} +19 -3
- package/dist/chunk-SMA4IMHV.js.map +1 -0
- package/dist/{chunk-6YJHX2DL.js → chunk-TIFRGAKO.js} +242 -22
- package/dist/chunk-TIFRGAKO.js.map +1 -0
- package/dist/chunk-TUFG6VXY.js +875 -0
- package/dist/chunk-TUFG6VXY.js.map +1 -0
- package/dist/chunk-TYEOAFH3.js +251 -0
- package/dist/chunk-TYEOAFH3.js.map +1 -0
- package/dist/chunk-UKJAGEXH.js +260 -0
- package/dist/chunk-UKJAGEXH.js.map +1 -0
- package/dist/{chunk-KVBLZUKV.js → chunk-USFPPRAF.js} +93 -3
- package/dist/chunk-USFPPRAF.js.map +1 -0
- package/dist/{chunk-NBVAS5MT.js → chunk-V7TEH5I2.js} +6 -6
- package/dist/{chunk-GA5P7RST.js → chunk-VTJVUHRK.js} +22 -36
- package/dist/chunk-VTJVUHRK.js.map +1 -0
- package/dist/{chunk-SPI27QT6.js → chunk-W7WWT4FJ.js} +9 -4
- package/dist/chunk-W7WWT4FJ.js.map +1 -0
- package/dist/chunk-WIICJPET.js +45 -0
- package/dist/chunk-WIICJPET.js.map +1 -0
- package/dist/{chunk-VBVG2M5G.js → chunk-WPGJYVUH.js} +6 -2
- package/dist/chunk-WPGJYVUH.js.map +1 -0
- package/dist/{chunk-4HQS2HPX.js → chunk-WSZIHQBK.js} +29 -9
- package/dist/{chunk-4HQS2HPX.js.map → chunk-WSZIHQBK.js.map} +1 -1
- package/dist/{chunk-NZLQTHS5.js → chunk-WW3QQF4H.js} +4 -1
- package/dist/chunk-WW3QQF4H.js.map +1 -0
- package/dist/{chunk-DIXB44VE.js → chunk-X6VBWOVZ.js} +28 -13
- package/dist/chunk-X6VBWOVZ.js.map +1 -0
- package/dist/{chunk-XXVWLXSG.js → chunk-XQ4EJLUD.js} +64 -92
- package/dist/chunk-XQ4EJLUD.js.map +1 -0
- package/dist/{chunk-OC5OXUQ4.js → chunk-XRCYKJ3V.js} +780 -17
- package/dist/chunk-XRCYKJ3V.js.map +1 -0
- package/dist/{chunk-F5VP6YCB.js → chunk-Y4A6M3B6.js} +573 -156
- package/dist/chunk-Y4A6M3B6.js.map +1 -0
- package/dist/chunk-YNJHCGDT.js +309 -0
- package/dist/chunk-YNJHCGDT.js.map +1 -0
- package/dist/{chunk-L7IXWRYE.js → chunk-ZIBOQULP.js} +22 -13
- package/dist/chunk-ZIBOQULP.js.map +1 -0
- package/dist/{chunk-W6SL7OFG.js → chunk-ZTSE2ZJ6.js} +12 -2
- package/dist/{chunk-W6SL7OFG.js.map → chunk-ZTSE2ZJ6.js.map} +1 -1
- package/dist/chunking.js +1 -0
- package/dist/cipher-GVE2GQ5H.js +28 -0
- package/dist/cipher-GVE2GQ5H.js.map +1 -0
- package/dist/citations.js +1 -0
- package/dist/{cli-BkeRaYfk.d.ts → cli-lMql2FCr.d.ts} +26 -7
- package/dist/cli.d.ts +11 -6
- package/dist/cli.js +69 -34
- package/dist/codex-thread-key.js +1 -0
- package/dist/commitment-ledger.js +1 -0
- package/dist/compression-optimizer.js +1 -0
- package/dist/config.d.ts +2 -1
- package/dist/config.js +4 -1
- package/dist/connectors-cli-DFGtY2DB.d.ts +257 -0
- package/dist/connectors-cli.d.ts +2 -0
- package/dist/connectors-cli.js +22 -0
- package/dist/connectors-cli.js.map +1 -0
- package/dist/consolidation-operator.d.ts +65 -5
- package/dist/consolidation-operator.js +6 -1
- package/dist/consolidation-provenance-check.d.ts +1 -1
- package/dist/consolidation-provenance-check.js +3 -2
- package/dist/consolidation-undo.d.ts +1 -1
- package/dist/consolidation-undo.js +1 -0
- package/dist/consolidation-undo.js.map +1 -1
- package/dist/{contradiction-review-WIUBAR52.js → contradiction-review-5LTTVDQV.js} +2 -1
- package/dist/contradiction-review-5LTTVDQV.js.map +1 -0
- package/dist/{contradiction-scan-E3GJTI4F.js → contradiction-scan-3Z6YW7YA.js} +2 -1
- package/dist/{contradiction-scan-E3GJTI4F.js.map → contradiction-scan-3Z6YW7YA.js.map} +1 -1
- package/dist/cross-namespace-budget.js +1 -0
- package/dist/cue-anchors.js +1 -0
- package/dist/dashboard-runtime.js +1 -0
- package/dist/day-summary.js +1 -0
- package/dist/delinearize.js +1 -0
- package/dist/direct-answer-wiring.js +1 -0
- package/dist/direct-answer.js +1 -0
- package/dist/dreams-ledger-LR2NBAZE.js +286 -0
- package/dist/dreams-ledger-LR2NBAZE.js.map +1 -0
- package/dist/embedding-fallback.js +1 -0
- package/dist/engine-O6YWKQM3.js +28 -0
- package/dist/engine-O6YWKQM3.js.map +1 -0
- package/dist/entity-retrieval.d.ts +1 -1
- package/dist/entity-retrieval.js +10 -7
- package/dist/entity-schema.js +1 -0
- package/dist/evals.js +1 -0
- package/dist/evidence-pack.d.ts +16 -0
- package/dist/evidence-pack.js +8 -0
- package/dist/evidence-pack.js.map +1 -0
- package/dist/explicit-capture.d.ts +6 -4
- package/dist/explicit-capture.js +1 -0
- package/dist/extraction-judge-telemetry.js +1 -0
- package/dist/extraction-judge-training.js +1 -0
- package/dist/extraction-judge.js +1 -0
- package/dist/extraction.js +8 -7
- package/dist/fallback-llm.js +3 -2
- package/dist/first-start-migration-4MHQEOSD.js +263 -0
- package/dist/first-start-migration-4MHQEOSD.js.map +1 -0
- package/dist/forget-PLR6J5DN.js +69 -0
- package/dist/forget-PLR6J5DN.js.map +1 -0
- package/dist/framework-CyHYDcri.d.ts +153 -0
- package/dist/fs-utils-IRVUFB6G.js +30 -0
- package/dist/fs-utils-IRVUFB6G.js.map +1 -0
- package/dist/graph-dashboard-diff.js +1 -0
- package/dist/graph-dashboard-key.js +1 -0
- package/dist/graph-dashboard-parser.js +1 -0
- package/dist/graph-edge-decay-PWB63GRE.js +207 -0
- package/dist/graph-edge-decay-PWB63GRE.js.map +1 -0
- package/dist/graph-edge-reinforcement.d.ts +81 -0
- package/dist/graph-edge-reinforcement.js +24 -0
- package/dist/graph-edge-reinforcement.js.map +1 -0
- package/dist/graph-events.d.ts +87 -0
- package/dist/graph-events.js +14 -0
- package/dist/graph-events.js.map +1 -0
- package/dist/graph-recall.js +1 -0
- package/dist/graph-retrieval.js +1 -0
- package/dist/graph-snapshot.d.ts +112 -0
- package/dist/graph-snapshot.js +19 -0
- package/dist/graph-snapshot.js.map +1 -0
- package/dist/graph.d.ts +105 -7
- package/dist/graph.js +20 -3
- package/dist/harmonic-retrieval.js +1 -0
- package/dist/himem.js +1 -0
- package/dist/hygiene.js +1 -0
- package/dist/identity-continuity.js +1 -0
- package/dist/importance.js +1 -0
- package/dist/index.d.ts +574 -13
- package/dist/index.js +337 -69
- package/dist/index.js.map +1 -1
- package/dist/intent.js +1 -0
- package/dist/json-extract.js +1 -0
- package/dist/json-store.js +1 -0
- package/dist/kdf-7S6RWKLZ.js +26 -0
- package/dist/kdf-7S6RWKLZ.js.map +1 -0
- package/dist/legacy-hook-compat.js +1 -0
- package/dist/legacy-hook-compat.js.map +1 -1
- package/dist/lifecycle.js +1 -0
- package/dist/live-connectors-runner.d.ts +48 -0
- package/dist/live-connectors-runner.js +17 -0
- package/dist/live-connectors-runner.js.map +1 -0
- package/dist/local-llm.js +1 -0
- package/dist/logger.js +1 -0
- package/dist/memory-action-policy.js +1 -0
- package/dist/memory-cache.d.ts +2 -1
- package/dist/memory-cache.js +4 -1
- package/dist/memory-governance-JZHZDOLN.js +37 -0
- package/dist/memory-governance-JZHZDOLN.js.map +1 -0
- package/dist/memory-lifecycle-ledger-utils.d.ts +2 -1
- package/dist/memory-lifecycle-ledger-utils.js +4 -1
- package/dist/memory-projection-format.js +1 -0
- package/dist/{memory-projection-store-DeSXPh1j.d.ts → memory-projection-store-CY8TU40w.d.ts} +2 -1
- package/dist/memory-projection-store.d.ts +1 -1
- package/dist/memory-projection-store.js +2 -1
- package/dist/memory-worth-bench.js +1 -0
- package/dist/memory-worth-bench.js.map +1 -1
- package/dist/memory-worth-filter.js +1 -0
- package/dist/memory-worth-outcomes.d.ts +1 -1
- package/dist/memory-worth-outcomes.js +1 -0
- package/dist/memory-worth.js +1 -0
- package/dist/metadata-FC3XPDRQ.js +21 -0
- package/dist/metadata-FC3XPDRQ.js.map +1 -0
- package/dist/migrate-from-identity-anchor-TTEDEJGX.js +8 -0
- package/dist/migrate-from-identity-anchor-TTEDEJGX.js.map +1 -0
- package/dist/model-registry.js +1 -0
- package/dist/models-json.js +1 -0
- package/dist/native-knowledge.js +1 -0
- package/dist/negative.js +1 -0
- package/dist/objective-state-writers.js +1 -0
- package/dist/objective-state-writers.js.map +1 -1
- package/dist/objective-state.js +1 -0
- package/dist/openai-chat-compat.js +1 -0
- package/dist/operator-toolkit.d.ts +46 -2
- package/dist/operator-toolkit.js +29 -17
- package/dist/opik-exporter.js +1 -0
- package/dist/opik-exporter.js.map +1 -1
- package/dist/{orchestrator-CmJ-NTdJ.d.ts → orchestrator-ChkesB8U.d.ts} +177 -13
- package/dist/orchestrator.d.ts +6 -4
- package/dist/orchestrator.js +57 -41
- package/dist/page-versioning.js +1 -0
- package/dist/path-RMTY5Y5A.js +9 -0
- package/dist/path-RMTY5Y5A.js.map +1 -0
- package/dist/patterns-cli.d.ts +160 -0
- package/dist/patterns-cli.js +29 -0
- package/dist/patterns-cli.js.map +1 -0
- package/dist/peers-6OSQ3NK6.js +44 -0
- package/dist/peers-6OSQ3NK6.js.map +1 -0
- package/dist/plugin-id.js +1 -0
- package/dist/policy-runtime.js +1 -0
- package/dist/{port-BADbLZU5.d.ts → port-hqGnoStS.d.ts} +6 -0
- package/dist/profiling.js +1 -0
- package/dist/purge-6ATBGT77.js +205 -0
- package/dist/purge-6ATBGT77.js.map +1 -0
- package/dist/qmd-recall-cache.d.ts +1 -1
- package/dist/qmd-recall-cache.js +1 -0
- package/dist/qmd.d.ts +2 -1
- package/dist/qmd.js +4 -3
- package/dist/reasoning-trace-recall.js +1 -0
- package/dist/reasoning-trace-types.js +1 -0
- package/dist/recall-audit-anomaly.js +1 -0
- package/dist/recall-audit.js +1 -0
- package/dist/recall-disclosure-escalation.d.ts +84 -0
- package/dist/recall-disclosure-escalation.js +14 -0
- package/dist/recall-disclosure-escalation.js.map +1 -0
- package/dist/recall-explain-renderer.js +4 -1
- package/dist/recall-mmr.js +1 -0
- package/dist/recall-qos.js +1 -0
- package/dist/recall-query-policy.js +1 -0
- package/dist/recall-state.d.ts +7 -0
- package/dist/recall-state.js +2 -1
- package/dist/recall-tag-filter.d.ts +56 -0
- package/dist/recall-tag-filter.js +14 -0
- package/dist/recall-tag-filter.js.map +1 -0
- package/dist/recall-tokenization.js +1 -0
- package/dist/recall-xray-cli.d.ts +9 -2
- package/dist/recall-xray-cli.js +9 -4
- package/dist/recall-xray-renderer.js +4 -1
- package/dist/recall-xray.d.ts +116 -2
- package/dist/recall-xray.js +9 -3
- package/dist/reconstruct.js +1 -0
- package/dist/release-changelog.js +2 -0
- package/dist/release-changelog.js.map +1 -1
- package/dist/relevance.js +1 -0
- package/dist/rerank.js +1 -0
- package/dist/{resolution-QBTDHTG7.js → resolution-YGIBORXI.js} +2 -1
- package/dist/{resolution-QBTDHTG7.js.map → resolution-YGIBORXI.js.map} +1 -1
- package/dist/resolve-auth-token.d.ts +51 -0
- package/dist/resolve-auth-token.js +12 -0
- package/dist/resolve-auth-token.js.map +1 -0
- package/dist/resolve-provider-secret.d.ts +9 -1
- package/dist/resolve-provider-secret.js +4 -1
- package/dist/resume-bundles.js +4 -3
- package/dist/retrieval-agents.d.ts +1 -1
- package/dist/retrieval-agents.js +1 -0
- package/dist/retrieval-tiers.js +1 -0
- package/dist/retrieval.js +1 -0
- package/dist/sanitize.js +1 -0
- package/dist/schemas.d.ts +15 -2
- package/dist/schemas.js +2 -1
- package/dist/sdk-compat.js +1 -0
- package/dist/sdk-compat.js.map +1 -1
- package/dist/secure-store-4R2GSO7S.js +156 -0
- package/dist/secure-store-4R2GSO7S.js.map +1 -0
- package/dist/semantic-chunking.js +1 -0
- package/dist/{semantic-consolidation-CxJU6MJk.d.ts → semantic-consolidation-ByBXb-sf.d.ts} +3 -3
- package/dist/semantic-consolidation.d.ts +2 -2
- package/dist/semantic-consolidation.js +12 -7
- package/dist/semantic-rule-promotion.d.ts +1 -1
- package/dist/semantic-rule-promotion.js +10 -7
- package/dist/semantic-rule-verifier.d.ts +1 -1
- package/dist/semantic-rule-verifier.js +10 -7
- package/dist/session-integrity.js +1 -0
- package/dist/session-observer-bands.js +1 -0
- package/dist/session-observer-state.js +1 -0
- package/dist/session-toggles.js +2 -0
- package/dist/session-toggles.js.map +1 -1
- package/dist/signal.js +1 -0
- package/dist/skills-registry.js +2 -0
- package/dist/skills-registry.js.map +1 -1
- package/dist/source-attribution.js +1 -0
- package/dist/state-NCHQ4TRG.js +8 -0
- package/dist/state-NCHQ4TRG.js.map +1 -0
- package/dist/state-store-3EH7HYIN.js +16 -0
- package/dist/state-store-3EH7HYIN.js.map +1 -0
- package/dist/storage.d.ts +76 -2
- package/dist/storage.js +9 -6
- package/dist/store-contract.js +1 -0
- package/dist/summarizer.js +5 -4
- package/dist/summary-snapshot.js +1 -0
- package/dist/temporal-index.js +1 -0
- package/dist/temporal-supersession.d.ts +1 -1
- package/dist/temporal-supersession.js +2 -1
- package/dist/temporal-validity.d.ts +52 -0
- package/dist/temporal-validity.js +14 -0
- package/dist/temporal-validity.js.map +1 -0
- package/dist/threading.js +1 -0
- package/dist/tier-migration.d.ts +2 -2
- package/dist/tier-migration.js +1 -0
- package/dist/tier-routing.js +1 -0
- package/dist/tier-stats-62ZVDFKS.js +152 -0
- package/dist/tier-stats-62ZVDFKS.js.map +1 -0
- package/dist/tmt.js +1 -0
- package/dist/tokens.js +1 -0
- package/dist/topics.js +1 -0
- package/dist/trace-C5ETWBEF.js +290 -0
- package/dist/trace-C5ETWBEF.js.map +1 -0
- package/dist/transcript.js +1 -0
- package/dist/trust-zones.js +1 -0
- package/dist/tui-RI7P6PBS.js +13 -0
- package/dist/tui-RI7P6PBS.js.map +1 -0
- package/dist/types-V3FJ26TF.js +30 -0
- package/dist/types-V3FJ26TF.js.map +1 -0
- package/dist/types.d.ts +634 -9
- package/dist/types.js +10 -3
- package/dist/utility-learner.js +1 -0
- package/dist/utility-runtime.js +1 -0
- package/dist/utility-telemetry.js +1 -0
- package/dist/verified-recall.js +10 -7
- package/dist/version-utils.js +1 -0
- package/dist/whitespace.js +1 -0
- package/dist/work-product-ledger.js +1 -0
- package/package.json +7 -3
- package/scripts/ensure-better-sqlite3.mjs +124 -0
- package/dist/access-service-Br8ZydTK.d.ts +0 -827
- package/dist/chunk-3OGMS3PE.js.map +0 -1
- package/dist/chunk-3YGHKTBF.js.map +0 -1
- package/dist/chunk-6PFRXT4K.js.map +0 -1
- package/dist/chunk-6YJHX2DL.js.map +0 -1
- package/dist/chunk-BECYBZLX.js.map +0 -1
- package/dist/chunk-C2EFFULQ.js.map +0 -1
- package/dist/chunk-CUPFXL3J.js.map +0 -1
- package/dist/chunk-DIXB44VE.js.map +0 -1
- package/dist/chunk-F5VP6YCB.js.map +0 -1
- package/dist/chunk-FVA6TGI3.js.map +0 -1
- package/dist/chunk-GA5P7RST.js.map +0 -1
- package/dist/chunk-KVBLZUKV.js.map +0 -1
- package/dist/chunk-L7IXWRYE.js.map +0 -1
- package/dist/chunk-LOIMBRDE.js.map +0 -1
- package/dist/chunk-LTCGGW2D.js +0 -14
- package/dist/chunk-LTCGGW2D.js.map +0 -1
- package/dist/chunk-NZLQTHS5.js.map +0 -1
- package/dist/chunk-OC5OXUQ4.js.map +0 -1
- package/dist/chunk-PVPWZSSI.js.map +0 -1
- package/dist/chunk-SPI27QT6.js.map +0 -1
- package/dist/chunk-STGWEHYR.js.map +0 -1
- package/dist/chunk-TP4FZJIZ.js.map +0 -1
- package/dist/chunk-ULYOGL6R.js.map +0 -1
- package/dist/chunk-UWB5LMWY.js.map +0 -1
- package/dist/chunk-VBVG2M5G.js.map +0 -1
- package/dist/chunk-VDX363PS.js.map +0 -1
- package/dist/chunk-WCLICCGB.js.map +0 -1
- package/dist/chunk-X6GF3FX2.js +0 -26
- package/dist/chunk-X6GF3FX2.js.map +0 -1
- package/dist/chunk-XXVWLXSG.js.map +0 -1
- package/dist/chunk-Y7R2XJ5Q.js.map +0 -1
- package/dist/chunk-ZAIM4TUE.js.map +0 -1
- package/dist/engine-72LSIWQP.js +0 -23
- /package/dist/{contradiction-review-WIUBAR52.js.map → capsule-cli.js.map} +0 -0
- /package/dist/{engine-72LSIWQP.js.map → capsule-crypto-5CYAGVC5.js.map} +0 -0
- /package/dist/{chunk-TMYO7B5P.js.map → chunk-47WOM4YW.js.map} +0 -0
- /package/dist/{chunk-DG6YMRDC.js.map → chunk-B2TL6GA2.js.map} +0 -0
- /package/dist/{chunk-AYXIPSZO.js.map → chunk-CRU27Q4J.js.map} +0 -0
- /package/dist/{chunk-RBBWYEFJ.js.map → chunk-G2WADRQ3.js.map} +0 -0
- /package/dist/{chunk-NBVAS5MT.js.map → chunk-V7TEH5I2.js.map} +0 -0
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import {
|
|
2
|
+
applyUtilityPromotionRuntimePolicy,
|
|
3
|
+
loadUtilityRuntimeValues
|
|
4
|
+
} from "./chunk-FSFEQI74.js";
|
|
5
|
+
import {
|
|
6
|
+
computeTierValueScore,
|
|
7
|
+
decideTierTransition
|
|
8
|
+
} from "./chunk-S75M5ZRK.js";
|
|
9
|
+
import "./chunk-PYXS46O7.js";
|
|
10
|
+
import "./chunk-3QKK7QOS.js";
|
|
11
|
+
import {
|
|
12
|
+
computeLifecycleValueInputs
|
|
13
|
+
} from "./chunk-TBBDFYXW.js";
|
|
14
|
+
import "./chunk-DGXUHMOV.js";
|
|
15
|
+
import "./chunk-LPSF4OQH.js";
|
|
16
|
+
import "./chunk-PZ5AY32C.js";
|
|
17
|
+
|
|
18
|
+
// src/maintenance/tier-stats.ts
|
|
19
|
+
async function readTierVisibleMemories(storage) {
|
|
20
|
+
const [hotMemories, coldMemories] = await Promise.all([
|
|
21
|
+
storage.readAllMemories(),
|
|
22
|
+
storage.readAllColdMemories()
|
|
23
|
+
]);
|
|
24
|
+
return [
|
|
25
|
+
...hotMemories.map((memory) => ({ memory, tier: "hot" })),
|
|
26
|
+
...coldMemories.map((memory) => ({ memory, tier: "cold" }))
|
|
27
|
+
];
|
|
28
|
+
}
|
|
29
|
+
async function tierRoutingPolicyFromConfig(config) {
|
|
30
|
+
const basePolicy = {
|
|
31
|
+
enabled: config.qmdTierMigrationEnabled,
|
|
32
|
+
demotionMinAgeDays: config.qmdTierDemotionMinAgeDays,
|
|
33
|
+
demotionValueThreshold: config.qmdTierDemotionValueThreshold,
|
|
34
|
+
promotionValueThreshold: config.qmdTierPromotionValueThreshold
|
|
35
|
+
};
|
|
36
|
+
const runtime = await loadUtilityRuntimeValues({
|
|
37
|
+
memoryDir: config.memoryDir,
|
|
38
|
+
memoryUtilityLearningEnabled: config.memoryUtilityLearningEnabled,
|
|
39
|
+
promotionByOutcomeEnabled: config.promotionByOutcomeEnabled
|
|
40
|
+
});
|
|
41
|
+
return applyUtilityPromotionRuntimePolicy(basePolicy, runtime);
|
|
42
|
+
}
|
|
43
|
+
async function summarizeTiers(storage) {
|
|
44
|
+
const all = await readTierVisibleMemories(storage);
|
|
45
|
+
const summary = {
|
|
46
|
+
total: all.length,
|
|
47
|
+
byTier: { hot: 0, cold: 0 },
|
|
48
|
+
byStatus: {},
|
|
49
|
+
forgottenCount: 0,
|
|
50
|
+
byCategory: {}
|
|
51
|
+
};
|
|
52
|
+
for (const { memory: m, tier } of all) {
|
|
53
|
+
summary.byTier[tier] += 1;
|
|
54
|
+
const status = m.frontmatter.status ?? "active";
|
|
55
|
+
summary.byStatus[status] = (summary.byStatus[status] ?? 0) + 1;
|
|
56
|
+
if (status === "forgotten") summary.forgottenCount += 1;
|
|
57
|
+
const cat = m.frontmatter.category ?? "(uncategorized)";
|
|
58
|
+
summary.byCategory[cat] = (summary.byCategory[cat] ?? 0) + 1;
|
|
59
|
+
}
|
|
60
|
+
return summary;
|
|
61
|
+
}
|
|
62
|
+
async function explainTierForMemory(storage, id, config) {
|
|
63
|
+
const trimmed = typeof id === "string" ? id.trim() : "";
|
|
64
|
+
if (trimmed.length === 0) {
|
|
65
|
+
throw new Error("tier explain: memory id is required and must be non-empty");
|
|
66
|
+
}
|
|
67
|
+
const all = await readTierVisibleMemories(storage);
|
|
68
|
+
const entry = all.find(({ memory: m }) => m.frontmatter.id === trimmed);
|
|
69
|
+
if (!entry) {
|
|
70
|
+
throw new Error(`tier explain: memory not found: ${trimmed}`);
|
|
71
|
+
}
|
|
72
|
+
const { memory, tier: currentTier } = entry;
|
|
73
|
+
const now = /* @__PURE__ */ new Date();
|
|
74
|
+
const valueInputs = computeLifecycleValueInputs(memory, now);
|
|
75
|
+
const valueScore = computeTierValueScore(memory, now);
|
|
76
|
+
const policy = await tierRoutingPolicyFromConfig(config);
|
|
77
|
+
const decision = decideTierTransition(memory, currentTier, policy, now);
|
|
78
|
+
const fm = memory.frontmatter;
|
|
79
|
+
return {
|
|
80
|
+
id: trimmed,
|
|
81
|
+
path: memory.path,
|
|
82
|
+
currentTier,
|
|
83
|
+
status: typeof fm.status === "string" ? fm.status : "active",
|
|
84
|
+
category: typeof fm.category === "string" ? fm.category : "",
|
|
85
|
+
valueScore,
|
|
86
|
+
decision,
|
|
87
|
+
signals: {
|
|
88
|
+
confidence: valueInputs.confidence,
|
|
89
|
+
accessCount: typeof fm.accessCount === "number" ? fm.accessCount : 0,
|
|
90
|
+
lastAccessed: typeof fm.lastAccessed === "string" ? fm.lastAccessed : null,
|
|
91
|
+
created: typeof fm.created === "string" ? fm.created : "",
|
|
92
|
+
updated: typeof fm.updated === "string" ? fm.updated : "",
|
|
93
|
+
importance: valueInputs.importance,
|
|
94
|
+
feedback: valueInputs.feedback
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
function formatTierSummaryText(summary) {
|
|
99
|
+
const lines = [];
|
|
100
|
+
lines.push("=== Memory Tier Distribution ===");
|
|
101
|
+
lines.push(`Total memories: ${summary.total}`);
|
|
102
|
+
lines.push("");
|
|
103
|
+
lines.push("Tier:");
|
|
104
|
+
lines.push(` hot: ${summary.byTier.hot}`);
|
|
105
|
+
lines.push(` cold: ${summary.byTier.cold}`);
|
|
106
|
+
lines.push("");
|
|
107
|
+
lines.push("Status:");
|
|
108
|
+
const statusEntries = Object.entries(summary.byStatus).sort(
|
|
109
|
+
(a, b) => b[1] - a[1] || a[0].localeCompare(b[0])
|
|
110
|
+
);
|
|
111
|
+
for (const [status, count] of statusEntries) {
|
|
112
|
+
lines.push(` ${status}: ${count}`);
|
|
113
|
+
}
|
|
114
|
+
lines.push("");
|
|
115
|
+
lines.push("Top categories:");
|
|
116
|
+
const categoryEntries = Object.entries(summary.byCategory).sort((a, b) => b[1] - a[1] || a[0].localeCompare(b[0])).slice(0, 8);
|
|
117
|
+
for (const [cat, count] of categoryEntries) {
|
|
118
|
+
lines.push(` ${cat}: ${count}`);
|
|
119
|
+
}
|
|
120
|
+
return lines.join("\n");
|
|
121
|
+
}
|
|
122
|
+
function formatTierExplainText(explain) {
|
|
123
|
+
const lines = [];
|
|
124
|
+
lines.push(`=== Tier Explain: ${explain.id} ===`);
|
|
125
|
+
lines.push(`path: ${explain.path}`);
|
|
126
|
+
lines.push(`current tier: ${explain.currentTier}`);
|
|
127
|
+
lines.push(`status: ${explain.status}`);
|
|
128
|
+
lines.push(`category: ${explain.category}`);
|
|
129
|
+
lines.push(`value score: ${explain.valueScore.toFixed(3)}`);
|
|
130
|
+
lines.push("");
|
|
131
|
+
lines.push("Tier-transition decision:");
|
|
132
|
+
lines.push(` next tier: ${explain.decision.nextTier}`);
|
|
133
|
+
lines.push(` changed: ${explain.decision.changed}`);
|
|
134
|
+
lines.push(` reason: ${explain.decision.reason}`);
|
|
135
|
+
lines.push("");
|
|
136
|
+
lines.push("Signals:");
|
|
137
|
+
lines.push(` confidence: ${explain.signals.confidence}`);
|
|
138
|
+
lines.push(` accessCount: ${explain.signals.accessCount}`);
|
|
139
|
+
lines.push(` lastAccessed: ${explain.signals.lastAccessed ?? "(never)"}`);
|
|
140
|
+
lines.push(` created: ${explain.signals.created}`);
|
|
141
|
+
lines.push(` updated: ${explain.signals.updated}`);
|
|
142
|
+
lines.push(` importance: ${explain.signals.importance}`);
|
|
143
|
+
lines.push(` feedback: ${explain.signals.feedback}`);
|
|
144
|
+
return lines.join("\n");
|
|
145
|
+
}
|
|
146
|
+
export {
|
|
147
|
+
explainTierForMemory,
|
|
148
|
+
formatTierExplainText,
|
|
149
|
+
formatTierSummaryText,
|
|
150
|
+
summarizeTiers
|
|
151
|
+
};
|
|
152
|
+
//# sourceMappingURL=tier-stats-62ZVDFKS.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/maintenance/tier-stats.ts"],"sourcesContent":["/**\n * Operator-facing tier visibility (issue #686 PR 5/6).\n *\n * Two read-only surfaces:\n *\n * - `summarizeTiers(storage)` — count memories by tier (hot vs cold)\n * plus per-status breakdown so operators can see at a glance\n * whether the lifecycle policy has actually demoted anything.\n * - `explainTierForMemory(storage, id)` — show the value-score\n * components and tier-transition decision for a single memory\n * so an operator can reason about why a memory ended up where\n * it did.\n *\n * Pure inspection — neither surface mutates anything. The CLI wires\n * them as `remnic tier list` and `remnic tier explain <id>`.\n */\n\nimport type { StorageManager } from \"../storage.js\";\nimport type { MemoryFile, PluginConfig } from \"../types.js\";\nimport { computeLifecycleValueInputs } from \"../lifecycle.js\";\nimport {\n computeTierValueScore,\n decideTierTransition,\n type MemoryTier,\n type TierRoutingPolicy,\n type TierTransitionDecision,\n} from \"../tier-routing.js\";\nimport {\n applyUtilityPromotionRuntimePolicy,\n loadUtilityRuntimeValues,\n} from \"../utility-runtime.js\";\n\nexport interface TierSummary {\n /** Total memories scanned (all tiers, all statuses). */\n total: number;\n byTier: Record<MemoryTier, number>;\n byStatus: Record<string, number>;\n /** Memories with `status === \"forgotten\"` (issue #686 PR 4/6). */\n forgottenCount: number;\n /** Top contributors to the forgotten / archived buckets, by category. */\n byCategory: Record<string, number>;\n}\n\nexport interface TierExplainResult {\n id: string;\n path: string;\n currentTier: MemoryTier;\n status: string;\n category: string;\n valueScore: number;\n decision: TierTransitionDecision;\n signals: {\n confidence: number;\n accessCount: number;\n lastAccessed: string | null;\n created: string;\n updated: string;\n importance: number;\n feedback: number;\n };\n}\n\ninterface TierVisibleMemory {\n memory: MemoryFile;\n tier: MemoryTier;\n}\n\nasync function readTierVisibleMemories(\n storage: StorageManager,\n): Promise<TierVisibleMemory[]> {\n const [hotMemories, coldMemories] = await Promise.all([\n storage.readAllMemories(),\n storage.readAllColdMemories(),\n ]);\n return [\n ...hotMemories.map((memory) => ({ memory, tier: \"hot\" as const })),\n ...coldMemories.map((memory) => ({ memory, tier: \"cold\" as const })),\n ];\n}\n\nasync function tierRoutingPolicyFromConfig(\n config: PluginConfig,\n): Promise<TierRoutingPolicy> {\n const basePolicy: TierRoutingPolicy = {\n enabled: config.qmdTierMigrationEnabled,\n demotionMinAgeDays: config.qmdTierDemotionMinAgeDays,\n demotionValueThreshold: config.qmdTierDemotionValueThreshold,\n promotionValueThreshold: config.qmdTierPromotionValueThreshold,\n };\n const runtime = await loadUtilityRuntimeValues({\n memoryDir: config.memoryDir,\n memoryUtilityLearningEnabled: config.memoryUtilityLearningEnabled,\n promotionByOutcomeEnabled: config.promotionByOutcomeEnabled,\n });\n return applyUtilityPromotionRuntimePolicy(basePolicy, runtime);\n}\n\nexport async function summarizeTiers(\n storage: StorageManager,\n): Promise<TierSummary> {\n const all = await readTierVisibleMemories(storage);\n const summary: TierSummary = {\n total: all.length,\n byTier: { hot: 0, cold: 0 },\n byStatus: {},\n forgottenCount: 0,\n byCategory: {},\n };\n for (const { memory: m, tier } of all) {\n summary.byTier[tier] += 1;\n const status: string = m.frontmatter.status ?? \"active\";\n summary.byStatus[status] = (summary.byStatus[status] ?? 0) + 1;\n // Compare via the widened `string` type so this module compiles\n // both before and after PR 4/6 lands `\"forgotten\"` in MemoryStatus.\n if (status === \"forgotten\") summary.forgottenCount += 1;\n const cat = m.frontmatter.category ?? \"(uncategorized)\";\n summary.byCategory[cat] = (summary.byCategory[cat] ?? 0) + 1;\n }\n return summary;\n}\n\nexport async function explainTierForMemory(\n storage: StorageManager,\n id: string,\n config: PluginConfig,\n): Promise<TierExplainResult> {\n const trimmed = typeof id === \"string\" ? id.trim() : \"\";\n if (trimmed.length === 0) {\n throw new Error(\"tier explain: memory id is required and must be non-empty\");\n }\n const all = await readTierVisibleMemories(storage);\n const entry = all.find(({ memory: m }) => m.frontmatter.id === trimmed);\n if (!entry) {\n throw new Error(`tier explain: memory not found: ${trimmed}`);\n }\n const { memory, tier: currentTier } = entry;\n const now = new Date();\n const valueInputs = computeLifecycleValueInputs(memory, now);\n const valueScore = computeTierValueScore(memory, now);\n const policy = await tierRoutingPolicyFromConfig(config);\n const decision = decideTierTransition(memory, currentTier, policy, now);\n const fm = memory.frontmatter as unknown as Record<string, unknown>;\n return {\n id: trimmed,\n path: memory.path,\n currentTier,\n status: typeof fm.status === \"string\" ? (fm.status as string) : \"active\",\n category: typeof fm.category === \"string\" ? (fm.category as string) : \"\",\n valueScore,\n decision,\n signals: {\n confidence: valueInputs.confidence,\n accessCount:\n typeof fm.accessCount === \"number\" ? (fm.accessCount as number) : 0,\n lastAccessed:\n typeof fm.lastAccessed === \"string\" ? (fm.lastAccessed as string) : null,\n created: typeof fm.created === \"string\" ? (fm.created as string) : \"\",\n updated: typeof fm.updated === \"string\" ? (fm.updated as string) : \"\",\n importance: valueInputs.importance,\n feedback: valueInputs.feedback,\n },\n };\n}\n\n/**\n * Render a TierSummary as plain text for `remnic tier list` text mode.\n * Pure formatter — exposed so future surfaces (HTTP, MCP) can reuse.\n */\nexport function formatTierSummaryText(summary: TierSummary): string {\n const lines: string[] = [];\n lines.push(\"=== Memory Tier Distribution ===\");\n lines.push(`Total memories: ${summary.total}`);\n lines.push(\"\");\n lines.push(\"Tier:\");\n lines.push(` hot: ${summary.byTier.hot}`);\n lines.push(` cold: ${summary.byTier.cold}`);\n lines.push(\"\");\n lines.push(\"Status:\");\n const statusEntries = Object.entries(summary.byStatus).sort(\n (a, b) => b[1] - a[1] || a[0].localeCompare(b[0]),\n );\n for (const [status, count] of statusEntries) {\n lines.push(` ${status}: ${count}`);\n }\n lines.push(\"\");\n lines.push(\"Top categories:\");\n const categoryEntries = Object.entries(summary.byCategory)\n .sort((a, b) => b[1] - a[1] || a[0].localeCompare(b[0]))\n .slice(0, 8);\n for (const [cat, count] of categoryEntries) {\n lines.push(` ${cat}: ${count}`);\n }\n return lines.join(\"\\n\");\n}\n\n/**\n * Render a TierExplainResult as plain text for `remnic tier explain`.\n */\nexport function formatTierExplainText(explain: TierExplainResult): string {\n const lines: string[] = [];\n lines.push(`=== Tier Explain: ${explain.id} ===`);\n lines.push(`path: ${explain.path}`);\n lines.push(`current tier: ${explain.currentTier}`);\n lines.push(`status: ${explain.status}`);\n lines.push(`category: ${explain.category}`);\n lines.push(`value score: ${explain.valueScore.toFixed(3)}`);\n lines.push(\"\");\n lines.push(\"Tier-transition decision:\");\n lines.push(` next tier: ${explain.decision.nextTier}`);\n lines.push(` changed: ${explain.decision.changed}`);\n lines.push(` reason: ${explain.decision.reason}`);\n lines.push(\"\");\n lines.push(\"Signals:\");\n lines.push(` confidence: ${explain.signals.confidence}`);\n lines.push(` accessCount: ${explain.signals.accessCount}`);\n lines.push(` lastAccessed: ${explain.signals.lastAccessed ?? \"(never)\"}`);\n lines.push(` created: ${explain.signals.created}`);\n lines.push(` updated: ${explain.signals.updated}`);\n lines.push(` importance: ${explain.signals.importance}`);\n lines.push(` feedback: ${explain.signals.feedback}`);\n return lines.join(\"\\n\");\n}\n"],"mappings":";;;;;;;;;;;;;;;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,QAAM,KAAK,kBAAkB,QAAQ,WAAW,QAAQ,CAAC,CAAC,EAAE;AAC5D,QAAM,KAAK,EAAE;AACb,QAAM,KAAK,2BAA2B;AACtC,QAAM,KAAK,gBAAgB,QAAQ,SAAS,QAAQ,EAAE;AACtD,QAAM,KAAK,gBAAgB,QAAQ,SAAS,OAAO,EAAE;AACrD,QAAM,KAAK,gBAAgB,QAAQ,SAAS,MAAM,EAAE;AACpD,QAAM,KAAK,EAAE;AACb,QAAM,KAAK,UAAU;AACrB,QAAM,KAAK,mBAAmB,QAAQ,QAAQ,UAAU,EAAE;AAC1D,QAAM,KAAK,mBAAmB,QAAQ,QAAQ,WAAW,EAAE;AAC3D,QAAM,KAAK,mBAAmB,QAAQ,QAAQ,gBAAgB,SAAS,EAAE;AACzE,QAAM,KAAK,mBAAmB,QAAQ,QAAQ,OAAO,EAAE;AACvD,QAAM,KAAK,mBAAmB,QAAQ,QAAQ,OAAO,EAAE;AACvD,QAAM,KAAK,mBAAmB,QAAQ,QAAQ,UAAU,EAAE;AAC1D,QAAM,KAAK,mBAAmB,QAAQ,QAAQ,QAAQ,EAAE;AACxD,SAAO,MAAM,KAAK,IAAI;AACxB;","names":[]}
|
package/dist/tmt.js
CHANGED
package/dist/tokens.js
CHANGED
package/dist/topics.js
CHANGED
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
import {
|
|
2
|
+
renderFrame
|
|
3
|
+
} from "./chunk-32KD5IHZ.js";
|
|
4
|
+
import "./chunk-TYEOAFH3.js";
|
|
5
|
+
import "./chunk-PZ5AY32C.js";
|
|
6
|
+
|
|
7
|
+
// src/console/trace.ts
|
|
8
|
+
import { promises as fs } from "fs";
|
|
9
|
+
import path from "path";
|
|
10
|
+
import readline from "readline";
|
|
11
|
+
import { createReadStream } from "fs";
|
|
12
|
+
var ANSI_CLEAR_HOME = "\x1B[2J\x1B[H";
|
|
13
|
+
var ANSI_HIDE_CURSOR = "\x1B[?25l";
|
|
14
|
+
var ANSI_SHOW_CURSOR = "\x1B[?25h";
|
|
15
|
+
var DEFAULT_REPLAY_DELAY_MS = 2e3;
|
|
16
|
+
var MAX_REPLAY_DELAY_MS = 6e4;
|
|
17
|
+
var MIN_REPLAY_DELAY_MS = 0;
|
|
18
|
+
async function openTraceRecorder(filePath, options = {}) {
|
|
19
|
+
const ensureParentDir = options.ensureParentDir ?? true;
|
|
20
|
+
if (ensureParentDir) {
|
|
21
|
+
const parent = path.dirname(filePath);
|
|
22
|
+
if (parent && parent !== "." && parent !== "/") {
|
|
23
|
+
await fs.mkdir(parent, { recursive: true });
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
const handle = await fs.open(filePath, "a");
|
|
27
|
+
let closed = false;
|
|
28
|
+
let lastError = null;
|
|
29
|
+
let writeChain = Promise.resolve();
|
|
30
|
+
const queueWrite = (line) => {
|
|
31
|
+
const next = writeChain.then(async () => {
|
|
32
|
+
if (closed) return;
|
|
33
|
+
try {
|
|
34
|
+
await handle.write(line);
|
|
35
|
+
} catch (err) {
|
|
36
|
+
const msg = describeError(err);
|
|
37
|
+
lastError = msg;
|
|
38
|
+
throw err;
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
writeChain = next.catch(() => {
|
|
42
|
+
});
|
|
43
|
+
return next;
|
|
44
|
+
};
|
|
45
|
+
return {
|
|
46
|
+
append: async (snapshot) => {
|
|
47
|
+
if (closed) return;
|
|
48
|
+
let line;
|
|
49
|
+
try {
|
|
50
|
+
line = JSON.stringify(snapshot) + "\n";
|
|
51
|
+
} catch (err) {
|
|
52
|
+
lastError = `serialize failed: ${describeError(err)}`;
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
try {
|
|
56
|
+
await queueWrite(line);
|
|
57
|
+
} catch {
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
close: async (signal) => {
|
|
61
|
+
if (closed) return;
|
|
62
|
+
try {
|
|
63
|
+
if (signal) {
|
|
64
|
+
await Promise.race([
|
|
65
|
+
writeChain,
|
|
66
|
+
new Promise((_, reject) => {
|
|
67
|
+
if (signal.aborted) {
|
|
68
|
+
reject(makeAbortError());
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
signal.addEventListener("abort", () => reject(makeAbortError()), {
|
|
72
|
+
once: true
|
|
73
|
+
});
|
|
74
|
+
})
|
|
75
|
+
]);
|
|
76
|
+
} else {
|
|
77
|
+
await writeChain;
|
|
78
|
+
}
|
|
79
|
+
} catch {
|
|
80
|
+
}
|
|
81
|
+
closed = true;
|
|
82
|
+
try {
|
|
83
|
+
await handle.close();
|
|
84
|
+
} catch (err) {
|
|
85
|
+
lastError = describeError(err);
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
getLastError: () => lastError
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
async function replayTrace(filePath, options = {}) {
|
|
92
|
+
const output = options.output ?? process.stdout;
|
|
93
|
+
const speed = normalizeSpeed(options.speed);
|
|
94
|
+
const sleep = options.sleep ?? ((ms) => sleepAbortable(ms, options.signal));
|
|
95
|
+
const manageCursor = options.manageCursor ?? true;
|
|
96
|
+
const nowFn = options.now ?? ((snapshot) => {
|
|
97
|
+
const ms = Date.parse(snapshot.capturedAt);
|
|
98
|
+
return Number.isFinite(ms) ? ms : Date.now();
|
|
99
|
+
});
|
|
100
|
+
const stream = createReadStream(filePath, { encoding: "utf-8" });
|
|
101
|
+
const rl = readline.createInterface({ input: stream, crlfDelay: Infinity });
|
|
102
|
+
let framesRendered = 0;
|
|
103
|
+
let framesSkipped = 0;
|
|
104
|
+
let lastSnapshot = null;
|
|
105
|
+
let prevCapturedMs = null;
|
|
106
|
+
if (manageCursor) safeWrite(output, ANSI_HIDE_CURSOR);
|
|
107
|
+
try {
|
|
108
|
+
for await (const rawLine of rl) {
|
|
109
|
+
if (options.signal?.aborted) break;
|
|
110
|
+
const line = rawLine.trim();
|
|
111
|
+
if (line.length === 0) continue;
|
|
112
|
+
const snapshot = parseSnapshotLine(line);
|
|
113
|
+
if (snapshot === null) {
|
|
114
|
+
framesSkipped += 1;
|
|
115
|
+
continue;
|
|
116
|
+
}
|
|
117
|
+
const capturedMs = Date.parse(snapshot.capturedAt);
|
|
118
|
+
let waitMs = 0;
|
|
119
|
+
if (prevCapturedMs !== null && Number.isFinite(capturedMs)) {
|
|
120
|
+
const rawDelta = capturedMs - prevCapturedMs;
|
|
121
|
+
waitMs = computeReplayDelay(rawDelta, speed);
|
|
122
|
+
} else if (prevCapturedMs !== null) {
|
|
123
|
+
waitMs = computeReplayDelay(DEFAULT_REPLAY_DELAY_MS, speed);
|
|
124
|
+
}
|
|
125
|
+
if (waitMs > 0) {
|
|
126
|
+
try {
|
|
127
|
+
await sleep(waitMs);
|
|
128
|
+
} catch (err) {
|
|
129
|
+
if (isAbortError(err) || options.signal?.aborted) break;
|
|
130
|
+
throw err;
|
|
131
|
+
}
|
|
132
|
+
if (options.signal?.aborted) break;
|
|
133
|
+
}
|
|
134
|
+
let frame;
|
|
135
|
+
try {
|
|
136
|
+
frame = renderFrame({
|
|
137
|
+
snapshot,
|
|
138
|
+
renderError: null,
|
|
139
|
+
now: () => nowFn(snapshot, framesRendered)
|
|
140
|
+
});
|
|
141
|
+
} catch (err) {
|
|
142
|
+
frame = `remnic console replay: render failed: ${describeError(err)}
|
|
143
|
+
`;
|
|
144
|
+
}
|
|
145
|
+
safeWrite(output, ANSI_CLEAR_HOME);
|
|
146
|
+
safeWrite(output, frame);
|
|
147
|
+
framesRendered += 1;
|
|
148
|
+
lastSnapshot = snapshot;
|
|
149
|
+
if (Number.isFinite(capturedMs)) prevCapturedMs = capturedMs;
|
|
150
|
+
}
|
|
151
|
+
} finally {
|
|
152
|
+
rl.close();
|
|
153
|
+
stream.close();
|
|
154
|
+
if (manageCursor) safeWrite(output, ANSI_SHOW_CURSOR);
|
|
155
|
+
}
|
|
156
|
+
return { framesRendered, framesSkipped, lastSnapshot };
|
|
157
|
+
}
|
|
158
|
+
function parseSnapshotLine(line) {
|
|
159
|
+
let parsed;
|
|
160
|
+
try {
|
|
161
|
+
parsed = JSON.parse(line);
|
|
162
|
+
} catch {
|
|
163
|
+
return null;
|
|
164
|
+
}
|
|
165
|
+
if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
|
|
166
|
+
return null;
|
|
167
|
+
}
|
|
168
|
+
return parsed;
|
|
169
|
+
}
|
|
170
|
+
function computeReplayDelay(rawDeltaMs, speed) {
|
|
171
|
+
if (!Number.isFinite(rawDeltaMs)) return 0;
|
|
172
|
+
if (rawDeltaMs <= 0) return 0;
|
|
173
|
+
if (!Number.isFinite(speed)) return 0;
|
|
174
|
+
const adjusted = rawDeltaMs / speed;
|
|
175
|
+
if (!Number.isFinite(adjusted)) return 0;
|
|
176
|
+
if (adjusted <= MIN_REPLAY_DELAY_MS) return MIN_REPLAY_DELAY_MS;
|
|
177
|
+
if (adjusted > MAX_REPLAY_DELAY_MS) return MAX_REPLAY_DELAY_MS;
|
|
178
|
+
return adjusted;
|
|
179
|
+
}
|
|
180
|
+
function parseSpeedFlag(raw) {
|
|
181
|
+
if (raw === void 0 || raw === null) return 1;
|
|
182
|
+
const num = typeof raw === "number" ? raw : Number(raw);
|
|
183
|
+
if (!Number.isFinite(num) && num !== Infinity) {
|
|
184
|
+
throw new Error(
|
|
185
|
+
`invalid --speed value: ${JSON.stringify(raw)} (must be a positive number)`
|
|
186
|
+
);
|
|
187
|
+
}
|
|
188
|
+
if (num <= 0) {
|
|
189
|
+
throw new Error(
|
|
190
|
+
`invalid --speed value: ${JSON.stringify(raw)} (must be > 0)`
|
|
191
|
+
);
|
|
192
|
+
}
|
|
193
|
+
return num;
|
|
194
|
+
}
|
|
195
|
+
function normalizeSpeed(speed) {
|
|
196
|
+
if (speed === void 0) return 1;
|
|
197
|
+
if (!Number.isFinite(speed) && speed !== Infinity) return 1;
|
|
198
|
+
if (speed <= 0) return 1;
|
|
199
|
+
return speed;
|
|
200
|
+
}
|
|
201
|
+
function sleepAbortable(ms, signal) {
|
|
202
|
+
return new Promise((resolve, reject) => {
|
|
203
|
+
if (signal?.aborted) {
|
|
204
|
+
reject(makeAbortError());
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
const timer = setTimeout(() => {
|
|
208
|
+
if (signal && onAbort) signal.removeEventListener("abort", onAbort);
|
|
209
|
+
resolve();
|
|
210
|
+
}, ms);
|
|
211
|
+
let onAbort = null;
|
|
212
|
+
if (signal) {
|
|
213
|
+
onAbort = () => {
|
|
214
|
+
clearTimeout(timer);
|
|
215
|
+
reject(makeAbortError());
|
|
216
|
+
};
|
|
217
|
+
signal.addEventListener("abort", onAbort, { once: true });
|
|
218
|
+
}
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
function makeAbortError() {
|
|
222
|
+
if (typeof DOMException !== "undefined") {
|
|
223
|
+
return new DOMException("aborted", "AbortError");
|
|
224
|
+
}
|
|
225
|
+
const err = new Error("aborted");
|
|
226
|
+
err.name = "AbortError";
|
|
227
|
+
return err;
|
|
228
|
+
}
|
|
229
|
+
function isAbortError(err) {
|
|
230
|
+
return typeof err === "object" && err !== null && "name" in err && err.name === "AbortError";
|
|
231
|
+
}
|
|
232
|
+
async function flushWithTimeout(flush, timeoutMs) {
|
|
233
|
+
const TIMEOUT_SENTINEL = /* @__PURE__ */ Symbol("flush-timeout");
|
|
234
|
+
let error = null;
|
|
235
|
+
let timeoutHandle = null;
|
|
236
|
+
const ac = new AbortController();
|
|
237
|
+
const flushPromise = flush(ac.signal).then(
|
|
238
|
+
() => void 0,
|
|
239
|
+
(err) => {
|
|
240
|
+
error = err;
|
|
241
|
+
return void 0;
|
|
242
|
+
}
|
|
243
|
+
);
|
|
244
|
+
const timeoutPromise = new Promise((resolve) => {
|
|
245
|
+
timeoutHandle = setTimeout(() => resolve(TIMEOUT_SENTINEL), timeoutMs);
|
|
246
|
+
if (typeof timeoutHandle.unref === "function") {
|
|
247
|
+
timeoutHandle.unref();
|
|
248
|
+
}
|
|
249
|
+
});
|
|
250
|
+
try {
|
|
251
|
+
const winner = await Promise.race([
|
|
252
|
+
flushPromise,
|
|
253
|
+
timeoutPromise
|
|
254
|
+
]);
|
|
255
|
+
if (winner === TIMEOUT_SENTINEL) {
|
|
256
|
+
ac.abort();
|
|
257
|
+
return { flushed: false, timedOut: true, error: null };
|
|
258
|
+
}
|
|
259
|
+
return { flushed: true, timedOut: false, error };
|
|
260
|
+
} finally {
|
|
261
|
+
if (timeoutHandle !== null) {
|
|
262
|
+
clearTimeout(timeoutHandle);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
function safeWrite(output, chunk) {
|
|
267
|
+
try {
|
|
268
|
+
output.write(chunk);
|
|
269
|
+
} catch {
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
function describeError(err) {
|
|
273
|
+
if (err instanceof Error) return err.message;
|
|
274
|
+
try {
|
|
275
|
+
return String(err);
|
|
276
|
+
} catch {
|
|
277
|
+
return "unknown error";
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
export {
|
|
281
|
+
computeReplayDelay,
|
|
282
|
+
flushWithTimeout,
|
|
283
|
+
isAbortError,
|
|
284
|
+
openTraceRecorder,
|
|
285
|
+
parseSnapshotLine,
|
|
286
|
+
parseSpeedFlag,
|
|
287
|
+
replayTrace,
|
|
288
|
+
sleepAbortable
|
|
289
|
+
};
|
|
290
|
+
//# sourceMappingURL=trace-C5ETWBEF.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/console/trace.ts"],"sourcesContent":["/**\n * Trace recording + replay for the operator console (issue #688 PR 3/3).\n *\n * This module is the I/O layer that bridges the live console surface\n * (PR 2/3, `runConsoleTui`) with an offline replay mode. Operators can:\n *\n * - `remnic console --record-trace <path>`: append every refresh\n * cycle's `ConsoleStateSnapshot` to a JSONL file at `<path>` (one\n * snapshot per line), so the engine state can be reviewed later.\n *\n * - `remnic console --trace <path> [--speed N]`: read the JSONL file\n * frame-by-frame, recompute the inter-frame delay from the\n * captured `capturedAt` timestamps (divided by `speed`), and feed\n * each frame into the same `renderFrame` function the live TUI\n * uses. EOF exits cleanly.\n *\n * Design contract:\n * - Replay reuses `renderFrame` (NOT a parallel reimplementation).\n * Live and replay must look identical for the same snapshot.\n * - Replay is fully sandboxed: no orchestrator instance is required,\n * no filesystem reads beyond the trace file itself.\n * - Recording is cheap: one `JSON.stringify` + a single\n * `\\n`-delimited append per snapshot. A failed write logs once and\n * disables further writes; the live loop must NOT crash.\n * - Speed multiplier `N`: positive finite. `N=2` halves the delay,\n * `N=0.5` doubles it. `Infinity` is permitted and means \"no\n * delay\" (back-to-back frames).\n */\n\nimport { promises as fs } from \"node:fs\";\nimport path from \"node:path\";\nimport readline from \"node:readline\";\nimport { createReadStream } from \"node:fs\";\nimport type { Writable } from \"node:stream\";\n\nimport { renderFrame } from \"./tui.js\";\nimport type { ConsoleStateSnapshot } from \"./state.js\";\n\n/** ANSI: clear screen + move cursor to home (top-left). Same constant the TUI uses. */\nconst ANSI_CLEAR_HOME = \"\\x1b[2J\\x1b[H\";\n/** ANSI: hide / show the cursor during replay. */\nconst ANSI_HIDE_CURSOR = \"\\x1b[?25l\";\nconst ANSI_SHOW_CURSOR = \"\\x1b[?25h\";\n\n/**\n * Default delay (ms) used when the trace file has fewer than two\n * frames OR the captured timestamps don't yield a valid delta. Mirrors\n * the live TUI's default refresh interval for visual consistency.\n */\nconst DEFAULT_REPLAY_DELAY_MS = 2000;\n\n/**\n * Maximum allowed delay between replay frames. A pathological trace\n * with hour-long gaps would otherwise stall replay indefinitely; cap\n * at one minute so a tester running `--trace` always sees progress.\n */\nconst MAX_REPLAY_DELAY_MS = 60_000;\n\n/** Minimum delay between replay frames (ms) — prevents starving the loop. */\nconst MIN_REPLAY_DELAY_MS = 0;\n\nexport interface TraceRecorder {\n /**\n * Append a snapshot to the trace file. Returns a promise that\n * resolves once the line is flushed. Errors are surfaced via\n * `getLastError()` rather than thrown — the live TUI must never\n * crash because tracing failed.\n */\n append: (snapshot: ConsoleStateSnapshot) => Promise<void>;\n /**\n * Close the underlying file handle. Idempotent.\n *\n * The optional `signal` parameter is forwarded from\n * `flushWithTimeout` when the deadline wins the race. When the\n * signal fires, the pending write-chain drain is abandoned and the\n * file handle is closed immediately, releasing OS resources instead\n * of leaving the handle open until the orphaned writeChain resolves.\n */\n close: (signal?: AbortSignal) => Promise<void>;\n /** Returns the most recent error (or null) without throwing. */\n getLastError: () => string | null;\n}\n\nexport interface OpenTraceRecorderOptions {\n /**\n * If true (default), `path` is created with `mkdir -p` on its\n * parent directory before the first append. Set to false in tests\n * that pre-create the parent.\n */\n ensureParentDir?: boolean;\n}\n\n/**\n * Open (create or append to) a JSONL trace recorder at `filePath`.\n * Each call to `recorder.append(snapshot)` writes\n * `JSON.stringify(snapshot) + \"\\n\"`. Concurrent appends are\n * serialized through an internal write chain so partial-line\n * interleaving cannot occur.\n */\nexport async function openTraceRecorder(\n filePath: string,\n options: OpenTraceRecorderOptions = {},\n): Promise<TraceRecorder> {\n const ensureParentDir = options.ensureParentDir ?? true;\n if (ensureParentDir) {\n const parent = path.dirname(filePath);\n if (parent && parent !== \".\" && parent !== \"/\") {\n await fs.mkdir(parent, { recursive: true });\n }\n }\n const handle = await fs.open(filePath, \"a\");\n let closed = false;\n let lastError: string | null = null;\n // Codex P0 (Common Gotcha #40): a serialized promise chain without\n // `.catch()` recovery permanently poisons the chain after the first\n // I/O error. Use `queueWrite` — it surfaces the error to the caller\n // AND restores the chain to a resolved state for the next caller.\n let writeChain: Promise<void> = Promise.resolve();\n const queueWrite = (line: string): Promise<void> => {\n const next = writeChain.then(async () => {\n if (closed) return;\n try {\n await handle.write(line);\n } catch (err) {\n const msg = describeError(err);\n lastError = msg;\n // Re-throw so the caller's awaiter sees the failure, but\n // recover the chain below so the next append can still run.\n throw err;\n }\n });\n writeChain = next.catch(() => {\n // Recovery: reset the chain so a single transient failure does\n // not poison every subsequent append. The original error is\n // already captured in `lastError` AND was surfaced to the\n // caller via the awaited `next` promise above.\n });\n return next;\n };\n return {\n append: async (snapshot: ConsoleStateSnapshot) => {\n if (closed) return;\n let line: string;\n try {\n line = JSON.stringify(snapshot) + \"\\n\";\n } catch (err) {\n // A non-serializable snapshot is a bug, not a runtime\n // condition we should crash on. Record + skip.\n lastError = `serialize failed: ${describeError(err)}`;\n return;\n }\n try {\n await queueWrite(line);\n } catch {\n // already captured in lastError via queueWrite\n }\n },\n close: async (signal?: AbortSignal) => {\n if (closed) return;\n // Codex P1: do NOT set `closed = true` before draining. Each\n // queued write begins with `if (closed) return;`, so flipping the\n // flag first would silently drop frames that callers already\n // queued via `append()`. Drain the existing chain first so every\n // already-queued write executes against the still-open handle,\n // THEN flip `closed` to reject any further appends, THEN close\n // the file handle. This honors the documented \"drain pending\n // writes\" contract of `close()`.\n //\n // Codex P1 (PR #732 round 5): when `flushWithTimeout` races the\n // drain against a deadline and the timeout wins, it fires the\n // `signal` passed here. We race the writeChain drain against that\n // signal so the file handle is closed promptly instead of being\n // held open until the orphaned writeChain eventually resolves.\n try {\n if (signal) {\n await Promise.race([\n writeChain,\n new Promise<void>((_, reject) => {\n if (signal.aborted) {\n reject(makeAbortError());\n return;\n }\n signal.addEventListener(\"abort\", () => reject(makeAbortError()), {\n once: true,\n });\n }),\n ]);\n } else {\n await writeChain;\n }\n } catch {\n // ignore — abort or I/O error already in lastError\n }\n closed = true;\n try {\n await handle.close();\n } catch (err) {\n lastError = describeError(err);\n }\n },\n getLastError: () => lastError,\n };\n}\n\nexport interface ReplayTraceOptions {\n /** Output stream. Defaults to `process.stdout`. */\n output?: Writable;\n /**\n * Speed multiplier. `1` = original cadence, `2` = twice as fast,\n * `0.5` = half speed. `Infinity` is permitted and means \"no\n * delay\" (back-to-back frames). Defaults to 1.\n */\n speed?: number;\n /**\n * Override the inter-frame delay function — primarily for tests so\n * we can swap `setTimeout` for an instant resolver. The function\n * receives the *raw* (already-speed-adjusted) delay in ms.\n */\n sleep?: (ms: number) => Promise<void>;\n /**\n * Hide / show the terminal cursor during replay. Defaults to true.\n * Tests typically pass false so they don't pollute captured output\n * with cursor-control escapes.\n */\n manageCursor?: boolean;\n /**\n * Optional clock injection — feeds `renderFrame`'s \"current time\"\n * value during replay. By default, replay uses the snapshot's own\n * `capturedAt` so the rendered timestamp matches the original\n * frame. Tests override this for determinism.\n */\n now?: (snapshot: ConsoleStateSnapshot, frameIndex: number) => number;\n /**\n * Abort signal. If aborted mid-replay, the loop exits cleanly at\n * the next frame boundary.\n */\n signal?: AbortSignal;\n}\n\nexport interface ReplayTraceResult {\n /** Total frames rendered. */\n framesRendered: number;\n /** Frames skipped because they could not be parsed. */\n framesSkipped: number;\n /** Last snapshot that was rendered, or null if the file was empty. */\n lastSnapshot: ConsoleStateSnapshot | null;\n}\n\n/**\n * Replay a JSONL trace file frame-by-frame. Each line is parsed,\n * optionally renders via `renderFrame`, then waits the speed-adjusted\n * delay before the next frame. Returns once EOF is reached or the\n * abort signal fires.\n */\nexport async function replayTrace(\n filePath: string,\n options: ReplayTraceOptions = {},\n): Promise<ReplayTraceResult> {\n const output: Writable = options.output ?? process.stdout;\n const speed = normalizeSpeed(options.speed);\n // Codex P2 (PR #732 follow-up): the default sleeper now uses\n // `sleepAbortable` which REJECTS with `AbortError` on signal abort\n // (rather than resolving silently). The replay loop catches the\n // AbortError and exits cleanly. Custom `sleep` implementations are\n // responsible for their own abort wiring; if they reject with an\n // AbortError-shaped error the loop will treat it as a clean exit.\n const sleep =\n options.sleep ?? ((ms: number) => sleepAbortable(ms, options.signal));\n const manageCursor = options.manageCursor ?? true;\n const nowFn =\n options.now ??\n ((snapshot: ConsoleStateSnapshot) => {\n const ms = Date.parse(snapshot.capturedAt);\n return Number.isFinite(ms) ? ms : Date.now();\n });\n\n const stream = createReadStream(filePath, { encoding: \"utf-8\" });\n const rl = readline.createInterface({ input: stream, crlfDelay: Infinity });\n\n let framesRendered = 0;\n let framesSkipped = 0;\n let lastSnapshot: ConsoleStateSnapshot | null = null;\n let prevCapturedMs: number | null = null;\n\n if (manageCursor) safeWrite(output, ANSI_HIDE_CURSOR);\n\n try {\n for await (const rawLine of rl) {\n if (options.signal?.aborted) break;\n const line = rawLine.trim();\n if (line.length === 0) continue;\n const snapshot = parseSnapshotLine(line);\n if (snapshot === null) {\n framesSkipped += 1;\n continue;\n }\n\n // Compute the inter-frame delay from the captured timestamps.\n // The first frame paints immediately; subsequent frames wait\n // `(this.capturedAt - prev.capturedAt) / speed`.\n const capturedMs = Date.parse(snapshot.capturedAt);\n let waitMs = 0;\n if (prevCapturedMs !== null && Number.isFinite(capturedMs)) {\n const rawDelta = capturedMs - prevCapturedMs;\n waitMs = computeReplayDelay(rawDelta, speed);\n } else if (prevCapturedMs !== null) {\n // No usable timestamp on this frame — fall back to the\n // default refresh interval (also speed-adjusted).\n waitMs = computeReplayDelay(DEFAULT_REPLAY_DELAY_MS, speed);\n }\n if (waitMs > 0) {\n try {\n await sleep(waitMs);\n } catch (err) {\n // Codex P2 (PR #732 follow-up): `sleepAbortable` rejects\n // with AbortError when SIGINT fires mid-sleep. Treat any\n // AbortError-shaped rejection as a clean early exit so\n // Ctrl-C does not have to wait for the current `setTimeout`\n // to elapse. Re-throw any other error so genuine bugs\n // surface.\n if (isAbortError(err) || options.signal?.aborted) break;\n throw err;\n }\n if (options.signal?.aborted) break;\n }\n\n let frame: string;\n try {\n frame = renderFrame({\n snapshot,\n renderError: null,\n now: () => nowFn(snapshot, framesRendered),\n });\n } catch (err) {\n // Mirror the live loop's renderer-failure recovery: emit a\n // minimal error frame and keep replaying.\n frame = `remnic console replay: render failed: ${describeError(err)}\\n`;\n }\n safeWrite(output, ANSI_CLEAR_HOME);\n safeWrite(output, frame);\n\n framesRendered += 1;\n lastSnapshot = snapshot;\n if (Number.isFinite(capturedMs)) prevCapturedMs = capturedMs;\n }\n } finally {\n rl.close();\n stream.close();\n if (manageCursor) safeWrite(output, ANSI_SHOW_CURSOR);\n }\n\n return { framesRendered, framesSkipped, lastSnapshot };\n}\n\n/**\n * Parse a single JSONL line into a `ConsoleStateSnapshot`. Returns\n * null for malformed lines so the replay loop can keep going. We\n * intentionally do NOT validate every nested field — the renderer is\n * already defensive about missing fields and the trace file format\n * is best-effort.\n */\nexport function parseSnapshotLine(line: string): ConsoleStateSnapshot | null {\n let parsed: unknown;\n try {\n parsed = JSON.parse(line);\n } catch {\n return null;\n }\n // Common Gotcha #18: JSON.parse('null') succeeds but null is not a\n // valid snapshot. Always check the result type.\n if (typeof parsed !== \"object\" || parsed === null || Array.isArray(parsed)) {\n return null;\n }\n // Best-effort cast: the renderer is tolerant of missing fields.\n return parsed as ConsoleStateSnapshot;\n}\n\n/**\n * Compute the speed-adjusted, clamped inter-frame delay. Exposed for\n * tests so we can assert the speed math without a real timer.\n *\n * - `rawDeltaMs` is the captured-time difference between two frames\n * (may be negative if the trace went back in time — clamped to 0).\n * - `speed` must be a positive finite number OR `Infinity` (treated\n * as \"no delay\"). Non-positive / NaN values are normalized to 1\n * upstream so this function never sees them.\n */\nexport function computeReplayDelay(rawDeltaMs: number, speed: number): number {\n if (!Number.isFinite(rawDeltaMs)) return 0;\n if (rawDeltaMs <= 0) return 0;\n if (!Number.isFinite(speed)) return 0; // Infinity → no delay.\n const adjusted = rawDeltaMs / speed;\n if (!Number.isFinite(adjusted)) return 0;\n if (adjusted <= MIN_REPLAY_DELAY_MS) return MIN_REPLAY_DELAY_MS;\n if (adjusted > MAX_REPLAY_DELAY_MS) return MAX_REPLAY_DELAY_MS;\n return adjusted;\n}\n\n/**\n * Coerce a user-provided `--speed` value into a valid positive\n * multiplier. Common Gotchas #28 / #36: CLI values arrive as strings,\n * and `\"false\"` / `\"0\"` are truthy. Always convert + validate at the\n * input boundary. Throws on invalid input so the CLI surfaces a\n * helpful error message instead of silently defaulting (Common\n * Gotcha #51).\n */\nexport function parseSpeedFlag(raw: unknown): number {\n if (raw === undefined || raw === null) return 1;\n const num = typeof raw === \"number\" ? raw : Number(raw);\n if (!Number.isFinite(num) && num !== Infinity) {\n throw new Error(\n `invalid --speed value: ${JSON.stringify(raw)} (must be a positive number)`,\n );\n }\n if (num <= 0) {\n throw new Error(\n `invalid --speed value: ${JSON.stringify(raw)} (must be > 0)`,\n );\n }\n return num;\n}\n\nfunction normalizeSpeed(speed: number | undefined): number {\n if (speed === undefined) return 1;\n if (!Number.isFinite(speed) && speed !== Infinity) return 1;\n if (speed <= 0) return 1;\n return speed;\n}\n\n/**\n * Abortable sleep used by `replayTrace` between frames.\n *\n * Codex P2 (PR #732): unlike a plain `setTimeout` wrapper, this\n * variant REJECTS with `AbortError` when `signal` fires (or is\n * already aborted on entry). That gives callers a way to\n * *distinguish* timer-expiry from signal-driven early exit, instead\n * of silently resolving on both. The replay loop catches the\n * `AbortError` and exits cleanly so Ctrl-C does not have to wait for\n * the current inter-frame `setTimeout` (capped at 60s) to elapse.\n *\n * Resolves only on timer expiry. Rejects with `AbortError` (DOMException-\n * shaped: `name === \"AbortError\"`) on abort. Exported so callers in\n * tests and adjacent modules can reuse the same primitive.\n */\nexport function sleepAbortable(\n ms: number,\n signal?: AbortSignal,\n): Promise<void> {\n return new Promise((resolve, reject) => {\n if (signal?.aborted) {\n reject(makeAbortError());\n return;\n }\n const timer = setTimeout(() => {\n if (signal && onAbort) signal.removeEventListener(\"abort\", onAbort);\n resolve();\n }, ms);\n let onAbort: (() => void) | null = null;\n if (signal) {\n onAbort = () => {\n clearTimeout(timer);\n reject(makeAbortError());\n };\n signal.addEventListener(\"abort\", onAbort, { once: true });\n }\n });\n}\n\n/**\n * Construct an `AbortError`-shaped error. Prefers the standard\n * `DOMException(\"...\", \"AbortError\")` when available (Node 18+);\n * falls back to a plain Error with `name = \"AbortError\"` for\n * environments without `DOMException`.\n */\nfunction makeAbortError(): Error {\n if (typeof DOMException !== \"undefined\") {\n return new DOMException(\"aborted\", \"AbortError\");\n }\n const err = new Error(\"aborted\");\n err.name = \"AbortError\";\n return err;\n}\n\n/**\n * Detect an AbortError-shaped rejection. Matches both\n * `DOMException(\"...\", \"AbortError\")` and plain `Error` with\n * `name === \"AbortError\"`. Exported for tests.\n */\nexport function isAbortError(err: unknown): boolean {\n return (\n typeof err === \"object\" &&\n err !== null &&\n \"name\" in err &&\n (err as { name?: unknown }).name === \"AbortError\"\n );\n}\n\nexport interface FlushWithTimeoutResult {\n /** True if the flush completed before the deadline. */\n flushed: boolean;\n /** True if the deadline won. */\n timedOut: boolean;\n /** Error from the flush, if any. */\n error: unknown;\n}\n\n/**\n * Bound a recorder flush against a wall-clock deadline (Codex P1, PR\n * #732 follow-up).\n *\n * The CLI shutdown path awaits `recorder.close()`. On a wedged\n * network-backed filesystem that drain can block indefinitely. This\n * helper races the drain against `timeoutMs` and returns a structured\n * result so the caller can decide whether to log a warning, retry, or\n * proceed silently. Returning a structured result (rather than\n * throwing) keeps shutdown ordering deterministic — the caller must\n * always reach the next teardown step.\n *\n * Errors raised by the flush are captured in `result.error` rather\n * than re-thrown.\n *\n * The `flush` factory receives an `AbortSignal` that fires when the\n * timeout wins the race. Callers should forward the signal into\n * whatever I/O the flush performs so the underlying operation is\n * actually cancelled rather than just orphaned. The signal is fired\n * exactly once, immediately after the timeout sentinel wins. The flush\n * promise is still awaited in the background; any subsequent error is\n * silently discarded (it was already abandoned by the caller).\n */\nexport async function flushWithTimeout(\n flush: (signal: AbortSignal) => Promise<void>,\n timeoutMs: number,\n): Promise<FlushWithTimeoutResult> {\n const TIMEOUT_SENTINEL = Symbol(\"flush-timeout\");\n let error: unknown = null;\n let timeoutHandle: ReturnType<typeof setTimeout> | null = null;\n // Codex P1 (PR #732 round 5): give the flush an AbortSignal so the\n // underlying close() can stop holding resources when the timeout\n // wins. Previously the close kept running silently after the race\n // resolved — the AbortController lets callers wire cancellation into\n // their I/O path (e.g., by aborting a stream or write chain) instead\n // of merely abandoning the orphaned promise.\n const ac = new AbortController();\n const flushPromise = flush(ac.signal).then(\n () => undefined,\n (err) => {\n error = err;\n // Resolve so the race winner is \"flush\" — the caller inspects\n // `result.error` to decide what to do.\n return undefined;\n },\n );\n const timeoutPromise = new Promise<symbol>((resolve) => {\n timeoutHandle = setTimeout(() => resolve(TIMEOUT_SENTINEL), timeoutMs);\n // Codex P1 (PR #732): unref the fallback timer so it does not\n // hold the event loop open on its own. Belt-and-suspenders with\n // the `clearTimeout` in the `finally` below: even if a future\n // refactor accidentally drops the clear, an unref'd timer will\n // not prevent process exit once the flush has resolved.\n if (typeof timeoutHandle.unref === \"function\") {\n timeoutHandle.unref();\n }\n });\n try {\n const winner = await Promise.race<symbol | void>([\n flushPromise,\n timeoutPromise,\n ]);\n if (winner === TIMEOUT_SENTINEL) {\n // Fire the abort signal so the flush's underlying I/O can\n // release its resources rather than staying open indefinitely.\n ac.abort();\n return { flushed: false, timedOut: true, error: null };\n }\n return { flushed: true, timedOut: false, error };\n } finally {\n // Codex P1 (PR #732): clear the fallback timer when the flush\n // wins the race. Without this, Node keeps the ref'd timeout\n // handle alive for the full `timeoutMs` and delays process exit\n // by that interval on EVERY normal shutdown — turning a\n // safety-net into a consistent user-visible hang.\n if (timeoutHandle !== null) {\n clearTimeout(timeoutHandle);\n }\n }\n}\n\nfunction safeWrite(output: Writable, chunk: string): void {\n try {\n output.write(chunk);\n } catch {\n // ignore — best effort\n }\n}\n\nfunction describeError(err: unknown): string {\n if (err instanceof Error) return err.message;\n try {\n return String(err);\n } catch {\n return \"unknown error\";\n }\n}\n"],"mappings":";;;;;;;AA6BA,SAAS,YAAY,UAAU;AAC/B,OAAO,UAAU;AACjB,OAAO,cAAc;AACrB,SAAS,wBAAwB;AAOjC,IAAM,kBAAkB;AAExB,IAAM,mBAAmB;AACzB,IAAM,mBAAmB;AAOzB,IAAM,0BAA0B;AAOhC,IAAM,sBAAsB;AAG5B,IAAM,sBAAsB;AAwC5B,eAAsB,kBACpB,UACA,UAAoC,CAAC,GACb;AACxB,QAAM,kBAAkB,QAAQ,mBAAmB;AACnD,MAAI,iBAAiB;AACnB,UAAM,SAAS,KAAK,QAAQ,QAAQ;AACpC,QAAI,UAAU,W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|
+
import {
|
|
2
|
+
renderFrame,
|
|
3
|
+
runConsoleTui,
|
|
4
|
+
stripAnsi
|
|
5
|
+
} from "./chunk-32KD5IHZ.js";
|
|
6
|
+
import "./chunk-TYEOAFH3.js";
|
|
7
|
+
import "./chunk-PZ5AY32C.js";
|
|
8
|
+
export {
|
|
9
|
+
renderFrame,
|
|
10
|
+
runConsoleTui,
|
|
11
|
+
stripAnsi
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=tui-RI7P6PBS.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CAPSULE_ID_PATTERN,
|
|
3
|
+
CapsuleBlockSchema,
|
|
4
|
+
CapsuleIncludesSchema,
|
|
5
|
+
CapsuleParentSchema,
|
|
6
|
+
CapsuleRetrievalPolicySchema,
|
|
7
|
+
ExportBundleV1Schema,
|
|
8
|
+
ExportBundleV2Schema,
|
|
9
|
+
ExportManifestV1Schema,
|
|
10
|
+
ExportManifestV2Schema,
|
|
11
|
+
ExportMemoryRecordV1Schema,
|
|
12
|
+
parseExportBundle,
|
|
13
|
+
parseExportManifest
|
|
14
|
+
} from "./chunk-OA3L7BFR.js";
|
|
15
|
+
import "./chunk-PZ5AY32C.js";
|
|
16
|
+
export {
|
|
17
|
+
CAPSULE_ID_PATTERN,
|
|
18
|
+
CapsuleBlockSchema,
|
|
19
|
+
CapsuleIncludesSchema,
|
|
20
|
+
CapsuleParentSchema,
|
|
21
|
+
CapsuleRetrievalPolicySchema,
|
|
22
|
+
ExportBundleV1Schema,
|
|
23
|
+
ExportBundleV2Schema,
|
|
24
|
+
ExportManifestV1Schema,
|
|
25
|
+
ExportManifestV2Schema,
|
|
26
|
+
ExportMemoryRecordV1Schema,
|
|
27
|
+
parseExportBundle,
|
|
28
|
+
parseExportManifest
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=types-V3FJ26TF.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|