@appaflytech/zeyrek-ai-mcp 0.0.77 → 0.0.78

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.
@@ -68,9 +68,10 @@ const guideRouting = {
68
68
  page: 'sayfa/flow işleri; prop\'u veri kaynağına bağlama (connectData, Kural 1c-3); flex düzen prop grubu ve boyut modları (Kural 1f-2)',
69
69
  layout: 'yerleşim kabuğu: tek slot, views, dar ekranda yığılma, widthType fill/fixed/auto',
70
70
  mobile: "mobil UYGULAMA (type:'mobile'): kurulum sırası (mobile_app_create), flex-only yerleşim, tipli stil, sekmeler (properties.mobile.tabs) ve çekmece, sayfa mount/focus olayları, MOB-* bulguları, page_screenshot device",
71
- 'mobile-steps': "mobil uygulamada cihaza dokunan akış adımları (redirect, alert, confirm, download, storage, setcookie, share, haptic, location, notification-*, permission, open-settings, back, ad-show, scan-code, biometric-auth, sign-in-with, purchase, restore-purchases, balance-spend): mobildeki davranış, args sözleşmesi, Steps.<adım> sonucu; bildirim, izin, reklam, biyometri, Apple / Google ile giriş (istemci yarısı), satın alma (Entitlements/Products, teklif ekranı), kredi harcama (Balances, balance-spend) ve konum tarifleri; cihaz bileşenleri (code-scanner, audio-recorder, rich-text-editor: izin, yük, önizleme ve page_screenshot emit); FLOW-029/030/045/046/047, MOB-024/026/027/034/035/036",
71
+ 'mobile-steps': "mobil uygulamada cihaza dokunan akış adımları (redirect, alert, confirm, download, storage, setcookie, share, haptic, location, notification-*, permission, open-settings, back, ad-show, scan-code, biometric-auth, sign-in-with, purchase, restore-purchases, balance-spend, local-backup, local-restore): mobildeki davranış, args sözleşmesi, Steps.<adım> sonucu; bildirim, izin, reklam, biyometri, Apple / Google ile giriş (istemci yarısı), satın alma (Entitlements/Products, teklif ekranı), kredi harcama (Balances, balance-spend) ve konum tarifleri; cihaz bileşenleri (code-scanner, audio-recorder, rich-text-editor: izin, yük, önizleme ve page_screenshot emit); FLOW-029/030/045/046/047, MOB-024/026/027/034/035/036",
72
72
  'mobile-publish': "mobil uygulamanın mağaza yayını: altı adımlı yolculuk, mobile_store_* / mobile_build_* akışı, ön kontrol P-01…P-23 (push kimlikleri, izinler, reklam, kod tarama, App Review, satın alma kabuğu), yayın hedefleri (yalnız dryRun), uygulama içi satın alma (mobile_product_* / mobile_purchase_*: ürün — abonelik, tek seferlik, tüketilen kredi/jeton → hazırlık → faturalandırmalı derleme → gönder; elle kalanlar), iki tür güncelleme, derleme hata kodları, insanın Studio'da yaptıkları (test kullanıcıları dahil)",
73
73
  'mobile-connect-data': "mobil uygulamada veri bağlamanın telefon farkı: alt sayfa / ↗ tam ekran seçim (lookup.mobileMode, mobileRow), sonsuz kaydırma (behavior.mobile), datatable kartı (mobileCard), gruplu liste grouping, autocomplete araması, bağsız listede liste sonu (repeater endReached / hasMore / isLoadingMore), CD-004/019/020",
74
+ 'mobile-local': "yerel uygulama (properties.mobile.dataLocation: 'device'): veri yalnız cihazda, yalnız table servisi cihazda koşar; ne zaman seçilir, ifade kümesi, hesaplama code adımında, yalnız eklemeli şema, kapalı yetenekler, yedek (local-backup / local-restore adımları); MOB-049…056 (local_service_unsupported, local_parameter_source, local_server_capability, local_schema_change)",
74
75
  'mobile-layout': 'mobil ekranın mizanpajı — tek dil: güvenli alan, tek kaydırıcı, 16 dp kenar, gap ritmi, saydam/yüzeyli grup, genişlik, yarıçap/yazı ölçeği; MOB-015…021 reçeteleri ve layoutReport hiza ölçümü',
75
76
  component: 'komponent modeli, olay sözleşmeleri, appearance boyut sözlüğü (widthString/heightString)',
76
77
  html: 'hazır komponent yetmediğinde tek seferlik kaçış kapısı (Mustache, fireEvent, script kuralları)',
@@ -2,7 +2,8 @@ import { z } from 'zod';
2
2
  import { applyPolicyMode, enforcePolicy } from '../knowledge/policy.js';
3
3
  import { readProjectLanguages } from '../knowledge/languages.js';
4
4
  import { logStep } from '../observability/trace.js';
5
- import { addedHooks, addedWords, comparedWordsIn, displayTextsIn, textHooksIn } from '../knowledge/textHooks.js';
5
+ import { listAll } from '../platform/ifExists.js';
6
+ import { addedHooks, addedWords, comparedWordsIn, displayTextsIn, enumOptionValuesIn, textHooksIn } from '../knowledge/textHooks.js';
6
7
  /**
7
8
  * Sayfa / layout / widget yazan araçların kaçış girdisi. Ad bilerek akış araçlarınınkiyle aynı: PolicyBlockError
8
9
  * "aynı çağrıyı policyOverride: true ile tekrarlayın" der ve o alan bu araçlarda da var olmalı (S-12 dersi).
@@ -18,6 +19,7 @@ const dictionaryCache = new Map();
18
19
  /** Testler birbirinin önbelleğini görmesin diye. */
19
20
  export function clearTextHookDictionaryCache() {
20
21
  dictionaryCache.clear();
22
+ enumValueCache.clear();
21
23
  }
22
24
  async function defaultLanguageTexts(platform, project, environment, applicationId) {
23
25
  const key = `${platform.resolveProject(project)}|${environment ?? ''}|${applicationId.toLowerCase()}`;
@@ -45,6 +47,35 @@ async function defaultLanguageTexts(platform, project, environment, applicationI
45
47
  dictionaryCache.set(key, { at: Date.now(), ttl, values });
46
48
  return values;
47
49
  }
50
+ const enumValueCache = new Map();
51
+ /**
52
+ * Projedeki bütün entity alanlarının enum seçenek değerleri: datasource listesi + datasource başına entity listesi
53
+ * (EntityDto alanları ve `valueOptions`'ı taşır; entity başına GET yok). Yalnız bulgu çıkacakken okunur. Okunamazsa
54
+ * boş döner — kapı eski davranışında kalır (kanca durur), kısa süre sonra yeniden denenir.
55
+ */
56
+ async function entityEnumValues(scope, refresh) {
57
+ const key = `${scope.platform.resolveProject(scope.project)}|${scope.environment ?? ''}`;
58
+ const cached = enumValueCache.get(key);
59
+ if (!refresh && cached && Date.now() - cached.at < cached.ttl)
60
+ return { values: cached.values, fromCache: true };
61
+ const values = new Set();
62
+ let ttl = DICTIONARY_TTL_MS;
63
+ try {
64
+ for (const datasource of await listAll(scope.platform, scope.project, scope.environment, '/datasources')) {
65
+ enumOptionValuesIn(await listAll(scope.platform, scope.project, scope.environment, `/entities/${String(datasource.id)}`), values);
66
+ }
67
+ }
68
+ catch (error) {
69
+ values.clear();
70
+ ttl = FAILED_DICTIONARY_TTL_MS;
71
+ logStep('metin kancası', `enum seçenek değerleri okunamadı (${key}) — kancalar enum değeri sayılmadan denetlendi`, [error instanceof Error ? error.message : String(error)]);
72
+ }
73
+ enumValueCache.set(key, { at: Date.now(), ttl, values });
74
+ return { values, fromCache: false };
75
+ }
76
+ // Görünen alanı okuyan karşılaştırma (`title === …`) ve etiket seçicisi ekrandaki yazıya bakar: metin bir enum
77
+ // değeriyle aynı olsa da kancadır. Kayıttaki değeri taşıyabilen iki tür enum değeriyle eşleşince veridir.
78
+ const comparesData = (hook) => hook.kind === 'literal' || hook.kind === 'color-map';
48
79
  function listed(hooks) {
49
80
  const shown = hooks.slice(0, LISTED).map(hook => `'${hook.text}' ← ${hook.excerpt}`).join(' · ');
50
81
  return hooks.length > LISTED ? `${shown} · ve ${hooks.length - LISTED} tane daha` : shown;
@@ -54,6 +85,8 @@ const RIGHT_WAY = "Kararı yazıya değil değişmeyen bir değere bağlayın: k
54
85
  * TR-005: görünen metne bağlı mantık — bu yazımla gelen `block`, kayıtta duran `warn` (karar D1, kullanıcı 2026-10-16).
55
86
  * TR-006: biçimden ayırt edilemeyen tek kelime / ASCII boşluklu metin sözlükte (varsayılan dil) ya da sayfa yazısında
56
87
  * geçiyorsa — tek kelime `warn` (karar D2), boşluklu metin kesin sayılıp TR-005 olur.
88
+ * Karşılaştırılan metin projedeki bir entity alanının enum seçenek değeriyse (`valueOptions[].value`) kanca değildir:
89
+ * kayıtlı veridir (g-02 S-2). Hangi alanın okunduğu ifadeden çıkarılamaz — eşleşme proje genelindeki değer kümesiyledir.
57
90
  */
58
91
  export async function textHookFindings(scope) {
59
92
  const afterHooks = textHooksIn(scope.after);
@@ -75,12 +108,20 @@ export async function textHookFindings(scope) {
75
108
  const dictionary = needsTexts ? await defaultLanguageTexts(scope.platform, scope.project, scope.environment, scope.applicationId) : new Map();
76
109
  const knownAs = (text) => dictionary.has(text) ? `sözlükte ${dictionary.get(text)}` : pageTexts.has(text) ? 'sayfadaki yazı' : undefined;
77
110
  const isHook = (hook) => hook.certain || knownAs(hook.text) !== undefined;
78
- const newHooks = added.filter(isHook);
79
- const oldHooks = kept.filter(isHook);
80
- const wordHits = words.flatMap(word => {
81
- const known = knownAs(word);
82
- return known ? [`'${word}' (${known})`] : [];
83
- });
111
+ const suspectHooks = added.filter(isHook);
112
+ const suspectOldHooks = kept.filter(isHook);
113
+ const suspectWords = words.filter(word => knownAs(word) !== undefined);
114
+ if (suspectHooks.length === 0 && suspectOldHooks.length === 0 && suspectWords.length === 0)
115
+ return [];
116
+ let enumValues = await entityEnumValues(scope, false);
117
+ const blocksWrite = () => suspectHooks.some(hook => comparesData(hook) && !enumValues.values.has(hook.text));
118
+ // Önbellekteki küme bu oturumda yeni eklenen seçeneği bilmeyebilir: isteği durdurmadan önce bir kez tazelenir.
119
+ if (enumValues.fromCache && blocksWrite())
120
+ enumValues = await entityEnumValues(scope, true);
121
+ const isData = (hook) => comparesData(hook) && enumValues.values.has(hook.text);
122
+ const newHooks = suspectHooks.filter(hook => !isData(hook));
123
+ const oldHooks = suspectOldHooks.filter(hook => !isData(hook));
124
+ const wordHits = suspectWords.filter(word => !enumValues.values.has(word)).map(word => `'${word}' (${knownAs(word)})`);
84
125
  const findings = [];
85
126
  if (newHooks.length > 0) {
86
127
  findings.push({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appaflytech/zeyrek-ai-mcp",
3
- "version": "0.0.77",
3
+ "version": "0.0.78",
4
4
  "type": "module",
5
5
  "description": "Zeyrek (NgApps) platform APIs as MCP tools — data, logic and Studio design surface in one gateway",
6
6
  "license": "UNLICENSED",
@@ -41,6 +41,7 @@
41
41
  "kabul:import-adres": "tsx scripts/import-kabul-adres.ts",
42
42
  "kabul:import-senaryolar": "tsx scripts/import-kabul-senaryolar.ts",
43
43
  "kabul:workflow-hata-zinciri": "tsx scripts/kabul-workflow-hata-zinciri.ts",
44
+ "fixtures:local-parity": "tsx scripts/local-parity-fixtures.ts",
44
45
  "benchmark:report": "tsx scripts/benchmark-report.ts"
45
46
  },
46
47
  "dependencies": {