@futdevpro/fdp-agent-memory 1.1.153 → 1.1.159

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@futdevpro/fdp-agent-memory",
3
- "version": "1.1.153",
3
+ "version": "1.1.159",
4
4
  "description": "Local-first, vector-backed multi-table agent memory exposed as an MCP server (read/write/capabilities). Public, FDP-Templates-free, no auth.",
5
5
  "private": false,
6
6
  "publishConfig": {
@@ -526,12 +526,12 @@ exports.CONFIG_CATALOG = {
526
526
  },
527
527
  // --- 4.5c. Rules-injekció (fogyasztó: FAM_RuleInjection_ControlService) ---
528
528
  'rules.injectBudgetChars': {
529
- type: 'number', default: 32000, min: 1000, max: 200000, integer: true, levels: GLOBAL_ONLY,
530
- description: 'Az always-on szabály-injekció char-budgetje (owner-döntés 2026-08-14: a szabályok kritikusak"). '
531
- + 'MÉRVE: a teljes kurált készlet egy FDP-projekten belül 56 szabály / 25 179 char; a korábbi 6000-es '
532
- + 'budget ebből csak ~10-et engedett be (36 kimaradt). A budget-fit ATOMI: egy szabály vagy TELJESEN '
533
- + 'bekerül, vagy a „(…and N more rules not shown)" jelzésbe esik sosem félig (`core-rule-integrity`). '
534
- + 'A hívó explicit `budgetChars`-a (pl. a SessionStart-hook) felülírja ezt.',
529
+ type: 'number', default: 88000, min: 1000, max: 400000, integer: true, levels: ALL_LEVELS,
530
+ description: 'Az injektalt szabaly-blokk char-budgetje. MERT (2026-08-22): a 60 szabaly injektalt merete '
531
+ + '80 514 char, ezert 82 000 alatt szabalyok ESNEK KI 32 000-nel 65-bol 45, koztuk a core-no-coauthor, '
532
+ + 'a core-always-master es maga a fam-use-preferentially. A 88 000 ~9% fejlodesi tartalek. '
533
+ + 'Elotte a `fam:elide-start/end` jelolok mar levalasztottak a nem-normativ kifejtest (88 480 -> 80 514, '
534
+ + '-9%); tovabbi csokkentes csak a hosszu UTASITASOK owner-dontesu tomoritesevel lehetseges.',
535
535
  },
536
536
  // --- 4.6. Reference / scope (fogyasztó: dsgn-002) ---
537
537
  'reference.cacheTtlMs': {
@@ -23,6 +23,16 @@ const fsm_dynamo_1 = require("@futdevpro/fsm-dynamo");
23
23
  * hogy a logok a látható ablak MELLETT fájlból is tail-elhetők legyenek (a `fam serve` ezt állítja be a detached szerverre).
24
24
  */
25
25
  class FAM_Console_Util {
26
+ /**
27
+ * UTF-8 BOM (`U+FEFF`) — a generalt `.ps1` ELSO karaktere. Enelkul a Windows PowerShell 5.1 a fajlt a
28
+ * rendszer ANSI-kodlapjan olvassa (magyar Windowson `windows-1250`), es minden ekezet elromlik
29
+ * (lasd `windowsServerScript`). A Node `writeFileSync` UTF-8-ban ir, igy ebbol pontosan `EF BB BF` lesz.
30
+ *
31
+ * A `String.fromCharCode(0xFEFF)` forma szandekos a literalis (lathatatlan) karakter helyett: azt egy code-style sweep,
32
+ * egy editor vagy egy trim-elo szkript NEMAN kiszedhetne, es a hiba csak a felhasznalonal jelentkezne
33
+ * mojibake-kent — pontosan ugy, ahogy 2026-08-22-en jelentkezett.
34
+ */
35
+ static UTF8_BOM = String.fromCharCode(0xFEFF);
26
36
  /**
27
37
  * **File-log (`FAM_LOG_FILE`)** — ha az env be van állítva, a `console.*` MINDEN sorát rácsatolja arra a fájlra
28
38
  * (a látható ablak MELLETT). A `fam serve` ezt állítja a detached szerverre → a logok (köztük az import-progress)
@@ -113,11 +123,23 @@ class FAM_Console_Util {
113
123
  * A Windows szerver-launcher `.ps1` tartalma (PURE — unit-tesztelhető): UTF-8 konzol + ablakcím, az env-override-ok
114
124
  * (`$env:X='...'`), majd a szerver futtatása (`& command args`). A `'`-eket megdupláljuk (PS string-escape). A
115
125
  * `-NoExit` (a spawn-oldalon) tartja nyitva az ablakot kilépés után.
126
+ *
127
+ * 🔴 **A visszaadott szöveg UTF-8 BOM-mal KEZDŐDIK — ez nem díszítés, hanem a helyes működés feltétele.**
128
+ * A launchert a `powershell.exe` (**Windows PowerShell 5.1**) futtatja, az pedig a **BOM NÉLKÜLI** `.ps1`-et a
129
+ * rendszer ANSI-kódlapján értelmezi — magyar Windowson `windows-1250`. Mérve (2026-08-22, PS 5.1.26100,
130
+ * ANSI = windows-1250) ugyanazzal a fájllal:
131
+ *
132
+ * BOM nélkül → `[FAM szerver kilĂ©pett †exit 0 †'fam serve --restart' ĂşjraindĂ­tja]`
133
+ * BOM-mal → `[FAM szerver kilépett — exit 0 — 'fam serve --restart' újraindítja]`
134
+ *
135
+ * A `[Console]::OutputEncoding=UTF8` sor ezen NEM segít: az a KIMENET kódolását állítja, a hiba viszont már a
136
+ * fájl BEOLVASÁSAKOR megtörténik. És a hiba nem csak kozmetikai: az `envOverrides` ÉRTÉKEI is ezen az úton
137
+ * mennek át, így egy ékezetes útvonal/érték is elromlana.
116
138
  */
117
139
  static windowsServerScript(set) {
118
140
  const esc = (value) => value.replace(/'/g, "''");
119
141
  const lines = [
120
- 'try { [Console]::OutputEncoding=[System.Text.Encoding]::UTF8 } catch {}',
142
+ `${FAM_Console_Util.UTF8_BOM}try { [Console]::OutputEncoding=[System.Text.Encoding]::UTF8 } catch {}`,
121
143
  `try { $host.UI.RawUI.WindowTitle='FAM server :${set.port}' } catch {}`,
122
144
  ];
123
145
  for (const [key, value] of Object.entries(set.envOverrides)) {
@@ -13,15 +13,47 @@ const fam_rule_scope_type_enum_1 = require("../../../_enums/fam-rule-scope.type-
13
13
  */
14
14
  class FAM_RuleInjection_Util {
15
15
  /**
16
- * Default char-budget az injektált blokkra. **32000 (owner-döntés 2026-08-14: „a szabályok kritikusak").**
16
+ * Default char-budget az injektált blokkra. **88000 (2026-08-22).** Owner-alapelv változatlan (2026-08-14):
17
+ * „a szabályok kritikusak" — inkább fizetünk kontextust, mint hogy szabály essen ki.
17
18
  *
18
- * MÉRVE: a teljes kurált készlet egy FDP-PROJEKTEN BELÜL 56 szabály / **25 179 char** (global 19 552 +
19
- * fdp-global 2 103 + project-internal 2 779 + project-type 745). A korábbi `6000` ebből csak ~10-et engedett be,
20
- * 36-ot kihagyva — és mivel a hosszabb szabályok chunkokra bomlottak, a kimaradás NÉMA CSONKOLÁSKÉNT jelent meg
21
- * (`core-rule-integrity` sérülés). A 32000 a mért 25 179-re ad ~27% fejlődési tartalékot, hogy egy új szabály
22
- * felvétele NE szorítson ki egy meglévőt. Konfigurálható: `rules.injectBudgetChars` (a hívó `budgetChars`-a nyer).
19
+ * A SZÁM TÖRTÉNETE, MÉRVE:
20
+ * - `6000` 56 szabályból ~10 fért be; a hosszabbak chunkokra bomlottak, így a kimaradás NÉMA CSONKOLÁSKÉNT
21
+ * jelent meg (`core-rule-integrity` sérülés).
22
+ * - `32000` a 2026-08-14-i mért 25 179 char-ra ~27% tartalék volt. 2026-08-22-re a készlet **85 854 char**-ra
23
+ * nőtt (nem a darabszám, hanem a HOSSZ nőtt), és **65 szabályból 45 esett ki** — köztük a `core-no-coauthor`,
24
+ * a `core-always-master`, a `core-no-polling` és maga a `fam-use-preferentially`.
25
+ * - `88000` → a `fam:elide-start/end` jelölők bevezetése UTÁN mért injektált méret **80 514 char** (a jelölés
26
+ * 88 480-ról vitte le, −9%; a további csökkentés már a hosszú UTASÍTÁSOKAT érintené, az pedig owner-döntés).
27
+ * 82 000 alatt szabály esik ki; a 88 000 ~9% fejlődési tartalék.
28
+ *
29
+ * Konfigurálható: `rules.injectBudgetChars` (a hívó `budgetChars`-a nyer). A budget-hiány SOHA nem néma:
30
+ * a záró sor jelzi a kimaradt darabszámot, és minden rövidített szabály LÁTHATÓ pointert kap (`coreOf`).
23
31
  */
24
- static DEFAULT_BUDGET_CHARS = 32000;
32
+ static DEFAULT_BUDGET_CHARS = 88000;
33
+ /**
34
+ * A **mindig injektálandó normatív mag** vége a szabály-fájlban. Ami a jelölő UTÁN áll (Miért / Példák /
35
+ * Migráció / Ellenőrzés / incidens-narratíva), az **on-demand** — a kanonikus fájlban marad, és a `read`
36
+ * hozza elő, ha kell.
37
+ *
38
+ * MÉRT INDOK (2026-08-22): a szabály-készlet 60 szabályból **85 854 char**-ra nőtt, és 65-ből **45 esett ki**
39
+ * a 32k-s budgetből — köztük a `core-no-coauthor`, a `core-always-master` és maga a `fam-use-preferentially`.
40
+ * A készlet ugyanakkor KETTÉVÁLT: 38 szabály 1000 char alatt (átlag 292, kifejtés nélkül), míg 8 szabály
41
+ * 4000 fölött adja a készlet **49%-át**. A hízás NEM az utasításban van: a legnagyobbaknál a normatív mag
42
+ * `core-no-polling` 7%, `core-dynamo-docs-english` 10%, `core-wakeup-state-file` 20%. A címkézett kifejtés
43
+ * összesen a készlet **33%-a** (alsó becslés).
44
+ *
45
+ * A megoldás a `core-rule-integrity` által KIFEJEZETTEN megengedett forma: az **utasítás inline marad**, a
46
+ * kifejtés **pointerré válik**, LÁTHATÓ jelzéssel. A fájlból SEMMI nem kerül ki — csak az injektálás
47
+ * szelektív. Jelölő nélküli szabály **teljes egészében** injektálódik (visszafelé kompatibilis default).
48
+ *
49
+ * SZAKASZ-jelölő, nem egyetlen vágópont: a kifejtés a valós szabály-fájlokban BEÉKELŐDIK a normatív részek
50
+ * közé (pl. `core-wakeup-state-file`: „A szabály" → „Miért" → „Hol éljen" → „Mit tartalmazzon"), ezért egy
51
+ * záró vágópont nem lenne elég — átrendezéssel járna, azt pedig nem akarjuk a szabály-fájlokon.
52
+ * Lezáratlan `elide-start` → a fájl végéig tart (így a záró kifejtésnél elég egyetlen jelölő).
53
+ */
54
+ static ELIDE_START = '<!-- fam:elide-start -->';
55
+ /** Az elhagyható szakasz vége (lásd `ELIDE_START`). */
56
+ static ELIDE_END = '<!-- fam:elide-end -->';
25
57
  /** A `globalRule:true` legacy hard-rule effektív fontossága, ha nincs explicit `importance`. */
26
58
  static LEGACY_GLOBAL_IMPORTANCE = 90;
27
59
  /** Importance-default explicit érték nélkül (közepes — a globalRule-legacy fölött, nem-jelölt alatt). */
@@ -102,6 +134,41 @@ class FAM_RuleInjection_Util {
102
134
  * addig vesz fel, amíg a következő szabály content-je (a `separator`-ral) belefér. Ha a legelső sem fér, akkor is
103
135
  * felveszi (legalább a legfontosabb core menjen). A footer csak akkor van, ha tényleg maradt ki.
104
136
  */
137
+ /**
138
+ * Egy szabály **injektálandó** szövege: a `CORE_END_MARKER` előtti normatív mag + egy LÁTHATÓ pointer-sor,
139
+ * ha volt mit elhagyni. Jelölő nélkül a teljes szöveg (back-compat). Üres mag esetén szintén a teljes
140
+ * szöveg — a jelölő elgépelése SOHA nem némíthat el egy szabályt.
141
+ */
142
+ static coreOf(rule) {
143
+ const text = (rule.content ?? '').trim();
144
+ const start = FAM_RuleInjection_Util.ELIDE_START;
145
+ const end = FAM_RuleInjection_Util.ELIDE_END;
146
+ if (!text.includes(start)) {
147
+ return text;
148
+ }
149
+ let kept = '';
150
+ let cursor = 0;
151
+ for (;;) {
152
+ const from = text.indexOf(start, cursor);
153
+ if (from < 0) {
154
+ kept += text.slice(cursor);
155
+ break;
156
+ }
157
+ kept += text.slice(cursor, from);
158
+ const to = text.indexOf(end, from);
159
+ if (to < 0) {
160
+ break; // lezáratlan szakasz → a fájl végéig tart
161
+ }
162
+ cursor = to + end.length;
163
+ }
164
+ const core = kept.replace(/\n{3,}/g, '\n\n').trim();
165
+ if (!core) {
166
+ return text;
167
+ }
168
+ const id = rule.ruleId ?? rule.id ?? '(ismeretlen ruleId)';
169
+ return `${core}\n> ℹ️ *A szabály INDOKLÁSA / példái / migrációs-ellenőrzési része itt NINCS inline-olva — `
170
+ + `a teljes kanonikus szöveg: \`${id}\` (\`read\` a \`rules\` táron).*`;
171
+ }
105
172
  static assemble(input) {
106
173
  const budget = input.budgetChars && input.budgetChars > 0 ? input.budgetChars : FAM_RuleInjection_Util.DEFAULT_BUDGET_CHARS;
107
174
  const sep = input.separator ?? '\n\n';
@@ -113,7 +180,7 @@ class FAM_RuleInjection_Util {
113
180
  let used = 0;
114
181
  let included = 0;
115
182
  for (const rule of ranked) {
116
- const text = (rule.content ?? '').trim();
183
+ const text = FAM_RuleInjection_Util.coreOf(rule);
117
184
  const addLen = text.length + (parts.length ? sep.length : 0);
118
185
  if (used + addLen > budget && included > 0) {
119
186
  break; // budget-stop (de a legelső MINDIG befér — included>0 guard)
@@ -0,0 +1 @@
1
+ import{$ as z,A as T,Aa as we,B as E,Ba as Me,C as S,Ca as H,D as a,E as o,F as A,I as ie,Ia as Z,J as k,K as u,Ka as le,L as c,M as oe,Ma as P,N as Ee,Na as Ve,O as R,Oa as X,P as s,Q as I,R as g,S as W,T as Y,U as Se,V as y,W as v,X as w,Y as V,Z as ne,_ as $e,a as B,aa as j,b as U,ba as xe,ca as Fe,d as b,da as be,ea as ae,fa as Ce,ga as D,i as _e,k as $,l as m,m as _,o as h,p as l,pa as he,q as Te,ra as re,s as N,sa as O,t as ue,ta as L,u as ge,ua as ye,v as M,va as Q,w as f,wa as q,x,xa as K,y as fe,ya as Ie,z as J,za as ve}from"./chunk-XXE6ASDW.js";var C=(function(n){return n.rules="rules",n.documents="documents",n.codebase="codebase",n.knowledge="knowledge",n.codingPatterns="coding_patterns",n.memory="memory",n.reference="reference",n})(C||{});var G={[C.rules]:"Rules",[C.documents]:"Documents",[C.codebase]:"Codebase",[C.knowledge]:"Knowledge",[C.codingPatterns]:"Coding Patterns",[C.memory]:"Memory",[C.reference]:"Reference"},ke={[C.rules]:"glob\xE1lis / projekt-bound",[C.documents]:"projekt-bound",[C.codebase]:"projekt-bound",[C.knowledge]:"glob\xE1lis / domain",[C.codingPatterns]:"glob\xE1lis",[C.memory]:"session / projekt-bound",[C.reference]:"helper (alias \u2192 canonical)"},ee=[C.rules,C.documents,C.codebase,C.knowledge,C.codingPatterns,C.memory],De={[C.rules]:["coding","architecture","naming","behavior","security","project"],[C.documents]:["spec","feature_request","bug_report","architecture_doc","dev_note","meeting_note","research_note"],[C.codebase]:["source_file","symbol","function","class","interface","config","dataflow","runflow","module_summary"],[C.knowledge]:["fact","concept","definition","relationship","domain_knowledge","company_knowledge","user_knowledge","decision_rationale"],[C.codingPatterns]:["pattern","anti_pattern","recipe","example","template","migration_pattern","debugging_pattern"],[C.memory]:["session_history","development_history","decision_history","incident","lesson_learned","important_note","user_preference","project_event","temporary_context","resolved_issue"]};var Xe=()=>["/maintenance"],Le=(n,d)=>d._id;function Ge(n,d){if(n&1&&(a(0,"option",8),s(1),o()),n&2){let e=d.$implicit,i=c();S("value",e),l(),I(i.tableLabel(e))}}function Ue(n,d){n&1&&(a(0,"div",9),s(1,"Loading\u2026"),o())}function Qe(n,d){if(n&1&&s(0),n&2){let e=c().$implicit;Se(" \xB7 new ",e.verdicts.new," / mod ",e.verdicts.modified," / eq ",e.verdicts.equal," / del ",e.verdicts.deleted," ")}}function Ze(n,d){if(n&1){let e=k();a(0,"button",25),u("click",function(){m(e);let t=c().$implicit,r=c(2);return _(r.viewRunErrors(t))}),s(1,"errors"),o()}}function Je(n,d){if(n&1&&(a(0,"div",26),s(1),o()),n&2){let e=d.$implicit;l(),Se(" ",e.sourceFilePath??"(no path)"," [",e.chunkIndex,"/",e.chunkTotal,"] \u2014 ",e.content==null?null:e.content.slice(0,80),"\u2026 ")}}function Ye(n,d){n&1&&(a(0,"div",27),s(1,"Nincs chunk ehhez a run-hoz."),o())}function et(n,d){if(n&1&&(a(0,"div",24),T(1,Je,2,4,"div",26,Le,!1,Ye,2,0,"div",27),o()),n&2){let e=c().$implicit,i=c(2);M("data-testid","ma-ingest-chunks-"+e._id),l(),E(i.chunksFor(e._id??""))}}function tt(n,d){if(n&1){let e=k();a(0,"div",13)(1,"div",14)(2,"div",15)(3,"span",16),s(4),o(),a(5,"span",17),s(6),z(7,"date"),o(),a(8,"div",18),s(9),f(10,Qe,1,4),s(11),o()(),a(12,"div",19)(13,"span",20),s(14),o(),f(15,Ze,2,0,"button",21),a(16,"button",22),u("click",function(){let t=m(e).$implicit,r=c(2);return _(r.toggleRun(t))}),s(17),o(),a(18,"button",23),u("click",function(){let t=m(e).$implicit,r=c(2);return _(r.deleteRun(t))}),s(19,"delete"),o()()(),f(20,et,4,2,"div",24),o()}if(n&2){let e=d.$implicit,i=c(2);R("border-red-700",i.isFailed(e))("border-neutral-800",!i.isFailed(e)),M("data-testid","ma-ingest-run-"+e._id),l(4),I(e.trigger??"\u2014"),l(2),W(" \xB7 ",i.tableLabel(e.table)," \xB7 ",e.__created?j(7,23,e.__created,"short"):"\u2014"),l(3),Y(" files ",e.filesProcessed??0," (skip ",e.filesSkipped??0,") \xB7 chunks ",e.chunkCount??0," "),l(),x(e.verdicts?10:-1),l(),g(" \xB7 cost ",e.embedTokenCost!==void 0?e.embedTokenCost:"n/a"," "),l(2),R("bg-emerald-700",e.status==="ok")("bg-red-700",i.isFailed(e)),M("data-testid","ma-ingest-status-"+e._id),l(),g(" ",e.status??"ok"," "),l(),x(i.isFailed(e)?15:-1),l(),M("data-testid","ma-ingest-expand-"+e._id),l(),g(" ",i.isExpanded(e._id??"")?"collapse":"expand"," "),l(3),x(i.isExpanded(e._id??"")?20:-1)}}function nt(n,d){n&1&&(a(0,"div",12),s(1,"Nincs ingest-run."),o())}function it(n,d){if(n&1&&(a(0,"div",10),T(1,tt,21,26,"div",11,Le,!1,nt,2,0,"div",12),o()),n&2){let e=c();l(),E(e.runs_$())}}var Ne=(()=>{class n{api=$(P);router=$(re);notify=$(Z);popup=$(le);mainTables=ee;runs_$=h([]);loading_$=h(!0);tableFilter="";expanded_$=h(new Set);runChunks_$=h({});ngOnInit(){return b(this,null,function*(){yield this.load()})}load(){return b(this,null,function*(){this.loading_$.set(!0);let e=yield this.api.getIngestRuns(this.tableFilter||void 0);if(e.error){this.notify.newErrorMessage(`${e.error.errorCode}: ${e.error.message}`),this.loading_$.set(!1);return}this.runs_$.set(e.data?.runs??[]),this.loading_$.set(!1)})}tableLabel(e){return e?Array.isArray(e)?e.map(i=>G[i]).join(", "):G[e]:"\u2014"}isExpanded(e){return this.expanded_$().has(e)}toggleRun(e){return b(this,null,function*(){let i=e._id??"",t=new Set(this.expanded_$());if(t.has(i)){t.delete(i),this.expanded_$.set(t);return}t.add(i),this.expanded_$.set(t);let r=Array.isArray(e.table)?e.table[0]:e.table;if(!r)return;let p=yield this.api.getItems(r,{ingestRunId:i,pageSize:200});p.data&&this.runChunks_$.set(U(B({},this.runChunks_$()),{[i]:p.data.items}))})}chunksFor(e){return this.runChunks_$()[e]??[]}isFailed(e){return e.status==="failed"||e.status==="partial-failed"}deleteRun(e){return b(this,null,function*(){if(!(yield this.popup.newConfirm({title:"Run csoportos soft-delete",message:`A(z) ${e._id} run minden chunkja t\xF6rl\xE9sre ker\xFCl (soft-delete). Folytatod?`,confirmBtn:"Delete run"})))return;let t=yield this.api.invokeCapability("delete_ingest_run",{ingestRunId:e._id});if(t.error){this.notify.newErrorMessage(`${t.error.errorCode}: ${t.error.message}`);return}this.notify.newSuccessMessage("Run t\xF6r\xF6lve (soft-delete)."),yield this.load()})}viewRunErrors(e){this.router.navigate(["/errors"],{queryParams:{ingestRunId:e._id}})}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=N({type:n,selectors:[["ma-ingest-timeline"]],decls:16,vars:4,consts:[["data-testid","ma-ingest-timeline",1,"mx-auto","max-w-5xl","p-6"],[1,"mb-4","block"],[1,"mb-4","flex","items-center","justify-between"],[1,"text-sm","opacity-60","hover:underline",3,"routerLink"],[1,"text-2xl","font-semibold"],[1,"flex","items-center","gap-2","text-sm"],["data-testid","ma-ingest-table-filter",1,"rounded","border","border-neutral-700","bg-neutral-900","px-2","py-1",3,"ngModelChange","ngModel"],["value",""],[3,"value"],["data-testid","ma-ingest-loading",1,"py-10","text-center","opacity-60"],["data-testid","ma-ingest-list",1,"flex","flex-col","gap-2"],[1,"rounded","border","bg-neutral-900",3,"border-red-700","border-neutral-800"],[1,"py-6","text-center","opacity-50"],[1,"rounded","border","bg-neutral-900"],[1,"flex","items-center","justify-between","px-3","py-2","text-sm"],[1,"flex-1"],[1,"font-medium"],[1,"opacity-50"],[1,"mt-1","text-xs","opacity-60"],[1,"flex","items-center","gap-2"],[1,"rounded","px-2","py-0.5","text-xs"],[1,"rounded","px-2","py-1","text-xs","text-red-300","hover:bg-neutral-800"],[1,"rounded","px-2","py-1","text-xs","hover:bg-neutral-800",3,"click"],[1,"rounded","px-2","py-1","text-xs","text-red-400","hover:bg-neutral-800",3,"click"],[1,"border-t","border-neutral-800","p-2"],[1,"rounded","px-2","py-1","text-xs","text-red-300","hover:bg-neutral-800",3,"click"],[1,"rounded","px-2","py-1","text-xs","opacity-80"],[1,"py-2","text-center","text-xs","opacity-40"]],template:function(i,t){i&1&&(a(0,"div",0),A(1,"ma-banner-host",1),a(2,"div",2)(3,"div")(4,"a",3),s(5,"\u2190 Maintenance"),o(),a(6,"h1",4),s(7,"Ingest timeline"),o()(),a(8,"div",5)(9,"select",6),w("ngModelChange",function(p){return v(t.tableFilter,p)||(t.tableFilter=p),p}),u("ngModelChange",function(){return t.load()}),a(10,"option",7),s(11,"\xF6sszes t\xE1r"),o(),T(12,Ge,2,2,"option",8,J),o()()(),f(14,Ue,2,0,"div",9)(15,it,4,1,"div",10),o()),i&2&&(l(4),S("routerLink",V(3,Xe)),l(5),y("ngModel",t.tableFilter),l(3),E(t.mainTables),l(2),x(t.loading_$()?14:15))},dependencies:[D,H,we,Me,ve,q,K,L,O,X,ae],encapsulation:2})}return n})();var ot=()=>["/maintenance/search"],Pe=()=>["/maintenance/scopes"],at=()=>["/maintenance/ingest"],rt=()=>["/maintenance/settings"],lt=()=>["/errors"],st=n=>["/maintenance",n],dt=(n,d)=>d.table;function ct(n,d){n&1&&(a(0,"div",7),s(1," A FAM szerver nem el\xE9rhet\u0151 (port 39185). Ind\xEDtsd el a szervert, majd friss\xEDts. "),o())}function pt(n,d){n&1&&(a(0,"div",8),s(1,"Loading\u2026"),o())}function mt(n,d){n&1&&(a(0,"div",19)(1,"span",21),s(2,"Add first entry"),o(),a(3,"span",21),s(4,"Run scan"),o()())}function _t(n,d){n&1&&(a(0,"div",20),s(1,"Configure embedding \u2192 Settings"),o())}function ut(n,d){if(n&1&&(a(0,"a",10)(1,"div",12)(2,"span",13),s(3),o(),a(4,"span",14),s(5),o()(),a(6,"div",15),s(7),o(),a(8,"div",16),s(9),z(10,"date"),o(),a(11,"div",17),s(12),o(),a(13,"div",18),s(14),o(),f(15,mt,5,0,"div",19),f(16,_t,2,0,"div",20),o()),n&2){let e=d.$implicit;S("routerLink",ne(20,st,e.table)),M("data-testid","ma-table-card-"+e.table),l(3),I(e.label),l(),R("bg-neutral-700",e.status==="empty")("bg-red-700",e.status==="bootstrap-skip"||e.status==="config-error")("bg-emerald-700",e.status==="ok"),M("data-testid","ma-table-status-"+e.table),l(),g(" ",e.status," "),l(2),g("",e.count," bejegyz\xE9s"),l(2),g(" utols\xF3 ingest: ",e.lastIngest?j(10,17,e.lastIngest,"short"):"\u2014"," "),l(3),g("embedding: ",e.embeddingState),l(2),g("scope: ",e.scopeHint),l(),x(e.status==="empty"?15:-1),l(),x(e.status==="bootstrap-skip"?16:-1)}}function gt(n,d){if(n&1&&(a(0,"div",11)(1,"h2",22),s(2,"Helper (nem kereshet\u0151 t\xE1r)"),o(),a(3,"a",23)(4,"div",12)(5,"span",13),s(6),o(),a(7,"span",24),s(8,"helper"),o()(),a(9,"div",15),s(10),o(),a(11,"div",25),s(12,"alias \u2192 canonical felold\xE1s \xB7 scope-fa kezel\xE9s"),o()()()),n&2){let e=d;l(3),S("routerLink",V(3,Pe)),l(3),I(e.label),l(4),g("",e.count," reference-bejegyz\xE9s")}}function ft(n,d){if(n&1&&(a(0,"div",9),T(1,ut,17,22,"a",10,dt),o(),f(3,gt,13,4,"div",11)),n&2){let e,i=c();l(),E(i.cards_$()),l(2),x((e=i.referenceCard_$())?3:-1,e)}}var Be=(()=>{class n{api=$(P);adminState=$(Ve);loading_$=h(!0);cards_$=h([]);referenceCard_$=h(null);get serverUnreachable_$(){return this.adminState.serverUnreachable_$}totalEntries_$=Fe(()=>this.cards_$().reduce((e,i)=>e+i.count,0));ngOnInit(){return b(this,null,function*(){this.adminState.startPolling(),yield this.load()})}load(){return b(this,null,function*(){this.loading_$.set(!0);let e=yield this.api.getStats();if(e.error){this.adminState.pushBanner({key:"landing-stats-error",color:"red",title:"T\xE1r-statisztika nem el\xE9rhet\u0151",message:`${e.error.errorCode}: ${e.error.message}`,errorsLink:!0}),this.loading_$.set(!1);return}let i={};for(let r of e.data?.tables??[])i[r.table]=r;let t=[];for(let r of ee)t.push(yield this.buildCard(r,i[r]));this.cards_$.set(t),this.referenceCard_$.set(yield this.buildReferenceCard()),this.loading_$.set(!1)})}buildCard(e,i){return b(this,null,function*(){let t=i?.count??0,r=yield this.resolveEmbeddingState(e),p=this.deriveStatus(t,r);return{table:e,label:G[e],scopeHint:ke[e],count:t,lastIngest:i?.lastModified??null,status:p,embeddingState:r}})}buildReferenceCard(){return b(this,null,function*(){let i=(yield this.api.invokeCapability("get_reference_stats")).data??{},t=i.count??i.total??0;return{table:C.reference,label:G[C.reference],scopeHint:ke[C.reference],count:t,lastIngest:null,status:t?"ok":"empty",embeddingState:"helper (alias-resolve)"}})}resolveEmbeddingState(e){return b(this,null,function*(){let i=yield this.api.getConfig(e);if(i.error||!i.data)return"nincs (config nem el\xE9rhet\u0151)";let t=i.data,r=t.effective["embedding.provider"],p=t.effective["embedding.model"];if(!r||r.value===null||r.value==="")return"nincs konfigur\xE1lva";let F=r.resolvedFrom==="builtin"||r.resolvedFrom==="global"?"global default":r.resolvedFrom;return`${r.value}${p?.value?" / "+p.value:""} (${F})`})}deriveStatus(e,i){return i.startsWith("nincs")?"bootstrap-skip":e?"ok":"empty"}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=N({type:n,selectors:[["ma-landing"]],decls:22,vars:13,consts:[["data-testid","ma-landing",1,"mx-auto","max-w-6xl","p-6"],[1,"mb-4","block"],[1,"mb-6","flex","items-end","justify-between"],[1,"text-2xl","font-semibold"],[1,"text-sm","opacity-60"],[1,"flex","gap-2","text-sm"],[1,"rounded","border","border-neutral-700","px-3","py-1","hover:bg-neutral-800",3,"routerLink"],["data-testid","ma-landing-unreachable",1,"mb-4","rounded","border","border-red-600","bg-red-950","px-4","py-3","text-sm","text-red-200"],["data-testid","ma-landing-loading",1,"py-10","text-center","opacity-60"],["data-testid","ma-landing-cards",1,"grid","grid-cols-1","gap-4","sm:grid-cols-2","lg:grid-cols-3"],[1,"block","rounded-lg","border","border-neutral-800","bg-neutral-900","p-4","transition","hover:border-neutral-600",3,"routerLink"],[1,"mt-8"],[1,"flex","items-center","justify-between"],[1,"text-lg","font-medium"],[1,"rounded-full","px-2","py-0.5","text-xs"],[1,"mt-2","text-sm","opacity-70"],[1,"text-xs","opacity-50"],[1,"mt-2","text-xs","opacity-60"],[1,"text-xs","opacity-40"],[1,"mt-3","flex","gap-2","text-xs"],[1,"mt-3","text-xs","text-red-300"],[1,"rounded","border","border-neutral-700","px-2","py-1"],[1,"mb-2","text-sm","uppercase","tracking-wide","opacity-50"],["data-testid","ma-reference-card",1,"block","max-w-sm","rounded-lg","border","border-dashed","border-amber-700/60","bg-neutral-900","p-4","hover:border-amber-500",3,"routerLink"],[1,"rounded-full","bg-amber-800","px-2","py-0.5","text-xs"],[1,"mt-1","text-xs","opacity-50"]],template:function(i,t){i&1&&(a(0,"div",0),A(1,"ma-banner-host",1),a(2,"div",2)(3,"div")(4,"h1",3),s(5,"FDP Agent Memory \u2014 Maintenance"),o(),a(6,"p",4),s(7),o()(),a(8,"div",5)(9,"a",6),s(10,"Search"),o(),a(11,"a",6),s(12,"Scopes"),o(),a(13,"a",6),s(14,"Ingest"),o(),a(15,"a",6),s(16,"Settings"),o(),a(17,"a",6),s(18,"Errors"),o()()(),f(19,ct,2,0,"div",7),f(20,pt,2,0,"div",8)(21,ft,4,1),o()),i&2&&(l(7),g("6 f\u0151 RAG-t\xE1r + reference helper \xB7 ",t.totalEntries_$()," bejegyz\xE9s"),l(2),S("routerLink",V(8,ot)),l(2),S("routerLink",V(9,Pe)),l(2),S("routerLink",V(10,at)),l(2),S("routerLink",V(11,rt)),l(2),S("routerLink",V(12,lt)),l(2),x(t.serverUnreachable_$()?19:-1),l(),x(t.loading_$()?20:21))},dependencies:[D,L,O,X,ae],encapsulation:2})}return n})();var xt=()=>["/maintenance"],bt=n=>({$implicit:n,depth:0}),Ct=()=>[],ht=(n,d)=>({$implicit:n,depth:d}),Ae=(n,d)=>d.scopeId,yt=(n,d)=>d._id;function vt(n,d){n&1&&(a(0,"div",9),s(1,"Loading\u2026"),o())}function wt(n,d){if(n&1&&ie(0,13),n&2){let e=d.$implicit;c(2);let i=oe(16);S("ngTemplateOutlet",i)("ngTemplateOutletContext",ne(2,bt,e))}}function Mt(n,d){n&1&&(a(0,"div",14),s(1,"Nincs scope (a write/scan auto-regisztr\xE1lja)."),o())}function St(n,d){if(n&1&&(a(0,"div",22),s(1),o()),n&2){let e=c();l(),g("aliases: ",e.aliases==null?null:e.aliases.join(", "))}}function kt(n,d){if(n&1){let e=k();a(0,"div",15)(1,"div",20),s(2),o(),a(3,"div",21),s(4),o(),f(5,St,2,1,"div",22),a(6,"button",23),u("click",function(){let t=m(e),r=c(2);return _(r.viewEntries(t))}),s(7,"View entries"),o()()}if(n&2){let e=d;l(2),I(e.canonicalName),l(2),W("layer: ",e.layer," \xB7 ",e.entryCount??0," entry"),l(),x(e.aliases!=null&&e.aliases.length?5:-1)}}function Tt(n,d){if(n&1&&s(0),n&2){let e=c().$implicit;g(" category: ",e.category," \xB7 ")}}function Et(n,d){if(n&1&&s(0),n&2){let e=c().$implicit;g(" layer: ",e.scopeLayer," \xB7 ")}}function $t(n,d){if(n&1&&s(0),n&2){let e=c().$implicit;g(" t\xE1rak: ",e.ragScopes==null?null:e.ragScopes.join(", ")," ")}}function Ft(n,d){if(n&1){let e=k();a(0,"div",17)(1,"div",24)(2,"div",25)(3,"div",20)(4,"span",26),s(5),o(),s(6),o(),a(7,"div",27),f(8,Tt,1,1),f(9,Et,1,1),f(10,$t,1,1),o()(),a(11,"div",28)(12,"button",29),u("click",function(){let t=m(e).$implicit,r=c(2);return _(r.openEditForm(t))}),s(13,"edit"),o(),a(14,"button",29),u("click",function(){let t=m(e).$implicit,r=c(2);return _(r.toggleActive(t))}),s(15),o()()()()}if(n&2){let e=d.$implicit;M("data-testid","ma-reference-"+e._id),l(3),R("opacity-40",!e.isActive),l(2),I((e.aliasTerms??V(14,Ct)).join(" / ")),l(),g(" \u2192 ",e.canonicalTerm," "),l(2),x(e.category?8:-1),l(),x(e.scopeLayer?9:-1),l(),x(e.ragScopes!=null&&e.ragScopes.length?10:-1),l(4),R("text-emerald-400",!e.isActive)("text-amber-400",e.isActive),M("data-testid","ma-reference-toggle-"+e._id),l(),g(" ",e.isActive?"deactivate":"activate"," ")}}function It(n,d){n&1&&(a(0,"div",18),s(1,"Nincs reference-bejegyz\xE9s."),o())}function Vt(n,d){if(n&1){let e=k();a(0,"div",19)(1,"h3",30),s(2),o(),a(3,"input",31),w("ngModelChange",function(t){m(e);let r=c(2);return v(r.formCanonical,t)||(r.formCanonical=t),_(t)}),o(),a(4,"input",32),w("ngModelChange",function(t){m(e);let r=c(2);return v(r.formAliases,t)||(r.formAliases=t),_(t)}),o(),a(5,"textarea",33),w("ngModelChange",function(t){m(e);let r=c(2);return v(r.formDescription,t)||(r.formDescription=t),_(t)}),o(),a(6,"div",34)(7,"input",35),w("ngModelChange",function(t){m(e);let r=c(2);return v(r.formCategory,t)||(r.formCategory=t),_(t)}),o(),a(8,"input",36),w("ngModelChange",function(t){m(e);let r=c(2);return v(r.formScopeLayer,t)||(r.formScopeLayer=t),_(t)}),o()(),a(9,"input",37),w("ngModelChange",function(t){m(e);let r=c(2);return v(r.formRagScopes,t)||(r.formRagScopes=t),_(t)}),o(),a(10,"div",38)(11,"button",39),u("click",function(){m(e);let t=c(2);return _(t.submitForm())}),s(12,"Save"),o(),a(13,"button",40),u("click",function(){m(e);let t=c(2);return _(t.formOpen_$.set(!1))}),s(14,"Cancel"),o()()()}if(n&2){let e=c(2);l(2),I(e.editId?"Edit reference":"New reference"),l(),y("ngModel",e.formCanonical),l(),y("ngModel",e.formAliases),l(),y("ngModel",e.formDescription),l(2),y("ngModel",e.formCategory),l(),y("ngModel",e.formScopeLayer),l(),y("ngModel",e.formRagScopes)}}function Dt(n,d){if(n&1&&(a(0,"div",10)(1,"div")(2,"h2",11),s(3,"Scope tree"),o(),a(4,"div",12),T(5,wt,1,4,"ng-container",13,Ae,!1,Mt,2,0,"div",14),o(),f(8,kt,8,4,"div",15),o(),a(9,"div")(10,"h2",11),s(11,"Reference (alias \u2192 canonical)"),o(),a(12,"div",16),T(13,Ft,16,15,"div",17,yt,!1,It,2,0,"div",18),o()()(),f(16,Vt,15,7,"div",19)),n&2){let e,i=c();l(5),E(i.scopeTree_$()),l(3),x((e=i.selectedNode_$())?8:-1,e),l(5),E(i.references_$()),l(3),x(i.formOpen_$()?16:-1)}}function Lt(n,d){if(n&1&&ie(0,13),n&2){let e=d.$implicit,i=c().depth;c();let t=oe(16);S("ngTemplateOutlet",t)("ngTemplateOutletContext",$e(2,ht,e,i+1))}}function Nt(n,d){if(n&1){let e=k();a(0,"div")(1,"button",41),u("click",function(){let t=m(e).$implicit,r=c();return _(r.selectNode(t))}),a(2,"span",42),s(3),o(),s(4),a(5,"span",43),s(6),o()(),T(7,Lt,1,5,"ng-container",13,Ae),o()}if(n&2){let e=d.$implicit,i=d.depth;l(),Ee("padding-left",8+i*16,"px"),M("data-testid","ma-scope-node-"+e.scopeId),l(2),g("",e.layer,":"),l(),g(" ",e.canonicalName," "),l(2),g("(",e.entryCount??0,")"),l(),E(e.children)}}var Re=(()=>{class n{api=$(P);route=$(he);router=$(re);notify=$(Z);popup=$(le);scopeTree_$=h([]);selectedNode_$=h(null);references_$=h([]);loading_$=h(!0);formOpen_$=h(!1);editId=null;formCanonical="";formAliases="";formDescription="";formCategory="";formScopeLayer="";formRagScopes="";focusScopeId=null;ngOnInit(){return b(this,null,function*(){this.focusScopeId=this.route.snapshot.queryParamMap.get("focus"),yield this.load()})}load(){return b(this,null,function*(){this.loading_$.set(!0),yield Promise.all([this.loadScopeTree(),this.loadReferences()]),this.loading_$.set(!1),this.focusScopeId&&this.focusNode(this.focusScopeId)})}loadScopeTree(){return b(this,null,function*(){let e=yield this.api.invokeCapability("get_scope_tree");if(e.error)return;let i=e.data??{};this.scopeTree_$.set(i.tree??i.nodes??[])})}loadReferences(){return b(this,null,function*(){let e=yield this.api.invokeCapability("get_reference_stats");if(e.error)return;let i=e.data??{};this.references_$.set(i.references??i.items??[])})}selectNode(e){this.selectedNode_$.set(e)}focusNode(e){let i=this.findNode(this.scopeTree_$(),e);i&&this.selectedNode_$.set(i)}findNode(e,i){for(let t of e){if(t.scopeId===i)return t;let r=this.findNode(t.children??[],i);if(r)return r}return null}viewEntries(e){this.router.navigate(["/maintenance"],{queryParams:{scope:e.scopeId}})}openNewForm(){this.editId=null,this.formCanonical="",this.formAliases="",this.formDescription="",this.formCategory="",this.formScopeLayer="",this.formRagScopes="",this.formOpen_$.set(!0)}openEditForm(e){this.editId=e._id??null,this.formCanonical=e.canonicalTerm,this.formAliases=(e.aliasTerms??[]).join(", "),this.formDescription=e.description??"",this.formCategory=e.category??"",this.formScopeLayer=e.scopeLayer??"",this.formRagScopes=(e.ragScopes??[]).join(", "),this.formOpen_$.set(!0)}submitForm(){return b(this,null,function*(){if(!this.formCanonical.trim()){this.notify.newErrorMessage("A canonical term k\xF6telez\u0151.");return}let e={canonicalTerm:this.formCanonical,aliasTerms:this.parseCsv(this.formAliases),description:this.formDescription||void 0,category:this.formCategory||void 0,scopeLayer:this.formScopeLayer||void 0,ragScopes:this.parseCsv(this.formRagScopes)},i=yield this.api.invokeCapability(this.editId?"update_reference":"create_reference",B({id:this.editId??void 0},e));if(i.error){this.notify.newErrorMessage(`${i.error.errorCode}: ${i.error.message}`);return}this.notify.newSuccessMessage(this.editId?"Reference friss\xEDtve.":"Reference l\xE9trehozva."),this.formOpen_$.set(!1),yield this.loadReferences(),yield this.suggestRebuild()})}toggleActive(e){return b(this,null,function*(){let i=yield this.api.invokeCapability("toggle_reference",{id:e._id,isActive:!e.isActive});if(i.error){this.notify.newErrorMessage(`${i.error.errorCode}: ${i.error.message}`);return}this.notify.newSuccessMessage(`Reference ${e.isActive?"inaktiv\xE1lva":"aktiv\xE1lva"}.`),yield this.loadReferences(),yield this.suggestRebuild()})}rebuildIndex(){return b(this,null,function*(){let e=yield this.api.invokeCapability("rebuild_reference_index");if(e.error){this.notify.newErrorMessage(`${e.error.errorCode}: ${e.error.message}`);return}this.notify.newSuccessMessage("Reference-index \xFAjra\xE9p\xEDtve.")})}suggestRebuild(){return b(this,null,function*(){(yield this.popup.newConfirm({title:"Reference-index rebuild",message:"A reference-cache TTL-es (60s). Most \xFAjra\xE9p\xEDtsem az indexet, hogy a v\xE1ltoz\xE1s azonnal hasson?",confirmBtn:"Rebuild now"}))&&(yield this.rebuildIndex())})}parseCsv(e){return(e??"").split(",").map(i=>i.trim()).filter(i=>i.length)}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=N({type:n,selectors:[["ma-scopes"]],decls:17,vars:3,consts:[["scopeNode",""],["data-testid","ma-scopes",1,"mx-auto","max-w-6xl","p-6"],[1,"mb-4","block"],[1,"mb-4","flex","items-center","justify-between"],[1,"text-sm","opacity-60","hover:underline",3,"routerLink"],[1,"text-2xl","font-semibold"],[1,"flex","gap-2","text-sm"],["data-testid","ma-scopes-new-ref",1,"rounded","border","border-neutral-700","px-3","py-1","hover:bg-neutral-800",3,"click"],["data-testid","ma-scopes-rebuild",1,"rounded","border","border-neutral-700","px-3","py-1","hover:bg-neutral-800",3,"click"],["data-testid","ma-scopes-loading",1,"py-10","text-center","opacity-60"],[1,"grid","grid-cols-1","gap-6","lg:grid-cols-2"],[1,"mb-2","text-sm","uppercase","tracking-wide","opacity-50"],["data-testid","ma-scope-tree",1,"rounded","border","border-neutral-800","bg-neutral-900","p-3"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"py-4","text-center","text-sm","opacity-50"],["data-testid","ma-scope-detail",1,"mt-3","rounded","border","border-neutral-800","bg-neutral-900","p-3","text-sm"],["data-testid","ma-reference-list",1,"flex","flex-col","gap-2"],[1,"rounded","border","border-neutral-800","bg-neutral-900","p-3","text-sm"],[1,"py-4","text-center","opacity-50"],["data-testid","ma-reference-form",1,"mt-6","rounded","border","border-neutral-800","bg-neutral-900","p-4"],[1,"font-medium"],[1,"text-xs","opacity-60"],[1,"mt-1","text-xs","opacity-60"],["data-testid","ma-scope-view-entries",1,"mt-2","rounded","border","border-neutral-700","px-2","py-1","text-xs","hover:bg-neutral-800",3,"click"],[1,"flex","items-start","justify-between"],[1,"flex-1"],[1,"opacity-60"],[1,"mt-1","text-xs","opacity-50"],[1,"flex","gap-1"],[1,"rounded","px-2","py-1","text-xs","hover:bg-neutral-800",3,"click"],[1,"mb-3","font-medium"],["placeholder","canonical term","data-testid","ma-ref-canonical",1,"mb-2","w-full","rounded","border","border-neutral-700","bg-neutral-950","p-2","text-sm",3,"ngModelChange","ngModel"],["placeholder","aliases (typo / fonetikus / STT, vessz\u0151vel)","data-testid","ma-ref-aliases",1,"mb-2","w-full","rounded","border","border-neutral-700","bg-neutral-950","p-2","text-sm",3,"ngModelChange","ngModel"],["rows","2","placeholder","description",1,"mb-2","w-full","rounded","border","border-neutral-700","bg-neutral-950","p-2","text-sm",3,"ngModelChange","ngModel"],[1,"mb-2","flex","gap-2"],["placeholder","category",1,"flex-1","rounded","border","border-neutral-700","bg-neutral-950","p-2","text-sm",3,"ngModelChange","ngModel"],["placeholder","scope-layer (opc.)",1,"flex-1","rounded","border","border-neutral-700","bg-neutral-950","p-2","text-sm",3,"ngModelChange","ngModel"],["placeholder","ragScopes \u2014 mely t\xE1rakra (vessz\u0151vel, \xFCres = mind)",1,"mb-3","w-full","rounded","border","border-neutral-700","bg-neutral-950","p-2","text-sm",3,"ngModelChange","ngModel"],[1,"flex","gap-2"],["data-testid","ma-ref-submit",1,"rounded","bg-emerald-700","px-4","py-1","text-sm","hover:bg-emerald-600",3,"click"],[1,"rounded","border","border-neutral-700","px-4","py-1","text-sm","hover:bg-neutral-800",3,"click"],["type","button",1,"block","w-full","rounded","px-2","py-1","text-left","text-sm","hover:bg-neutral-800",3,"click"],[1,"opacity-50"],[1,"opacity-40"]],template:function(i,t){if(i&1){let r=k();a(0,"div",1),A(1,"ma-banner-host",2),a(2,"div",3)(3,"div")(4,"a",4),s(5,"\u2190 Maintenance"),o(),a(6,"h1",5),s(7,"Scopes & Reference"),o()(),a(8,"div",6)(9,"button",7),u("click",function(){return m(r),_(t.openNewForm())}),s(10,"New reference"),o(),a(11,"button",8),u("click",function(){return m(r),_(t.rebuildIndex())}),s(12,"Rebuild index"),o()()(),f(13,vt,2,0,"div",9)(14,Dt,17,4),o(),ge(15,Nt,9,6,"ng-template",null,0,xe)}i&2&&(l(4),S("routerLink",V(2,xt)),l(9),x(t.loading_$()?13:14))},dependencies:[D,be,H,Q,q,K,L,O,X],encapsulation:2})}return n})();var Pt=()=>["/maintenance"],Bt=(n,d)=>d.query,At=(n,d)=>d.id,Rt=(n,d)=>d.rawToken,Wt=(n,d)=>d.scopeId;function zt(n,d){if(n&1){let e=k();a(0,"button",23),u("click",function(){let t=m(e).$implicit,r=c().$index,p=c();return _(p.toggleTable(r,t))}),s(1),o()}if(n&2){let e=d.$implicit,i=c().$index,t=c();R("bg-blue-700",t.isTableSelected(i,e))("bg-neutral-800",!t.isTableSelected(i,e)),M("data-testid","ma-search-table-"+i+"-"+e),l(),g(" ",t.tableLabel(e)," ")}}function jt(n,d){if(n&1){let e=k();a(0,"div",6)(1,"div",18),T(2,zt,2,6,"button",19,J),o(),a(4,"div",20)(5,"input",21),u("ngModelChange",function(t){let r=m(e).$index,p=c();return _(p.setQuery(r,t))}),o(),a(6,"button",22),u("click",function(){let t=m(e).$index,r=c();return _(r.removeRow(t))}),s(7,"remove"),o()()()}if(n&2){let e=d.$implicit,i=d.$index,t=c();l(2),E(t.mainTables),l(3),S("ngModel",e.query),M("data-testid","ma-search-query-"+i)}}function Ot(n,d){n&1&&(a(0,"div",15),s(1,"Searching\u2026"),o())}function qt(n,d){n&1&&(s(0," \xB7 "),a(1,"span",25),s(2,"relev\xE1ns elemek lemaradtak (truncated)"),o())}function Kt(n,d){if(n&1){let e=k();a(0,"button",36),u("click",function(){let t=m(e).$implicit,r=c(4);return _(r.applySuggestion(t))}),s(1),o()}if(n&2){let e=d.$implicit;M("data-testid","ma-search-suggestion"),l(),g(" ",e," ")}}function Ht(n,d){if(n&1&&(a(0,"div",34),T(1,Kt,2,2,"button",35,J),o()),n&2){let e=c(2).$implicit;l(),E(e.suggestions)}}function Xt(n,d){if(n&1&&(a(0,"div",27)(1,"div",32),s(2,"S\u0171r\u0171 eredm\xE9ny \u2014 a query t\xFAl t\xE1g lehet"),o(),a(3,"div",33),s(4),f(5,qt,3,0),o(),f(6,Ht,3,0,"div",34),o()),n&2){let e=c().$implicit;M("data-testid","ma-search-dense-"+e.query),l(4),g(" ",e.totalRelevant," relev\xE1ns elem a minScore felett (topK el\u0151tt) "),l(),x(e.truncated?5:-1),l(),x(e.suggestions.length?6:-1)}}function Gt(n,d){if(n&1&&(a(0,"div"),s(1),z(2,"number"),o()),n&2){let e=d.$implicit;l(),Y('"',e.rawToken,'" \u2192 ',e.resolvedTo," (konfidencia: ",j(2,3,e.confidence,"1.2-2"),")")}}function Ut(n,d){if(n&1&&(a(0,"div",28),T(1,Gt,3,6,"div",null,Rt),o()),n&2){let e=c().$implicit;M("data-testid","ma-search-uncertainty"),l(),E(e.uncertaintyNotes)}}function Qt(n,d){if(n&1&&s(0),n&2){let e=c(2).$implicit;g(" szekci\xF3: ",e.heading??(e.headingPath==null?null:e.headingPath.join(" \u203A "))," \xB7 ")}}function Zt(n,d){if(n&1&&s(0),n&2){let e=c(2).$implicit;g(" sorok ",e.lines," \xB7 ")}}function Jt(n,d){if(n&1&&s(0),n&2){let e=c(2).$implicit;W(" chars ",e.position.charStart,"\u2013",e.position.charEnd," \xB7 ")}}function Yt(n,d){if(n&1&&s(0),n&2){let e=c(2).$implicit;g(" repo: ",e.repoPath," \xB7 ")}}function en(n,d){if(n&1&&(a(0,"div",43),s(1),o(),a(2,"div",44),f(3,Qt,1,1),f(4,Zt,1,1)(5,Jt,1,2),f(6,Yt,1,1),s(7),o()),n&2){let e=c().$implicit;l(),I(e.content),l(2),x(e.heading||e.headingPath!=null&&e.headingPath.length?3:-1),l(),x(e.lines?4:e.position?5:-1),l(2),x(e.repoPath?6:-1),l(),W(" kind: ",e.kind??"\u2014"," \xB7 tags: ",e.tags.join(", ")," ")}}function tn(n,d){if(n&1&&(a(0,"div",39),s(1),o()),n&2){let e=c().$implicit;l(),I(e.content)}}function nn(n,d){if(n&1&&(a(0,"span",41),s(1),o()),n&2){let e=d.$implicit;l(),W("",e.layer,":",e.canonicalName)}}function on(n,d){if(n&1){let e=k();a(0,"div",30)(1,"div",37)(2,"div",38),f(3,en,8,6)(4,tn,2,1,"div",39),a(5,"div",40)(6,"span"),s(7),z(8,"number"),o(),a(9,"span"),s(10),o(),a(11,"span"),s(12),z(13,"number"),o(),a(14,"span"),s(15),o(),a(16,"span"),s(17),o(),T(18,nn,2,2,"span",41,Wt),o()(),a(20,"button",42),u("click",function(){let t=m(e).$implicit,r=c(2);return _(r.toggleExpand(t.id))}),s(21),o()()()}if(n&2){let e=d.$implicit,i=c(2);M("data-testid","ma-search-hit-"+e.id),l(3),x(i.isExpanded(e.id)?3:4),l(4),g("score ",j(8,9,e.score,"1.3-3")),l(3),g("weight ",e.weight),l(2),g("final ",j(13,12,e.finalScore,"1.3-3")),l(3),I(i.tableLabel(e.table)),l(2),g("src: ",i.hitSource(e)),l(),E(e.scopePath),l(2),M("data-testid","ma-search-expand-"+e.id),l(),g(" ",i.isExpanded(e.id)?"collapse":"expand"," ")}}function an(n,d){n&1&&(a(0,"div",31),s(1,"Nincs tal\xE1lat erre a query-re."),o())}function rn(n,d){if(n&1&&(a(0,"div",17)(1,"div",24)(2,"span",25),s(3),o(),a(4,"span",26),s(5),o()(),f(6,Xt,7,4,"div",27),f(7,Ut,3,1,"div",28),a(8,"div",29),T(9,on,22,15,"div",30,At,!1,an,2,0,"div",31),o()()),n&2){let e=d.$implicit;l(3),g('"',e.query,'"'),l(2),W(" \xB7 ",e.hits.length," hit \xB7 ",e.totalRelevant," relev\xE1ns"),l(),x(e.denseResults?6:-1),l(),x(e.uncertaintyNotes.length?7:-1),l(2),E(e.hits)}}var We=(()=>{class n{api=$(P);notify=$(Z);mainTables=ee;rows_$=h([{tables:[C.memory],query:""}]);topK=5;minScore=0;tagFilter="";kindFilter="";results_$=h([]);searching_$=h(!1);expanded_$=h(new Set);ngOnInit(){return b(this,null,function*(){yield this.loadDefaults()})}loadDefaults(){return b(this,null,function*(){let e=yield this.api.getConfig();if(e.data?.effective){let i=e.data.effective["read.topK"],t=e.data.effective["read.minScore"];typeof i?.value=="number"&&(this.topK=i.value),typeof t?.value=="number"&&(this.minScore=t.value)}})}addRow(){this.rows_$.set([...this.rows_$(),{tables:[C.knowledge],query:""}])}removeRow(e){this.rows_$.set(this.rows_$().filter((i,t)=>t!==e))}toggleTable(e,i){let t=[...this.rows_$()],r=t[e].tables.includes(i)?t[e].tables.filter(p=>p!==i):[...t[e].tables,i];t[e]=U(B({},t[e]),{tables:r}),this.rows_$.set(t)}isTableSelected(e,i){return this.rows_$()[e].tables.includes(i)}setQuery(e,i){let t=[...this.rows_$()];t[e]=U(B({},t[e]),{query:i}),this.rows_$.set(t)}tableLabel(e){return G[e]}search(){return b(this,null,function*(){let e=this.rows_$().filter(t=>t.query.trim()&&t.tables.length);if(!e.length){this.notify.newErrorMessage("Adj meg legal\xE1bb egy query-t (t\xE1bla + phrase).");return}this.searching_$.set(!0);let i=yield this.api.read({queries:e.map(t=>({tables:t.tables,query:t.query,topK:this.topK,minScore:this.minScore,tagFilter:this.tagFilter?this.parseCsv(this.tagFilter):void 0,kindFilter:this.kindFilter||void 0})),includeContent:!0});if(this.searching_$.set(!1),i.error){this.notify.newErrorMessage(`${i.error.errorCode}: ${i.error.message}`),this.results_$.set([]);return}this.results_$.set(i.data?.results??[])})}toggleExpand(e){let i=new Set(this.expanded_$());i.has(e)?i.delete(e):i.add(e),this.expanded_$.set(i)}isExpanded(e){return this.expanded_$().has(e)}applySuggestion(e){let i=e.toLowerCase(),t=e.match(/tag[:=]\s*([\w-]+)/i),r=e.match(/kind[:=]\s*([\w-]+)/i);t?this.tagFilter=this.tagFilter?`${this.tagFilter},${t[1]}`:t[1]:r?this.kindFilter=r[1]:i.includes("mincore")||i.includes("minscore")?this.minScore=Math.min(this.minScore+.1,1):i.includes("topk")&&(this.topK=Math.max(this.topK-1,1)),this.search()}hitSource(e){let i=e.path??e.sourceFilePath;return i||(e.sourceType??e.source?.type??"manual")}parseCsv(e){return(e??"").split(",").map(i=>i.trim()).filter(i=>i.length)}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=N({type:n,selectors:[["ma-search"]],decls:27,vars:7,consts:[["data-testid","ma-search",1,"mx-auto","max-w-5xl","p-6"],[1,"mb-4","block"],[1,"mb-4"],[1,"text-sm","opacity-60","hover:underline",3,"routerLink"],[1,"text-2xl","font-semibold"],["data-testid","ma-search-queries",1,"mb-4","flex","flex-col","gap-3"],[1,"rounded","border","border-neutral-800","bg-neutral-900","p-3"],["data-testid","ma-search-add-query",1,"self-start","rounded","border","border-neutral-700","px-3","py-1","text-sm","hover:bg-neutral-800",3,"click"],[1,"mb-4","flex","flex-wrap","items-center","gap-3","text-sm"],[1,"flex","items-center","gap-1"],["type","number","data-testid","ma-search-topk",1,"w-20","rounded","border","border-neutral-700","bg-neutral-900","px-2","py-1",3,"ngModelChange","ngModel"],["type","number","step","0.05","data-testid","ma-search-minscore",1,"w-24","rounded","border","border-neutral-700","bg-neutral-900","px-2","py-1",3,"ngModelChange","ngModel"],["placeholder","tag filter (vessz\u0151vel)","data-testid","ma-search-tagfilter",1,"w-40","rounded","border","border-neutral-700","bg-neutral-900","px-2","py-1",3,"ngModelChange","ngModel"],["placeholder","kind filter","data-testid","ma-search-kindfilter",1,"w-32","rounded","border","border-neutral-700","bg-neutral-900","px-2","py-1",3,"ngModelChange","ngModel"],["data-testid","ma-search-submit",1,"rounded","bg-blue-700","px-4","py-1","hover:bg-blue-600",3,"click"],["data-testid","ma-search-loading",1,"py-10","text-center","opacity-60"],["data-testid","ma-search-results",1,"flex","flex-col","gap-6"],[1,"rounded","border","border-neutral-800"],[1,"mb-2","flex","flex-wrap","gap-1"],["type","button",1,"rounded","px-2","py-1","text-xs",3,"bg-blue-700","bg-neutral-800"],[1,"flex","items-center","gap-2"],["placeholder","query phrase",1,"flex-1","rounded","border","border-neutral-700","bg-neutral-950","px-2","py-1","text-sm",3,"ngModelChange","ngModel"],[1,"rounded","px-2","py-1","text-sm","text-red-400","hover:bg-neutral-800",3,"click"],["type","button",1,"rounded","px-2","py-1","text-xs",3,"click"],[1,"border-b","border-neutral-800","bg-neutral-900","px-3","py-2","text-sm"],[1,"font-medium"],[1,"opacity-50"],[1,"border-b","border-yellow-700","bg-yellow-950","px-3","py-2","text-sm","text-yellow-200"],[1,"border-b","border-amber-700/60","bg-neutral-900","px-3","py-2","text-xs","text-amber-300"],[1,"flex","flex-col","gap-2","p-2"],[1,"rounded","border","border-neutral-800","bg-neutral-900","p-3","text-sm"],[1,"py-4","text-center","opacity-50"],[1,"font-semibold"],[1,"mt-1"],[1,"mt-2","flex","flex-wrap","gap-2"],["type","button",1,"rounded","bg-yellow-800","px-2","py-1","text-xs","hover:bg-yellow-700"],["type","button",1,"rounded","bg-yellow-800","px-2","py-1","text-xs","hover:bg-yellow-700",3,"click"],[1,"flex","items-start","justify-between","gap-3"],[1,"flex-1"],[1,"line-clamp-2","opacity-90"],[1,"mt-1","flex","flex-wrap","gap-2","text-xs","opacity-60"],[1,"rounded","bg-purple-900","px-1.5","py-0.5"],[1,"rounded","px-2","py-1","text-xs","hover:bg-neutral-800",3,"click"],[1,"whitespace-pre-wrap","opacity-90"],[1,"mt-1","text-xs","opacity-50"]],template:function(i,t){i&1&&(a(0,"div",0),A(1,"ma-banner-host",1),a(2,"div",2)(3,"a",3),s(4,"\u2190 Maintenance"),o(),a(5,"h1",4),s(6,"Search (val\xF3di read-teszt)"),o()(),a(7,"div",5),T(8,jt,8,2,"div",6,fe),a(10,"button",7),u("click",function(){return t.addRow()}),s(11,"+ add query"),o()(),a(12,"div",8)(13,"label",9),s(14,"topK "),a(15,"input",10),w("ngModelChange",function(p){return v(t.topK,p)||(t.topK=p),p}),o()(),a(16,"label",9),s(17,"minScore "),a(18,"input",11),w("ngModelChange",function(p){return v(t.minScore,p)||(t.minScore=p),p}),o()(),a(19,"input",12),w("ngModelChange",function(p){return v(t.tagFilter,p)||(t.tagFilter=p),p}),o(),a(20,"input",13),w("ngModelChange",function(p){return v(t.kindFilter,p)||(t.kindFilter=p),p}),o(),a(21,"button",14),u("click",function(){return t.search()}),s(22,"Search"),o()(),f(23,Ot,2,0,"div",15),a(24,"div",16),T(25,rn,12,6,"div",17,Bt),o()()),i&2&&(l(3),S("routerLink",V(6,Pt)),l(5),E(t.rows_$()),l(7),y("ngModel",t.topK),l(3),y("ngModel",t.minScore),l(),y("ngModel",t.tagFilter),l(),y("ngModel",t.kindFilter),l(3),x(t.searching_$()?23:-1),l(2),E(t.results_$()))},dependencies:[D,H,Q,Ie,q,K,L,O,X,Ce],encapsulation:2})}return n})();var ln=()=>["/maintenance"],sn=(n,d)=>d.key;function dn(n,d){if(n&1&&(a(0,"option",7),s(1),o()),n&2){let e=d.$implicit,i=c();S("value",e),l(),g("",i.tableLabel(e)," (table-override)")}}function cn(n,d){n&1&&(a(0,"div",15),s(1,"Loading\u2026"),o())}function pn(n,d){if(n&1){let e=k();a(0,"input",25),u("ngModelChange",function(t){m(e);let r=c().$implicit,p=c(2);return _(p.onValueChange(r.key,t))}),o()}if(n&2){let e=c().$implicit;S("ngModel",e.value),M("data-testid","ma-config-value-"+e.key)}}function mn(n,d){if(n&1){let e=k();a(0,"input",26),u("ngModelChange",function(t){m(e);let r=c().$implicit,p=c(2);return _(p.onValueChange(r.key,t))}),o()}if(n&2){let e=c().$implicit;S("ngModel",e.value),M("data-testid","ma-config-value-"+e.key)}}function _n(n,d){if(n&1){let e=k();a(0,"div",17)(1,"div",19),s(2),o(),a(3,"div",20),f(4,pn,1,2,"input",21)(5,mn,1,2,"input",22),o(),a(6,"span",23),s(7),o(),a(8,"button",24),u("click",function(){let t=m(e).$implicit,r=c(2);return _(r.saveRow(t))}),s(9,"Save"),o()()}if(n&2){let e=d.$implicit,i=c(2);M("data-testid","ma-config-row-"+e.key),l(2),I(e.key),l(2),x(i.isBoolean(e.value)?4:5),l(2),R("bg-neutral-700",e.resolvedFrom==="builtin"||e.resolvedFrom==="global")("bg-blue-800",e.resolvedFrom==="table")("bg-purple-800",e.resolvedFrom==="scope"),M("data-testid","ma-config-source-"+e.key),l(),g(" ",i.sourceLabel(e.resolvedFrom)," "),l(),M("data-testid","ma-config-save-"+e.key)}}function un(n,d){n&1&&(a(0,"div",18),s(1,"Nincs config-kulcs (a szerver nem el\xE9rhet\u0151?)."),o())}function gn(n,d){if(n&1&&(a(0,"div",16),T(1,_n,10,12,"div",17,sn,!1,un,2,0,"div",18),o()),n&2){let e=c();l(),E(e.rows_$())}}var ze=(()=>{class n{api=$(P);notify=$(Z);mainTables=ee;tableScope="";rows_$=h([]);loading_$=h(!0);ngOnInit(){return b(this,null,function*(){yield this.load()})}load(){return b(this,null,function*(){this.loading_$.set(!0);let e=yield this.api.getConfig(this.tableScope||void 0);if(e.error){this.notify.newErrorMessage(`${e.error.errorCode}: ${e.error.message}`),this.loading_$.set(!1);return}let i=e.data?.effective??{},t=Object.keys(i).sort().map(r=>({key:r,value:i[r].value,resolvedFrom:i[r].resolvedFrom}));this.rows_$.set(t),this.loading_$.set(!1)})}tableLabel(e){return G[e]}sourceLabel(e){switch(e){case"builtin":return"builtin default";case"global":return"\xF6r\xF6kl\xF6tt global default";case"table":return"table-override";case"scope":return"scope-override";default:return e}}isBoolean(e){return typeof e=="boolean"}onValueChange(e,i){let t=this.rows_$().map(r=>r.key===e?U(B({},r),{value:i}):r);this.rows_$.set(t)}saveRow(e){return b(this,null,function*(){let i=yield this.api.setConfig({key:e.key,value:e.value,table:this.tableScope||void 0});if(i.error){this.notify.newErrorMessage(`${i.error.errorCode}: ${i.error.message}`);return}this.notify.newSuccessMessage(`${e.key} mentve.`),yield this.load()})}applyOpenAiPreset(){return b(this,null,function*(){yield this.applyPreset("openai")})}applyLmStudioPreset(){return b(this,null,function*(){yield this.applyPreset("lmstudio")})}applyPreset(e){return b(this,null,function*(){let i=yield this.api.invokeCapability("apply_preset",{preset:e,table:this.tableScope||void 0});if(i.error){this.notify.newErrorMessage(`${i.error.errorCode}: ${i.error.message}`);return}this.notify.newSuccessMessage(`${e} preset alkalmazva.`),yield this.load()})}testMongo(){this.runTest("test_mongodb_connection","MongoDB")}testEmbedding(){this.runTest("test_embedding_provider","Embedding-provider")}testVectorSearch(){this.runTest("test_vector_search","Vector search")}runTest(e,i){return b(this,null,function*(){let t=yield this.api.invokeCapability(e);if(t.error){this.notify.newErrorMessage(`${i} teszt: ${t.error.errorCode} \u2014 ${t.error.message}`);return}let r=t.data??{};r.ok===!1?this.notify.newErrorMessage(`${i} teszt sikertelen: ${r.message??"ismeretlen ok"}`):this.notify.newSuccessMessage(`${i} teszt OK${r.message?" \u2014 "+r.message:""}.`)})}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=N({type:n,selectors:[["ma-settings"]],decls:28,vars:4,consts:[["data-testid","ma-settings",1,"mx-auto","max-w-4xl","p-6"],[1,"mb-4","block"],[1,"mb-4","flex","items-center","justify-between"],[1,"text-sm","opacity-60","hover:underline",3,"routerLink"],[1,"text-2xl","font-semibold"],["data-testid","ma-settings-scope",1,"rounded","border","border-neutral-700","bg-neutral-900","px-2","py-1","text-sm",3,"ngModelChange","ngModel"],["value",""],[3,"value"],["data-testid","ma-settings-actions",1,"mb-4","flex","flex-wrap","gap-2","text-sm"],["data-testid","ma-preset-openai",1,"rounded","border","border-neutral-700","px-3","py-1","hover:bg-neutral-800",3,"click"],["data-testid","ma-preset-lmstudio",1,"rounded","border","border-neutral-700","px-3","py-1","hover:bg-neutral-800",3,"click"],[1,"mx-1","opacity-30"],["data-testid","ma-test-mongo",1,"rounded","border","border-neutral-700","px-3","py-1","hover:bg-neutral-800",3,"click"],["data-testid","ma-test-embedding",1,"rounded","border","border-neutral-700","px-3","py-1","hover:bg-neutral-800",3,"click"],["data-testid","ma-test-vector",1,"rounded","border","border-neutral-700","px-3","py-1","hover:bg-neutral-800",3,"click"],["data-testid","ma-settings-loading",1,"py-10","text-center","opacity-60"],["data-testid","ma-settings-rows",1,"flex","flex-col","gap-2"],[1,"flex","flex-wrap","items-center","gap-3","rounded","border","border-neutral-800","bg-neutral-900","p-2","text-sm"],[1,"py-6","text-center","opacity-50"],[1,"w-56","font-mono","text-xs"],[1,"flex-1"],["type","checkbox",3,"ngModel"],[1,"w-full","rounded","border","border-neutral-700","bg-neutral-950","px-2","py-1",3,"ngModel"],[1,"rounded","px-2","py-0.5","text-xs"],[1,"rounded","bg-emerald-700","px-3","py-1","text-xs","hover:bg-emerald-600",3,"click"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"w-full","rounded","border","border-neutral-700","bg-neutral-950","px-2","py-1",3,"ngModelChange","ngModel"]],template:function(i,t){i&1&&(a(0,"div",0),A(1,"ma-banner-host",1),a(2,"div",2)(3,"div")(4,"a",3),s(5,"\u2190 Maintenance"),o(),a(6,"h1",4),s(7,"Settings"),o()(),a(8,"select",5),w("ngModelChange",function(p){return v(t.tableScope,p)||(t.tableScope=p),p}),u("ngModelChange",function(){return t.load()}),a(9,"option",6),s(10,"global"),o(),T(11,dn,2,2,"option",7,J),o()(),a(13,"div",8)(14,"button",9),u("click",function(){return t.applyOpenAiPreset()}),s(15,"Apply OpenAI preset"),o(),a(16,"button",10),u("click",function(){return t.applyLmStudioPreset()}),s(17,"Apply LM Studio preset"),o(),a(18,"span",11),s(19,"|"),o(),a(20,"button",12),u("click",function(){return t.testMongo()}),s(21,"Test MongoDB"),o(),a(22,"button",13),u("click",function(){return t.testEmbedding()}),s(23,"Test embedding"),o(),a(24,"button",14),u("click",function(){return t.testVectorSearch()}),s(25,"Test vector search"),o()(),f(26,cn,2,0,"div",15)(27,gn,4,1,"div",16),o()),i&2&&(l(4),S("routerLink",V(3,ln)),l(4),y("ngModel",t.tableScope),l(3),E(t.mainTables),l(15),x(t.loading_$()?26:27))},dependencies:[D,H,we,Me,Q,ye,ve,q,K,L,O,X],encapsulation:2})}return n})();var se=(function(n){return n.create="create",n.update="update",n.delete="delete",n.scanFile="scan-file",n.scanFolder="scan-folder",n.scanProject="scan-project",n.reEmbed="re-embed",n.import="import",n})(se||{});function fn(n,d){if(n&1&&(a(0,"div",7),s(1),a(2,"span",8),s(3),z(4,"number"),o()()),n&2){let e=c(),i=e.$implicit,t=e.$index;M("data-testid","ma-scope-preview-"+t),l(),g(" \u2192 ",i.resolvedPreview.canonicalName," "),l(2),g("(konfidencia: ",j(4,3,i.resolvedPreview.confidence,"1.2-2"),")")}}function xn(n,d){if(n&1){let e=k();a(0,"div",2)(1,"input",4),u("ngModelChange",function(t){let r=m(e).$index,p=c();return _(p.onLayerChange(r,t))}),o(),a(2,"input",5),u("ngModelChange",function(t){let r=m(e).$index,p=c();return _(p.onRawNameChange(r,t))}),o(),a(3,"button",6),u("click",function(){let t=m(e).$index,r=c();return _(r.removeLayer(t))}),s(4," remove "),o(),f(5,fn,5,6,"div",7),o()}if(n&2){let e=d.$implicit,i=d.$index;l(),S("ngModel",e.layer),M("data-testid","ma-scope-layer-"+i),l(),S("ngModel",e.rawName),M("data-testid","ma-scope-rawname-"+i),l(),M("data-testid","ma-scope-remove-"+i),l(2),x(e.resolvedPreview?5:-1)}}var je=(()=>{class n{api=$(P);value=[];valueChange=new Te;rows_$=h([]);ngOnInit(){let e=(this.value??[]).map(i=>({layer:i.layer,rawName:i.rawName,resolvedPreview:void 0}));this.rows_$.set(e.length?e:[{layer:"project",rawName:"",resolvedPreview:void 0}])}addLayer(){this.rows_$.set([...this.rows_$(),{layer:"",rawName:"",resolvedPreview:void 0}])}removeLayer(e){this.rows_$.set(this.rows_$().filter((i,t)=>t!==e)),this.emit()}onLayerChange(e,i){let t=[...this.rows_$()];t[e]=U(B({},t[e]),{layer:i}),this.rows_$.set(t),this.emit()}onRawNameChange(e,i){let t=[...this.rows_$()];t[e]=U(B({},t[e]),{rawName:i}),this.rows_$.set(t),this.emit(),this.loadPreview(e)}loadPreview(e){return b(this,null,function*(){let i=this.rows_$()[e];if(!i?.rawName)return;let t=yield this.api.invokeCapability("trace_reference_expansion",{layer:i.layer,rawName:i.rawName});if(t.error)return;let r=t.data??{};if(r.canonicalName){let p=[...this.rows_$()];p[e]=U(B({},p[e]),{resolvedPreview:{canonicalName:r.canonicalName,confidence:r.confidence??0}}),this.rows_$.set(p)}})}emit(){let e=this.rows_$().filter(i=>i.layer&&i.rawName).map(i=>({layer:i.layer,rawName:i.rawName}));this.value=e,this.valueChange.emit(e)}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=N({type:n,selectors:[["ma-scope-picker"]],inputs:{value:"value"},outputs:{valueChange:"valueChange"},decls:7,vars:0,consts:[["data-testid","ma-scope-picker",1,"flex","flex-col","gap-2"],[1,"text-xs","uppercase","tracking-wide","opacity-60"],[1,"flex","flex-wrap","items-center","gap-2"],["type","button","data-testid","ma-scope-add-layer",1,"self-start","rounded","border","border-neutral-700","px-3","py-1","text-sm","hover:bg-neutral-800",3,"click"],["type","text","placeholder","layer (pl. project)",1,"w-40","rounded","border","border-neutral-700","bg-neutral-900","px-2","py-1","text-sm",3,"ngModelChange","ngModel"],["type","text","placeholder","n\xE9v (pl. Adventor)",1,"flex-1","rounded","border","border-neutral-700","bg-neutral-900","px-2","py-1","text-sm",3,"ngModelChange","ngModel"],["type","button",1,"rounded","px-2","py-1","text-sm","text-red-400","hover:bg-neutral-800",3,"click"],[1,"basis-full","pl-2","text-xs","text-emerald-400"],[1,"opacity-70"]],template:function(i,t){i&1&&(a(0,"div",0)(1,"div",1),s(2,"Scope (root \u2192 leaf, k\xF6telez\u0151)"),o(),T(3,xn,6,6,"div",2,fe),a(5,"button",3),u("click",function(){return t.addLayer()}),s(6," + add layer "),o()()),i&2&&(l(3),E(t.rows_$()))},dependencies:[D,H,Q,q,K,Ce],encapsulation:2})}return n})();var bn=()=>["/maintenance"],Oe=n=>({$implicit:n}),qe=(n,d)=>d._id,Cn=(n,d)=>d.runId,hn=(n,d)=>d.scopeId;function yn(n,d){if(n&1&&(a(0,"div",11)(1,"div")(2,"span",24),s(3,"count:"),o(),s(4),o(),a(5,"div")(6,"span",24),s(7,"pending:"),o(),s(8),o(),a(9,"div")(10,"span",24),s(11,"completed:"),o(),s(12),o(),a(13,"div")(14,"span",24),s(15,"error:"),o(),s(16),o()()),n&2){let e=d;l(4),g(" ",e.count),l(4),g(" ",(e.embeddingStatus==null?null:e.embeddingStatus.pending)??0),l(4),g(" ",(e.embeddingStatus==null?null:e.embeddingStatus.completed)??0),l(4),g(" ",(e.embeddingStatus==null?null:e.embeddingStatus.error)??0)}}function vn(n,d){if(n&1){let e=k();a(0,"textarea",34),w("ngModelChange",function(t){m(e);let r=c(2);return v(r.addCode,t)||(r.addCode=t),_(t)}),o()}if(n&2){let e=c(2);y("ngModel",e.addCode)}}function wn(n,d){if(n&1&&(a(0,"div",31),s(1),o()),n&2){let e=c(2);l(),g("aj\xE1nlott tag-ek: ",e.recommendedTags.join(", "))}}function Mn(n,d){if(n&1){let e=k();a(0,"div",12)(1,"h3",25),s(2,"Manual add"),o(),a(3,"textarea",26),w("ngModelChange",function(t){m(e);let r=c();return v(r.addContent,t)||(r.addContent=t),_(t)}),o(),f(4,vn,1,1,"textarea",27),a(5,"div",28)(6,"input",29),w("ngModelChange",function(t){m(e);let r=c();return v(r.addKind,t)||(r.addKind=t),_(t)}),o(),a(7,"input",30),w("ngModelChange",function(t){m(e);let r=c();return v(r.addTags,t)||(r.addTags=t),_(t)}),o()(),f(8,wn,2,1,"div",31),a(9,"ma-scope-picker",32),w("valueChange",function(t){m(e);let r=c();return v(r.addScope,t)||(r.addScope=t),_(t)}),o(),a(10,"button",33),u("click",function(){m(e);let t=c();return _(t.submitAdd())}),s(11,"Create"),o()()}if(n&2){let e=c();l(3),y("ngModel",e.addContent),l(),x(e.isCodingPatterns?4:-1),l(2),y("ngModel",e.addKind),l(),y("ngModel",e.addTags),l(),x(e.recommendedTags.length?8:-1),l(),y("value",e.addScope)}}function Sn(n,d){if(n&1){let e=k();a(0,"div",13)(1,"h3",25),s(2,"Bulk paste (\xFCres sor v\xE1lasztja el a blokkokat)"),o(),a(3,"textarea",35),w("ngModelChange",function(t){m(e);let r=c();return v(r.bulkText,t)||(r.bulkText=t),_(t)}),o(),a(4,"div",28)(5,"input",36),w("ngModelChange",function(t){m(e);let r=c();return v(r.bulkKind,t)||(r.bulkKind=t),_(t)}),o(),a(6,"input",37),w("ngModelChange",function(t){m(e);let r=c();return v(r.bulkTags,t)||(r.bulkTags=t),_(t)}),o()(),a(7,"ma-scope-picker",32),w("valueChange",function(t){m(e);let r=c();return v(r.bulkScope,t)||(r.bulkScope=t),_(t)}),o(),a(8,"button",38),u("click",function(){m(e);let t=c();return _(t.submitBulk())}),s(9,"Import all"),o()()}if(n&2){let e=c();l(3),y("ngModel",e.bulkText),l(2),y("ngModel",e.bulkKind),l(),y("ngModel",e.bulkTags),l(),y("value",e.bulkScope)}}function kn(n,d){if(n&1){let e=k();a(0,"div",14)(1,"h3",25),s(2,"Run scan / system-sync"),o(),a(3,"input",39),w("ngModelChange",function(t){m(e);let r=c();return v(r.scanPath,t)||(r.scanPath=t),_(t)}),o(),a(4,"div",28)(5,"input",40),w("ngModelChange",function(t){m(e);let r=c();return v(r.scanInclude,t)||(r.scanInclude=t),_(t)}),o(),a(6,"input",41),w("ngModelChange",function(t){m(e);let r=c();return v(r.scanExclude,t)||(r.scanExclude=t),_(t)}),o()(),a(7,"label",42)(8,"input",43),w("ngModelChange",function(t){m(e);let r=c();return v(r.scanDryRun,t)||(r.scanDryRun=t),_(t)}),o(),s(9," dry-run (csak felder\xEDt\xE9s) "),o(),a(10,"ma-scope-picker",32),w("valueChange",function(t){m(e);let r=c();return v(r.scanScope,t)||(r.scanScope=t),_(t)}),o(),a(11,"button",44),u("click",function(){m(e);let t=c();return _(t.submitScan())}),s(12,"Run"),o()()}if(n&2){let e=c();l(3),y("ngModel",e.scanPath),l(2),y("ngModel",e.scanInclude),l(),y("ngModel",e.scanExclude),l(2),y("ngModel",e.scanDryRun),l(2),y("value",e.scanScope)}}function Tn(n,d){n&1&&(a(0,"div",23),s(1,"Loading\u2026"),o())}function En(n,d){if(n&1&&ie(0,52),n&2){let e=d.$implicit;c(3);let i=oe(34);S("ngTemplateOutlet",i)("ngTemplateOutletContext",ne(2,Oe,e))}}function $n(n,d){n&1&&(a(0,"div",53),s(1,"Nincs bejegyz\xE9s."),o())}function Fn(n,d){if(n&1&&(a(0,"div",45),T(1,En,1,4,"ng-container",52,qe,!1,$n,2,0,"div",53),o()),n&2){let e=c(2);l(),E(e.items_$())}}function In(n,d){if(n&1&&ie(0,52),n&2){let e=d.$implicit;c(4);let i=oe(34);S("ngTemplateOutlet",i)("ngTemplateOutletContext",ne(2,Oe,e))}}function Vn(n,d){if(n&1){let e=k();a(0,"div",54)(1,"div",55)(2,"span",56),s(3),o(),a(4,"button",57),u("click",function(){let t=m(e).$implicit,r=c(3);return _(r.deleteRunGroup(t.runId))}),s(5,"Delete run"),o()(),a(6,"div",58),T(7,In,1,4,"ng-container",52,qe),o()()}if(n&2){let e=d.$implicit;l(3),W("run: ",e.runId," (",e.items.length," chunk)"),l(4),E(e.items)}}function Dn(n,d){if(n&1&&(a(0,"div",46),T(1,Vn,9,2,"div",54,Cn),o()),n&2){let e=c(2);l(),E(e.groupedByRun())}}function Ln(n,d){if(n&1){let e=k();f(0,Fn,4,1,"div",45)(1,Dn,3,0,"div",46),a(2,"div",47)(3,"span",48),s(4),o(),a(5,"div",49)(6,"button",50),u("click",function(){m(e);let t=c();return _(t.prevPage())}),s(7,"Prev"),o(),a(8,"button",51),u("click",function(){m(e);let t=c();return _(t.nextPage())}),s(9,"Next"),o()()()}if(n&2){let e=c();x(e.groupByRun?1:0),l(4),Y("\xF6sszesen: ",e.total_$()," \xB7 oldal ",e.page_$()," \xB7 oldalm\xE9ret ",e.pageSize_$())}}function Nn(n,d){if(n&1&&(a(0,"span",64),s(1),o()),n&2){let e=c().$implicit;l(),I(e.kind)}}function Pn(n,d){if(n&1&&(a(0,"span",65),s(1),o()),n&2){let e=d.$implicit;l(),I(e)}}function Bn(n,d){if(n&1){let e=k();a(0,"button",68),u("click",function(){let t=m(e).$implicit,r=c(2);return _(r.openScope(t.scopeId))}),s(1),o()}if(n&2){let e=d.$implicit;l(),W("",e.layer,":",e.canonicalName)}}function An(n,d){if(n&1&&s(0),n&2){let e=c().$implicit;Y(" \xB7 ",e.sourceFilePath," (",e.chunkIndex,"/",e.chunkTotal,") ")}}function Rn(n,d){if(n&1){let e=k();a(0,"div",59)(1,"div",60)(2,"div",61)(3,"div",62),s(4),o(),a(5,"div",63),f(6,Nn,2,1,"span",64),T(7,Pn,2,1,"span",65,J),T(9,Bn,2,2,"button",66,hn),o(),a(11,"div",67),s(12),z(13,"date"),f(14,An,1,3),o()(),a(15,"button",57),u("click",function(){let t=m(e).$implicit,r=c();return _(r.deleteEntry(t))}),s(16,"Delete"),o()()()}if(n&2){let e=d.$implicit;M("data-testid","ma-entry-"+e._id),l(4),I(e.content),l(2),x(e.kind?6:-1),l(),E(e.tags),l(2),E(e.scopePath),l(3),Y(" weight ",e.weight??1," \xB7 ",e.addedBy??"\u2014"," \xB7 ",e.__lastModified?j(13,8,e.__lastModified,"short"):"\u2014"," "),l(2),x(e.sourceFilePath?14:-1),l(),M("data-testid","ma-entry-delete-"+e._id)}}var Wn=50,zn=500,Ke=(()=>{class n{api=$(P);route=$(he);router=$(re);notify=$(Z);popup=$(le);table_$=h(C.rules);items_$=h([]);total_$=h(0);page_$=h(1);pageSize_$=h(Wn);loading_$=h(!1);tagFilter="";kindFilter="";textFilter="";ingestRunFilter="";groupByRun=!1;stats_$=h(null);addContent="";addCode="";addKind="";addTags="";addScope=[];addFormOpen_$=h(!1);bulkText="";bulkKind="";bulkTags="";bulkScope=[];bulkOpen_$=h(!1);scanPath="";scanInclude="";scanExclude="";scanDryRun=!0;scanScope=[];scanOpen_$=h(!1);get isCodingPatterns(){return this.table_$()===C.codingPatterns}get tableLabel(){return G[this.table_$()]}get recommendedTags(){return De[this.table_$()]??[]}ngOnInit(){this.route.paramMap.subscribe(e=>{let i=e.get("table"),t=Object.values(C).find(r=>r===i);if(!t||t===C.reference){this.router.navigate(["/maintenance"]);return}this.table_$.set(t),this.page_$.set(1),this.reload()})}reload(){return b(this,null,function*(){this.loading_$.set(!0);let e=yield this.api.getItems(this.table_$(),{page:this.page_$(),pageSize:this.pageSize_$(),tag:this.tagFilter||void 0,kind:this.kindFilter||void 0,ingestRunId:this.ingestRunFilter||void 0});if(e.error){this.notify.newErrorMessage(`${e.error.errorCode}: ${e.error.message}`),this.loading_$.set(!1);return}let i=e.data?.items??[];if(this.textFilter){let r=this.textFilter.toLowerCase();i=i.filter(p=>(p.content??"").toLowerCase().includes(r))}this.items_$.set(i),this.total_$.set(e.data?.total??i.length);let t=yield this.api.getTableStats(this.table_$());t.data&&this.stats_$.set(t.data),this.loading_$.set(!1)})}applyFilters(){this.page_$.set(1),this.reload()}nextPage(){this.page_$()*this.pageSize_$()<this.total_$()&&(this.page_$.set(this.page_$()+1),this.reload())}prevPage(){this.page_$()>1&&(this.page_$.set(this.page_$()-1),this.reload())}setPageSize(e){this.pageSize_$.set(Math.min(Math.max(e,1),zn)),this.page_$.set(1),this.reload()}submitAdd(){return b(this,null,function*(){if(!this.addContent.trim()){this.notify.newErrorMessage("A content k\xF6telez\u0151.");return}if(!this.addScope.length){this.notify.newErrorMessage("A scope k\xF6telez\u0151 (legal\xE1bb egy layer).");return}let e=this.parseCsv(this.addTags),i={};this.isCodingPatterns&&this.addCode&&(i.code=this.addCode);let t=yield this.api.write({table:this.table_$(),operation:se.create,scopePath:this.addScope,content:this.addContent,tags:e,kind:this.addKind||void 0,fields:Object.keys(i).length?i:void 0});if(t.error){this.notify.newErrorMessage(`${t.error.errorCode}: ${t.error.message}`);return}this.notify.newSuccessMessage("Bejegyz\xE9s l\xE9trehozva."),this.resetAddForm(),this.addFormOpen_$.set(!1),yield this.reload()})}resetAddForm(){this.addContent="",this.addCode="",this.addKind="",this.addTags="",this.addScope=[]}submitBulk(){return b(this,null,function*(){if(!this.bulkScope.length){this.notify.newErrorMessage("A bulk-paste-hez scope k\xF6telez\u0151.");return}let e=this.bulkText.split(/\n\s*\n/).map(p=>p.trim()).filter(p=>p.length);if(!e.length){this.notify.newErrorMessage("Nincs feldolgozhat\xF3 blokk (\xFCres sor v\xE1lasztja el).");return}let i=this.parseCsv(this.bulkTags),t=0,r=[];for(let p of e){let F=yield this.api.write({table:this.table_$(),operation:se.create,scopePath:this.bulkScope,content:p,tags:i,kind:this.bulkKind||void 0});F.error?r.push(`${F.error.errorCode}: ${p.slice(0,40)}\u2026`):t++}r.length?this.notify.newErrorMessage(`${t} l\xE9trehozva, ${r.length} hiba: ${r[0]}`):(this.notify.newSuccessMessage(`${t} bejegyz\xE9s l\xE9trehozva.`),this.bulkText="",this.bulkOpen_$.set(!1)),yield this.reload()})}deleteEntry(e){return b(this,null,function*(){if(!(yield this.popup.newConfirm({title:"Soft-delete",message:"Biztosan t\xF6rl\xF6d ezt a bejegyz\xE9st? (soft-delete, vissza\xE1ll\xEDthat\xF3)",confirmBtn:"Delete"})))return;let t=yield this.api.write({table:this.table_$(),operation:se.delete,target:{by:"id",value:e._id??""}});if(t.error){this.notify.newErrorMessage(`${t.error.errorCode}: ${t.error.message}`);return}this.notify.newSuccessMessage("T\xF6r\xF6lve (soft-delete)."),yield this.reload()})}deleteRunGroup(e){return b(this,null,function*(){if(!(yield this.popup.newConfirm({title:"Csoportos soft-delete",message:`A(z) ${e} ingest-run minden chunkja t\xF6rl\xE9sre ker\xFCl (soft-delete). Folytatod?`,confirmBtn:"Delete run"})))return;let t=yield this.api.invokeCapability("delete_ingest_run",{ingestRunId:e});if(t.error){this.notify.newErrorMessage(`${t.error.errorCode}: ${t.error.message}`);return}this.notify.newSuccessMessage("Run t\xF6r\xF6lve (soft-delete)."),yield this.reload()})}reembedTable(){return b(this,null,function*(){let i=this.stats_$()?.count??0;if(!(yield this.popup.newConfirm({title:"Re-embed t\xE1r",message:`${i} elem \xFAjra-embeddel\xE9se \u2014 ez embedding-k\xF6lts\xE9get okozhat. Folytatod?`,confirmBtn:"Re-embed"})))return;let r=yield this.api.invokeCapability("reembed_table",{table:this.table_$()});if(r.error){this.notify.newErrorMessage(`${r.error.errorCode}: ${r.error.message}`);return}this.notify.newSuccessMessage("Re-embed elind\xEDtva."),yield this.reload()})}submitScan(){return b(this,null,function*(){if(!this.scanPath.trim()){this.notify.newErrorMessage("A scan path k\xF6telez\u0151.");return}if(!this.scanScope.length){this.notify.newErrorMessage("A scan-hez scope k\xF6telez\u0151.");return}let e=yield this.api.write({table:this.table_$(),operation:se.scanFolder,scopePath:this.scanScope,scan:{path:this.scanPath,include:this.parseCsv(this.scanInclude),exclude:this.parseCsv(this.scanExclude),dryRun:this.scanDryRun}});if(e.error){this.notify.newErrorMessage(`${e.error.errorCode}: ${e.error.message}`);return}this.notify.newSuccessMessage(this.scanDryRun?"Dry-run scan k\xE9sz (l\xE1sd ingest id\u0151vonal).":"Scan k\xE9sz."),this.scanOpen_$.set(!1),yield this.reload()})}openScope(e){this.router.navigate(["/maintenance/scopes"],{queryParams:{focus:e}})}groupedByRun(){let e={};for(let i of this.items_$()){let t=i.ingestRunId??"(manual / no run)";(e[t]??=[]).push(i)}return Object.keys(e).map(i=>({runId:i,items:e[i]}))}parseCsv(e){return(e??"").split(",").map(i=>i.trim()).filter(i=>i.length)}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=N({type:n,selectors:[["ma-table-detail"]],decls:35,vars:13,consts:[["entryRow",""],["data-testid","ma-table-detail",1,"mx-auto","max-w-6xl","p-6"],[1,"mb-4","block"],[1,"mb-4","flex","items-center","justify-between"],[1,"text-sm","opacity-60","hover:underline",3,"routerLink"],[1,"text-2xl","font-semibold"],[1,"flex","gap-2","text-sm"],["data-testid","ma-detail-add-toggle",1,"rounded","border","border-neutral-700","px-3","py-1","hover:bg-neutral-800",3,"click"],["data-testid","ma-detail-bulk-toggle",1,"rounded","border","border-neutral-700","px-3","py-1","hover:bg-neutral-800",3,"click"],["data-testid","ma-detail-scan-toggle",1,"rounded","border","border-neutral-700","px-3","py-1","hover:bg-neutral-800",3,"click"],["data-testid","ma-detail-reembed",1,"rounded","border","border-amber-700","px-3","py-1","text-amber-300","hover:bg-neutral-800",3,"click"],["data-testid","ma-detail-stats",1,"mb-4","grid","grid-cols-2","gap-2","rounded","border","border-neutral-800","bg-neutral-900","p-3","text-sm","sm:grid-cols-4"],["data-testid","ma-entry-add-form",1,"mb-4","rounded","border","border-neutral-800","bg-neutral-900","p-4"],["data-testid","ma-bulk-paste",1,"mb-4","rounded","border","border-neutral-800","bg-neutral-900","p-4"],["data-testid","ma-scan-dialog",1,"mb-4","rounded","border","border-neutral-800","bg-neutral-900","p-4"],["data-testid","ma-detail-filters",1,"mb-3","flex","flex-wrap","items-center","gap-2","text-sm"],["placeholder","tag",1,"w-32","rounded","border","border-neutral-700","bg-neutral-900","px-2","py-1",3,"ngModelChange","ngModel"],["placeholder","kind",1,"w-32","rounded","border","border-neutral-700","bg-neutral-900","px-2","py-1",3,"ngModelChange","ngModel"],["placeholder","text (substring)",1,"w-40","rounded","border","border-neutral-700","bg-neutral-900","px-2","py-1",3,"ngModelChange","ngModel"],["placeholder","ingestRunId",1,"w-40","rounded","border","border-neutral-700","bg-neutral-900","px-2","py-1",3,"ngModelChange","ngModel"],[1,"flex","items-center","gap-1"],["type","checkbox","data-testid","ma-detail-groupby",3,"ngModelChange","ngModel"],["data-testid","ma-detail-apply-filters",1,"rounded","border","border-neutral-700","px-3","py-1","hover:bg-neutral-800",3,"click"],["data-testid","ma-detail-loading",1,"py-10","text-center","opacity-60"],[1,"opacity-50"],[1,"mb-3","font-medium"],["rows","4","placeholder","content","data-testid","ma-add-content",1,"mb-2","w-full","rounded","border","border-neutral-700","bg-neutral-950","p-2","text-sm",3,"ngModelChange","ngModel"],["rows","3","placeholder","code (NEM ker\xFCl a vektorba)","data-testid","ma-add-code",1,"mb-2","w-full","rounded","border","border-neutral-700","bg-neutral-950","p-2","text-sm",3,"ngModel"],[1,"mb-2","flex","gap-2"],["placeholder","kind","data-testid","ma-add-kind",1,"w-40","rounded","border","border-neutral-700","bg-neutral-950","p-2","text-sm",3,"ngModelChange","ngModel"],["placeholder","tags (vessz\u0151vel)","data-testid","ma-add-tags",1,"flex-1","rounded","border","border-neutral-700","bg-neutral-950","p-2","text-sm",3,"ngModelChange","ngModel"],[1,"mb-2","text-xs","opacity-50"],[1,"mb-3","block",3,"valueChange","value"],["data-testid","ma-add-submit",1,"rounded","bg-emerald-700","px-4","py-1","text-sm","hover:bg-emerald-600",3,"click"],["rows","3","placeholder","code (NEM ker\xFCl a vektorba)","data-testid","ma-add-code",1,"mb-2","w-full","rounded","border","border-neutral-700","bg-neutral-950","p-2","text-sm",3,"ngModelChange","ngModel"],["rows","6","placeholder","t\xF6bb blokk\u2026","data-testid","ma-bulk-text",1,"mb-2","w-full","rounded","border","border-neutral-700","bg-neutral-950","p-2","text-sm",3,"ngModelChange","ngModel"],["placeholder","k\xF6z\xF6s kind",1,"w-40","rounded","border","border-neutral-700","bg-neutral-950","p-2","text-sm",3,"ngModelChange","ngModel"],["placeholder","k\xF6z\xF6s tags (vessz\u0151vel)",1,"flex-1","rounded","border","border-neutral-700","bg-neutral-950","p-2","text-sm",3,"ngModelChange","ngModel"],["data-testid","ma-bulk-submit",1,"rounded","bg-emerald-700","px-4","py-1","text-sm","hover:bg-emerald-600",3,"click"],["placeholder","path (folder / project)","data-testid","ma-scan-path",1,"mb-2","w-full","rounded","border","border-neutral-700","bg-neutral-950","p-2","text-sm",3,"ngModelChange","ngModel"],["placeholder","include (glob, vessz\u0151vel)",1,"flex-1","rounded","border","border-neutral-700","bg-neutral-950","p-2","text-sm",3,"ngModelChange","ngModel"],["placeholder","exclude (glob, vessz\u0151vel)",1,"flex-1","rounded","border","border-neutral-700","bg-neutral-950","p-2","text-sm",3,"ngModelChange","ngModel"],[1,"mb-2","flex","items-center","gap-2","text-sm"],["type","checkbox","data-testid","ma-scan-dryrun",3,"ngModelChange","ngModel"],["data-testid","ma-scan-submit",1,"rounded","bg-emerald-700","px-4","py-1","text-sm","hover:bg-emerald-600",3,"click"],["data-testid","ma-detail-list",1,"flex","flex-col","gap-2"],["data-testid","ma-detail-grouped",1,"flex","flex-col","gap-4"],["data-testid","ma-detail-pagination",1,"mt-4","flex","items-center","justify-between","text-sm"],[1,"opacity-60"],[1,"flex","gap-2"],["data-testid","ma-detail-prev",1,"rounded","border","border-neutral-700","px-3","py-1","hover:bg-neutral-800",3,"click"],["data-testid","ma-detail-next",1,"rounded","border","border-neutral-700","px-3","py-1","hover:bg-neutral-800",3,"click"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"py-6","text-center","opacity-50"],[1,"rounded","border","border-neutral-800"],[1,"flex","items-center","justify-between","border-b","border-neutral-800","bg-neutral-900","px-3","py-2","text-sm"],[1,"font-medium"],[1,"rounded","px-2","py-1","text-xs","text-red-400","hover:bg-neutral-800",3,"click"],[1,"flex","flex-col","gap-2","p-2"],[1,"rounded","border","border-neutral-800","bg-neutral-900","p-3","text-sm"],[1,"flex","items-start","justify-between","gap-3"],[1,"flex-1"],[1,"line-clamp-2","opacity-90"],[1,"mt-1","flex","flex-wrap","items-center","gap-1","text-xs","opacity-60"],[1,"rounded","bg-neutral-800","px-1.5","py-0.5"],[1,"rounded","bg-blue-900","px-1.5","py-0.5"],[1,"rounded","bg-purple-900","px-1.5","py-0.5","hover:bg-purple-800"],[1,"mt-1","text-xs","opacity-40"],[1,"rounded","bg-purple-900","px-1.5","py-0.5","hover:bg-purple-800",3,"click"]],template:function(i,t){if(i&1){let r=k();a(0,"div",1),A(1,"ma-banner-host",2),a(2,"div",3)(3,"div")(4,"a",4),s(5,"\u2190 Maintenance"),o(),a(6,"h1",5),s(7),o()(),a(8,"div",6)(9,"button",7),u("click",function(){return m(r),_(t.addFormOpen_$.set(!t.addFormOpen_$()))}),s(10,"Add entry"),o(),a(11,"button",8),u("click",function(){return m(r),_(t.bulkOpen_$.set(!t.bulkOpen_$()))}),s(12,"Bulk paste"),o(),a(13,"button",9),u("click",function(){return m(r),_(t.scanOpen_$.set(!t.scanOpen_$()))}),s(14,"Run scan"),o(),a(15,"button",10),u("click",function(){return m(r),_(t.reembedTable())}),s(16,"Re-embed"),o()()(),f(17,yn,17,4,"div",11),f(18,Mn,12,6,"div",12),f(19,Sn,10,4,"div",13),f(20,kn,13,5,"div",14),a(21,"div",15)(22,"input",16),w("ngModelChange",function(F){return m(r),v(t.tagFilter,F)||(t.tagFilter=F),_(F)}),o(),a(23,"input",17),w("ngModelChange",function(F){return m(r),v(t.kindFilter,F)||(t.kindFilter=F),_(F)}),o(),a(24,"input",18),w("ngModelChange",function(F){return m(r),v(t.textFilter,F)||(t.textFilter=F),_(F)}),o(),a(25,"input",19),w("ngModelChange",function(F){return m(r),v(t.ingestRunFilter,F)||(t.ingestRunFilter=F),_(F)}),o(),a(26,"label",20)(27,"input",21),w("ngModelChange",function(F){return m(r),v(t.groupByRun,F)||(t.groupByRun=F),_(F)}),o(),s(28," group by run"),o(),a(29,"button",22),u("click",function(){return m(r),_(t.applyFilters())}),s(30,"Apply"),o()(),f(31,Tn,2,0,"div",23)(32,Ln,10,4),o(),ge(33,Rn,17,11,"ng-template",null,0,xe)}if(i&2){let r;l(4),S("routerLink",V(12,bn)),l(3),I(t.tableLabel),l(10),x((r=t.stats_$())?17:-1,r),l(),x(t.addFormOpen_$()?18:-1),l(),x(t.bulkOpen_$()?19:-1),l(),x(t.scanOpen_$()?20:-1),l(2),y("ngModel",t.tagFilter),l(),y("ngModel",t.kindFilter),l(),y("ngModel",t.textFilter),l(),y("ngModel",t.ingestRunFilter),l(2),y("ngModel",t.groupByRun),l(4),x(t.loading_$()?31:32)}},dependencies:[D,be,H,Q,ye,q,K,L,O,X,je,ae],encapsulation:2})}return n})();var de=(function(n){return n.maintenance="maintenance",n.search="search",n.scopes="scopes",n.ingest="ingest",n.settings="settings",n.errors="errors",n})(de||{});var jn=[{path:"",component:Be},{path:de.search,component:We},{path:de.scopes,component:Re},{path:de.ingest,component:Ne},{path:de.settings,component:ze},{path:":table",component:Ke}];var He=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=ue({type:n});static \u0275inj=_e({imports:[L.forChild(jn),L]})}return n})();var Vo=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=ue({type:n});static \u0275inj=_e({imports:[D,He]})}return n})();export{Vo as Maintenance_Module};