@remnic/core 9.63.6 → 9.63.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 +1 -1
- package/dist/access-admin-ops-surface.js +27 -25
- package/dist/access-authorization-probe.d.ts +1 -1
- package/dist/access-authorization-probe.js +28 -26
- package/dist/access-boundary.d.ts +1 -1
- package/dist/access-boundary.js +27 -25
- package/dist/access-cli.js +83 -81
- package/dist/access-cli.js.map +1 -1
- package/dist/access-extraction-force-flush.d.ts +1 -1
- package/dist/access-extraction-force-flush.js +27 -25
- package/dist/access-http-lcm-compaction.d.ts +1 -1
- package/dist/access-http-lifecycle-flush.d.ts +1 -1
- package/dist/access-http-offline-stream.d.ts +1 -1
- package/dist/access-http-query.js +29 -27
- package/dist/access-http.d.ts +2 -2
- package/dist/access-http.js +43 -41
- package/dist/access-identity-continuity-surface.js +27 -25
- package/dist/access-lcm-surface.d.ts +1 -1
- package/dist/access-lcm-surface.js +27 -25
- package/dist/access-mcp.d.ts +1 -1
- package/dist/access-mcp.js +34 -32
- package/dist/access-namespace-preflight.js +27 -25
- package/dist/access-observe-write-surface.d.ts +1 -1
- package/dist/access-observe-write-surface.js +27 -25
- package/dist/access-offline-manifest.js +6 -5
- package/dist/access-operations-batch.js +29 -27
- package/dist/access-operations.d.ts +4 -4
- package/dist/access-operations.js +33 -31
- package/dist/access-recall-concurrency.d.ts +1 -1
- package/dist/access-recall-concurrency.js +27 -25
- package/dist/access-recall-response.d.ts +1 -1
- package/dist/access-recall-response.js +27 -25
- package/dist/access-recall-surface.d.ts +1 -1
- package/dist/access-recall-surface.js +27 -25
- package/dist/access-schema.d.ts +88 -88
- package/dist/access-schema.js +6 -5
- package/dist/access-service-helpers.d.ts +1 -1
- package/dist/access-service.d.ts +1 -1
- package/dist/access-service.js +27 -25
- package/dist/access-surface-catalog.d.ts +1 -1
- package/dist/access-surface-catalog.js +29 -27
- package/dist/access-surface-catalog.js.map +1 -1
- package/dist/active-recall.js +5 -3
- package/dist/active-recall.js.map +1 -1
- package/dist/adapters/index.js +4 -4
- package/dist/adapters/registry.js +2 -2
- package/dist/{auto-sync-BKRJDMKX.js → auto-sync-3SHMZVQS.js} +5 -3
- package/dist/{auto-sync-BKRJDMKX.js.map → auto-sync-3SHMZVQS.js.map} +1 -1
- package/dist/briefing.js +10 -10
- package/dist/calibration.d.ts +2 -1
- package/dist/calibration.js +7 -0
- package/dist/calibration.js.map +1 -1
- package/dist/causal-consolidation.js +11 -11
- package/dist/census-validation.d.ts +19 -0
- package/dist/census-validation.js +14 -0
- package/dist/census-validation.js.map +1 -0
- package/dist/{chunk-LEPOP46W.js → chunk-227UFSEQ.js} +4 -4
- package/dist/{chunk-Z4N7SVVF.js → chunk-2L7DKNVE.js} +12 -7
- package/dist/chunk-2L7DKNVE.js.map +1 -0
- package/dist/{chunk-3Z5TGRFA.js → chunk-3NZAVWU5.js} +9 -9
- package/dist/{chunk-I5FLIB2J.js → chunk-3S3PNR5H.js} +2 -2
- package/dist/{chunk-R6UMNP5C.js → chunk-3T6HIIKA.js} +2 -2
- package/dist/{chunk-77QZW2D6.js → chunk-3TDAA7VA.js} +2 -2
- package/dist/{chunk-TWTUGCTY.js → chunk-3YTTAGPB.js} +6 -1
- package/dist/chunk-3YTTAGPB.js.map +1 -0
- package/dist/{chunk-DXDAQZ2K.js → chunk-42TIIO2M.js} +2 -2
- package/dist/{chunk-Y7COCXY2.js → chunk-4F67JJPG.js} +2 -2
- package/dist/{chunk-PB4WVYGC.js → chunk-5S5DUJFJ.js} +2 -2
- package/dist/{chunk-KYTRF64R.js → chunk-5SCFDQEJ.js} +2 -2
- package/dist/{chunk-GG4DN63W.js → chunk-62Y5AGCM.js} +2 -2
- package/dist/{chunk-KHCUVYCY.js → chunk-6UKSOXAO.js} +3 -3
- package/dist/{chunk-F6JYBVL6.js → chunk-7ZAC2C2U.js} +24 -24
- package/dist/{chunk-GF7RQWXC.js → chunk-AJRJDXYR.js} +2 -2
- package/dist/{chunk-YEQCMA5L.js → chunk-BOSIHHOH.js} +2 -2
- package/dist/{chunk-7LF2OHIJ.js → chunk-BRHKW7GY.js} +2 -2
- package/dist/{chunk-LX4TNSAE.js → chunk-CBY54QYW.js} +4 -4
- package/dist/chunk-FEHIOYML.js +168 -0
- package/dist/chunk-FEHIOYML.js.map +1 -0
- package/dist/{chunk-6YMEU6OQ.js → chunk-G72IPMR7.js} +2 -2
- package/dist/{chunk-7AF243WZ.js → chunk-GBVRVYF4.js} +1 -1
- package/dist/{chunk-GTD4Q62X.js → chunk-H4GQ2Y24.js} +3 -3
- package/dist/{chunk-QI5RDDEL.js → chunk-HXZNTZ3Y.js} +6 -6
- package/dist/{chunk-CIAI24TQ.js → chunk-IBZQQOM5.js} +3 -3
- package/dist/{chunk-RYST72N5.js → chunk-IINVXO3U.js} +4 -154
- package/dist/chunk-IINVXO3U.js.map +1 -0
- package/dist/{chunk-R7TZ2HCS.js → chunk-JG22O53B.js} +58 -3
- package/dist/chunk-JG22O53B.js.map +1 -0
- package/dist/{chunk-VPHSMJ2E.js → chunk-JPWSYHLB.js} +2 -2
- package/dist/{chunk-X7LEDA74.js → chunk-KFB4YNXM.js} +2 -2
- package/dist/{chunk-IPLYGWQF.js → chunk-KQAFEZQX.js} +5 -5
- package/dist/chunk-LQWOFU6L.js +17 -0
- package/dist/chunk-LQWOFU6L.js.map +1 -0
- package/dist/{chunk-ZUPKNWRZ.js → chunk-MIUL6AUZ.js} +3 -3
- package/dist/{chunk-EJY3HJMT.js → chunk-MYI3RKI6.js} +2 -2
- package/dist/{chunk-NA56NSKL.js → chunk-OOJCXJBN.js} +2 -2
- package/dist/{chunk-7KQB4EBS.js → chunk-OPPBTPUU.js} +4 -4
- package/dist/{chunk-ERPBRXVZ.js → chunk-PZKWPXRF.js} +2 -2
- package/dist/{chunk-FHKXVTM5.js → chunk-Q5XKKDFQ.js} +16 -16
- package/dist/{chunk-QRWMS6SI.js → chunk-Q6OL23WM.js} +2 -2
- package/dist/{chunk-OW7NVMGQ.js → chunk-QIZOU3FN.js} +2 -2
- package/dist/{chunk-V3KIRICY.js → chunk-QQYHYW2N.js} +3 -3
- package/dist/{chunk-YFCEBB5P.js → chunk-QTXNS3HB.js} +2 -2
- package/dist/{chunk-2QSZNTDO.js → chunk-RKNJBZ55.js} +4 -4
- package/dist/{chunk-E4KMY4KR.js → chunk-SNEUAZ6B.js} +2 -2
- package/dist/{chunk-TSTI6A3A.js → chunk-SYJW273H.js} +11 -11
- package/dist/{chunk-EFKZT6AY.js → chunk-T42L3S6A.js} +6 -11
- package/dist/chunk-T42L3S6A.js.map +1 -0
- package/dist/{chunk-YXMHUBN2.js → chunk-TOP3FSDW.js} +25 -102
- package/dist/chunk-TOP3FSDW.js.map +1 -0
- package/dist/{chunk-PBRCYYO7.js → chunk-ULZFZL7K.js} +2 -2
- package/dist/{chunk-UGHCZS6K.js → chunk-VFZQXYN5.js} +2 -2
- package/dist/{chunk-IVXVLDNT.js → chunk-WKJTMXME.js} +37 -54
- package/dist/chunk-WKJTMXME.js.map +1 -0
- package/dist/{chunk-NKB43PGI.js → chunk-WZDTSBGQ.js} +2 -2
- package/dist/{chunk-2UM6WHME.js → chunk-XE2QCCT2.js} +2 -2
- package/dist/{chunk-FPEZ74F7.js → chunk-XNJQZLAP.js} +3 -3
- package/dist/{chunk-SYVGVK4S.js → chunk-XTMYB2HY.js} +2 -2
- package/dist/{chunk-OETHJBAL.js → chunk-XV6PUXJ5.js} +71 -71
- package/dist/{chunk-UCLMKNHA.js → chunk-YIMV2KYM.js} +2 -2
- package/dist/{chunk-DYZR3Z6D.js → chunk-YMQKPSB2.js} +4 -4
- package/dist/{chunk-AYVCKGA6.js → chunk-YTXNDEUS.js} +2 -2
- package/dist/{chunk-L3CHRBHE.js → chunk-ZRUEP4IK.js} +17 -11
- package/dist/chunk-ZRUEP4IK.js.map +1 -0
- package/dist/{cli-BFBDYV0D.d.ts → cli-BTNj5DzK.d.ts} +1 -1
- package/dist/cli.d.ts +2 -2
- package/dist/cli.js +59 -57
- package/dist/compounding/engine.js +10 -10
- package/dist/config.js +5 -3
- package/dist/connectors/codex-materialize-runner.js +10 -10
- package/dist/connectors/index.js +10 -10
- package/dist/consolidation-provenance-check.js +2 -2
- package/dist/convergence-refresh.js +12 -12
- package/dist/conversation-index/backend.js +2 -2
- package/dist/corpus-watermark.js +12 -12
- package/dist/entity-retrieval.js +10 -10
- package/dist/external-wiki-access.d.ts +1 -1
- package/dist/external-wiki-access.js +28 -26
- package/dist/external-wiki-mcp-tools.d.ts +1 -1
- package/dist/extraction-judge.d.ts +2 -1
- package/dist/extraction-judge.js +6 -1
- package/dist/extraction-normalization.js +2 -2
- package/dist/extraction-prompt.d.ts +20 -1
- package/dist/extraction-prompt.js +11 -1
- package/dist/extraction.js +13 -13
- package/dist/{first-start-migration-4NETATFF.js → first-start-migration-Q2VB2E2D.js} +4 -4
- package/dist/harmonic-retrieval.js +1 -1
- package/dist/index.d.ts +680 -680
- package/dist/index.js +92 -90
- package/dist/maintenance/memory-governance.js +10 -10
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +10 -10
- package/dist/maintenance/rebuild-memory-projection.js +11 -11
- package/dist/mcp-memory-inspector-app.d.ts +1 -1
- package/dist/namespaces/migrate.js +11 -11
- package/dist/namespaces/search.js +4 -4
- package/dist/namespaces/storage.js +10 -10
- package/dist/offline-sync.js +3 -2
- package/dist/operator-doctor-corpus.js +13 -13
- package/dist/operator-toolkit.js +24 -22
- package/dist/orchestration/maintenance.js +16 -16
- package/dist/orchestrator.js +85 -83
- package/dist/{public-http-8PcrDIYi.d.ts → public-http-BmPktTe3.d.ts} +1 -1
- package/dist/reconcile/cursor.js +7 -3
- package/dist/reconcile/cursor.js.map +1 -1
- package/dist/reconcile/manifest.js +3 -7
- package/dist/reconcile/plan.d.ts +15 -1
- package/dist/reconcile/plan.js +6 -10
- package/dist/resume-bundles.js +6 -4
- package/dist/schemas.d.ts +108 -108
- package/dist/search/factory.js +3 -3
- package/dist/search/index.js +3 -3
- package/dist/semantic-consolidation.js +16 -16
- package/dist/semantic-rule-promotion.js +10 -10
- package/dist/semantic-rule-verifier.js +10 -10
- package/dist/shared-context/manager.d.ts +8 -8
- package/dist/source-agent-qualifier.js +10 -10
- package/dist/storage.js +9 -9
- package/dist/support-passport/index.d.ts +4 -4
- package/dist/support-passport/index.js +30 -28
- 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 +66 -66
- package/dist/verified-recall.js +10 -10
- package/package.json +2 -2
- package/src/calibration.ts +3 -1
- package/src/census-validation.ts +25 -0
- package/src/coding/architecture-surfaces.test.ts +9 -10
- package/src/coding/architecture-surfaces.ts +2 -35
- package/src/coding/codegraph-runtime-loader.test.ts +228 -0
- package/src/coding/codegraph-runtime.ts +30 -50
- package/src/coding/codegraph-surfaces.ts +2 -2
- package/src/coding/coding-knowledge-config.ts +35 -1
- package/src/coding/decision-surfaces.test.ts +9 -10
- package/src/coding/decision-surfaces.ts +2 -40
- package/src/coding/session-delta-surfaces.test.ts +9 -10
- package/src/coding/session-delta-surfaces.ts +2 -33
- package/src/extraction-judge.ts +3 -1
- package/src/extraction-output-language.test.ts +116 -0
- package/src/extraction-prompt.ts +70 -1
- package/src/extraction.ts +23 -95
- package/src/offline-sync.ts +4 -4
- package/src/reconcile/census-parity.test.ts +152 -0
- package/src/reconcile/cursor.ts +5 -5
- package/src/reconcile/manifest.ts +4 -11
- package/src/reconcile/plan.ts +18 -15
- package/dist/chunk-EFKZT6AY.js.map +0 -1
- package/dist/chunk-IVXVLDNT.js.map +0 -1
- package/dist/chunk-L3CHRBHE.js.map +0 -1
- package/dist/chunk-R7TZ2HCS.js.map +0 -1
- package/dist/chunk-RYST72N5.js.map +0 -1
- package/dist/chunk-TWTUGCTY.js.map +0 -1
- package/dist/chunk-YXMHUBN2.js.map +0 -1
- package/dist/chunk-Z4N7SVVF.js.map +0 -1
- package/dist/{access-service-cKQrte9Z.d.ts → access-service-CocW74uA.d.ts} +64 -64
- /package/dist/{chunk-LEPOP46W.js.map → chunk-227UFSEQ.js.map} +0 -0
- /package/dist/{chunk-3Z5TGRFA.js.map → chunk-3NZAVWU5.js.map} +0 -0
- /package/dist/{chunk-I5FLIB2J.js.map → chunk-3S3PNR5H.js.map} +0 -0
- /package/dist/{chunk-R6UMNP5C.js.map → chunk-3T6HIIKA.js.map} +0 -0
- /package/dist/{chunk-77QZW2D6.js.map → chunk-3TDAA7VA.js.map} +0 -0
- /package/dist/{chunk-DXDAQZ2K.js.map → chunk-42TIIO2M.js.map} +0 -0
- /package/dist/{chunk-Y7COCXY2.js.map → chunk-4F67JJPG.js.map} +0 -0
- /package/dist/{chunk-PB4WVYGC.js.map → chunk-5S5DUJFJ.js.map} +0 -0
- /package/dist/{chunk-KYTRF64R.js.map → chunk-5SCFDQEJ.js.map} +0 -0
- /package/dist/{chunk-GG4DN63W.js.map → chunk-62Y5AGCM.js.map} +0 -0
- /package/dist/{chunk-KHCUVYCY.js.map → chunk-6UKSOXAO.js.map} +0 -0
- /package/dist/{chunk-F6JYBVL6.js.map → chunk-7ZAC2C2U.js.map} +0 -0
- /package/dist/{chunk-GF7RQWXC.js.map → chunk-AJRJDXYR.js.map} +0 -0
- /package/dist/{chunk-YEQCMA5L.js.map → chunk-BOSIHHOH.js.map} +0 -0
- /package/dist/{chunk-7LF2OHIJ.js.map → chunk-BRHKW7GY.js.map} +0 -0
- /package/dist/{chunk-LX4TNSAE.js.map → chunk-CBY54QYW.js.map} +0 -0
- /package/dist/{chunk-6YMEU6OQ.js.map → chunk-G72IPMR7.js.map} +0 -0
- /package/dist/{chunk-7AF243WZ.js.map → chunk-GBVRVYF4.js.map} +0 -0
- /package/dist/{chunk-GTD4Q62X.js.map → chunk-H4GQ2Y24.js.map} +0 -0
- /package/dist/{chunk-QI5RDDEL.js.map → chunk-HXZNTZ3Y.js.map} +0 -0
- /package/dist/{chunk-CIAI24TQ.js.map → chunk-IBZQQOM5.js.map} +0 -0
- /package/dist/{chunk-VPHSMJ2E.js.map → chunk-JPWSYHLB.js.map} +0 -0
- /package/dist/{chunk-X7LEDA74.js.map → chunk-KFB4YNXM.js.map} +0 -0
- /package/dist/{chunk-IPLYGWQF.js.map → chunk-KQAFEZQX.js.map} +0 -0
- /package/dist/{chunk-ZUPKNWRZ.js.map → chunk-MIUL6AUZ.js.map} +0 -0
- /package/dist/{chunk-EJY3HJMT.js.map → chunk-MYI3RKI6.js.map} +0 -0
- /package/dist/{chunk-NA56NSKL.js.map → chunk-OOJCXJBN.js.map} +0 -0
- /package/dist/{chunk-7KQB4EBS.js.map → chunk-OPPBTPUU.js.map} +0 -0
- /package/dist/{chunk-ERPBRXVZ.js.map → chunk-PZKWPXRF.js.map} +0 -0
- /package/dist/{chunk-FHKXVTM5.js.map → chunk-Q5XKKDFQ.js.map} +0 -0
- /package/dist/{chunk-QRWMS6SI.js.map → chunk-Q6OL23WM.js.map} +0 -0
- /package/dist/{chunk-OW7NVMGQ.js.map → chunk-QIZOU3FN.js.map} +0 -0
- /package/dist/{chunk-V3KIRICY.js.map → chunk-QQYHYW2N.js.map} +0 -0
- /package/dist/{chunk-YFCEBB5P.js.map → chunk-QTXNS3HB.js.map} +0 -0
- /package/dist/{chunk-2QSZNTDO.js.map → chunk-RKNJBZ55.js.map} +0 -0
- /package/dist/{chunk-E4KMY4KR.js.map → chunk-SNEUAZ6B.js.map} +0 -0
- /package/dist/{chunk-TSTI6A3A.js.map → chunk-SYJW273H.js.map} +0 -0
- /package/dist/{chunk-PBRCYYO7.js.map → chunk-ULZFZL7K.js.map} +0 -0
- /package/dist/{chunk-UGHCZS6K.js.map → chunk-VFZQXYN5.js.map} +0 -0
- /package/dist/{chunk-NKB43PGI.js.map → chunk-WZDTSBGQ.js.map} +0 -0
- /package/dist/{chunk-2UM6WHME.js.map → chunk-XE2QCCT2.js.map} +0 -0
- /package/dist/{chunk-FPEZ74F7.js.map → chunk-XNJQZLAP.js.map} +0 -0
- /package/dist/{chunk-SYVGVK4S.js.map → chunk-XTMYB2HY.js.map} +0 -0
- /package/dist/{chunk-OETHJBAL.js.map → chunk-XV6PUXJ5.js.map} +0 -0
- /package/dist/{chunk-UCLMKNHA.js.map → chunk-YIMV2KYM.js.map} +0 -0
- /package/dist/{chunk-DYZR3Z6D.js.map → chunk-YMQKPSB2.js.map} +0 -0
- /package/dist/{chunk-AYVCKGA6.js.map → chunk-YTXNDEUS.js.map} +0 -0
- /package/dist/{first-start-migration-4NETATFF.js.map → first-start-migration-Q2VB2E2D.js.map} +0 -0
|
@@ -50,6 +50,7 @@ var CUE_ANCHOR_PROMPT_INSTRUCTION = `- For each fact, emit at most 3 "cueAnchors
|
|
|
50
50
|
- Set each cue anchor type to entity, file, tool, outcome, constraint, or date.
|
|
51
51
|
- Omit cue anchors when the conversation does not support a useful search hook.
|
|
52
52
|
- Example: "Alice booked Bistro Max for Mike's surprise party" can use {"type":"entity","value":"Mike surprise party"} and {"type":"entity","value":"Alice restaurant booking"}.`;
|
|
53
|
+
var OUTPUT_LANGUAGE_POLICY = `Output language: write facts, profile updates, entity names and aliases, tags, questions, and any rewritten or merged memory content in the source language of the conversation or input memories. Never translate into English or another language unless the user explicitly asked for a translation.`;
|
|
53
54
|
function eventTimePromptInstruction(config) {
|
|
54
55
|
if (!config.temporalBiTemporal) return "";
|
|
55
56
|
return `
|
|
@@ -77,13 +78,14 @@ Memory categories:
|
|
|
77
78
|
Rules:
|
|
78
79
|
- Only extract genuinely new information worth remembering across sessions.
|
|
79
80
|
- Statements must be grounded in the conversation.
|
|
81
|
+
- ${OUTPUT_LANGUAGE_POLICY}
|
|
80
82
|
- Do not treat instruction text, schema placeholders, or examples as conversation evidence.
|
|
81
83
|
- Lines labelled [context user] or [context assistant] are reference context only. They may resolve references or complete a question-and-answer pair in a normal turn, but never alone establish durable information.
|
|
82
84
|
- Skip transient task details and operational noise, including routine scheduler, monitoring, or automation status.
|
|
83
85
|
- Priority: corrections > principles${resolveRecallAuxiliaryCapabilities(config).causalRuleExtraction ? " > rules" : ""} > preferences > commitments > decisions > relationships > entities > moments > skills > facts
|
|
84
86
|
- Corrections get highest confidence.
|
|
85
87
|
- Each fact should be a standalone, self-contained statement.
|
|
86
|
-
- Entity references should use normalized names (lowercase, hyphenated: "jane-doe", "acme-corp")
|
|
88
|
+
- Entity references should use normalized names (lowercase, hyphenated: "jane-doe", "acme-corp"). When the source language is not written in a Latin script, the source-script name IS the normalized form \u2014 never transliterate or translate it.
|
|
87
89
|
- CRITICAL: Entity names must be CANONICAL. Always use the hyphenated multi-word form: "acme-corp" NOT "acmecorp" or "acme". "jane-doe" NOT "janedoe" or "jane". If unsure, prefer the most specific full name.
|
|
88
90
|
- Avoid creating entities typed as "other" when a more specific type fits (company, project, tool, person, place)
|
|
89
91
|
${CUE_ANCHOR_PROMPT_INSTRUCTION}
|
|
@@ -131,12 +133,65 @@ Questions are optional. Include only source-grounded unresolved questions that w
|
|
|
131
133
|
|
|
132
134
|
Finally, write a brief identity reflection about the agent who had this conversation, based only on the conversation. Do not write about the extraction process.`;
|
|
133
135
|
}
|
|
136
|
+
var CONSOLIDATION_RESPONSE_SCHEMA = `{
|
|
137
|
+
"items": [
|
|
138
|
+
{
|
|
139
|
+
"existingId": "id",
|
|
140
|
+
"action": "ADD",
|
|
141
|
+
"mergeWith": "optional-existing-id",
|
|
142
|
+
"updatedContent": "optional replacement content",
|
|
143
|
+
"reason": "brief reason for this action"
|
|
144
|
+
}
|
|
145
|
+
],
|
|
146
|
+
"profileUpdates": ["optional profile update"],
|
|
147
|
+
"entityUpdates": [{"name": "person-jane-doe", "type": "person", "facts": ["Now leads the backend team", "Recently migrated the user service to TypeScript"]}]
|
|
148
|
+
}`;
|
|
149
|
+
var PROFILE_CONSOLIDATION_RESPONSE_SCHEMA = `{
|
|
150
|
+
"consolidatedProfile": "# Behavioral Profile\\n\\n... (complete markdown)",
|
|
151
|
+
"removedCount": 42,
|
|
152
|
+
"summary": "brief summary of what was consolidated"
|
|
153
|
+
}`;
|
|
154
|
+
function buildConsolidationSystemPrompt(config) {
|
|
155
|
+
return `You are a memory consolidation system. Compare new memories against existing ones and decide what to do with each.
|
|
156
|
+
|
|
157
|
+
Actions:
|
|
158
|
+
- ADD: Keep the new memory as-is (no duplicate exists)
|
|
159
|
+
- MERGE: Combine with an existing memory (provide mergeWith ID and updated content)
|
|
160
|
+
- UPDATE: Replace existing memory content (provide updated content)
|
|
161
|
+
- INVALIDATE: Remove existing memory (it's been superseded or is wrong)
|
|
162
|
+
- SKIP: This new memory is redundant (exact duplicate or subset of existing)
|
|
163
|
+
|
|
164
|
+
Also:
|
|
165
|
+
- Suggest profile updates based on patterns across memories
|
|
166
|
+
- Identify entity updates for entity tracking${resolveRecallAuxiliaryCapabilities(config).causalRuleExtraction ? `
|
|
167
|
+
- When merging or updating memories, look for IF\u2192THEN causal patterns. If a memory describes "X failed/succeeded because Y" or "doing X led to Y", rewrite its content to make the causal rule explicit in the form "IF <condition> THEN <action/outcome>".` : ""}
|
|
168
|
+
- ${OUTPUT_LANGUAGE_POLICY}`;
|
|
169
|
+
}
|
|
170
|
+
function buildProfileConsolidationSystemPrompt(targetLines) {
|
|
171
|
+
return `You are a profile consolidation system. You are given a behavioral profile (markdown) that has grown too large. Your job is to produce a CONSOLIDATED version that:
|
|
172
|
+
|
|
173
|
+
1. PRESERVES all ## section headers and their structure
|
|
174
|
+
2. MERGES duplicate or near-duplicate bullet points into single, clear statements
|
|
175
|
+
3. REMOVES stale information that has been superseded by newer bullets
|
|
176
|
+
4. REMOVES trivial or overly specific operational details that won't be useful across sessions
|
|
177
|
+
5. KEEPS the most important, durable observations about the user's preferences, habits, identity, and working style
|
|
178
|
+
6. Target roughly ${targetLines} lines \u2014 this is a soft target, prioritize quality over length
|
|
179
|
+
7. Write in the same style as the existing profile \u2014 concise bullets, no fluff
|
|
180
|
+
8. ${OUTPUT_LANGUAGE_POLICY}
|
|
181
|
+
|
|
182
|
+
The output should be the COMPLETE consolidated profile as valid markdown, starting with "# Behavioral Profile".`;
|
|
183
|
+
}
|
|
134
184
|
|
|
135
185
|
export {
|
|
136
186
|
EXTRACTION_RESPONSE_SHAPE,
|
|
137
187
|
EXTRACTION_RESPONSE_PLACEHOLDERS,
|
|
138
188
|
CUE_ANCHOR_PROMPT_INSTRUCTION,
|
|
189
|
+
OUTPUT_LANGUAGE_POLICY,
|
|
139
190
|
eventTimePromptInstruction,
|
|
140
|
-
buildExtractionInstructions
|
|
191
|
+
buildExtractionInstructions,
|
|
192
|
+
CONSOLIDATION_RESPONSE_SCHEMA,
|
|
193
|
+
PROFILE_CONSOLIDATION_RESPONSE_SCHEMA,
|
|
194
|
+
buildConsolidationSystemPrompt,
|
|
195
|
+
buildProfileConsolidationSystemPrompt
|
|
141
196
|
};
|
|
142
|
-
//# sourceMappingURL=chunk-
|
|
197
|
+
//# sourceMappingURL=chunk-JG22O53B.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/extraction-prompt.ts"],"sourcesContent":["/**\n * Extraction prompt construction (issue #1995 sibling extraction).\n *\n * The system prompt, its JSON response shape, and the placeholder table\n * derived from that shape are prompt DATA, not engine behavior. They live here\n * so `extraction.ts` holds the pipeline and one module owns the text every\n * extraction path — local LLM, direct client, gateway fallback — sends.\n */\n\nimport { AMBIENT_CAPTURE_PROMPT_SECTION, AMBIENT_SPECULATIVE_TIER_CLAUSE } from \"./ambient-provenance.js\";\nimport { resolveMemoryLifecycleCapabilities, resolveRecallAuxiliaryCapabilities } from \"./capabilities.js\";\nimport type { PluginConfig } from \"./types.js\";\n\nexport const EXTRACTION_RESPONSE_SHAPE = `{\n \"facts\": [{\n \"category\": \"<category>\",\n \"content\": \"<source-grounded statement>\",\n \"confidence\": 0.0,\n \"tags\": [\"<tag>\"],\n \"entityRef\": \"<optional normalized-name>\",\n \"cueAnchors\": [{\"type\": \"<anchor-type>\", \"value\": \"<entity-or-topic plus key aspect>\"}],\n \"promptedByQuestion\": \"<optional source-grounded question>\",\n \"quote\": \"<optional exact contiguous source span>\",\n \"scope\": \"<optional project-or-global>\",\n \"structuredAttributes\": {\"<key>\": \"<value>\"},\n \"procedureSteps\": [{\"order\": 1, \"intent\": \"<step>\"}, {\"order\": 2, \"intent\": \"<step>\"}],\n \"reasoningTrace\": {\n \"steps\": [{\"order\": 1, \"description\": \"<step>\"}, {\"order\": 2, \"description\": \"<step>\"}],\n \"finalAnswer\": \"<answer>\",\n \"observedOutcome\": \"<optional outcome>\"\n },\n \"eventTime\": \"<optional source temporal expression>\"\n }],\n \"entities\": [{\n \"name\": \"<normalized-name>\",\n \"type\": \"<entity-type>\",\n \"facts\": [\"<source-grounded statement>\"],\n \"promptedByQuestion\": \"<optional source-grounded question>\",\n \"structuredSections\": [{\"key\": \"<section-key>\", \"title\": \"<section-title>\", \"facts\": [\"<source-grounded statement>\"]}]\n }],\n \"profileUpdates\": [\"<source-grounded profile update>\"],\n \"questions\": [{\"question\": \"<source-grounded unresolved question>\", \"context\": \"<source-grounded context>\", \"priority\": 0.0}],\n \"identityReflection\": \"<conversation-grounded agent reflection>\",\n \"episodeTitle\": \"<six-to-eight word conversation segment title>\",\n \"relationships\": [{\"source\": \"<normalized-name>\", \"target\": \"<normalized-name>\", \"label\": \"<source-grounded relationship>\"}]\n}`;\nexport const EXTRACTION_RESPONSE_PLACEHOLDERS: Record<string, true> = {};\nfor (const placeholder of EXTRACTION_RESPONSE_SHAPE.match(/<[^<>\\r\\n]+>/g) ?? []) {\n EXTRACTION_RESPONSE_PLACEHOLDERS[placeholder] = true;\n}\nexport const CUE_ANCHOR_PROMPT_INSTRUCTION = `- For each fact, emit at most 3 \"cueAnchors\".\n- Each cue anchor value must be a source-grounded search hook of at most 120 characters, in the form \"<main entity or topic> <key aspect>\".\n- Set each cue anchor type to entity, file, tool, outcome, constraint, or date.\n- Omit cue anchors when the conversation does not support a useful search hook.\n- Example: \"Alice booked Bistro Max for Mike's surprise party\" can use {\"type\":\"entity\",\"value\":\"Mike surprise party\"} and {\"type\":\"entity\",\"value\":\"Alice restaurant booking\"}.`;\n\n/**\n * Output-language policy (issue #2190). Every prompt that produces memory\n * content embeds this verbatim so non-English conversations are not silently\n * translated to English — translated memories fail later lexical recall.\n */\nexport const OUTPUT_LANGUAGE_POLICY = `Output language: write facts, profile updates, entity names and aliases, tags, questions, and any rewritten or merged memory content in the source language of the conversation or input memories. Never translate into English or another language unless the user explicitly asked for a translation.`;\n\n/**\n * Bi-temporal event-time extraction instruction (#1578 PR2). Emitted on\n * every extraction entry path when `temporal.biTemporal` is on so the LLM\n * emits an optional per-fact `eventTime` expression. The expression is\n * resolved against the source turn timestamp at write time — never\n * wall-clock — so replay/import of old transcripts anchors correctly.\n * Returns an empty string when the gate is off (byte-identical prompt).\n */\nexport function eventTimePromptInstruction(config: PluginConfig): string {\n if (!config.temporalBiTemporal) return \"\";\n return `\nWhen a fact states when it became or stopped being true, copy that explicit temporal expression verbatim into \"eventTime\". Omit \"eventTime\" when no such expression appears; never infer dates.`;\n}\n\n/**\n * Build extraction instructions shared between local and cloud LLM.\n *\n * `ambientCapture` marks input from an always-on recorder, which may carry\n * speech the user never authored (issue #2294).\n */\nexport function buildExtractionInstructions(\n config: PluginConfig,\n existingEntities?: string[],\n ambientCapture = false\n): string {\n const lifecycleCaps = resolveMemoryLifecycleCapabilities(config);\n return `You are a memory extraction system. Analyze the following conversation and extract durable, reusable memories.\n\nMemory categories:\n- fact: Objective information about the world\n- preference: User likes, dislikes, or stylistic choices\n- correction: User correcting a mistake or misconception (highest priority)\n- entity: Information about a specific person, project, tool, or company\n- decision: A choice that was made with rationale\n- relationship: How two entities relate to each other (e.g., \"Alice is Bob's manager\", \"Acme Corp uses Shopify\")\n- principle: Durable rules, values, or operating beliefs (e.g., \"never use Chat Completions API\")\n- commitment: Promises, obligations, or deadlines (e.g., \"deploy by Friday\", \"call accountant Monday\")\n- moment: Emotionally significant events or milestones (e.g., \"first successful deployment of engram\")\n- skill: Capabilities the user or agent has demonstrated (e.g., \"user is proficient with Kubernetes\")${\n resolveRecallAuxiliaryCapabilities(config).causalRuleExtraction\n ? `\n- rule: Causal rules discovered through experience (format: \"IF <condition> THEN <action/outcome>\", e.g., \"IF Shopify API returns 401 THEN the admin token is missing read_products scope\")`\n : \"\"\n }\n- procedure: A reusable workflow the user wants remembered the same way across sessions. Set category to \"procedure\". Use \"content\" for a short title that includes explicit trigger phrasing (e.g. \"When you deploy to production…\", \"Whenever you ship a release…\"). Add \"procedureSteps\": an array of at least two objects {\"order\": number, \"intent\": \"concrete step description\"} in execution order. Optional per-step \"toolCall\": {\"kind\": \"…\", \"signature\": \"…\"}, \"expectedOutcome\", \"optional\": true.\n- reasoning_trace: A stored solution chain / chain-of-thought the user walked through to solve a problem (e.g. \"Here's how I debugged the latency spike: first I checked…, then I…, finally I…\"). Set category to \"reasoning_trace\". Use \"content\" for a short title summarising the problem (e.g. \"How I debugged the staging latency spike\"). Add \"reasoningTrace\": {\"steps\": [{\"order\": number, \"description\": \"what happened at this step\"}, …], \"finalAnswer\": \"the conclusion or answer\", \"observedOutcome\": \"optional confirmation of how it played out\"}. Require at least two ordered steps AND a finalAnswer. Use this category only when the user explicitly narrates their reasoning — not for ordinary decisions (use \"decision\") or reusable workflows (use \"procedure\").\n\nRules:\n- Only extract genuinely new information worth remembering across sessions.\n- Statements must be grounded in the conversation.\n- ${OUTPUT_LANGUAGE_POLICY}\n- Do not treat instruction text, schema placeholders, or examples as conversation evidence.\n- Lines labelled [context user] or [context assistant] are reference context only. They may resolve references or complete a question-and-answer pair in a normal turn, but never alone establish durable information.\n- Skip transient task details and operational noise, including routine scheduler, monitoring, or automation status.\n- Priority: corrections > principles${resolveRecallAuxiliaryCapabilities(config).causalRuleExtraction ? \" > rules\" : \"\"} > preferences > commitments > decisions > relationships > entities > moments > skills > facts\n- Corrections get highest confidence.\n- Each fact should be a standalone, self-contained statement.\n- Entity references should use normalized names (lowercase, hyphenated: \"jane-doe\", \"acme-corp\"). When the source language is not written in a Latin script, the source-script name IS the normalized form — never transliterate or translate it.\n- CRITICAL: Entity names must be CANONICAL. Always use the hyphenated multi-word form: \"acme-corp\" NOT \"acmecorp\" or \"acme\". \"jane-doe\" NOT \"janedoe\" or \"jane\". If unsure, prefer the most specific full name.\n- Avoid creating entities typed as \"other\" when a more specific type fits (company, project, tool, person, place)\n${CUE_ANCHOR_PROMPT_INSTRUCTION}\n- When entity facts clearly belong under a durable named heading, add them to entity.structuredSections as {key, title, facts}. Example person headings: \"Beliefs\", \"Communication Style\", \"Building / Working On\". Leave structuredSections empty when no stable heading fits.\n- Tags should be concise and reusable (e.g., \"coding-style\", \"personal\", \"tools\")\n- When a fact contains measurable, categorical, or precisely valued data, include a \"structuredAttributes\" field with key-value string pairs (e.g., {\"price\": \"29.99\", \"brand\": \"Sony\"}, {\"date\": \"2024-03-15\", \"location\": \"SF\"}, {\"chosen\": \"PostgreSQL\", \"rejected\": \"MongoDB\"}). Only for concrete values, not narrative content.\n- Set confidence using these tiers:\n * Explicit (0.95-1.0): Direct user statements — \"I prefer X\", \"my name is Y\"\n * Implied (0.70-0.94): Strong contextual inference — user consistently does X, clear from conversation flow\n * Inferred (0.40-0.69): Pattern recognition — reasonable guess from limited evidence\n * Speculative (0.00-0.39): Tentative hypothesis — weak signal, needs future confirmation. Speculative memories auto-expire after 30 days if not confirmed.${ambientCapture ? AMBIENT_SPECULATIVE_TIER_CLAUSE : \"\"}${\n config.provenance?.enabled\n ? `\n- Source quotes: For each fact, include a \"quote\" field containing the EXACT verbatim words from the conversation that support the fact. Copy a contiguous span from a single speaker turn (not a paraphrase, not a summary). Cap at ~300 characters. This grounds every memory in the literal utterance that created it.`\n : \"\"\n }\n- For commitments: include any deadline or timeframe mentioned${\n lifecycleCaps.extractionScopeClassification\n ? `\n\nScope classification:\nFor each fact, set \"scope\" to one of:\n- \"global\" — knowledge that applies across projects: core framework/library bugs, API behavior patterns, user preferences (editor, language, style), general coding patterns, infrastructure knowledge, technology facts not tied to one codebase\n- \"project\" — knowledge specific to one codebase: file paths, environment configs, deployment details, project-specific workarounds, team/stakeholder info tied to one project, repo-specific conventions. Tool, command, or CLI-flag instructions TIED TO ONE AGENT are also \"project\", because the same tool name means different things in different agent integrations (a \"search\" tool may search repository code in one agent and the web in another); when keeping such an agent-tied instruction, the fact text MUST name the originating agent as a leading \"In <agent>,\" clause (e.g. \"In Pi, use the search tool with a repository path.\"). A tool/command fact that holds in every agent and every repo is NOT agent-tied — leave it \"global\" and do not add a qualifier (e.g. \"\\`git status --short\\` emits compact output\"). Examples: \"In Pi, the search tool takes a repository path\" -> \"project\"; \"\\`git status --short\\` emits compact output\" -> \"global\".\nWhen in doubt, prefer \"project\" — it is safer to keep knowledge scoped narrowly.`\n : \"\"\n }\n${\n ambientCapture\n ? `${AMBIENT_CAPTURE_PROMPT_SECTION}\n`\n : \"\"\n}\nEntity creation rules (STRICT):\n- Only create entities for DURABLE things: real people, companies, products, tools, ongoing projects\n- NEVER create entities for transient items: individual PRs, branches, Jira tickets, meetings, agent task IDs, log files, database tables, cron job runs, sessions\n- When you learn something about a transient item (e.g., PR #58 fixed a bug), store it as a FACT with an entityRef to the parent project — do NOT create an entity for the PR itself\n- Prefer attaching facts to broad parent entities rather than creating sub-entities. E.g., \"acme-store uses Algolia for search\" is a fact on entity \"acme-store\", NOT a new entity \"acme-store-algolia-connector\"\n- The entity list should be SHORT — think \"things that would have their own Wikipedia page\" not \"things mentioned in passing\"\n\n${\n existingEntities && existingEntities.length > 0\n ? `\nKNOWN ENTITIES (use these exact names when referencing existing things):\n${existingEntities.join(\", \")}\n\nWhen you see something that matches a known entity, use THAT name exactly. Only create a NEW entity if nothing in this list represents it.\n`\n : \"\"\n}\n${eventTimePromptInstruction(config)}\nAlso extract relationships between entities mentioned in the conversation.\n- Format: {source: \"entity-name\", target: \"entity-name\", label: \"relationship description\"}\n- Max 5 relationships per extraction\n- Only include clear, durable relationships (e.g., \"works at\", \"created\", \"manages\", \"uses\")\n- Use normalized entity names (e.g., \"person-jane-doe\", \"company-acme-corp\")\n\n\nAlso emit \"episodeTitle\" as a six-to-eight word title for this conversation segment.\nQuestions are optional. Include only source-grounded unresolved questions that would be useful in future sessions; otherwise return an empty array.\n\nFinally, write a brief identity reflection about the agent who had this conversation, based only on the conversation. Do not write about the extraction process.`;\n}\n\nexport const CONSOLIDATION_RESPONSE_SCHEMA = `{\n \"items\": [\n {\n \"existingId\": \"id\",\n \"action\": \"ADD\",\n \"mergeWith\": \"optional-existing-id\",\n \"updatedContent\": \"optional replacement content\",\n \"reason\": \"brief reason for this action\"\n }\n ],\n \"profileUpdates\": [\"optional profile update\"],\n \"entityUpdates\": [{\"name\": \"person-jane-doe\", \"type\": \"person\", \"facts\": [\"Now leads the backend team\", \"Recently migrated the user service to TypeScript\"]}]\n}`;\n\nexport const PROFILE_CONSOLIDATION_RESPONSE_SCHEMA = `{\n \"consolidatedProfile\": \"# Behavioral Profile\\\\n\\\\n... (complete markdown)\",\n \"removedCount\": 42,\n \"summary\": \"brief summary of what was consolidated\"\n}`;\n\n/**\n * System prompt shared by every consolidation path (gateway, direct client,\n * local LLM). Owns the causal-rule clause and the output-language policy so\n * the three paths cannot drift (issue #2190).\n */\nexport function buildConsolidationSystemPrompt(config: PluginConfig): string {\n return `You are a memory consolidation system. Compare new memories against existing ones and decide what to do with each.\n\nActions:\n- ADD: Keep the new memory as-is (no duplicate exists)\n- MERGE: Combine with an existing memory (provide mergeWith ID and updated content)\n- UPDATE: Replace existing memory content (provide updated content)\n- INVALIDATE: Remove existing memory (it's been superseded or is wrong)\n- SKIP: This new memory is redundant (exact duplicate or subset of existing)\n\nAlso:\n- Suggest profile updates based on patterns across memories\n- Identify entity updates for entity tracking${resolveRecallAuxiliaryCapabilities(config).causalRuleExtraction ? `\n- When merging or updating memories, look for IF→THEN causal patterns. If a memory describes \"X failed/succeeded because Y\" or \"doing X led to Y\", rewrite its content to make the causal rule explicit in the form \"IF <condition> THEN <action/outcome>\".` : \"\"}\n- ${OUTPUT_LANGUAGE_POLICY}`;\n}\n\n/**\n * System prompt shared by every profile-consolidation path (gateway, direct\n * client, local LLM). Owns the output-language policy (issue #2190).\n */\nexport function buildProfileConsolidationSystemPrompt(targetLines: number): string {\n return `You are a profile consolidation system. You are given a behavioral profile (markdown) that has grown too large. Your job is to produce a CONSOLIDATED version that:\n\n1. PRESERVES all ## section headers and their structure\n2. MERGES duplicate or near-duplicate bullet points into single, clear statements\n3. REMOVES stale information that has been superseded by newer bullets\n4. REMOVES trivial or overly specific operational details that won't be useful across sessions\n5. KEEPS the most important, durable observations about the user's preferences, habits, identity, and working style\n6. Target roughly ${targetLines} lines — this is a soft target, prioritize quality over length\n7. Write in the same style as the existing profile — concise bullets, no fluff\n8. ${OUTPUT_LANGUAGE_POLICY}\n\nThe output should be the COMPLETE consolidated profile as valid markdown, starting with \"# Behavioral Profile\".`;\n}\n"],"mappings":";;;;;;;;;;AAaO,IAAM,4BAA4B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAiClC,IAAM,mCAAyD,CAAC;AACvE,WAAW,eAAe,0BAA0B,MAAM,eAAe,KAAK,CAAC,GAAG;AAChF,mCAAiC,WAAW,IAAI;AAClD;AACO,IAAM,gCAAgC;AAAA;AAAA;AAAA;AAAA;AAWtC,IAAM,yBAAyB;AAU/B,SAAS,2BAA2B,QAA8B;AACvE,MAAI,CAAC,OAAO,mBAAoB,QAAO;AACvC,SAAO;AAAA;AAET;AAQO,SAAS,4BACd,QACA,kBACA,iBAAiB,OACT;AACR,QAAM,gBAAgB,mCAAmC,MAAM;AAC/D,SAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uGAaL,mCAAmC,MAAM,EAAE,uBACvC;AAAA,+LAEA,EACN;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOE,sBAAsB;AAAA;AAAA;AAAA;AAAA,sCAIY,mCAAmC,MAAM,EAAE,uBAAuB,aAAa,EAAE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMrH,6BAA6B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mKAQ+H,iBAAiB,kCAAkC,EAAE,GAC/M,OAAO,YAAY,UACf;AAAA,6TAEA,EACN;AAAA,gEAEE,cAAc,gCACV;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yFAOA,EACN;AAAA,EAEA,iBACI,GAAG,8BAA8B;AAAA,IAEjC,EACN;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASE,oBAAoB,iBAAiB,SAAS,IAC1C;AAAA;AAAA,EAEJ,iBAAiB,KAAK,IAAI,CAAC;AAAA;AAAA;AAAA,IAIvB,EACN;AAAA,EACE,2BAA2B,MAAM,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYpC;AAEO,IAAM,gCAAgC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AActC,IAAM,wCAAwC;AAAA;AAAA;AAAA;AAAA;AAW9C,SAAS,+BAA+B,QAA8B;AAC3E,SAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,+CAWsC,mCAAmC,MAAM,EAAE,uBAAuB;AAAA,oQAC8I,EAAE;AAAA,IAC7P,sBAAsB;AAC1B;AAMO,SAAS,sCAAsC,aAA6B;AACjF,SAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAOW,WAAW;AAAA;AAAA,KAE1B,sBAAsB;AAAA;AAAA;AAG3B;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isNamespaceKind
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-KFB4YNXM.js";
|
|
4
4
|
import {
|
|
5
5
|
EngramAccessInputError
|
|
6
6
|
} from "./chunk-2Z24E5W2.js";
|
|
@@ -40,4 +40,4 @@ export {
|
|
|
40
40
|
positiveIntQueryParam,
|
|
41
41
|
optionalNamespaceKindQueryParam
|
|
42
42
|
};
|
|
43
|
-
//# sourceMappingURL=chunk-
|
|
43
|
+
//# sourceMappingURL=chunk-JPWSYHLB.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveDefaultNamespaceRoot,
|
|
3
3
|
resolveNamespaceStorageRoot
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-5SCFDQEJ.js";
|
|
5
5
|
import {
|
|
6
6
|
MutationSerializer,
|
|
7
7
|
withHeldFileLock
|
|
@@ -1473,4 +1473,4 @@ export {
|
|
|
1473
1473
|
isNamespaceKind,
|
|
1474
1474
|
NamespaceCatalog
|
|
1475
1475
|
};
|
|
1476
|
-
//# sourceMappingURL=chunk-
|
|
1476
|
+
//# sourceMappingURL=chunk-KFB4YNXM.js.map
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
CAPSULE_SCHEMA_VERSION,
|
|
3
|
-
EXPORT_FORMAT
|
|
4
|
-
} from "./chunk-J4EB7DNW.js";
|
|
5
1
|
import {
|
|
6
2
|
CAPSULE_ID_PATTERN,
|
|
7
3
|
CapsuleBlockSchema,
|
|
@@ -11,6 +7,10 @@ import {
|
|
|
11
7
|
import {
|
|
12
8
|
encryptCapsuleFile
|
|
13
9
|
} from "./chunk-X7Y7WX73.js";
|
|
10
|
+
import {
|
|
11
|
+
CAPSULE_SCHEMA_VERSION,
|
|
12
|
+
EXPORT_FORMAT
|
|
13
|
+
} from "./chunk-J4EB7DNW.js";
|
|
14
14
|
import {
|
|
15
15
|
DEFAULT_TRANSFER_EXCLUDE_DIRS,
|
|
16
16
|
computeTransferOutputRel
|
|
@@ -261,4 +261,4 @@ export {
|
|
|
261
261
|
exportCapsule,
|
|
262
262
|
isValidCapsuleSince
|
|
263
263
|
};
|
|
264
|
-
//# sourceMappingURL=chunk-
|
|
264
|
+
//# sourceMappingURL=chunk-KQAFEZQX.js.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// src/census-validation.ts
|
|
2
|
+
var SHA256_HEX_PATTERN = /^[a-f0-9]{64}$/i;
|
|
3
|
+
var CENSUS_MAX_MTIME_MS = 864e13;
|
|
4
|
+
function isSha256Hex(value) {
|
|
5
|
+
return typeof value === "string" && SHA256_HEX_PATTERN.test(value);
|
|
6
|
+
}
|
|
7
|
+
function isCensusMtimeMs(value) {
|
|
8
|
+
return typeof value === "number" && Number.isFinite(value) && value >= 0 && value <= CENSUS_MAX_MTIME_MS;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export {
|
|
12
|
+
SHA256_HEX_PATTERN,
|
|
13
|
+
CENSUS_MAX_MTIME_MS,
|
|
14
|
+
isSha256Hex,
|
|
15
|
+
isCensusMtimeMs
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=chunk-LQWOFU6L.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/census-validation.ts"],"sourcesContent":["/**\n * Census field acceptance shared by offline-sync and the reconcile planner\n * (issue #2477). Both surfaces parse untrusted peer censuses and must accept\n * and reject exactly the same values; when these checks lived as two copies\n * they could drift silently and break convergence. Each surface keeps only a\n * thin wrapper that picks its own error type and message.\n */\n\n/** 64-character sha256 hex, either case; the canonical stored form is lowercase. */\nexport const SHA256_HEX_PATTERN = /^[a-f0-9]{64}$/i;\n\n/** Largest `mtimeMs` a census may carry: `new Date(ms)` must stay a valid Date. */\nexport const CENSUS_MAX_MTIME_MS = 8_640_000_000_000_000;\n\nexport function isSha256Hex(value: unknown): value is string {\n return typeof value === \"string\" && SHA256_HEX_PATTERN.test(value);\n}\n\n/**\n * Fractional values are valid: `fs.stat()` reports sub-millisecond mtimes on\n * common filesystems, so this deliberately does not require an integer.\n */\nexport function isCensusMtimeMs(value: unknown): value is number {\n return typeof value === \"number\" && Number.isFinite(value) && value >= 0 && value <= CENSUS_MAX_MTIME_MS;\n}\n"],"mappings":";AASO,IAAM,qBAAqB;AAG3B,IAAM,sBAAsB;AAE5B,SAAS,YAAY,OAAiC;AAC3D,SAAO,OAAO,UAAU,YAAY,mBAAmB,KAAK,KAAK;AACnE;AAMO,SAAS,gBAAgB,OAAiC;AAC/D,SAAO,OAAO,UAAU,YAAY,OAAO,SAAS,KAAK,KAAK,SAAS,KAAK,SAAS;AACvF;","names":[]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
NamespaceStorageRouter
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-5SCFDQEJ.js";
|
|
4
4
|
import {
|
|
5
5
|
namespaceCollectionName
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-AJRJDXYR.js";
|
|
7
7
|
import {
|
|
8
8
|
isSafeRouteNamespace
|
|
9
9
|
} from "./chunk-PCXDUHQH.js";
|
|
@@ -213,4 +213,4 @@ export {
|
|
|
213
213
|
verifyNamespaces,
|
|
214
214
|
runNamespaceMigration
|
|
215
215
|
};
|
|
216
|
-
//# sourceMappingURL=chunk-
|
|
216
|
+
//# sourceMappingURL=chunk-MIUL6AUZ.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
listNamespaces
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-MIUL6AUZ.js";
|
|
4
4
|
import {
|
|
5
5
|
capabilityAllowsNamespace
|
|
6
6
|
} from "./chunk-MZWSOLMT.js";
|
|
@@ -282,4 +282,4 @@ export {
|
|
|
282
282
|
computeServiceCorpusWatermarks,
|
|
283
283
|
computeServiceCorpusCensus
|
|
284
284
|
};
|
|
285
|
-
//# sourceMappingURL=chunk-
|
|
285
|
+
//# sourceMappingURL=chunk-MYI3RKI6.js.map
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
SupportPassportError,
|
|
3
3
|
SupportPassportOwnerCreateGrantRequestSchema,
|
|
4
4
|
getOperation
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-WKJTMXME.js";
|
|
6
6
|
|
|
7
7
|
// src/support-passport/access-http.ts
|
|
8
8
|
var OWNER_ROOT = "/engram/v1/support-passport";
|
|
@@ -137,4 +137,4 @@ export {
|
|
|
137
137
|
SUPPORT_PASSPORT_OWNER_HTTP_ROUTES,
|
|
138
138
|
handleSupportPassportOwnerHttp
|
|
139
139
|
};
|
|
140
|
-
//# sourceMappingURL=chunk-
|
|
140
|
+
//# sourceMappingURL=chunk-OOJCXJBN.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import {
|
|
2
|
+
sidecarKey
|
|
3
|
+
} from "./chunk-UFKPQBXH.js";
|
|
1
4
|
import {
|
|
2
5
|
DERIVED_FROM_MEMORY_ID_RE,
|
|
3
6
|
isConsolidationOperator
|
|
4
7
|
} from "./chunk-G7D6GZ5J.js";
|
|
5
|
-
import {
|
|
6
|
-
sidecarKey
|
|
7
|
-
} from "./chunk-UFKPQBXH.js";
|
|
8
8
|
import {
|
|
9
9
|
RECALL_FALLBACK_DIRS
|
|
10
10
|
} from "./chunk-VS2IYZRU.js";
|
|
@@ -342,4 +342,4 @@ function isPathWithin(candidate, root) {
|
|
|
342
342
|
export {
|
|
343
343
|
runConsolidationProvenanceCheck
|
|
344
344
|
};
|
|
345
|
-
//# sourceMappingURL=chunk-
|
|
345
|
+
//# sourceMappingURL=chunk-OPPBTPUU.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
getOperation,
|
|
4
4
|
operationRequiresAuthorizedNamespace,
|
|
5
5
|
operationUsesPrincipalNamespace
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-WKJTMXME.js";
|
|
7
7
|
import {
|
|
8
8
|
assertOperationAuthorizationAllowed
|
|
9
9
|
} from "./chunk-MZWSOLMT.js";
|
|
@@ -60,4 +60,4 @@ export {
|
|
|
60
60
|
authorizationProbeNamespaces,
|
|
61
61
|
authorizationProbeRequiresPrincipalNamespace
|
|
62
62
|
};
|
|
63
|
-
//# sourceMappingURL=chunk-
|
|
63
|
+
//# sourceMappingURL=chunk-PZKWPXRF.js.map
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
TombstoneStore,
|
|
3
|
-
applyTombstoneResurrectionGate,
|
|
4
|
-
buildRetiredFactTombstoneInputs,
|
|
5
|
-
collectRetiredMemoriesForRebuild
|
|
6
|
-
} from "./chunk-46WM6JX2.js";
|
|
7
1
|
import {
|
|
8
2
|
WEARABLES_DIR_NAME,
|
|
9
3
|
escapeSegmentText,
|
|
@@ -15,9 +9,15 @@ import {
|
|
|
15
9
|
unescapeSegmentText,
|
|
16
10
|
unescapeSpeakerLabel
|
|
17
11
|
} from "./chunk-UHVXE24Y.js";
|
|
12
|
+
import {
|
|
13
|
+
TombstoneStore,
|
|
14
|
+
applyTombstoneResurrectionGate,
|
|
15
|
+
buildRetiredFactTombstoneInputs,
|
|
16
|
+
collectRetiredMemoriesForRebuild
|
|
17
|
+
} from "./chunk-46WM6JX2.js";
|
|
18
18
|
import {
|
|
19
19
|
normalizeQmdResultPath
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-AJRJDXYR.js";
|
|
21
21
|
import {
|
|
22
22
|
withholdToolScopedFromSharedNamespace
|
|
23
23
|
} from "./chunk-S2V7RUCL.js";
|
|
@@ -25,6 +25,10 @@ import {
|
|
|
25
25
|
SPECULATIVE_TTL_DAYS,
|
|
26
26
|
confidenceTier
|
|
27
27
|
} from "./chunk-AR253JBM.js";
|
|
28
|
+
import {
|
|
29
|
+
normalizeProjectionPreview,
|
|
30
|
+
normalizeProjectionTags
|
|
31
|
+
} from "./chunk-SCU65EZI.js";
|
|
28
32
|
import {
|
|
29
33
|
rewriteProjectedEntityReferences,
|
|
30
34
|
rewriteProjectedMemoryEntityReference
|
|
@@ -32,10 +36,6 @@ import {
|
|
|
32
36
|
import {
|
|
33
37
|
createMemorySnapshot
|
|
34
38
|
} from "./chunk-S2HLHAZ4.js";
|
|
35
|
-
import {
|
|
36
|
-
normalizeProjectionPreview,
|
|
37
|
-
normalizeProjectionTags
|
|
38
|
-
} from "./chunk-SCU65EZI.js";
|
|
39
39
|
import {
|
|
40
40
|
rotateMarkdownFileToArchive
|
|
41
41
|
} from "./chunk-DM2T26WE.js";
|
|
@@ -73,10 +73,6 @@ import {
|
|
|
73
73
|
import {
|
|
74
74
|
checkCorpusReadAbort
|
|
75
75
|
} from "./chunk-5GINB5LC.js";
|
|
76
|
-
import {
|
|
77
|
-
isConsolidationOperator,
|
|
78
|
-
isValidDerivedFromEntry
|
|
79
|
-
} from "./chunk-G7D6GZ5J.js";
|
|
80
76
|
import {
|
|
81
77
|
createVersion
|
|
82
78
|
} from "./chunk-UFKPQBXH.js";
|
|
@@ -107,6 +103,10 @@ import {
|
|
|
107
103
|
normalizeSupersessionKey,
|
|
108
104
|
supersessionKeysForFact
|
|
109
105
|
} from "./chunk-5WITETWU.js";
|
|
106
|
+
import {
|
|
107
|
+
isConsolidationOperator,
|
|
108
|
+
isValidDerivedFromEntry
|
|
109
|
+
} from "./chunk-G7D6GZ5J.js";
|
|
110
110
|
import {
|
|
111
111
|
clearMemoryCache,
|
|
112
112
|
getCachedEntities,
|
|
@@ -11175,4 +11175,4 @@ export {
|
|
|
11175
11175
|
isValidBufferSurpriseEvent,
|
|
11176
11176
|
StorageManager3 as StorageManager
|
|
11177
11177
|
};
|
|
11178
|
-
//# sourceMappingURL=chunk-
|
|
11178
|
+
//# sourceMappingURL=chunk-Q5XKKDFQ.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-KJTKLXTH.js";
|
|
4
4
|
import {
|
|
5
5
|
StorageManager
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-Q5XKKDFQ.js";
|
|
7
7
|
import {
|
|
8
8
|
copyExistingFileToBackup,
|
|
9
9
|
writeFileAtomically
|
|
@@ -260,4 +260,4 @@ export {
|
|
|
260
260
|
backupExistingLedger,
|
|
261
261
|
rebuildMemoryLifecycleLedger
|
|
262
262
|
};
|
|
263
|
-
//# sourceMappingURL=chunk-
|
|
263
|
+
//# sourceMappingURL=chunk-Q6OL23WM.js.map
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
} from "./chunk-NOB2T2FC.js";
|
|
12
12
|
import {
|
|
13
13
|
parseConfig
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-IINVXO3U.js";
|
|
15
15
|
import {
|
|
16
16
|
resolveObjectiveStateStoreDir,
|
|
17
17
|
validateObjectiveStateSnapshot
|
|
@@ -268,4 +268,4 @@ export {
|
|
|
268
268
|
recordResumeBundle,
|
|
269
269
|
getResumeBundleStatus
|
|
270
270
|
};
|
|
271
|
-
//# sourceMappingURL=chunk-
|
|
271
|
+
//# sourceMappingURL=chunk-QIZOU3FN.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
hasMemoryData
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-KFB4YNXM.js";
|
|
4
4
|
import {
|
|
5
5
|
resolveNamespaceStorageRoot
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-5SCFDQEJ.js";
|
|
7
7
|
import {
|
|
8
8
|
getConfiguredNamespaces
|
|
9
9
|
} from "./chunk-Q57GOHLF.js";
|
|
@@ -724,4 +724,4 @@ export {
|
|
|
724
724
|
runNamespaceMaintenancePlan,
|
|
725
725
|
runNamespaceMaintenanceBatchPlan
|
|
726
726
|
};
|
|
727
|
-
//# sourceMappingURL=chunk-
|
|
727
|
+
//# sourceMappingURL=chunk-QQYHYW2N.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveCorpusNamespaceRoots
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-MYI3RKI6.js";
|
|
4
4
|
import {
|
|
5
5
|
capabilityAllowsNamespace
|
|
6
6
|
} from "./chunk-MZWSOLMT.js";
|
|
@@ -200,4 +200,4 @@ async function readAggregateExtractionWatermark(options) {
|
|
|
200
200
|
export {
|
|
201
201
|
readAggregateExtractionWatermark
|
|
202
202
|
};
|
|
203
|
-
//# sourceMappingURL=chunk-
|
|
203
|
+
//# sourceMappingURL=chunk-QTXNS3HB.js.map
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ClaudeCodeAdapter
|
|
3
|
+
} from "./chunk-J64TK33U.js";
|
|
1
4
|
import {
|
|
2
5
|
CodexAdapter
|
|
3
6
|
} from "./chunk-RSUYKGGZ.js";
|
|
@@ -7,9 +10,6 @@ import {
|
|
|
7
10
|
import {
|
|
8
11
|
ReplitAdapter
|
|
9
12
|
} from "./chunk-TMSXWOBZ.js";
|
|
10
|
-
import {
|
|
11
|
-
ClaudeCodeAdapter
|
|
12
|
-
} from "./chunk-J64TK33U.js";
|
|
13
13
|
|
|
14
14
|
// src/adapters/registry.ts
|
|
15
15
|
var AdapterRegistry = class {
|
|
@@ -53,4 +53,4 @@ var AdapterRegistry = class {
|
|
|
53
53
|
export {
|
|
54
54
|
AdapterRegistry
|
|
55
55
|
};
|
|
56
|
-
//# sourceMappingURL=chunk-
|
|
56
|
+
//# sourceMappingURL=chunk-RKNJBZ55.js.map
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
} from "./chunk-UYCIS6V5.js";
|
|
8
8
|
import {
|
|
9
9
|
StorageManager
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-Q5XKKDFQ.js";
|
|
11
11
|
import {
|
|
12
12
|
parseContinuityImprovementLoops
|
|
13
13
|
} from "./chunk-LDXUBPMO.js";
|
|
@@ -1283,4 +1283,4 @@ export {
|
|
|
1283
1283
|
defaultTierMigrationCycleBudget,
|
|
1284
1284
|
CompoundingEngine
|
|
1285
1285
|
};
|
|
1286
|
-
//# sourceMappingURL=chunk-
|
|
1286
|
+
//# sourceMappingURL=chunk-SNEUAZ6B.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-V7IZKJI3.js";
|
|
4
4
|
import {
|
|
5
5
|
AdapterRegistry
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-RKNJBZ55.js";
|
|
7
7
|
import {
|
|
8
8
|
WriteRateLimiter
|
|
9
9
|
} from "./chunk-TB6CBZ5V.js";
|
|
@@ -12,16 +12,16 @@ import {
|
|
|
12
12
|
} from "./chunk-3HSRWJTC.js";
|
|
13
13
|
import {
|
|
14
14
|
handleSupportPassportOwnerHttp
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-OOJCXJBN.js";
|
|
16
16
|
import {
|
|
17
17
|
buildSupportPassportPublicRequestHandler
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-YIMV2KYM.js";
|
|
19
19
|
import {
|
|
20
20
|
nonEmptyQueryParam,
|
|
21
21
|
optionalNamespaceKindQueryParam,
|
|
22
22
|
optionalQueryString,
|
|
23
23
|
positiveIntQueryParam
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-JPWSYHLB.js";
|
|
25
25
|
import {
|
|
26
26
|
EngramMcpServer,
|
|
27
27
|
MCP_SUPPORTED_PROTOCOL_VERSIONS,
|
|
@@ -31,13 +31,13 @@ import {
|
|
|
31
31
|
processChatMessage,
|
|
32
32
|
sessionBelongsToPrincipal,
|
|
33
33
|
subscribeChatTranscript
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-H4GQ2Y24.js";
|
|
35
35
|
import {
|
|
36
36
|
RelayMissionStoreError
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-YMQKPSB2.js";
|
|
38
38
|
import {
|
|
39
39
|
validateRequest
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-IBZQQOM5.js";
|
|
41
41
|
import {
|
|
42
42
|
executeResolution,
|
|
43
43
|
isValidResolutionVerb
|
|
@@ -61,12 +61,12 @@ import {
|
|
|
61
61
|
authorizationProbeNamespaces,
|
|
62
62
|
authorizationProbeRequiresPrincipalNamespace,
|
|
63
63
|
probeOperationAuthorization
|
|
64
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-PZKWPXRF.js";
|
|
65
65
|
import {
|
|
66
66
|
CorrectionContractError,
|
|
67
67
|
getOperation,
|
|
68
68
|
resolveQueryNamespaceWritablePreflight
|
|
69
|
-
} from "./chunk-
|
|
69
|
+
} from "./chunk-WKJTMXME.js";
|
|
70
70
|
import {
|
|
71
71
|
isTrustZoneName
|
|
72
72
|
} from "./chunk-5QZR2RA3.js";
|
|
@@ -80,7 +80,7 @@ import {
|
|
|
80
80
|
OFFLINE_SYNC_APPLY_MAX_BODY_BYTES,
|
|
81
81
|
OFFLINE_SYNC_FILE_CONTENT_MAX_CHUNK_BYTES,
|
|
82
82
|
OFFLINE_SYNC_SNAPSHOT_BASE_MAX_BODY_BYTES
|
|
83
|
-
} from "./chunk-
|
|
83
|
+
} from "./chunk-2L7DKNVE.js";
|
|
84
84
|
import {
|
|
85
85
|
assertOperationAllowed,
|
|
86
86
|
capabilityAllowsOp,
|
|
@@ -3394,4 +3394,4 @@ export {
|
|
|
3394
3394
|
resolveDefaultAdminConsolePublicDir,
|
|
3395
3395
|
EngramAccessHttpServer
|
|
3396
3396
|
};
|
|
3397
|
-
//# sourceMappingURL=chunk-
|
|
3397
|
+
//# sourceMappingURL=chunk-SYJW273H.js.map
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
|
+
compareReconcilePlanEntries,
|
|
3
|
+
semanticAgreementKey,
|
|
2
4
|
summarizeReconcilePlan
|
|
3
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-ZRUEP4IK.js";
|
|
4
6
|
import {
|
|
5
7
|
DEFAULT_CITATION_FORMAT,
|
|
6
8
|
stripCitationForTemplate
|
|
@@ -134,13 +136,6 @@ function contentHashRows(files, contentHash) {
|
|
|
134
136
|
}
|
|
135
137
|
return rows;
|
|
136
138
|
}
|
|
137
|
-
function comparePlanEntries(left, right) {
|
|
138
|
-
if (left.namespace !== right.namespace) return left.namespace < right.namespace ? -1 : 1;
|
|
139
|
-
return left.path < right.path ? -1 : left.path > right.path ? 1 : 0;
|
|
140
|
-
}
|
|
141
|
-
function semanticAgreementKey(agreement) {
|
|
142
|
-
return `${agreement.local.path}\0${agreement.peer.path}`;
|
|
143
|
-
}
|
|
144
139
|
function classifySemanticChange(current, prior) {
|
|
145
140
|
if (!prior) return "unchanged";
|
|
146
141
|
const localChanged = current.local.sha256 !== prior.local.sha256;
|
|
@@ -278,12 +273,12 @@ function collapseActiveFactDuplicates(plan, localManifests, peerManifests, prior
|
|
|
278
273
|
if (removed.size > 0 || replacements.length > 0) {
|
|
279
274
|
entriesByNamespace.set(
|
|
280
275
|
namespace,
|
|
281
|
-
[...entries2.filter((entry) => !removed.has(entry)), ...replacements].sort(
|
|
276
|
+
[...entries2.filter((entry) => !removed.has(entry)), ...replacements].sort(compareReconcilePlanEntries)
|
|
282
277
|
);
|
|
283
278
|
}
|
|
284
279
|
}
|
|
285
280
|
if (!changed) return plan;
|
|
286
|
-
const entries = [...entriesByNamespace.values()].flat().sort(
|
|
281
|
+
const entries = [...entriesByNamespace.values()].flat().sort(compareReconcilePlanEntries);
|
|
287
282
|
return {
|
|
288
283
|
entries,
|
|
289
284
|
byNamespace: summarizeReconcilePlan(entries),
|
|
@@ -298,4 +293,4 @@ export {
|
|
|
298
293
|
buildReconcileManifest,
|
|
299
294
|
collapseActiveFactDuplicates
|
|
300
295
|
};
|
|
301
|
-
//# sourceMappingURL=chunk-
|
|
296
|
+
//# sourceMappingURL=chunk-T42L3S6A.js.map
|