@futdevpro/fdp-agent-memory 0.1.0 → 1.1.14
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/LICENSE +21 -0
- package/README.md +7 -7
- package/build/package.json +6 -5
- package/build/src/_cli/_collections/fam-arg.util.js +48 -0
- package/build/src/_cli/_collections/fam-cli.const.js +40 -0
- package/build/src/_cli/_collections/fam-output.util.js +86 -0
- package/build/src/_cli/_collections/fam-project-discovery.util.js +98 -0
- package/build/src/_cli/_commands/capture.command.js +73 -0
- package/build/src/_cli/_commands/config.command.js +93 -0
- package/build/src/_cli/_commands/doctor.command.js +124 -0
- package/build/src/_cli/_commands/errors.command.js +66 -0
- package/build/src/_cli/_commands/export.command.js +65 -0
- package/build/src/_cli/_commands/find-duplicates.command.js +97 -0
- package/build/src/_cli/_commands/import.command.js +136 -0
- package/build/src/_cli/_commands/init.command.js +147 -0
- package/build/src/_cli/_commands/read.command.js +109 -0
- package/build/src/_cli/_commands/scan-projects.command.js +138 -0
- package/build/src/_cli/_commands/scan.command.js +98 -0
- package/build/src/_cli/_commands/seed.command.js +40 -0
- package/build/src/_cli/_commands/serve.command.js +373 -0
- package/build/src/_cli/_commands/start.command.js +134 -0
- package/build/src/_cli/_commands/stats.command.js +54 -0
- package/build/src/_cli/_commands/write.command.js +103 -0
- package/build/src/_cli/_models/interfaces/fam-cli-global-options.interface.js +2 -0
- package/build/src/_cli/_models/interfaces/fam-cli-output.interface.js +9 -0
- package/build/src/_cli/_models/interfaces/fam-client-result.interface.js +2 -0
- package/build/src/_cli/_services/fam-client.service.js +140 -0
- package/build/src/_cli/register-commands.js +86 -0
- package/build/src/_collections/config-catalog.const.js +67 -1
- package/build/src/_collections/fam-console.util.js +367 -0
- package/build/src/_collections/fam-entry-bootstrap.util.js +158 -4
- package/build/src/_collections/fam-error-factory.util.js +0 -9
- package/build/src/_collections/fam-mcp-bridge.util.js +49 -0
- package/build/src/_collections/fam-reference-code.util.js +105 -0
- package/build/src/_collections/fam-version.const.js +10 -0
- package/build/src/_models/data-models/fam-entry-base-properties.const.js +1 -0
- package/build/src/_models/data-models/fam-entry.data-model.js +6 -0
- package/build/src/_models/data-models/fam-ingest-run.data-model.js +3 -1
- package/build/src/_models/data-models/fam-reference.data-model.js +7 -0
- package/build/src/_modules/capture/_collections/fam-capture.const.js +11 -0
- package/build/src/_modules/capture/_services/fam-auto-capture.control-service.js +87 -0
- package/build/src/_modules/capture/index.js +8 -0
- package/build/src/_modules/embedding/_collections/fam-embedding-prefix.util.js +77 -0
- package/build/src/_modules/embedding/_services/fam-duplicate-scan.control-service.js +202 -0
- package/build/src/_modules/embedding/_services/fam-embedding-pipeline.control-service.js +33 -9
- package/build/src/_modules/embedding/_services/fam-embedding.control-service.js +21 -2
- package/build/src/_modules/embedding/_services/fam-entry.data-service.js +135 -0
- package/build/src/_modules/embedding/_services/fam-vector-search.control-service.js +42 -32
- package/build/src/_modules/embedding/index.js +4 -1
- package/build/src/_modules/export/_collections/fam-export.const.js +22 -0
- package/build/src/_modules/export/_services/fam-export.control-service.js +64 -0
- package/build/src/_modules/export/index.js +8 -0
- package/build/src/_modules/ingest/_collections/fam-famignore.util.js +83 -0
- package/build/src/_modules/ingest/_collections/fam-file-routing.util.js +59 -48
- package/build/src/_modules/ingest/_collections/fam-git-repo.util.js +193 -0
- package/build/src/_modules/ingest/_collections/fam-project-identity.util.js +134 -0
- package/build/src/_modules/ingest/_collections/fam-scan-progress.util.js +57 -0
- package/build/src/_modules/ingest/_collections/fam-scan-summary.util.js +60 -0
- package/build/src/_modules/ingest/_collections/fam-scan-weight.util.js +53 -0
- package/build/src/_modules/ingest/_collections/fam-secret-exclude.util.js +37 -14
- package/build/src/_modules/ingest/_collections/fam-sliding-chunker.util.js +34 -0
- package/build/src/_modules/ingest/_collections/fam-ts-chunker.util.js +200 -14
- package/build/src/_modules/ingest/_services/fam-delta-compare.util.js +4 -1
- package/build/src/_modules/ingest/_services/fam-ingest-run.data-service.js +7 -4
- package/build/src/_modules/ingest/_services/fam-ingest.control-service.js +349 -17
- package/build/src/_modules/ingest/_services/fam-scan.control-service.js +25 -2
- package/build/src/_modules/ingest/index.js +3 -1
- package/build/src/_modules/mcp/_collections/fam-active-rules.util.js +56 -0
- package/build/src/_modules/mcp/_collections/fam-core-tools.const.js +47 -6
- package/build/src/_modules/mcp/_services/fam-capabilities-tool.service.js +4 -4
- package/build/src/_modules/mcp/_services/fam-capability-registry.service.js +224 -18
- package/build/src/_modules/mcp/_services/fam-mcp-adapter.service.js +4 -4
- package/build/src/_modules/mcp/_services/fam-mcp-server.service.js +4 -4
- package/build/src/_modules/mcp/_services/fam-read-tool.service.js +53 -1
- package/build/src/_modules/mcp/_services/fam-write-tool.service.js +104 -8
- package/build/src/_modules/mcp/index.js +4 -4
- package/build/src/_modules/migration/_collections/fam-claude-mem-normalize.util.js +66 -3
- package/build/src/_modules/migration/_collections/fam-prompt-aggregate.util.js +143 -0
- package/build/src/_modules/migration/_collections/fam-target-mapping.util.js +19 -0
- package/build/src/_modules/migration/_enums/fam-claude-mem-source.type-enum.js +6 -0
- package/build/src/_modules/migration/_models/interfaces/fam-claude-mem.interface.js +5 -0
- package/build/src/_modules/migration/_services/fam-agent-memory-reader.service.js +125 -0
- package/build/src/_modules/migration/_services/fam-claude-mem-import.control-service.js +101 -18
- package/build/src/_modules/migration/_services/fam-import-dedup.data-service.js +53 -0
- package/build/src/_modules/migration/index.js +3 -1
- package/build/src/_modules/retrieval/_services/fam-retrieval-candidate.data-service.js +78 -4
- package/build/src/_modules/retrieval/_services/fam-retrieval.control-service.js +293 -50
- package/build/src/_modules/scope-reference/_collections/fam-scope-normalize.util.js +6 -3
- package/build/src/_modules/scope-reference/_services/fam-reference.data-service.js +18 -0
- package/build/src/_modules/scope-reference/_services/fam-scope-resolver.control-service.js +79 -20
- package/build/src/_routes/server/api/api.controller.js +34 -2
- package/build/src/_routes/server/client-app/client-app.control-service.js +1 -1
- package/build/src/_routes/server/server-status/server-status.controller.js +2 -1
- package/build/src/app.server.js +13 -1
- package/build/src/environments/environment.js +1 -1
- package/build/src/index.js +1 -1
- package/client-dist/{chunk-GHKRM4SM.js → chunk-I77GXVAQ.js} +1 -1
- package/client-dist/{chunk-LMTL7GA3.js → chunk-YXHWCJ5O.js} +1 -1
- package/client-dist/index.html +1 -1
- package/client-dist/{main-2KWB3QYK.js → main-PJPEDVJT.js} +1 -1
- package/package.json +6 -5
|
@@ -115,7 +115,11 @@ class FAM_ScopeResolver_ControlService {
|
|
|
115
115
|
async fuzzyResolve(rawToken, context) {
|
|
116
116
|
const reference_DS = new fam_reference_data_service_1.FAM_Reference_DataService({ issuer: this.issuer });
|
|
117
117
|
const allReferences = await this.getActiveReferences();
|
|
118
|
-
|
|
118
|
+
// Negatív-alias veto (disambiguáció): a tokent EXPLICIT disclaim-elő reference-eket kiszűrjük MÁR a matching
|
|
119
|
+
// ELŐTT (exact + string-fuzzy + vektor egyaránt) → nem keveredik egy hasonló nevű, de más fogalommal.
|
|
120
|
+
const normalizedToken = fam_scope_normalize_util_1.FAM_ScopeNormalize_Util.normalize(rawToken);
|
|
121
|
+
const references = reference_DS.filterByContext(allReferences, context)
|
|
122
|
+
.filter((reference) => !fam_reference_data_service_1.FAM_Reference_DataService.vetoesToken(normalizedToken, reference));
|
|
119
123
|
const candidates = [];
|
|
120
124
|
// (1) Exact fast-path (score 1.0).
|
|
121
125
|
const exact = reference_DS.exactMatch(rawToken, references);
|
|
@@ -142,6 +146,12 @@ class FAM_ScopeResolver_ControlService {
|
|
|
142
146
|
* A token embeddelése a vektor-fuzzy-hoz (MP-2 `FAM_Embedding_ControlService`). Bármilyen hiba /
|
|
143
147
|
* üres pool / nincs provider → üres vektor + `warn` (graceful degrade — a string-fuzzy ág teljes
|
|
144
148
|
* értékű marad MP-2 nélkül; dsgn-002 §3.1 SP-3.2 kockázat). NEM dob, NEM néma (warn-log).
|
|
149
|
+
*
|
|
150
|
+
* **FEAT-004 figyelem (F4-2):** a `callType: 'embed-query'` itt SZÁNDÉKOS — az alias-match query↔query
|
|
151
|
+
* hasonlóság (token vs canonicalTerm), NEM query↔document. Ha valaha bekötöd a reference DOC-ok
|
|
152
|
+
* (`FAM_Reference.contentVector`) embeddelését, az is `'embed-query'`-vel menjen (azonos task-prefix-
|
|
153
|
+
* séma), KÜLÖNBEN a FEAT-004 query/document aszimmetria (`search_query:` vs `search_document:`)
|
|
154
|
+
* elrontaná a cosine-egyezést. (Jelenleg a reference doc-vektor SEHOL nem készül → a vektor-fuzzy dormant.)
|
|
145
155
|
*/
|
|
146
156
|
async embedTokenSafe(rawToken) {
|
|
147
157
|
try {
|
|
@@ -220,22 +230,27 @@ class FAM_ScopeResolver_ControlService {
|
|
|
220
230
|
let parentScopeId = undefined;
|
|
221
231
|
for (const rawLayer of rawScopePath) {
|
|
222
232
|
const candidates = await this.fuzzyResolve(rawLayer.rawName, { scopeLayer: rawLayer.layer });
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
233
|
+
// FAM-REV-059: a write-resolve KONZERVATÍV — csak EXACT reference-match (a rawName pontos alias/canonical)
|
|
234
|
+
// redirect-elhet egy meglévő (akár MÁS nevű) scope-ra; a FUZZY match (string/vektor) NEM, különben a
|
|
235
|
+
// hasonló nevű TESTVÉR-package-ek keresztbe-scope-olódnak ("ngx-dynamo" ~80% ~ "nts-dynamo" → az ngx az
|
|
236
|
+
// nts scope-ba kerülne). Ambiguus CSAK több KÜLÖNBÖZŐ EXACT match esetén (két scope ugyanazt a pontos
|
|
237
|
+
// aliast állítja); a fuzzy-ambiguitás NEM blokkol — a write a RAW nevet használja (a near-match note-olva).
|
|
238
|
+
const exacts = candidates.filter((candidate) => candidate.matchSource === 'exact');
|
|
239
|
+
if (exacts.length > 1) {
|
|
240
|
+
throw this.ambiguousError(rawLayer, exacts, minScore);
|
|
226
241
|
}
|
|
227
242
|
const resolved = await this.resolveOneWriteLayer({
|
|
228
243
|
rawLayer: rawLayer,
|
|
229
|
-
|
|
230
|
-
classification: classification,
|
|
244
|
+
exactCandidate: exacts[0],
|
|
231
245
|
parentScopeId: parentScopeId,
|
|
232
246
|
autoCreate: autoCreate,
|
|
233
247
|
scopeDataService: scope_DS,
|
|
234
248
|
});
|
|
235
249
|
layers.push(resolved);
|
|
236
250
|
parentScopeId = resolved.scopeRef.scopeId;
|
|
237
|
-
//
|
|
238
|
-
|
|
251
|
+
// Nincs exact, de van confident fuzzy near-match → uncertaintyNote (a write a RAW nevet használta — a
|
|
252
|
+
// hívó lássa, hogy volt hasonló nevű scope; NEM hiba, NEM néma redirect — FAM-REV-059).
|
|
253
|
+
if (!exacts.length && candidates.length && this.classifyResolution(candidates, minScore) !== 'no-match') {
|
|
239
254
|
uncertaintyNotes.push(this.toUncertaintyNote(rawLayer.rawName, candidates));
|
|
240
255
|
}
|
|
241
256
|
}
|
|
@@ -246,27 +261,26 @@ class FAM_ScopeResolver_ControlService {
|
|
|
246
261
|
};
|
|
247
262
|
}
|
|
248
263
|
/**
|
|
249
|
-
* Egy write-layer feloldása (a `resolveForWrite` belső lépése). `
|
|
250
|
-
*
|
|
251
|
-
* (ha
|
|
264
|
+
* Egy write-layer feloldása (a `resolveForWrite` belső lépése, FAM-REV-059). Az `exactCandidate` az EGYETLEN
|
|
265
|
+
* EXACT reference-match (a rawName pontos aliasa/canonical-ja), vagy `undefined`. (a) ha scope-entitásra mutat
|
|
266
|
+
* → annak scopeId-ja; (b) ha csak fogalmi alias → a canonical néven find-or-create; (c) ha NINCS exact (fuzzy/
|
|
267
|
+
* no-match) → a NYERS néven find-or-create (a fuzzy NEM redirect-el a hasonló testvér-névre). Auto-regiszt csak
|
|
268
|
+
* ha `autoCreate`, KÜLÖNBEN `FAM-REF-RESOLVE-001`.
|
|
252
269
|
*/
|
|
253
270
|
async resolveOneWriteLayer(set) {
|
|
254
|
-
// (a)
|
|
255
|
-
if (set.
|
|
256
|
-
|
|
257
|
-
return { scopeRef: ref, created: false };
|
|
271
|
+
// (a) EXACT reference-match, ami EGY konkrét scope-entitásra mutat → annak a scopeId-ja.
|
|
272
|
+
if (set.exactCandidate?.canonicalScopeRef?.scopeId) {
|
|
273
|
+
return { scopeRef: set.exactCandidate.canonicalScopeRef, created: false };
|
|
258
274
|
}
|
|
259
|
-
// (b)
|
|
260
|
-
|
|
261
|
-
const isConfident = set.classification === 'confident' && set.candidates.length > 0;
|
|
262
|
-
const canonicalName = isConfident ? set.candidates[0].canonicalTerm : set.rawLayer.rawName;
|
|
275
|
+
// (b) EXACT, de csak fogalmi alias (nincs scope-ref): a canonical néven. (c) NINCS exact: a NYERS néven.
|
|
276
|
+
const canonicalName = set.exactCandidate ? set.exactCandidate.canonicalTerm : set.rawLayer.rawName;
|
|
263
277
|
// Determinisztikus de-dup: a (normalizált név + layer + parent) hármasra már létezik-e?
|
|
264
278
|
const existing = await set.scopeDataService.findByCanonical(set.rawLayer.layer, canonicalName, set.parentScopeId);
|
|
265
279
|
if (existing.length && existing[0]._id) {
|
|
266
280
|
return { scopeRef: this.toScopeRef(existing[0]), created: false };
|
|
267
281
|
}
|
|
268
282
|
if (!set.autoCreate) {
|
|
269
|
-
throw this.noMatchError(set.rawLayer, set.
|
|
283
|
+
throw this.noMatchError(set.rawLayer, set.exactCandidate ? [set.exactCandidate] : [], await this.resolveFuzzyMinScore());
|
|
270
284
|
}
|
|
271
285
|
// Auto-regiszt (createdBy='agent-write', parent = az előző layer scopeId-ja).
|
|
272
286
|
const created = await set.scopeDataService.findOrCreateScope({
|
|
@@ -322,6 +336,15 @@ class FAM_ScopeResolver_ControlService {
|
|
|
322
336
|
*/
|
|
323
337
|
async resolveReadLayerScopeIds(set) {
|
|
324
338
|
if (set.classification === 'no-match') {
|
|
339
|
+
// Reference-index MISS → fallback a scope-ENTITÁSOKRA (a write-path `findByCanonical`-jával
|
|
340
|
+
// szimmetrikusan, dsgn-002 §3.2). A `scan` a scope-entitást létrehozza, de `fam_reference`
|
|
341
|
+
// alias-bejegyzést NEM — enélkül a read-filter SOHA nem oldódna fel (FAM-REF-RESOLVE-001),
|
|
342
|
+
// pedig a scope a fán LÉTEZIK. Ha van canonical-név-match erre a layerre → annak a subtree-ja;
|
|
343
|
+
// csak ha ez is üres → a feloldhatatlan-filter hiba (nincs csendes üres-prefilter).
|
|
344
|
+
const entityScopeIds = await this.entityFallbackScopeIds(set.rawLayer, set.scopeDataService);
|
|
345
|
+
if (entityScopeIds.length) {
|
|
346
|
+
return entityScopeIds;
|
|
347
|
+
}
|
|
325
348
|
throw this.noMatchError(set.rawLayer, set.candidates, set.minScore);
|
|
326
349
|
}
|
|
327
350
|
// A confident (top-1) + az ambiguous-multi (a >= minScore közeli kandidátusok) scope-jai.
|
|
@@ -343,6 +366,23 @@ class FAM_ScopeResolver_ControlService {
|
|
|
343
366
|
}
|
|
344
367
|
return result;
|
|
345
368
|
}
|
|
369
|
+
/**
|
|
370
|
+
* Read-filter fallback (a `no-match` ág): egy raw-layer canonical-nevének EXACT match-e a
|
|
371
|
+
* scope-ENTITÁSOK fáján (a reference-indexet megkerülve), majd a match(ek) `getSubtreeScopeIds`
|
|
372
|
+
* uniója. A `scan` scope-entitást ír, de `fam_reference` alias-t NEM — ez teszi a read-filtert
|
|
373
|
+
* feloldhatóvá reference-bejegyzés nélkül is. Üres lista = nincs entitás-match.
|
|
374
|
+
*/
|
|
375
|
+
async entityFallbackScopeIds(rawLayer, scopeDataService) {
|
|
376
|
+
const matches = await scopeDataService.findByCanonical(rawLayer.layer, rawLayer.rawName);
|
|
377
|
+
const result = [];
|
|
378
|
+
for (const scope of matches) {
|
|
379
|
+
if (scope._id) {
|
|
380
|
+
const subtree = await scopeDataService.getSubtreeScopeIds(scope._id);
|
|
381
|
+
result.push(...subtree);
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
return result;
|
|
385
|
+
}
|
|
346
386
|
/**
|
|
347
387
|
* Egy kandidátus → a fán létező scopeId (read-expand). Ha a kandidátus konkrét scope-ref-et hordoz
|
|
348
388
|
* → annak az scopeId-ja; egyébként a canonical néven keresünk a layerben (a read NEM hoz létre
|
|
@@ -382,12 +422,17 @@ class FAM_ScopeResolver_ControlService {
|
|
|
382
422
|
async traceResolution(rawTokens, mode) {
|
|
383
423
|
const minScore = await this.resolveFuzzyMinScore();
|
|
384
424
|
const queryVectorAvailable = (await this.embedTokenSafe(rawTokens[0]?.rawName ?? '')).length > 0;
|
|
425
|
+
const scope_DS = new fam_scope_data_service_1.FAM_Scope_DataService({ issuer: this.issuer });
|
|
385
426
|
const steps = [];
|
|
386
427
|
for (const rawLayer of rawTokens) {
|
|
387
428
|
const context = mode === 'query-expand' ? undefined : { scopeLayer: rawLayer.layer };
|
|
388
429
|
const candidates = await this.fuzzyResolve(rawLayer.rawName, context);
|
|
389
430
|
const classification = this.classifyResolution(candidates, minScore);
|
|
390
431
|
const decided = classification === 'confident' ? candidates[0] : undefined;
|
|
432
|
+
// FAM-REV-041: a reference-réteg után az entity-fallback (scope-entitás canonical-match) is a
|
|
433
|
+
// trace-be — ez oldja fel a valós write/read scope-ot üres reference-indexnél is (nincs hamis
|
|
434
|
+
// no-match egy létező scope-ra). Query-expand módban (nincs layer) kihagyjuk.
|
|
435
|
+
const entityFallback = mode === 'query-expand' ? undefined : await this.traceEntityFallback(rawLayer, scope_DS);
|
|
391
436
|
steps.push({
|
|
392
437
|
rawToken: rawLayer.rawName,
|
|
393
438
|
normalizedForm: fam_scope_normalize_util_1.FAM_ScopeNormalize_Util.normalize(rawLayer.rawName),
|
|
@@ -396,6 +441,7 @@ class FAM_ScopeResolver_ControlService {
|
|
|
396
441
|
classification: classification,
|
|
397
442
|
decidedMatchSource: decided?.matchSource,
|
|
398
443
|
decidedCanonical: decided?.canonicalTerm,
|
|
444
|
+
entityFallback: entityFallback,
|
|
399
445
|
});
|
|
400
446
|
}
|
|
401
447
|
const cacheAge = this.referenceCache ? Date.now() - this.referenceCache.loadedAt : 0;
|
|
@@ -406,6 +452,19 @@ class FAM_ScopeResolver_ControlService {
|
|
|
406
452
|
referenceCacheAgeMs: cacheAge,
|
|
407
453
|
};
|
|
408
454
|
}
|
|
455
|
+
/**
|
|
456
|
+
* Egy raw-layer entity-fallback trace-e (FAM-REV-041): a scope-ENTITÁSOK fáján canonical-név-match
|
|
457
|
+
* (`findByCanonical` — ugyanaz a kulcs, amit a write `resolveOneWriteLayer` és a read
|
|
458
|
+
* `entityFallbackScopeIds` használ). NEM mutál (nem hoz létre scope-ot) — csak diagnosztika.
|
|
459
|
+
*/
|
|
460
|
+
async traceEntityFallback(rawLayer, scopeDataService) {
|
|
461
|
+
const matches = await scopeDataService.findByCanonical(rawLayer.layer, rawLayer.rawName);
|
|
462
|
+
const hit = matches.find((scope) => !!scope._id);
|
|
463
|
+
if (hit && hit._id) {
|
|
464
|
+
return { matched: true, scopeId: hit._id, canonicalName: hit.canonicalName };
|
|
465
|
+
}
|
|
466
|
+
return { matched: false };
|
|
467
|
+
}
|
|
409
468
|
// =========================================================================
|
|
410
469
|
// UNCERTAINTY + hiba-építés (dsgn-002 §4, SP-3.4)
|
|
411
470
|
// =========================================================================
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Api_Controller = void 0;
|
|
4
4
|
const fsm_dynamo_1 = require("@futdevpro/fsm-dynamo");
|
|
5
5
|
const nts_dynamo_1 = require("@futdevpro/nts-dynamo");
|
|
6
|
+
const fam_version_const_1 = require("../../../_collections/fam-version.const");
|
|
6
7
|
const fam_table_type_enum_1 = require("../../../_enums/fam-table.type-enum");
|
|
7
8
|
const fam_config_level_type_enum_1 = require("../../../_enums/fam-config-level.type-enum");
|
|
8
9
|
const config_control_service_1 = require("../config/config.control-service");
|
|
@@ -22,7 +23,7 @@ const MAIN_TABLES = [
|
|
|
22
23
|
* belépési pontja: a 3 core-tool **REST-tükre** + a UI-specifikus listázó/stat/ingest endpoint-ok.
|
|
23
24
|
* A REST-handler UGYANAZT a transport-agnosztikus core-service-t hívja, mint az MCP-réteg
|
|
24
25
|
* (`FAM_ReadTool_Service`/`FAM_WriteTool_Service`/`FAM_CapabilitiesTool_Service`) — paritás-garancia,
|
|
25
|
-
* no-duplication (dsgn-003 §6.5). No-auth, lokál, port
|
|
26
|
+
* no-duplication (dsgn-003 §6.5). No-auth, lokál, port 39265 (ADR-004).
|
|
26
27
|
*
|
|
27
28
|
* **Endpoint-felület (a kód-szintű kontraktus — a formális `__documentations/server-api.md` follow-up;
|
|
28
29
|
* dsgn-013 user-jóváhagyásra vár):** lásd a modul `README.md`-jét.
|
|
@@ -53,6 +54,7 @@ class Api_Controller extends nts_dynamo_1.DyNTS_Controller {
|
|
|
53
54
|
this.statsEndpoint(),
|
|
54
55
|
this.statsTableEndpoint(),
|
|
55
56
|
this.ingestRunsEndpoint(),
|
|
57
|
+
this.duplicatesEndpoint(),
|
|
56
58
|
this.configGetEndpoint(),
|
|
57
59
|
this.configSetEndpoint(),
|
|
58
60
|
];
|
|
@@ -135,7 +137,7 @@ class Api_Controller extends nts_dynamo_1.DyNTS_Controller {
|
|
|
135
137
|
endpoint: '/health',
|
|
136
138
|
tasks: [
|
|
137
139
|
async (req, res) => {
|
|
138
|
-
res.send({ ok: true, service: 'fdp-agent-memory', uptime: process.uptime() });
|
|
140
|
+
res.send({ ok: true, service: 'fdp-agent-memory', version: fam_version_const_1.FAM_VERSION, uptime: process.uptime() });
|
|
139
141
|
},
|
|
140
142
|
],
|
|
141
143
|
});
|
|
@@ -284,6 +286,36 @@ class Api_Controller extends nts_dynamo_1.DyNTS_Controller {
|
|
|
284
286
|
return Array.isArray(runTable) ? runTable.some((entry) => String(entry) === table) : String(runTable) === table;
|
|
285
287
|
}
|
|
286
288
|
// =========================================================================
|
|
289
|
+
// /duplicates/:table — near-duplikátum FELDERÍTŐ (read-only; user-direktíva 2026-06-21)
|
|
290
|
+
// =========================================================================
|
|
291
|
+
/**
|
|
292
|
+
* `GET /duplicates/:table` — egy tár near-duplikátum / multiplikáció scan-je (koszinusz-cluster, NEM töröl).
|
|
293
|
+
* Query: `threshold` (0..1, default 0.95), `neighbors` (top-K/entry, default 10), `maxEntries` (O(n²)-cap,
|
|
294
|
+
* default 3000 — a `capped` jelzi, ha a tár nagyobb), `maxClusters` (output-cap, default 100). A `capped`-et
|
|
295
|
+
* a hívó MINDIG nézze (nincs néma csonkolás).
|
|
296
|
+
*/
|
|
297
|
+
duplicatesEndpoint() {
|
|
298
|
+
return new nts_dynamo_1.DyNTS_Endpoint_Params({
|
|
299
|
+
name: 'duplicates',
|
|
300
|
+
type: fsm_dynamo_1.DyFM_HttpCallType.get,
|
|
301
|
+
endpoint: '/duplicates/:table',
|
|
302
|
+
tasks: [
|
|
303
|
+
async (req, res) => {
|
|
304
|
+
await this.run(res, async () => {
|
|
305
|
+
const table = this.parseTable(req.params.table);
|
|
306
|
+
return embedding_1.FAM_DuplicateScan_ControlService.getInstance().scan({
|
|
307
|
+
table: table,
|
|
308
|
+
threshold: req.query.threshold !== undefined ? Number(req.query.threshold) : undefined,
|
|
309
|
+
neighbors: req.query.neighbors !== undefined ? this.parseNumber(req.query.neighbors, 10) : undefined,
|
|
310
|
+
maxEntries: req.query.maxEntries !== undefined ? this.parseNumber(req.query.maxEntries, 3000) : undefined,
|
|
311
|
+
maxClusters: req.query.maxClusters !== undefined ? this.parseNumber(req.query.maxClusters, 100) : undefined,
|
|
312
|
+
});
|
|
313
|
+
});
|
|
314
|
+
},
|
|
315
|
+
],
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
// =========================================================================
|
|
287
319
|
// /config — scoped config olvasás/írás (dsgn-007; a UI settings + CLI config)
|
|
288
320
|
// =========================================================================
|
|
289
321
|
/**
|
|
@@ -44,7 +44,7 @@ const FALLBACK_HTML = `<!DOCTYPE html>
|
|
|
44
44
|
<p>The admin UI is not built yet. Options:</p>
|
|
45
45
|
<ul>
|
|
46
46
|
<li>From the repo: run <code>pnpm run build-ui-for-publish</code> (server), then reload.</li>
|
|
47
|
-
<li>Dev: start the Angular dev server in <code>client/</code> (<code>pnpm start</code>) at <code>http://localhost:
|
|
47
|
+
<li>Dev: start the Angular dev server in <code>client/</code> (<code>pnpm start</code>) at <code>http://localhost:4226</code>.</li>
|
|
48
48
|
</ul>
|
|
49
49
|
</body>
|
|
50
50
|
</html>`;
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ServerStatus_Controller = void 0;
|
|
4
4
|
const fsm_dynamo_1 = require("@futdevpro/fsm-dynamo");
|
|
5
5
|
const nts_dynamo_1 = require("@futdevpro/nts-dynamo");
|
|
6
|
+
const fam_version_const_1 = require("../../../_collections/fam-version.const");
|
|
6
7
|
const server_status_control_service_1 = require("./server-status.control-service");
|
|
7
8
|
/**
|
|
8
9
|
* ServerStatus_Controller — saját status endpoint (Pure Dynamo, FDP-mentes).
|
|
@@ -25,7 +26,7 @@ class ServerStatus_Controller extends nts_dynamo_1.DyNTS_Controller {
|
|
|
25
26
|
async (req, res, issuer) => {
|
|
26
27
|
res.send({
|
|
27
28
|
name: 'fdp-agent-memory-server',
|
|
28
|
-
version:
|
|
29
|
+
version: fam_version_const_1.FAM_VERSION,
|
|
29
30
|
status: 'ok',
|
|
30
31
|
uptime: process.uptime(),
|
|
31
32
|
timestamp: new Date().toISOString(),
|
package/build/src/app.server.js
CHANGED
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.App = void 0;
|
|
4
4
|
const fsm_dynamo_1 = require("@futdevpro/fsm-dynamo");
|
|
5
5
|
const nts_dynamo_1 = require("@futdevpro/nts-dynamo");
|
|
6
|
+
const logs_1 = require("@futdevpro/nts-dynamo/logs");
|
|
6
7
|
const package_json_1 = require("../package.json");
|
|
7
8
|
const fam_db_models_const_1 = require("./_collections/fam-db-models.const");
|
|
8
9
|
const api_controller_1 = require("./_routes/server/api/api.controller");
|
|
@@ -40,7 +41,15 @@ class App extends nts_dynamo_1.DyNTS_App {
|
|
|
40
41
|
overrideDynamoNTSGlobalSettings() {
|
|
41
42
|
nts_dynamo_1.DyNTS_global_settings.log_settings.api_errors = false;
|
|
42
43
|
nts_dynamo_1.DyNTS_global_settings.log_settings.setup = true;
|
|
43
|
-
// NINCS JWT/auth check (ADR-004): a szerver lokális, single-user.
|
|
44
|
+
// NINCS JWT/auth check (ADR-004): a szerver lokális, single-user. Az auth-t EXPLICITEN
|
|
45
|
+
// opcionálisnak jelöljük → elnémítja a minden booton megjelenő „Unique Authentication Service
|
|
46
|
+
// missing!" figyelmeztetést (a no-auth a SZÁNDÉK, nem hiányosság).
|
|
47
|
+
nts_dynamo_1.DyNTS_global_settings.auth_settings.optional = true;
|
|
48
|
+
// Dynamo KEZELT logs-megoldás (user-direktíva 2026-06-21: „a Dynamo-ban van rá solution, ami elérhetővé
|
|
49
|
+
// teszi"): a `DyNTS_Logs_Service` buffer-eli a szerver-logokat, és a `/logs` REST-endpoint (no-auth, FAM
|
|
50
|
+
// lokális) lekérdezhetővé teszi → az agent IS olvashatja REST-en (nem csak a tmp-fájlból). Install + enable.
|
|
51
|
+
nts_dynamo_1.DyNTS_global_settings.log_settings.logs_endpoint = { enabled: true };
|
|
52
|
+
logs_1.DyNTS_Logs_Service.getInstance().install();
|
|
44
53
|
}
|
|
45
54
|
getGlobalServiceCollection() {
|
|
46
55
|
return {
|
|
@@ -87,6 +96,9 @@ class App extends nts_dynamo_1.DyNTS_App {
|
|
|
87
96
|
client_app_controller_1.ClientApp_Controller.getInstance(),
|
|
88
97
|
],
|
|
89
98
|
}),
|
|
99
|
+
// Dynamo KEZELT logs-endpoint — a szerver-logok REST-en lekérdezhetők (`GET /api/logs`, no-auth,
|
|
100
|
+
// FAM lokális). A `DyNTS_Logs_Service.install()` (fent) buffer-eli; ez a route adja vissza.
|
|
101
|
+
(0, logs_1.DyNTS_getLogsRoutingModule)(),
|
|
90
102
|
// NB: NINCS DyNTS_getTestRoutingModule / DyNTS_getUsageRoutingModule — a usage-controller
|
|
91
103
|
// `getAuthService()`-t hív (boot-crash a no-auth FAM-on, ADR-004), és egyik Dynamo-leftover
|
|
92
104
|
// route-ot sem használja a FAM (saját ServerStatus_Controller a health-re). FAM-REV-027.
|
|
@@ -13,7 +13,7 @@ const nts_dynamo_1 = require("@futdevpro/nts-dynamo");
|
|
|
13
13
|
exports.env = {
|
|
14
14
|
env: process.env.FDP_ENV || nts_dynamo_1.DyNTS_global_settings.env_settings.environment,
|
|
15
15
|
// REST/UI szerver-port (NEM az MCP-stdio — az MVP1-ben stdio, dsgn-012 §4.1).
|
|
16
|
-
httpPort: +(process.env.FAM_SERVER_PORT || process.env.HTTP_PORT ||
|
|
16
|
+
httpPort: +(process.env.FAM_SERVER_PORT || process.env.HTTP_PORT || 39265),
|
|
17
17
|
api: {
|
|
18
18
|
// Project-specifikus külső API kulcsok ide kerülnek (pl. embedding-provider, MP-6+).
|
|
19
19
|
},
|
package/build/src/index.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
//
|
|
8
8
|
// Indítás:
|
|
9
|
-
// node build/src/index.js start → REST szerver (port
|
|
9
|
+
// node build/src/index.js start → REST szerver (port 39265) + MCP stdio szerver (read/write/capabilities)
|
|
10
10
|
// node build/src/index.js → CSAK REST szerver (visszafelé-kompatibilis; `new App()`)
|
|
11
11
|
// fam start → ugyanaz (a publikált bin a build/src/index.js-re mutat)
|
|
12
12
|
//
|