@futdevpro/fdp-agent-memory 1.1.12 → 1.1.21

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.
@@ -12,7 +12,10 @@ const errors_controller_1 = require("./_routes/server/errors/errors.controller")
12
12
  const errors_control_service_1 = require("./_routes/server/errors/errors.control-service");
13
13
  const server_status_controller_1 = require("./_routes/server/server-status/server-status.controller");
14
14
  const embedding_1 = require("./_modules/embedding");
15
+ const config_control_service_1 = require("./_routes/server/config/config.control-service");
16
+ const fam_heap_guard_control_service_1 = require("./_collections/fam-heap-guard.control-service");
15
17
  const environment_1 = require("./environments/environment");
18
+ const title_const_1 = require("./_collections/title.const");
16
19
  /**
17
20
  * FDP Agent Memory Server App — Pure Dynamo, **AUTH NÉLKÜL** (ADR-004).
18
21
  *
@@ -32,6 +35,7 @@ class App extends nts_dynamo_1.DyNTS_App {
32
35
  const mongoBase = process.env.MONGODB_URI || process.env.MONGO_URL || 'mongodb://0.0.0.0:29017';
33
36
  return new nts_dynamo_1.DyNTS_App_Params({
34
37
  name: 'FDP Agent Memory Server',
38
+ title: title_const_1.FAM_title,
35
39
  version: package_json_1.version,
36
40
  dbName: dbName,
37
41
  dbUri: `${mongoBase}/${dbName}`,
@@ -40,7 +44,7 @@ class App extends nts_dynamo_1.DyNTS_App {
40
44
  }
41
45
  overrideDynamoNTSGlobalSettings() {
42
46
  nts_dynamo_1.DyNTS_global_settings.log_settings.api_errors = false;
43
- nts_dynamo_1.DyNTS_global_settings.log_settings.setup = true;
47
+ //DyNTS_global_settings.log_settings.setup = true;
44
48
  // NINCS JWT/auth check (ADR-004): a szerver lokális, single-user. Az auth-t EXPLICITEN
45
49
  // opcionálisnak jelöljük → elnémítja a minden booton megjelenő „Unique Authentication Service
46
50
  // missing!" figyelmeztetést (a no-auth a SZÁNDÉK, nem hiányosság).
@@ -115,7 +119,33 @@ class App extends nts_dynamo_1.DyNTS_App {
115
119
  * át, amit a write/scan path (MP-4/MP-5) hív mentés után. Lásd a `_modules/embedding` modul-doksit.
116
120
  */
117
121
  async postProcess() {
122
+ // Heap-guard (OOM-hibakezelés) — a DB/config UTÁN, a (memória-igényes) pool-hidratálás ELŐTT telepítve, hogy
123
+ // a boot-növekedést is figyelje. A küszöbök a config-ból (memory.*), majd crash-handler + watchdog. Best-effort.
124
+ await this.installHeapGuard();
118
125
  await embedding_1.FAM_EmbeddingBootstrap_ControlService.getInstance().boot();
126
+ fsm_dynamo_1.DyFM_Log.S_info(`UI is available at: localhost:${environment_1.env.httpPort}/api/app`);
127
+ }
128
+ /** A heap-guard küszöbeinek beolvasása a config-ból + telepítés. A config-hiba NEM buktatja a bootot (default-ok). */
129
+ async installHeapGuard() {
130
+ try {
131
+ const config = config_control_service_1.FAM_Config_ControlService.getInstance();
132
+ const num = async (key) => {
133
+ const resolved = await config.resolve(key, {});
134
+ return typeof resolved.value === 'number' ? resolved.value : undefined;
135
+ };
136
+ const enabledResolved = await config.resolve('memory.guardEnabled', {});
137
+ fam_heap_guard_control_service_1.FAM_HeapGuard_ControlService.getInstance().configure({
138
+ enabled: typeof enabledResolved.value === 'boolean' ? enabledResolved.value : undefined,
139
+ warnRatio: await num('memory.warnRatio'),
140
+ shedRatio: await num('memory.shedRatio'),
141
+ exitRatio: await num('memory.exitRatio'),
142
+ pollMs: await num('memory.pollMs'),
143
+ });
144
+ }
145
+ catch (error) {
146
+ fsm_dynamo_1.DyFM_Log.warn(`[heap-guard] config-olvasás sikertelen, default küszöbök: ${error?.message}`);
147
+ }
148
+ fam_heap_guard_control_service_1.FAM_HeapGuard_ControlService.getInstance().install();
119
149
  }
120
150
  getGlobalErrorHandler() {
121
151
  return async (err, req, res, issuer) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@futdevpro/fdp-agent-memory",
3
- "version": "1.1.12",
3
+ "version": "1.1.21",
4
4
  "description": "Local-first, vector-backed multi-table agent memory exposed as an MCP server (read/write/capabilities). Public, FDP-Templates-free, no auth.",
5
5
  "private": false,
6
6
  "publishConfig": {