@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
|
@@ -0,0 +1,671 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import { request } from "node:http";
|
|
3
|
+
import test from "node:test";
|
|
4
|
+
|
|
5
|
+
import { EngramAccessHttpServer } from "../access-http.js";
|
|
6
|
+
import type { EngramAccessService } from "../access-service.js";
|
|
7
|
+
import { SupportPassportError } from "./errors.js";
|
|
8
|
+
|
|
9
|
+
const TOKEN = "support-passport-owner-token";
|
|
10
|
+
const REVISION = "a".repeat(64);
|
|
11
|
+
|
|
12
|
+
function card(status: "pending_review" | "active" = "pending_review") {
|
|
13
|
+
return {
|
|
14
|
+
cardId: "card-one",
|
|
15
|
+
title: "Plan changes",
|
|
16
|
+
statement: "Tell me before plans change.",
|
|
17
|
+
category: "transitions" as const,
|
|
18
|
+
status,
|
|
19
|
+
updatedAt: "2026-08-11T12:00:00.000Z",
|
|
20
|
+
reviewBy: "2027-02-07T12:00:00.000Z",
|
|
21
|
+
revision: REVISION,
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
test("owner HTTP routes require bearer auth and use the trusted principal", async () => {
|
|
26
|
+
const principals: string[] = [];
|
|
27
|
+
const service = {
|
|
28
|
+
supportPassportEnabled: true,
|
|
29
|
+
supportPassportListCards: async (principal: string) => {
|
|
30
|
+
principals.push(principal);
|
|
31
|
+
return [card("active")];
|
|
32
|
+
},
|
|
33
|
+
} as unknown as EngramAccessService;
|
|
34
|
+
const server = new EngramAccessHttpServer({
|
|
35
|
+
service,
|
|
36
|
+
port: 0,
|
|
37
|
+
authToken: TOKEN,
|
|
38
|
+
principal: "owner:alice",
|
|
39
|
+
adminConsoleEnabled: false,
|
|
40
|
+
});
|
|
41
|
+
const { port } = await server.start();
|
|
42
|
+
const url = `http://127.0.0.1:${port}/engram/v1/support-passport/cards`;
|
|
43
|
+
try {
|
|
44
|
+
assert.equal((await fetch(url)).status, 401);
|
|
45
|
+
assert.equal((await fetch(url, { headers: { authorization: "SupportPassport helper-secret" } })).status, 401);
|
|
46
|
+
const response = await fetch(url, { headers: { authorization: `Bearer ${TOKEN}` } });
|
|
47
|
+
assert.equal(response.status, 200);
|
|
48
|
+
assert.equal(response.headers.get("cache-control"), "private, no-store");
|
|
49
|
+
assert.equal(response.headers.get("vary"), "Authorization");
|
|
50
|
+
assert.deepEqual(await response.json(), { cards: [card("active")] });
|
|
51
|
+
assert.deepEqual(principals, ["owner:alice"]);
|
|
52
|
+
|
|
53
|
+
const queried = await fetch(`${url}?namespace=another-owner`, {
|
|
54
|
+
headers: { authorization: `Bearer ${TOKEN}` },
|
|
55
|
+
});
|
|
56
|
+
assert.equal(queried.status, 400);
|
|
57
|
+
const malformedPath = await fetch(`http://127.0.0.1:${port}/engram/v1/support-passport/cards/%ZZ/approve`, {
|
|
58
|
+
method: "POST",
|
|
59
|
+
headers: { authorization: `Bearer ${TOKEN}`, "content-type": "application/json" },
|
|
60
|
+
body: JSON.stringify({ expectedRevision: REVISION, reasonCode: "owner-approved" }),
|
|
61
|
+
});
|
|
62
|
+
assert.equal(malformedPath.status, 400);
|
|
63
|
+
assert.deepEqual(principals, ["owner:alice"]);
|
|
64
|
+
} finally {
|
|
65
|
+
await server.stop();
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
test("owner HTTP writes reject unknown and path-owned fields before dispatch", async () => {
|
|
70
|
+
const calls: unknown[] = [];
|
|
71
|
+
const service = {
|
|
72
|
+
supportPassportEnabled: true,
|
|
73
|
+
supportPassportApproveCard: async (...input: unknown[]) => {
|
|
74
|
+
calls.push(input);
|
|
75
|
+
return card("active");
|
|
76
|
+
},
|
|
77
|
+
} as unknown as EngramAccessService;
|
|
78
|
+
const server = new EngramAccessHttpServer({
|
|
79
|
+
service,
|
|
80
|
+
port: 0,
|
|
81
|
+
authToken: TOKEN,
|
|
82
|
+
principal: "owner:alice",
|
|
83
|
+
adminConsoleEnabled: false,
|
|
84
|
+
});
|
|
85
|
+
const { port } = await server.start();
|
|
86
|
+
const url = `http://127.0.0.1:${port}/engram/v1/support-passport/cards/card-one/approve`;
|
|
87
|
+
const request = (body: Record<string, unknown>) =>
|
|
88
|
+
fetch(url, {
|
|
89
|
+
method: "POST",
|
|
90
|
+
headers: { authorization: `Bearer ${TOKEN}`, "content-type": "application/json" },
|
|
91
|
+
body: JSON.stringify(body),
|
|
92
|
+
});
|
|
93
|
+
try {
|
|
94
|
+
assert.equal(
|
|
95
|
+
(await request({ expectedRevision: REVISION, reasonCode: "owner-approved", namespace: "other" })).status,
|
|
96
|
+
400
|
|
97
|
+
);
|
|
98
|
+
assert.equal(
|
|
99
|
+
(await request({ cardId: "another-card", expectedRevision: REVISION, reasonCode: "owner-approved" })).status,
|
|
100
|
+
400
|
|
101
|
+
);
|
|
102
|
+
assert.equal(calls.length, 0);
|
|
103
|
+
|
|
104
|
+
const response = await request({ expectedRevision: REVISION, reasonCode: "owner-approved" });
|
|
105
|
+
assert.equal(response.status, 200);
|
|
106
|
+
assert.deepEqual(await response.json(), { card: card("active") });
|
|
107
|
+
const [principal, cardId, input, options] = calls[0] as [
|
|
108
|
+
string,
|
|
109
|
+
string,
|
|
110
|
+
Record<string, unknown>,
|
|
111
|
+
Record<string, unknown>,
|
|
112
|
+
];
|
|
113
|
+
assert.equal(principal, "owner:alice");
|
|
114
|
+
assert.equal(cardId, "card-one");
|
|
115
|
+
assert.deepEqual(input, { expectedRevision: REVISION, reasonCode: "owner-approved" });
|
|
116
|
+
assert.equal(typeof options.onCommitted, "function");
|
|
117
|
+
} finally {
|
|
118
|
+
await server.stop();
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
test("manual owner HTTP drafts require the owner's review date", async () => {
|
|
123
|
+
const calls: unknown[] = [];
|
|
124
|
+
const service = {
|
|
125
|
+
supportPassportEnabled: true,
|
|
126
|
+
supportPassportCreateManualDraft: async (...input: unknown[]) => {
|
|
127
|
+
calls.push(input);
|
|
128
|
+
return card();
|
|
129
|
+
},
|
|
130
|
+
} as unknown as EngramAccessService;
|
|
131
|
+
const server = new EngramAccessHttpServer({
|
|
132
|
+
service,
|
|
133
|
+
port: 0,
|
|
134
|
+
authToken: TOKEN,
|
|
135
|
+
principal: "owner:alice",
|
|
136
|
+
adminConsoleEnabled: false,
|
|
137
|
+
});
|
|
138
|
+
const { port } = await server.start();
|
|
139
|
+
const url = `http://127.0.0.1:${port}/engram/v1/support-passport/drafts`;
|
|
140
|
+
const request = (body: Record<string, unknown>) =>
|
|
141
|
+
fetch(url, {
|
|
142
|
+
method: "POST",
|
|
143
|
+
headers: { authorization: `Bearer ${TOKEN}`, "content-type": "application/json" },
|
|
144
|
+
body: JSON.stringify(body),
|
|
145
|
+
});
|
|
146
|
+
const draft = {
|
|
147
|
+
title: "Plan changes",
|
|
148
|
+
statement: "Tell me before plans change.",
|
|
149
|
+
category: "transitions",
|
|
150
|
+
};
|
|
151
|
+
try {
|
|
152
|
+
assert.equal((await request(draft)).status, 400);
|
|
153
|
+
assert.equal(calls.length, 0);
|
|
154
|
+
const response = await request({ ...draft, reviewBy: "2027-02-07T12:00:00.000Z" });
|
|
155
|
+
assert.equal(response.status, 200);
|
|
156
|
+
assert.equal(calls.length, 1);
|
|
157
|
+
} finally {
|
|
158
|
+
await server.stop();
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
test("owner HTTP forwards request cancellation to every support passport write", async () => {
|
|
163
|
+
const observed: AbortSignal[] = [];
|
|
164
|
+
const service = {
|
|
165
|
+
supportPassportEnabled: true,
|
|
166
|
+
supportPassportCreateManualDraft: async (
|
|
167
|
+
_principal: string,
|
|
168
|
+
_input: unknown,
|
|
169
|
+
options: { signal?: AbortSignal }
|
|
170
|
+
) => {
|
|
171
|
+
assert.ok(options.signal);
|
|
172
|
+
observed.push(options.signal);
|
|
173
|
+
return card();
|
|
174
|
+
},
|
|
175
|
+
} as unknown as EngramAccessService;
|
|
176
|
+
const server = new EngramAccessHttpServer({
|
|
177
|
+
service,
|
|
178
|
+
port: 0,
|
|
179
|
+
authToken: TOKEN,
|
|
180
|
+
principal: "owner:alice",
|
|
181
|
+
adminConsoleEnabled: false,
|
|
182
|
+
});
|
|
183
|
+
const { port } = await server.start();
|
|
184
|
+
try {
|
|
185
|
+
const response = await fetch(`http://127.0.0.1:${port}/engram/v1/support-passport/drafts`, {
|
|
186
|
+
method: "POST",
|
|
187
|
+
headers: { authorization: `Bearer ${TOKEN}`, "content-type": "application/json" },
|
|
188
|
+
body: JSON.stringify({
|
|
189
|
+
title: "Plan changes",
|
|
190
|
+
statement: "Tell me before plans change.",
|
|
191
|
+
category: "transitions",
|
|
192
|
+
reviewBy: "2027-02-07T12:00:00.000Z",
|
|
193
|
+
}),
|
|
194
|
+
});
|
|
195
|
+
assert.equal(response.status, 200);
|
|
196
|
+
assert.equal(observed.length, 1);
|
|
197
|
+
assert.equal(observed[0]?.aborted, false);
|
|
198
|
+
} finally {
|
|
199
|
+
await server.stop();
|
|
200
|
+
}
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
test("owner HTTP previews exact memory text with a consent revision", async () => {
|
|
204
|
+
const calls: unknown[] = [];
|
|
205
|
+
const service = {
|
|
206
|
+
supportPassportEnabled: true,
|
|
207
|
+
supportPassportPreviewMemory: async (principal: string, memoryId: string) => {
|
|
208
|
+
calls.push([principal, memoryId]);
|
|
209
|
+
if (memoryId === "missing") return { found: false };
|
|
210
|
+
return {
|
|
211
|
+
found: true,
|
|
212
|
+
memory: { id: memoryId, content: "Tell me before plans change.", revision: REVISION },
|
|
213
|
+
};
|
|
214
|
+
},
|
|
215
|
+
} as unknown as EngramAccessService;
|
|
216
|
+
const server = new EngramAccessHttpServer({
|
|
217
|
+
service,
|
|
218
|
+
port: 0,
|
|
219
|
+
authToken: TOKEN,
|
|
220
|
+
principal: "owner:alice",
|
|
221
|
+
adminConsoleEnabled: false,
|
|
222
|
+
});
|
|
223
|
+
const { port } = await server.start();
|
|
224
|
+
const root = `http://127.0.0.1:${port}/engram/v1/support-passport/memories`;
|
|
225
|
+
try {
|
|
226
|
+
const found = await fetch(`${root}/memory-one`, { headers: { authorization: `Bearer ${TOKEN}` } });
|
|
227
|
+
assert.equal(found.status, 200);
|
|
228
|
+
assert.deepEqual(await found.json(), {
|
|
229
|
+
found: true,
|
|
230
|
+
memory: { id: "memory-one", content: "Tell me before plans change.", revision: REVISION },
|
|
231
|
+
});
|
|
232
|
+
const missing = await fetch(`${root}/missing`, { headers: { authorization: `Bearer ${TOKEN}` } });
|
|
233
|
+
assert.equal(missing.status, 200);
|
|
234
|
+
assert.deepEqual(await missing.json(), { found: false });
|
|
235
|
+
assert.deepEqual(calls, [
|
|
236
|
+
["owner:alice", "memory-one"],
|
|
237
|
+
["owner:alice", "missing"],
|
|
238
|
+
]);
|
|
239
|
+
} finally {
|
|
240
|
+
await server.stop();
|
|
241
|
+
}
|
|
242
|
+
});
|
|
243
|
+
|
|
244
|
+
test("owner HTTP requires reviewed memory revisions before model drafting", async () => {
|
|
245
|
+
const calls: unknown[] = [];
|
|
246
|
+
const service = {
|
|
247
|
+
supportPassportEnabled: true,
|
|
248
|
+
supportPassportGenerateDrafts: async (...input: unknown[]) => {
|
|
249
|
+
calls.push(input);
|
|
250
|
+
return [card()];
|
|
251
|
+
},
|
|
252
|
+
} as unknown as EngramAccessService;
|
|
253
|
+
const server = new EngramAccessHttpServer({
|
|
254
|
+
service,
|
|
255
|
+
port: 0,
|
|
256
|
+
authToken: TOKEN,
|
|
257
|
+
principal: "owner:alice",
|
|
258
|
+
adminConsoleEnabled: false,
|
|
259
|
+
});
|
|
260
|
+
const { port } = await server.start();
|
|
261
|
+
const url = `http://127.0.0.1:${port}/engram/v1/support-passport/drafts/generate`;
|
|
262
|
+
const request = (body: Record<string, unknown>) =>
|
|
263
|
+
fetch(url, {
|
|
264
|
+
method: "POST",
|
|
265
|
+
headers: { authorization: `Bearer ${TOKEN}`, "content-type": "application/json" },
|
|
266
|
+
body: JSON.stringify(body),
|
|
267
|
+
});
|
|
268
|
+
try {
|
|
269
|
+
assert.equal((await request({ sourceMemoryIds: ["memory-one"], consent: true })).status, 400);
|
|
270
|
+
assert.equal(calls.length, 0);
|
|
271
|
+
const sourceMemoryRevisions = [{ memoryId: "memory-one", revision: REVISION }];
|
|
272
|
+
const response = await request({ sourceMemoryIds: ["memory-one"], sourceMemoryRevisions, consent: true });
|
|
273
|
+
assert.equal(response.status, 200);
|
|
274
|
+
assert.deepEqual(await response.json(), { cards: [card()] });
|
|
275
|
+
assert.equal(calls.length, 1);
|
|
276
|
+
const [principal, input] = calls[0] as [string, Record<string, unknown>];
|
|
277
|
+
assert.equal(principal, "owner:alice");
|
|
278
|
+
const { onCommitted, ...forwardedInput } = input;
|
|
279
|
+
assert.deepEqual(
|
|
280
|
+
{ ...forwardedInput, signal: undefined },
|
|
281
|
+
{ sourceMemoryIds: ["memory-one"], sourceMemoryRevisions, consent: true, signal: undefined }
|
|
282
|
+
);
|
|
283
|
+
assert.ok(input.signal instanceof AbortSignal);
|
|
284
|
+
assert.equal(typeof onCommitted, "function");
|
|
285
|
+
} finally {
|
|
286
|
+
await server.stop();
|
|
287
|
+
}
|
|
288
|
+
});
|
|
289
|
+
|
|
290
|
+
test("owner HTTP reserves write quota before concurrent dispatch", async () => {
|
|
291
|
+
let markStarted: (() => void) | undefined;
|
|
292
|
+
let finishWrite: (() => void) | undefined;
|
|
293
|
+
const started = new Promise<void>((resolve) => {
|
|
294
|
+
markStarted = resolve;
|
|
295
|
+
});
|
|
296
|
+
const finish = new Promise<void>((resolve) => {
|
|
297
|
+
finishWrite = resolve;
|
|
298
|
+
});
|
|
299
|
+
let calls = 0;
|
|
300
|
+
const service = {
|
|
301
|
+
supportPassportEnabled: true,
|
|
302
|
+
supportPassportCreateManualDraft: async () => {
|
|
303
|
+
calls += 1;
|
|
304
|
+
markStarted?.();
|
|
305
|
+
await finish;
|
|
306
|
+
return card();
|
|
307
|
+
},
|
|
308
|
+
} as unknown as EngramAccessService;
|
|
309
|
+
const server = new EngramAccessHttpServer({
|
|
310
|
+
service,
|
|
311
|
+
port: 0,
|
|
312
|
+
authToken: TOKEN,
|
|
313
|
+
principal: "owner:alice",
|
|
314
|
+
adminConsoleEnabled: false,
|
|
315
|
+
writeRateLimitMaxRequests: 1,
|
|
316
|
+
writeRateLimitWindowMs: 60_000,
|
|
317
|
+
});
|
|
318
|
+
const { port } = await server.start();
|
|
319
|
+
const url = `http://127.0.0.1:${port}/engram/v1/support-passport/drafts`;
|
|
320
|
+
const request = () =>
|
|
321
|
+
fetch(url, {
|
|
322
|
+
method: "POST",
|
|
323
|
+
headers: { authorization: `Bearer ${TOKEN}`, "content-type": "application/json" },
|
|
324
|
+
body: JSON.stringify({
|
|
325
|
+
title: "Plan changes",
|
|
326
|
+
statement: "Tell me before plans change.",
|
|
327
|
+
category: "transitions",
|
|
328
|
+
reviewBy: "2027-02-07T12:00:00.000Z",
|
|
329
|
+
}),
|
|
330
|
+
});
|
|
331
|
+
try {
|
|
332
|
+
const firstPending = request();
|
|
333
|
+
await started;
|
|
334
|
+
const concurrent = await request();
|
|
335
|
+
assert.equal(concurrent.status, 429);
|
|
336
|
+
assert.equal(calls, 1, "the rate-limited request never reaches the service");
|
|
337
|
+
|
|
338
|
+
finishWrite?.();
|
|
339
|
+
const first = await firstPending;
|
|
340
|
+
assert.equal(first.status, 200);
|
|
341
|
+
assert.equal((await request()).status, 429, "the successful reservation remains a quota hit");
|
|
342
|
+
} finally {
|
|
343
|
+
finishWrite?.();
|
|
344
|
+
await server.stop();
|
|
345
|
+
}
|
|
346
|
+
});
|
|
347
|
+
|
|
348
|
+
test("owner HTTP releases reserved write quota when dispatch fails", async () => {
|
|
349
|
+
let calls = 0;
|
|
350
|
+
const service = {
|
|
351
|
+
supportPassportEnabled: true,
|
|
352
|
+
supportPassportCreateManualDraft: async () => {
|
|
353
|
+
calls += 1;
|
|
354
|
+
if (calls === 1) {
|
|
355
|
+
throw new SupportPassportError("state_conflict", "Please retry.", 409);
|
|
356
|
+
}
|
|
357
|
+
return card();
|
|
358
|
+
},
|
|
359
|
+
} as unknown as EngramAccessService;
|
|
360
|
+
const server = new EngramAccessHttpServer({
|
|
361
|
+
service,
|
|
362
|
+
port: 0,
|
|
363
|
+
authToken: TOKEN,
|
|
364
|
+
principal: "owner:alice",
|
|
365
|
+
adminConsoleEnabled: false,
|
|
366
|
+
writeRateLimitMaxRequests: 1,
|
|
367
|
+
writeRateLimitWindowMs: 60_000,
|
|
368
|
+
});
|
|
369
|
+
const { port } = await server.start();
|
|
370
|
+
const url = `http://127.0.0.1:${port}/engram/v1/support-passport/drafts`;
|
|
371
|
+
const request = () =>
|
|
372
|
+
fetch(url, {
|
|
373
|
+
method: "POST",
|
|
374
|
+
headers: { authorization: `Bearer ${TOKEN}`, "content-type": "application/json" },
|
|
375
|
+
body: JSON.stringify({
|
|
376
|
+
title: "Plan changes",
|
|
377
|
+
statement: "Tell me before plans change.",
|
|
378
|
+
category: "transitions",
|
|
379
|
+
reviewBy: "2027-02-07T12:00:00.000Z",
|
|
380
|
+
}),
|
|
381
|
+
});
|
|
382
|
+
try {
|
|
383
|
+
assert.equal((await request()).status, 409);
|
|
384
|
+
assert.equal((await request()).status, 200, "a failed write returns its reserved quota slot");
|
|
385
|
+
assert.equal(calls, 2);
|
|
386
|
+
} finally {
|
|
387
|
+
await server.stop();
|
|
388
|
+
}
|
|
389
|
+
});
|
|
390
|
+
|
|
391
|
+
test("owner HTTP keeps reserved quota when generated drafts commit before failure", async () => {
|
|
392
|
+
let calls = 0;
|
|
393
|
+
const service = {
|
|
394
|
+
supportPassportEnabled: true,
|
|
395
|
+
supportPassportGenerateDrafts: async (
|
|
396
|
+
_principal: string,
|
|
397
|
+
input: { onCommitted?: () => void }
|
|
398
|
+
) => {
|
|
399
|
+
calls += 1;
|
|
400
|
+
input.onCommitted?.();
|
|
401
|
+
throw new SupportPassportError("state_conflict", "Draft cleanup failed.", 409);
|
|
402
|
+
},
|
|
403
|
+
} as unknown as EngramAccessService;
|
|
404
|
+
const server = new EngramAccessHttpServer({
|
|
405
|
+
service,
|
|
406
|
+
port: 0,
|
|
407
|
+
authToken: TOKEN,
|
|
408
|
+
principal: "owner:alice",
|
|
409
|
+
adminConsoleEnabled: false,
|
|
410
|
+
writeRateLimitMaxRequests: 1,
|
|
411
|
+
writeRateLimitWindowMs: 60_000,
|
|
412
|
+
});
|
|
413
|
+
const { port } = await server.start();
|
|
414
|
+
const request = () =>
|
|
415
|
+
fetch(`http://127.0.0.1:${port}/engram/v1/support-passport/drafts/generate`, {
|
|
416
|
+
method: "POST",
|
|
417
|
+
headers: { authorization: `Bearer ${TOKEN}`, "content-type": "application/json" },
|
|
418
|
+
body: JSON.stringify({
|
|
419
|
+
sourceMemoryIds: ["memory-one"],
|
|
420
|
+
sourceMemoryRevisions: [{ memoryId: "memory-one", revision: REVISION }],
|
|
421
|
+
consent: true,
|
|
422
|
+
}),
|
|
423
|
+
});
|
|
424
|
+
try {
|
|
425
|
+
assert.equal((await request()).status, 409);
|
|
426
|
+
assert.equal((await request()).status, 429, "the committed draft keeps its reserved quota slot");
|
|
427
|
+
assert.equal(calls, 1);
|
|
428
|
+
} finally {
|
|
429
|
+
await server.stop();
|
|
430
|
+
}
|
|
431
|
+
});
|
|
432
|
+
|
|
433
|
+
test("owner HTTP keeps reserved quota when a card edit commits before failure", async () => {
|
|
434
|
+
let calls = 0;
|
|
435
|
+
const service = {
|
|
436
|
+
supportPassportEnabled: true,
|
|
437
|
+
supportPassportReplaceCard: async (
|
|
438
|
+
_principal: string,
|
|
439
|
+
_cardId: string,
|
|
440
|
+
_input: unknown,
|
|
441
|
+
options: { onCommitted?: () => void }
|
|
442
|
+
) => {
|
|
443
|
+
calls += 1;
|
|
444
|
+
options.onCommitted?.();
|
|
445
|
+
throw new SupportPassportError("storage_conflict", "Draft cleanup failed.", 409);
|
|
446
|
+
},
|
|
447
|
+
} as unknown as EngramAccessService;
|
|
448
|
+
const server = new EngramAccessHttpServer({
|
|
449
|
+
service,
|
|
450
|
+
port: 0,
|
|
451
|
+
authToken: TOKEN,
|
|
452
|
+
principal: "owner:alice",
|
|
453
|
+
adminConsoleEnabled: false,
|
|
454
|
+
writeRateLimitMaxRequests: 1,
|
|
455
|
+
writeRateLimitWindowMs: 60_000,
|
|
456
|
+
});
|
|
457
|
+
const { port } = await server.start();
|
|
458
|
+
const request = () =>
|
|
459
|
+
fetch(`http://127.0.0.1:${port}/engram/v1/support-passport/cards/card-one`, {
|
|
460
|
+
method: "PUT",
|
|
461
|
+
headers: { authorization: `Bearer ${TOKEN}`, "content-type": "application/json" },
|
|
462
|
+
body: JSON.stringify({
|
|
463
|
+
title: "Plan changes",
|
|
464
|
+
statement: "Tell me before plans change.",
|
|
465
|
+
category: "transitions",
|
|
466
|
+
reviewBy: "2027-02-07T12:00:00.000Z",
|
|
467
|
+
expectedRevision: REVISION,
|
|
468
|
+
}),
|
|
469
|
+
});
|
|
470
|
+
try {
|
|
471
|
+
assert.equal((await request()).status, 409);
|
|
472
|
+
assert.equal((await request()).status, 429, "the committed edit keeps its reserved quota slot");
|
|
473
|
+
assert.equal(calls, 1);
|
|
474
|
+
} finally {
|
|
475
|
+
await server.stop();
|
|
476
|
+
}
|
|
477
|
+
});
|
|
478
|
+
|
|
479
|
+
test("owner HTTP forwards commit accounting to manual drafts and grant creation", async () => {
|
|
480
|
+
const callbacks: Array<() => void> = [];
|
|
481
|
+
const service = {
|
|
482
|
+
supportPassportEnabled: true,
|
|
483
|
+
supportPassportCreateManualDraft: async (
|
|
484
|
+
_principal: string,
|
|
485
|
+
_input: unknown,
|
|
486
|
+
options: { onCommitted?: () => void }
|
|
487
|
+
) => {
|
|
488
|
+
assert.equal(typeof options.onCommitted, "function");
|
|
489
|
+
callbacks.push(options.onCommitted!);
|
|
490
|
+
return card();
|
|
491
|
+
},
|
|
492
|
+
supportPassportCreateGrant: async (_principal: string, _input: unknown, options: { onCommitted?: () => void }) => {
|
|
493
|
+
assert.equal(typeof options.onCommitted, "function");
|
|
494
|
+
callbacks.push(options.onCommitted!);
|
|
495
|
+
return {
|
|
496
|
+
grantId: "grant-one",
|
|
497
|
+
secret: "s".repeat(43),
|
|
498
|
+
expiresAt: "2026-08-11T14:00:00.000Z",
|
|
499
|
+
version: 1,
|
|
500
|
+
};
|
|
501
|
+
},
|
|
502
|
+
} as unknown as EngramAccessService;
|
|
503
|
+
const server = new EngramAccessHttpServer({
|
|
504
|
+
service,
|
|
505
|
+
port: 0,
|
|
506
|
+
authToken: TOKEN,
|
|
507
|
+
principal: "owner:alice",
|
|
508
|
+
adminConsoleEnabled: false,
|
|
509
|
+
writeRateLimitMaxRequests: 2,
|
|
510
|
+
writeRateLimitWindowMs: 60_000,
|
|
511
|
+
});
|
|
512
|
+
const { port } = await server.start();
|
|
513
|
+
try {
|
|
514
|
+
const draft = await fetch(`http://127.0.0.1:${port}/engram/v1/support-passport/drafts`, {
|
|
515
|
+
method: "POST",
|
|
516
|
+
headers: { authorization: `Bearer ${TOKEN}`, "content-type": "application/json" },
|
|
517
|
+
body: JSON.stringify({
|
|
518
|
+
title: "Plan changes",
|
|
519
|
+
statement: "Tell me before plans change.",
|
|
520
|
+
category: "transitions",
|
|
521
|
+
reviewBy: "2027-02-07T12:00:00.000Z",
|
|
522
|
+
}),
|
|
523
|
+
});
|
|
524
|
+
assert.equal(draft.status, 200);
|
|
525
|
+
const grant = await fetch(`http://127.0.0.1:${port}/engram/v1/support-passport/grants`, {
|
|
526
|
+
method: "POST",
|
|
527
|
+
headers: { authorization: `Bearer ${TOKEN}`, "content-type": "application/json" },
|
|
528
|
+
body: JSON.stringify({
|
|
529
|
+
cardIds: ["card-one"],
|
|
530
|
+
cardRevisions: [{ cardId: "card-one", revision: REVISION }],
|
|
531
|
+
expiresAt: "2026-08-11T14:00:00.000Z",
|
|
532
|
+
}),
|
|
533
|
+
});
|
|
534
|
+
assert.equal(grant.status, 200);
|
|
535
|
+
assert.equal(callbacks.length, 2);
|
|
536
|
+
} finally {
|
|
537
|
+
await server.stop();
|
|
538
|
+
}
|
|
539
|
+
});
|
|
540
|
+
|
|
541
|
+
test("owner HTTP preserves preset grant durations for the grant service clock", async () => {
|
|
542
|
+
let grantInput: Record<string, unknown> | undefined;
|
|
543
|
+
const service = {
|
|
544
|
+
supportPassportEnabled: true,
|
|
545
|
+
supportPassportCreateGrant: async (_principal: string, input: Record<string, unknown>) => {
|
|
546
|
+
grantInput = input;
|
|
547
|
+
return {
|
|
548
|
+
grantId: "grant-one",
|
|
549
|
+
secret: "s".repeat(43),
|
|
550
|
+
expiresAt: input.expiresAt,
|
|
551
|
+
version: 1,
|
|
552
|
+
};
|
|
553
|
+
},
|
|
554
|
+
} as unknown as EngramAccessService;
|
|
555
|
+
const server = new EngramAccessHttpServer({
|
|
556
|
+
service,
|
|
557
|
+
port: 0,
|
|
558
|
+
authToken: TOKEN,
|
|
559
|
+
principal: "owner:alice",
|
|
560
|
+
adminConsoleEnabled: false,
|
|
561
|
+
});
|
|
562
|
+
const { port } = await server.start();
|
|
563
|
+
try {
|
|
564
|
+
const response = await fetch(`http://127.0.0.1:${port}/engram/v1/support-passport/grants`, {
|
|
565
|
+
method: "POST",
|
|
566
|
+
headers: { authorization: `Bearer ${TOKEN}`, "content-type": "application/json" },
|
|
567
|
+
body: JSON.stringify({
|
|
568
|
+
cardIds: ["card-one"],
|
|
569
|
+
cardRevisions: [{ cardId: "card-one", revision: REVISION }],
|
|
570
|
+
durationMs: 1_800_000,
|
|
571
|
+
}),
|
|
572
|
+
});
|
|
573
|
+
assert.equal(response.status, 200);
|
|
574
|
+
assert.equal(grantInput?.durationMs, 1_800_000);
|
|
575
|
+
assert.equal(Object.hasOwn(grantInput ?? {}, "expiresAt"), false);
|
|
576
|
+
} finally {
|
|
577
|
+
await server.stop();
|
|
578
|
+
}
|
|
579
|
+
});
|
|
580
|
+
|
|
581
|
+
test("owner HTTP applies the write quota to share-link revocation", async () => {
|
|
582
|
+
const revocations: unknown[] = [];
|
|
583
|
+
const service = {
|
|
584
|
+
supportPassportEnabled: true,
|
|
585
|
+
supportPassportCreateManualDraft: async () => card(),
|
|
586
|
+
supportPassportRevokeGrant: async (...args: unknown[]) => {
|
|
587
|
+
revocations.push(args);
|
|
588
|
+
return {
|
|
589
|
+
grantId: "grant-one",
|
|
590
|
+
revokedAt: "2026-08-11T12:05:00.000Z",
|
|
591
|
+
version: 2,
|
|
592
|
+
};
|
|
593
|
+
},
|
|
594
|
+
} as unknown as EngramAccessService;
|
|
595
|
+
const server = new EngramAccessHttpServer({
|
|
596
|
+
service,
|
|
597
|
+
port: 0,
|
|
598
|
+
authToken: TOKEN,
|
|
599
|
+
principal: "owner:alice",
|
|
600
|
+
adminConsoleEnabled: false,
|
|
601
|
+
writeRateLimitMaxRequests: 1,
|
|
602
|
+
writeRateLimitWindowMs: 60_000,
|
|
603
|
+
});
|
|
604
|
+
const { port } = await server.start();
|
|
605
|
+
try {
|
|
606
|
+
const draft = await fetch(`http://127.0.0.1:${port}/engram/v1/support-passport/drafts`, {
|
|
607
|
+
method: "POST",
|
|
608
|
+
headers: { authorization: `Bearer ${TOKEN}`, "content-type": "application/json" },
|
|
609
|
+
body: JSON.stringify({
|
|
610
|
+
title: "Plan changes",
|
|
611
|
+
statement: "Tell me before plans change.",
|
|
612
|
+
category: "transitions",
|
|
613
|
+
reviewBy: "2027-02-07T12:00:00.000Z",
|
|
614
|
+
}),
|
|
615
|
+
});
|
|
616
|
+
assert.equal(draft.status, 200);
|
|
617
|
+
const revoked = await fetch(`http://127.0.0.1:${port}/engram/v1/support-passport/grants/grant-one/revoke`, {
|
|
618
|
+
method: "POST",
|
|
619
|
+
headers: { authorization: `Bearer ${TOKEN}`, "content-type": "application/json" },
|
|
620
|
+
body: JSON.stringify({ expectedVersion: 1 }),
|
|
621
|
+
});
|
|
622
|
+
assert.equal(revoked.status, 429);
|
|
623
|
+
assert.equal(revocations.length, 0);
|
|
624
|
+
} finally {
|
|
625
|
+
await server.stop();
|
|
626
|
+
}
|
|
627
|
+
});
|
|
628
|
+
|
|
629
|
+
test("owner HTTP closes an unread body when a query is rejected", async () => {
|
|
630
|
+
const service = { supportPassportEnabled: true } as unknown as EngramAccessService;
|
|
631
|
+
const server = new EngramAccessHttpServer({
|
|
632
|
+
service,
|
|
633
|
+
port: 0,
|
|
634
|
+
authToken: TOKEN,
|
|
635
|
+
principal: "owner:alice",
|
|
636
|
+
adminConsoleEnabled: false,
|
|
637
|
+
});
|
|
638
|
+
const { port } = await server.start();
|
|
639
|
+
try {
|
|
640
|
+
const result = await new Promise<{ status: number | undefined; connection: string | undefined }>(
|
|
641
|
+
(resolve, reject) => {
|
|
642
|
+
const client = request(
|
|
643
|
+
{
|
|
644
|
+
hostname: "127.0.0.1",
|
|
645
|
+
port,
|
|
646
|
+
path: "/engram/v1/support-passport/drafts?unexpected=true",
|
|
647
|
+
method: "POST",
|
|
648
|
+
headers: {
|
|
649
|
+
authorization: `Bearer ${TOKEN}`,
|
|
650
|
+
"content-type": "application/json",
|
|
651
|
+
"content-length": "100",
|
|
652
|
+
},
|
|
653
|
+
},
|
|
654
|
+
(response) => {
|
|
655
|
+
response.resume();
|
|
656
|
+
response.once("end", () =>
|
|
657
|
+
resolve({ status: response.statusCode, connection: response.headers.connection })
|
|
658
|
+
);
|
|
659
|
+
}
|
|
660
|
+
);
|
|
661
|
+
client.once("error", reject);
|
|
662
|
+
client.flushHeaders();
|
|
663
|
+
client.write('{"title":"partial');
|
|
664
|
+
}
|
|
665
|
+
);
|
|
666
|
+
assert.equal(result.status, 400);
|
|
667
|
+
assert.equal(result.connection, "close");
|
|
668
|
+
} finally {
|
|
669
|
+
await server.stop();
|
|
670
|
+
}
|
|
671
|
+
});
|