@futdevpro/nts-dynamo 1.15.57 → 1.15.58
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/.dynamo/logs/cicd-pipeline/output.log +1757 -3604
- package/.dynamo/logs/cicd-pipeline/status.json +43 -345
- package/build/_modules/ai/_modules/document-ai/_collections/dai-code-chunking.util.d.ts +110 -0
- package/build/_modules/ai/_modules/document-ai/_collections/dai-code-chunking.util.d.ts.map +1 -0
- package/build/_modules/ai/_modules/document-ai/_collections/dai-code-chunking.util.js +419 -0
- package/build/_modules/ai/_modules/document-ai/_collections/dai-code-chunking.util.js.map +1 -0
- package/build/_modules/ai/_modules/document-ai/_models/interfaces/dai-code-chunk.interface.d.ts +50 -0
- package/build/_modules/ai/_modules/document-ai/_models/interfaces/dai-code-chunk.interface.d.ts.map +1 -0
- package/build/_modules/ai/_modules/document-ai/_models/interfaces/dai-code-chunk.interface.js +3 -0
- package/build/_modules/ai/_modules/document-ai/_models/interfaces/dai-code-chunk.interface.js.map +1 -0
- package/build/_modules/ai/_modules/document-ai/index.d.ts +2 -0
- package/build/_modules/ai/_modules/document-ai/index.d.ts.map +1 -1
- package/build/_modules/ai/_modules/document-ai/index.js +2 -0
- package/build/_modules/ai/_modules/document-ai/index.js.map +1 -1
- package/build/_modules/ai/_services/ai-embedding-mock.service.d.ts +81 -0
- package/build/_modules/ai/_services/ai-embedding-mock.service.d.ts.map +1 -0
- package/build/_modules/ai/_services/ai-embedding-mock.service.js +167 -0
- package/build/_modules/ai/_services/ai-embedding-mock.service.js.map +1 -0
- package/build/_modules/ai/_services/ai-embedding-provider.registry.d.ts +52 -0
- package/build/_modules/ai/_services/ai-embedding-provider.registry.d.ts.map +1 -0
- package/build/_modules/ai/_services/ai-embedding-provider.registry.js +79 -0
- package/build/_modules/ai/_services/ai-embedding-provider.registry.js.map +1 -0
- package/build/_modules/ai/_services/lmstudio-embedding.control-service.d.ts +111 -0
- package/build/_modules/ai/_services/lmstudio-embedding.control-service.d.ts.map +1 -0
- package/build/_modules/ai/_services/lmstudio-embedding.control-service.js +298 -0
- package/build/_modules/ai/_services/lmstudio-embedding.control-service.js.map +1 -0
- package/build/_modules/ai/index.d.ts +3 -0
- package/build/_modules/ai/index.d.ts.map +1 -1
- package/build/_modules/ai/index.js +4 -0
- package/build/_modules/ai/index.js.map +1 -1
- package/build/_modules/data-readers/_collections/dynts-sqlite-reader.util.d.ts +59 -0
- package/build/_modules/data-readers/_collections/dynts-sqlite-reader.util.d.ts.map +1 -0
- package/build/_modules/data-readers/_collections/dynts-sqlite-reader.util.js +169 -0
- package/build/_modules/data-readers/_collections/dynts-sqlite-reader.util.js.map +1 -0
- package/build/_modules/data-readers/_models/interfaces/dynts-sqlite-reader.interface.d.ts +32 -0
- package/build/_modules/data-readers/_models/interfaces/dynts-sqlite-reader.interface.d.ts.map +1 -0
- package/build/_modules/data-readers/_models/interfaces/dynts-sqlite-reader.interface.js +8 -0
- package/build/_modules/data-readers/_models/interfaces/dynts-sqlite-reader.interface.js.map +1 -0
- package/build/_modules/data-readers/index.d.ts +3 -0
- package/build/_modules/data-readers/index.d.ts.map +1 -0
- package/build/_modules/data-readers/index.js +11 -0
- package/build/_modules/data-readers/index.js.map +1 -0
- package/build/_modules/local-vector-search/_models/data-models/lvs-vector-persist.data-model.d.ts +36 -0
- package/build/_modules/local-vector-search/_models/data-models/lvs-vector-persist.data-model.d.ts.map +1 -0
- package/build/_modules/local-vector-search/_models/data-models/lvs-vector-persist.data-model.js +54 -0
- package/build/_modules/local-vector-search/_models/data-models/lvs-vector-persist.data-model.js.map +1 -0
- package/build/_modules/local-vector-search/_services/lvs-persistent-vector-pool.control-service.d.ts +70 -0
- package/build/_modules/local-vector-search/_services/lvs-persistent-vector-pool.control-service.d.ts.map +1 -0
- package/build/_modules/local-vector-search/_services/lvs-persistent-vector-pool.control-service.js +123 -0
- package/build/_modules/local-vector-search/_services/lvs-persistent-vector-pool.control-service.js.map +1 -0
- package/build/_modules/local-vector-search/_services/lvs-vector-persist.data-service.d.ts +43 -0
- package/build/_modules/local-vector-search/_services/lvs-vector-persist.data-service.d.ts.map +1 -0
- package/build/_modules/local-vector-search/_services/lvs-vector-persist.data-service.js +72 -0
- package/build/_modules/local-vector-search/_services/lvs-vector-persist.data-service.js.map +1 -0
- package/build/_modules/local-vector-search/index.d.ts +3 -0
- package/build/_modules/local-vector-search/index.d.ts.map +1 -1
- package/build/_modules/local-vector-search/index.js +4 -0
- package/build/_modules/local-vector-search/index.js.map +1 -1
- package/build/_modules/mcp/_models/interfaces/dynts-mcp.interface.d.ts +109 -0
- package/build/_modules/mcp/_models/interfaces/dynts-mcp.interface.d.ts.map +1 -0
- package/build/_modules/mcp/_models/interfaces/dynts-mcp.interface.js +14 -0
- package/build/_modules/mcp/_models/interfaces/dynts-mcp.interface.js.map +1 -0
- package/build/_modules/mcp/_services/dynts-mcp-server.service-base.d.ts +71 -0
- package/build/_modules/mcp/_services/dynts-mcp-server.service-base.d.ts.map +1 -0
- package/build/_modules/mcp/_services/dynts-mcp-server.service-base.js +99 -0
- package/build/_modules/mcp/_services/dynts-mcp-server.service-base.js.map +1 -0
- package/build/_modules/mcp/_services/dynts-mcp.adapter.d.ts +57 -0
- package/build/_modules/mcp/_services/dynts-mcp.adapter.d.ts.map +1 -0
- package/build/_modules/mcp/_services/dynts-mcp.adapter.js +134 -0
- package/build/_modules/mcp/_services/dynts-mcp.adapter.js.map +1 -0
- package/build/_modules/mcp/index.d.ts +4 -0
- package/build/_modules/mcp/index.d.ts.map +1 -0
- package/build/_modules/mcp/index.js +13 -0
- package/build/_modules/mcp/index.js.map +1 -0
- package/build/_modules/scoped-config/_enums/dynts-scoped-config-level.enum.d.ts +19 -0
- package/build/_modules/scoped-config/_enums/dynts-scoped-config-level.enum.d.ts.map +1 -0
- package/build/_modules/scoped-config/_enums/dynts-scoped-config-level.enum.js +23 -0
- package/build/_modules/scoped-config/_enums/dynts-scoped-config-level.enum.js.map +1 -0
- package/build/_modules/scoped-config/_models/data-models/dynts-scoped-config.data-model.d.ts +44 -0
- package/build/_modules/scoped-config/_models/data-models/dynts-scoped-config.data-model.d.ts.map +1 -0
- package/build/_modules/scoped-config/_models/data-models/dynts-scoped-config.data-model.js +68 -0
- package/build/_modules/scoped-config/_models/data-models/dynts-scoped-config.data-model.js.map +1 -0
- package/build/_modules/scoped-config/_models/interfaces/dynts-scoped-config.interface.d.ts +89 -0
- package/build/_modules/scoped-config/_models/interfaces/dynts-scoped-config.interface.d.ts.map +1 -0
- package/build/_modules/scoped-config/_models/interfaces/dynts-scoped-config.interface.js +3 -0
- package/build/_modules/scoped-config/_models/interfaces/dynts-scoped-config.interface.js.map +1 -0
- package/build/_modules/scoped-config/_services/dynts-scoped-config.control-service.d.ts +84 -0
- package/build/_modules/scoped-config/_services/dynts-scoped-config.control-service.d.ts.map +1 -0
- package/build/_modules/scoped-config/_services/dynts-scoped-config.control-service.js +220 -0
- package/build/_modules/scoped-config/_services/dynts-scoped-config.control-service.js.map +1 -0
- package/build/_modules/scoped-config/_services/dynts-scoped-config.data-service.d.ts +54 -0
- package/build/_modules/scoped-config/_services/dynts-scoped-config.data-service.d.ts.map +1 -0
- package/build/_modules/scoped-config/_services/dynts-scoped-config.data-service.js +76 -0
- package/build/_modules/scoped-config/_services/dynts-scoped-config.data-service.js.map +1 -0
- package/build/_modules/scoped-config/index.d.ts +6 -0
- package/build/_modules/scoped-config/index.d.ts.map +1 -0
- package/build/_modules/scoped-config/index.js +15 -0
- package/build/_modules/scoped-config/index.js.map +1 -0
- package/package.json +58 -2
- package/pnpm-workspace.yaml +1 -0
- package/src/_modules/ai/_modules/document-ai/_collections/dai-code-chunking.util.spec.ts +295 -0
- package/src/_modules/ai/_modules/document-ai/_collections/dai-code-chunking.util.ts +520 -0
- package/src/_modules/ai/_modules/document-ai/_models/interfaces/dai-code-chunk.interface.ts +68 -0
- package/src/_modules/ai/_modules/document-ai/index.ts +2 -0
- package/src/_modules/ai/_services/ai-embedding-mock.service.spec.ts +115 -0
- package/src/_modules/ai/_services/ai-embedding-mock.service.ts +219 -0
- package/src/_modules/ai/_services/ai-embedding-provider.registry.spec.ts +110 -0
- package/src/_modules/ai/_services/ai-embedding-provider.registry.ts +110 -0
- package/src/_modules/ai/_services/lmstudio-embedding.control-service.spec.ts +197 -0
- package/src/_modules/ai/_services/lmstudio-embedding.control-service.ts +378 -0
- package/src/_modules/ai/index.ts +5 -0
- package/src/_modules/data-readers/_collections/dynts-sqlite-reader.util.spec.ts +161 -0
- package/src/_modules/data-readers/_collections/dynts-sqlite-reader.util.ts +192 -0
- package/src/_modules/data-readers/_models/interfaces/dynts-sqlite-reader.interface.ts +33 -0
- package/src/_modules/data-readers/index.ts +11 -0
- package/src/_modules/local-vector-search/_models/data-models/lvs-vector-persist.data-model.ts +59 -0
- package/src/_modules/local-vector-search/_services/lvs-persistent-vector-pool.control-service.spec.ts +198 -0
- package/src/_modules/local-vector-search/_services/lvs-persistent-vector-pool.control-service.ts +146 -0
- package/src/_modules/local-vector-search/_services/lvs-vector-persist.data-service.spec.ts +167 -0
- package/src/_modules/local-vector-search/_services/lvs-vector-persist.data-service.ts +106 -0
- package/src/_modules/local-vector-search/index.ts +6 -1
- package/src/_modules/mcp/_models/interfaces/dynts-mcp.interface.ts +111 -0
- package/src/_modules/mcp/_services/dynts-mcp-server.service-base.spec.ts +142 -0
- package/src/_modules/mcp/_services/dynts-mcp-server.service-base.ts +120 -0
- package/src/_modules/mcp/_services/dynts-mcp.adapter.ts +157 -0
- package/src/_modules/mcp/index.ts +13 -0
- package/src/_modules/scoped-config/_enums/dynts-scoped-config-level.enum.ts +22 -0
- package/src/_modules/scoped-config/_models/data-models/dynts-scoped-config.data-model.ts +81 -0
- package/src/_modules/scoped-config/_models/interfaces/dynts-scoped-config.interface.ts +109 -0
- package/src/_modules/scoped-config/_services/dynts-scoped-config.control-service.spec.ts +306 -0
- package/src/_modules/scoped-config/_services/dynts-scoped-config.control-service.ts +295 -0
- package/src/_modules/scoped-config/_services/dynts-scoped-config.data-service.spec.ts +118 -0
- package/src/_modules/scoped-config/_services/dynts-scoped-config.data-service.ts +105 -0
- package/src/_modules/scoped-config/index.ts +17 -0
package/src/_modules/local-vector-search/_services/lvs-persistent-vector-pool.control-service.ts
ADDED
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
|
|
2
|
+
import { DyFM_Log } from '@futdevpro/fsm-dynamo';
|
|
3
|
+
|
|
4
|
+
import { LVS_Search_Mode } from '../_enums/lvs-search-mode.enum';
|
|
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';
|
|
7
|
+
import { DyNTS_LVS_VectorPersist_DataService } from './lvs-vector-persist.data-service';
|
|
8
|
+
import { LVS_VectorPool_ControlService } from './lvs-vector-pool.control-service';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* `DyNTS_LVS_PersistentVectorPool` (BFR-AM-001) — egy `LVS_VectorPool_ControlService` in-memory pool +
|
|
12
|
+
* MongoDB-perzisztencia **kompozíciója**. A FAM (fdp-agent-memory) `FAM_VectorSearch_ControlService`
|
|
13
|
+
* persist+hydrate workaround-ját generalizálja bedrock-szintre: a vektorok a SAJÁT Mongo-ban
|
|
14
|
+
* (`dynts_lvs_vector`) élnek, boot-kor a memória-pool-ba hidratálódnak — **NEM** MongoDB Atlas
|
|
15
|
+
* Vector Search.
|
|
16
|
+
*
|
|
17
|
+
* **Miért KOMPOZÍCIÓ (NEM a pool-class módosítása):** a `LVS_VectorPool_ControlService`-t egy másik,
|
|
18
|
+
* párhuzamos WIP (hybrid cosine+BM25) is érinti; a pool-class változtatása merge-konfliktust okozna.
|
|
19
|
+
* Ez a wrapper a pool-t VÁLTOZATLANUL hagyja (delegál: `addVector`/`removeVector`/`updateVector`/
|
|
20
|
+
* `search`), és a perzisztencia-mellékhatást a wrapper-metódusokban végzi. Egy wrapper-instance egy
|
|
21
|
+
* `collectionKey` (logikai pool); több pool = több wrapper.
|
|
22
|
+
*
|
|
23
|
+
* **FIGYELEM (memory: dynts_dataservice_eager_resolve):** a `DyNTS_DataService` base-ctor EAGER
|
|
24
|
+
* `getDBService`-t hív, ezért a wrapper NEM tart élő data-service-mezőt — minden DB-művelet előtt lazy
|
|
25
|
+
* `new DyNTS_LVS_VectorPersist_DataService(...)` (a `getPersistService` ezt adja).
|
|
26
|
+
*/
|
|
27
|
+
export class DyNTS_LVS_PersistentVectorPool {
|
|
28
|
+
|
|
29
|
+
/** A wrapped in-memory pool (a Dynamo LVS engine; VÁLTOZATLAN — kompozíció, nem módosítás). */
|
|
30
|
+
private readonly pool: LVS_VectorPool_ControlService;
|
|
31
|
+
|
|
32
|
+
/** A pool-particionálás kulcsa (a Mongo-rekordok `collectionKey`-e + a hidratálás-szűrő). */
|
|
33
|
+
private readonly collectionKey: string;
|
|
34
|
+
|
|
35
|
+
/** A perzisztencia-műveletek issuer-e (audit). */
|
|
36
|
+
private readonly issuer: string;
|
|
37
|
+
|
|
38
|
+
constructor(set: {
|
|
39
|
+
collectionKey: string,
|
|
40
|
+
issuer: string,
|
|
41
|
+
pool?: LVS_VectorPool_ControlService,
|
|
42
|
+
}) {
|
|
43
|
+
this.collectionKey = set.collectionKey;
|
|
44
|
+
this.issuer = set.issuer;
|
|
45
|
+
// Saját pool, ha a hívó nem ad be egyet (a wrapper nem módosítja a pool-osztályt — kompozíció).
|
|
46
|
+
this.pool = set.pool ?? new LVS_VectorPool_ControlService();
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** A wrapped in-memory pool (közvetlen olvasáshoz — pl. más search-mód, getAll). */
|
|
50
|
+
getPool(): LVS_VectorPool_ControlService {
|
|
51
|
+
return this.pool;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Egy vektor felvétele a memória-pool-ba ÉS tartós upsert-je Mongo-ba (persist-on-write, FAM-minta).
|
|
56
|
+
* A pool `addVector`-ja upsert-szemantikájú (azonos kulcson felülír), a Mongo-oldal is `(collectionKey,
|
|
57
|
+
* vectorId)`-upsert. A Mongo-írás MELLÉKHATÁS a memória-művelet után (a memória a forrás, a Mongo a tár).
|
|
58
|
+
*/
|
|
59
|
+
async addVector(vectorId: string, vector: number[], metadata?: unknown): Promise<void> {
|
|
60
|
+
this.pool.addVector(vectorId, vector);
|
|
61
|
+
await this.getPersistService().upsertVector({
|
|
62
|
+
collectionKey: this.collectionKey,
|
|
63
|
+
vectorId: vectorId,
|
|
64
|
+
embedding: vector,
|
|
65
|
+
metadata: metadata,
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Egy MEGLÉVŐ vektor frissítése a memória-pool-ban + tartós upsert Mongo-ba. A pool `updateVector`-ja
|
|
71
|
+
* dob, ha a kulcs nem létezik (a pool-szerződés változatlan) — a Mongo-írás csak siker után fut.
|
|
72
|
+
*/
|
|
73
|
+
async updateVector(vectorId: string, vector: number[], metadata?: unknown): Promise<void> {
|
|
74
|
+
this.pool.updateVector(vectorId, vector);
|
|
75
|
+
await this.getPersistService().upsertVector({
|
|
76
|
+
collectionKey: this.collectionKey,
|
|
77
|
+
vectorId: vectorId,
|
|
78
|
+
embedding: vector,
|
|
79
|
+
metadata: metadata,
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/** Egy vektor eltávolítása a memória-pool-ból ÉS a tartós tárból (`(collectionKey, vectorId)`). */
|
|
84
|
+
async removeVector(vectorId: string): Promise<void> {
|
|
85
|
+
this.pool.removeVector(vectorId);
|
|
86
|
+
await this.getPersistService().removeVector(this.collectionKey, vectorId);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/** Keresés a memória-pool-on (a wrapped pool `search`-jét delegálja — VÁLTOZATLAN engine). */
|
|
90
|
+
search(query: number[], k: number, mode: LVS_Search_Mode): LVS_SearchResult[] {
|
|
91
|
+
return this.pool.search(query, k, mode);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* BOOT-HIDRATÁLÁS (FAM-minta, BFR-AM-001): a `collectionKey` ÖSSZES perzistált vektorát betölti a
|
|
96
|
+
* MEMÓRIA-pool-ba (`pool.addVector`), így a szerver-restart utáni in-memory index újraépül. A pool-t
|
|
97
|
+
* előbb üríti (idempotens hidratálás). A hiányos (üres `vectorId`/`embedding`) rekordokat átugorja.
|
|
98
|
+
* Visszaadja a betöltött vektorok számát. **NEM** Atlas — saját Mongo + in-memory pool.
|
|
99
|
+
*/
|
|
100
|
+
async hydrateFromMongo(): Promise<number> {
|
|
101
|
+
const records: DyNTS_LVS_VectorPersist_DataModel[] =
|
|
102
|
+
await this.getPersistService().findByCollectionKey(this.collectionKey);
|
|
103
|
+
|
|
104
|
+
this.pool.clearPool();
|
|
105
|
+
|
|
106
|
+
let loaded: number = 0;
|
|
107
|
+
for (const record of records) {
|
|
108
|
+
if (!record.vectorId || !record.embedding?.length) {
|
|
109
|
+
continue;
|
|
110
|
+
}
|
|
111
|
+
this.pool.addVector(record.vectorId, record.embedding);
|
|
112
|
+
loaded++;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
DyFM_Log.log(
|
|
116
|
+
`[DyNTS LVS hydrate] '${this.collectionKey}' pool: ${loaded} vektor betöltve az in-memory pool-ba.`,
|
|
117
|
+
);
|
|
118
|
+
return loaded;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Perzistált rekordok közvetlen hidratálása a memória-pool-ba (Mongo-olvasás NÉLKÜL) — ha a hívó már
|
|
123
|
+
* kezében van a rekord-halmaz (pl. batch-boot). A pool-t előbb üríti (idempotens). Visszaadja a
|
|
124
|
+
* betöltött vektorok számát.
|
|
125
|
+
*/
|
|
126
|
+
hydrate(records: DyNTS_LVS_VectorPersist_DataModel[]): number {
|
|
127
|
+
this.pool.clearPool();
|
|
128
|
+
let loaded: number = 0;
|
|
129
|
+
for (const record of records) {
|
|
130
|
+
if (!record.vectorId || !record.embedding?.length) {
|
|
131
|
+
continue;
|
|
132
|
+
}
|
|
133
|
+
this.pool.addVector(record.vectorId, record.embedding);
|
|
134
|
+
loaded++;
|
|
135
|
+
}
|
|
136
|
+
return loaded;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Lazy persist-data-service (memory: dynts_dataservice_eager_resolve — a base-ctor eager
|
|
141
|
+
* `getDBService`-e miatt NEM tartható élő mezőként).
|
|
142
|
+
*/
|
|
143
|
+
private getPersistService(): DyNTS_LVS_VectorPersist_DataService {
|
|
144
|
+
return new DyNTS_LVS_VectorPersist_DataService({ issuer: this.issuer });
|
|
145
|
+
}
|
|
146
|
+
}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
|
|
2
|
+
import { DyFM_EnvironmentFlag } from '@futdevpro/fsm-dynamo';
|
|
3
|
+
|
|
4
|
+
import { DyNTS_global_settings } from '../../../_collections/global-settings.const';
|
|
5
|
+
import { DyNTS_GlobalService } from '../../../_services/core/global.service';
|
|
6
|
+
import { DyNTS_LVS_VectorPersist_DataModel } from '../_models/data-models/lvs-vector-persist.data-model';
|
|
7
|
+
import { DyNTS_LVS_VectorPersist_DataService } from './lvs-vector-persist.data-service';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* BFR-AM-001 — a `DyNTS_LVS_VectorPersist_DataService` spec-jei. A base-ctor eager `getDBService`-jét
|
|
11
|
+
* stub-oljuk (memory: dynts_dataservice_eager_resolve), így NEM kell élő Mongo. Az upsert atomikus
|
|
12
|
+
* `$set`-jét (Mixed `metadata` — memory: mongoose_mixed_atomic_write) + a dimenzió-tárolást bizonyítja.
|
|
13
|
+
*/
|
|
14
|
+
describe('| DyNTS_LVS_VectorPersist_DataService', () => {
|
|
15
|
+
|
|
16
|
+
let mockDBService: jasmine.SpyObj<{ find: () => Promise<unknown[]>; findOne: () => Promise<unknown> }>;
|
|
17
|
+
|
|
18
|
+
beforeAll(() => {
|
|
19
|
+
if (!DyNTS_global_settings.systemShortCodeName) {
|
|
20
|
+
(DyNTS_global_settings as { systemShortCodeName?: string }).systemShortCodeName = 'TEST';
|
|
21
|
+
}
|
|
22
|
+
if (!DyNTS_global_settings.env_settings) {
|
|
23
|
+
(DyNTS_global_settings as { env_settings?: unknown }).env_settings = {
|
|
24
|
+
environment: DyFM_EnvironmentFlag.local,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
beforeEach(() => {
|
|
30
|
+
mockDBService = jasmine.createSpyObj('DyNTS_DBService', ['find', 'findOne']);
|
|
31
|
+
mockDBService.find.and.returnValue(Promise.resolve([]));
|
|
32
|
+
mockDBService.findOne.and.returnValue(Promise.resolve(null));
|
|
33
|
+
spyOn(DyNTS_GlobalService, 'getDBService').and.returnValue(mockDBService as never);
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
describe('| constructor', () => {
|
|
37
|
+
|
|
38
|
+
it('| should create the service with a data model', () => {
|
|
39
|
+
const data: DyNTS_LVS_VectorPersist_DataModel = new DyNTS_LVS_VectorPersist_DataModel({
|
|
40
|
+
collectionKey: 'pool-a',
|
|
41
|
+
vectorId: 'v1',
|
|
42
|
+
embedding: [1, 2, 3],
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
const service: DyNTS_LVS_VectorPersist_DataService =
|
|
46
|
+
new DyNTS_LVS_VectorPersist_DataService({ data: data, issuer: 'issuer-123' });
|
|
47
|
+
|
|
48
|
+
expect(service).toBeInstanceOf(DyNTS_LVS_VectorPersist_DataService);
|
|
49
|
+
expect(service.data).toBeDefined();
|
|
50
|
+
expect(service.data.vectorId).toBe('v1');
|
|
51
|
+
expect(service.data.collectionKey).toBe('pool-a');
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
it('| should create the service without data', () => {
|
|
55
|
+
const service: DyNTS_LVS_VectorPersist_DataService =
|
|
56
|
+
new DyNTS_LVS_VectorPersist_DataService({ issuer: 'issuer-123' });
|
|
57
|
+
|
|
58
|
+
expect(service).toBeInstanceOf(DyNTS_LVS_VectorPersist_DataService);
|
|
59
|
+
expect(service.data).toBeInstanceOf(DyNTS_LVS_VectorPersist_DataModel);
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
describe('| findByCollectionKey', () => {
|
|
64
|
+
|
|
65
|
+
it('| should query the persisted vectors for a collectionKey', async () => {
|
|
66
|
+
const service: DyNTS_LVS_VectorPersist_DataService =
|
|
67
|
+
new DyNTS_LVS_VectorPersist_DataService({ issuer: 'issuer-123' });
|
|
68
|
+
|
|
69
|
+
const records: DyNTS_LVS_VectorPersist_DataModel[] = [
|
|
70
|
+
new DyNTS_LVS_VectorPersist_DataModel({ collectionKey: 'pool-a', vectorId: 'v1', embedding: [1, 0] }),
|
|
71
|
+
];
|
|
72
|
+
const findSpy = spyOn(service, 'findDataList').and.returnValue(Promise.resolve(records));
|
|
73
|
+
|
|
74
|
+
const result: DyNTS_LVS_VectorPersist_DataModel[] = await service.findByCollectionKey('pool-a');
|
|
75
|
+
|
|
76
|
+
expect(findSpy).toHaveBeenCalledTimes(1);
|
|
77
|
+
const filterArg = findSpy.calls.mostRecent().args[0] as { collectionKey: string };
|
|
78
|
+
expect(filterArg.collectionKey).toBe('pool-a');
|
|
79
|
+
expect(result).toBe(records);
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
describe('| upsertVector — atomic $set + dimension store', () => {
|
|
84
|
+
|
|
85
|
+
it('| should issue an updateOne $set (with dimensions) for an EXISTING record', async () => {
|
|
86
|
+
const service: DyNTS_LVS_VectorPersist_DataService =
|
|
87
|
+
new DyNTS_LVS_VectorPersist_DataService({ issuer: 'issuer-123' });
|
|
88
|
+
|
|
89
|
+
const existing: DyNTS_LVS_VectorPersist_DataModel = new DyNTS_LVS_VectorPersist_DataModel({
|
|
90
|
+
collectionKey: 'pool-a', vectorId: 'v1', embedding: [1, 2, 3],
|
|
91
|
+
});
|
|
92
|
+
existing._id = 'rec-1';
|
|
93
|
+
|
|
94
|
+
spyOn(service, 'findData').and.returnValue(Promise.resolve(existing));
|
|
95
|
+
const updateSpy = spyOn(service, 'updateData').and.returnValue(Promise.resolve());
|
|
96
|
+
const saveSpy = spyOn(service, 'saveData').and.returnValue(Promise.resolve(existing));
|
|
97
|
+
|
|
98
|
+
await service.upsertVector({
|
|
99
|
+
collectionKey: 'pool-a', vectorId: 'v1', embedding: [4, 5, 6, 7], metadata: { tag: 'x' },
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
expect(saveSpy).not.toHaveBeenCalled();
|
|
103
|
+
expect(updateSpy).toHaveBeenCalledTimes(1);
|
|
104
|
+
const arg = updateSpy.calls.mostRecent().args[0] as {
|
|
105
|
+
filterBy: { _id: string };
|
|
106
|
+
update: { $set: { embedding: number[]; dimensions: number; metadata: unknown } };
|
|
107
|
+
};
|
|
108
|
+
expect(arg.filterBy._id).toBe('rec-1');
|
|
109
|
+
expect(arg.update.$set.embedding).toEqual([4, 5, 6, 7]);
|
|
110
|
+
expect(arg.update.$set.dimensions).toBe(4);
|
|
111
|
+
expect(arg.update.$set.metadata).toEqual({ tag: 'x' });
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
it('| should saveData a NEW record (with stored dimensions) when none exists', async () => {
|
|
115
|
+
const service: DyNTS_LVS_VectorPersist_DataService =
|
|
116
|
+
new DyNTS_LVS_VectorPersist_DataService({ issuer: 'issuer-123' });
|
|
117
|
+
|
|
118
|
+
spyOn(service, 'findData').and.returnValue(Promise.resolve(null));
|
|
119
|
+
const updateSpy = spyOn(service, 'updateData').and.returnValue(Promise.resolve());
|
|
120
|
+
const saveSpy = spyOn(service, 'saveData')
|
|
121
|
+
.and.callFake((data?: DyNTS_LVS_VectorPersist_DataModel) =>
|
|
122
|
+
Promise.resolve(data as DyNTS_LVS_VectorPersist_DataModel));
|
|
123
|
+
|
|
124
|
+
await service.upsertVector({ collectionKey: 'pool-a', vectorId: 'v2', embedding: [0.1, 0.2] });
|
|
125
|
+
|
|
126
|
+
expect(updateSpy).not.toHaveBeenCalled();
|
|
127
|
+
expect(saveSpy).toHaveBeenCalledTimes(1);
|
|
128
|
+
const written = saveSpy.calls.mostRecent().args[0] as DyNTS_LVS_VectorPersist_DataModel;
|
|
129
|
+
expect(written.vectorId).toBe('v2');
|
|
130
|
+
expect(written.collectionKey).toBe('pool-a');
|
|
131
|
+
expect(written.embedding).toEqual([0.1, 0.2]);
|
|
132
|
+
expect(written.dimensions).toBe(2);
|
|
133
|
+
});
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
describe('| removeVector', () => {
|
|
137
|
+
|
|
138
|
+
it('| should absolute-delete the matching record', async () => {
|
|
139
|
+
const service: DyNTS_LVS_VectorPersist_DataService =
|
|
140
|
+
new DyNTS_LVS_VectorPersist_DataService({ issuer: 'issuer-123' });
|
|
141
|
+
|
|
142
|
+
const existing: DyNTS_LVS_VectorPersist_DataModel = new DyNTS_LVS_VectorPersist_DataModel({
|
|
143
|
+
collectionKey: 'pool-a', vectorId: 'v1', embedding: [1, 0],
|
|
144
|
+
});
|
|
145
|
+
existing._id = 'rec-1';
|
|
146
|
+
|
|
147
|
+
spyOn(service, 'findData').and.returnValue(Promise.resolve(existing));
|
|
148
|
+
const deleteSpy = spyOn(service, 'deleteData').and.returnValue(Promise.resolve());
|
|
149
|
+
|
|
150
|
+
await service.removeVector('pool-a', 'v1');
|
|
151
|
+
|
|
152
|
+
expect(deleteSpy).toHaveBeenCalledWith('rec-1', true);
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
it('| should be a no-op when no matching record exists', async () => {
|
|
156
|
+
const service: DyNTS_LVS_VectorPersist_DataService =
|
|
157
|
+
new DyNTS_LVS_VectorPersist_DataService({ issuer: 'issuer-123' });
|
|
158
|
+
|
|
159
|
+
spyOn(service, 'findData').and.returnValue(Promise.resolve(null));
|
|
160
|
+
const deleteSpy = spyOn(service, 'deleteData').and.returnValue(Promise.resolve());
|
|
161
|
+
|
|
162
|
+
await service.removeVector('pool-a', 'missing');
|
|
163
|
+
|
|
164
|
+
expect(deleteSpy).not.toHaveBeenCalled();
|
|
165
|
+
});
|
|
166
|
+
});
|
|
167
|
+
});
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
|
|
2
|
+
import { DyFM_DBFilter, DyFM_DBFilterSimple } from '@futdevpro/fsm-dynamo';
|
|
3
|
+
|
|
4
|
+
import { DyNTS_DataService } from '../../../_services/base/data.service';
|
|
5
|
+
import {
|
|
6
|
+
DyNTS_LVS_VectorPersist_DataModel,
|
|
7
|
+
dyNTS_lvsVectorPersist_dataParams,
|
|
8
|
+
} from '../_models/data-models/lvs-vector-persist.data-model';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* `DyNTS_LVS_VectorPersist_DataService` (BFR-AM-001) — a `dynts_lvs_vector` collection CRUD-rétege; a
|
|
12
|
+
* `LVS_VectorPool_ControlService` in-memory pool-jának tartós Mongo-háttértára. `extends
|
|
13
|
+
* DyNTS_DataService`; a nts-konvenció szerinti `{ data?, issuer }` constructor.
|
|
14
|
+
*
|
|
15
|
+
* **FIGYELEM (memory: dynts_dataservice_eager_resolve):** a `DyNTS_DataService` base-ctor EAGER
|
|
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).
|
|
18
|
+
*
|
|
19
|
+
* **Atomikus írás (memory: mongoose_mixed_atomic_write):** az upsert a `(collectionKey, vectorId)`
|
|
20
|
+
* logikai-kulcson MEGLÉVŐ rekordot `updateOne({...},{$set:{embedding,dimensions,metadata}})`-tel
|
|
21
|
+
* frissíti (a Mixed `metadata` `findOne→mutate→save` SILENT-DROP-ja ellen); ÚJ rekordot `saveData`-val ír.
|
|
22
|
+
*/
|
|
23
|
+
export class DyNTS_LVS_VectorPersist_DataService extends DyNTS_DataService<DyNTS_LVS_VectorPersist_DataModel> {
|
|
24
|
+
|
|
25
|
+
constructor(
|
|
26
|
+
set: {
|
|
27
|
+
data?: DyNTS_LVS_VectorPersist_DataModel,
|
|
28
|
+
issuer: string,
|
|
29
|
+
},
|
|
30
|
+
) {
|
|
31
|
+
super(
|
|
32
|
+
set.data instanceof DyNTS_LVS_VectorPersist_DataModel
|
|
33
|
+
? set.data
|
|
34
|
+
: new DyNTS_LVS_VectorPersist_DataModel(set.data),
|
|
35
|
+
dyNTS_lvsVectorPersist_dataParams,
|
|
36
|
+
set.issuer,
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
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).
|
|
43
|
+
*/
|
|
44
|
+
async findByCollectionKey(collectionKey: string): Promise<DyNTS_LVS_VectorPersist_DataModel[]> {
|
|
45
|
+
return this.findDataList(
|
|
46
|
+
{ collectionKey: collectionKey } as DyFM_DBFilterSimple<DyNTS_LVS_VectorPersist_DataModel>,
|
|
47
|
+
true,
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Egy vektor ATOMIKUS upsert-je a `(collectionKey, vectorId)` logikai-kulcson. MEGLÉVŐ rekordnál
|
|
53
|
+
* `$set` (a Mixed `metadata` silent-drop ellen — memory: mongoose_mixed_atomic_write); ÚJ rekordnál
|
|
54
|
+
* `saveData`. A dimenzió az `embedding.length`-ből rögzül.
|
|
55
|
+
*/
|
|
56
|
+
async upsertVector(set: {
|
|
57
|
+
collectionKey: string,
|
|
58
|
+
vectorId: string,
|
|
59
|
+
embedding: number[],
|
|
60
|
+
metadata?: unknown,
|
|
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>,
|
|
64
|
+
true,
|
|
65
|
+
);
|
|
66
|
+
|
|
67
|
+
if (existing?._id) {
|
|
68
|
+
await this.updateData({
|
|
69
|
+
filterBy: { _id: existing._id } as DyFM_DBFilterSimple<DyNTS_LVS_VectorPersist_DataModel>,
|
|
70
|
+
update: {
|
|
71
|
+
$set: {
|
|
72
|
+
embedding: set.embedding,
|
|
73
|
+
dimensions: set.embedding.length,
|
|
74
|
+
metadata: set.metadata,
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
});
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
await this.saveData(
|
|
82
|
+
new DyNTS_LVS_VectorPersist_DataModel({
|
|
83
|
+
collectionKey: set.collectionKey,
|
|
84
|
+
vectorId: set.vectorId,
|
|
85
|
+
embedding: set.embedding,
|
|
86
|
+
dimensions: set.embedding.length,
|
|
87
|
+
metadata: set.metadata,
|
|
88
|
+
}),
|
|
89
|
+
true,
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Egy vektor-rekord végleges törlése a `(collectionKey, vectorId)` logikai-kulcson (a pool
|
|
95
|
+
* `removeVector`-ja után — a tartós tár is törli). `addArchive` nincs → `absolute` true-val töröl.
|
|
96
|
+
*/
|
|
97
|
+
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>,
|
|
100
|
+
true,
|
|
101
|
+
);
|
|
102
|
+
if (existing?._id) {
|
|
103
|
+
await this.deleteData(existing._id, true);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
@@ -6,7 +6,12 @@ export * from './_enums/lvs-search-mode.enum';
|
|
|
6
6
|
// INTERFACES
|
|
7
7
|
export * from './_models/lvs-search-result.interface';
|
|
8
8
|
|
|
9
|
+
// DATA MODELS
|
|
10
|
+
export * from './_models/data-models/lvs-vector-persist.data-model';
|
|
11
|
+
|
|
9
12
|
// SERVICES
|
|
10
13
|
export * from './_services/lvs-doc-chunk-data.service';
|
|
11
14
|
export * from './_services/lvs-local-vector-search.data-service';
|
|
12
|
-
export * from './_services/lvs-vector-pool.control-service';
|
|
15
|
+
export * from './_services/lvs-vector-pool.control-service';
|
|
16
|
+
export * from './_services/lvs-vector-persist.data-service';
|
|
17
|
+
export * from './_services/lvs-persistent-vector-pool.control-service';
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP-réteg shared vokabulár (BFR-AM-003) — a domain-agnosztikus MCP-szerver-base + adaptor közös
|
|
3
|
+
* típusai. Egy fájlban a szorosan összetartozó tool-/transport-típusok (`*.interface.ts` az
|
|
4
|
+
* egy-export-per-file konvenció ismert kivétele a tightly-coupled shape-ekre).
|
|
5
|
+
*
|
|
6
|
+
* Boundary: a `DyNTS_McpToolDefinition` + a `DyNTS_Mcp_Adapter` egyetlen `registerTool` choke-pontot
|
|
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
|
|
9
|
+
* consumer-tool-ok változatlanok). A consumer a SAJÁT tool-jait regisztrálja (a bedrock NEM definiál
|
|
10
|
+
* domain-tool-okat — csak a server-base + a transport + a registry).
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Egy JSON-schema fragment (a tool input-schema-jának típusa). Szabad-formájú JSON-objektum (a
|
|
15
|
+
* draft-07 / MCP tool-schema dialektusa); a `properties`/`required`/`type` mezők gyakoriak, de a
|
|
16
|
+
* shape nem kényszerített (az MCP-kliens a `tools/list`-ben kapja vissza, ahogy van).
|
|
17
|
+
*/
|
|
18
|
+
export interface DyNTS_Mcp_JsonSchema {
|
|
19
|
+
/** A JSON-schema gyökér-típusa (a tool input-ja jellemzően `object`). */
|
|
20
|
+
type: string;
|
|
21
|
+
/** A property-leírások (kulcs → al-schema). */
|
|
22
|
+
properties?: { [key: string]: DyNTS_Mcp_JsonSchema };
|
|
23
|
+
/** Kötelező property-nevek. */
|
|
24
|
+
required?: string[];
|
|
25
|
+
/** Array-elem schema (`type: 'array'` esetén). */
|
|
26
|
+
items?: DyNTS_Mcp_JsonSchema;
|
|
27
|
+
/** Enum-értékek (string/number/boolean literál-halmaz). */
|
|
28
|
+
enum?: (string | number | boolean)[];
|
|
29
|
+
/** Emberi leírás (a tool-választáshoz; az LLM ezt olvassa). */
|
|
30
|
+
description?: string;
|
|
31
|
+
/** Default érték (a kliens-hint). */
|
|
32
|
+
default?: unknown;
|
|
33
|
+
/** Engedi-e a nem-leírt property-ket (`object` schema-n). */
|
|
34
|
+
additionalProperties?: boolean;
|
|
35
|
+
/** Beágyazott `oneOf`/`anyOf` alternatívák. */
|
|
36
|
+
oneOf?: DyNTS_Mcp_JsonSchema[];
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Egy MCP tool-handler kimenete (a transport-agnosztikus core ezt adja; az adaptor MCP-tool-result-tá
|
|
41
|
+
* fordítja). A `data` a strukturált JSON-payload; az `isError` jelzi a strukturált hibát — a néma
|
|
42
|
+
* hiba TILOS (a hiba MINDIG `isError:true` payload VAGY dobott exception, amit az adaptor egységesen
|
|
43
|
+
* `isError`-re fordít).
|
|
44
|
+
*/
|
|
45
|
+
export interface DyNTS_Mcp_ToolOutcome {
|
|
46
|
+
/** A strukturált eredmény-payload (a tool output-shape JSON-ja). */
|
|
47
|
+
data: unknown;
|
|
48
|
+
/** `true`, ha a kimenet strukturált hiba — az adaptor `isError`-re fordítja. */
|
|
49
|
+
isError?: boolean;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Egy tool-handler aláírása. Az `args` a nyers tool-argumentumok (JSON); a handler a saját
|
|
54
|
+
* input-shape-jére validál + a `DyNTS_Mcp_ToolOutcome`-ot adja. A hibát NEM nyeli el (strukturált
|
|
55
|
+
* hiba-payload `isError:true`-val VAGY dobott exception, amit az adaptor egységes MCP-error-ré fordít).
|
|
56
|
+
*/
|
|
57
|
+
export type DyNTS_Mcp_ToolHandler = (args: unknown) => Promise<DyNTS_Mcp_ToolOutcome>;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Egy MCP tool-definíció (a `registerTool` egységes shape-je). A consumer ezt a shape-et használja az
|
|
61
|
+
* advertised halmazba (`name`+`description`+`inputSchema`+`handler`). A `tools/list` a regisztrált
|
|
62
|
+
* tool-ok `name`/`description`/`inputSchema`-ját hirdeti.
|
|
63
|
+
*/
|
|
64
|
+
export interface DyNTS_Mcp_ToolDefinition {
|
|
65
|
+
/** A tool neve (a `tools/list`-ben + a `tools/call` dispatch-kulcsa — UNIK kell legyen). */
|
|
66
|
+
name: string;
|
|
67
|
+
/** Agent-barát leírás (mikor melyik tool; az LLM ezt olvassa a tool-választáshoz). */
|
|
68
|
+
description: string;
|
|
69
|
+
/** A tool input JSON-schema-ja (a `tools/list` ezt hirdeti). */
|
|
70
|
+
inputSchema: DyNTS_Mcp_JsonSchema;
|
|
71
|
+
/** A handler (a transport-agnosztikus core-logika). */
|
|
72
|
+
handler: DyNTS_Mcp_ToolHandler;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Az MCP-szerver identitása (a SDK `serverInfo`-ja). A `name`/`version` a kliensnek hirdetett.
|
|
77
|
+
*/
|
|
78
|
+
export interface DyNTS_Mcp_ServerInfo {
|
|
79
|
+
/** A szerver neve (a kliensnek hirdetett `serverInfo.name`). */
|
|
80
|
+
name: string;
|
|
81
|
+
/** A szerver verziója (a kliensnek hirdetett `serverInfo.version`). */
|
|
82
|
+
version: string;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* A támogatott transport-fajták. MVP: `stdio` (a JSON-RPC a stdin/stdout-on). A `start({transport})`
|
|
87
|
+
* ezzel választ — egy jövőbeli transport (pl. `http`/`sse`) NON-breaking módon bővíthető (csak az
|
|
88
|
+
* adaptor `start`-ja kap új ágat; a server-base + a tool-ok változatlanok).
|
|
89
|
+
*/
|
|
90
|
+
export type DyNTS_Mcp_TransportKind = 'stdio';
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* A `start()` opciói. A `transport` választja a csatornát (default `stdio`).
|
|
94
|
+
*/
|
|
95
|
+
export interface DyNTS_Mcp_StartOptions {
|
|
96
|
+
/** A transport-csatorna (default `stdio`). */
|
|
97
|
+
transport?: DyNTS_Mcp_TransportKind;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Egy MCP `tools/call` strukturált eredménye (a transport-payload shape-je). Az adaptor ezt termeli;
|
|
102
|
+
* a `content` egy text-JSON blokk, az `isError` a strukturált-hiba jelzés. Ez a SDK
|
|
103
|
+
* `CallToolResult`-tal wire-kompatibilis al-shape (a SDK-t az adaptor izolálja, ezért itt a saját,
|
|
104
|
+
* SDK-független shape él).
|
|
105
|
+
*/
|
|
106
|
+
export interface DyNTS_Mcp_CallResult {
|
|
107
|
+
/** A tartalom-blokkok (MVP: egyetlen `text`-JSON blokk). */
|
|
108
|
+
content: { type: 'text'; text: string }[];
|
|
109
|
+
/** `true`, ha a hívás strukturált hibával végződött (no-silent-failure). */
|
|
110
|
+
isError?: boolean;
|
|
111
|
+
}
|