@shahmilsaari/memory-core 1.0.18 → 1.0.19
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.
|
@@ -129,8 +129,8 @@ function getChatConfig() {
|
|
|
129
129
|
};
|
|
130
130
|
}
|
|
131
131
|
function getDefaultTimeoutMs() {
|
|
132
|
-
const raw = Number(process.env.CHAT_TIMEOUT_MS ??
|
|
133
|
-
return Number.isFinite(raw) && raw > 0 ? Math.floor(raw) :
|
|
132
|
+
const raw = Number(process.env.CHAT_TIMEOUT_MS ?? 6e4);
|
|
133
|
+
return Number.isFinite(raw) && raw > 0 ? Math.floor(raw) : 6e4;
|
|
134
134
|
}
|
|
135
135
|
function timeoutSignal(timeoutMs) {
|
|
136
136
|
return AbortSignal.timeout(timeoutMs ?? getDefaultTimeoutMs());
|
package/dist/cli.js
CHANGED
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
retrieveMemorySelection,
|
|
21
21
|
runMigrations,
|
|
22
22
|
seeds
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-VQEIQHK6.js";
|
|
24
24
|
|
|
25
25
|
// src/cli.ts
|
|
26
26
|
import { Command } from "commander";
|
|
@@ -1385,6 +1385,9 @@ function getEnvPath() {
|
|
|
1385
1385
|
const dotEnv = join3(process.cwd(), ".env");
|
|
1386
1386
|
return existsSync3(dotEnv) ? dotEnv : memoryEnv;
|
|
1387
1387
|
}
|
|
1388
|
+
function getWriteEnvPath() {
|
|
1389
|
+
return join3(process.cwd(), ".memory-core.env");
|
|
1390
|
+
}
|
|
1388
1391
|
function parseEnvFile(raw) {
|
|
1389
1392
|
const lines = raw.split(/\r?\n/);
|
|
1390
1393
|
const values = {};
|
|
@@ -1408,9 +1411,9 @@ function readRuntimeEnv() {
|
|
|
1408
1411
|
for (const [key, value] of Object.entries(process.env)) {
|
|
1409
1412
|
if (typeof value === "string" && value !== "") values[key] = value;
|
|
1410
1413
|
}
|
|
1411
|
-
return { envPath, values };
|
|
1414
|
+
return { envPath: getWriteEnvPath(), values };
|
|
1412
1415
|
}
|
|
1413
|
-
function writeRuntimeEnv(values, envPath =
|
|
1416
|
+
function writeRuntimeEnv(values, envPath = getWriteEnvPath()) {
|
|
1414
1417
|
const orderedKeys = [
|
|
1415
1418
|
"DATABASE_URL",
|
|
1416
1419
|
"OLLAMA_URL",
|
|
@@ -1443,15 +1446,6 @@ function applyRuntimeEnv(values) {
|
|
|
1443
1446
|
process.env[key] = value;
|
|
1444
1447
|
}
|
|
1445
1448
|
}
|
|
1446
|
-
function ensureEnvFileIgnored(envPath = getEnvPath()) {
|
|
1447
|
-
const envFileName = envPath.split("/").pop() ?? ".memory-core.env";
|
|
1448
|
-
const gitignorePath = join3(process.cwd(), ".gitignore");
|
|
1449
|
-
const existing = existsSync3(gitignorePath) ? readFileSync3(gitignorePath, "utf-8") : "";
|
|
1450
|
-
if (!existing.includes(envFileName)) {
|
|
1451
|
-
appendFileSync(gitignorePath, `${existing ? "\n" : ""}${envFileName}
|
|
1452
|
-
`);
|
|
1453
|
-
}
|
|
1454
|
-
}
|
|
1455
1449
|
function appendMissingGitignoreEntries(entries, heading) {
|
|
1456
1450
|
const gitignorePath = join3(process.cwd(), ".gitignore");
|
|
1457
1451
|
const existing = existsSync3(gitignorePath) ? readFileSync3(gitignorePath, "utf-8") : "";
|
|
@@ -1970,7 +1964,7 @@ program.command("init").description("Initialize memory-core in the current proje
|
|
|
1970
1964
|
};
|
|
1971
1965
|
writeRuntimeEnv(envValues, envPath);
|
|
1972
1966
|
applyRuntimeEnv(envValues);
|
|
1973
|
-
|
|
1967
|
+
appendMissingGitignoreEntries(LOCAL_STATE_FILES, GITIGNORE_HEADING);
|
|
1974
1968
|
console.log(chalk2.green(" \u2713 .memory-core.env created with local defaults"));
|
|
1975
1969
|
} else if (!hasEnv) {
|
|
1976
1970
|
console.log(chalk2.dim(" No .memory-core.env found \u2014 let's set up your connection.\n"));
|
|
@@ -2118,7 +2112,7 @@ program.command("init").description("Initialize memory-core in the current proje
|
|
|
2118
2112
|
if (chatApiKey) envValues.CHAT_API_KEY = chatApiKey;
|
|
2119
2113
|
writeRuntimeEnv(envValues, envPath);
|
|
2120
2114
|
applyRuntimeEnv(envValues);
|
|
2121
|
-
|
|
2115
|
+
appendMissingGitignoreEntries(LOCAL_STATE_FILES, GITIGNORE_HEADING);
|
|
2122
2116
|
console.log(chalk2.green("\n \u2713 .memory-core.env created"));
|
|
2123
2117
|
console.log(chalk2.gray(" Added to .gitignore \u2014 your DB credentials stay local.\n"));
|
|
2124
2118
|
} else {
|
|
@@ -2954,7 +2948,7 @@ program.command("dashboard").description("Start the live Svelte dashboard with W
|
|
|
2954
2948
|
}
|
|
2955
2949
|
return void 0;
|
|
2956
2950
|
};
|
|
2957
|
-
const { startDashboard } = await import("./dashboard-server-
|
|
2951
|
+
const { startDashboard } = await import("./dashboard-server-ZERRHWQS.js");
|
|
2958
2952
|
await startDashboard({
|
|
2959
2953
|
port: parseInt(opts.port, 10),
|
|
2960
2954
|
path: resolveDashboardPath(),
|
|
@@ -3162,7 +3156,7 @@ provider.command("set <name>").description("Set the code-checking provider (olla
|
|
|
3162
3156
|
}
|
|
3163
3157
|
writeRuntimeEnv(values, runtimeEnv.envPath);
|
|
3164
3158
|
applyRuntimeEnv(values);
|
|
3165
|
-
|
|
3159
|
+
appendMissingGitignoreEntries(LOCAL_STATE_FILES, GITIGNORE_HEADING);
|
|
3166
3160
|
console.log(chalk2.green(`Updated provider: ${providerName}`));
|
|
3167
3161
|
console.log(chalk2.gray(` Chat model: ${getConfiguredChatModel(values)}`));
|
|
3168
3162
|
} catch (err) {
|
|
@@ -3187,7 +3181,7 @@ model.command("set <name>").description("Set the chat model used for code checki
|
|
|
3187
3181
|
values.OLLAMA_MODEL = values.OLLAMA_MODEL ?? DEFAULT_EMBEDDING_MODEL;
|
|
3188
3182
|
writeRuntimeEnv(values, runtimeEnv.envPath);
|
|
3189
3183
|
applyRuntimeEnv(values);
|
|
3190
|
-
|
|
3184
|
+
appendMissingGitignoreEntries(LOCAL_STATE_FILES, GITIGNORE_HEADING);
|
|
3191
3185
|
console.log(chalk2.green(`Updated ${opts.embedding ? "embedding" : "chat"} model: ${name}`));
|
|
3192
3186
|
console.log(chalk2.gray(` Provider: ${providerName}`));
|
|
3193
3187
|
} catch (err) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shahmilsaari/memory-core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.19",
|
|
4
4
|
"description": "Universal AI memory core — generate AI context files from architecture profiles with RAG support",
|
|
5
5
|
"homepage": "https://memory-core.shahmilsaari.my/",
|
|
6
6
|
"type": "module",
|