@remnic/core 9.54.5 → 9.54.7
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 +24 -24
- package/dist/access-admin-ops-surface.js +32 -29
- package/dist/access-authorization-probe.d.ts +25 -23
- package/dist/access-authorization-probe.js +35 -30
- package/dist/access-boundary.d.ts +26 -24
- package/dist/access-boundary.js +36 -31
- package/dist/access-cli.js +86 -80
- 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 +19 -19
- package/dist/access-extraction-force-flush.js +32 -29
- package/dist/access-health-types.d.ts +1 -1
- package/dist/access-http-lcm-compaction.d.ts +22 -22
- package/dist/access-http-lifecycle-flush.d.ts +22 -22
- package/dist/access-http-offline-stream.d.ts +18 -18
- package/dist/access-http-query.js +32 -29
- package/dist/access-http.d.ts +55 -37
- package/dist/access-http.js +52 -43
- package/dist/access-identity-continuity-surface.d.ts +9 -9
- package/dist/access-identity-continuity-surface.js +32 -29
- package/dist/access-lcm-surface.d.ts +21 -21
- package/dist/access-lcm-surface.js +32 -29
- package/dist/access-mcp.d.ts +22 -22
- package/dist/access-mcp.js +40 -36
- package/dist/access-memory-search-fanout.d.ts +2 -2
- package/dist/{access-namespace-preflight-BdHlGd_T.d.ts → access-namespace-preflight-CCNn_6NE.d.ts} +1 -1
- package/dist/access-namespace-preflight.d.ts +3 -3
- package/dist/access-namespace-preflight.js +32 -29
- package/dist/access-observe-write-surface.d.ts +22 -22
- package/dist/access-observe-write-surface.js +32 -29
- package/dist/access-offline-manifest.d.ts +9 -9
- package/dist/access-offline-manifest.js +2 -2
- package/dist/access-operations-batch.js +34 -31
- package/dist/access-operations.d.ts +23 -23
- package/dist/access-operations.js +38 -34
- package/dist/access-recall-concurrency.d.ts +21 -21
- package/dist/access-recall-concurrency.js +32 -29
- package/dist/access-recall-response.d.ts +19 -19
- package/dist/access-recall-response.js +32 -29
- package/dist/access-recall-surface.d.ts +19 -19
- package/dist/access-recall-surface.js +32 -29
- package/dist/access-schema.js +3 -3
- package/dist/{access-service-DL7X9hrg.d.ts → access-service-DK82xdNi.d.ts} +1314 -83
- package/dist/access-service-helpers.d.ts +22 -22
- package/dist/access-service.d.ts +31 -31
- package/dist/access-service.js +32 -29
- package/dist/access-surface-catalog.d.ts +22 -22
- package/dist/access-surface-catalog.js +209 -2
- package/dist/access-surface-catalog.js.map +1 -1
- package/dist/access-wearables-meetings-surface.d.ts +3 -3
- package/dist/action-confidence.d.ts +1 -1
- package/dist/active-memory-bridge.d.ts +6 -5
- package/dist/active-memory-bridge.js +2 -2
- package/dist/active-recall.d.ts +1 -1
- package/dist/active-recall.js +2 -1
- package/dist/active-recall.js.map +1 -1
- package/dist/adapters/index.js +4 -4
- package/dist/adapters/registry.js +2 -2
- package/dist/admin-console/public/what-helps-me/app.js +1594 -0
- package/dist/admin-console/public/what-helps-me/index.html +339 -0
- package/dist/admin-console/public/what-helps-me/model.js +685 -0
- package/dist/admin-console/public/what-helps-me/what-helps-me.css +1296 -0
- package/dist/ambient-provenance.d.ts +1 -1
- package/dist/artifact-search.d.ts +1 -1
- package/dist/{auto-sync-TDHLZPVP.js → auto-sync-NR3GPCOA.js} +4 -4
- package/dist/behavior-learner.d.ts +1 -1
- package/dist/behavior-signals.d.ts +1 -1
- package/dist/bootstrap.d.ts +9 -9
- package/dist/briefing.d.ts +2 -2
- package/dist/briefing.js +14 -14
- 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 +2 -2
- package/dist/bulk-import/index.d.ts +3 -3
- package/dist/calibration.d.ts +1 -1
- package/dist/calibration.js +1 -1
- package/dist/capabilities.d.ts +1 -1
- package/dist/{catalog-B90is4d8.d.ts → catalog-DGFf8mD9.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 +15 -15
- package/dist/causal-trajectory-graph.d.ts +1 -1
- package/dist/{chunk-CSY44OKU.js → chunk-26ZXBTYN.js} +4 -4
- package/dist/chunk-26ZXBTYN.js.map +1 -0
- package/dist/{chunk-LLJMAULE.js → chunk-2FKEIPIT.js} +5 -5
- package/dist/{chunk-AU7Q3LSC.js → chunk-2QSZNTDO.js} +4 -4
- package/dist/chunk-37DZZFFM.js +502 -0
- package/dist/chunk-37DZZFFM.js.map +1 -0
- package/dist/chunk-3HSRWJTC.js +9 -0
- package/dist/chunk-3HSRWJTC.js.map +1 -0
- package/dist/{chunk-TKFGFDPJ.js → chunk-3TIZPSJC.js} +4 -4
- package/dist/{chunk-B4T3FQMT.js → chunk-43SEBY2M.js} +1 -1
- package/dist/{chunk-LVKYLMSM.js → chunk-46SZBVDS.js} +2 -2
- package/dist/{chunk-YKZLOPTC.js → chunk-5FD7JMTX.js} +2 -2
- package/dist/{chunk-2PNXOQ4P.js → chunk-5NB726GV.js} +3 -7
- package/dist/chunk-5NB726GV.js.map +1 -0
- package/dist/chunk-62OKGIJA.js +39 -0
- package/dist/chunk-62OKGIJA.js.map +1 -0
- package/dist/{chunk-WM5LD6AT.js → chunk-6CYHUWCO.js} +2 -2
- package/dist/{chunk-BIF4SHMD.js → chunk-76JJSXK7.js} +1 -1
- package/dist/chunk-76JJSXK7.js.map +1 -0
- package/dist/{chunk-3SXLD5T3.js → chunk-7BD6O7ZV.js} +189 -4
- package/dist/chunk-7BD6O7ZV.js.map +1 -0
- package/dist/chunk-7TBXNYLO.js +346 -0
- package/dist/chunk-7TBXNYLO.js.map +1 -0
- package/dist/{chunk-YR65W7BV.js → chunk-BRR5EUTF.js} +3 -3
- package/dist/{chunk-JKW663ZN.js → chunk-CIAI24TQ.js} +2 -2
- package/dist/{chunk-3WGI7F4V.js → chunk-D3LBIUWV.js} +9219 -5233
- package/dist/chunk-D3LBIUWV.js.map +1 -0
- package/dist/{chunk-YDWPYDML.js → chunk-EKTP7MNS.js} +4 -4
- package/dist/{chunk-6LEIWWAF.js → chunk-F2JRDPON.js} +2 -2
- package/dist/{chunk-VYQ4URQB.js → chunk-FFRTNF3L.js} +2 -2
- package/dist/{chunk-TY6MKIWP.js → chunk-FONWBCVY.js} +3 -3
- package/dist/{chunk-XSV2YDCJ.js → chunk-FPLM2TKD.js} +2 -2
- package/dist/{chunk-VTU5IEKY.js → chunk-FTPONF6B.js} +2 -2
- package/dist/{chunk-6PZGKGAO.js → chunk-FWX7W5PM.js} +2 -2
- package/dist/{chunk-QPW3PAIH.js → chunk-G6DFSS6A.js} +2 -2
- package/dist/{chunk-2DD6ZHOM.js → chunk-GJ776BC2.js} +3 -3
- package/dist/{chunk-XKAR4RF6.js → chunk-GN3WRFJY.js} +6 -6
- package/dist/{chunk-RG426DJO.js → chunk-H7NAZ3UB.js} +2 -2
- package/dist/{chunk-BSXGTDVJ.js → chunk-HBUFQRIM.js} +2 -2
- package/dist/{chunk-FFEBSFVT.js → chunk-HGJ6NJ4E.js} +2 -2
- package/dist/{chunk-WB7JSQCP.js → chunk-HIEWDJ2O.js} +5 -2
- package/dist/{chunk-WB7JSQCP.js.map → chunk-HIEWDJ2O.js.map} +1 -1
- package/dist/{chunk-QTO6BMQZ.js → chunk-I3MSGFGD.js} +17 -6
- package/dist/chunk-I3MSGFGD.js.map +1 -0
- package/dist/{chunk-5JKUSBMX.js → chunk-IKP5OYQQ.js} +2 -2
- package/dist/{chunk-KQAFEZQX.js → chunk-IPLYGWQF.js} +5 -5
- package/dist/{chunk-DBY26JJJ.js → chunk-IQ4NVWEF.js} +2 -2
- package/dist/{chunk-7Q7JWLQ4.js → chunk-JYG4OLWH.js} +2 -2
- package/dist/{chunk-3OTSVCPK.js → chunk-K26NWEOC.js} +4 -4
- package/dist/{chunk-WZWZRZ2V.js → chunk-K2UGPTYY.js} +484 -43
- package/dist/chunk-K2UGPTYY.js.map +1 -0
- package/dist/{chunk-L6CQ7WIW.js → chunk-KFBOPMF6.js} +11 -11
- package/dist/chunk-KFBOPMF6.js.map +1 -0
- package/dist/{chunk-HOIRB77A.js → chunk-L6Z5OAS4.js} +2 -2
- package/dist/{chunk-7RZJWZ46.js → chunk-LEPOP46W.js} +5 -5
- package/dist/{chunk-QQXWFDRD.js → chunk-M4YHAODQ.js} +270 -684
- package/dist/chunk-M4YHAODQ.js.map +1 -0
- package/dist/{chunk-NGT35IGQ.js → chunk-MIH3CJPN.js} +3 -3
- package/dist/{chunk-QPAQSG3F.js → chunk-MK5VEWCR.js} +2 -2
- package/dist/chunk-NISZQW72.js +140 -0
- package/dist/chunk-NISZQW72.js.map +1 -0
- package/dist/{chunk-L7RTUEDG.js → chunk-OCIP6YMD.js} +2 -2
- package/dist/{chunk-2INWPC6E.js → chunk-PG4QBPVG.js} +20 -10
- package/dist/chunk-PG4QBPVG.js.map +1 -0
- package/dist/{chunk-DDA55IVB.js → chunk-PT54WISF.js} +189 -55
- package/dist/chunk-PT54WISF.js.map +1 -0
- package/dist/{chunk-UWJNKGBA.js → chunk-QZLDRQ4I.js} +5 -5
- package/dist/{chunk-UYOXFFEY.js → chunk-RUNORG2P.js} +3 -3
- package/dist/{chunk-LC3FD4BV.js → chunk-RZQ6W2W4.js} +39 -39
- package/dist/{chunk-MRGJZ75M.js → chunk-SMNYAMJD.js} +3 -3
- package/dist/{chunk-MKQBXQKU.js → chunk-TB6CBZ5V.js} +22 -15
- package/dist/chunk-TB6CBZ5V.js.map +1 -0
- package/dist/{chunk-DN2IDKI5.js → chunk-TO7ZTWJW.js} +2 -2
- package/dist/{chunk-K2TDK7GG.js → chunk-TWTUGCTY.js} +2 -2
- package/dist/{chunk-CUTFSLSD.js → chunk-UCTS3DDH.js} +2 -2
- package/dist/{chunk-JYIJNNN3.js → chunk-UG6VXIOK.js} +2 -2
- package/dist/{chunk-QOQQMVR2.js → chunk-UKYS3NU5.js} +2 -2
- package/dist/{chunk-VZRFGJCH.js → chunk-UPLZNJKN.js} +2 -2
- package/dist/{chunk-C23BYTJV.js → chunk-UW5NPZJ2.js} +40 -12
- package/dist/chunk-UW5NPZJ2.js.map +1 -0
- package/dist/{chunk-DOOWFDWN.js → chunk-V6ERBR7U.js} +2 -2
- package/dist/{chunk-7HG7MGAP.js → chunk-W5ZKPI34.js} +462 -2673
- package/dist/chunk-W5ZKPI34.js.map +1 -0
- package/dist/{chunk-HNDIND7P.js → chunk-XX4HPFFM.js} +54 -15
- package/dist/chunk-XX4HPFFM.js.map +1 -0
- package/dist/{chunk-N7CXQ5TA.js → chunk-XZHE2DEN.js} +1 -1
- package/dist/chunk-YXQEKCZM.js +223 -0
- package/dist/chunk-YXQEKCZM.js.map +1 -0
- package/dist/{chunk-6NNNURLK.js → chunk-Z54EM5YZ.js} +4 -4
- package/dist/{chunk-F2Y6I74C.js → chunk-ZRZVLB7O.js} +2 -2
- package/dist/{chunk-CLKBV3Z3.js → chunk-ZUKIUXHQ.js} +9 -9
- package/dist/{cli-jfuZXixq.d.ts → cli-BPDUXnAl.d.ts} +5 -5
- package/dist/cli.d.ts +22 -22
- package/dist/cli.js +66 -58
- package/dist/coding/pre-action-gate.d.ts +1 -1
- package/dist/compounding/engine.d.ts +2 -2
- package/dist/compounding/engine.js +14 -14
- 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/config.js +2 -1
- package/dist/connectors/codex-materialize-runner.d.ts +1 -1
- package/dist/connectors/codex-materialize-runner.js +14 -14
- package/dist/connectors/codex-materialize.d.ts +1 -1
- package/dist/connectors/index.d.ts +1 -1
- package/dist/connectors/index.js +14 -14
- package/dist/consolidation-provenance-check.d.ts +2 -2
- package/dist/consolidation-undo.d.ts +2 -2
- package/dist/contradiction/index.d.ts +2 -2
- package/dist/contradiction/index.js +2 -2
- package/dist/{contradiction-scan-KCADHXPE.js → contradiction-scan-JDTBXRGW.js} +3 -3
- package/dist/converge-config.d.ts +1 -1
- package/dist/convergence-refresh.d.ts +2 -2
- package/dist/convergence-refresh.js +16 -16
- package/dist/conversation-index/backend.d.ts +1 -1
- package/dist/conversation-index/backend.js +2 -2
- 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 +16 -16
- package/dist/day-summary.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-CTDuAVJc.d.ts → dependency-propagation-delivery-CzEfB31P.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-retrieval.d.ts +2 -2
- package/dist/entity-retrieval.js +14 -14
- package/dist/entity-schema.d.ts +1 -1
- package/dist/explicit-capture.d.ts +9 -9
- package/dist/explicit-capture.js +4 -3
- package/dist/external-wiki-access.d.ts +22 -22
- package/dist/external-wiki-access.js +33 -30
- 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 +22 -22
- package/dist/extraction-error-classification.d.ts +1 -1
- package/dist/extraction-faithfulness.d.ts +1 -1
- package/dist/extraction-faithfulness.js +2 -2
- package/dist/extraction-judge-telemetry.d.ts +1 -1
- package/dist/extraction-judge-training.d.ts +1 -1
- package/dist/extraction-judge.d.ts +1 -1
- package/dist/extraction-judge.js +2 -2
- 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.d.ts +1 -1
- package/dist/extraction.js +20 -20
- package/dist/fallback-llm.d.ts +14 -1
- package/dist/fallback-llm.js +1 -1
- package/dist/{first-start-migration-LMMZFLKK.js → first-start-migration-CRZCZAJN.js} +5 -5
- 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-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/in-flight-reads.d.ts +1 -1
- package/dist/index.d.ts +30 -747
- package/dist/index.js +203 -118
- package/dist/inline-script.d.ts +3 -0
- package/dist/inline-script.js +8 -0
- package/dist/inline-script.js.map +1 -0
- package/dist/intent.d.ts +1 -1
- package/dist/lcm/engine.d.ts +1 -1
- package/dist/lcm/engine.js +2 -2
- package/dist/lcm/index.d.ts +1 -1
- package/dist/lcm/index.js +2 -2
- 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.d.ts +2 -1
- package/dist/local-llm.js +2 -2
- package/dist/local-model-endpoint.d.ts +1 -1
- package/dist/maintenance/memory-governance.d.ts +1 -1
- package/dist/maintenance/memory-governance.js +14 -14
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.d.ts +2 -2
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +14 -14
- package/dist/maintenance/rebuild-memory-projection.d.ts +2 -2
- package/dist/maintenance/rebuild-memory-projection.js +15 -15
- package/dist/{maintenance-heMZSq7G.d.ts → maintenance-C8aRWfhq.d.ts} +3 -3
- package/dist/mcp-memory-inspector-app.d.ts +22 -22
- package/dist/mcp-read-only-tools.js +1 -1
- package/dist/memory-action-policy.d.ts +1 -1
- package/dist/memory-cache.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-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 +15 -15
- package/dist/namespaces/principal.d.ts +1 -1
- package/dist/namespaces/search.d.ts +1 -1
- package/dist/namespaces/search.js +6 -6
- package/dist/namespaces/storage.d.ts +3 -3
- package/dist/namespaces/storage.js +14 -14
- 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 +17 -17
- package/dist/operator-doctor-replica.d.ts +1 -1
- package/dist/operator-toolkit.d.ts +3 -3
- package/dist/operator-toolkit.js +23 -22
- package/dist/orchestration/compression-guideline-coordinator.d.ts +2 -2
- package/dist/orchestration/maintenance.d.ts +4 -4
- package/dist/orchestration/maintenance.js +19 -19
- package/dist/{orchestrator-BQQPsSjs.d.ts → orchestrator-D85CzDDY.d.ts} +8 -8
- package/dist/orchestrator.d.ts +9 -9
- package/dist/orchestrator.js +86 -80
- package/dist/patterns-cli.d.ts +1 -1
- package/dist/{pipeline-DFfmsnGk.d.ts → pipeline-DPcUifCO.d.ts} +1 -1
- package/dist/policy-runtime.d.ts +1 -1
- package/dist/proactive-contention.d.ts +1 -1
- package/dist/provenance.d.ts +1 -1
- package/dist/public-http-D3GBeII4.d.ts +25 -0
- package/dist/{qmd-BF5bcVRs.d.ts → qmd-dFCHp1r0.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-explain-renderer.js +3 -3
- package/dist/recall-memory-map.d.ts +1 -1
- package/dist/recall-planner-llm.d.ts +1 -1
- package/dist/recall-planner-llm.js +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-cli.js +4 -4
- package/dist/recall-xray-renderer.d.ts +1 -1
- package/dist/recall-xray-renderer.js +3 -3
- package/dist/recall-xray.d.ts +1 -1
- package/dist/recall-xray.js +2 -2
- package/dist/reconcile/cursor.d.ts +1 -1
- package/dist/reconcile/manifest.d.ts +1 -1
- 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/resume-bundles.js +3 -2
- 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/{scope-profiles-CbUOsE_E.d.ts → scope-profiles-DICK7GtN.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 +5 -5
- package/dist/search/index.d.ts +1 -1
- package/dist/search/index.js +9 -9
- 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-DAB3xdKM.d.ts → semantic-consolidation-BP7NAX0N.d.ts} +1 -1
- package/dist/semantic-consolidation.d.ts +2 -2
- package/dist/semantic-consolidation.js +15 -15
- package/dist/semantic-rule-promotion.js +14 -14
- package/dist/semantic-rule-verifier.d.ts +1 -1
- package/dist/semantic-rule-verifier.js +14 -14
- package/dist/{service-DGKg2O6r.d.ts → service-DT-pJyda.d.ts} +660 -660
- 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 +1 -1
- package/dist/signal.d.ts +1 -1
- package/dist/source-agent-qualifier.d.ts +1 -1
- package/dist/source-agent-qualifier.js +16 -16
- package/dist/{storage-CC1jKcWg.d.ts → storage-qOnaJ1Lw.d.ts} +4 -1
- package/dist/storage.d.ts +2 -2
- package/dist/storage.js +13 -13
- package/dist/summarizer.d.ts +1 -1
- package/dist/summarizer.js +5 -5
- package/dist/summary-snapshot.d.ts +1 -1
- package/dist/support-passport/index.d.ts +518 -0
- package/dist/support-passport/index.js +357 -0
- package/dist/support-passport/index.js.map +1 -0
- 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/tier-routing.js +2 -2
- package/dist/{tier-stats-JDN6HRNT.js → tier-stats-EXYSKSVN.js} +3 -3
- 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/types.d.ts +24 -24
- package/dist/trust-score-stage.d.ts +1 -1
- package/dist/trust-score.d.ts +1 -1
- package/dist/{types-BnQza1y8.d.ts → types-ed-SvS2t.d.ts} +7 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.js +1 -1
- package/dist/utility-runtime.d.ts +1 -1
- package/dist/verified-recall.js +14 -14
- package/dist/write-envelope.d.ts +1 -1
- package/dist/write-rate-limiter.d.ts +11 -5
- package/dist/write-rate-limiter.js +1 -1
- package/package.json +12 -2
- package/scripts/build-with-heap.mjs +11 -1
- package/src/access-authorization-probe.ts +20 -2
- package/src/access-boundary.ts +32 -0
- package/src/access-http.test.ts +1940 -643
- package/src/access-http.ts +81 -74
- package/src/access-mcp.ts +3 -1
- package/src/access-operations.ts +2 -0
- package/src/access-service.ts +612 -845
- package/src/access-surface-catalog.test.ts +40 -10
- package/src/access-surface-catalog.ts +15 -0
- package/src/active-memory-bridge.ts +17 -19
- package/src/config.ts +18 -9
- package/src/fallback-llm.test.ts +54 -0
- package/src/fallback-llm.ts +54 -9
- package/src/inline-script.ts +6 -0
- package/src/local-llm-headers-timeout.test.ts +42 -0
- package/src/local-llm.ts +8 -8
- package/src/mcp-read-only-tools.ts +3 -0
- package/src/relay/mission-access.test.ts +11 -11
- package/src/relay/mission-ui.test.ts +3 -1
- package/src/storage/tombstone-blocked-capture-sync.ts +31 -0
- package/src/storage-contract/failure-semantics.test.ts +102 -0
- package/src/support-passport/access-http-base.ts +143 -0
- package/src/support-passport/access-http.ts +172 -0
- package/src/support-passport/access-operations.ts +272 -0
- package/src/support-passport/access-service-base.test.ts +193 -0
- package/src/support-passport/access-service-base.ts +176 -0
- package/src/support-passport/access-surface.test.ts +283 -0
- package/src/support-passport/access-surface.ts +286 -0
- package/src/support-passport/card-projection.test.ts +8 -0
- package/src/support-passport/card-projection.ts +77 -16
- package/src/support-passport/card-replacement.ts +126 -0
- package/src/support-passport/card-service-commit-forwarding.test.ts +160 -0
- package/src/support-passport/card-service.test.ts +533 -31
- package/src/support-passport/card-service.ts +506 -364
- package/src/support-passport/card-state.ts +158 -0
- package/src/support-passport/config-model-routing.test.ts +37 -0
- package/src/support-passport/config.test.ts +34 -0
- package/src/support-passport/config.ts +41 -0
- package/src/support-passport/contracts.test.ts +15 -2
- package/src/support-passport/contracts.ts +13 -0
- package/src/support-passport/errors.ts +6 -0
- package/src/support-passport/generated-batch.test.ts +185 -0
- package/src/support-passport/generated-batch.ts +338 -0
- package/src/support-passport/grant-contracts.ts +45 -1
- package/src/support-passport/grant-generated-batch-scope.test.ts +201 -0
- package/src/support-passport/grant-service-cache.test.ts +2 -2
- package/src/support-passport/grant-service-cancellation.test.ts +2 -0
- package/src/support-passport/grant-service-marker-cache.test.ts +62 -0
- package/src/support-passport/grant-service.test.ts +853 -239
- package/src/support-passport/grant-service.ts +206 -57
- package/src/support-passport/grant-store.ts +7 -3
- package/src/support-passport/index.ts +10 -0
- package/src/support-passport/mcp-tools.test.ts +222 -0
- package/src/support-passport/mcp-tools.ts +187 -0
- package/src/support-passport/model-adapter.test.ts +840 -0
- package/src/support-passport/model-adapter.ts +602 -0
- package/src/support-passport/model-audit-pinned-write.test.ts +59 -0
- package/src/support-passport/model-audit.ts +152 -0
- package/src/support-passport/model-bridge.test.ts +456 -0
- package/src/support-passport/model-bridge.ts +439 -0
- package/src/support-passport/model-contracts.ts +124 -0
- package/src/support-passport/model-service.test.ts +1731 -0
- package/src/support-passport/model-service.ts +399 -0
- package/src/support-passport/owner-http.test.ts +671 -0
- package/src/support-passport/owner-lock.ts +26 -9
- package/src/support-passport/private-file.test.ts +99 -0
- package/src/support-passport/private-file.ts +139 -12
- package/src/support-passport/public-http.test.ts +476 -0
- package/src/support-passport/public-http.ts +601 -0
- package/src/support-passport/ui.test.ts +181 -0
- package/src/types.ts +7 -0
- package/src/write-rate-limiter.test.ts +30 -6
- package/src/write-rate-limiter.ts +29 -18
- package/dist/chunk-2INWPC6E.js.map +0 -1
- package/dist/chunk-2PNXOQ4P.js.map +0 -1
- package/dist/chunk-3SXLD5T3.js.map +0 -1
- package/dist/chunk-3WGI7F4V.js.map +0 -1
- package/dist/chunk-7HG7MGAP.js.map +0 -1
- package/dist/chunk-BIF4SHMD.js.map +0 -1
- package/dist/chunk-C23BYTJV.js.map +0 -1
- package/dist/chunk-CSY44OKU.js.map +0 -1
- package/dist/chunk-DDA55IVB.js.map +0 -1
- package/dist/chunk-HNDIND7P.js.map +0 -1
- package/dist/chunk-L6CQ7WIW.js.map +0 -1
- package/dist/chunk-MKQBXQKU.js.map +0 -1
- package/dist/chunk-QQXWFDRD.js.map +0 -1
- package/dist/chunk-QTO6BMQZ.js.map +0 -1
- package/dist/chunk-WZWZRZ2V.js.map +0 -1
- /package/dist/{auto-sync-TDHLZPVP.js.map → auto-sync-NR3GPCOA.js.map} +0 -0
- /package/dist/{chunk-LLJMAULE.js.map → chunk-2FKEIPIT.js.map} +0 -0
- /package/dist/{chunk-AU7Q3LSC.js.map → chunk-2QSZNTDO.js.map} +0 -0
- /package/dist/{chunk-TKFGFDPJ.js.map → chunk-3TIZPSJC.js.map} +0 -0
- /package/dist/{chunk-B4T3FQMT.js.map → chunk-43SEBY2M.js.map} +0 -0
- /package/dist/{chunk-LVKYLMSM.js.map → chunk-46SZBVDS.js.map} +0 -0
- /package/dist/{chunk-YKZLOPTC.js.map → chunk-5FD7JMTX.js.map} +0 -0
- /package/dist/{chunk-WM5LD6AT.js.map → chunk-6CYHUWCO.js.map} +0 -0
- /package/dist/{chunk-YR65W7BV.js.map → chunk-BRR5EUTF.js.map} +0 -0
- /package/dist/{chunk-JKW663ZN.js.map → chunk-CIAI24TQ.js.map} +0 -0
- /package/dist/{chunk-YDWPYDML.js.map → chunk-EKTP7MNS.js.map} +0 -0
- /package/dist/{chunk-6LEIWWAF.js.map → chunk-F2JRDPON.js.map} +0 -0
- /package/dist/{chunk-VYQ4URQB.js.map → chunk-FFRTNF3L.js.map} +0 -0
- /package/dist/{chunk-TY6MKIWP.js.map → chunk-FONWBCVY.js.map} +0 -0
- /package/dist/{chunk-XSV2YDCJ.js.map → chunk-FPLM2TKD.js.map} +0 -0
- /package/dist/{chunk-VTU5IEKY.js.map → chunk-FTPONF6B.js.map} +0 -0
- /package/dist/{chunk-6PZGKGAO.js.map → chunk-FWX7W5PM.js.map} +0 -0
- /package/dist/{chunk-QPW3PAIH.js.map → chunk-G6DFSS6A.js.map} +0 -0
- /package/dist/{chunk-2DD6ZHOM.js.map → chunk-GJ776BC2.js.map} +0 -0
- /package/dist/{chunk-XKAR4RF6.js.map → chunk-GN3WRFJY.js.map} +0 -0
- /package/dist/{chunk-RG426DJO.js.map → chunk-H7NAZ3UB.js.map} +0 -0
- /package/dist/{chunk-BSXGTDVJ.js.map → chunk-HBUFQRIM.js.map} +0 -0
- /package/dist/{chunk-FFEBSFVT.js.map → chunk-HGJ6NJ4E.js.map} +0 -0
- /package/dist/{chunk-5JKUSBMX.js.map → chunk-IKP5OYQQ.js.map} +0 -0
- /package/dist/{chunk-KQAFEZQX.js.map → chunk-IPLYGWQF.js.map} +0 -0
- /package/dist/{chunk-DBY26JJJ.js.map → chunk-IQ4NVWEF.js.map} +0 -0
- /package/dist/{chunk-7Q7JWLQ4.js.map → chunk-JYG4OLWH.js.map} +0 -0
- /package/dist/{chunk-3OTSVCPK.js.map → chunk-K26NWEOC.js.map} +0 -0
- /package/dist/{chunk-HOIRB77A.js.map → chunk-L6Z5OAS4.js.map} +0 -0
- /package/dist/{chunk-7RZJWZ46.js.map → chunk-LEPOP46W.js.map} +0 -0
- /package/dist/{chunk-NGT35IGQ.js.map → chunk-MIH3CJPN.js.map} +0 -0
- /package/dist/{chunk-QPAQSG3F.js.map → chunk-MK5VEWCR.js.map} +0 -0
- /package/dist/{chunk-L7RTUEDG.js.map → chunk-OCIP6YMD.js.map} +0 -0
- /package/dist/{chunk-UWJNKGBA.js.map → chunk-QZLDRQ4I.js.map} +0 -0
- /package/dist/{chunk-UYOXFFEY.js.map → chunk-RUNORG2P.js.map} +0 -0
- /package/dist/{chunk-LC3FD4BV.js.map → chunk-RZQ6W2W4.js.map} +0 -0
- /package/dist/{chunk-MRGJZ75M.js.map → chunk-SMNYAMJD.js.map} +0 -0
- /package/dist/{chunk-DN2IDKI5.js.map → chunk-TO7ZTWJW.js.map} +0 -0
- /package/dist/{chunk-K2TDK7GG.js.map → chunk-TWTUGCTY.js.map} +0 -0
- /package/dist/{chunk-CUTFSLSD.js.map → chunk-UCTS3DDH.js.map} +0 -0
- /package/dist/{chunk-JYIJNNN3.js.map → chunk-UG6VXIOK.js.map} +0 -0
- /package/dist/{chunk-QOQQMVR2.js.map → chunk-UKYS3NU5.js.map} +0 -0
- /package/dist/{chunk-VZRFGJCH.js.map → chunk-UPLZNJKN.js.map} +0 -0
- /package/dist/{chunk-DOOWFDWN.js.map → chunk-V6ERBR7U.js.map} +0 -0
- /package/dist/{chunk-N7CXQ5TA.js.map → chunk-XZHE2DEN.js.map} +0 -0
- /package/dist/{chunk-6NNNURLK.js.map → chunk-Z54EM5YZ.js.map} +0 -0
- /package/dist/{chunk-F2Y6I74C.js.map → chunk-ZRZVLB7O.js.map} +0 -0
- /package/dist/{chunk-CLKBV3Z3.js.map → chunk-ZUKIUXHQ.js.map} +0 -0
- /package/dist/{contradiction-scan-KCADHXPE.js.map → contradiction-scan-JDTBXRGW.js.map} +0 -0
- /package/dist/{first-start-migration-LMMZFLKK.js.map → first-start-migration-CRZCZAJN.js.map} +0 -0
- /package/dist/{tier-stats-JDN6HRNT.js.map → tier-stats-EXYSKSVN.js.map} +0 -0
|
@@ -2,11 +2,16 @@ import type { StorageManager } from "../index.js";
|
|
|
2
2
|
import type { MemoryFile } from "../types.js";
|
|
3
3
|
import {
|
|
4
4
|
type StoredSupportPassportCard,
|
|
5
|
+
activeSupportPassportReplacementPredecessorIds,
|
|
5
6
|
computeSupportPassportOwnerKey,
|
|
6
7
|
projectSupportPassportCard,
|
|
7
8
|
} from "./card-projection.js";
|
|
8
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
SupportPassportListCardsInputSchema,
|
|
11
|
+
SupportPassportNamespaceSchema,
|
|
12
|
+
} from "./contracts.js";
|
|
9
13
|
import { SupportPassportError } from "./errors.js";
|
|
14
|
+
import { type GeneratedBatchMarker, isCommittedGeneratedCard } from "./generated-batch.js";
|
|
10
15
|
import {
|
|
11
16
|
type SupportPassportCreateGrantInput,
|
|
12
17
|
SupportPassportCreateGrantInputSchema,
|
|
@@ -27,20 +32,37 @@ import { requireSupportPassportOwnerLock, withSupportPassportOwnerLock } from ".
|
|
|
27
32
|
|
|
28
33
|
export interface SupportPassportGrantServiceDependencies {
|
|
29
34
|
grantStore: SupportPassportGrantStore;
|
|
30
|
-
resolveOwner(
|
|
35
|
+
resolveOwner(
|
|
36
|
+
principal: string,
|
|
37
|
+
): Promise<{ principal: string; namespace: string; storage: StorageManager }>;
|
|
31
38
|
resolveNamespace(namespace: string): Promise<StorageManager>;
|
|
32
39
|
now?: () => Date;
|
|
33
40
|
}
|
|
34
41
|
|
|
35
|
-
type SupportPassportGrantOwnerScope = Awaited<
|
|
42
|
+
type SupportPassportGrantOwnerScope = Awaited<
|
|
43
|
+
ReturnType<SupportPassportGrantServiceDependencies["resolveOwner"]>
|
|
44
|
+
>;
|
|
36
45
|
|
|
37
46
|
interface SupportPassportCardSnapshot {
|
|
38
47
|
version: string;
|
|
39
48
|
cardsById: ReadonlyMap<string, StoredSupportPassportCard>;
|
|
49
|
+
activeReplacementPredecessors: ReadonlySet<string>;
|
|
40
50
|
}
|
|
41
51
|
|
|
52
|
+
interface CachedOwnerCards {
|
|
53
|
+
version: string;
|
|
54
|
+
expiresAt: number;
|
|
55
|
+
cards: readonly StoredSupportPassportCard[];
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const MAX_OWNER_CARD_CACHE_ENTRIES = 256;
|
|
59
|
+
|
|
42
60
|
function invalidInput(): SupportPassportError {
|
|
43
|
-
return new SupportPassportError(
|
|
61
|
+
return new SupportPassportError(
|
|
62
|
+
"invalid_input",
|
|
63
|
+
"The share link request is invalid.",
|
|
64
|
+
400,
|
|
65
|
+
);
|
|
44
66
|
}
|
|
45
67
|
|
|
46
68
|
export class SupportPassportGrantService {
|
|
@@ -48,6 +70,7 @@ export class SupportPassportGrantService {
|
|
|
48
70
|
private readonly resolveOwner: SupportPassportGrantServiceDependencies["resolveOwner"];
|
|
49
71
|
private readonly resolveNamespace: SupportPassportGrantServiceDependencies["resolveNamespace"];
|
|
50
72
|
private readonly now: () => Date;
|
|
73
|
+
private readonly ownerCardCache = new Map<string, CachedOwnerCards>();
|
|
51
74
|
|
|
52
75
|
constructor(dependencies: SupportPassportGrantServiceDependencies) {
|
|
53
76
|
this.grantStore = dependencies.grantStore;
|
|
@@ -58,40 +81,52 @@ export class SupportPassportGrantService {
|
|
|
58
81
|
|
|
59
82
|
async createGrant(
|
|
60
83
|
input: SupportPassportCreateGrantInput,
|
|
61
|
-
options: { signal?: AbortSignal; onCommitted?: () => void | Promise<void> } = {}
|
|
84
|
+
options: { signal?: AbortSignal; onCommitted?: () => void | Promise<void> } = {},
|
|
62
85
|
): Promise<SupportPassportCreatedGrant> {
|
|
63
86
|
const requestedAt = this.now();
|
|
64
87
|
const parsed = SupportPassportCreateGrantInputSchema.safeParse(input);
|
|
65
88
|
if (!parsed.success) throw invalidInput();
|
|
89
|
+
const expiresAt = parsed.data.expiresAt ?? this.expiryFromDuration(requestedAt, parsed.data.durationMs);
|
|
66
90
|
const owner = await this.resolveOwnerScope(parsed.data.principal);
|
|
67
91
|
return await withSupportPassportOwnerLock(
|
|
68
92
|
owner.storage,
|
|
69
93
|
{ namespace: owner.namespace, principal: owner.principal },
|
|
70
94
|
async (ownerLock) => {
|
|
71
95
|
options.signal?.throwIfAborted();
|
|
72
|
-
const
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
ownerHash
|
|
78
|
-
).map((card) => [card.card.cardId, card])
|
|
96
|
+
const ownerKey = computeSupportPassportOwnerKey(owner.principal);
|
|
97
|
+
const snapshot = await this.readStoredCardSnapshot(
|
|
98
|
+
owner.storage,
|
|
99
|
+
owner.namespace,
|
|
100
|
+
ownerKey,
|
|
79
101
|
);
|
|
80
102
|
for (const cardRef of parsed.data.cards) {
|
|
81
|
-
const stored = cardsById.get(cardRef.cardId);
|
|
103
|
+
const stored = snapshot.cardsById.get(cardRef.cardId);
|
|
82
104
|
if (
|
|
83
105
|
!stored ||
|
|
84
106
|
stored.namespace !== owner.namespace ||
|
|
85
|
-
stored.owner !==
|
|
86
|
-
stored.card.status !== "active"
|
|
107
|
+
stored.owner !== ownerKey ||
|
|
108
|
+
stored.card.status !== "active" ||
|
|
109
|
+
snapshot.activeReplacementPredecessors.has(cardRef.cardId)
|
|
87
110
|
) {
|
|
88
|
-
throw new SupportPassportError(
|
|
111
|
+
throw new SupportPassportError(
|
|
112
|
+
"invalid_card_status",
|
|
113
|
+
"Only approved support cards can be shared.",
|
|
114
|
+
409,
|
|
115
|
+
);
|
|
89
116
|
}
|
|
90
117
|
if (stored.card.revision !== cardRef.revision) {
|
|
91
|
-
throw new SupportPassportError(
|
|
118
|
+
throw new SupportPassportError(
|
|
119
|
+
"revision_conflict",
|
|
120
|
+
"A support card changed after it was selected.",
|
|
121
|
+
409,
|
|
122
|
+
);
|
|
92
123
|
}
|
|
93
124
|
if (!this.publicCard(stored.card).success) {
|
|
94
|
-
throw new SupportPassportError(
|
|
125
|
+
throw new SupportPassportError(
|
|
126
|
+
"card_data_invalid",
|
|
127
|
+
"The support card data is invalid.",
|
|
128
|
+
500,
|
|
129
|
+
);
|
|
95
130
|
}
|
|
96
131
|
}
|
|
97
132
|
const created = await this.grantStore.create(
|
|
@@ -99,7 +134,7 @@ export class SupportPassportGrantService {
|
|
|
99
134
|
namespace: owner.namespace,
|
|
100
135
|
principal: owner.principal,
|
|
101
136
|
cards: parsed.data.cards,
|
|
102
|
-
expiresAt
|
|
137
|
+
expiresAt,
|
|
103
138
|
requestedAt,
|
|
104
139
|
},
|
|
105
140
|
{
|
|
@@ -107,7 +142,7 @@ export class SupportPassportGrantService {
|
|
|
107
142
|
options.signal?.throwIfAborted();
|
|
108
143
|
await requireSupportPassportOwnerLock(ownerLock);
|
|
109
144
|
},
|
|
110
|
-
}
|
|
145
|
+
},
|
|
111
146
|
);
|
|
112
147
|
try {
|
|
113
148
|
await requireSupportPassportOwnerLock(ownerLock);
|
|
@@ -125,22 +160,24 @@ export class SupportPassportGrantService {
|
|
|
125
160
|
});
|
|
126
161
|
notifySupportPassportCommitted(options.onCommitted);
|
|
127
162
|
return output;
|
|
128
|
-
}
|
|
163
|
+
},
|
|
129
164
|
);
|
|
130
165
|
}
|
|
131
166
|
|
|
132
|
-
async listGrants(input: {
|
|
167
|
+
async listGrants(input: {
|
|
168
|
+
principal: string;
|
|
169
|
+
}): Promise<SupportPassportOwnerGrant[]> {
|
|
133
170
|
const parsed = SupportPassportListGrantsInputSchema.safeParse(input);
|
|
134
171
|
if (!parsed.success) throw invalidInput();
|
|
135
172
|
const owner = await this.resolveOwnerScope(parsed.data.principal);
|
|
136
|
-
return (
|
|
137
|
-
this.
|
|
138
|
-
);
|
|
173
|
+
return (
|
|
174
|
+
await this.grantStore.listForOwner(owner.namespace, owner.principal)
|
|
175
|
+
).map((state) => this.ownerGrant(state));
|
|
139
176
|
}
|
|
140
177
|
|
|
141
178
|
async revokeGrant(
|
|
142
179
|
input: SupportPassportRevokeGrantInput,
|
|
143
|
-
options: { signal?: AbortSignal; onCommitted?: () => void | Promise<void> } = {}
|
|
180
|
+
options: { signal?: AbortSignal; onCommitted?: () => void | Promise<void> } = {},
|
|
144
181
|
): Promise<SupportPassportOwnerGrant> {
|
|
145
182
|
const parsed = SupportPassportRevokeGrantInputSchema.safeParse(input);
|
|
146
183
|
if (!parsed.success) throw invalidInput();
|
|
@@ -171,26 +208,50 @@ export class SupportPassportGrantService {
|
|
|
171
208
|
);
|
|
172
209
|
}
|
|
173
210
|
|
|
174
|
-
async readGrant(input: {
|
|
175
|
-
|
|
176
|
-
|
|
211
|
+
async readGrant(input: {
|
|
212
|
+
grantId: string;
|
|
213
|
+
secret: string;
|
|
214
|
+
}): Promise<SupportPassportPublicGuide> {
|
|
215
|
+
if (
|
|
216
|
+
!input ||
|
|
217
|
+
typeof input.grantId !== "string" ||
|
|
218
|
+
typeof input.secret !== "string"
|
|
219
|
+
) {
|
|
220
|
+
throw new SupportPassportError(
|
|
221
|
+
"grant_not_found",
|
|
222
|
+
"The share link was not found.",
|
|
223
|
+
404,
|
|
224
|
+
);
|
|
177
225
|
}
|
|
178
226
|
return await this.readGrantAttempt(input);
|
|
179
227
|
}
|
|
180
228
|
|
|
181
|
-
private async readGrantAttempt(input: {
|
|
182
|
-
|
|
229
|
+
private async readGrantAttempt(input: {
|
|
230
|
+
grantId: string;
|
|
231
|
+
secret: string;
|
|
232
|
+
}): Promise<SupportPassportPublicGuide> {
|
|
233
|
+
const initialState = await this.grantStore.authenticate(
|
|
234
|
+
input.grantId,
|
|
235
|
+
input.secret,
|
|
236
|
+
);
|
|
183
237
|
const storage = await this.resolveNamespace(initialState.namespace);
|
|
184
238
|
const initialSnapshot = await this.readStoredCardSnapshot(
|
|
185
239
|
storage,
|
|
186
240
|
initialState.namespace,
|
|
187
|
-
initialState.principalHash
|
|
241
|
+
initialState.principalHash,
|
|
188
242
|
);
|
|
189
243
|
const cards = this.readGrantCards(initialSnapshot, initialState);
|
|
190
244
|
const firstCard = cards[0];
|
|
191
|
-
if (!firstCard)
|
|
245
|
+
if (!firstCard)
|
|
246
|
+
throw new SupportPassportError(
|
|
247
|
+
"grant_stale",
|
|
248
|
+
"The shared support guide has changed.",
|
|
249
|
+
410,
|
|
250
|
+
);
|
|
192
251
|
const updatedAt = cards.reduce((latest, card) => {
|
|
193
|
-
return Date.parse(card.updatedAt) > Date.parse(latest)
|
|
252
|
+
return Date.parse(card.updatedAt) > Date.parse(latest)
|
|
253
|
+
? card.updatedAt
|
|
254
|
+
: latest;
|
|
194
255
|
}, firstCard.updatedAt);
|
|
195
256
|
return await withSupportPassportOwnerLock(
|
|
196
257
|
storage,
|
|
@@ -201,18 +262,29 @@ export class SupportPassportGrantService {
|
|
|
201
262
|
input.secret,
|
|
202
263
|
async (finalState) => {
|
|
203
264
|
if (finalState.namespace !== initialState.namespace) {
|
|
204
|
-
throw new SupportPassportError(
|
|
265
|
+
throw new SupportPassportError(
|
|
266
|
+
"grant_stale",
|
|
267
|
+
"The shared support guide has changed.",
|
|
268
|
+
410,
|
|
269
|
+
);
|
|
205
270
|
}
|
|
206
271
|
await requireSupportPassportOwnerLock(ownerLock);
|
|
207
272
|
const currentSnapshot = await this.readStoredCardSnapshot(
|
|
208
273
|
storage,
|
|
209
274
|
finalState.namespace,
|
|
210
|
-
finalState.principalHash
|
|
275
|
+
finalState.principalHash,
|
|
276
|
+
);
|
|
277
|
+
const currentCards = this.readGrantCards(
|
|
278
|
+
currentSnapshot,
|
|
279
|
+
finalState,
|
|
211
280
|
);
|
|
212
|
-
const currentCards = this.readGrantCards(currentSnapshot, finalState);
|
|
213
281
|
await requireSupportPassportOwnerLock(ownerLock);
|
|
214
282
|
if (JSON.stringify(currentCards) !== JSON.stringify(cards)) {
|
|
215
|
-
throw new SupportPassportError(
|
|
283
|
+
throw new SupportPassportError(
|
|
284
|
+
"grant_stale",
|
|
285
|
+
"The shared support guide has changed.",
|
|
286
|
+
410,
|
|
287
|
+
);
|
|
216
288
|
}
|
|
217
289
|
return SupportPassportPublicGuideSchema.parse({
|
|
218
290
|
schemaVersion: 1,
|
|
@@ -222,13 +294,16 @@ export class SupportPassportGrantService {
|
|
|
222
294
|
cards,
|
|
223
295
|
});
|
|
224
296
|
},
|
|
225
|
-
async () => await requireSupportPassportOwnerLock(ownerLock)
|
|
297
|
+
async () => await requireSupportPassportOwnerLock(ownerLock),
|
|
226
298
|
);
|
|
227
|
-
}
|
|
299
|
+
},
|
|
228
300
|
);
|
|
229
301
|
}
|
|
230
302
|
|
|
231
|
-
private readGrantCards(
|
|
303
|
+
private readGrantCards(
|
|
304
|
+
snapshot: SupportPassportCardSnapshot,
|
|
305
|
+
state: SupportPassportGrantState,
|
|
306
|
+
) {
|
|
232
307
|
return state.cards.map((cardRef) => {
|
|
233
308
|
const stored = snapshot.cardsById.get(cardRef.cardId);
|
|
234
309
|
if (
|
|
@@ -236,13 +311,22 @@ export class SupportPassportGrantService {
|
|
|
236
311
|
stored.namespace !== state.namespace ||
|
|
237
312
|
stored.owner !== state.principalHash ||
|
|
238
313
|
stored.card.status !== "active" ||
|
|
239
|
-
stored.card.revision !== cardRef.revision
|
|
314
|
+
stored.card.revision !== cardRef.revision ||
|
|
315
|
+
snapshot.activeReplacementPredecessors.has(cardRef.cardId)
|
|
240
316
|
) {
|
|
241
|
-
throw new SupportPassportError(
|
|
317
|
+
throw new SupportPassportError(
|
|
318
|
+
"grant_stale",
|
|
319
|
+
"The shared support guide has changed.",
|
|
320
|
+
410,
|
|
321
|
+
);
|
|
242
322
|
}
|
|
243
323
|
const publicCard = this.publicCard(stored.card);
|
|
244
324
|
if (!publicCard.success) {
|
|
245
|
-
throw new SupportPassportError(
|
|
325
|
+
throw new SupportPassportError(
|
|
326
|
+
"grant_stale",
|
|
327
|
+
"The shared support guide has changed.",
|
|
328
|
+
410,
|
|
329
|
+
);
|
|
246
330
|
}
|
|
247
331
|
return publicCard.data;
|
|
248
332
|
});
|
|
@@ -251,17 +335,37 @@ export class SupportPassportGrantService {
|
|
|
251
335
|
private async readStoredCardSnapshot(
|
|
252
336
|
storage: StorageManager,
|
|
253
337
|
namespace: string,
|
|
254
|
-
|
|
338
|
+
ownerKey: string,
|
|
255
339
|
): Promise<SupportPassportCardSnapshot> {
|
|
256
340
|
for (let attempt = 0; attempt < 3; attempt += 1) {
|
|
341
|
+
const markerCache = new Map<string, GeneratedBatchMarker | null>();
|
|
257
342
|
const before = this.cardSnapshotVersion(storage);
|
|
258
|
-
const
|
|
343
|
+
const cacheKey = JSON.stringify([storage.dir, namespace, ownerKey]);
|
|
344
|
+
const nowMs = this.now().getTime();
|
|
345
|
+
const cached = this.ownerCardCache.get(cacheKey);
|
|
346
|
+
let ownerCards: readonly StoredSupportPassportCard[];
|
|
347
|
+
if (cached && cached.version === before && cached.expiresAt >= nowMs) {
|
|
348
|
+
this.ownerCardCache.delete(cacheKey);
|
|
349
|
+
this.ownerCardCache.set(cacheKey, cached);
|
|
350
|
+
ownerCards = cached.cards;
|
|
351
|
+
} else {
|
|
352
|
+
this.ownerCardCache.delete(cacheKey);
|
|
353
|
+
ownerCards = this.projectOwnedCards(await storage.readAllMemories(), namespace, ownerKey);
|
|
354
|
+
}
|
|
259
355
|
const after = this.cardSnapshotVersion(storage);
|
|
260
356
|
if (before !== after) continue;
|
|
261
|
-
|
|
357
|
+
if (!cached || cached.version !== before || cached.expiresAt < nowMs) {
|
|
358
|
+
this.cacheOwnerCards(storage, cacheKey, after, ownerCards, nowMs);
|
|
359
|
+
}
|
|
360
|
+
const cards: StoredSupportPassportCard[] = [];
|
|
361
|
+
for (const card of ownerCards) {
|
|
362
|
+
if (await isCommittedGeneratedCard(storage, card, markerCache)) cards.push(card);
|
|
363
|
+
}
|
|
262
364
|
const snapshot = {
|
|
263
365
|
version: after,
|
|
264
366
|
cardsById: new Map(cards.map((card) => [card.card.cardId, card])),
|
|
367
|
+
activeReplacementPredecessors:
|
|
368
|
+
activeSupportPassportReplacementPredecessorIds(cards),
|
|
265
369
|
};
|
|
266
370
|
return snapshot;
|
|
267
371
|
}
|
|
@@ -271,13 +375,13 @@ export class SupportPassportGrantService {
|
|
|
271
375
|
private projectOwnedCards(
|
|
272
376
|
memories: MemoryFile[],
|
|
273
377
|
namespace: string,
|
|
274
|
-
|
|
378
|
+
ownerKey: string,
|
|
275
379
|
): StoredSupportPassportCard[] {
|
|
276
380
|
const cards = memories
|
|
277
381
|
.map((memory) => projectSupportPassportCard(memory))
|
|
278
382
|
.filter(
|
|
279
383
|
(card): card is StoredSupportPassportCard =>
|
|
280
|
-
card !== null && card.namespace === namespace && card.owner ===
|
|
384
|
+
card !== null && card.namespace === namespace && card.owner === ownerKey
|
|
281
385
|
);
|
|
282
386
|
const cardIds = new Set<string>();
|
|
283
387
|
for (const card of cards) {
|
|
@@ -289,13 +393,31 @@ export class SupportPassportGrantService {
|
|
|
289
393
|
return cards;
|
|
290
394
|
}
|
|
291
395
|
|
|
396
|
+
private cacheOwnerCards(
|
|
397
|
+
storage: StorageManager,
|
|
398
|
+
cacheKey: string,
|
|
399
|
+
version: string,
|
|
400
|
+
cards: readonly StoredSupportPassportCard[],
|
|
401
|
+
nowMs: number,
|
|
402
|
+
): void {
|
|
403
|
+
if (!storage.isHotCacheEnabled()) return;
|
|
404
|
+
const ttlMs = storage.hotCacheTtlMs();
|
|
405
|
+
if (!Number.isFinite(ttlMs) || ttlMs <= 0) return;
|
|
406
|
+
this.ownerCardCache.set(cacheKey, { version, cards, expiresAt: nowMs + ttlMs });
|
|
407
|
+
while (this.ownerCardCache.size > MAX_OWNER_CARD_CACHE_ENTRIES) {
|
|
408
|
+
const oldestKey = this.ownerCardCache.keys().next().value as string | undefined;
|
|
409
|
+
if (oldestKey === undefined) break;
|
|
410
|
+
this.ownerCardCache.delete(oldestKey);
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
|
|
292
414
|
private cardSnapshotVersion(storage: StorageManager): string {
|
|
293
415
|
return `${storage.getCorpusScanVersion()}:${storage.hotCacheKeyId()}`;
|
|
294
416
|
}
|
|
295
417
|
|
|
296
418
|
private async revokeCommittedGrant(
|
|
297
419
|
created: { state: SupportPassportGrantState; secret: string },
|
|
298
|
-
owner: SupportPassportGrantOwnerScope
|
|
420
|
+
owner: SupportPassportGrantOwnerScope,
|
|
299
421
|
): Promise<void> {
|
|
300
422
|
try {
|
|
301
423
|
await this.grantStore.revoke({
|
|
@@ -308,7 +430,7 @@ export class SupportPassportGrantService {
|
|
|
308
430
|
throw new SupportPassportError(
|
|
309
431
|
"storage_conflict",
|
|
310
432
|
"A share link could not be stopped after owner access changed. Review the active share list.",
|
|
311
|
-
500
|
|
433
|
+
500,
|
|
312
434
|
);
|
|
313
435
|
}
|
|
314
436
|
}
|
|
@@ -329,23 +451,50 @@ export class SupportPassportGrantService {
|
|
|
329
451
|
});
|
|
330
452
|
}
|
|
331
453
|
|
|
332
|
-
private
|
|
333
|
-
|
|
454
|
+
private expiryFromDuration(requestedAt: Date, durationMs: number | undefined): string {
|
|
455
|
+
if (durationMs === undefined) throw invalidInput();
|
|
456
|
+
const expiresAtMs = requestedAt.getTime() + durationMs;
|
|
457
|
+
if (!Number.isFinite(expiresAtMs)) throw invalidInput();
|
|
458
|
+
try {
|
|
459
|
+
return new Date(expiresAtMs).toISOString();
|
|
460
|
+
} catch {
|
|
461
|
+
throw invalidInput();
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
private async resolveOwnerScope(
|
|
466
|
+
principal: string,
|
|
467
|
+
): Promise<SupportPassportGrantOwnerScope> {
|
|
468
|
+
const requestedPrincipal = SupportPassportListCardsInputSchema.safeParse({
|
|
469
|
+
principal,
|
|
470
|
+
});
|
|
334
471
|
const owner = await this.resolveOwner(principal);
|
|
335
472
|
const namespace = SupportPassportNamespaceSchema.safeParse(owner.namespace);
|
|
336
|
-
const ownerPrincipal = SupportPassportListCardsInputSchema.safeParse({
|
|
473
|
+
const ownerPrincipal = SupportPassportListCardsInputSchema.safeParse({
|
|
474
|
+
principal: owner.principal,
|
|
475
|
+
});
|
|
337
476
|
if (
|
|
338
477
|
!requestedPrincipal.success ||
|
|
339
478
|
!namespace.success ||
|
|
340
479
|
!ownerPrincipal.success ||
|
|
341
480
|
ownerPrincipal.data.principal !== requestedPrincipal.data.principal
|
|
342
481
|
) {
|
|
343
|
-
throw new SupportPassportError(
|
|
482
|
+
throw new SupportPassportError(
|
|
483
|
+
"card_data_invalid",
|
|
484
|
+
"The support passport owner scope is invalid.",
|
|
485
|
+
500,
|
|
486
|
+
);
|
|
344
487
|
}
|
|
345
|
-
return {
|
|
488
|
+
return {
|
|
489
|
+
...owner,
|
|
490
|
+
principal: ownerPrincipal.data.principal,
|
|
491
|
+
namespace: namespace.data,
|
|
492
|
+
};
|
|
346
493
|
}
|
|
347
494
|
|
|
348
|
-
private ownerGrant(
|
|
495
|
+
private ownerGrant(
|
|
496
|
+
state: SupportPassportGrantState,
|
|
497
|
+
): SupportPassportOwnerGrant {
|
|
349
498
|
const status = state.revokedAt
|
|
350
499
|
? "revoked"
|
|
351
500
|
: Date.parse(state.expiresAt) <= this.now().getTime()
|
|
@@ -183,8 +183,12 @@ export class SupportPassportGrantStore {
|
|
|
183
183
|
if (!parsed.success) {
|
|
184
184
|
throw new SupportPassportError("invalid_input", "The share link request is invalid.", 400);
|
|
185
185
|
}
|
|
186
|
+
const expiresAt = parsed.data.expiresAt;
|
|
187
|
+
if (expiresAt === undefined) {
|
|
188
|
+
throw new SupportPassportError("invalid_input", "The share link request is invalid.", 400);
|
|
189
|
+
}
|
|
186
190
|
const requestedAt = input.requestedAt ?? this.now();
|
|
187
|
-
const durationMs = Date.parse(
|
|
191
|
+
const durationMs = Date.parse(expiresAt) - requestedAt.getTime();
|
|
188
192
|
if (
|
|
189
193
|
!Number.isFinite(requestedAt.getTime()) ||
|
|
190
194
|
!Number.isFinite(durationMs) ||
|
|
@@ -214,7 +218,7 @@ export class SupportPassportGrantStore {
|
|
|
214
218
|
const secret = secretBytes.toString("base64url");
|
|
215
219
|
const createdAt = this.now();
|
|
216
220
|
const createdAtMs = createdAt.getTime();
|
|
217
|
-
const expiresAtMs = Date.parse(
|
|
221
|
+
const expiresAtMs = Date.parse(expiresAt);
|
|
218
222
|
if (
|
|
219
223
|
!Number.isFinite(createdAtMs) ||
|
|
220
224
|
requestedAt.getTime() > createdAtMs ||
|
|
@@ -233,7 +237,7 @@ export class SupportPassportGrantStore {
|
|
|
233
237
|
secretHash: sha256("support-passport-secret:v1", secret),
|
|
234
238
|
cards: parsed.data.cards,
|
|
235
239
|
createdAt: createdAt.toISOString(),
|
|
236
|
-
expiresAt
|
|
240
|
+
expiresAt,
|
|
237
241
|
});
|
|
238
242
|
await this.requireMutationLock(mutationLock);
|
|
239
243
|
await mutationHooks.beforeCommit?.();
|
|
@@ -1,7 +1,17 @@
|
|
|
1
|
+
import "./access-operations.js";
|
|
2
|
+
|
|
1
3
|
export * from "./card-projection.js";
|
|
4
|
+
export * from "./access-surface.js";
|
|
2
5
|
export * from "./card-service.js";
|
|
6
|
+
export * from "./config.js";
|
|
3
7
|
export * from "./contracts.js";
|
|
4
8
|
export * from "./errors.js";
|
|
5
9
|
export * from "./grant-contracts.js";
|
|
6
10
|
export * from "./grant-service.js";
|
|
7
11
|
export * from "./grant-store.js";
|
|
12
|
+
export * from "./model-adapter.js";
|
|
13
|
+
export * from "./model-bridge.js";
|
|
14
|
+
export * from "./model-contracts.js";
|
|
15
|
+
export * from "./model-audit.js";
|
|
16
|
+
export * from "./model-service.js";
|
|
17
|
+
export * from "./public-http.js";
|