@remnic/core 9.69.44 → 9.69.46
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.d.ts +14 -14
- package/dist/access-admin-ops-surface.js +36 -36
- package/dist/access-audit.js +2 -2
- package/dist/access-authorization-probe.d.ts +14 -14
- package/dist/access-authorization-probe.js +37 -37
- package/dist/access-boundary.d.ts +14 -14
- package/dist/access-boundary.js +36 -36
- package/dist/access-cli.js +90 -87
- package/dist/access-cli.js.map +1 -1
- package/dist/access-coding-context-resolution.d.ts +1 -1
- package/dist/access-extraction-force-flush.d.ts +14 -14
- package/dist/access-extraction-force-flush.js +36 -36
- package/dist/access-health-types.d.ts +1 -1
- package/dist/access-http-briefing.d.ts +14 -14
- package/dist/access-http-briefing.js +37 -37
- package/dist/access-http-lcm-compaction.d.ts +14 -14
- package/dist/access-http-lifecycle-flush.d.ts +14 -14
- package/dist/access-http-offline-stream.d.ts +14 -14
- package/dist/access-http-query.d.ts +2 -2
- package/dist/access-http-query.js +38 -38
- package/dist/access-http.d.ts +15 -15
- package/dist/access-http.js +52 -52
- package/dist/access-identity-continuity-surface.d.ts +11 -11
- package/dist/access-identity-continuity-surface.js +36 -36
- package/dist/access-lcm-surface.d.ts +14 -14
- package/dist/access-lcm-surface.js +36 -36
- package/dist/access-mcp-shared-context-tools.d.ts +14 -14
- package/dist/access-mcp.d.ts +14 -14
- package/dist/access-mcp.js +44 -44
- package/dist/access-memory-search-fanout.d.ts +2 -2
- package/dist/{access-namespace-preflight-CE-RrXKu.d.ts → access-namespace-preflight-DDnsN22V.d.ts} +1 -1
- package/dist/access-namespace-preflight.d.ts +3 -3
- package/dist/access-namespace-preflight.js +36 -36
- package/dist/access-observe-transcript.d.ts +11 -11
- package/dist/access-observe-write-category.d.ts +3 -3
- package/dist/access-observe-write-category.js +4 -4
- package/dist/access-observe-write-surface.d.ts +14 -14
- package/dist/access-observe-write-surface.js +36 -36
- package/dist/access-offline-manifest.d.ts +11 -11
- package/dist/access-offline-manifest.js +3 -3
- package/dist/access-operations-batch.js +37 -37
- package/dist/access-operations.d.ts +14 -14
- package/dist/access-operations.js +43 -43
- package/dist/access-recall-concurrency.d.ts +14 -14
- package/dist/access-recall-concurrency.js +36 -36
- package/dist/access-recall-response.d.ts +14 -14
- package/dist/access-recall-response.js +36 -36
- package/dist/access-recall-surface.d.ts +14 -14
- package/dist/access-recall-surface.js +36 -36
- package/dist/access-schema.d.ts +114 -114
- package/dist/access-schema.js +3 -3
- package/dist/{access-service-Cww3xAAy.d.ts → access-service-DGynYlbE.d.ts} +73 -73
- package/dist/access-service-helpers.d.ts +14 -14
- package/dist/access-service.d.ts +14 -14
- package/dist/access-service.js +36 -36
- package/dist/access-surface-catalog.d.ts +14 -14
- package/dist/access-surface-catalog.js +38 -38
- package/dist/access-wearables-meetings-surface.d.ts +4 -4
- package/dist/action-confidence.d.ts +1 -1
- package/dist/active-memory-bridge.d.ts +1 -1
- package/dist/active-recall.d.ts +1 -1
- package/dist/activity/digest.d.ts +1 -1
- package/dist/ambient-provenance.d.ts +1 -1
- package/dist/artifact-search.d.ts +1 -1
- package/dist/{auto-sync-QZD4RD6H.js → auto-sync-DG5KEOF5.js} +5 -5
- package/dist/background-generation.d.ts +1 -1
- package/dist/behavior-learner.d.ts +1 -1
- package/dist/behavior-signals.d.ts +1 -1
- package/dist/bootstrap.d.ts +11 -11
- package/dist/briefing-window.d.ts +2 -2
- package/dist/briefing.d.ts +2 -2
- package/dist/briefing.js +12 -12
- package/dist/buffer-surprise-report.d.ts +1 -1
- package/dist/buffer-turn-helpers.d.ts +1 -1
- package/dist/buffer.d.ts +2 -2
- package/dist/buffer.js +3 -3
- package/dist/bulk-import/index.d.ts +3 -3
- package/dist/calibration.d.ts +1 -1
- package/dist/calibration.js +2 -2
- package/dist/capabilities.d.ts +1 -1
- package/dist/{catalog-Ya3DDn_T.d.ts → catalog-Dl2hYqpS.d.ts} +1 -1
- package/dist/causal-behavior.d.ts +1 -1
- package/dist/causal-consolidation.d.ts +1 -1
- package/dist/causal-consolidation.js +13 -13
- package/dist/causal-trajectory-graph.d.ts +1 -1
- package/dist/{chunk-MOL7JK4F.js → chunk-3NYM6JA4.js} +2 -2
- package/dist/{chunk-WNMVUWI7.js → chunk-3UQIS2GC.js} +2 -2
- package/dist/{chunk-JDL5BYYF.js → chunk-47C6DF43.js} +3 -3
- package/dist/{chunk-ZBSP4BSN.js → chunk-4ECS33D4.js} +2 -2
- package/dist/{chunk-6EGIQEKC.js → chunk-4HTQ76O4.js} +2 -2
- package/dist/{chunk-7L54ARML.js → chunk-4XTSKGLX.js} +2 -2
- package/dist/{chunk-SUS64JER.js → chunk-5EHPB6RL.js} +2 -2
- package/dist/{chunk-J2MGTGKC.js → chunk-5ZXGH2ZL.js} +20 -3
- package/dist/chunk-5ZXGH2ZL.js.map +1 -0
- package/dist/{chunk-VDLNQVYW.js → chunk-62NYUFNH.js} +7 -7
- package/dist/{chunk-Y77UTH7F.js → chunk-66QOUYNS.js} +83 -64
- package/dist/chunk-66QOUYNS.js.map +1 -0
- package/dist/{chunk-SZV2L2IG.js → chunk-7BNB7KHB.js} +4 -4
- package/dist/chunk-AAQA6ZUP.js +41 -0
- package/dist/chunk-AAQA6ZUP.js.map +1 -0
- package/dist/{chunk-RJ7Z7YXK.js → chunk-AG6PANBG.js} +14 -20
- package/dist/chunk-AG6PANBG.js.map +1 -0
- package/dist/{chunk-IAGEEVQL.js → chunk-AN2O4KZY.js} +2 -2
- package/dist/{chunk-JUOJGZPV.js → chunk-AYP2FZFA.js} +2 -2
- package/dist/{chunk-XK76RJBN.js → chunk-AYZHHMTK.js} +2 -2
- package/dist/{chunk-LQVXSRAJ.js → chunk-B4EGAHHS.js} +2 -2
- package/dist/{chunk-HKQAI6XI.js → chunk-CFIHVWYZ.js} +2 -2
- package/dist/{chunk-DABSYX7V.js → chunk-CWMMKFO7.js} +3 -3
- package/dist/{chunk-WLHPCAVD.js → chunk-D5DTZBTV.js} +6 -6
- package/dist/{chunk-2HDLDBJW.js → chunk-DDBLZJRV.js} +2 -2
- package/dist/{chunk-F2FJTOV6.js → chunk-DO6R3LIE.js} +2 -2
- package/dist/{chunk-SHEHQBCG.js → chunk-DUJYRVUD.js} +638 -45
- package/dist/chunk-DUJYRVUD.js.map +1 -0
- package/dist/{chunk-LD22AAJI.js → chunk-EAZ3YZKN.js} +2 -2
- package/dist/{chunk-46FVFU7S.js → chunk-EC5SVM6H.js} +2 -2
- package/dist/{chunk-GKKLI23D.js → chunk-EEHQY7ER.js} +2 -2
- package/dist/{chunk-UHSOPTNB.js → chunk-EP6BA7VV.js} +50 -15
- package/dist/chunk-EP6BA7VV.js.map +1 -0
- package/dist/{chunk-BPXJINHW.js → chunk-EUP4AXIW.js} +2 -2
- package/dist/{chunk-2WMXZYMS.js → chunk-F5V7KRQS.js} +2 -2
- package/dist/{chunk-4AX5OYKC.js → chunk-FDDCZDBI.js} +2 -2
- package/dist/{chunk-XLPZN3A5.js → chunk-FMEP2RB5.js} +2 -2
- package/dist/{chunk-D7UUB33A.js → chunk-FSH6KRKO.js} +2 -2
- package/dist/{chunk-3254BYQV.js → chunk-GGY7WKMB.js} +1 -1
- package/dist/{chunk-ROXDOKLM.js → chunk-GYYLZOSO.js} +4 -4
- package/dist/{chunk-3K64PLY3.js → chunk-HXDXR2FH.js} +23 -23
- package/dist/{chunk-XOCGC3FJ.js → chunk-HYWPUYLO.js} +2 -2
- package/dist/{chunk-KQAFEZQX.js → chunk-IPLYGWQF.js} +5 -5
- package/dist/{chunk-M6FKXOYV.js → chunk-IXMWTNNY.js} +2 -2
- package/dist/{chunk-ZYSOT6HD.js → chunk-J3IWHCMF.js} +2 -2
- package/dist/{chunk-3YQ7VLP3.js → chunk-J5OXWG66.js} +2 -2
- package/dist/{chunk-H2N6SLTR.js → chunk-JIWZVOQM.js} +2 -2
- package/dist/{chunk-C3YEB7CR.js → chunk-JOP7W24J.js} +4 -4
- package/dist/{chunk-F6PTJLEM.js → chunk-K4KE5MYE.js} +1 -1
- package/dist/{chunk-IOTYIECA.js → chunk-KF57IQFX.js} +13 -13
- package/dist/{chunk-JL4TQYM5.js → chunk-L272A5QW.js} +33 -2
- package/dist/{chunk-JL4TQYM5.js.map → chunk-L272A5QW.js.map} +1 -1
- package/dist/chunk-M4DB6ZNN.js +87 -0
- package/dist/chunk-M4DB6ZNN.js.map +1 -0
- package/dist/{chunk-ZVQ5HF77.js → chunk-N46SNYMC.js} +2 -2
- package/dist/{chunk-YR5QT4SR.js → chunk-NAFPHFDM.js} +2 -2
- package/dist/{chunk-VHANUT45.js → chunk-ORQ7AZMU.js} +7 -7
- package/dist/{chunk-EOXCOZ6L.js → chunk-OV7GJ4KW.js} +2 -2
- package/dist/{chunk-VJXMFBVR.js → chunk-P7S7BVBJ.js} +2 -2
- package/dist/{chunk-GMU7MAHS.js → chunk-QUFJ3NJE.js} +260 -796
- package/dist/chunk-QUFJ3NJE.js.map +1 -0
- package/dist/{chunk-7F47R4H4.js → chunk-S3SND7SO.js} +2 -2
- package/dist/{chunk-5AJZ7EUW.js → chunk-S7KDHFF2.js} +2 -2
- package/dist/{chunk-4WMGRLTV.js → chunk-SRRZZHA5.js} +2 -2
- package/dist/{chunk-KDLOKVX7.js → chunk-SW42MMAH.js} +2 -2
- package/dist/{chunk-2YIUUXNK.js → chunk-T5NI5K46.js} +2 -2
- package/dist/{chunk-QCTXQ2HW.js → chunk-TE6B2UU6.js} +2 -2
- package/dist/{chunk-JDOBQPJY.js → chunk-TNQR7N52.js} +2 -2
- package/dist/{chunk-7K5Q6COX.js → chunk-TVVEYCNW.js} +4 -4
- package/dist/{chunk-T3F2HWIG.js → chunk-TZ44E732.js} +2 -2
- package/dist/{chunk-PF7LQ22G.js → chunk-U4ESGVZ2.js} +3 -3
- package/dist/{chunk-WJPR2XUN.js → chunk-UEJY6ZTQ.js} +2 -2
- package/dist/{chunk-K3IVJ5ML.js → chunk-UGGOQKO6.js} +26 -26
- package/dist/{chunk-OCX7OWOC.js → chunk-UOREPQ3C.js} +2 -2
- package/dist/{chunk-R3H2AXO2.js → chunk-VGRVJ6Z6.js} +2 -2
- package/dist/{chunk-IWHNT35B.js → chunk-WOBMSMUK.js} +3 -3
- package/dist/{chunk-DDGQDNQW.js → chunk-XLZZLUWL.js} +2 -2
- package/dist/{chunk-KORQWGUA.js → chunk-Y3XHIWVP.js} +2 -2
- package/dist/{chunk-BZDK5EOD.js → chunk-YFVIA5A6.js} +2 -2
- package/dist/{chunk-GR76OKET.js → chunk-YSBYNCCN.js} +2 -2
- package/dist/{chunk-OGAKUA7I.js → chunk-YUQPUK6H.js} +2 -2
- package/dist/{chunk-TRTLWUDD.js → chunk-ZTHGFTMW.js} +2 -2
- package/dist/{cli-Cl7bKIWJ.d.ts → cli-Cik3H7q1.d.ts} +5 -5
- package/dist/cli.d.ts +16 -16
- package/dist/cli.js +67 -67
- package/dist/coding/export-okf-codegraph.d.ts +1 -1
- package/dist/coding/export-okf-codegraph.js +11 -11
- package/dist/coding/pre-action-gate.d.ts +1 -1
- package/dist/compounding/engine.d.ts +2 -2
- package/dist/compounding/engine.js +12 -12
- package/dist/compounding/preference-consolidator.d.ts +1 -1
- package/dist/compression-optimizer.d.ts +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/connectors/codex-materialize-runner.d.ts +1 -1
- package/dist/connectors/codex-materialize-runner.js +12 -12
- package/dist/connectors/codex-materialize.d.ts +1 -1
- package/dist/connectors/index.d.ts +1 -1
- package/dist/connectors/index.js +12 -12
- package/dist/consolidation-provenance-check.d.ts +2 -2
- package/dist/consolidation-undo.d.ts +2 -2
- package/dist/contradiction/index.d.ts +4 -4
- package/dist/converge-config.d.ts +1 -1
- package/dist/convergence-refresh.d.ts +2 -2
- package/dist/convergence-refresh.js +14 -14
- package/dist/conversation-index/backend.d.ts +1 -1
- package/dist/conversation-index/chunker.d.ts +1 -1
- package/dist/conversation-index/faiss-adapter.d.ts +1 -1
- package/dist/conversation-index/indexer.d.ts +1 -1
- package/dist/conversation-index/search.d.ts +1 -1
- package/dist/corpus-watermark.d.ts +1 -1
- package/dist/corpus-watermark.js +14 -14
- package/dist/cross-lingual-recall.d.ts +1 -1
- package/dist/day-summary.d.ts +1 -1
- package/dist/deep-recall-http-glue.d.ts +14 -14
- package/dist/deep-recall-http-glue.js +4 -4
- package/dist/deep-recall-mcp-tools.d.ts +14 -14
- package/dist/deep-recall-policy-llm.d.ts +2 -2
- package/dist/deep-recall-policy-llm.js +3 -3
- package/dist/deep-recall-seeds.d.ts +1 -1
- package/dist/delinearize.d.ts +1 -1
- package/dist/dependency-propagation-config.d.ts +1 -1
- package/dist/{dependency-propagation-delivery-CggS9BFT.d.ts → dependency-propagation-delivery-BXaUoVUf.d.ts} +1 -1
- package/dist/direct-answer-wiring.d.ts +1 -1
- package/dist/direct-answer.d.ts +1 -1
- package/dist/embedding-fallback.d.ts +1 -1
- package/dist/enrichment/index.d.ts +1 -1
- package/dist/entity-origin-fields.d.ts +1 -1
- package/dist/entity-retrieval.d.ts +2 -2
- package/dist/entity-retrieval.js +12 -12
- package/dist/entity-schema.d.ts +1 -1
- package/dist/episodic-context.d.ts +1 -1
- package/dist/eval-trajectory-contracts.d.ts +1 -1
- package/dist/eval-trajectory-store.d.ts +1 -1
- package/dist/eval-trajectory.d.ts +1 -1
- package/dist/explicit-capture.d.ts +11 -11
- package/dist/explicit-capture.js +2 -2
- package/dist/external-wiki-access.d.ts +14 -14
- package/dist/external-wiki-access.js +37 -37
- package/dist/external-wiki-collection-registration.d.ts +1 -1
- package/dist/external-wiki-collection.d.ts +1 -1
- package/dist/external-wiki-mcp-tools.d.ts +14 -14
- package/dist/extraction-error-classification.d.ts +1 -1
- package/dist/extraction-faithfulness.d.ts +2 -2
- package/dist/extraction-faithfulness.js +3 -3
- package/dist/extraction-judge-telemetry.d.ts +2 -2
- package/dist/extraction-judge-training.d.ts +2 -2
- package/dist/extraction-judge.d.ts +2 -2
- package/dist/extraction-judge.js +3 -3
- package/dist/extraction-liveness.d.ts +1 -1
- package/dist/extraction-normalization.d.ts +1 -1
- package/dist/extraction-prompt.d.ts +1 -1
- package/dist/extraction-source-grounding-rules.d.ts +1 -1
- package/dist/extraction-source-grounding.d.ts +1 -1
- package/dist/extraction-span-config.d.ts +1 -1
- package/dist/extraction-span-materialize.d.ts +1 -1
- package/dist/extraction-span-wire.d.ts +23 -4
- package/dist/extraction-span-wire.js +7 -8
- package/dist/extraction-span-wire.js.map +1 -1
- package/dist/extraction.d.ts +2 -2
- package/dist/extraction.js +19 -17
- package/dist/fallback-llm-codex-subscription.d.ts +1 -1
- package/dist/fallback-llm-codex-subscription.js +1 -1
- package/dist/fallback-llm.d.ts +1 -1
- package/dist/fallback-llm.js +2 -2
- package/dist/{generic-recall-paths-CoXPSnCw.d.ts → generic-recall-paths-BkVVEoeO.d.ts} +1 -1
- package/dist/graph-append-error.d.ts +1 -1
- package/dist/graph-dashboard-diff.d.ts +1 -1
- package/dist/graph-dashboard-key.d.ts +1 -1
- package/dist/graph-dashboard-parser.d.ts +1 -1
- package/dist/graph-edge-reinforcement.d.ts +1 -1
- package/dist/graph-jsonl.d.ts +1 -1
- package/dist/graph-path-reconstruction.d.ts +1 -1
- package/dist/graph-path-scoring.d.ts +1 -1
- package/dist/graph-snapshot.d.ts +1 -1
- package/dist/graph.d.ts +1 -1
- package/dist/harmonic-retrieval.js +1 -1
- package/dist/importance.d.ts +1 -1
- package/dist/importers/index.d.ts +1 -1
- package/dist/importers/test-utils.d.ts +1 -1
- package/dist/in-flight-reads.d.ts +1 -1
- package/dist/{index-fdw_oK5a.d.ts → index-Zb6SUV4R.d.ts} +3 -3
- package/dist/index.d.ts +703 -703
- package/dist/index.js +90 -87
- package/dist/intent.d.ts +1 -1
- package/dist/lcm/engine.d.ts +1 -1
- package/dist/lcm/index.d.ts +1 -1
- package/dist/lcm/index.js +3 -3
- package/dist/lcm/tools.d.ts +1 -1
- package/dist/lifecycle.d.ts +1 -1
- package/dist/live-connectors-runner.d.ts +1 -1
- package/dist/{local-llm-3-jtw52a.d.ts → local-llm-DdrhmecM.d.ts} +1 -1
- package/dist/local-llm-helpers.d.ts +2 -2
- package/dist/local-llm.d.ts +2 -2
- package/dist/local-model-endpoint.d.ts +1 -1
- package/dist/location/index.d.ts +5 -5
- package/dist/location/index.js +14 -14
- package/dist/maintenance/memory-governance.d.ts +1 -1
- package/dist/maintenance/memory-governance.js +12 -12
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.d.ts +2 -2
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +12 -12
- package/dist/maintenance/rebuild-memory-projection.d.ts +2 -2
- package/dist/maintenance/rebuild-memory-projection.js +13 -13
- package/dist/{maintenance-DgeeH0a1.d.ts → maintenance-Du_VRvVg.d.ts} +3 -3
- package/dist/mcp-memory-inspector-app.d.ts +14 -14
- package/dist/memory-action-policy.d.ts +1 -1
- package/dist/memory-age.d.ts +100 -0
- package/dist/memory-age.js +22 -0
- package/dist/memory-age.js.map +1 -0
- package/dist/memory-cache.d.ts +1 -1
- package/dist/memory-controller.d.ts +1 -1
- package/dist/memory-lifecycle-ledger-utils.d.ts +1 -1
- package/dist/memory-projection-store.d.ts +1 -1
- package/dist/memory-provenance.d.ts +1 -1
- package/dist/memory-snapshot.d.ts +1 -1
- package/dist/memory-subject-cli.d.ts +14 -14
- package/dist/memory-subject.d.ts +14 -14
- package/dist/memory-worth-outcomes.d.ts +2 -2
- package/dist/models-json.d.ts +1 -1
- package/dist/namespaces/migrate.d.ts +3 -3
- package/dist/namespaces/migrate.js +13 -13
- package/dist/namespaces/principal.d.ts +1 -1
- package/dist/namespaces/search.d.ts +1 -1
- package/dist/namespaces/search.js +3 -3
- package/dist/namespaces/storage.d.ts +3 -3
- package/dist/namespaces/storage.js +12 -12
- package/dist/native-knowledge.d.ts +1 -1
- package/dist/offline-sync-impression-drain.d.ts +1 -1
- package/dist/operator-doctor-corpus.d.ts +1 -1
- package/dist/operator-doctor-corpus.js +15 -15
- package/dist/operator-doctor-replica.d.ts +1 -1
- package/dist/operator-toolkit.d.ts +3 -3
- package/dist/operator-toolkit.js +20 -20
- package/dist/orchestration/compression-guideline-coordinator.d.ts +2 -2
- package/dist/orchestration/maintenance.d.ts +4 -4
- package/dist/orchestration/maintenance.js +20 -20
- package/dist/{orchestrator-VXWKdatm.d.ts → orchestrator-D9U3Zgjp.d.ts} +10 -10
- package/dist/orchestrator.d.ts +11 -11
- package/dist/orchestrator.js +90 -87
- package/dist/patterns-cli.d.ts +1 -1
- package/dist/{pipeline-CwXZBKR5.d.ts → pipeline-4lqKJZ_0.d.ts} +1 -1
- package/dist/policy-runtime.d.ts +1 -1
- package/dist/proactive-contention.d.ts +2 -2
- package/dist/provenance.d.ts +1 -1
- package/dist/{public-http-DdmM4scJ.d.ts → public-http-AabioFLh.d.ts} +1 -1
- package/dist/{qmd-DOLTPIQg.d.ts → qmd-DnoWaXKb.d.ts} +1 -1
- package/dist/qmd-preflight.d.ts +2 -2
- package/dist/qmd-recall-cache.d.ts +1 -1
- package/dist/qmd.d.ts +2 -2
- package/dist/recall-concurrency-config.d.ts +1 -1
- package/dist/recall-disclosure-escalation.d.ts +1 -1
- package/dist/recall-explain-renderer.d.ts +1 -1
- package/dist/recall-memory-map.d.ts +1 -1
- package/dist/recall-navigate-access.d.ts +1 -1
- package/dist/recall-navigate-disclosure.d.ts +1 -1
- package/dist/recall-navigate.d.ts +1 -1
- package/dist/recall-navigation-http-glue.d.ts +14 -14
- package/dist/recall-navigation-mcp-tools.d.ts +14 -14
- package/dist/recall-navigation-operations.js +37 -37
- package/dist/recall-navigation-renderer.d.ts +1 -1
- package/dist/recall-navigation.d.ts +1 -1
- package/dist/recall-navigation.js +36 -36
- package/dist/recall-planner-llm.d.ts +1 -1
- package/dist/recall-planner-llm.js +2 -2
- package/dist/recall-state-view-admission.d.ts +2 -2
- package/dist/recall-state-view-admission.js +3 -3
- package/dist/recall-state-view-anchors.d.ts +1 -1
- package/dist/recall-state.d.ts +1 -1
- package/dist/recall-tag-filter.d.ts +1 -1
- package/dist/recall-timings.d.ts +1 -1
- package/dist/recall-xray-cli.d.ts +1 -1
- package/dist/recall-xray-renderer.d.ts +1 -1
- package/dist/recall-xray.d.ts +1 -1
- package/dist/reconcile/cursor.d.ts +1 -1
- package/dist/reconcile/manifest.d.ts +1 -1
- package/dist/reconcile/manifest.js +2 -2
- package/dist/reconcile/plan.d.ts +1 -1
- package/dist/replay/normalizers/chatgpt.d.ts +1 -1
- package/dist/replay/normalizers/claude.d.ts +1 -1
- package/dist/replay/normalizers/openclaw.d.ts +1 -1
- package/dist/replay/normalizers/shared.d.ts +1 -1
- package/dist/replay/runner.d.ts +1 -1
- package/dist/replay/types.d.ts +1 -1
- package/dist/replica-divergence.d.ts +1 -1
- package/dist/replica-peers-config.d.ts +1 -1
- package/dist/resolve-auth-token.d.ts +1 -1
- package/dist/retrieval-agents.d.ts +2 -2
- package/dist/retrieval-tiers.d.ts +1 -1
- package/dist/routing/engine.d.ts +1 -1
- package/dist/routing/store.d.ts +1 -1
- package/dist/salvage-envelope.d.ts +1 -1
- package/dist/schemas.d.ts +160 -160
- package/dist/{scope-profiles-C564-hrv.d.ts → scope-profiles-crazXegZ.d.ts} +1 -1
- package/dist/search/embed-helper.d.ts +1 -1
- package/dist/search/factory.d.ts +1 -1
- package/dist/search/factory.js +2 -2
- package/dist/search/index.d.ts +1 -1
- package/dist/search/index.js +4 -4
- package/dist/search/lancedb-backend.d.ts +1 -1
- package/dist/search/meilisearch-backend.d.ts +1 -1
- package/dist/search/noop-backend.d.ts +1 -1
- package/dist/search/orama-backend.d.ts +1 -1
- package/dist/search/port.d.ts +1 -1
- package/dist/search/remote-backend.d.ts +1 -1
- package/dist/{semantic-consolidation-g6x-ShY8.d.ts → semantic-consolidation-B09JI9WM.d.ts} +1 -1
- package/dist/semantic-consolidation.d.ts +2 -2
- package/dist/semantic-consolidation.js +13 -13
- package/dist/semantic-rule-promotion.js +12 -12
- package/dist/semantic-rule-verifier.d.ts +1 -1
- package/dist/semantic-rule-verifier.js +12 -12
- package/dist/{service-CaCOk0rd.d.ts → service-ByjbCuj7.d.ts} +2 -2
- package/dist/session-observer-bands.d.ts +1 -1
- package/dist/session-observer-state.d.ts +1 -1
- package/dist/shared-context/manager.d.ts +7 -7
- package/dist/signal.d.ts +1 -1
- package/dist/source-agent-qualifier.d.ts +1 -1
- package/dist/source-agent-qualifier.js +15 -15
- package/dist/source-attribution.d.ts +7 -4
- package/dist/source-attribution.js +1 -1
- package/dist/standup/build.js +12 -12
- package/dist/{storage-C9nsZX5Q.d.ts → storage-CbdF077z.d.ts} +17 -3
- package/dist/storage.d.ts +2 -2
- package/dist/storage.js +11 -11
- package/dist/subject-config.d.ts +1 -1
- package/dist/summarizer.d.ts +1 -1
- package/dist/summarizer.js +3 -3
- package/dist/summary-snapshot.d.ts +1 -1
- package/dist/support-passport/index.d.ts +17 -17
- package/dist/support-passport/index.js +39 -39
- package/dist/{tagging-BA4RFdH3.d.ts → tagging-CF7DNV7_.d.ts} +2 -2
- package/dist/temporal-supersession.d.ts +2 -2
- package/dist/temporal-timeline-recall.d.ts +1 -1
- package/dist/temporal-validity.d.ts +1 -1
- package/dist/threading.d.ts +1 -1
- package/dist/tier-migration.d.ts +2 -2
- package/dist/tier-routing.d.ts +1 -1
- package/dist/topics.d.ts +1 -1
- package/dist/transcript.d.ts +1 -1
- package/dist/transfer/autodetect.js +1 -1
- package/dist/transfer/backup.js +1 -1
- package/dist/transfer/capsule-export.js +2 -2
- package/dist/transfer/export-okf.d.ts +1 -1
- package/dist/transfer/export-okf.js +12 -12
- package/dist/transfer/types.d.ts +78 -78
- package/dist/trust-score-stage.d.ts +1 -1
- package/dist/trust-score.d.ts +1 -1
- package/dist/{types-Sps-lg5I.d.ts → types-nmhnJpxx.d.ts} +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/utility-runtime.d.ts +1 -1
- package/dist/verified-recall.js +12 -12
- package/dist/who-knows-cli.d.ts +14 -14
- package/dist/who-knows-cli.js +13 -13
- package/dist/who-knows.d.ts +14 -14
- package/dist/who-knows.js +12 -12
- package/dist/write-envelope.d.ts +1 -1
- package/package.json +2 -2
- package/src/background-generation.test.ts +77 -0
- package/src/dedup/merge.test.ts +185 -8
- package/src/extraction-span-wire.test.ts +17 -1
- package/src/extraction-span-wire.ts +46 -3
- package/src/extraction.ts +2 -11
- package/src/memory-age.test.ts +106 -0
- package/src/memory-age.ts +196 -0
- package/src/orchestration/recall-search-pipeline.test.ts +207 -1
- package/src/orchestration/recall-search-pipeline.ts +13 -9
- package/src/orchestration/semantic-merge-commit-effects.ts +31 -9
- package/src/orchestration/semantic-merge-persist.ts +16 -5
- package/src/providers/codex-subscription.test.ts +109 -3
- package/src/providers/codex-subscription.ts +57 -17
- package/src/source-attribution.test.ts +27 -0
- package/src/source-attribution.ts +41 -5
- package/src/storage/cas-revision-host.ts +22 -0
- package/src/storage/cas-revision-store.test.ts +44 -1
- package/src/storage/cas-revision-store.ts +23 -0
- package/src/storage/tombstone-blocked-capture-sync.ts +26 -1
- package/src/storage-frontmatter-cas.test.ts +49 -1
- package/src/storage.ts +1 -1
- package/src/summarizer.ts +18 -0
- package/dist/chunk-GMU7MAHS.js.map +0 -1
- package/dist/chunk-J2MGTGKC.js.map +0 -1
- package/dist/chunk-RJ7Z7YXK.js.map +0 -1
- package/dist/chunk-SHEHQBCG.js.map +0 -1
- package/dist/chunk-UHSOPTNB.js.map +0 -1
- package/dist/chunk-Y77UTH7F.js.map +0 -1
- /package/dist/{auto-sync-QZD4RD6H.js.map → auto-sync-DG5KEOF5.js.map} +0 -0
- /package/dist/{chunk-MOL7JK4F.js.map → chunk-3NYM6JA4.js.map} +0 -0
- /package/dist/{chunk-WNMVUWI7.js.map → chunk-3UQIS2GC.js.map} +0 -0
- /package/dist/{chunk-JDL5BYYF.js.map → chunk-47C6DF43.js.map} +0 -0
- /package/dist/{chunk-ZBSP4BSN.js.map → chunk-4ECS33D4.js.map} +0 -0
- /package/dist/{chunk-6EGIQEKC.js.map → chunk-4HTQ76O4.js.map} +0 -0
- /package/dist/{chunk-7L54ARML.js.map → chunk-4XTSKGLX.js.map} +0 -0
- /package/dist/{chunk-SUS64JER.js.map → chunk-5EHPB6RL.js.map} +0 -0
- /package/dist/{chunk-VDLNQVYW.js.map → chunk-62NYUFNH.js.map} +0 -0
- /package/dist/{chunk-SZV2L2IG.js.map → chunk-7BNB7KHB.js.map} +0 -0
- /package/dist/{chunk-IAGEEVQL.js.map → chunk-AN2O4KZY.js.map} +0 -0
- /package/dist/{chunk-JUOJGZPV.js.map → chunk-AYP2FZFA.js.map} +0 -0
- /package/dist/{chunk-XK76RJBN.js.map → chunk-AYZHHMTK.js.map} +0 -0
- /package/dist/{chunk-LQVXSRAJ.js.map → chunk-B4EGAHHS.js.map} +0 -0
- /package/dist/{chunk-HKQAI6XI.js.map → chunk-CFIHVWYZ.js.map} +0 -0
- /package/dist/{chunk-DABSYX7V.js.map → chunk-CWMMKFO7.js.map} +0 -0
- /package/dist/{chunk-WLHPCAVD.js.map → chunk-D5DTZBTV.js.map} +0 -0
- /package/dist/{chunk-2HDLDBJW.js.map → chunk-DDBLZJRV.js.map} +0 -0
- /package/dist/{chunk-F2FJTOV6.js.map → chunk-DO6R3LIE.js.map} +0 -0
- /package/dist/{chunk-LD22AAJI.js.map → chunk-EAZ3YZKN.js.map} +0 -0
- /package/dist/{chunk-46FVFU7S.js.map → chunk-EC5SVM6H.js.map} +0 -0
- /package/dist/{chunk-GKKLI23D.js.map → chunk-EEHQY7ER.js.map} +0 -0
- /package/dist/{chunk-BPXJINHW.js.map → chunk-EUP4AXIW.js.map} +0 -0
- /package/dist/{chunk-2WMXZYMS.js.map → chunk-F5V7KRQS.js.map} +0 -0
- /package/dist/{chunk-4AX5OYKC.js.map → chunk-FDDCZDBI.js.map} +0 -0
- /package/dist/{chunk-XLPZN3A5.js.map → chunk-FMEP2RB5.js.map} +0 -0
- /package/dist/{chunk-D7UUB33A.js.map → chunk-FSH6KRKO.js.map} +0 -0
- /package/dist/{chunk-3254BYQV.js.map → chunk-GGY7WKMB.js.map} +0 -0
- /package/dist/{chunk-ROXDOKLM.js.map → chunk-GYYLZOSO.js.map} +0 -0
- /package/dist/{chunk-3K64PLY3.js.map → chunk-HXDXR2FH.js.map} +0 -0
- /package/dist/{chunk-XOCGC3FJ.js.map → chunk-HYWPUYLO.js.map} +0 -0
- /package/dist/{chunk-KQAFEZQX.js.map → chunk-IPLYGWQF.js.map} +0 -0
- /package/dist/{chunk-M6FKXOYV.js.map → chunk-IXMWTNNY.js.map} +0 -0
- /package/dist/{chunk-ZYSOT6HD.js.map → chunk-J3IWHCMF.js.map} +0 -0
- /package/dist/{chunk-3YQ7VLP3.js.map → chunk-J5OXWG66.js.map} +0 -0
- /package/dist/{chunk-H2N6SLTR.js.map → chunk-JIWZVOQM.js.map} +0 -0
- /package/dist/{chunk-C3YEB7CR.js.map → chunk-JOP7W24J.js.map} +0 -0
- /package/dist/{chunk-F6PTJLEM.js.map → chunk-K4KE5MYE.js.map} +0 -0
- /package/dist/{chunk-IOTYIECA.js.map → chunk-KF57IQFX.js.map} +0 -0
- /package/dist/{chunk-ZVQ5HF77.js.map → chunk-N46SNYMC.js.map} +0 -0
- /package/dist/{chunk-YR5QT4SR.js.map → chunk-NAFPHFDM.js.map} +0 -0
- /package/dist/{chunk-VHANUT45.js.map → chunk-ORQ7AZMU.js.map} +0 -0
- /package/dist/{chunk-EOXCOZ6L.js.map → chunk-OV7GJ4KW.js.map} +0 -0
- /package/dist/{chunk-VJXMFBVR.js.map → chunk-P7S7BVBJ.js.map} +0 -0
- /package/dist/{chunk-7F47R4H4.js.map → chunk-S3SND7SO.js.map} +0 -0
- /package/dist/{chunk-5AJZ7EUW.js.map → chunk-S7KDHFF2.js.map} +0 -0
- /package/dist/{chunk-4WMGRLTV.js.map → chunk-SRRZZHA5.js.map} +0 -0
- /package/dist/{chunk-KDLOKVX7.js.map → chunk-SW42MMAH.js.map} +0 -0
- /package/dist/{chunk-2YIUUXNK.js.map → chunk-T5NI5K46.js.map} +0 -0
- /package/dist/{chunk-QCTXQ2HW.js.map → chunk-TE6B2UU6.js.map} +0 -0
- /package/dist/{chunk-JDOBQPJY.js.map → chunk-TNQR7N52.js.map} +0 -0
- /package/dist/{chunk-7K5Q6COX.js.map → chunk-TVVEYCNW.js.map} +0 -0
- /package/dist/{chunk-T3F2HWIG.js.map → chunk-TZ44E732.js.map} +0 -0
- /package/dist/{chunk-PF7LQ22G.js.map → chunk-U4ESGVZ2.js.map} +0 -0
- /package/dist/{chunk-WJPR2XUN.js.map → chunk-UEJY6ZTQ.js.map} +0 -0
- /package/dist/{chunk-K3IVJ5ML.js.map → chunk-UGGOQKO6.js.map} +0 -0
- /package/dist/{chunk-OCX7OWOC.js.map → chunk-UOREPQ3C.js.map} +0 -0
- /package/dist/{chunk-R3H2AXO2.js.map → chunk-VGRVJ6Z6.js.map} +0 -0
- /package/dist/{chunk-IWHNT35B.js.map → chunk-WOBMSMUK.js.map} +0 -0
- /package/dist/{chunk-DDGQDNQW.js.map → chunk-XLZZLUWL.js.map} +0 -0
- /package/dist/{chunk-KORQWGUA.js.map → chunk-Y3XHIWVP.js.map} +0 -0
- /package/dist/{chunk-BZDK5EOD.js.map → chunk-YFVIA5A6.js.map} +0 -0
- /package/dist/{chunk-GR76OKET.js.map → chunk-YSBYNCCN.js.map} +0 -0
- /package/dist/{chunk-OGAKUA7I.js.map → chunk-YUQPUK6H.js.map} +0 -0
- /package/dist/{chunk-TRTLWUDD.js.map → chunk-ZTHGFTMW.js.map} +0 -0
|
@@ -177,7 +177,7 @@ export interface CodexSubscriptionRunnerDeps {
|
|
|
177
177
|
/** Runs `codex exec`. Default: isolated subprocess via launchProcess. */
|
|
178
178
|
runCodexExec?: (request: CodexSubscriptionExecRequest) => Promise<CodexSubscriptionExecResult>;
|
|
179
179
|
/** Runs `codex login status`. Default: isolated subprocess. Receives the
|
|
180
|
-
* login-status
|
|
180
|
+
* shared login-status ceiling (not any one caller's deadline) and the
|
|
181
181
|
* shared-check abort signal (fires when the last waiter leaves). */
|
|
182
182
|
runLoginStatus?: (
|
|
183
183
|
executable: string,
|
|
@@ -210,6 +210,7 @@ interface LoginStatusCacheEntry {
|
|
|
210
210
|
}
|
|
211
211
|
|
|
212
212
|
const loginStatusCache = new Map<string, LoginStatusCacheEntry>();
|
|
213
|
+
const inFlightLoginByRunner = new WeakMap<CodexCliFallbackRunner, Map<string, LoginStatusCacheEntry>>();
|
|
213
214
|
const childrenByRunner = new WeakMap<CodexCliFallbackRunner, Set<number>>();
|
|
214
215
|
const runnerByOwner = new WeakMap<object, CodexCliFallbackRunner>();
|
|
215
216
|
const shutdownByRunner = new WeakMap<CodexCliFallbackRunner, AbortController>();
|
|
@@ -239,6 +240,7 @@ export function createCodexSubscriptionRunner(deps: CodexSubscriptionRunnerDeps
|
|
|
239
240
|
{ ...request, options: { ...request.options, signal } },
|
|
240
241
|
runnerDeps,
|
|
241
242
|
envSource,
|
|
243
|
+
runner,
|
|
242
244
|
);
|
|
243
245
|
};
|
|
244
246
|
childrenByRunner.set(runner, children);
|
|
@@ -320,7 +322,8 @@ export function beginCodexSubscriptionShutdown(
|
|
|
320
322
|
async function runCodexSubscriptionRequest(
|
|
321
323
|
request: CodexCliFallbackRequest,
|
|
322
324
|
deps: CodexSubscriptionRunnerDeps,
|
|
323
|
-
envSource: NodeJS.ProcessEnv
|
|
325
|
+
envSource: NodeJS.ProcessEnv,
|
|
326
|
+
runner: CodexCliFallbackRunner,
|
|
324
327
|
): Promise<CodexCliFallbackResult> {
|
|
325
328
|
const { config } = request;
|
|
326
329
|
assertNoApiKeyConfig(config);
|
|
@@ -339,7 +342,7 @@ async function runCodexSubscriptionRequest(
|
|
|
339
342
|
throw abortErrorOf(request.options.signal);
|
|
340
343
|
}
|
|
341
344
|
await assertSubscriptionLogin(executable, env, deps, {
|
|
342
|
-
|
|
345
|
+
runner,
|
|
343
346
|
callerTimeoutMs: timeoutMs,
|
|
344
347
|
deadlineStartedAt,
|
|
345
348
|
signal: request.options.signal,
|
|
@@ -460,8 +463,7 @@ function isAllowedEnvKey(key: string): boolean {
|
|
|
460
463
|
}
|
|
461
464
|
|
|
462
465
|
interface LoginCheckContext {
|
|
463
|
-
|
|
464
|
-
loginStatusTimeoutMs: number;
|
|
466
|
+
runner: CodexCliFallbackRunner;
|
|
465
467
|
/** The caller's overall effective deadline (login + exec). */
|
|
466
468
|
callerTimeoutMs: number;
|
|
467
469
|
deadlineStartedAt: number;
|
|
@@ -483,16 +485,32 @@ async function assertSubscriptionLogin(
|
|
|
483
485
|
ctx: LoginCheckContext
|
|
484
486
|
): Promise<void> {
|
|
485
487
|
const now = deps.now ?? Date.now;
|
|
486
|
-
const cacheKey =
|
|
488
|
+
const cacheKey = loginCacheKey(executable, env);
|
|
489
|
+
const inflight = inFlightLoginsFor(ctx.runner).get(cacheKey);
|
|
490
|
+
if (inflight && now() - inflight.at < LOGIN_STATUS_CACHE_TTL_MS) {
|
|
491
|
+
await waitForLoginEntry(inflight, cacheKey, ctx, now);
|
|
492
|
+
return;
|
|
493
|
+
}
|
|
487
494
|
const cached = loginStatusCache.get(cacheKey);
|
|
488
495
|
if (cached && now() - cached.at < LOGIN_STATUS_CACHE_TTL_MS) {
|
|
489
496
|
if (!cached.settled || (await authStoreFingerprint(env)) === cached.fingerprint) {
|
|
490
497
|
await waitForLoginEntry(cached, cacheKey, ctx, now);
|
|
491
498
|
return;
|
|
492
499
|
}
|
|
493
|
-
|
|
500
|
+
if (loginStatusCache.get(cacheKey) === cached) {
|
|
501
|
+
loginStatusCache.delete(cacheKey);
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
const raced = inFlightLoginsFor(ctx.runner).get(cacheKey);
|
|
505
|
+
if (raced && now() - raced.at < LOGIN_STATUS_CACHE_TTL_MS) {
|
|
506
|
+
await waitForLoginEntry(raced, cacheKey, ctx, now);
|
|
507
|
+
return;
|
|
508
|
+
}
|
|
509
|
+
const published = loginStatusCache.get(cacheKey);
|
|
510
|
+
if (published && now() - published.at < LOGIN_STATUS_CACHE_TTL_MS) {
|
|
511
|
+
await waitForLoginEntry(published, cacheKey, ctx, now);
|
|
512
|
+
return;
|
|
494
513
|
}
|
|
495
|
-
loginStatusCache.delete(cacheKey);
|
|
496
514
|
if (ctx.signal?.aborted) {
|
|
497
515
|
throw abortErrorOf(ctx.signal);
|
|
498
516
|
}
|
|
@@ -504,19 +522,19 @@ async function assertSubscriptionLogin(
|
|
|
504
522
|
controller: new AbortController(),
|
|
505
523
|
promise: Promise.resolve(undefined),
|
|
506
524
|
};
|
|
507
|
-
entry.promise = runLoginStatusCheck(executable, env, deps,
|
|
525
|
+
entry.promise = runLoginStatusCheck(executable, env, deps, entry);
|
|
508
526
|
entry.promise.then(
|
|
509
527
|
() => {
|
|
510
528
|
entry.settled = true;
|
|
529
|
+
loginStatusCache.set(cacheKey, entry);
|
|
530
|
+
dropInFlightLogin(ctx.runner, cacheKey, entry);
|
|
511
531
|
},
|
|
512
532
|
() => {
|
|
513
533
|
entry.settled = true;
|
|
514
|
-
|
|
515
|
-
loginStatusCache.delete(cacheKey);
|
|
516
|
-
}
|
|
534
|
+
dropInFlightLogin(ctx.runner, cacheKey, entry);
|
|
517
535
|
}
|
|
518
536
|
);
|
|
519
|
-
|
|
537
|
+
inFlightLoginsFor(ctx.runner).set(cacheKey, entry);
|
|
520
538
|
await waitForLoginEntry(entry, cacheKey, ctx, now);
|
|
521
539
|
}
|
|
522
540
|
|
|
@@ -524,16 +542,15 @@ async function runLoginStatusCheck(
|
|
|
524
542
|
executable: string,
|
|
525
543
|
env: NodeJS.ProcessEnv,
|
|
526
544
|
deps: CodexSubscriptionRunnerDeps,
|
|
527
|
-
ctx: LoginCheckContext,
|
|
528
545
|
entry: LoginStatusCacheEntry
|
|
529
546
|
): Promise<void> {
|
|
530
547
|
const runLoginStatus = deps.runLoginStatus!;
|
|
531
|
-
const result = await runLoginStatus(executable, env,
|
|
548
|
+
const result = await runLoginStatus(executable, env, LOGIN_STATUS_TIMEOUT_MS, entry.controller.signal);
|
|
532
549
|
const output = `${result.stdout}\n${result.stderr}`.trim();
|
|
533
550
|
if (TIMEOUT_PATTERN.test(output)) {
|
|
534
551
|
// A login-status subprocess timeout is a deadline expiry, not an auth
|
|
535
552
|
// failure — never report it as "unauthenticated".
|
|
536
|
-
throw new CodexSubscriptionTimeoutError(
|
|
553
|
+
throw new CodexSubscriptionTimeoutError(LOGIN_STATUS_TIMEOUT_MS);
|
|
537
554
|
}
|
|
538
555
|
if (result.status === 0 && LOGIN_OK_PATTERN.test(output)) {
|
|
539
556
|
entry.fingerprint = await authStoreFingerprint(env);
|
|
@@ -602,6 +619,7 @@ async function waitForLoginEntry(
|
|
|
602
619
|
entry.waiters--;
|
|
603
620
|
if (entry.waiters <= 0 && !entry.settled) {
|
|
604
621
|
entry.controller.abort();
|
|
622
|
+
dropInFlightLogin(ctx.runner, cacheKey, entry);
|
|
605
623
|
if (loginStatusCache.get(cacheKey) === entry) {
|
|
606
624
|
loginStatusCache.delete(cacheKey);
|
|
607
625
|
}
|
|
@@ -633,6 +651,28 @@ function resolveCodexAuthHome(env: NodeJS.ProcessEnv): string | undefined {
|
|
|
633
651
|
return profile ? path.join(profile, ".codex") : undefined;
|
|
634
652
|
}
|
|
635
653
|
|
|
654
|
+
function loginCacheKey(executable: string, env: NodeJS.ProcessEnv): string {
|
|
655
|
+
return `${executable}\0${resolveCodexAuthHome(env) ?? ""}`;
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
function inFlightLoginsFor(runner: CodexCliFallbackRunner): Map<string, LoginStatusCacheEntry> {
|
|
659
|
+
let map = inFlightLoginByRunner.get(runner);
|
|
660
|
+
if (!map) {
|
|
661
|
+
map = new Map();
|
|
662
|
+
inFlightLoginByRunner.set(runner, map);
|
|
663
|
+
}
|
|
664
|
+
return map;
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
function dropInFlightLogin(
|
|
668
|
+
runner: CodexCliFallbackRunner,
|
|
669
|
+
cacheKey: string,
|
|
670
|
+
entry: LoginStatusCacheEntry,
|
|
671
|
+
): void {
|
|
672
|
+
const map = inFlightLoginByRunner.get(runner);
|
|
673
|
+
if (map?.get(cacheKey) === entry) map.delete(cacheKey);
|
|
674
|
+
}
|
|
675
|
+
|
|
636
676
|
/**
|
|
637
677
|
* Args mirror the bench provider: fully sandboxed, ephemeral, no tools/hooks/
|
|
638
678
|
* plugins/memories — extraction must behave as a plain completion endpoint.
|
|
@@ -755,7 +795,7 @@ function execFailureError(
|
|
|
755
795
|
}
|
|
756
796
|
if (AUTH_FAILURE_PATTERN.test(combined)) {
|
|
757
797
|
// Re-check login on the next request; the cached status is now stale.
|
|
758
|
-
loginStatusCache.delete(
|
|
798
|
+
loginStatusCache.delete(loginCacheKey(executable, env));
|
|
759
799
|
return new CodexSubscriptionAuthError(
|
|
760
800
|
"expired_or_revoked",
|
|
761
801
|
"codex-subscription: the Codex CLI rejected the request as unauthenticated " +
|
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
formatCitation,
|
|
17
17
|
hasCitation,
|
|
18
18
|
hasCitationForTemplate,
|
|
19
|
+
lastRecognizedCitationMarker,
|
|
19
20
|
parseAllCitations,
|
|
20
21
|
parseCitation,
|
|
21
22
|
stripCitation,
|
|
@@ -578,6 +579,32 @@ test("citationTemplatesToRecognize drops undetectable shapes and keeps prior his
|
|
|
578
579
|
]);
|
|
579
580
|
});
|
|
580
581
|
|
|
582
|
+
test("stripCitationForTemplate: literal template strips the exact marker (#2951)", () => {
|
|
583
|
+
const template = "[cited-fixed]";
|
|
584
|
+
const body = "Fact body. [cited-fixed]";
|
|
585
|
+
assert.equal(citationTemplateIsDetectable(template), true);
|
|
586
|
+
assert.equal(hasCitationForTemplate(body, template), true);
|
|
587
|
+
assert.equal(stripCitationForTemplate(body, template), "Fact body.");
|
|
588
|
+
});
|
|
589
|
+
|
|
590
|
+
test("citationTemplatesToRecognize: overlapping custom marker wins over inner default (#2951)", () => {
|
|
591
|
+
const custom = "[Source: agent={agent}, session={sessionId}, ts={ts}; via={agent}]";
|
|
592
|
+
const ctx = {
|
|
593
|
+
agent: "planner",
|
|
594
|
+
session: "agent:planner:main",
|
|
595
|
+
ts: "2026-04-10T14:25:07Z",
|
|
596
|
+
};
|
|
597
|
+
const marker = formatCitation(ctx, custom);
|
|
598
|
+
const body = `The cadence is weekly. ${marker}`;
|
|
599
|
+
const recognized = citationTemplatesToRecognize(custom);
|
|
600
|
+
assert.ok(
|
|
601
|
+
recognized.indexOf(custom) < recognized.indexOf(DEFAULT_CITATION_FORMAT),
|
|
602
|
+
"current overlapping template must be recognized before the inner default",
|
|
603
|
+
);
|
|
604
|
+
assert.equal(lastRecognizedCitationMarker(body, recognized), marker);
|
|
605
|
+
assert.equal(stripRecognizedCitations(body, recognized), "The cadence is weekly.");
|
|
606
|
+
});
|
|
607
|
+
|
|
581
608
|
test("formatCitation: substituted values containing placeholder syntax are not re-interpreted", () => {
|
|
582
609
|
// Regression for PR #401 (low-severity): the previous implementation chained
|
|
583
610
|
// `.replace(/\{agent\}/g, ...)`, `.replace(/\{ts\}/g, ...)` etc. If the agent
|
|
@@ -499,10 +499,10 @@ export function citationTemplateIsDetectable(template: string): boolean {
|
|
|
499
499
|
}
|
|
500
500
|
|
|
501
501
|
/**
|
|
502
|
-
* Templates the merge path may lift, preserve, or strip
|
|
503
|
-
*
|
|
504
|
-
*
|
|
505
|
-
* dropped so we never hash or attach a marker we cannot re-match.
|
|
502
|
+
* Templates the merge path may lift, preserve, or strip. Longest
|
|
503
|
+
* templates first so an overlapping custom marker beats an inner default
|
|
504
|
+
* match; the current template wins equal-length ties. Undetectable
|
|
505
|
+
* shapes are dropped so we never hash or attach a marker we cannot re-match.
|
|
506
506
|
*/
|
|
507
507
|
export function citationTemplatesToRecognize(
|
|
508
508
|
primary: string | undefined,
|
|
@@ -514,9 +514,15 @@ export function citationTemplatesToRecognize(
|
|
|
514
514
|
if (!citationTemplateIsDetectable(template)) return;
|
|
515
515
|
if (!out.includes(template)) out.push(template);
|
|
516
516
|
};
|
|
517
|
-
add(DEFAULT_CITATION_FORMAT);
|
|
518
517
|
add(primary);
|
|
519
518
|
for (const template of extra) add(template);
|
|
519
|
+
add(DEFAULT_CITATION_FORMAT);
|
|
520
|
+
out.sort((a, b) => {
|
|
521
|
+
if (b.length !== a.length) return b.length - a.length;
|
|
522
|
+
if (a === primary && b !== primary) return -1;
|
|
523
|
+
if (b === primary && a !== primary) return 1;
|
|
524
|
+
return 0;
|
|
525
|
+
});
|
|
520
526
|
return out;
|
|
521
527
|
}
|
|
522
528
|
|
|
@@ -708,6 +714,9 @@ export function stripCitation(text: string): string {
|
|
|
708
714
|
* written under the default format can carry the default marker plus a
|
|
709
715
|
* custom marker appended after a config change; returning after the
|
|
710
716
|
* default pass alone left the custom marker inside hash inputs (#2330).
|
|
717
|
+
* - Fully-literal templates (no placeholders) are stripped by exact match
|
|
718
|
+
* of the template text, the same inclusion check `hasCitationForTemplate`
|
|
719
|
+
* uses.
|
|
711
720
|
* - All-placeholder templates (no literal prefix/suffix/separator) cannot
|
|
712
721
|
* produce a reliable matcher. `hasCitationForTemplate` already returns
|
|
713
722
|
* `false` for such templates, so this function never attempts to strip an
|
|
@@ -731,6 +740,13 @@ export function stripCitationForTemplate(
|
|
|
731
740
|
|
|
732
741
|
if (!hasCitationForTemplate(afterDefault, template)) return afterDefault;
|
|
733
742
|
|
|
743
|
+
PLACEHOLDER_REGEX.lastIndex = 0;
|
|
744
|
+
if (!PLACEHOLDER_REGEX.test(template)) {
|
|
745
|
+
PLACEHOLDER_REGEX.lastIndex = 0;
|
|
746
|
+
return stripExactLiteralCitation(afterDefault, template);
|
|
747
|
+
}
|
|
748
|
+
PLACEHOLDER_REGEX.lastIndex = 0;
|
|
749
|
+
|
|
734
750
|
// Build the template matcher. hasCitationForTemplate already returned true,
|
|
735
751
|
// which means templateMatcher produced a non-null result. The null branch
|
|
736
752
|
// here is a defensive fallback only — the default pass already ran.
|
|
@@ -769,6 +785,26 @@ export function stripCitationForTemplate(
|
|
|
769
785
|
return result.trimEnd();
|
|
770
786
|
}
|
|
771
787
|
|
|
788
|
+
function stripExactLiteralCitation(text: string, marker: string): string {
|
|
789
|
+
if (marker.length === 0) return text;
|
|
790
|
+
let result = "";
|
|
791
|
+
let lastIndex = 0;
|
|
792
|
+
let idx = text.indexOf(marker);
|
|
793
|
+
if (idx === -1) return text;
|
|
794
|
+
while (idx !== -1) {
|
|
795
|
+
const before = text.slice(lastIndex, idx).replace(/[ \t]+$/, "");
|
|
796
|
+
result += before;
|
|
797
|
+
lastIndex = idx + marker.length;
|
|
798
|
+
idx = text.indexOf(marker, lastIndex);
|
|
799
|
+
}
|
|
800
|
+
const after = text.slice(lastIndex).replace(/^[ \t]+/, "");
|
|
801
|
+
if (after.length > 0) {
|
|
802
|
+
if (result.length > 0) result += " ";
|
|
803
|
+
result += after;
|
|
804
|
+
}
|
|
805
|
+
return result.trimEnd();
|
|
806
|
+
}
|
|
807
|
+
|
|
772
808
|
function enclosingDelimiterRange(
|
|
773
809
|
text: string,
|
|
774
810
|
start: number,
|
|
@@ -72,4 +72,26 @@ export class CasRevisionHost extends CasRevisionStore {
|
|
|
72
72
|
await this.recoverPendingRevision(pathname);
|
|
73
73
|
return await this.beginRevisionTransaction(pathname, expectedContent);
|
|
74
74
|
}
|
|
75
|
+
|
|
76
|
+
/** #2837: best-effort post-deletion sweep of the target's receipt shard.
|
|
77
|
+
* The durable memory file is already gone, so a failed sweep must never
|
|
78
|
+
* fail the deletion itself — it logs instead. A PENDING shard (crash
|
|
79
|
+
* recovery evidence) and a foreign shard (another target's receipt) are
|
|
80
|
+
* kept, with a warning naming the recovery path. */
|
|
81
|
+
async sweepShardAfterDeletion(filePath: string): Promise<void> {
|
|
82
|
+
try {
|
|
83
|
+
const outcome = await this.removeRevisionShard(filePath);
|
|
84
|
+
if (outcome === "pending") {
|
|
85
|
+
log.warn(
|
|
86
|
+
`CAS revision shard for ${filePath} kept after memory deletion: a pending reservation stands — run recovery before the path is reused`,
|
|
87
|
+
);
|
|
88
|
+
} else if (outcome === "foreign") {
|
|
89
|
+
log.warn(
|
|
90
|
+
`CAS revision shard for ${filePath} kept after memory deletion: the shard names another target`,
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
} catch (err) {
|
|
94
|
+
log.warn(`failed to sweep CAS revision shard for deleted memory ${filePath}: ${err}`);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
75
97
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import assert from "node:assert/strict";
|
|
2
2
|
import { createHash } from "node:crypto";
|
|
3
|
-
import { mkdir, mkdtemp, readFile, readdir, rm, symlink, writeFile } from "node:fs/promises";
|
|
3
|
+
import { mkdir, mkdtemp, readFile, readdir, rm, stat, symlink, writeFile } from "node:fs/promises";
|
|
4
4
|
import os from "node:os";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import test from "node:test";
|
|
@@ -461,3 +461,46 @@ test("legacy landed pending whose file no longer matches expectedDigest is ambig
|
|
|
461
461
|
assert.equal((await store.readRevisionStatus(target)).status, "unavailable");
|
|
462
462
|
});
|
|
463
463
|
});
|
|
464
|
+
|
|
465
|
+
test("removeRevisionShard sweeps a committed shard, keeps pending evidence, never touches a foreign shard (#2837)", async () => {
|
|
466
|
+
await withStore(async (store, root) => {
|
|
467
|
+
const target = path.join(root, "memories", "fact-deleted.md");
|
|
468
|
+
const shard = shardPathFor(root, target);
|
|
469
|
+
const shardExists = async () =>
|
|
470
|
+
stat(shard).then(
|
|
471
|
+
() => true,
|
|
472
|
+
() => false,
|
|
473
|
+
);
|
|
474
|
+
|
|
475
|
+
// No receipt was ever minted: the sweep reports absence, not an error.
|
|
476
|
+
assert.equal(await store.removeRevisionShard(target), "absent");
|
|
477
|
+
|
|
478
|
+
const a = await store.beginRevisionTransaction(target);
|
|
479
|
+
await a.commit();
|
|
480
|
+
assert.equal(await shardExists(), true);
|
|
481
|
+
assert.equal(await store.removeRevisionShard(target), "removed");
|
|
482
|
+
assert.equal(await shardExists(), false, "the committed shard is gone once its memory is deleted");
|
|
483
|
+
assert.equal((await store.readRevisionStatus(target)).status, "absent");
|
|
484
|
+
|
|
485
|
+
// A PENDING marker is crash-recovery evidence: the sweep must keep it.
|
|
486
|
+
const b = await store.beginRevisionTransaction(target);
|
|
487
|
+
assert.equal(await store.removeRevisionShard(target), "pending");
|
|
488
|
+
assert.equal(await shardExists(), true, "the pending marker survives the deletion sweep");
|
|
489
|
+
await b.abort();
|
|
490
|
+
|
|
491
|
+
// A shard naming another target is never destroyed by this target's sweep.
|
|
492
|
+
await mkdir(path.dirname(shard), { recursive: true });
|
|
493
|
+
await writeFile(
|
|
494
|
+
shard,
|
|
495
|
+
`${JSON.stringify({
|
|
496
|
+
version: 1,
|
|
497
|
+
path: "memories/someone-else.md",
|
|
498
|
+
revision: "2026-08-01T00:00:00.000Z",
|
|
499
|
+
state: "committed",
|
|
500
|
+
})}\n`,
|
|
501
|
+
"utf8",
|
|
502
|
+
);
|
|
503
|
+
assert.equal(await store.removeRevisionShard(target), "foreign");
|
|
504
|
+
assert.equal(await shardExists(), true, "a foreign shard is kept — it names another target");
|
|
505
|
+
});
|
|
506
|
+
});
|
|
@@ -641,6 +641,29 @@ export class CasRevisionStore {
|
|
|
641
641
|
});
|
|
642
642
|
}
|
|
643
643
|
|
|
644
|
+
/** #2837: remove the target's receipt shard once its durable memory file
|
|
645
|
+
* has been deleted, so orphan shards cannot accumulate. Under the shard
|
|
646
|
+
* lock: a PENDING marker is crash-recovery evidence for
|
|
647
|
+
* {@link recoverPendingRevision} and is KEPT ("pending"); a shard naming
|
|
648
|
+
* another target is KEPT ("foreign") — never destroy a receipt you cannot
|
|
649
|
+
* attribute. Never touches the durable memory file or the legacy global
|
|
650
|
+
* metadata: a stale legacy entry keeps per-path monotonicity if the path
|
|
651
|
+
* is ever reused. */
|
|
652
|
+
async removeRevisionShard(
|
|
653
|
+
filePath: string,
|
|
654
|
+
): Promise<"removed" | "absent" | "pending" | "foreign"> {
|
|
655
|
+
const relativePath = await this.resolveRelativePath(filePath);
|
|
656
|
+
return await this.withShardLock(relativePath, async () => {
|
|
657
|
+
const { shardPath } = await this.getSafeShardInfo(relativePath);
|
|
658
|
+
const view = await this.readShardView(shardPath, relativePath);
|
|
659
|
+
if (view.kind === "missing") return "absent";
|
|
660
|
+
if (view.kind === "pending") return view.foreign ? "foreign" : "pending";
|
|
661
|
+
if (view.kind === "foreign" || view.foreign) return "foreign";
|
|
662
|
+
await unlink(shardPath);
|
|
663
|
+
return "removed";
|
|
664
|
+
});
|
|
665
|
+
}
|
|
666
|
+
|
|
644
667
|
/** #2813 (P1 C): recovery for a reservation left PENDING by a crash or a
|
|
645
668
|
* failed publication. The caller supplies the KNOWN outcome of the
|
|
646
669
|
* durable memory write: `fileWriteLanded` publishes the pending token as
|
|
@@ -10,6 +10,7 @@ import { withRawEntityPageMutation } from "./entity-canonical-id-lock.js";
|
|
|
10
10
|
import { readMaybeEncryptedFileFromChunks, writeMaybeEncryptedFileFromChunks } from "../secure-store/secure-fs.js";
|
|
11
11
|
import * as archiveMutation from "../archive-mutation-version.js";
|
|
12
12
|
import { invalidationCommitFingerprint, isSemanticFrontmatterChange } from "./deletion-revision-store.js";
|
|
13
|
+
import { CasRevisionHost } from "./cas-revision-host.js";
|
|
13
14
|
import type { CasRevisionTransaction } from "./cas-revision-store.js";
|
|
14
15
|
import {
|
|
15
16
|
buildExplicitCaptureDedupKey,
|
|
@@ -208,7 +209,11 @@ export abstract class TombstoneBlockedCaptureIndexHost {
|
|
|
208
209
|
protected abstract bumpMemoryStatusVersion(): void;
|
|
209
210
|
protected abstract bumpMemoryCorpusVersion(): void;
|
|
210
211
|
protected abstract markFactHashIndexNotAuthoritative(): void;
|
|
211
|
-
|
|
212
|
+
/** #2837: durable unlink plus deletion-revision record, WITHOUT the CAS
|
|
213
|
+
* shard sweep — the concrete {@link deleteManagedStorageFile} composes the
|
|
214
|
+
* two so every deletion funnel (invalidation, maintenance purge, archive
|
|
215
|
+
* move, offline sync) sweeps. */
|
|
216
|
+
protected abstract deleteManagedStorageFileDurable(filePath: string, deletionMtimeMs?: number | null): Promise<boolean>;
|
|
212
217
|
protected abstract writeManagedStorageFile(filePath: string, write: () => Promise<void>): Promise<void>;
|
|
213
218
|
|
|
214
219
|
/** #2813 (P1 C, #2807): reserve the target's next durable CAS revision
|
|
@@ -221,6 +226,26 @@ export abstract class TombstoneBlockedCaptureIndexHost {
|
|
|
221
226
|
return undefined;
|
|
222
227
|
}
|
|
223
228
|
|
|
229
|
+
/** #2837 (shard cleanup): after a managed memory file is durably deleted,
|
|
230
|
+
* sweep its per-target CAS receipt shard so orphan shards cannot grow
|
|
231
|
+
* forever. The sweep runs under the shard's own lock and is best-effort —
|
|
232
|
+
* the memory file is already gone, so a sweep failure logs and never
|
|
233
|
+
* fails the delete. The sweeper is a second CasRevisionHost over the same
|
|
234
|
+
* memory dir; the host is stateless and every mutation serializes through
|
|
235
|
+
* the sidecar's file locks, so it shares the same shard files
|
|
236
|
+
* StorageManager's own host operates on. */
|
|
237
|
+
private deletedMemoryShardSweeper: CasRevisionHost | null = null;
|
|
238
|
+
|
|
239
|
+
protected async deleteManagedStorageFile(filePath: string, deletionMtimeMs?: number | null): Promise<boolean> {
|
|
240
|
+
const deleted = await this.deleteManagedStorageFileDurable(filePath, deletionMtimeMs);
|
|
241
|
+
if (!deleted) return false;
|
|
242
|
+
if (this.deletedMemoryShardSweeper === null) {
|
|
243
|
+
this.deletedMemoryShardSweeper = new CasRevisionHost(this.tombstoneBlockedCaptureIndexOptions().memoryDir);
|
|
244
|
+
}
|
|
245
|
+
await this.deletedMemoryShardSweeper.sweepShardAfterDeletion(filePath);
|
|
246
|
+
return true;
|
|
247
|
+
}
|
|
248
|
+
|
|
224
249
|
private async writeStorageSecureFileChunks(filePath: string, chunks: AsyncIterable<Buffer>): Promise<void> {
|
|
225
250
|
const options = this.tombstoneBlockedCaptureIndexOptions();
|
|
226
251
|
await writeMaybeEncryptedFileFromChunks(
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import assert from "node:assert/strict";
|
|
2
|
-
import { mkdir, mkdtemp, readdir, readFile, rm, symlink, writeFile } from "node:fs/promises";
|
|
2
|
+
import { mkdir, mkdtemp, readdir, readFile, rm, stat, symlink, writeFile } from "node:fs/promises";
|
|
3
3
|
import { createHash } from "node:crypto";
|
|
4
4
|
import os from "node:os";
|
|
5
5
|
import path from "node:path";
|
|
@@ -838,3 +838,51 @@ test("crash after memory write before writeLanded recovers from host-forwarded e
|
|
|
838
838
|
);
|
|
839
839
|
});
|
|
840
840
|
});
|
|
841
|
+
|
|
842
|
+
test("deleting a memory sweeps its CAS revision shard (#2837)", async () => {
|
|
843
|
+
await withStorageDir(async (dir) => {
|
|
844
|
+
const storage = new StorageManager(dir);
|
|
845
|
+
const created = await storage.writeMemory("fact", "Deletion shard sweep content.", { source: "test" });
|
|
846
|
+
const memory = await storage.getMemoryById(created.id);
|
|
847
|
+
assert.ok(memory);
|
|
848
|
+
|
|
849
|
+
// Mint a standing receipt, then delete the memory through the public
|
|
850
|
+
// invalidation funnel (the same funnel maintenance purge and archive
|
|
851
|
+
// moves use underneath).
|
|
852
|
+
assert.equal(await storage.writeMemoryFrontmatter(memory, { tags: ["sweep"] }), true);
|
|
853
|
+
const shard = casShardPath(dir, memory.path);
|
|
854
|
+
assert.equal((await storage.readCasRevisionStatus(memory.path)).status, "present");
|
|
855
|
+
await stat(shard);
|
|
856
|
+
|
|
857
|
+
assert.equal(await storage.invalidateMemory(created.id), true);
|
|
858
|
+
assert.equal(await stat(shard).then(() => true, () => false), false, "the deleted memory's shard is swept");
|
|
859
|
+
assert.equal(
|
|
860
|
+
(await storage.readCasRevisionStatus(memory.path)).status,
|
|
861
|
+
"absent",
|
|
862
|
+
"no standing receipt survives the memory",
|
|
863
|
+
);
|
|
864
|
+
});
|
|
865
|
+
});
|
|
866
|
+
|
|
867
|
+
test("a pending shard survives memory deletion as recovery evidence, and the delete still succeeds (#2837)", async () => {
|
|
868
|
+
await withStorageDir(async (dir) => {
|
|
869
|
+
const storage = new StorageManager(dir);
|
|
870
|
+
const created = await storage.writeMemory("fact", "Pending shard kept on delete.", { source: "test" });
|
|
871
|
+
const memory = await storage.getMemoryById(created.id);
|
|
872
|
+
assert.ok(memory);
|
|
873
|
+
|
|
874
|
+
// Crash simulation: a reservation left PENDING for this target.
|
|
875
|
+
const seams = storage as unknown as { casRevisions: CasRevisionStore };
|
|
876
|
+
await seams.casRevisions.beginRevisionTransaction(memory.path);
|
|
877
|
+
const shard = casShardPath(dir, memory.path);
|
|
878
|
+
await stat(shard);
|
|
879
|
+
|
|
880
|
+
assert.equal(await storage.invalidateMemory(created.id), true, "the deletion itself never fails on the sweep");
|
|
881
|
+
assert.equal(
|
|
882
|
+
await stat(shard).then(() => true, () => false),
|
|
883
|
+
true,
|
|
884
|
+
"a PENDING marker is crash-recovery evidence and is kept",
|
|
885
|
+
);
|
|
886
|
+
assert.equal((await storage.readCasRevisionStatus(memory.path)).status, "unavailable");
|
|
887
|
+
});
|
|
888
|
+
});
|
package/src/storage.ts
CHANGED
|
@@ -2732,7 +2732,7 @@ export class StorageManager extends TombstoneBlockedCaptureIndexHost {
|
|
|
2732
2732
|
protected async writeManagedStorageFile(filePath: string, write: () => Promise<void>): Promise<void> {
|
|
2733
2733
|
return this.deletionRevisionStore.writeManagedStorageFile(filePath, write);
|
|
2734
2734
|
}
|
|
2735
|
-
protected async
|
|
2735
|
+
protected async deleteManagedStorageFileDurable(filePath: string, deletionMtimeMs?: number | null): Promise<boolean> {
|
|
2736
2736
|
return this.deletionRevisionStore.deleteManagedStorageFile(filePath, deletionMtimeMs);
|
|
2737
2737
|
}
|
|
2738
2738
|
|
package/src/summarizer.ts
CHANGED
|
@@ -360,6 +360,24 @@ Respond with valid JSON matching this schema:
|
|
|
360
360
|
|
|
361
361
|
const user = `Hour: ${hourIso}\nSession: ${sessionKey}\n\n${statsLine}${toolStatsLine}Conversation:\n${conversation}\n`;
|
|
362
362
|
|
|
363
|
+
if (this.config.backgroundGeneration) {
|
|
364
|
+
try {
|
|
365
|
+
const text = await completeBackgroundGeneration(this.config, [
|
|
366
|
+
{ role: "system", content: sys },
|
|
367
|
+
{ role: "user", content: user },
|
|
368
|
+
]);
|
|
369
|
+
const parsed = parseBackgroundGenerationJson(text, (value) => HourlySummaryExtendedSchema.parse(value));
|
|
370
|
+
if (parsed) {
|
|
371
|
+
log.debug(
|
|
372
|
+
`generated extended hourly summary for ${sessionKey} at ${hourIso} in ${Date.now() - startTime}ms (background)`
|
|
373
|
+
);
|
|
374
|
+
return { ...parsed, _meta: { userTurns, assistantTurns, toolCalls, toolCounts } };
|
|
375
|
+
}
|
|
376
|
+
} catch {
|
|
377
|
+
log.info("extended summary: background generation unavailable, continuing");
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
|
|
363
381
|
// Try local LLM first if enabled
|
|
364
382
|
if (this.shouldUseLocalLlm) {
|
|
365
383
|
try {
|