@remnic/core 1.1.8 → 1.1.10
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-cli.js +44 -41
- package/dist/access-cli.js.map +1 -1
- package/dist/access-http.d.ts +8 -7
- package/dist/access-http.js +20 -17
- package/dist/access-mcp.d.ts +8 -7
- package/dist/access-mcp.js +19 -16
- package/dist/{access-service-C0Rkioec.d.ts → access-service-BTTNyo1i.d.ts} +11 -9
- package/dist/access-service.d.ts +8 -7
- package/dist/access-service.js +18 -15
- package/dist/active-memory-bridge.d.ts +2 -1
- package/dist/active-recall.d.ts +3 -2
- package/dist/active-recall.js +2 -2
- package/dist/active-recall.js.map +1 -1
- package/dist/behavior-learner.d.ts +2 -1
- package/dist/behavior-signals.d.ts +2 -1
- package/dist/bootstrap.d.ts +7 -6
- package/dist/briefing.d.ts +3 -2
- package/dist/briefing.js +6 -6
- package/dist/buffer-surprise-report.d.ts +2 -1
- package/dist/buffer.d.ts +3 -2
- package/dist/calibration.d.ts +4 -1
- package/dist/calibration.js +10 -5
- package/dist/calibration.js.map +1 -1
- package/dist/causal-behavior.d.ts +2 -1
- package/dist/causal-consolidation.d.ts +5 -2
- package/dist/causal-consolidation.js +17 -11
- package/dist/causal-consolidation.js.map +1 -1
- package/dist/{chunk-AV2WSYZY.js → chunk-2YMTO4ZJ.js} +2 -2
- package/dist/{chunk-SYWJJTNL.js → chunk-363MWCD3.js} +42 -42
- package/dist/{chunk-65ZPH7QA.js → chunk-36CTNQY7.js} +7 -7
- package/dist/{chunk-GZCUW5IC.js → chunk-3IQ2TR4N.js} +5 -5
- package/dist/chunk-3IQ2TR4N.js.map +1 -0
- package/dist/{chunk-TUFG6VXY.js → chunk-4DWOBS2A.js} +2 -2
- package/dist/chunk-4DWOBS2A.js.map +1 -0
- package/dist/{chunk-SRIDOT64.js → chunk-4DXC6HQQ.js} +6 -4
- package/dist/chunk-4DXC6HQQ.js.map +1 -0
- package/dist/{chunk-L2IO2QPY.js → chunk-4IS4SXIQ.js} +17 -13
- package/dist/chunk-4IS4SXIQ.js.map +1 -0
- package/dist/{chunk-RJSVRPNU.js → chunk-57QNCUEZ.js} +19 -12
- package/dist/chunk-57QNCUEZ.js.map +1 -0
- package/dist/{chunk-GRDDGNYQ.js → chunk-5GCNE7CN.js} +105 -499
- package/dist/chunk-5GCNE7CN.js.map +1 -0
- package/dist/{chunk-LOBRX7VD.js → chunk-5UM2VJ6D.js} +12 -1
- package/dist/chunk-5UM2VJ6D.js.map +1 -0
- package/dist/{chunk-XVOIMCVW.js → chunk-6XA7UN4Z.js} +2 -2
- package/dist/{chunk-QJZ77K7F.js → chunk-6Z6UH6TK.js} +26 -12
- package/dist/chunk-6Z6UH6TK.js.map +1 -0
- package/dist/{chunk-ODWDQNRE.js → chunk-7SI52C65.js} +7 -3
- package/dist/chunk-7SI52C65.js.map +1 -0
- package/dist/{chunk-FIXIX6DE.js → chunk-C5HUWVH2.js} +33 -43
- package/dist/chunk-C5HUWVH2.js.map +1 -0
- package/dist/{chunk-NN3TS5BM.js → chunk-D54LZC5L.js} +4 -4
- package/dist/{chunk-KNQ5YJTO.js → chunk-ERUDW6DU.js} +209 -1
- package/dist/chunk-ERUDW6DU.js.map +1 -0
- package/dist/{chunk-E27HOXMX.js → chunk-EYNQTST2.js} +2 -2
- package/dist/chunk-FVQJYWH7.js +52 -0
- package/dist/chunk-FVQJYWH7.js.map +1 -0
- package/dist/{chunk-3FPTCC3Z.js → chunk-GVPWB7EY.js} +2 -2
- package/dist/chunk-HJYHRE4S.js +647 -0
- package/dist/chunk-HJYHRE4S.js.map +1 -0
- package/dist/{chunk-SWRJFKYW.js → chunk-I6BQZSML.js} +5 -5
- package/dist/chunk-IBX3VFOM.js +446 -0
- package/dist/chunk-IBX3VFOM.js.map +1 -0
- package/dist/{chunk-STB3GUYU.js → chunk-KBYWQWSB.js} +8 -8
- package/dist/chunk-KWBPHZUU.js +83 -0
- package/dist/chunk-KWBPHZUU.js.map +1 -0
- package/dist/{chunk-MYH2IBSP.js → chunk-LIO5X3CM.js} +3 -3
- package/dist/{chunk-XGX4TUF6.js → chunk-MCC6KDQF.js} +5 -5
- package/dist/{chunk-4KAN3GZ3.js → chunk-NN2DKE4T.js} +1 -1
- package/dist/chunk-NN2DKE4T.js.map +1 -0
- package/dist/{chunk-R2XRID2N.js → chunk-NN3LPQ5D.js} +5 -5
- package/dist/chunk-NN3LPQ5D.js.map +1 -0
- package/dist/{chunk-WXPPM426.js → chunk-O4XJUPSF.js} +2 -2
- package/dist/{chunk-WSZIHQBK.js → chunk-P77UEOU2.js} +4 -1
- package/dist/{chunk-WSZIHQBK.js.map → chunk-P77UEOU2.js.map} +1 -1
- package/dist/{chunk-RLV2F337.js → chunk-PB5KW5PL.js} +2 -2
- package/dist/{chunk-S5SQDIF5.js → chunk-PHNGXFQ6.js} +7 -5
- package/dist/chunk-PHNGXFQ6.js.map +1 -0
- package/dist/{chunk-FEMOX5AD.js → chunk-QR3C7BKQ.js} +7 -7
- package/dist/chunk-QR3C7BKQ.js.map +1 -0
- package/dist/{chunk-ETA2JXP5.js → chunk-RXTFCYQF.js} +2 -2
- package/dist/{chunk-Q7FJ5ZHM.js → chunk-S3IP6R6K.js} +8 -2
- package/dist/{chunk-Q7FJ5ZHM.js.map → chunk-S3IP6R6K.js.map} +1 -1
- package/dist/{chunk-3LCWFNVS.js → chunk-SKE7JYKA.js} +2 -2
- package/dist/{chunk-T65SHTJP.js → chunk-VQXK37XA.js} +1 -1
- package/dist/chunk-VQXK37XA.js.map +1 -0
- package/dist/{chunk-DWMXVUGO.js → chunk-VX2IUQFE.js} +98 -10
- package/dist/chunk-VX2IUQFE.js.map +1 -0
- package/dist/{chunk-KHJRMWO4.js → chunk-WGK4VHGP.js} +84 -22
- package/dist/chunk-WGK4VHGP.js.map +1 -0
- package/dist/{chunk-4IT6WL23.js → chunk-WTFWLUSX.js} +2 -2
- package/dist/{chunk-67YLUWLG.js → chunk-XJKFSSDW.js} +3 -3
- package/dist/chunk-XJKFSSDW.js.map +1 -0
- package/dist/{chunk-ASIQZXYO.js → chunk-XMVFHBHT.js} +2 -2
- package/dist/{chunk-Q5TJRAGE.js → chunk-Y5KDIOKF.js} +3 -3
- package/dist/{chunk-FCGWNWG4.js → chunk-Z5S5HNGY.js} +31 -29
- package/dist/chunk-Z5S5HNGY.js.map +1 -0
- package/dist/{chunk-OJMD2LIW.js → chunk-ZL4S7ARC.js} +3 -3
- package/dist/{cli-CIATRu8o.d.ts → cli-BrEwQTnW.d.ts} +4 -4
- package/dist/cli.d.ts +9 -8
- package/dist/cli.js +33 -31
- package/dist/codex-cli-fallback.d.ts +44 -0
- package/dist/codex-cli-fallback.js +12 -0
- package/dist/{codex-materialize-xVqbEmcm.d.ts → codex-materialize-CQlLTzke.d.ts} +1 -1
- package/dist/compression-optimizer.d.ts +2 -1
- package/dist/config.d.ts +2 -1
- package/dist/config.js +1 -1
- package/dist/consolidation-provenance-check.d.ts +3 -2
- package/dist/consolidation-undo.d.ts +3 -2
- package/dist/day-summary.d.ts +2 -1
- package/dist/day-summary.js +1 -1
- package/dist/delinearize.d.ts +2 -1
- package/dist/direct-answer-wiring.d.ts +2 -1
- package/dist/direct-answer.d.ts +2 -1
- package/dist/embedding-fallback.d.ts +2 -1
- package/dist/{engine-MEAYUA7A.js → engine-FOC3IJLA.js} +7 -7
- package/dist/entity-retrieval.d.ts +3 -2
- package/dist/entity-retrieval.js +6 -6
- package/dist/entity-schema.d.ts +2 -1
- package/dist/explicit-capture.d.ts +7 -6
- package/dist/explicit-capture.js +2 -2
- package/dist/explicit-cue-recall.js +1 -1
- package/dist/extraction-judge-telemetry.d.ts +2 -1
- package/dist/extraction-judge-training.d.ts +2 -1
- package/dist/extraction-judge.d.ts +2 -1
- package/dist/extraction.d.ts +2 -1
- package/dist/extraction.js +10 -8
- package/dist/fallback-llm.d.ts +8 -1
- package/dist/fallback-llm.js +5 -3
- package/dist/identity-continuity.d.ts +2 -1
- package/dist/importance.d.ts +2 -1
- package/dist/index-1qIcnbG1.d.ts +34 -0
- package/dist/index.d.ts +15 -13
- package/dist/index.js +175 -168
- package/dist/index.js.map +1 -1
- package/dist/intent.d.ts +2 -1
- package/dist/lifecycle.d.ts +2 -1
- package/dist/live-connectors-runner.d.ts +2 -1
- package/dist/live-connectors-runner.js +2 -2
- package/dist/local-llm.d.ts +2 -1
- package/dist/local-llm.js +1 -1
- package/dist/memory-action-policy.d.ts +2 -1
- package/dist/memory-cache.d.ts +2 -1
- package/dist/{memory-governance-G3XODEXW.js → memory-governance-F3QOJGEY.js} +7 -7
- package/dist/memory-lifecycle-ledger-utils.d.ts +2 -1
- package/dist/{memory-projection-store-lCzmu4JX.d.ts → memory-projection-store-CY8TU40w.d.ts} +1 -1
- package/dist/memory-projection-store.d.ts +3 -2
- package/dist/memory-projection-store.js +1 -1
- package/dist/memory-worth-outcomes.d.ts +3 -2
- package/dist/{migrate-from-identity-anchor-TTEDEJGX.js → migrate-from-identity-anchor-G27MCD6A.js} +2 -2
- package/dist/model-registry.js +1 -1
- package/dist/models-json.d.ts +2 -1
- package/dist/models-json.js +1 -1
- package/dist/native-knowledge.d.ts +2 -1
- package/dist/objective-state-writers.d.ts +23 -1
- package/dist/objective-state-writers.js +10 -306
- package/dist/objective-state-writers.js.map +1 -1
- package/dist/objective-state.d.ts +7 -1
- package/dist/objective-state.js +3 -1
- package/dist/operator-toolkit.d.ts +3 -2
- package/dist/operator-toolkit.js +11 -11
- package/dist/opik-exporter.js +2 -2
- package/dist/opik-exporter.js.map +1 -1
- package/dist/{orchestrator-CvUYwuaL.d.ts → orchestrator-6IvQ-Phj.d.ts} +6 -5
- package/dist/orchestrator.d.ts +7 -6
- package/dist/orchestrator.js +37 -35
- package/dist/patterns-cli.d.ts +2 -1
- package/dist/{peers-6OSQ3NK6.js → peers-HCVGHMAE.js} +3 -3
- package/dist/peers-HCVGHMAE.js.map +1 -0
- package/dist/policy-runtime.d.ts +2 -1
- package/dist/{port-BkWL7hqo.d.ts → port-B6VEDIkC.d.ts} +7 -1
- package/dist/qmd-recall-cache.d.ts +3 -2
- package/dist/qmd.d.ts +4 -2
- package/dist/qmd.js +1 -1
- package/dist/recall-disclosure-escalation.d.ts +2 -1
- package/dist/recall-explain-renderer.d.ts +2 -1
- package/dist/recall-explain-renderer.js +3 -3
- package/dist/recall-state.d.ts +2 -1
- package/dist/recall-tag-filter.d.ts +2 -1
- package/dist/recall-xray-cli.d.ts +2 -1
- package/dist/recall-xray-cli.js +4 -4
- package/dist/recall-xray-renderer.d.ts +2 -1
- package/dist/recall-xray-renderer.js +3 -3
- package/dist/recall-xray.d.ts +2 -1
- package/dist/recall-xray.js +2 -2
- package/dist/resolve-auth-token.d.ts +2 -1
- package/dist/resolve-provider-secret.d.ts +2 -1
- package/dist/resolve-provider-secret.js +3 -1
- package/dist/resume-bundles.js +4 -4
- package/dist/retrieval-agents.d.ts +3 -2
- package/dist/retrieval-tiers.d.ts +2 -1
- package/dist/sanitize.js +1 -1
- package/dist/schemas.d.ts +22 -22
- package/dist/{semantic-consolidation-CGiH52qa.d.ts → semantic-consolidation-ByBXb-sf.d.ts} +2 -2
- package/dist/semantic-consolidation.d.ts +4 -3
- package/dist/semantic-consolidation.js +6 -6
- package/dist/semantic-rule-promotion.js +6 -6
- package/dist/semantic-rule-verifier.d.ts +2 -1
- package/dist/semantic-rule-verifier.js +6 -6
- package/dist/session-observer-bands.d.ts +2 -1
- package/dist/session-observer-state.d.ts +2 -1
- package/dist/signal.d.ts +2 -1
- package/dist/source-attribution.d.ts +1 -1
- package/dist/source-attribution.js +1 -1
- package/dist/storage.d.ts +3 -2
- package/dist/storage.js +5 -5
- package/dist/summarizer.d.ts +2 -1
- package/dist/summarizer.js +8 -6
- package/dist/summary-snapshot.d.ts +2 -1
- package/dist/temporal-supersession.d.ts +3 -2
- package/dist/temporal-validity.d.ts +2 -1
- package/dist/threading.d.ts +2 -1
- package/dist/tier-migration.d.ts +4 -3
- package/dist/tier-routing.d.ts +2 -1
- package/dist/topics.d.ts +2 -1
- package/dist/transcript.d.ts +2 -1
- package/dist/types.d.ts +2693 -1
- package/dist/types.js +1 -1
- package/dist/utility-runtime.d.ts +2 -1
- package/dist/verified-recall.js +6 -6
- package/package.json +1 -1
- package/dist/chunk-4KAN3GZ3.js.map +0 -1
- package/dist/chunk-67YLUWLG.js.map +0 -1
- package/dist/chunk-DWMXVUGO.js.map +0 -1
- package/dist/chunk-FCGWNWG4.js.map +0 -1
- package/dist/chunk-FEMOX5AD.js.map +0 -1
- package/dist/chunk-FIXIX6DE.js.map +0 -1
- package/dist/chunk-GRDDGNYQ.js.map +0 -1
- package/dist/chunk-GZCUW5IC.js.map +0 -1
- package/dist/chunk-KHJRMWO4.js.map +0 -1
- package/dist/chunk-KNQ5YJTO.js.map +0 -1
- package/dist/chunk-L2IO2QPY.js.map +0 -1
- package/dist/chunk-LOBRX7VD.js.map +0 -1
- package/dist/chunk-M62O4P4T.js +0 -41
- package/dist/chunk-M62O4P4T.js.map +0 -1
- package/dist/chunk-ODWDQNRE.js.map +0 -1
- package/dist/chunk-QJZ77K7F.js.map +0 -1
- package/dist/chunk-R2XRID2N.js.map +0 -1
- package/dist/chunk-RJSVRPNU.js.map +0 -1
- package/dist/chunk-S5SQDIF5.js.map +0 -1
- package/dist/chunk-SRIDOT64.js.map +0 -1
- package/dist/chunk-T65SHTJP.js.map +0 -1
- package/dist/chunk-TUFG6VXY.js.map +0 -1
- package/dist/types-H85grL1f.d.ts +0 -2714
- /package/dist/{chunk-AV2WSYZY.js.map → chunk-2YMTO4ZJ.js.map} +0 -0
- /package/dist/{chunk-SYWJJTNL.js.map → chunk-363MWCD3.js.map} +0 -0
- /package/dist/{chunk-65ZPH7QA.js.map → chunk-36CTNQY7.js.map} +0 -0
- /package/dist/{chunk-XVOIMCVW.js.map → chunk-6XA7UN4Z.js.map} +0 -0
- /package/dist/{chunk-NN3TS5BM.js.map → chunk-D54LZC5L.js.map} +0 -0
- /package/dist/{chunk-E27HOXMX.js.map → chunk-EYNQTST2.js.map} +0 -0
- /package/dist/{chunk-3FPTCC3Z.js.map → chunk-GVPWB7EY.js.map} +0 -0
- /package/dist/{chunk-SWRJFKYW.js.map → chunk-I6BQZSML.js.map} +0 -0
- /package/dist/{chunk-STB3GUYU.js.map → chunk-KBYWQWSB.js.map} +0 -0
- /package/dist/{chunk-MYH2IBSP.js.map → chunk-LIO5X3CM.js.map} +0 -0
- /package/dist/{chunk-XGX4TUF6.js.map → chunk-MCC6KDQF.js.map} +0 -0
- /package/dist/{chunk-WXPPM426.js.map → chunk-O4XJUPSF.js.map} +0 -0
- /package/dist/{chunk-RLV2F337.js.map → chunk-PB5KW5PL.js.map} +0 -0
- /package/dist/{chunk-ETA2JXP5.js.map → chunk-RXTFCYQF.js.map} +0 -0
- /package/dist/{chunk-3LCWFNVS.js.map → chunk-SKE7JYKA.js.map} +0 -0
- /package/dist/{chunk-4IT6WL23.js.map → chunk-WTFWLUSX.js.map} +0 -0
- /package/dist/{chunk-ASIQZXYO.js.map → chunk-XMVFHBHT.js.map} +0 -0
- /package/dist/{chunk-Q5TJRAGE.js.map → chunk-Y5KDIOKF.js.map} +0 -0
- /package/dist/{chunk-OJMD2LIW.js.map → chunk-ZL4S7ARC.js.map} +0 -0
- /package/dist/{engine-MEAYUA7A.js.map → codex-cli-fallback.js.map} +0 -0
- /package/dist/{memory-governance-G3XODEXW.js.map → engine-FOC3IJLA.js.map} +0 -0
- /package/dist/{migrate-from-identity-anchor-TTEDEJGX.js.map → memory-governance-F3QOJGEY.js.map} +0 -0
- /package/dist/{peers-6OSQ3NK6.js.map → migrate-from-identity-anchor-G27MCD6A.js.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./chunk-
|
|
1
|
+
import "./chunk-SKE7JYKA.js";
|
|
2
2
|
import {
|
|
3
3
|
PEERS_DIR_NAME,
|
|
4
4
|
PEER_ID_MAX_LENGTH,
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
readPeerProfile,
|
|
12
12
|
writePeer,
|
|
13
13
|
writePeerProfile
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-4DWOBS2A.js";
|
|
15
15
|
import {
|
|
16
16
|
buildTokenEntry,
|
|
17
17
|
commitTokenEntry,
|
|
@@ -53,19 +53,19 @@ import {
|
|
|
53
53
|
runBulkImportCliCommand,
|
|
54
54
|
runBulkImportPipeline,
|
|
55
55
|
validateImportTurn
|
|
56
|
-
} from "./chunk-
|
|
57
|
-
import "./chunk-
|
|
56
|
+
} from "./chunk-363MWCD3.js";
|
|
57
|
+
import "./chunk-6XA7UN4Z.js";
|
|
58
|
+
import "./chunk-KBYWQWSB.js";
|
|
58
59
|
import {
|
|
59
60
|
clearAuthTokenSecretCache,
|
|
60
61
|
isAgentAccessSecretRef,
|
|
61
62
|
resolveAgentAccessAuthToken
|
|
62
63
|
} from "./chunk-MXC3AP5I.js";
|
|
63
|
-
import "./chunk-STB3GUYU.js";
|
|
64
64
|
import {
|
|
65
65
|
parseXrayBudgetFlag,
|
|
66
66
|
parseXrayCliOptions
|
|
67
|
-
} from "./chunk-
|
|
68
|
-
import "./chunk-
|
|
67
|
+
} from "./chunk-ZL4S7ARC.js";
|
|
68
|
+
import "./chunk-I6BQZSML.js";
|
|
69
69
|
import {
|
|
70
70
|
parseStrictCliDate
|
|
71
71
|
} from "./chunk-AJA46VX5.js";
|
|
@@ -100,16 +100,9 @@ import {
|
|
|
100
100
|
generateResolverDocument,
|
|
101
101
|
getTaxonomyDir,
|
|
102
102
|
getTaxonomyFilePath,
|
|
103
|
-
isLcmMessagePartKind,
|
|
104
103
|
loadTaxonomy,
|
|
105
104
|
migrateFromEngram,
|
|
106
|
-
normalizeExplicitParts,
|
|
107
105
|
openLcmDatabase,
|
|
108
|
-
parseAnthropicMessageParts,
|
|
109
|
-
parseMessageParts,
|
|
110
|
-
parseOpenAiMessageParts,
|
|
111
|
-
parseOpenClawMessageParts,
|
|
112
|
-
partsFromRenderedText,
|
|
113
106
|
projectNamespaceName,
|
|
114
107
|
resolveCodingNamespaceOverlay,
|
|
115
108
|
rollbackFromEngramMigration,
|
|
@@ -117,10 +110,11 @@ import {
|
|
|
117
110
|
saveTaxonomy,
|
|
118
111
|
validateSlug,
|
|
119
112
|
validateTaxonomy
|
|
120
|
-
} from "./chunk-
|
|
121
|
-
import "./chunk-
|
|
113
|
+
} from "./chunk-5GCNE7CN.js";
|
|
114
|
+
import "./chunk-4DXC6HQQ.js";
|
|
122
115
|
import "./chunk-CK5NTM2S.js";
|
|
123
116
|
import "./chunk-FSFEQI74.js";
|
|
117
|
+
import "./chunk-MDYG7VI7.js";
|
|
124
118
|
import "./chunk-Z5AAYHUC.js";
|
|
125
119
|
import {
|
|
126
120
|
computeTierValueScore,
|
|
@@ -128,10 +122,9 @@ import {
|
|
|
128
122
|
} from "./chunk-S75M5ZRK.js";
|
|
129
123
|
import "./chunk-TPB3I2AC.js";
|
|
130
124
|
import "./chunk-UHGBNIOS.js";
|
|
131
|
-
import "./chunk-
|
|
125
|
+
import "./chunk-PHNGXFQ6.js";
|
|
132
126
|
import "./chunk-ETOW6ACV.js";
|
|
133
127
|
import "./chunk-ZTSE2ZJ6.js";
|
|
134
|
-
import "./chunk-MDYG7VI7.js";
|
|
135
128
|
import "./chunk-JR4ZC3G4.js";
|
|
136
129
|
import "./chunk-K4FLSOR5.js";
|
|
137
130
|
import "./chunk-V3RXWQIE.js";
|
|
@@ -169,8 +162,15 @@ import {
|
|
|
169
162
|
builtInLiveConnectorDefinitions,
|
|
170
163
|
hasEnabledLiveConnector,
|
|
171
164
|
runLiveConnectorsOnce
|
|
172
|
-
} from "./chunk-
|
|
165
|
+
} from "./chunk-XMVFHBHT.js";
|
|
173
166
|
import "./chunk-YAZNBMNF.js";
|
|
167
|
+
import {
|
|
168
|
+
ExtractionEngine
|
|
169
|
+
} from "./chunk-Z5S5HNGY.js";
|
|
170
|
+
import "./chunk-WW3QQF4H.js";
|
|
171
|
+
import "./chunk-54V4BZWP.js";
|
|
172
|
+
import "./chunk-QR3C7BKQ.js";
|
|
173
|
+
import "./chunk-NN3LPQ5D.js";
|
|
174
174
|
import {
|
|
175
175
|
buildExplicitCueRecallSection,
|
|
176
176
|
collectBenchmarkAnchorCues,
|
|
@@ -179,7 +179,7 @@ import {
|
|
|
179
179
|
collectQuestionSlotCues,
|
|
180
180
|
collectStructuredPlanCues,
|
|
181
181
|
collectTemporalLexicalCues
|
|
182
|
-
} from "./chunk-
|
|
182
|
+
} from "./chunk-ERUDW6DU.js";
|
|
183
183
|
import {
|
|
184
184
|
buildEvidencePack
|
|
185
185
|
} from "./chunk-74WWN7ZW.js";
|
|
@@ -194,17 +194,10 @@ import {
|
|
|
194
194
|
normalizeCachedVerdict,
|
|
195
195
|
verdictCacheSize
|
|
196
196
|
} from "./chunk-C4SQJZAF.js";
|
|
197
|
-
import {
|
|
198
|
-
ExtractionEngine
|
|
199
|
-
} from "./chunk-FCGWNWG4.js";
|
|
200
|
-
import "./chunk-WW3QQF4H.js";
|
|
201
|
-
import "./chunk-54V4BZWP.js";
|
|
202
|
-
import "./chunk-FEMOX5AD.js";
|
|
203
|
-
import "./chunk-R2XRID2N.js";
|
|
204
197
|
import {
|
|
205
198
|
buildExtensionsFooterForSummary,
|
|
206
199
|
loadDaySummaryPrompt
|
|
207
|
-
} from "./chunk-
|
|
200
|
+
} from "./chunk-3IQ2TR4N.js";
|
|
208
201
|
import "./chunk-VEWZZM3H.js";
|
|
209
202
|
import {
|
|
210
203
|
resolveCategory
|
|
@@ -216,32 +209,31 @@ import {
|
|
|
216
209
|
import "./chunk-Z2E7VW55.js";
|
|
217
210
|
import {
|
|
218
211
|
buildEntityRecallSection
|
|
219
|
-
} from "./chunk-
|
|
212
|
+
} from "./chunk-LIO5X3CM.js";
|
|
220
213
|
import "./chunk-2NMMFZ5T.js";
|
|
221
214
|
import "./chunk-SRBJUAMP.js";
|
|
222
215
|
import "./chunk-PYXS46O7.js";
|
|
223
216
|
import "./chunk-3QKK7QOS.js";
|
|
224
|
-
import "./chunk-
|
|
217
|
+
import "./chunk-RXTFCYQF.js";
|
|
225
218
|
import "./chunk-JRNQ3RNA.js";
|
|
226
|
-
import "./chunk-
|
|
219
|
+
import "./chunk-PB5KW5PL.js";
|
|
227
220
|
import "./chunk-CULXMQJH.js";
|
|
228
221
|
import "./chunk-E6K4NIEU.js";
|
|
229
222
|
import {
|
|
230
223
|
LanceDbBackend,
|
|
231
224
|
MeilisearchBackend,
|
|
232
225
|
OramaBackend
|
|
233
|
-
} from "./chunk-
|
|
226
|
+
} from "./chunk-57QNCUEZ.js";
|
|
234
227
|
import "./chunk-YRMVARQP.js";
|
|
235
228
|
import {
|
|
236
229
|
QmdClient
|
|
237
|
-
} from "./chunk-
|
|
230
|
+
} from "./chunk-P77UEOU2.js";
|
|
238
231
|
import {
|
|
239
232
|
LEGACY_PLUGIN_ID,
|
|
240
233
|
PLUGIN_ID,
|
|
241
234
|
resolveRemnicPluginEntry
|
|
242
235
|
} from "./chunk-U66YHYC7.js";
|
|
243
236
|
import "./chunk-EABGC2TL.js";
|
|
244
|
-
import "./chunk-LOBRX7VD.js";
|
|
245
237
|
import {
|
|
246
238
|
DEFAULT_POLL_INTERVAL_MS,
|
|
247
239
|
GOOGLE_DRIVE_CONNECTOR_ID,
|
|
@@ -256,7 +248,7 @@ import {
|
|
|
256
248
|
defaultGoogleDriveClientFactory,
|
|
257
249
|
validateGoogleDriveConfig,
|
|
258
250
|
validateNotionConfig
|
|
259
|
-
} from "./chunk-
|
|
251
|
+
} from "./chunk-4IS4SXIQ.js";
|
|
260
252
|
import {
|
|
261
253
|
CONNECTOR_ID_PATTERN,
|
|
262
254
|
isValidConnectorId,
|
|
@@ -268,11 +260,13 @@ import "./chunk-HMDCOMYU.js";
|
|
|
268
260
|
import "./chunk-JXS5PDQ7.js";
|
|
269
261
|
import "./chunk-K6WK37A6.js";
|
|
270
262
|
import "./chunk-AJU4PJGY.js";
|
|
263
|
+
import "./chunk-C6QPK5GG.js";
|
|
271
264
|
import "./chunk-7SEAZFFB.js";
|
|
265
|
+
import "./chunk-FYIYMQ5N.js";
|
|
272
266
|
import {
|
|
273
267
|
coerceInstallExtension,
|
|
274
268
|
parseConfig
|
|
275
|
-
} from "./chunk-
|
|
269
|
+
} from "./chunk-6Z6UH6TK.js";
|
|
276
270
|
import "./chunk-Z5LAYHGJ.js";
|
|
277
271
|
import {
|
|
278
272
|
CONNECTORS_OUTPUT_FORMATS,
|
|
@@ -284,11 +278,9 @@ import {
|
|
|
284
278
|
renderConnectorsRunResult,
|
|
285
279
|
runConnectorPollOnce
|
|
286
280
|
} from "./chunk-OZHRDTDX.js";
|
|
287
|
-
import "./chunk-C6QPK5GG.js";
|
|
288
281
|
import {
|
|
289
282
|
CODEX_THREAD_KEY_PREFIX
|
|
290
283
|
} from "./chunk-3PG3H5TD.js";
|
|
291
|
-
import "./chunk-FYIYMQ5N.js";
|
|
292
284
|
import "./chunk-KVE7R4CG.js";
|
|
293
285
|
import "./chunk-4WMCPJWX.js";
|
|
294
286
|
import {
|
|
@@ -303,7 +295,7 @@ import {
|
|
|
303
295
|
materializeForNamespace,
|
|
304
296
|
runCodexMaterialize,
|
|
305
297
|
runPostConsolidationMaterialize
|
|
306
|
-
} from "./chunk-
|
|
298
|
+
} from "./chunk-C5HUWVH2.js";
|
|
307
299
|
import {
|
|
308
300
|
REMNIC_EXTENSIONS_TOTAL_TOKEN_LIMIT,
|
|
309
301
|
discoverMemoryExtensions,
|
|
@@ -313,11 +305,14 @@ import {
|
|
|
313
305
|
} from "./chunk-EJI5XIBB.js";
|
|
314
306
|
import {
|
|
315
307
|
FallbackLlmClient
|
|
316
|
-
} from "./chunk-
|
|
317
|
-
import "./chunk-
|
|
318
|
-
import "./chunk-ODWDQNRE.js";
|
|
308
|
+
} from "./chunk-VX2IUQFE.js";
|
|
309
|
+
import "./chunk-S3IP6R6K.js";
|
|
319
310
|
import "./chunk-L2EXJQJP.js";
|
|
311
|
+
import "./chunk-7SI52C65.js";
|
|
320
312
|
import "./chunk-UZB5KHKX.js";
|
|
313
|
+
import {
|
|
314
|
+
setCodexCliFallbackRunnerForProcess
|
|
315
|
+
} from "./chunk-KWBPHZUU.js";
|
|
321
316
|
import "./chunk-6HZ6AO2P.js";
|
|
322
317
|
import "./chunk-JWPLJLDU.js";
|
|
323
318
|
import {
|
|
@@ -329,10 +324,10 @@ import "./chunk-PVGDJXVK.js";
|
|
|
329
324
|
import "./chunk-NGAVDO7E.js";
|
|
330
325
|
import {
|
|
331
326
|
EngramAccessHttpServer
|
|
332
|
-
} from "./chunk-
|
|
327
|
+
} from "./chunk-36CTNQY7.js";
|
|
333
328
|
import {
|
|
334
329
|
EngramMcpServer
|
|
335
|
-
} from "./chunk-
|
|
330
|
+
} from "./chunk-Y5KDIOKF.js";
|
|
336
331
|
import {
|
|
337
332
|
buildCitationGuidance,
|
|
338
333
|
formatOaiMemCitation,
|
|
@@ -344,12 +339,11 @@ import {
|
|
|
344
339
|
EngramAccessService,
|
|
345
340
|
computeProcedureStats,
|
|
346
341
|
formatProcedureStatsText
|
|
347
|
-
} from "./chunk-
|
|
342
|
+
} from "./chunk-WGK4VHGP.js";
|
|
348
343
|
import {
|
|
349
344
|
importCapsule
|
|
350
345
|
} from "./chunk-QIGOEM65.js";
|
|
351
346
|
import "./chunk-BT7NVCML.js";
|
|
352
|
-
import "./chunk-H7XKCNR6.js";
|
|
353
347
|
import {
|
|
354
348
|
RECALL_XRAY_FORMATS,
|
|
355
349
|
parseXrayFormat,
|
|
@@ -357,33 +351,42 @@ import {
|
|
|
357
351
|
renderXrayJson,
|
|
358
352
|
renderXrayMarkdown,
|
|
359
353
|
renderXrayText
|
|
360
|
-
} from "./chunk-
|
|
354
|
+
} from "./chunk-O4XJUPSF.js";
|
|
361
355
|
import "./chunk-SOBJ6NEY.js";
|
|
362
|
-
import "./chunk-
|
|
356
|
+
import "./chunk-H7XKCNR6.js";
|
|
357
|
+
import "./chunk-EYNQTST2.js";
|
|
363
358
|
import {
|
|
364
359
|
normalizeOriginUrl,
|
|
365
360
|
resolveGitContext,
|
|
366
361
|
stableHash
|
|
367
|
-
} from "./chunk-
|
|
362
|
+
} from "./chunk-D54LZC5L.js";
|
|
368
363
|
import {
|
|
369
364
|
isTrustZoneName
|
|
370
365
|
} from "./chunk-EQINRHYR.js";
|
|
371
|
-
import "./chunk-
|
|
366
|
+
import "./chunk-2YMTO4ZJ.js";
|
|
372
367
|
import {
|
|
373
368
|
memoryWorthOutcomeEligibleCategories,
|
|
374
369
|
recordMemoryOutcome
|
|
375
370
|
} from "./chunk-EIR5VLIH.js";
|
|
371
|
+
import "./chunk-HJYHRE4S.js";
|
|
376
372
|
import {
|
|
377
|
-
|
|
378
|
-
|
|
373
|
+
isLcmMessagePartKind,
|
|
374
|
+
normalizeExplicitParts,
|
|
375
|
+
parseAnthropicMessageParts,
|
|
376
|
+
parseMessageParts,
|
|
377
|
+
parseOpenAiMessageParts,
|
|
378
|
+
parseOpenClawMessageParts,
|
|
379
|
+
partsFromRenderedText
|
|
380
|
+
} from "./chunk-IBX3VFOM.js";
|
|
381
|
+
import "./chunk-5UM2VJ6D.js";
|
|
379
382
|
import "./chunk-PCUKNJAZ.js";
|
|
380
|
-
import "./chunk-3FPTCC3Z.js";
|
|
381
|
-
import "./chunk-2LGMW3DJ.js";
|
|
382
383
|
import "./chunk-EEQLFRUM.js";
|
|
383
384
|
import "./chunk-NBNN5GOB.js";
|
|
384
385
|
import {
|
|
385
386
|
launchProcessSync
|
|
386
387
|
} from "./chunk-OR64ZGRZ.js";
|
|
388
|
+
import "./chunk-GVPWB7EY.js";
|
|
389
|
+
import "./chunk-2LGMW3DJ.js";
|
|
387
390
|
import {
|
|
388
391
|
buildProcedureMarkdownBody,
|
|
389
392
|
parseProcedureStepsFromBody
|
|
@@ -397,6 +400,9 @@ import "./chunk-2LSZVONP.js";
|
|
|
397
400
|
import "./chunk-WIICJPET.js";
|
|
398
401
|
import "./chunk-G2WADRQ3.js";
|
|
399
402
|
import "./chunk-74EMIVE4.js";
|
|
403
|
+
import {
|
|
404
|
+
expandTildePath
|
|
405
|
+
} from "./chunk-IXEJRKCZ.js";
|
|
400
406
|
import "./chunk-DT5TVLJE.js";
|
|
401
407
|
import {
|
|
402
408
|
resolvePrincipal
|
|
@@ -414,10 +420,10 @@ import {
|
|
|
414
420
|
renderBriefingMarkdown,
|
|
415
421
|
resolveBriefingSaveDir,
|
|
416
422
|
validateBriefingFormat
|
|
417
|
-
} from "./chunk-
|
|
423
|
+
} from "./chunk-WTFWLUSX.js";
|
|
418
424
|
import {
|
|
419
425
|
StorageManager
|
|
420
|
-
} from "./chunk-
|
|
426
|
+
} from "./chunk-MCC6KDQF.js";
|
|
421
427
|
import "./chunk-YNJHCGDT.js";
|
|
422
428
|
import {
|
|
423
429
|
CITATION_UNKNOWN,
|
|
@@ -429,19 +435,19 @@ import {
|
|
|
429
435
|
parseAllCitations,
|
|
430
436
|
parseCitation,
|
|
431
437
|
stripCitation
|
|
432
|
-
} from "./chunk-
|
|
438
|
+
} from "./chunk-NN2DKE4T.js";
|
|
433
439
|
import {
|
|
434
440
|
DEFAULT_RECALL_DISCLOSURE,
|
|
435
441
|
RECALL_DISCLOSURE_LEVELS,
|
|
436
442
|
isRecallDisclosure
|
|
437
|
-
} from "./chunk-
|
|
443
|
+
} from "./chunk-VQXK37XA.js";
|
|
438
444
|
import "./chunk-PFV5C235.js";
|
|
439
445
|
import "./chunk-RULE4VG5.js";
|
|
440
446
|
import "./chunk-SCU65EZI.js";
|
|
441
|
-
import "./chunk-
|
|
447
|
+
import "./chunk-XJKFSSDW.js";
|
|
442
448
|
import "./chunk-DM2T26WE.js";
|
|
443
449
|
import "./chunk-QSVPYQPG.js";
|
|
444
|
-
import "./chunk-
|
|
450
|
+
import "./chunk-FVQJYWH7.js";
|
|
445
451
|
import "./chunk-4DJQYKMN.js";
|
|
446
452
|
import "./chunk-G7D6GZ5J.js";
|
|
447
453
|
import {
|
|
@@ -2554,14 +2560,14 @@ function hashContent3(content) {
|
|
|
2554
2560
|
}
|
|
2555
2561
|
|
|
2556
2562
|
// src/connectors/index.ts
|
|
2557
|
-
import
|
|
2563
|
+
import fs9 from "fs";
|
|
2558
2564
|
import path13 from "path";
|
|
2559
2565
|
import os from "os";
|
|
2560
2566
|
import { createRequire } from "module";
|
|
2561
2567
|
import { fileURLToPath } from "url";
|
|
2562
2568
|
|
|
2563
2569
|
// src/connectors/codex-marketplace.ts
|
|
2564
|
-
import
|
|
2570
|
+
import fs8 from "fs";
|
|
2565
2571
|
import path12 from "path";
|
|
2566
2572
|
var MARKETPLACE_SCHEMA_VERSION = 1;
|
|
2567
2573
|
var MARKETPLACE_MANIFEST_FILENAME = "marketplace.json";
|
|
@@ -2664,12 +2670,12 @@ async function writeMarketplaceManifest(outputDir, manifest) {
|
|
|
2664
2670
|
`Refusing to write invalid manifest: ${validation.errors.join("; ")}`
|
|
2665
2671
|
);
|
|
2666
2672
|
}
|
|
2667
|
-
mkdirSync(outputDir, { recursive: true });
|
|
2673
|
+
fs8.mkdirSync(outputDir, { recursive: true });
|
|
2668
2674
|
const destPath = path12.join(outputDir, MARKETPLACE_MANIFEST_FILENAME);
|
|
2669
2675
|
const tmpPath = `${destPath}.tmp.${process.pid}`;
|
|
2670
2676
|
const content = JSON.stringify(manifest, null, 2) + "\n";
|
|
2671
|
-
writeFileSync(tmpPath, content);
|
|
2672
|
-
renameSync(tmpPath, destPath);
|
|
2677
|
+
fs8.writeFileSync(tmpPath, content);
|
|
2678
|
+
fs8.renameSync(tmpPath, destPath);
|
|
2673
2679
|
}
|
|
2674
2680
|
async function installFromMarketplace(source, sourceType, config, logger) {
|
|
2675
2681
|
const _log = logger ?? {
|
|
@@ -2730,11 +2736,11 @@ async function resolveManifest(source, sourceType, logger) {
|
|
|
2730
2736
|
}
|
|
2731
2737
|
function resolveLocal(dirPath, logger) {
|
|
2732
2738
|
const manifestPath2 = path12.join(dirPath, MARKETPLACE_MANIFEST_FILENAME);
|
|
2733
|
-
if (!existsSync(manifestPath2)) {
|
|
2739
|
+
if (!fs8.existsSync(manifestPath2)) {
|
|
2734
2740
|
throw new Error(`marketplace.json not found at ${manifestPath2}`);
|
|
2735
2741
|
}
|
|
2736
2742
|
logger.debug?.(`reading local marketplace manifest: ${manifestPath2}`);
|
|
2737
|
-
const raw = readFileSync(manifestPath2, "utf-8");
|
|
2743
|
+
const raw = fs8.readFileSync(manifestPath2, "utf-8");
|
|
2738
2744
|
let parsed;
|
|
2739
2745
|
try {
|
|
2740
2746
|
parsed = JSON.parse(raw);
|
|
@@ -2793,8 +2799,8 @@ function readPackageVersion() {
|
|
|
2793
2799
|
for (const candidate of candidates) {
|
|
2794
2800
|
const pkgPath = path12.join(candidate, "package.json");
|
|
2795
2801
|
try {
|
|
2796
|
-
if (!existsSync(pkgPath)) continue;
|
|
2797
|
-
const raw = readFileSync(pkgPath, "utf-8");
|
|
2802
|
+
if (!fs8.existsSync(pkgPath)) continue;
|
|
2803
|
+
const raw = fs8.readFileSync(pkgPath, "utf-8");
|
|
2798
2804
|
const parsed = JSON.parse(raw);
|
|
2799
2805
|
if (typeof parsed === "object" && parsed !== null && typeof parsed.version === "string") {
|
|
2800
2806
|
return parsed.version;
|
|
@@ -3111,7 +3117,7 @@ function getRegistryPath() {
|
|
|
3111
3117
|
}
|
|
3112
3118
|
function loadRegistry() {
|
|
3113
3119
|
const regPath = getRegistryPath();
|
|
3114
|
-
if (!
|
|
3120
|
+
if (!fs9.existsSync(regPath)) {
|
|
3115
3121
|
const registry = {
|
|
3116
3122
|
connectors: BUILTIN_CONNECTORS,
|
|
3117
3123
|
registryPath: regPath
|
|
@@ -3119,7 +3125,7 @@ function loadRegistry() {
|
|
|
3119
3125
|
saveRegistry(registry);
|
|
3120
3126
|
return registry;
|
|
3121
3127
|
}
|
|
3122
|
-
const raw =
|
|
3128
|
+
const raw = fs9.readFileSync(regPath, "utf8");
|
|
3123
3129
|
try {
|
|
3124
3130
|
const parsed = JSON.parse(raw);
|
|
3125
3131
|
const builtinIds = new Set(BUILTIN_CONNECTORS.map((b) => b.id));
|
|
@@ -3140,19 +3146,19 @@ function loadRegistry() {
|
|
|
3140
3146
|
}
|
|
3141
3147
|
function saveRegistry(registry) {
|
|
3142
3148
|
const regPath = registry.registryPath;
|
|
3143
|
-
|
|
3144
|
-
|
|
3149
|
+
fs9.mkdirSync(path13.dirname(regPath), { recursive: true });
|
|
3150
|
+
fs9.writeFileSync(regPath, JSON.stringify({ connectors: registry.connectors }, null, 2));
|
|
3145
3151
|
}
|
|
3146
3152
|
function listConnectors() {
|
|
3147
3153
|
const registry = loadRegistry();
|
|
3148
3154
|
const connectorsDir = getConnectorsDir();
|
|
3149
3155
|
const installedIds = /* @__PURE__ */ new Set();
|
|
3150
|
-
if (
|
|
3151
|
-
for (const entry of
|
|
3156
|
+
if (fs9.existsSync(connectorsDir)) {
|
|
3157
|
+
for (const entry of fs9.readdirSync(connectorsDir)) {
|
|
3152
3158
|
if (entry.endsWith(".json")) {
|
|
3153
3159
|
try {
|
|
3154
3160
|
const config = JSON.parse(
|
|
3155
|
-
|
|
3161
|
+
fs9.readFileSync(path13.join(connectorsDir, entry), "utf8")
|
|
3156
3162
|
);
|
|
3157
3163
|
installedIds.add(config.connectorId);
|
|
3158
3164
|
} catch {
|
|
@@ -3168,7 +3174,7 @@ function listConnectors() {
|
|
|
3168
3174
|
for (const id of installedIds) {
|
|
3169
3175
|
const configPath = path13.join(connectorsDir, `${id}.json`);
|
|
3170
3176
|
try {
|
|
3171
|
-
const raw = JSON.parse(
|
|
3177
|
+
const raw = JSON.parse(fs9.readFileSync(configPath, "utf8"));
|
|
3172
3178
|
const { token: _redacted, ...config } = raw;
|
|
3173
3179
|
installed.push({
|
|
3174
3180
|
connectorId: id,
|
|
@@ -3202,7 +3208,7 @@ function installConnector(options) {
|
|
|
3202
3208
|
};
|
|
3203
3209
|
}
|
|
3204
3210
|
const configDir = getConnectorsDir();
|
|
3205
|
-
|
|
3211
|
+
fs9.mkdirSync(configDir, { recursive: true });
|
|
3206
3212
|
const configPath = path13.join(configDir, `${options.connectorId}.json`);
|
|
3207
3213
|
let hermesSavedProfile;
|
|
3208
3214
|
let hermesSavedHost;
|
|
@@ -3211,9 +3217,9 @@ function installConnector(options) {
|
|
|
3211
3217
|
let hermesResolvedHost;
|
|
3212
3218
|
let hermesResolvedPort;
|
|
3213
3219
|
if (options.connectorId === "hermes") {
|
|
3214
|
-
if (
|
|
3220
|
+
if (fs9.existsSync(configPath)) {
|
|
3215
3221
|
try {
|
|
3216
|
-
const prev = JSON.parse(
|
|
3222
|
+
const prev = JSON.parse(fs9.readFileSync(configPath, "utf8"));
|
|
3217
3223
|
if (prev?.profile != null) {
|
|
3218
3224
|
try {
|
|
3219
3225
|
hermesSavedProfile = sanitizeHermesProfile(String(prev.profile));
|
|
@@ -3377,7 +3383,7 @@ function installConnector(options) {
|
|
|
3377
3383
|
let yamlRollbackErrMsg = "";
|
|
3378
3384
|
try {
|
|
3379
3385
|
if (yamlResult.priorContent === null) {
|
|
3380
|
-
|
|
3386
|
+
fs9.unlinkSync(yamlResult.configPath);
|
|
3381
3387
|
} else if (typeof yamlResult.priorContent === "string") {
|
|
3382
3388
|
writeSecretFileSync(yamlResult.configPath, yamlResult.priorContent);
|
|
3383
3389
|
}
|
|
@@ -3419,7 +3425,7 @@ function installConnector(options) {
|
|
|
3419
3425
|
let unlinkSucceeded = false;
|
|
3420
3426
|
let unlinkErr;
|
|
3421
3427
|
try {
|
|
3422
|
-
|
|
3428
|
+
fs9.unlinkSync(yamlResult.configPath);
|
|
3423
3429
|
unlinkSucceeded = true;
|
|
3424
3430
|
} catch (err) {
|
|
3425
3431
|
unlinkErr = err;
|
|
@@ -3547,9 +3553,9 @@ function installConnector(options) {
|
|
|
3547
3553
|
if (options.connectorId === "weclone") {
|
|
3548
3554
|
try {
|
|
3549
3555
|
let proxyConfigPath = null;
|
|
3550
|
-
if (existing &&
|
|
3556
|
+
if (existing && fs9.existsSync(configPath)) {
|
|
3551
3557
|
try {
|
|
3552
|
-
const savedRegistryConfig = JSON.parse(
|
|
3558
|
+
const savedRegistryConfig = JSON.parse(fs9.readFileSync(configPath, "utf8"));
|
|
3553
3559
|
if (typeof savedRegistryConfig.proxyConfigPath === "string" && savedRegistryConfig.proxyConfigPath.length > 0) {
|
|
3554
3560
|
proxyConfigPath = savedRegistryConfig.proxyConfigPath;
|
|
3555
3561
|
}
|
|
@@ -3565,12 +3571,12 @@ function installConnector(options) {
|
|
|
3565
3571
|
priorConfig: prior ? safeParseJson(prior) : null,
|
|
3566
3572
|
authToken: tokenEntry?.token
|
|
3567
3573
|
});
|
|
3568
|
-
|
|
3574
|
+
fs9.mkdirSync(path13.dirname(proxyConfigPath), { recursive: true });
|
|
3569
3575
|
weCloneProxyHandleRollback = () => {
|
|
3570
3576
|
try {
|
|
3571
3577
|
if (prior === null) {
|
|
3572
|
-
if (
|
|
3573
|
-
|
|
3578
|
+
if (fs9.existsSync(proxyConfigPath)) {
|
|
3579
|
+
fs9.unlinkSync(proxyConfigPath);
|
|
3574
3580
|
}
|
|
3575
3581
|
} else {
|
|
3576
3582
|
writeSecretFileSync(proxyConfigPath, prior);
|
|
@@ -3675,9 +3681,9 @@ function removeConnector(connectorId) {
|
|
|
3675
3681
|
let codexHomeOverride = null;
|
|
3676
3682
|
let savedInstallExtension = void 0;
|
|
3677
3683
|
let configParsed = false;
|
|
3678
|
-
if (connectorId === "codex-cli" &&
|
|
3684
|
+
if (connectorId === "codex-cli" && fs9.existsSync(configPath)) {
|
|
3679
3685
|
try {
|
|
3680
|
-
const parsed = JSON.parse(
|
|
3686
|
+
const parsed = JSON.parse(fs9.readFileSync(configPath, "utf8"));
|
|
3681
3687
|
configParsed = true;
|
|
3682
3688
|
if (typeof parsed.codexHome === "string" && parsed.codexHome.length > 0) {
|
|
3683
3689
|
codexHomeOverride = parsed.codexHome;
|
|
@@ -3692,7 +3698,7 @@ function removeConnector(connectorId) {
|
|
|
3692
3698
|
);
|
|
3693
3699
|
}
|
|
3694
3700
|
}
|
|
3695
|
-
if (!
|
|
3701
|
+
if (!fs9.existsSync(configPath)) {
|
|
3696
3702
|
let staleTokenRevoked = false;
|
|
3697
3703
|
try {
|
|
3698
3704
|
staleTokenRevoked = revokeToken(connectorId);
|
|
@@ -3709,7 +3715,7 @@ function removeConnector(connectorId) {
|
|
|
3709
3715
|
let storedProfile = "default";
|
|
3710
3716
|
if (connectorId === "hermes") {
|
|
3711
3717
|
try {
|
|
3712
|
-
const stored = JSON.parse(
|
|
3718
|
+
const stored = JSON.parse(fs9.readFileSync(configPath, "utf8"));
|
|
3713
3719
|
if (typeof stored?.profile === "string") storedProfile = stored.profile;
|
|
3714
3720
|
} catch {
|
|
3715
3721
|
}
|
|
@@ -3718,7 +3724,7 @@ function removeConnector(connectorId) {
|
|
|
3718
3724
|
let weCloneRegistryParseFailed = false;
|
|
3719
3725
|
if (connectorId === "weclone") {
|
|
3720
3726
|
try {
|
|
3721
|
-
const stored = JSON.parse(
|
|
3727
|
+
const stored = JSON.parse(fs9.readFileSync(configPath, "utf8"));
|
|
3722
3728
|
if (typeof stored.proxyConfigPath === "string" && stored.proxyConfigPath.length > 0) {
|
|
3723
3729
|
weCloneProxyConfigPath = stored.proxyConfigPath;
|
|
3724
3730
|
}
|
|
@@ -3744,7 +3750,7 @@ function removeConnector(connectorId) {
|
|
|
3744
3750
|
reason: "config-parse-failed"
|
|
3745
3751
|
};
|
|
3746
3752
|
}
|
|
3747
|
-
if (connectorId === "codex-cli" &&
|
|
3753
|
+
if (connectorId === "codex-cli" && fs9.existsSync(configPath) && !configParsed) {
|
|
3748
3754
|
console.warn(
|
|
3749
3755
|
"[remnic/connectors] removeConnector: codex-cli.json is malformed \u2014 aborting removal to preserve provenance. Fix or delete " + configPath + " manually and retry."
|
|
3750
3756
|
);
|
|
@@ -3768,7 +3774,7 @@ function removeConnector(connectorId) {
|
|
|
3768
3774
|
}
|
|
3769
3775
|
}
|
|
3770
3776
|
try {
|
|
3771
|
-
|
|
3777
|
+
fs9.unlinkSync(configPath);
|
|
3772
3778
|
} catch (unlinkErr) {
|
|
3773
3779
|
const sanitizedErr = unlinkErr instanceof Error ? unlinkErr.message : String(unlinkErr);
|
|
3774
3780
|
return {
|
|
@@ -3800,8 +3806,8 @@ function removeConnector(connectorId) {
|
|
|
3800
3806
|
weCloneProxyDeleteFailed = `Proxy config path ${JSON.stringify(weCloneProxyConfigPath)} failed safety validation (must be absolute and end with "${expectedSuffix}"). Refusing to delete \u2014 remove the file manually if it exists.`;
|
|
3801
3807
|
} else {
|
|
3802
3808
|
try {
|
|
3803
|
-
if (
|
|
3804
|
-
|
|
3809
|
+
if (fs9.existsSync(weCloneProxyConfigPath)) {
|
|
3810
|
+
fs9.unlinkSync(weCloneProxyConfigPath);
|
|
3805
3811
|
notes.push(`Removed WeClone proxy config: ${weCloneProxyConfigPath}`);
|
|
3806
3812
|
}
|
|
3807
3813
|
} catch (err) {
|
|
@@ -3871,7 +3877,7 @@ function hermesConfigPath(profile) {
|
|
|
3871
3877
|
const profilesRoot = path13.join(hermesRoot, "profiles");
|
|
3872
3878
|
if (safeProfile === "default") {
|
|
3873
3879
|
const defaultProfileDir = path13.join(profilesRoot, safeProfile);
|
|
3874
|
-
if (isFile(rootConfigPath) || !
|
|
3880
|
+
if (isFile(rootConfigPath) || !fs9.existsSync(rootConfigPath) && !isDirectory(defaultProfileDir)) {
|
|
3875
3881
|
return rootConfigPath;
|
|
3876
3882
|
}
|
|
3877
3883
|
}
|
|
@@ -3886,21 +3892,21 @@ function hermesConfigPath(profile) {
|
|
|
3886
3892
|
}
|
|
3887
3893
|
function isDirectory(filePath) {
|
|
3888
3894
|
try {
|
|
3889
|
-
return
|
|
3895
|
+
return fs9.statSync(filePath).isDirectory();
|
|
3890
3896
|
} catch {
|
|
3891
3897
|
return false;
|
|
3892
3898
|
}
|
|
3893
3899
|
}
|
|
3894
3900
|
function isFile(filePath) {
|
|
3895
3901
|
try {
|
|
3896
|
-
return
|
|
3902
|
+
return fs9.statSync(filePath).isFile();
|
|
3897
3903
|
} catch {
|
|
3898
3904
|
return false;
|
|
3899
3905
|
}
|
|
3900
3906
|
}
|
|
3901
3907
|
function hermesConfigTarget(filePath) {
|
|
3902
3908
|
try {
|
|
3903
|
-
return
|
|
3909
|
+
return fs9.realpathSync.native(filePath);
|
|
3904
3910
|
} catch {
|
|
3905
3911
|
return path13.resolve(filePath);
|
|
3906
3912
|
}
|
|
@@ -3966,9 +3972,9 @@ function sanitizeHermesPort(port) {
|
|
|
3966
3972
|
return numeric;
|
|
3967
3973
|
}
|
|
3968
3974
|
function writeSecretFileSync(filePath, data) {
|
|
3969
|
-
|
|
3975
|
+
fs9.writeFileSync(filePath, data, { mode: 384 });
|
|
3970
3976
|
try {
|
|
3971
|
-
|
|
3977
|
+
fs9.chmodSync(filePath, 384);
|
|
3972
3978
|
} catch {
|
|
3973
3979
|
}
|
|
3974
3980
|
}
|
|
@@ -3994,11 +4000,11 @@ function upsertHermesConfig(opts) {
|
|
|
3994
4000
|
` port: ${safePort}`,
|
|
3995
4001
|
` token: "${opts.token}"`
|
|
3996
4002
|
].join("\n");
|
|
3997
|
-
if (!
|
|
4003
|
+
if (!fs9.existsSync(cfgPath)) {
|
|
3998
4004
|
writeSecretFileSync(cfgPath, block + "\n");
|
|
3999
4005
|
return { updated: true, skipped: false, configPath: cfgPath, priorContent: null };
|
|
4000
4006
|
}
|
|
4001
|
-
const raw =
|
|
4007
|
+
const raw = fs9.readFileSync(cfgPath, "utf8");
|
|
4002
4008
|
const hasRemnicBlock = /^remnic:/m.test(raw);
|
|
4003
4009
|
if (!hasRemnicBlock) {
|
|
4004
4010
|
const separator = raw.endsWith("\n") ? "\n" : "\n\n";
|
|
@@ -4101,7 +4107,7 @@ function removeHermesConfig(opts) {
|
|
|
4101
4107
|
};
|
|
4102
4108
|
}
|
|
4103
4109
|
function removeHermesConfigFile(cfgPath) {
|
|
4104
|
-
if (!
|
|
4110
|
+
if (!fs9.existsSync(cfgPath)) {
|
|
4105
4111
|
return {
|
|
4106
4112
|
updated: false,
|
|
4107
4113
|
skipped: true,
|
|
@@ -4109,7 +4115,7 @@ function removeHermesConfigFile(cfgPath) {
|
|
|
4109
4115
|
configPath: cfgPath
|
|
4110
4116
|
};
|
|
4111
4117
|
}
|
|
4112
|
-
const raw =
|
|
4118
|
+
const raw = fs9.readFileSync(cfgPath, "utf8");
|
|
4113
4119
|
if (!/^remnic:/m.test(raw)) {
|
|
4114
4120
|
return {
|
|
4115
4121
|
updated: false,
|
|
@@ -4210,11 +4216,11 @@ async function doctorConnector(connectorId) {
|
|
|
4210
4216
|
const checks = [];
|
|
4211
4217
|
checks.push({
|
|
4212
4218
|
name: "Config file",
|
|
4213
|
-
ok:
|
|
4219
|
+
ok: fs9.existsSync(configPath),
|
|
4214
4220
|
detail: configPath
|
|
4215
4221
|
});
|
|
4216
4222
|
try {
|
|
4217
|
-
const raw =
|
|
4223
|
+
const raw = fs9.readFileSync(configPath, "utf8");
|
|
4218
4224
|
JSON.parse(raw);
|
|
4219
4225
|
checks.push({ name: "Config valid", ok: true, detail: "OK" });
|
|
4220
4226
|
} catch (e) {
|
|
@@ -4238,7 +4244,7 @@ async function doctorConnector(connectorId) {
|
|
|
4238
4244
|
}
|
|
4239
4245
|
const memoryDir = instance.config.memoryDir;
|
|
4240
4246
|
if (memoryDir) {
|
|
4241
|
-
if (
|
|
4247
|
+
if (fs9.existsSync(memoryDir)) {
|
|
4242
4248
|
checks.push({ name: "Memory directory", ok: true, detail: memoryDir });
|
|
4243
4249
|
} else {
|
|
4244
4250
|
checks.push({ name: "Memory directory", ok: false, detail: `Not found: ${memoryDir}` });
|
|
@@ -4271,7 +4277,7 @@ function resolveCodexMemoryExtensionPaths(codexHomeOverride) {
|
|
|
4271
4277
|
function locatePluginCodexExtensionSource(override) {
|
|
4272
4278
|
if (override && typeof override === "string" && override.trim().length > 0) {
|
|
4273
4279
|
const resolved = path13.resolve(override.trim());
|
|
4274
|
-
if (
|
|
4280
|
+
if (fs9.existsSync(resolved) && fs9.statSync(resolved).isDirectory()) {
|
|
4275
4281
|
return resolved;
|
|
4276
4282
|
}
|
|
4277
4283
|
throw new Error(`Codex extension source directory not found: ${resolved}`);
|
|
@@ -4288,12 +4294,12 @@ function locatePluginCodexExtensionSource(override) {
|
|
|
4288
4294
|
const moduleDir = path13.dirname(fileURLToPath(import.meta.url));
|
|
4289
4295
|
const bundledCandidate = path13.join(moduleDir, "codex");
|
|
4290
4296
|
searched.push(bundledCandidate);
|
|
4291
|
-
if (
|
|
4297
|
+
if (fs9.existsSync(bundledCandidate) && fs9.statSync(bundledCandidate).isDirectory()) {
|
|
4292
4298
|
return bundledCandidate;
|
|
4293
4299
|
}
|
|
4294
4300
|
const distConnectorsCandidate = path13.join(moduleDir, "connectors", "codex");
|
|
4295
4301
|
searched.push(distConnectorsCandidate);
|
|
4296
|
-
if (
|
|
4302
|
+
if (fs9.existsSync(distConnectorsCandidate) && fs9.statSync(distConnectorsCandidate).isDirectory()) {
|
|
4297
4303
|
return distConnectorsCandidate;
|
|
4298
4304
|
}
|
|
4299
4305
|
} catch {
|
|
@@ -4304,7 +4310,7 @@ function locatePluginCodexExtensionSource(override) {
|
|
|
4304
4310
|
const pluginPkgRoot = path13.dirname(pluginPkgJsonPath);
|
|
4305
4311
|
const candidate = path13.join(pluginPkgRoot, EXTENSION_SUBPATH);
|
|
4306
4312
|
searched.push(candidate);
|
|
4307
|
-
if (
|
|
4313
|
+
if (fs9.existsSync(candidate) && fs9.statSync(candidate).isDirectory()) {
|
|
4308
4314
|
return candidate;
|
|
4309
4315
|
}
|
|
4310
4316
|
} catch {
|
|
@@ -4321,7 +4327,7 @@ function locatePluginCodexExtensionSource(override) {
|
|
|
4321
4327
|
EXTENSION_SUBPATH
|
|
4322
4328
|
);
|
|
4323
4329
|
searched.push(candidate);
|
|
4324
|
-
if (
|
|
4330
|
+
if (fs9.existsSync(candidate) && fs9.statSync(candidate).isDirectory()) {
|
|
4325
4331
|
return candidate;
|
|
4326
4332
|
}
|
|
4327
4333
|
const parent = path13.dirname(dir);
|
|
@@ -4341,7 +4347,7 @@ function locatePluginCodexExtensionSource(override) {
|
|
|
4341
4347
|
for (let depth = 0; depth < 12; depth += 1) {
|
|
4342
4348
|
const candidate = path13.join(dir, WORKSPACE_RELATIVE_PATH);
|
|
4343
4349
|
searched.push(candidate);
|
|
4344
|
-
if (
|
|
4350
|
+
if (fs9.existsSync(candidate) && fs9.statSync(candidate).isDirectory()) {
|
|
4345
4351
|
return candidate;
|
|
4346
4352
|
}
|
|
4347
4353
|
const parent = path13.dirname(dir);
|
|
@@ -4355,15 +4361,15 @@ function locatePluginCodexExtensionSource(override) {
|
|
|
4355
4361
|
}
|
|
4356
4362
|
function copyDirRecursiveSync(src, dest) {
|
|
4357
4363
|
let count = 0;
|
|
4358
|
-
|
|
4359
|
-
const entries =
|
|
4364
|
+
fs9.mkdirSync(dest, { recursive: true });
|
|
4365
|
+
const entries = fs9.readdirSync(src, { withFileTypes: true });
|
|
4360
4366
|
for (const entry of entries) {
|
|
4361
4367
|
const from = path13.join(src, entry.name);
|
|
4362
4368
|
const to = path13.join(dest, entry.name);
|
|
4363
4369
|
if (entry.isDirectory()) {
|
|
4364
4370
|
count += copyDirRecursiveSync(from, to);
|
|
4365
4371
|
} else if (entry.isFile()) {
|
|
4366
|
-
|
|
4372
|
+
fs9.copyFileSync(from, to);
|
|
4367
4373
|
count += 1;
|
|
4368
4374
|
}
|
|
4369
4375
|
}
|
|
@@ -4372,22 +4378,22 @@ function copyDirRecursiveSync(src, dest) {
|
|
|
4372
4378
|
function installCodexMemoryExtension(options = {}) {
|
|
4373
4379
|
const paths = resolveCodexMemoryExtensionPaths(options.codexHome ?? null);
|
|
4374
4380
|
const sourceDir = locatePluginCodexExtensionSource(options.sourceDir ?? null);
|
|
4375
|
-
|
|
4381
|
+
fs9.mkdirSync(paths.extensionsRoot, { recursive: true });
|
|
4376
4382
|
const tmpPrefix = `.${REMNIC_EXTENSION_DIR_NAME}.tmp-`;
|
|
4377
4383
|
const STALE_TMP_THRESHOLD_MS = 10 * 60 * 1e3;
|
|
4378
4384
|
const now = Date.now();
|
|
4379
4385
|
try {
|
|
4380
|
-
const existingEntries =
|
|
4386
|
+
const existingEntries = fs9.readdirSync(paths.extensionsRoot);
|
|
4381
4387
|
for (const entry of existingEntries) {
|
|
4382
4388
|
if (!entry.startsWith(tmpPrefix)) continue;
|
|
4383
4389
|
const stalePath = path13.join(paths.extensionsRoot, entry);
|
|
4384
4390
|
try {
|
|
4385
|
-
const stat =
|
|
4391
|
+
const stat = fs9.statSync(stalePath);
|
|
4386
4392
|
const ageMs = now - stat.mtimeMs;
|
|
4387
4393
|
if (ageMs < STALE_TMP_THRESHOLD_MS) {
|
|
4388
4394
|
continue;
|
|
4389
4395
|
}
|
|
4390
|
-
|
|
4396
|
+
fs9.rmSync(stalePath, { recursive: true, force: true });
|
|
4391
4397
|
} catch {
|
|
4392
4398
|
}
|
|
4393
4399
|
}
|
|
@@ -4403,16 +4409,16 @@ function installCodexMemoryExtension(options = {}) {
|
|
|
4403
4409
|
try {
|
|
4404
4410
|
filesCopied = copyDirRecursiveSync(sourceDir, tmpDir);
|
|
4405
4411
|
const backupDir = `${paths.remnicExtensionDir}.bak-${Date.now()}`;
|
|
4406
|
-
const hadExisting =
|
|
4412
|
+
const hadExisting = fs9.existsSync(paths.remnicExtensionDir);
|
|
4407
4413
|
if (hadExisting) {
|
|
4408
|
-
|
|
4414
|
+
fs9.renameSync(paths.remnicExtensionDir, backupDir);
|
|
4409
4415
|
}
|
|
4410
4416
|
try {
|
|
4411
|
-
|
|
4417
|
+
fs9.renameSync(tmpDir, paths.remnicExtensionDir);
|
|
4412
4418
|
} catch (renameErr) {
|
|
4413
4419
|
if (hadExisting) {
|
|
4414
4420
|
try {
|
|
4415
|
-
|
|
4421
|
+
fs9.renameSync(backupDir, paths.remnicExtensionDir);
|
|
4416
4422
|
} catch {
|
|
4417
4423
|
}
|
|
4418
4424
|
}
|
|
@@ -4421,7 +4427,7 @@ function installCodexMemoryExtension(options = {}) {
|
|
|
4421
4427
|
commitFn = () => {
|
|
4422
4428
|
if (hadExisting) {
|
|
4423
4429
|
try {
|
|
4424
|
-
|
|
4430
|
+
fs9.rmSync(backupDir, { recursive: true, force: true });
|
|
4425
4431
|
} catch {
|
|
4426
4432
|
}
|
|
4427
4433
|
}
|
|
@@ -4429,25 +4435,25 @@ function installCodexMemoryExtension(options = {}) {
|
|
|
4429
4435
|
rollbackFn = () => {
|
|
4430
4436
|
if (hadExisting) {
|
|
4431
4437
|
try {
|
|
4432
|
-
if (
|
|
4433
|
-
|
|
4438
|
+
if (fs9.existsSync(paths.remnicExtensionDir)) {
|
|
4439
|
+
fs9.rmSync(paths.remnicExtensionDir, { recursive: true, force: true });
|
|
4434
4440
|
}
|
|
4435
|
-
|
|
4441
|
+
fs9.renameSync(backupDir, paths.remnicExtensionDir);
|
|
4436
4442
|
} catch {
|
|
4437
4443
|
}
|
|
4438
4444
|
} else {
|
|
4439
4445
|
try {
|
|
4440
|
-
if (
|
|
4441
|
-
|
|
4446
|
+
if (fs9.existsSync(paths.remnicExtensionDir)) {
|
|
4447
|
+
fs9.rmSync(paths.remnicExtensionDir, { recursive: true, force: true });
|
|
4442
4448
|
}
|
|
4443
4449
|
} catch {
|
|
4444
4450
|
}
|
|
4445
4451
|
}
|
|
4446
4452
|
};
|
|
4447
4453
|
} catch (err) {
|
|
4448
|
-
if (
|
|
4454
|
+
if (fs9.existsSync(tmpDir)) {
|
|
4449
4455
|
try {
|
|
4450
|
-
|
|
4456
|
+
fs9.rmSync(tmpDir, { recursive: true, force: true });
|
|
4451
4457
|
} catch {
|
|
4452
4458
|
}
|
|
4453
4459
|
}
|
|
@@ -4465,8 +4471,8 @@ function installCodexMemoryExtension(options = {}) {
|
|
|
4465
4471
|
function removeCodexMemoryExtension(options = {}) {
|
|
4466
4472
|
const paths = resolveCodexMemoryExtensionPaths(options.codexHome ?? null);
|
|
4467
4473
|
let removed = false;
|
|
4468
|
-
if (
|
|
4469
|
-
|
|
4474
|
+
if (fs9.existsSync(paths.remnicExtensionDir)) {
|
|
4475
|
+
fs9.rmSync(paths.remnicExtensionDir, { recursive: true, force: true });
|
|
4470
4476
|
removed = true;
|
|
4471
4477
|
}
|
|
4472
4478
|
return { ...paths, removed };
|
|
@@ -4494,8 +4500,8 @@ function resolveWeCloneProxyConfigPath() {
|
|
|
4494
4500
|
}
|
|
4495
4501
|
function readWeCloneProxyConfigIfExists(configPath) {
|
|
4496
4502
|
try {
|
|
4497
|
-
if (!
|
|
4498
|
-
return
|
|
4503
|
+
if (!fs9.existsSync(configPath)) return null;
|
|
4504
|
+
return fs9.readFileSync(configPath, "utf8");
|
|
4499
4505
|
} catch {
|
|
4500
4506
|
return null;
|
|
4501
4507
|
}
|
|
@@ -4615,7 +4621,7 @@ function buildWeCloneProxyConfig(args) {
|
|
|
4615
4621
|
}
|
|
4616
4622
|
|
|
4617
4623
|
// src/spaces/index.ts
|
|
4618
|
-
import
|
|
4624
|
+
import fs10 from "fs";
|
|
4619
4625
|
import path14 from "path";
|
|
4620
4626
|
import crypto6 from "crypto";
|
|
4621
4627
|
var MANIFEST_VERSION = 1;
|
|
@@ -4628,7 +4634,7 @@ function getManifestPath(baseDir) {
|
|
|
4628
4634
|
}
|
|
4629
4635
|
function loadManifest(baseDir, memoryDirOverride) {
|
|
4630
4636
|
const manifestPath2 = getManifestPath(baseDir);
|
|
4631
|
-
if (!
|
|
4637
|
+
if (!fs10.existsSync(manifestPath2)) {
|
|
4632
4638
|
const personalSpace = createPersonalSpace(baseDir, memoryDirOverride);
|
|
4633
4639
|
const manifest = {
|
|
4634
4640
|
activeSpaceId: personalSpace.id,
|
|
@@ -4638,19 +4644,19 @@ function loadManifest(baseDir, memoryDirOverride) {
|
|
|
4638
4644
|
saveManifest(manifest, baseDir);
|
|
4639
4645
|
return manifest;
|
|
4640
4646
|
}
|
|
4641
|
-
const raw = JSON.parse(
|
|
4647
|
+
const raw = JSON.parse(fs10.readFileSync(manifestPath2, "utf8"));
|
|
4642
4648
|
return raw;
|
|
4643
4649
|
}
|
|
4644
4650
|
function saveManifest(manifest, baseDir) {
|
|
4645
4651
|
const manifestPath2 = getManifestPath(baseDir);
|
|
4646
|
-
|
|
4647
|
-
|
|
4652
|
+
fs10.mkdirSync(path14.dirname(manifestPath2), { recursive: true });
|
|
4653
|
+
fs10.writeFileSync(manifestPath2, JSON.stringify(manifest, null, 2) + "\n");
|
|
4648
4654
|
}
|
|
4649
4655
|
function createPersonalSpace(baseDir, memoryDirOverride) {
|
|
4650
4656
|
const homeDir = baseDir ?? resolveHomeDir();
|
|
4651
4657
|
const standalonePath = path14.join(homeDir, ".engram", "memory");
|
|
4652
4658
|
const openclawPath = path14.join(homeDir, ".openclaw", "workspace", "memory", "local");
|
|
4653
|
-
const memoryDir = memoryDirOverride ?? readEnvVar("ENGRAM_MEMORY_DIR") ?? (
|
|
4659
|
+
const memoryDir = memoryDirOverride ?? readEnvVar("ENGRAM_MEMORY_DIR") ?? (fs10.existsSync(standalonePath) ? standalonePath : fs10.existsSync(openclawPath) ? openclawPath : standalonePath);
|
|
4654
4660
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
4655
4661
|
return {
|
|
4656
4662
|
id: "personal",
|
|
@@ -4699,7 +4705,7 @@ function createSpace(options) {
|
|
|
4699
4705
|
owner: readEnvVar("USER"),
|
|
4700
4706
|
parentSpaceId: options.parentSpaceId
|
|
4701
4707
|
};
|
|
4702
|
-
|
|
4708
|
+
fs10.mkdirSync(memoryDir, { recursive: true });
|
|
4703
4709
|
manifest.spaces.push(space);
|
|
4704
4710
|
manifest.updatedAt = now;
|
|
4705
4711
|
saveManifest(manifest, options.baseDir);
|
|
@@ -4874,31 +4880,31 @@ function mergeSpaces(sourceSpaceId, targetSpaceId, options) {
|
|
|
4874
4880
|
}
|
|
4875
4881
|
function getAuditLog(baseDir) {
|
|
4876
4882
|
const auditPath = path14.join(getSpacesDir(baseDir), "audit.jsonl");
|
|
4877
|
-
if (!
|
|
4878
|
-
const lines =
|
|
4883
|
+
if (!fs10.existsSync(auditPath)) return [];
|
|
4884
|
+
const lines = fs10.readFileSync(auditPath, "utf8").trim().split("\n");
|
|
4879
4885
|
return lines.filter((l) => l.trim()).map((l) => JSON.parse(l));
|
|
4880
4886
|
}
|
|
4881
4887
|
function appendAudit(entry, baseDir) {
|
|
4882
4888
|
const auditPath = path14.join(getSpacesDir(baseDir), "audit.jsonl");
|
|
4883
|
-
|
|
4889
|
+
fs10.mkdirSync(path14.dirname(auditPath), { recursive: true });
|
|
4884
4890
|
const full = {
|
|
4885
4891
|
id: crypto6.randomUUID(),
|
|
4886
4892
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
4887
4893
|
...entry
|
|
4888
4894
|
};
|
|
4889
|
-
|
|
4895
|
+
fs10.appendFileSync(auditPath, JSON.stringify(full) + "\n");
|
|
4890
4896
|
}
|
|
4891
4897
|
function copyMemories(sourceDir, targetDir, options) {
|
|
4892
4898
|
let merged = 0;
|
|
4893
4899
|
const conflicts = [];
|
|
4894
4900
|
let skipped = 0;
|
|
4895
|
-
if (!
|
|
4901
|
+
if (!fs10.existsSync(sourceDir)) {
|
|
4896
4902
|
return { merged: 0, conflicts: [], skipped: 0 };
|
|
4897
4903
|
}
|
|
4898
|
-
|
|
4904
|
+
fs10.mkdirSync(targetDir, { recursive: true });
|
|
4899
4905
|
const sourceFiles = walkMd2(sourceDir);
|
|
4900
4906
|
for (const sourcePath of sourceFiles) {
|
|
4901
|
-
const content =
|
|
4907
|
+
const content = fs10.readFileSync(sourcePath, "utf8");
|
|
4902
4908
|
const relativePath = path14.relative(sourceDir, sourcePath);
|
|
4903
4909
|
const targetPath = path14.join(targetDir, relativePath);
|
|
4904
4910
|
const sourceHash = hashContent4(content);
|
|
@@ -4909,8 +4915,8 @@ function copyMemories(sourceDir, targetDir, options) {
|
|
|
4909
4915
|
continue;
|
|
4910
4916
|
}
|
|
4911
4917
|
}
|
|
4912
|
-
if (
|
|
4913
|
-
const targetContent =
|
|
4918
|
+
if (fs10.existsSync(targetPath) && !options?.force) {
|
|
4919
|
+
const targetContent = fs10.readFileSync(targetPath, "utf8");
|
|
4914
4920
|
const targetHash = hashContent4(targetContent);
|
|
4915
4921
|
if (sourceHash !== targetHash) {
|
|
4916
4922
|
conflicts.push({
|
|
@@ -4926,8 +4932,8 @@ function copyMemories(sourceDir, targetDir, options) {
|
|
|
4926
4932
|
skipped++;
|
|
4927
4933
|
continue;
|
|
4928
4934
|
}
|
|
4929
|
-
|
|
4930
|
-
|
|
4935
|
+
fs10.mkdirSync(path14.dirname(targetPath), { recursive: true });
|
|
4936
|
+
fs10.writeFileSync(targetPath, content);
|
|
4931
4937
|
merged++;
|
|
4932
4938
|
}
|
|
4933
4939
|
return { merged, conflicts, skipped };
|
|
@@ -4938,7 +4944,7 @@ function hashContent4(content) {
|
|
|
4938
4944
|
function walkMd2(dir) {
|
|
4939
4945
|
const results = [];
|
|
4940
4946
|
function walk(d) {
|
|
4941
|
-
for (const entry of
|
|
4947
|
+
for (const entry of fs10.readdirSync(d, { withFileTypes: true })) {
|
|
4942
4948
|
const fullPath = path14.join(d, entry.name);
|
|
4943
4949
|
if (entry.isDirectory()) {
|
|
4944
4950
|
walk(fullPath);
|
|
@@ -5067,7 +5073,7 @@ var REMNIC_RECALL_DECISION_RULES = `## When to Use Recall vs Direct Read
|
|
|
5067
5073
|
`;
|
|
5068
5074
|
|
|
5069
5075
|
// src/memory-extension/codex-publisher.ts
|
|
5070
|
-
import
|
|
5076
|
+
import fs11 from "fs";
|
|
5071
5077
|
import os2 from "os";
|
|
5072
5078
|
import path15 from "path";
|
|
5073
5079
|
var REMNIC_EXTENSION_DIR_NAME2 = "remnic";
|
|
@@ -5086,7 +5092,7 @@ var CodexMemoryExtensionPublisher = class {
|
|
|
5086
5092
|
async isHostAvailable() {
|
|
5087
5093
|
try {
|
|
5088
5094
|
const home = readEnvVar("CODEX_HOME")?.trim() || path15.join(resolveHomeDir(), ".codex");
|
|
5089
|
-
return
|
|
5095
|
+
return fs11.existsSync(home);
|
|
5090
5096
|
} catch {
|
|
5091
5097
|
return false;
|
|
5092
5098
|
}
|
|
@@ -5140,18 +5146,18 @@ When running inside the Codex phase-2 consolidation sandbox:
|
|
|
5140
5146
|
const filesWritten = [];
|
|
5141
5147
|
const skipped = [];
|
|
5142
5148
|
ctx.log.info(`Publishing Codex memory extension to ${extensionRoot}`);
|
|
5143
|
-
|
|
5149
|
+
fs11.mkdirSync(extensionRoot, { recursive: true });
|
|
5144
5150
|
const content = await this.renderInstructions(ctx);
|
|
5145
5151
|
const tmpPath = `${instructionsPath}.tmp-${process.pid}-${Date.now()}`;
|
|
5146
5152
|
try {
|
|
5147
|
-
|
|
5148
|
-
|
|
5153
|
+
fs11.writeFileSync(tmpPath, content, "utf-8");
|
|
5154
|
+
fs11.renameSync(tmpPath, instructionsPath);
|
|
5149
5155
|
filesWritten.push(instructionsPath);
|
|
5150
5156
|
ctx.log.info(`Wrote ${instructionsPath}`);
|
|
5151
5157
|
} catch (err) {
|
|
5152
5158
|
try {
|
|
5153
|
-
if (
|
|
5154
|
-
|
|
5159
|
+
if (fs11.existsSync(tmpPath)) {
|
|
5160
|
+
fs11.unlinkSync(tmpPath);
|
|
5155
5161
|
}
|
|
5156
5162
|
} catch {
|
|
5157
5163
|
}
|
|
@@ -5166,8 +5172,8 @@ When running inside the Codex phase-2 consolidation sandbox:
|
|
|
5166
5172
|
}
|
|
5167
5173
|
async unpublish() {
|
|
5168
5174
|
const extensionRoot = await this.resolveExtensionRoot();
|
|
5169
|
-
if (
|
|
5170
|
-
|
|
5175
|
+
if (fs11.existsSync(extensionRoot)) {
|
|
5176
|
+
fs11.rmSync(extensionRoot, { recursive: true, force: true });
|
|
5171
5177
|
}
|
|
5172
5178
|
}
|
|
5173
5179
|
};
|
|
@@ -5477,7 +5483,7 @@ async function runEnrichmentPipeline(entities, registry, config, log2) {
|
|
|
5477
5483
|
|
|
5478
5484
|
// src/enrichment/audit.ts
|
|
5479
5485
|
import { mkdir, readFile, appendFile } from "fs/promises";
|
|
5480
|
-
import { existsSync
|
|
5486
|
+
import { existsSync } from "fs";
|
|
5481
5487
|
import path16 from "path";
|
|
5482
5488
|
var AUDIT_FILENAME = "enrichment-audit.jsonl";
|
|
5483
5489
|
function auditFilePath(auditDir) {
|
|
@@ -5490,7 +5496,7 @@ async function appendAuditEntry(auditDir, entry) {
|
|
|
5490
5496
|
}
|
|
5491
5497
|
async function readAuditLog(auditDir, since) {
|
|
5492
5498
|
const filePath = auditFilePath(auditDir);
|
|
5493
|
-
if (!
|
|
5499
|
+
if (!existsSync(filePath)) return [];
|
|
5494
5500
|
const raw = await readFile(filePath, "utf-8");
|
|
5495
5501
|
const entries = [];
|
|
5496
5502
|
for (const line of raw.split("\n")) {
|
|
@@ -6045,6 +6051,7 @@ export {
|
|
|
6045
6051
|
saveTaxonomy,
|
|
6046
6052
|
saveTokenStore,
|
|
6047
6053
|
scanForBinaries,
|
|
6054
|
+
setCodexCliFallbackRunnerForProcess,
|
|
6048
6055
|
shareSpace,
|
|
6049
6056
|
stableHash,
|
|
6050
6057
|
stripCitation,
|