@futdevpro/nts-dynamo 1.15.58 → 1.15.64

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.
Files changed (108) hide show
  1. package/.dynamo/logs/cicd-pipeline/output.log +1746 -1819
  2. package/.dynamo/logs/cicd-pipeline/status.json +37 -37
  3. package/.github/workflows/main.yml +432 -426
  4. package/build/_collections/global-settings.const.d.ts.map +1 -1
  5. package/build/_collections/global-settings.const.js +6 -0
  6. package/build/_collections/global-settings.const.js.map +1 -1
  7. package/build/_collections/mongo-reconnect-guard.util.d.ts +74 -0
  8. package/build/_collections/mongo-reconnect-guard.util.d.ts.map +1 -0
  9. package/build/_collections/mongo-reconnect-guard.util.js +111 -0
  10. package/build/_collections/mongo-reconnect-guard.util.js.map +1 -0
  11. package/build/_models/interfaces/global-settings.interface.d.ts +21 -0
  12. package/build/_models/interfaces/global-settings.interface.d.ts.map +1 -1
  13. package/build/_modules/ai/_modules/document-ai/_collections/dai-code-chunking.util.d.ts.map +1 -1
  14. package/build/_modules/ai/_modules/document-ai/_collections/dai-code-chunking.util.js +2 -2
  15. package/build/_modules/ai/_modules/document-ai/_collections/dai-code-chunking.util.js.map +1 -1
  16. package/build/_modules/ai/_services/ai-embedding-mock.service.d.ts +1 -1
  17. package/build/_modules/ai/_services/ai-embedding-mock.service.d.ts.map +1 -1
  18. package/build/_modules/ai/_services/ai-embedding-mock.service.js.map +1 -1
  19. package/build/_modules/ai/_services/ai-embedding-provider.registry.d.ts.map +1 -1
  20. package/build/_modules/ai/_services/ai-embedding-provider.registry.js.map +1 -1
  21. package/build/_modules/ai/_services/lmstudio-embedding.control-service.d.ts +1 -1
  22. package/build/_modules/ai/_services/lmstudio-embedding.control-service.d.ts.map +1 -1
  23. package/build/_modules/ai/_services/lmstudio-embedding.control-service.js +3 -3
  24. package/build/_modules/ai/_services/lmstudio-embedding.control-service.js.map +1 -1
  25. package/build/_modules/ai/index.d.ts +2 -0
  26. package/build/_modules/ai/index.d.ts.map +1 -1
  27. package/build/_modules/ai/index.js +4 -0
  28. package/build/_modules/ai/index.js.map +1 -1
  29. package/build/_modules/data-readers/_collections/dynts-sqlite-reader.util.d.ts +17 -17
  30. package/build/_modules/data-readers/_collections/dynts-sqlite-reader.util.d.ts.map +1 -1
  31. package/build/_modules/data-readers/_collections/dynts-sqlite-reader.util.js +21 -21
  32. package/build/_modules/data-readers/_collections/dynts-sqlite-reader.util.js.map +1 -1
  33. package/build/_modules/local-vector-search/_models/data-models/lvs-vector-persist.data-model.d.ts +4 -4
  34. package/build/_modules/local-vector-search/_models/data-models/lvs-vector-persist.data-model.d.ts.map +1 -1
  35. package/build/_modules/local-vector-search/_models/data-models/lvs-vector-persist.data-model.js +5 -5
  36. package/build/_modules/local-vector-search/_models/data-models/lvs-vector-persist.data-model.js.map +1 -1
  37. package/build/_modules/local-vector-search/_services/lvs-persistent-vector-pool.control-service.d.ts +4 -4
  38. package/build/_modules/local-vector-search/_services/lvs-persistent-vector-pool.control-service.d.ts.map +1 -1
  39. package/build/_modules/local-vector-search/_services/lvs-persistent-vector-pool.control-service.js +4 -4
  40. package/build/_modules/local-vector-search/_services/lvs-persistent-vector-pool.control-service.js.map +1 -1
  41. package/build/_modules/local-vector-search/_services/lvs-vector-persist.data-service.d.ts +6 -6
  42. package/build/_modules/local-vector-search/_services/lvs-vector-persist.data-service.d.ts.map +1 -1
  43. package/build/_modules/local-vector-search/_services/lvs-vector-persist.data-service.js +5 -5
  44. package/build/_modules/local-vector-search/_services/lvs-vector-persist.data-service.js.map +1 -1
  45. package/build/_modules/mcp/_models/interfaces/dynts-mcp.interface.d.ts +1 -1
  46. package/build/_modules/mcp/_models/interfaces/dynts-mcp.interface.js +1 -1
  47. package/build/_modules/mcp/_services/dynts-mcp-server.service-base.d.ts +4 -4
  48. package/build/_modules/mcp/_services/dynts-mcp-server.service-base.d.ts.map +1 -1
  49. package/build/_modules/mcp/_services/dynts-mcp-server.service-base.js +6 -6
  50. package/build/_modules/mcp/_services/dynts-mcp-server.service-base.js.map +1 -1
  51. package/build/_modules/mcp/_services/dynts-mcp.adapter.d.ts +11 -11
  52. package/build/_modules/mcp/_services/dynts-mcp.adapter.d.ts.map +1 -1
  53. package/build/_modules/mcp/_services/dynts-mcp.adapter.js +16 -11
  54. package/build/_modules/mcp/_services/dynts-mcp.adapter.js.map +1 -1
  55. package/build/_modules/mcp/index.js +1 -1
  56. package/build/_modules/mcp/index.js.map +1 -1
  57. package/build/_modules/scoped-config/_models/data-models/dynts-scoped-config.data-model.d.ts +3 -3
  58. package/build/_modules/scoped-config/_models/data-models/dynts-scoped-config.data-model.d.ts.map +1 -1
  59. package/build/_modules/scoped-config/_models/data-models/dynts-scoped-config.data-model.js +4 -4
  60. package/build/_modules/scoped-config/_models/data-models/dynts-scoped-config.data-model.js.map +1 -1
  61. package/build/_modules/scoped-config/_models/interfaces/dynts-scoped-config.interface.d.ts.map +1 -1
  62. package/build/_modules/scoped-config/_models/interfaces/dynts-scoped-config.interface.js +9 -0
  63. package/build/_modules/scoped-config/_models/interfaces/dynts-scoped-config.interface.js.map +1 -1
  64. package/build/_modules/scoped-config/_services/dynts-scoped-config.control-service.d.ts +3 -3
  65. package/build/_modules/scoped-config/_services/dynts-scoped-config.control-service.d.ts.map +1 -1
  66. package/build/_modules/scoped-config/_services/dynts-scoped-config.control-service.js +1 -1
  67. package/build/_modules/scoped-config/_services/dynts-scoped-config.control-service.js.map +1 -1
  68. package/build/_modules/scoped-config/_services/dynts-scoped-config.data-service.d.ts +7 -7
  69. package/build/_modules/scoped-config/_services/dynts-scoped-config.data-service.d.ts.map +1 -1
  70. package/build/_modules/scoped-config/_services/dynts-scoped-config.data-service.js +2 -2
  71. package/build/_modules/scoped-config/_services/dynts-scoped-config.data-service.js.map +1 -1
  72. package/build/_services/core/global.service.d.ts.map +1 -1
  73. package/build/_services/core/global.service.js +15 -2
  74. package/build/_services/core/global.service.js.map +1 -1
  75. package/build/_services/server/app.server.d.ts.map +1 -1
  76. package/build/_services/server/app.server.js +21 -0
  77. package/build/_services/server/app.server.js.map +1 -1
  78. package/package.json +1 -1
  79. package/src/_collections/global-settings.const.ts +7 -0
  80. package/src/_collections/mongo-reconnect-guard.util.spec.ts +52 -0
  81. package/src/_collections/mongo-reconnect-guard.util.ts +172 -0
  82. package/src/_models/interfaces/global-settings.interface.ts +22 -0
  83. package/src/_modules/ai/_modules/document-ai/_collections/dai-code-chunking.util.ts +39 -7
  84. package/src/_modules/ai/_services/ai-embedding-mock.service.ts +18 -4
  85. package/src/_modules/ai/_services/ai-embedding-provider.registry.ts +4 -0
  86. package/src/_modules/ai/_services/lmstudio-embedding.control-service.ts +26 -5
  87. package/src/_modules/ai/index.ts +5 -0
  88. package/src/_modules/data-readers/_collections/dynts-sqlite-reader.util.spec.ts +145 -130
  89. package/src/_modules/data-readers/_collections/dynts-sqlite-reader.util.ts +131 -120
  90. package/src/_modules/local-vector-search/_models/data-models/lvs-vector-persist.data-model.ts +6 -5
  91. package/src/_modules/local-vector-search/_services/lvs-persistent-vector-pool.control-service.spec.ts +35 -35
  92. package/src/_modules/local-vector-search/_services/lvs-persistent-vector-pool.control-service.ts +9 -5
  93. package/src/_modules/local-vector-search/_services/lvs-vector-persist.data-service.spec.ts +11 -11
  94. package/src/_modules/local-vector-search/_services/lvs-vector-persist.data-service.ts +19 -17
  95. package/src/_modules/mcp/_models/interfaces/dynts-mcp.interface.ts +1 -1
  96. package/src/_modules/mcp/_services/dynts-mcp-server.service-base.spec.ts +123 -114
  97. package/src/_modules/mcp/_services/dynts-mcp-server.service-base.ts +44 -39
  98. package/src/_modules/mcp/_services/dynts-mcp.adapter.ts +114 -103
  99. package/src/_modules/mcp/index.ts +1 -1
  100. package/src/_modules/scoped-config/_models/data-models/dynts-scoped-config.data-model.ts +5 -4
  101. package/src/_modules/scoped-config/_models/interfaces/dynts-scoped-config.interface.ts +0 -2
  102. package/src/_modules/scoped-config/_services/dynts-scoped-config.control-service.spec.ts +19 -13
  103. package/src/_modules/scoped-config/_services/dynts-scoped-config.control-service.ts +37 -21
  104. package/src/_modules/scoped-config/_services/dynts-scoped-config.data-service.spec.ts +11 -6
  105. package/src/_modules/scoped-config/_services/dynts-scoped-config.data-service.ts +17 -14
  106. package/src/_services/core/global.service.spec.ts +17 -0
  107. package/src/_services/core/global.service.ts +19 -5
  108. package/src/_services/server/app.server.ts +22 -1
@@ -5,12 +5,12 @@ import { DyNTS_global_settings } from '../../../_collections/global-settings.con
5
5
  import { DyNTS_GlobalService } from '../../../_services/core/global.service';
6
6
  import { LVS_Search_Mode } from '../_enums/lvs-search-mode.enum';
7
7
  import { LVS_SearchResult } from '../_models/lvs-search-result.interface';
8
- import { DyNTS_LVS_VectorPersist_DataModel } from '../_models/data-models/lvs-vector-persist.data-model';
8
+ import { DyNTS_LVS_VectorPersist } from '../_models/data-models/lvs-vector-persist.data-model';
9
9
  import { DyNTS_LVS_VectorPersist_DataService } from './lvs-vector-persist.data-service';
10
- import { DyNTS_LVS_PersistentVectorPool } from './lvs-persistent-vector-pool.control-service';
10
+ import { DyNTS_LVS_PersistentVectorPool_ControlService } from './lvs-persistent-vector-pool.control-service';
11
11
 
12
12
  /**
13
- * BFR-AM-001 — a `DyNTS_LVS_PersistentVectorPool` (kompozíció: in-memory pool + Mongo-persist) spec-jei.
13
+ * BFR-AM-001 — a `DyNTS_LVS_PersistentVectorPool_ControlService` (kompozíció: in-memory pool + Mongo-persist) spec-jei.
14
14
  *
15
15
  * A DB-réteget egy IN-MEMORY fake-store helyettesíti: a `DyNTS_LVS_VectorPersist_DataService.prototype`
16
16
  * `upsertVector`/`removeVector`/`findByCollectionKey` metódusait stub-oljuk (a `getDBService` eager
@@ -18,12 +18,12 @@ import { DyNTS_LVS_PersistentVectorPool } from './lvs-persistent-vector-pool.con
18
18
  * így a perzisztencia memóriában modellezett, ÉLŐ Mongo nélkül (skip-guard nem szükséges). A fő bizonyíték:
19
19
  * **persist-then-hydrate round-trip** újraépíti a VALÓDI `LVS_VectorPool_ControlService` in-memory indexét.
20
20
  */
21
- describe('| DyNTS_LVS_PersistentVectorPool', () => {
21
+ describe('| DyNTS_LVS_PersistentVectorPool_ControlService', () => {
22
22
 
23
23
  let mockDBService: jasmine.SpyObj<{ find: () => Promise<unknown[]>; findOne: () => Promise<unknown> }>;
24
24
 
25
25
  /** Fake tartós tár: `collectionKey` → (`vectorId` → rekord). A persist-stubok ezt írják/olvassák. */
26
- let store: Map<string, Map<string, DyNTS_LVS_VectorPersist_DataModel>>;
26
+ let store: Map<string, Map<string, DyNTS_LVS_VectorPersist>>;
27
27
 
28
28
  beforeAll(() => {
29
29
  if (!DyNTS_global_settings.systemShortCodeName) {
@@ -44,16 +44,16 @@ describe('| DyNTS_LVS_PersistentVectorPool', () => {
44
44
  spyOn(DyNTS_GlobalService, 'getDBService').and.returnValue(mockDBService as never);
45
45
 
46
46
  // A fake tartós tár + a persist-service prototype-stubok (memóriában modellezett Mongo).
47
- store = new Map<string, Map<string, DyNTS_LVS_VectorPersist_DataModel>>();
47
+ store = new Map<string, Map<string, DyNTS_LVS_VectorPersist>>();
48
48
 
49
49
  spyOn(DyNTS_LVS_VectorPersist_DataService.prototype, 'upsertVector').and.callFake(
50
50
  (set: { collectionKey: string; vectorId: string; embedding: number[]; metadata?: unknown }) => {
51
- let coll: Map<string, DyNTS_LVS_VectorPersist_DataModel> | undefined = store.get(set.collectionKey);
51
+ let coll: Map<string, DyNTS_LVS_VectorPersist> | undefined = store.get(set.collectionKey);
52
52
  if (!coll) {
53
- coll = new Map<string, DyNTS_LVS_VectorPersist_DataModel>();
53
+ coll = new Map<string, DyNTS_LVS_VectorPersist>();
54
54
  store.set(set.collectionKey, coll);
55
55
  }
56
- coll.set(set.vectorId, new DyNTS_LVS_VectorPersist_DataModel({
56
+ coll.set(set.vectorId, new DyNTS_LVS_VectorPersist({
57
57
  collectionKey: set.collectionKey,
58
58
  vectorId: set.vectorId,
59
59
  embedding: set.embedding,
@@ -85,12 +85,12 @@ describe('| DyNTS_LVS_PersistentVectorPool', () => {
85
85
  };
86
86
 
87
87
  it('| should persist on addVector and store the dimension', async () => {
88
- const pool: DyNTS_LVS_PersistentVectorPool =
89
- new DyNTS_LVS_PersistentVectorPool({ collectionKey: 'pool-a', issuer: 'test' });
88
+ const pool: DyNTS_LVS_PersistentVectorPool_ControlService =
89
+ new DyNTS_LVS_PersistentVectorPool_ControlService({ collectionKey: 'pool-a', issuer: 'test' });
90
90
 
91
91
  await pool.addVector('v1', [0.1, 0.2, 0.3], { tag: 'x' });
92
92
 
93
- const persisted: DyNTS_LVS_VectorPersist_DataModel | undefined = store.get('pool-a')?.get('v1');
93
+ const persisted: DyNTS_LVS_VectorPersist | undefined = store.get('pool-a')?.get('v1');
94
94
  expect(persisted).toBeDefined();
95
95
  expect(persisted.embedding).toEqual([0.1, 0.2, 0.3]);
96
96
  expect(persisted.dimensions).toBe(3);
@@ -101,16 +101,16 @@ describe('| DyNTS_LVS_PersistentVectorPool', () => {
101
101
 
102
102
  it('| persist-then-hydrate round-trip rebuilds the in-memory pool', async () => {
103
103
  // (1) Egy pool-ba 3 vektort persistálunk.
104
- const writer: DyNTS_LVS_PersistentVectorPool =
105
- new DyNTS_LVS_PersistentVectorPool({ collectionKey: 'pool-a', issuer: 'test' });
104
+ const writer: DyNTS_LVS_PersistentVectorPool_ControlService =
105
+ new DyNTS_LVS_PersistentVectorPool_ControlService({ collectionKey: 'pool-a', issuer: 'test' });
106
106
  await writer.addVector('v0', axis(4, 0));
107
107
  await writer.addVector('v1', axis(4, 1));
108
108
  await writer.addVector('v2', axis(4, 2));
109
109
  expect(store.get('pool-a').size).toBe(3);
110
110
 
111
111
  // (2) Egy FRISS wrapper (üres memória-pool) — szerver-restart szimuláció.
112
- const rebuilt: DyNTS_LVS_PersistentVectorPool =
113
- new DyNTS_LVS_PersistentVectorPool({ collectionKey: 'pool-a', issuer: 'test' });
112
+ const rebuilt: DyNTS_LVS_PersistentVectorPool_ControlService =
113
+ new DyNTS_LVS_PersistentVectorPool_ControlService({ collectionKey: 'pool-a', issuer: 'test' });
114
114
  expect(rebuilt.getPool().getAll().size).toBe(0);
115
115
 
116
116
  // (3) Hidratálás Mongo-ból → a memória-pool újraépül.
@@ -126,38 +126,38 @@ describe('| DyNTS_LVS_PersistentVectorPool', () => {
126
126
  });
127
127
 
128
128
  it('| should only hydrate the matching collectionKey (pool partitioning)', async () => {
129
- const a: DyNTS_LVS_PersistentVectorPool =
130
- new DyNTS_LVS_PersistentVectorPool({ collectionKey: 'pool-a', issuer: 'test' });
131
- const b: DyNTS_LVS_PersistentVectorPool =
132
- new DyNTS_LVS_PersistentVectorPool({ collectionKey: 'pool-b', issuer: 'test' });
129
+ const a: DyNTS_LVS_PersistentVectorPool_ControlService =
130
+ new DyNTS_LVS_PersistentVectorPool_ControlService({ collectionKey: 'pool-a', issuer: 'test' });
131
+ const b: DyNTS_LVS_PersistentVectorPool_ControlService =
132
+ new DyNTS_LVS_PersistentVectorPool_ControlService({ collectionKey: 'pool-b', issuer: 'test' });
133
133
 
134
134
  await a.addVector('a1', axis(3, 0));
135
135
  await b.addVector('b1', axis(3, 1));
136
136
  await b.addVector('b2', axis(3, 2));
137
137
 
138
- const rebuiltA: DyNTS_LVS_PersistentVectorPool =
139
- new DyNTS_LVS_PersistentVectorPool({ collectionKey: 'pool-a', issuer: 'test' });
138
+ const rebuiltA: DyNTS_LVS_PersistentVectorPool_ControlService =
139
+ new DyNTS_LVS_PersistentVectorPool_ControlService({ collectionKey: 'pool-a', issuer: 'test' });
140
140
  expect(await rebuiltA.hydrateFromMongo()).toBe(1);
141
141
  expect(Array.from(rebuiltA.getPool().getAll().keys())).toEqual(['a1']);
142
142
  });
143
143
 
144
144
  it('| upsert (re-add) is reflected in both the pool and the store', async () => {
145
- const pool: DyNTS_LVS_PersistentVectorPool =
146
- new DyNTS_LVS_PersistentVectorPool({ collectionKey: 'pool-a', issuer: 'test' });
145
+ const pool: DyNTS_LVS_PersistentVectorPool_ControlService =
146
+ new DyNTS_LVS_PersistentVectorPool_ControlService({ collectionKey: 'pool-a', issuer: 'test' });
147
147
 
148
148
  await pool.addVector('v1', [1, 0, 0]);
149
149
  await pool.updateVector('v1', [0, 1, 0], { v: 2 });
150
150
 
151
151
  // a tárban EGY rekord van, a frissített értékkel + dimenzióval:
152
152
  expect(store.get('pool-a').size).toBe(1);
153
- const persisted: DyNTS_LVS_VectorPersist_DataModel = store.get('pool-a').get('v1');
153
+ const persisted: DyNTS_LVS_VectorPersist = store.get('pool-a').get('v1');
154
154
  expect(persisted.embedding).toEqual([0, 1, 0]);
155
155
  expect(persisted.dimensions).toBe(3);
156
156
  expect(persisted.metadata).toEqual({ v: 2 });
157
157
 
158
158
  // és egy friss hidratálás a frissített vektort hozza:
159
- const rebuilt: DyNTS_LVS_PersistentVectorPool =
160
- new DyNTS_LVS_PersistentVectorPool({ collectionKey: 'pool-a', issuer: 'test' });
159
+ const rebuilt: DyNTS_LVS_PersistentVectorPool_ControlService =
160
+ new DyNTS_LVS_PersistentVectorPool_ControlService({ collectionKey: 'pool-a', issuer: 'test' });
161
161
  await rebuilt.hydrateFromMongo();
162
162
  const hits: LVS_SearchResult[] = rebuilt.search([0, 1, 0], 1, LVS_Search_Mode.cosineSimilarity);
163
163
  expect(hits[0].id).toBe('v1');
@@ -165,8 +165,8 @@ describe('| DyNTS_LVS_PersistentVectorPool', () => {
165
165
  });
166
166
 
167
167
  it('| removeVector is reflected in both the pool and the store', async () => {
168
- const pool: DyNTS_LVS_PersistentVectorPool =
169
- new DyNTS_LVS_PersistentVectorPool({ collectionKey: 'pool-a', issuer: 'test' });
168
+ const pool: DyNTS_LVS_PersistentVectorPool_ControlService =
169
+ new DyNTS_LVS_PersistentVectorPool_ControlService({ collectionKey: 'pool-a', issuer: 'test' });
170
170
 
171
171
  await pool.addVector('v1', axis(3, 0));
172
172
  await pool.addVector('v2', axis(3, 1));
@@ -181,15 +181,15 @@ describe('| DyNTS_LVS_PersistentVectorPool', () => {
181
181
  });
182
182
 
183
183
  it('| hydrate(records) rebuilds the pool without a Mongo read and skips incomplete records', () => {
184
- const pool: DyNTS_LVS_PersistentVectorPool =
185
- new DyNTS_LVS_PersistentVectorPool({ collectionKey: 'pool-a', issuer: 'test' });
184
+ const pool: DyNTS_LVS_PersistentVectorPool_ControlService =
185
+ new DyNTS_LVS_PersistentVectorPool_ControlService({ collectionKey: 'pool-a', issuer: 'test' });
186
186
 
187
187
  const loaded: number = pool.hydrate([
188
- new DyNTS_LVS_VectorPersist_DataModel({ collectionKey: 'pool-a', vectorId: 'v1', embedding: axis(2, 0) }),
189
- new DyNTS_LVS_VectorPersist_DataModel({ collectionKey: 'pool-a', vectorId: 'v2', embedding: axis(2, 1) }),
188
+ new DyNTS_LVS_VectorPersist({ collectionKey: 'pool-a', vectorId: 'v1', embedding: axis(2, 0) }),
189
+ new DyNTS_LVS_VectorPersist({ collectionKey: 'pool-a', vectorId: 'v2', embedding: axis(2, 1) }),
190
190
  // hiányos rekordok (átugorva):
191
- new DyNTS_LVS_VectorPersist_DataModel({ collectionKey: 'pool-a', vectorId: 'v3', embedding: [] }),
192
- new DyNTS_LVS_VectorPersist_DataModel({ collectionKey: 'pool-a', embedding: axis(2, 0) }),
191
+ new DyNTS_LVS_VectorPersist({ collectionKey: 'pool-a', vectorId: 'v3', embedding: [] }),
192
+ new DyNTS_LVS_VectorPersist({ collectionKey: 'pool-a', embedding: axis(2, 0) }),
193
193
  ]);
194
194
 
195
195
  expect(loaded).toBe(2);
@@ -3,12 +3,12 @@ import { DyFM_Log } from '@futdevpro/fsm-dynamo';
3
3
 
4
4
  import { LVS_Search_Mode } from '../_enums/lvs-search-mode.enum';
5
5
  import { LVS_SearchResult } from '../_models/lvs-search-result.interface';
6
- import { DyNTS_LVS_VectorPersist_DataModel } from '../_models/data-models/lvs-vector-persist.data-model';
6
+ import { DyNTS_LVS_VectorPersist } from '../_models/data-models/lvs-vector-persist.data-model';
7
7
  import { DyNTS_LVS_VectorPersist_DataService } from './lvs-vector-persist.data-service';
8
8
  import { LVS_VectorPool_ControlService } from './lvs-vector-pool.control-service';
9
9
 
10
10
  /**
11
- * `DyNTS_LVS_PersistentVectorPool` (BFR-AM-001) — egy `LVS_VectorPool_ControlService` in-memory pool +
11
+ * `DyNTS_LVS_PersistentVectorPool_ControlService` (BFR-AM-001) — egy `LVS_VectorPool_ControlService` in-memory pool +
12
12
  * MongoDB-perzisztencia **kompozíciója**. A FAM (fdp-agent-memory) `FAM_VectorSearch_ControlService`
13
13
  * persist+hydrate workaround-ját generalizálja bedrock-szintre: a vektorok a SAJÁT Mongo-ban
14
14
  * (`dynts_lvs_vector`) élnek, boot-kor a memória-pool-ba hidratálódnak — **NEM** MongoDB Atlas
@@ -24,7 +24,7 @@ import { LVS_VectorPool_ControlService } from './lvs-vector-pool.control-service
24
24
  * `getDBService`-t hív, ezért a wrapper NEM tart élő data-service-mezőt — minden DB-művelet előtt lazy
25
25
  * `new DyNTS_LVS_VectorPersist_DataService(...)` (a `getPersistService` ezt adja).
26
26
  */
27
- export class DyNTS_LVS_PersistentVectorPool {
27
+ export class DyNTS_LVS_PersistentVectorPool_ControlService {
28
28
 
29
29
  /** A wrapped in-memory pool (a Dynamo LVS engine; VÁLTOZATLAN — kompozíció, nem módosítás). */
30
30
  private readonly pool: LVS_VectorPool_ControlService;
@@ -98,12 +98,13 @@ export class DyNTS_LVS_PersistentVectorPool {
98
98
  * Visszaadja a betöltött vektorok számát. **NEM** Atlas — saját Mongo + in-memory pool.
99
99
  */
100
100
  async hydrateFromMongo(): Promise<number> {
101
- const records: DyNTS_LVS_VectorPersist_DataModel[] =
101
+ const records: DyNTS_LVS_VectorPersist[] =
102
102
  await this.getPersistService().findByCollectionKey(this.collectionKey);
103
103
 
104
104
  this.pool.clearPool();
105
105
 
106
106
  let loaded: number = 0;
107
+
107
108
  for (const record of records) {
108
109
  if (!record.vectorId || !record.embedding?.length) {
109
110
  continue;
@@ -115,6 +116,7 @@ export class DyNTS_LVS_PersistentVectorPool {
115
116
  DyFM_Log.log(
116
117
  `[DyNTS LVS hydrate] '${this.collectionKey}' pool: ${loaded} vektor betöltve az in-memory pool-ba.`,
117
118
  );
119
+
118
120
  return loaded;
119
121
  }
120
122
 
@@ -123,9 +125,10 @@ export class DyNTS_LVS_PersistentVectorPool {
123
125
  * kezében van a rekord-halmaz (pl. batch-boot). A pool-t előbb üríti (idempotens). Visszaadja a
124
126
  * betöltött vektorok számát.
125
127
  */
126
- hydrate(records: DyNTS_LVS_VectorPersist_DataModel[]): number {
128
+ hydrate(records: DyNTS_LVS_VectorPersist[]): number {
127
129
  this.pool.clearPool();
128
130
  let loaded: number = 0;
131
+
129
132
  for (const record of records) {
130
133
  if (!record.vectorId || !record.embedding?.length) {
131
134
  continue;
@@ -133,6 +136,7 @@ export class DyNTS_LVS_PersistentVectorPool {
133
136
  this.pool.addVector(record.vectorId, record.embedding);
134
137
  loaded++;
135
138
  }
139
+
136
140
  return loaded;
137
141
  }
138
142
 
@@ -3,7 +3,7 @@ import { DyFM_EnvironmentFlag } from '@futdevpro/fsm-dynamo';
3
3
 
4
4
  import { DyNTS_global_settings } from '../../../_collections/global-settings.const';
5
5
  import { DyNTS_GlobalService } from '../../../_services/core/global.service';
6
- import { DyNTS_LVS_VectorPersist_DataModel } from '../_models/data-models/lvs-vector-persist.data-model';
6
+ import { DyNTS_LVS_VectorPersist } from '../_models/data-models/lvs-vector-persist.data-model';
7
7
  import { DyNTS_LVS_VectorPersist_DataService } from './lvs-vector-persist.data-service';
8
8
 
9
9
  /**
@@ -36,7 +36,7 @@ describe('| DyNTS_LVS_VectorPersist_DataService', () => {
36
36
  describe('| constructor', () => {
37
37
 
38
38
  it('| should create the service with a data model', () => {
39
- const data: DyNTS_LVS_VectorPersist_DataModel = new DyNTS_LVS_VectorPersist_DataModel({
39
+ const data: DyNTS_LVS_VectorPersist = new DyNTS_LVS_VectorPersist({
40
40
  collectionKey: 'pool-a',
41
41
  vectorId: 'v1',
42
42
  embedding: [1, 2, 3],
@@ -56,7 +56,7 @@ describe('| DyNTS_LVS_VectorPersist_DataService', () => {
56
56
  new DyNTS_LVS_VectorPersist_DataService({ issuer: 'issuer-123' });
57
57
 
58
58
  expect(service).toBeInstanceOf(DyNTS_LVS_VectorPersist_DataService);
59
- expect(service.data).toBeInstanceOf(DyNTS_LVS_VectorPersist_DataModel);
59
+ expect(service.data).toBeInstanceOf(DyNTS_LVS_VectorPersist);
60
60
  });
61
61
  });
62
62
 
@@ -66,12 +66,12 @@ describe('| DyNTS_LVS_VectorPersist_DataService', () => {
66
66
  const service: DyNTS_LVS_VectorPersist_DataService =
67
67
  new DyNTS_LVS_VectorPersist_DataService({ issuer: 'issuer-123' });
68
68
 
69
- const records: DyNTS_LVS_VectorPersist_DataModel[] = [
70
- new DyNTS_LVS_VectorPersist_DataModel({ collectionKey: 'pool-a', vectorId: 'v1', embedding: [1, 0] }),
69
+ const records: DyNTS_LVS_VectorPersist[] = [
70
+ new DyNTS_LVS_VectorPersist({ collectionKey: 'pool-a', vectorId: 'v1', embedding: [1, 0] }),
71
71
  ];
72
72
  const findSpy = spyOn(service, 'findDataList').and.returnValue(Promise.resolve(records));
73
73
 
74
- const result: DyNTS_LVS_VectorPersist_DataModel[] = await service.findByCollectionKey('pool-a');
74
+ const result: DyNTS_LVS_VectorPersist[] = await service.findByCollectionKey('pool-a');
75
75
 
76
76
  expect(findSpy).toHaveBeenCalledTimes(1);
77
77
  const filterArg = findSpy.calls.mostRecent().args[0] as { collectionKey: string };
@@ -86,7 +86,7 @@ describe('| DyNTS_LVS_VectorPersist_DataService', () => {
86
86
  const service: DyNTS_LVS_VectorPersist_DataService =
87
87
  new DyNTS_LVS_VectorPersist_DataService({ issuer: 'issuer-123' });
88
88
 
89
- const existing: DyNTS_LVS_VectorPersist_DataModel = new DyNTS_LVS_VectorPersist_DataModel({
89
+ const existing: DyNTS_LVS_VectorPersist = new DyNTS_LVS_VectorPersist({
90
90
  collectionKey: 'pool-a', vectorId: 'v1', embedding: [1, 2, 3],
91
91
  });
92
92
  existing._id = 'rec-1';
@@ -118,14 +118,14 @@ describe('| DyNTS_LVS_VectorPersist_DataService', () => {
118
118
  spyOn(service, 'findData').and.returnValue(Promise.resolve(null));
119
119
  const updateSpy = spyOn(service, 'updateData').and.returnValue(Promise.resolve());
120
120
  const saveSpy = spyOn(service, 'saveData')
121
- .and.callFake((data?: DyNTS_LVS_VectorPersist_DataModel) =>
122
- Promise.resolve(data as DyNTS_LVS_VectorPersist_DataModel));
121
+ .and.callFake((data?: DyNTS_LVS_VectorPersist) =>
122
+ Promise.resolve(data as DyNTS_LVS_VectorPersist));
123
123
 
124
124
  await service.upsertVector({ collectionKey: 'pool-a', vectorId: 'v2', embedding: [0.1, 0.2] });
125
125
 
126
126
  expect(updateSpy).not.toHaveBeenCalled();
127
127
  expect(saveSpy).toHaveBeenCalledTimes(1);
128
- const written = saveSpy.calls.mostRecent().args[0] as DyNTS_LVS_VectorPersist_DataModel;
128
+ const written = saveSpy.calls.mostRecent().args[0] as DyNTS_LVS_VectorPersist;
129
129
  expect(written.vectorId).toBe('v2');
130
130
  expect(written.collectionKey).toBe('pool-a');
131
131
  expect(written.embedding).toEqual([0.1, 0.2]);
@@ -139,7 +139,7 @@ describe('| DyNTS_LVS_VectorPersist_DataService', () => {
139
139
  const service: DyNTS_LVS_VectorPersist_DataService =
140
140
  new DyNTS_LVS_VectorPersist_DataService({ issuer: 'issuer-123' });
141
141
 
142
- const existing: DyNTS_LVS_VectorPersist_DataModel = new DyNTS_LVS_VectorPersist_DataModel({
142
+ const existing: DyNTS_LVS_VectorPersist = new DyNTS_LVS_VectorPersist({
143
143
  collectionKey: 'pool-a', vectorId: 'v1', embedding: [1, 0],
144
144
  });
145
145
  existing._id = 'rec-1';
@@ -3,8 +3,8 @@ import { DyFM_DBFilter, DyFM_DBFilterSimple } from '@futdevpro/fsm-dynamo';
3
3
 
4
4
  import { DyNTS_DataService } from '../../../_services/base/data.service';
5
5
  import {
6
- DyNTS_LVS_VectorPersist_DataModel,
7
- dyNTS_lvsVectorPersist_dataParams,
6
+ DyNTS_LVS_VectorPersist,
7
+ DyNTS_lvsVectorPersist_dataParams
8
8
  } from '../_models/data-models/lvs-vector-persist.data-model';
9
9
 
10
10
  /**
@@ -14,36 +14,36 @@ import {
14
14
  *
15
15
  * **FIGYELEM (memory: dynts_dataservice_eager_resolve):** a `DyNTS_DataService` base-ctor EAGER
16
16
  * `getDBService`-t hív → a hívó NEM tarthat élő data-service-példányt mezőként; minden művelet előtt
17
- * lazy `new DyNTS_LVS_VectorPersist_DataService(...)` kell (a `DyNTS_LVS_PersistentVectorPool` így jár el).
17
+ * lazy `new DyNTS_LVS_VectorPersist_DataService(...)` kell (a `DyNTS_LVS_PersistentVectorPool_ControlService` így jár el).
18
18
  *
19
19
  * **Atomikus írás (memory: mongoose_mixed_atomic_write):** az upsert a `(collectionKey, vectorId)`
20
20
  * logikai-kulcson MEGLÉVŐ rekordot `updateOne({...},{$set:{embedding,dimensions,metadata}})`-tel
21
21
  * frissíti (a Mixed `metadata` `findOne→mutate→save` SILENT-DROP-ja ellen); ÚJ rekordot `saveData`-val ír.
22
22
  */
23
- export class DyNTS_LVS_VectorPersist_DataService extends DyNTS_DataService<DyNTS_LVS_VectorPersist_DataModel> {
23
+ export class DyNTS_LVS_VectorPersist_DataService extends DyNTS_DataService<DyNTS_LVS_VectorPersist> {
24
24
 
25
25
  constructor(
26
26
  set: {
27
- data?: DyNTS_LVS_VectorPersist_DataModel,
27
+ data?: DyNTS_LVS_VectorPersist,
28
28
  issuer: string,
29
29
  },
30
30
  ) {
31
31
  super(
32
- set.data instanceof DyNTS_LVS_VectorPersist_DataModel
32
+ set.data instanceof DyNTS_LVS_VectorPersist
33
33
  ? set.data
34
- : new DyNTS_LVS_VectorPersist_DataModel(set.data),
35
- dyNTS_lvsVectorPersist_dataParams,
34
+ : new DyNTS_LVS_VectorPersist(set.data),
35
+ DyNTS_lvsVectorPersist_dataParams,
36
36
  set.issuer,
37
37
  );
38
38
  }
39
39
 
40
40
  /**
41
41
  * Egy (logikai) pool ÖSSZES perzistált, nem-soft-delete-elt vektor-rekordja — a boot-hidratáláshoz
42
- * (a `DyNTS_LVS_PersistentVectorPool.hydrateFromMongo` ezt tölti az in-memory pool-ba).
42
+ * (a `DyNTS_LVS_PersistentVectorPool_ControlService.hydrateFromMongo` ezt tölti az in-memory pool-ba).
43
43
  */
44
- async findByCollectionKey(collectionKey: string): Promise<DyNTS_LVS_VectorPersist_DataModel[]> {
44
+ async findByCollectionKey(collectionKey: string): Promise<DyNTS_LVS_VectorPersist[]> {
45
45
  return this.findDataList(
46
- { collectionKey: collectionKey } as DyFM_DBFilterSimple<DyNTS_LVS_VectorPersist_DataModel>,
46
+ { collectionKey: collectionKey },
47
47
  true,
48
48
  );
49
49
  }
@@ -59,14 +59,14 @@ export class DyNTS_LVS_VectorPersist_DataService extends DyNTS_DataService<DyNTS
59
59
  embedding: number[],
60
60
  metadata?: unknown,
61
61
  }): Promise<void> {
62
- const existing: DyNTS_LVS_VectorPersist_DataModel = await this.findData(
63
- { collectionKey: set.collectionKey, vectorId: set.vectorId } as DyFM_DBFilter<DyNTS_LVS_VectorPersist_DataModel>,
62
+ const existing: DyNTS_LVS_VectorPersist = await this.findData(
63
+ { collectionKey: set.collectionKey, vectorId: set.vectorId },
64
64
  true,
65
65
  );
66
66
 
67
67
  if (existing?._id) {
68
68
  await this.updateData({
69
- filterBy: { _id: existing._id } as DyFM_DBFilterSimple<DyNTS_LVS_VectorPersist_DataModel>,
69
+ filterBy: { _id: existing._id },
70
70
  update: {
71
71
  $set: {
72
72
  embedding: set.embedding,
@@ -75,11 +75,12 @@ export class DyNTS_LVS_VectorPersist_DataService extends DyNTS_DataService<DyNTS
75
75
  },
76
76
  },
77
77
  });
78
+
78
79
  return;
79
80
  }
80
81
 
81
82
  await this.saveData(
82
- new DyNTS_LVS_VectorPersist_DataModel({
83
+ new DyNTS_LVS_VectorPersist({
83
84
  collectionKey: set.collectionKey,
84
85
  vectorId: set.vectorId,
85
86
  embedding: set.embedding,
@@ -95,10 +96,11 @@ export class DyNTS_LVS_VectorPersist_DataService extends DyNTS_DataService<DyNTS
95
96
  * `removeVector`-ja után — a tartós tár is törli). `addArchive` nincs → `absolute` true-val töröl.
96
97
  */
97
98
  async removeVector(collectionKey: string, vectorId: string): Promise<void> {
98
- const existing: DyNTS_LVS_VectorPersist_DataModel = await this.findData(
99
- { collectionKey: collectionKey, vectorId: vectorId } as DyFM_DBFilter<DyNTS_LVS_VectorPersist_DataModel>,
99
+ const existing: DyNTS_LVS_VectorPersist = await this.findData(
100
+ { collectionKey: collectionKey, vectorId: vectorId },
100
101
  true,
101
102
  );
103
+
102
104
  if (existing?._id) {
103
105
  await this.deleteData(existing._id, true);
104
106
  }
@@ -5,7 +5,7 @@
5
5
  *
6
6
  * Boundary: a `DyNTS_McpToolDefinition` + a `DyNTS_Mcp_Adapter` egyetlen `registerTool` choke-pontot
7
7
  * ad — a hivatalos `@modelcontextprotocol/sdk` KIZÁRÓLAG az adaptor mögött él, így egy jövőbeli
8
- * transport-/SDK-csere NEM-breaking (csak az adaptor cserélődik, a `DyNTS_Mcp_ServerBase` + a
8
+ * transport-/SDK-csere NEM-breaking (csak az adaptor cserélődik, a `DyNTS_Mcp_Server_ServiceBase` + a
9
9
  * consumer-tool-ok változatlanok). A consumer a SAJÁT tool-jait regisztrálja (a bedrock NEM definiál
10
10
  * domain-tool-okat — csak a server-base + a transport + a registry).
11
11
  */