@remnic/core 1.1.1 → 1.1.2
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 +20 -20
- package/dist/access-http.js +5 -5
- package/dist/access-mcp.js +4 -4
- package/dist/access-service.js +3 -2
- package/dist/briefing.js +2 -1
- package/dist/calibration.js +2 -2
- package/dist/causal-consolidation.js +4 -4
- package/dist/{chunk-VYM3VWOF.js → chunk-3YGHKTBF.js} +24 -18
- package/dist/chunk-3YGHKTBF.js.map +1 -0
- package/dist/{chunk-YNQKWQT4.js → chunk-4HQS2HPX.js} +5 -5
- package/dist/{chunk-B5WXLVDY.js → chunk-6YJHX2DL.js} +7 -7
- package/dist/{chunk-3GXCSUXR.js → chunk-AYXIPSZO.js} +2 -2
- package/dist/{chunk-BK2EFTE2.js → chunk-BECYBZLX.js} +8 -8
- package/dist/chunk-BECYBZLX.js.map +1 -0
- package/dist/{chunk-ZEM3OK2K.js → chunk-DG6YMRDC.js} +3 -3
- package/dist/{chunk-S3EEFKNY.js → chunk-DIXB44VE.js} +3 -3
- package/dist/{chunk-EPQJM2GC.js → chunk-GA5P7RST.js} +4 -4
- package/dist/{chunk-WVVA7F5A.js → chunk-L7IXWRYE.js} +9 -4
- package/dist/chunk-L7IXWRYE.js.map +1 -0
- package/dist/{chunk-INXV5JBT.js → chunk-LOIMBRDE.js} +13 -13
- package/dist/{chunk-7I7FKFZH.js → chunk-NBVAS5MT.js} +3 -3
- package/dist/{chunk-HK3FGIEW.js → chunk-OC5OXUQ4.js} +6 -6
- package/dist/{chunk-LK6SGL53.js → chunk-OR64ZGRZ.js} +3 -2
- package/dist/chunk-OR64ZGRZ.js.map +1 -0
- package/dist/{chunk-BGJGXLZ7.js → chunk-PVICZTKG.js} +7 -4
- package/dist/chunk-PVICZTKG.js.map +1 -0
- package/dist/{chunk-JL2PU6AI.js → chunk-R2XRID2N.js} +2 -2
- package/dist/{chunk-GKFXUTJ2.js → chunk-STGWEHYR.js} +2 -2
- package/dist/{chunk-KUB6JU6H.js → chunk-TMYO7B5P.js} +2 -2
- package/dist/{chunk-DFTTJYSO.js → chunk-UWB5LMWY.js} +3 -3
- package/dist/{chunk-O5ETUNBT.js → chunk-VTU2B4VF.js} +7 -3
- package/dist/chunk-VTU2B4VF.js.map +1 -0
- package/dist/{chunk-RGLL5SPU.js → chunk-XXVWLXSG.js} +1 -1
- package/dist/{chunk-XZ2TIKGC.js → chunk-Y7R2XJ5Q.js} +25 -9
- package/dist/chunk-Y7R2XJ5Q.js.map +1 -0
- package/dist/{chunk-ALXMCZEU.js → chunk-Z2E7VW55.js} +6 -3
- package/dist/chunk-Z2E7VW55.js.map +1 -0
- package/dist/cli.js +13 -13
- package/dist/config.js +2 -2
- package/dist/embedding-fallback.js +2 -1
- package/dist/{engine-F3GOXGE5.js → engine-72LSIWQP.js} +2 -2
- package/dist/extraction.js +6 -6
- package/dist/fallback-llm.js +2 -2
- package/dist/index.js +57 -50
- package/dist/index.js.map +1 -1
- package/dist/local-llm.js +2 -2
- package/dist/operator-toolkit.js +6 -6
- package/dist/orchestrator.js +14 -14
- package/dist/qmd.js +3 -3
- package/dist/resolve-provider-secret.d.ts +5 -1
- package/dist/resolve-provider-secret.js +3 -1
- package/dist/resume-bundles.js +3 -3
- package/dist/schemas.d.ts +22 -22
- package/dist/semantic-consolidation.js +2 -1
- package/dist/summarizer.js +5 -5
- package/dist/tokens.js +2 -1
- package/package.json +1 -1
- package/dist/chunk-ALXMCZEU.js.map +0 -1
- package/dist/chunk-BGJGXLZ7.js.map +0 -1
- package/dist/chunk-BK2EFTE2.js.map +0 -1
- package/dist/chunk-LK6SGL53.js.map +0 -1
- package/dist/chunk-O5ETUNBT.js.map +0 -1
- package/dist/chunk-VYM3VWOF.js.map +0 -1
- package/dist/chunk-WVVA7F5A.js.map +0 -1
- package/dist/chunk-XZ2TIKGC.js.map +0 -1
- /package/dist/{chunk-YNQKWQT4.js.map → chunk-4HQS2HPX.js.map} +0 -0
- /package/dist/{chunk-B5WXLVDY.js.map → chunk-6YJHX2DL.js.map} +0 -0
- /package/dist/{chunk-3GXCSUXR.js.map → chunk-AYXIPSZO.js.map} +0 -0
- /package/dist/{chunk-ZEM3OK2K.js.map → chunk-DG6YMRDC.js.map} +0 -0
- /package/dist/{chunk-S3EEFKNY.js.map → chunk-DIXB44VE.js.map} +0 -0
- /package/dist/{chunk-EPQJM2GC.js.map → chunk-GA5P7RST.js.map} +0 -0
- /package/dist/{chunk-INXV5JBT.js.map → chunk-LOIMBRDE.js.map} +0 -0
- /package/dist/{chunk-7I7FKFZH.js.map → chunk-NBVAS5MT.js.map} +0 -0
- /package/dist/{chunk-HK3FGIEW.js.map → chunk-OC5OXUQ4.js.map} +0 -0
- /package/dist/{chunk-JL2PU6AI.js.map → chunk-R2XRID2N.js.map} +0 -0
- /package/dist/{chunk-GKFXUTJ2.js.map → chunk-STGWEHYR.js.map} +0 -0
- /package/dist/{chunk-KUB6JU6H.js.map → chunk-TMYO7B5P.js.map} +0 -0
- /package/dist/{chunk-DFTTJYSO.js.map → chunk-UWB5LMWY.js.map} +0 -0
- /package/dist/{chunk-RGLL5SPU.js.map → chunk-XXVWLXSG.js.map} +0 -0
- /package/dist/{engine-F3GOXGE5.js.map → engine-72LSIWQP.js.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
resolveConnectorFromToken,
|
|
10
10
|
revokeToken,
|
|
11
11
|
saveTokenStore
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-VTU2B4VF.js";
|
|
13
13
|
import {
|
|
14
14
|
runGraphRecall
|
|
15
15
|
} from "./chunk-DGVM5SFL.js";
|
|
@@ -40,14 +40,14 @@ import {
|
|
|
40
40
|
runBulkImportCliCommand,
|
|
41
41
|
runBulkImportPipeline,
|
|
42
42
|
validateImportTurn
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-LOIMBRDE.js";
|
|
44
44
|
import "./chunk-VDX363PS.js";
|
|
45
|
-
import "./chunk-
|
|
45
|
+
import "./chunk-TMYO7B5P.js";
|
|
46
46
|
import {
|
|
47
47
|
parseXrayBudgetFlag,
|
|
48
48
|
parseXrayCliOptions
|
|
49
49
|
} from "./chunk-PVPWZSSI.js";
|
|
50
|
-
import "./chunk-
|
|
50
|
+
import "./chunk-6YJHX2DL.js";
|
|
51
51
|
import "./chunk-HL4DB7TO.js";
|
|
52
52
|
import "./chunk-ULYOGL6R.js";
|
|
53
53
|
import "./chunk-ZPKBYX2F.js";
|
|
@@ -89,8 +89,8 @@ import {
|
|
|
89
89
|
stableHash,
|
|
90
90
|
validateSlug,
|
|
91
91
|
validateTaxonomy
|
|
92
|
-
} from "./chunk-
|
|
93
|
-
import "./chunk-
|
|
92
|
+
} from "./chunk-3YGHKTBF.js";
|
|
93
|
+
import "./chunk-XXVWLXSG.js";
|
|
94
94
|
import "./chunk-UHGBNIOS.js";
|
|
95
95
|
import "./chunk-FSFEQI74.js";
|
|
96
96
|
import "./chunk-W6SL7OFG.js";
|
|
@@ -98,7 +98,7 @@ import "./chunk-Z5AAYHUC.js";
|
|
|
98
98
|
import "./chunk-S75M5ZRK.js";
|
|
99
99
|
import "./chunk-TPB3I2AC.js";
|
|
100
100
|
import "./chunk-JR4ZC3G4.js";
|
|
101
|
-
import "./chunk-
|
|
101
|
+
import "./chunk-DG6YMRDC.js";
|
|
102
102
|
import "./chunk-ETOW6ACV.js";
|
|
103
103
|
import "./chunk-5NPGSAVB.js";
|
|
104
104
|
import "./chunk-C7VW7C3F.js";
|
|
@@ -148,12 +148,12 @@ import {
|
|
|
148
148
|
} from "./chunk-C4SQJZAF.js";
|
|
149
149
|
import {
|
|
150
150
|
ExtractionEngine
|
|
151
|
-
} from "./chunk-
|
|
151
|
+
} from "./chunk-DIXB44VE.js";
|
|
152
152
|
import "./chunk-NZLQTHS5.js";
|
|
153
153
|
import "./chunk-54V4BZWP.js";
|
|
154
154
|
import "./chunk-NBNN5GOB.js";
|
|
155
155
|
import "./chunk-FEMOX5AD.js";
|
|
156
|
-
import "./chunk-
|
|
156
|
+
import "./chunk-R2XRID2N.js";
|
|
157
157
|
import "./chunk-VEWZZM3H.js";
|
|
158
158
|
import {
|
|
159
159
|
resolveCategory
|
|
@@ -162,7 +162,7 @@ import {
|
|
|
162
162
|
FILTER_LABELS,
|
|
163
163
|
isDirectAnswerEligible
|
|
164
164
|
} from "./chunk-Y4FHOFJ2.js";
|
|
165
|
-
import "./chunk-
|
|
165
|
+
import "./chunk-Z2E7VW55.js";
|
|
166
166
|
import {
|
|
167
167
|
buildEntityRecallSection
|
|
168
168
|
} from "./chunk-FVA6TGI3.js";
|
|
@@ -172,7 +172,7 @@ import {
|
|
|
172
172
|
} from "./chunk-GZCUW5IC.js";
|
|
173
173
|
import {
|
|
174
174
|
expandTildePath
|
|
175
|
-
} from "./chunk-
|
|
175
|
+
} from "./chunk-GA5P7RST.js";
|
|
176
176
|
import "./chunk-PYXS46O7.js";
|
|
177
177
|
import "./chunk-3QKK7QOS.js";
|
|
178
178
|
import "./chunk-CUPFXL3J.js";
|
|
@@ -184,11 +184,11 @@ import {
|
|
|
184
184
|
LanceDbBackend,
|
|
185
185
|
MeilisearchBackend,
|
|
186
186
|
OramaBackend
|
|
187
|
-
} from "./chunk-
|
|
187
|
+
} from "./chunk-NBVAS5MT.js";
|
|
188
188
|
import "./chunk-YRMVARQP.js";
|
|
189
189
|
import {
|
|
190
190
|
QmdClient
|
|
191
|
-
} from "./chunk-
|
|
191
|
+
} from "./chunk-4HQS2HPX.js";
|
|
192
192
|
import {
|
|
193
193
|
LEGACY_PLUGIN_ID,
|
|
194
194
|
PLUGIN_ID,
|
|
@@ -198,13 +198,15 @@ import "./chunk-EABGC2TL.js";
|
|
|
198
198
|
import "./chunk-LOBRX7VD.js";
|
|
199
199
|
import "./chunk-HMDCOMYU.js";
|
|
200
200
|
import "./chunk-JXS5PDQ7.js";
|
|
201
|
-
import
|
|
201
|
+
import {
|
|
202
|
+
launchProcessSync
|
|
203
|
+
} from "./chunk-OR64ZGRZ.js";
|
|
202
204
|
import "./chunk-7SEAZFFB.js";
|
|
203
205
|
import "./chunk-K6WK37A6.js";
|
|
204
206
|
import {
|
|
205
207
|
coerceInstallExtension,
|
|
206
208
|
parseConfig
|
|
207
|
-
} from "./chunk-
|
|
209
|
+
} from "./chunk-BECYBZLX.js";
|
|
208
210
|
import "./chunk-Z5LAYHGJ.js";
|
|
209
211
|
import "./chunk-C6QPK5GG.js";
|
|
210
212
|
import "./chunk-C2EFFULQ.js";
|
|
@@ -227,7 +229,7 @@ import {
|
|
|
227
229
|
materializeForNamespace,
|
|
228
230
|
runCodexMaterialize,
|
|
229
231
|
runPostConsolidationMaterialize
|
|
230
|
-
} from "./chunk-
|
|
232
|
+
} from "./chunk-PVICZTKG.js";
|
|
231
233
|
import {
|
|
232
234
|
REMNIC_EXTENSIONS_TOTAL_TOKEN_LIMIT,
|
|
233
235
|
discoverMemoryExtensions,
|
|
@@ -237,8 +239,8 @@ import {
|
|
|
237
239
|
} from "./chunk-EJI5XIBB.js";
|
|
238
240
|
import {
|
|
239
241
|
FallbackLlmClient
|
|
240
|
-
} from "./chunk-
|
|
241
|
-
import "./chunk-
|
|
242
|
+
} from "./chunk-AYXIPSZO.js";
|
|
243
|
+
import "./chunk-Y7R2XJ5Q.js";
|
|
242
244
|
import "./chunk-ODWDQNRE.js";
|
|
243
245
|
import "./chunk-Y27UJK6V.js";
|
|
244
246
|
import "./chunk-UZB5KHKX.js";
|
|
@@ -253,23 +255,22 @@ import "./chunk-PVGDJXVK.js";
|
|
|
253
255
|
import "./chunk-NGAVDO7E.js";
|
|
254
256
|
import {
|
|
255
257
|
EngramAccessHttpServer
|
|
256
|
-
} from "./chunk-
|
|
258
|
+
} from "./chunk-UWB5LMWY.js";
|
|
257
259
|
import {
|
|
258
260
|
EngramMcpServer
|
|
259
|
-
} from "./chunk-
|
|
261
|
+
} from "./chunk-OC5OXUQ4.js";
|
|
260
262
|
import {
|
|
261
263
|
buildCitationGuidance,
|
|
262
264
|
formatOaiMemCitation,
|
|
263
265
|
parseOaiMemCitation,
|
|
264
266
|
sanitizeNoteForCitation
|
|
265
267
|
} from "./chunk-IQT3XTKW.js";
|
|
266
|
-
import "./chunk-MARWOCVP.js";
|
|
267
268
|
import {
|
|
268
269
|
EngramAccessInputError,
|
|
269
270
|
EngramAccessService,
|
|
270
271
|
computeProcedureStats,
|
|
271
272
|
formatProcedureStatsText
|
|
272
|
-
} from "./chunk-
|
|
273
|
+
} from "./chunk-STGWEHYR.js";
|
|
273
274
|
import {
|
|
274
275
|
RECALL_XRAY_FORMATS,
|
|
275
276
|
parseXrayFormat,
|
|
@@ -316,7 +317,7 @@ import {
|
|
|
316
317
|
renderBriefingMarkdown,
|
|
317
318
|
resolveBriefingSaveDir,
|
|
318
319
|
validateBriefingFormat
|
|
319
|
-
} from "./chunk-
|
|
320
|
+
} from "./chunk-L7IXWRYE.js";
|
|
320
321
|
import {
|
|
321
322
|
StorageManager
|
|
322
323
|
} from "./chunk-F5VP6YCB.js";
|
|
@@ -348,6 +349,11 @@ import {
|
|
|
348
349
|
listVersions,
|
|
349
350
|
revertToVersion
|
|
350
351
|
} from "./chunk-FAAFWE4G.js";
|
|
352
|
+
import {
|
|
353
|
+
mergeEnv,
|
|
354
|
+
readEnvVar,
|
|
355
|
+
resolveHomeDir
|
|
356
|
+
} from "./chunk-MARWOCVP.js";
|
|
351
357
|
import {
|
|
352
358
|
initLogger,
|
|
353
359
|
log
|
|
@@ -2435,7 +2441,6 @@ function hashContent3(content) {
|
|
|
2435
2441
|
import fs8 from "fs";
|
|
2436
2442
|
import path13 from "path";
|
|
2437
2443
|
import os from "os";
|
|
2438
|
-
import { spawnSync } from "child_process";
|
|
2439
2444
|
import { createRequire } from "module";
|
|
2440
2445
|
import { fileURLToPath } from "url";
|
|
2441
2446
|
|
|
@@ -2984,7 +2989,8 @@ var BUILTIN_CONNECTORS = [
|
|
|
2984
2989
|
];
|
|
2985
2990
|
var REGISTRY_DIR_NAME = ".engram-connectors";
|
|
2986
2991
|
function getRegistryPath() {
|
|
2987
|
-
const
|
|
2992
|
+
const xdgConfigHome = readEnvVar("XDG_CONFIG_HOME");
|
|
2993
|
+
const configDir = xdgConfigHome ? path13.join(xdgConfigHome, "engram") : path13.join(resolveHomeDir(), ".config", "engram");
|
|
2988
2994
|
return path13.join(configDir, REGISTRY_DIR_NAME, "registry.json");
|
|
2989
2995
|
}
|
|
2990
2996
|
function loadRegistry() {
|
|
@@ -3723,7 +3729,7 @@ function sanitizeHermesProfile(profile) {
|
|
|
3723
3729
|
}
|
|
3724
3730
|
function hermesConfigPath(profile) {
|
|
3725
3731
|
const safeProfile = sanitizeHermesProfile(profile);
|
|
3726
|
-
const profilesRoot = path13.resolve(
|
|
3732
|
+
const profilesRoot = path13.resolve(resolveHomeDir(), ".hermes", "profiles");
|
|
3727
3733
|
const cfgPath = path13.resolve(profilesRoot, safeProfile, "config.yaml");
|
|
3728
3734
|
const rel = path13.relative(profilesRoot, cfgPath);
|
|
3729
3735
|
if (rel.startsWith("..") || path13.isAbsolute(rel)) {
|
|
@@ -3921,13 +3927,14 @@ function checkDaemonHealth(host, port, authToken) {
|
|
|
3921
3927
|
const bareHost = host.startsWith("[") && host.endsWith("]") ? host.slice(1, -1) : host;
|
|
3922
3928
|
const script = [
|
|
3923
3929
|
"const http = require('http');",
|
|
3930
|
+
"const env = process['env'];",
|
|
3924
3931
|
"const headers = {};",
|
|
3925
|
-
"if (
|
|
3926
|
-
" headers['authorization'] = 'Bearer ' +
|
|
3932
|
+
"if (env.REMNIC_HEALTH_TOKEN) {",
|
|
3933
|
+
" headers['authorization'] = 'Bearer ' + env.REMNIC_HEALTH_TOKEN;",
|
|
3927
3934
|
"}",
|
|
3928
3935
|
"const req = http.get({",
|
|
3929
|
-
" host:
|
|
3930
|
-
" port: parseInt(
|
|
3936
|
+
" host: env.REMNIC_HEALTH_HOST,",
|
|
3937
|
+
" port: parseInt(env.REMNIC_HEALTH_PORT, 10),",
|
|
3931
3938
|
" path: '/engram/v1/health',",
|
|
3932
3939
|
" headers,",
|
|
3933
3940
|
" timeout: 3000,",
|
|
@@ -3935,16 +3942,16 @@ function checkDaemonHealth(host, port, authToken) {
|
|
|
3935
3942
|
"req.on('error', () => process.exit(1));",
|
|
3936
3943
|
"req.on('timeout', () => { req.destroy(); process.exit(1); });"
|
|
3937
3944
|
].join("\n");
|
|
3938
|
-
const env = {
|
|
3939
|
-
...process.env,
|
|
3945
|
+
const env = mergeEnv({
|
|
3940
3946
|
REMNIC_HEALTH_HOST: bareHost,
|
|
3941
3947
|
REMNIC_HEALTH_PORT: String(safePort)
|
|
3942
|
-
};
|
|
3948
|
+
});
|
|
3943
3949
|
if (authToken) {
|
|
3944
3950
|
env.REMNIC_HEALTH_TOKEN = authToken;
|
|
3945
3951
|
}
|
|
3946
|
-
const
|
|
3947
|
-
const
|
|
3952
|
+
const processPath = process.execPath;
|
|
3953
|
+
const launchOptions = { timeout: 4e3, env };
|
|
3954
|
+
const result = launchProcessSync(processPath, ["-e", script], launchOptions);
|
|
3948
3955
|
if (result.status === HEALTH_EXIT_OK) {
|
|
3949
3956
|
return true;
|
|
3950
3957
|
}
|
|
@@ -3952,11 +3959,11 @@ function checkDaemonHealth(host, port, authToken) {
|
|
|
3952
3959
|
console.error(
|
|
3953
3960
|
"[remnic/connectors] health probe got 401 \u2014 retrying after token cache TTL..."
|
|
3954
3961
|
);
|
|
3955
|
-
|
|
3962
|
+
launchProcessSync(processPath, ["-e", "setTimeout(() => {}, 6000)"], {
|
|
3956
3963
|
timeout: 7e3,
|
|
3957
3964
|
env: {}
|
|
3958
3965
|
});
|
|
3959
|
-
const retry =
|
|
3966
|
+
const retry = launchProcessSync(processPath, ["-e", script], launchOptions);
|
|
3960
3967
|
return retry.status === HEALTH_EXIT_OK;
|
|
3961
3968
|
}
|
|
3962
3969
|
return false;
|
|
@@ -4022,11 +4029,11 @@ function resolveCodexHome(override) {
|
|
|
4022
4029
|
if (override && typeof override === "string" && override.trim().length > 0) {
|
|
4023
4030
|
return path13.resolve(override.trim());
|
|
4024
4031
|
}
|
|
4025
|
-
const envHome =
|
|
4032
|
+
const envHome = readEnvVar("CODEX_HOME");
|
|
4026
4033
|
if (envHome && envHome.trim().length > 0) {
|
|
4027
4034
|
return path13.resolve(envHome.trim());
|
|
4028
4035
|
}
|
|
4029
|
-
const home =
|
|
4036
|
+
const home = readEnvVar("HOME") || readEnvVar("USERPROFILE") || resolveHomeDir();
|
|
4030
4037
|
return path13.resolve(home, ".codex");
|
|
4031
4038
|
}
|
|
4032
4039
|
function resolveCodexMemoryExtensionPaths(codexHomeOverride) {
|
|
@@ -4240,17 +4247,18 @@ function removeCodexMemoryExtension(options = {}) {
|
|
|
4240
4247
|
return { ...paths, removed };
|
|
4241
4248
|
}
|
|
4242
4249
|
function getConnectorsDir() {
|
|
4243
|
-
const
|
|
4250
|
+
const xdgConfigHome = readEnvVar("XDG_CONFIG_HOME");
|
|
4251
|
+
const configDir = xdgConfigHome ? path13.join(xdgConfigHome, "engram") : path13.join(resolveHomeDir(), ".config", "engram");
|
|
4244
4252
|
return path13.join(configDir, REGISTRY_DIR_NAME, "connectors");
|
|
4245
4253
|
}
|
|
4246
4254
|
var WECLONE_PROXY_CONFIG_DIRNAME = ".remnic";
|
|
4247
4255
|
var WECLONE_PROXY_CONFIG_FILENAME = "weclone.json";
|
|
4248
4256
|
function resolveWeCloneProxyConfigPath() {
|
|
4249
|
-
const override =
|
|
4257
|
+
const override = readEnvVar("REMNIC_HOME") ?? readEnvVar("ENGRAM_HOME");
|
|
4250
4258
|
if (override && override.length > 0) {
|
|
4251
4259
|
return path13.resolve(override, "connectors", WECLONE_PROXY_CONFIG_FILENAME);
|
|
4252
4260
|
}
|
|
4253
|
-
const envHome =
|
|
4261
|
+
const envHome = readEnvVar("HOME");
|
|
4254
4262
|
const home = envHome && envHome.length > 0 ? envHome : os.homedir();
|
|
4255
4263
|
return path13.resolve(
|
|
4256
4264
|
home,
|
|
@@ -4387,7 +4395,7 @@ import path14 from "path";
|
|
|
4387
4395
|
import crypto6 from "crypto";
|
|
4388
4396
|
var MANIFEST_VERSION = 1;
|
|
4389
4397
|
function getSpacesDir(baseDir) {
|
|
4390
|
-
const homeDir = baseDir ??
|
|
4398
|
+
const homeDir = baseDir ?? resolveHomeDir();
|
|
4391
4399
|
return path14.join(homeDir, ".config", "engram", "spaces");
|
|
4392
4400
|
}
|
|
4393
4401
|
function getManifestPath(baseDir) {
|
|
@@ -4414,10 +4422,10 @@ function saveManifest(manifest, baseDir) {
|
|
|
4414
4422
|
fs9.writeFileSync(manifestPath2, JSON.stringify(manifest, null, 2) + "\n");
|
|
4415
4423
|
}
|
|
4416
4424
|
function createPersonalSpace(baseDir, memoryDirOverride) {
|
|
4417
|
-
const homeDir = baseDir ??
|
|
4425
|
+
const homeDir = baseDir ?? resolveHomeDir();
|
|
4418
4426
|
const standalonePath = path14.join(homeDir, ".engram", "memory");
|
|
4419
4427
|
const openclawPath = path14.join(homeDir, ".openclaw", "workspace", "memory", "local");
|
|
4420
|
-
const memoryDir = memoryDirOverride ??
|
|
4428
|
+
const memoryDir = memoryDirOverride ?? readEnvVar("ENGRAM_MEMORY_DIR") ?? (fs9.existsSync(standalonePath) ? standalonePath : fs9.existsSync(openclawPath) ? openclawPath : standalonePath);
|
|
4421
4429
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
4422
4430
|
return {
|
|
4423
4431
|
id: "personal",
|
|
@@ -4427,7 +4435,7 @@ function createPersonalSpace(baseDir, memoryDirOverride) {
|
|
|
4427
4435
|
memoryDir,
|
|
4428
4436
|
createdAt: now,
|
|
4429
4437
|
updatedAt: now,
|
|
4430
|
-
owner:
|
|
4438
|
+
owner: readEnvVar("USER")
|
|
4431
4439
|
};
|
|
4432
4440
|
}
|
|
4433
4441
|
function listSpaces(baseDir) {
|
|
@@ -4463,7 +4471,7 @@ function createSpace(options) {
|
|
|
4463
4471
|
memoryDir,
|
|
4464
4472
|
createdAt: now,
|
|
4465
4473
|
updatedAt: now,
|
|
4466
|
-
owner:
|
|
4474
|
+
owner: readEnvVar("USER"),
|
|
4467
4475
|
parentSpaceId: options.parentSpaceId
|
|
4468
4476
|
};
|
|
4469
4477
|
fs9.mkdirSync(memoryDir, { recursive: true });
|
|
@@ -4847,13 +4855,12 @@ var CodexMemoryExtensionPublisher = class {
|
|
|
4847
4855
|
readPathTemplate: true
|
|
4848
4856
|
};
|
|
4849
4857
|
async resolveExtensionRoot(env) {
|
|
4850
|
-
const
|
|
4851
|
-
const codexHome = e.CODEX_HOME?.trim() || path15.join(e.HOME ?? os2.homedir(), ".codex");
|
|
4858
|
+
const codexHome = env === void 0 ? readEnvVar("CODEX_HOME")?.trim() || path15.join(resolveHomeDir(), ".codex") : env.CODEX_HOME?.trim() || path15.join(env.HOME ?? env.USERPROFILE ?? os2.homedir(), ".codex");
|
|
4852
4859
|
return path15.join(codexHome, "memories_extensions", REMNIC_EXTENSION_DIR_NAME2);
|
|
4853
4860
|
}
|
|
4854
4861
|
async isHostAvailable() {
|
|
4855
4862
|
try {
|
|
4856
|
-
const home =
|
|
4863
|
+
const home = readEnvVar("CODEX_HOME")?.trim() || path15.join(resolveHomeDir(), ".codex");
|
|
4857
4864
|
return fs10.existsSync(home);
|
|
4858
4865
|
} catch {
|
|
4859
4866
|
return false;
|