@appaflytech/zeyrek-ai-mcp 0.0.41 → 0.0.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/knowledge/componentCatalog.js +27 -97
- package/dist/knowledge/componentEvents.js +1 -18
- package/dist/knowledge/mobileComponentCatalog.js +114 -15
- package/dist/knowledge/mobileComponentEvents.js +41 -0
- package/dist/knowledge/motionResolve.js +252 -0
- package/dist/knowledge/normalize.js +87 -59
- package/dist/knowledge/pageDiscover.js +2 -2
- package/dist/knowledge/platform/batchOps.js +70 -0
- package/dist/knowledge/platform/heroTag.js +153 -0
- package/dist/knowledge/platform/lint.js +128 -6
- package/dist/knowledge/platform/mobile.js +1 -1
- package/dist/knowledge/platform/mobileLayoutLint.js +8 -1
- package/dist/knowledge/platform/mobileRules.js +18 -0
- package/dist/knowledge/platform/pageTransition.js +57 -0
- package/dist/knowledge/platform/web.js +1 -1
- package/dist/knowledge/rules.js +52 -1
- package/dist/knowledge/styleResolveNative.js +88 -4
- package/dist/platform/capture/actions.js +4 -1
- package/dist/platform/capture/capture.js +10 -13
- package/dist/platform/capture/persistent-browser.js +130 -0
- package/dist/resources/examples/flow-list-to-form.json +8 -10
- package/dist/resources/examples/flow-load-table.json +1 -1
- package/dist/resources/examples/mobile-list-detail-form.json +4 -3
- package/dist/resources/examples/mobile-scan-code.json +285 -0
- package/dist/resources/guides/component.md +3 -3
- package/dist/resources/guides/expressions.md +2 -2
- package/dist/resources/guides/merge.md +98 -18
- package/dist/resources/guides/microservice.md +2 -2
- package/dist/resources/guides/mobile-layout.md +2 -1
- package/dist/resources/guides/mobile-publish.md +1 -0
- package/dist/resources/guides/mobile-steps.md +67 -0
- package/dist/resources/guides/mobile.md +27 -55
- package/dist/resources/guides/page.md +182 -121
- package/dist/resources/guides/translation.md +26 -0
- package/dist/resources/schema-fingerprint.json +2 -2
- package/dist/resources/schemas/ResolveMergeConflictsCommand.json +30 -1
- package/dist/tools/activities.js +3 -1
- package/dist/tools/applications.js +16 -2
- package/dist/tools/components.js +12 -6
- package/dist/tools/designSchemaPatch.js +18 -13
- package/dist/tools/layouts.js +7 -2
- package/dist/tools/merges.js +29 -9
- package/dist/tools/pages.js +129 -127
- package/dist/tools/platformInfo.js +3 -2
- package/dist/tools/profileWrite.js +2 -2
- package/dist/tools/schemaOps.js +132 -34
- package/dist/tools/screenWrite.js +1 -1
- package/dist/tools/screens.js +3 -3
- package/package.json +2 -2
package/dist/tools/schemaOps.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { isFlexContainer, schemaOpValidationErrors, FLEX_LAYOUT_PROP_NAMES, PAGE_CONTAINER_ELEMENT_ID, COMPONENT_BODY_RULE } from '../knowledge/normalize.js';
|
|
1
|
+
import { isFlexContainer, schemaOpValidationErrors, FLEX_LAYOUT_PROP_NAMES, PAGE_CONTAINER_ELEMENT_ID, COMPONENT_BODY_RULE, RETIRED_TYPE_RULE } from '../knowledge/normalize.js';
|
|
2
|
+
import { retiredComponent } from '../knowledge/componentCatalog.js';
|
|
2
3
|
import { findNode, outlineAppliedPatch } from './screens.js';
|
|
3
4
|
import { setPropTypeErrors } from '../knowledge/propTypes.js';
|
|
4
5
|
import { connectDataOpIssues } from '../knowledge/connectDataDefinition.js';
|
|
@@ -26,13 +27,18 @@ export function outlineWriteResponse(response) {
|
|
|
26
27
|
if (Array.isArray(container.appliedPatch))
|
|
27
28
|
container.appliedPatch = outlineAppliedPatch(container.appliedPatch);
|
|
28
29
|
}
|
|
29
|
-
export const opsParam = jsonArray(z.array(z.record(z.unknown()))).describe("Micro-op listesi. Op sözlüğü: replace_prop {target, prop, value} (value ham değer, code sarmalı {type: 'code', ref: '{{ … }}'} ya da translation sarmalı {type: 'translation', ref: '<çeviri anahtarı>'} — prop tipini değiştirmek için komponenti silip yeniden EKLEMEYİN, ona yazan setter'ların hedefi silinir (FLOW-018); platform replace_prop'ta expression alanını OKUMAZ — gateway onu code sarmalına çevirir) | set_binding {target, prop, expression: '{{ Page.variables.x }}'} | add_component {parent (üst elementId ya da 'root'), index?, component: {elementId, name (= elementId), type, props, blocks: [{breakpoint: 1024, size: {w,h}, position: {x,y}}]}} (blocks ZORUNLU, gateway doldurmaz — blocks'suz ya da null blocks'lu düğüm istek gitmeden PAGE-037 ile reddedilir, platform onu kayıtta 500 NullReferenceException ile düşürürdü; flex kapta position yalnız sıradır; ifadede name okunur, elementId değil) | remove_component {target} | move_component {target, parent, index?, position: {x, y}} (index ÇİZİM sırası değildir, runtime çocukları blocks.position'a göre (y, sonra x) çizer. page_schema_patch'te flex kapta gateway index'i görünen sıraya çevirir ve kardeş konumlarını yeniden yazar; ızgara kapta sırayı position.y verir, sona eklemeyen index PAGE-033 uyarısıdır. layout_schema_patch ve component_schema_patch bu çeviriyi YAPMAZ: orada sırayı position.y ile verin) | set_event {target, event, eventValue, replaceBoundFlows?} (olayın BÜTÜN bağlarını bu tek akışa indirir; olayda başka akış bağlıysa gateway PAGE-034 ile reddeder — bilerek değiştirmek için replaceBoundFlows: true) | add_event {target, event, eventValue} (olaya bir akış DAHA bağlar; bağlı akışların hepsi paralel ve birbirinden bağımsız koşar, sıra garantisi yoktur — sıra gerekiyorsa flow-trigger. Aynı akışı ikinci kez bağlamak etkisizdir (unchanged; tekrar güvenli). Mobil runtime yalnız İLK akışı koşar) | remove_event {target, event, eventValue?} (olayı diziden çıkarır; target: 'page' sayfa düzeyi olaylar. Olaya birden fazla akış bağlıysa eventValue ile hangisi olduğunu verin, yoksa 422 ambiguous-event. set_event ile eventValue: null olay SİLMEZ, değersiz ölü kayıt bırakır. Olmayan olay 422 missing-event) | set_validations {target, validations: [{type, message, value, isActive}]} (komponentin validation listesini TAMAMEN değiştirir; boş dizi hepsini siler) | set_appearance {target, appearance: {heightType?, widthType?, tooltip?, background?, …}} (kurulu düğümün appearance'ına YALNIZ verilen alanları yazar, gerisini korur; null alanı temizler; bilinmeyen alan unknown-appearance-field ile reddedilir. GÖRÜNÜRLÜK appearance'ta DEĞİLDİR: gizlemek için replace_prop {target, prop: 'isHidden', value: true}, koşul için set_binding {prop: 'isHidden'} — add_component gövdesindeki appearance.isHidden'ı gateway props.isHidden'a taşır) | resize_component {target, size?: {w,h}, appearance?: {widthType,widthString,heightType,heightString}, states?: {isWrapper,isScrollable,isSticky,isDroppable,isFloating,isQuickStack}, breakpoint?: 1024} (gateway adı: platforma set_block {target, breakpoint, size} + set_appearance {target, appearance} + set_states {target, states} olarak gider — o üç op'u doğrudan da gönderebilirsiniz. move_component'e konan size reddedilir. Izgarada blocks[].size, flex'te appearance geçerlidir, blocks yine zorunlu; ebeveynin düzeni yazılanı etkisiz kılıyorsa PAGE-019 uyarısı çıkar. states bir PROP DEĞİL düğüm alanıdır ve replace_prop onu yazamaz — düğümü silmeden isWrapper bayrağını değiştirmenin yolu budur). set_prop_type {target, prop, propType: 'static'|'code'|'translation', ref?, data?} (replace_prop sarmalıyla aynı sonucu verir ve mevcut data'yı tasarım yedeği olarak taşır. Bu op prop'un TİPİNİ yerinde değiştirir. Taşıyıcı alan tipe göre: static → data, code ve translation → ref (runtime data'yı her turda ezer, anahtar yalnız ref'te yaşar). Eksik taşıyıcı istek gönderilmeden reddedilir; page_schema_validate aynı kararı verir) | reorder {parent ('root' ya da elementId), order: [çocuk elementId'lerinin TAMAMI, yeni sırada]} (yalnız DİZİ sırasını değiştirir; çizim sırası blocks.position'dır — görünen sırayı değiştirmek için konumları set_block/move_component ile de yazın) | set_state_binding {target, binding: {name, expression, targets}} (ada göre ekler/değiştirir) | remove_state_binding {target, name} | set_connect_data {target, path, ref, data?} (prop'u veri kaynağına BAĞLAR: değer { type: 'connectData', ref: <tanım>, data: <son satırlar> } olur; path düz prop 'rows', nesne içi 'config.series' ya da dizi öğesi 'series.1.data'; data verilmezse bağlı prop'un satırları korunur, bağlı olmayan prop'un statik satırları (iç içe sarmallar açılarak) son satır olarak taşınır — D-11; tanım şekli ve alt küme kuralları istek gitmeden denetlenir — PAGE-035 · CD-004; platform_guide('page') §Kural 1c-3) | remove_connect_data {target, path} (bağlantıyı kaldırır, değer static olur; son satırlar static öğelere sarılarak korunur) — bağlı prop'a replace_prop ile connectData sarmalı, set_binding ya da set_prop_type yazılmaz; replace_prop { value: [ham satırlar] } yalnız örnek satırları değiştirir (CD-005) | batch {gestureId?, label?, ops: [...]} (iç içe batch yok). target = elementId. İstek atomiktir: tek op reddedilirse hiçbiri yazılmaz.");
|
|
30
|
+
export const opsParam = jsonArray(z.array(z.record(z.unknown()))).describe("Micro-op listesi. Op sözlüğü: replace_prop {target, prop, value} (value ham değer, code sarmalı {type: 'code', ref: '{{ … }}'} ya da translation sarmalı {type: 'translation', ref: '<çeviri anahtarı>'} — prop tipini değiştirmek için komponenti silip yeniden EKLEMEYİN, ona yazan setter'ların hedefi silinir (FLOW-018); platform replace_prop'ta expression alanını OKUMAZ — gateway onu code sarmalına çevirir) | set_binding {target, prop, expression: '{{ Page.variables.x }}'} | add_component {parent (üst elementId ya da 'root'), index?, component: {elementId, name (= elementId), type, props, blocks: [{breakpoint: 1024, size: {w,h}, position: {x,y}}]}} (blocks ZORUNLU, gateway doldurmaz — blocks'suz ya da null blocks'lu düğüm istek gitmeden PAGE-037 ile reddedilir, platform onu kayıtta 500 NullReferenceException ile düşürürdü; katalogdan kaldırılan tip (component_list'te retired: true — ör. table) istek gitmeden PAGE-051 ile reddedilir, replacedBy tipini kullanın; flex kapta position yalnız sıradır; ifadede name okunur, elementId değil) | remove_component {target} | move_component {target, parent, index?, position: {x, y}} (index ÇİZİM sırası değildir, runtime çocukları blocks.position'a göre (y, sonra x) çizer. page_schema_patch'te flex kapta gateway index'i görünen sıraya çevirir ve kardeş konumlarını yeniden yazar; ızgara kapta sırayı position.y verir, sona eklemeyen index PAGE-033 uyarısıdır. layout_schema_patch ve component_schema_patch bu çeviriyi YAPMAZ: orada sırayı position.y ile verin) | set_event {target, event, eventValue, replaceBoundFlows?} (olayın BÜTÜN bağlarını bu tek akışa indirir; olayda başka akış bağlıysa gateway PAGE-034 ile reddeder — bilerek değiştirmek için replaceBoundFlows: true) | add_event {target, event, eventValue} (olaya bir akış DAHA bağlar; bağlı akışların hepsi paralel ve birbirinden bağımsız koşar, sıra garantisi yoktur — sıra gerekiyorsa flow-trigger. Aynı akışı ikinci kez bağlamak etkisizdir (unchanged; tekrar güvenli). Mobil runtime yalnız İLK akışı koşar) | remove_event {target, event, eventValue?} (olayı diziden çıkarır; target: 'page' sayfa düzeyi olaylar. Olaya birden fazla akış bağlıysa eventValue ile hangisi olduğunu verin, yoksa 422 ambiguous-event. set_event ile eventValue: null olay SİLMEZ, değersiz ölü kayıt bırakır. Olmayan olay 422 missing-event) | set_validations {target, validations: [{type, message, value, isActive}]} (komponentin validation listesini TAMAMEN değiştirir; boş dizi hepsini siler) | set_appearance {target, appearance: {heightType?, widthType?, tooltip?, background?, …}} (kurulu düğümün appearance'ına YALNIZ verilen alanları yazar, gerisini korur; null alanı temizler; bilinmeyen alan unknown-appearance-field ile reddedilir. GÖRÜNÜRLÜK appearance'ta DEĞİLDİR: gizlemek için replace_prop {target, prop: 'isHidden', value: true}, koşul için set_binding {prop: 'isHidden'} — add_component gövdesindeki appearance.isHidden'ı gateway props.isHidden'a taşır) | resize_component {target, size?: {w,h}, appearance?: {widthType,widthString,heightType,heightString}, states?: {isWrapper,isScrollable,isSticky,isDroppable,isFloating,isQuickStack}, breakpoint?: 1024} (gateway adı: platforma set_block {target, breakpoint, size} + set_appearance {target, appearance} + set_states {target, states} olarak gider — o üç op'u doğrudan da gönderebilirsiniz. move_component'e konan size reddedilir. Izgarada blocks[].size, flex'te appearance geçerlidir, blocks yine zorunlu; ebeveynin düzeni yazılanı etkisiz kılıyorsa PAGE-019 uyarısı çıkar. states bir PROP DEĞİL düğüm alanıdır ve replace_prop onu yazamaz — düğümü silmeden isWrapper bayrağını değiştirmenin yolu budur). set_prop_type {target, prop, propType: 'static'|'code'|'translation', ref?, data?} (replace_prop sarmalıyla aynı sonucu verir ve mevcut data'yı tasarım yedeği olarak taşır. Bu op prop'un TİPİNİ yerinde değiştirir. Taşıyıcı alan tipe göre: static → data, code ve translation → ref (runtime data'yı her turda ezer, anahtar yalnız ref'te yaşar). Eksik taşıyıcı istek gönderilmeden reddedilir; page_schema_validate aynı kararı verir) | reorder {parent ('root' ya da elementId), order: [çocuk elementId'lerinin TAMAMI, yeni sırada]} (yalnız DİZİ sırasını değiştirir; çizim sırası blocks.position'dır — görünen sırayı değiştirmek için konumları set_block/move_component ile de yazın) | set_state_binding {target, binding: {name, expression, targets}} (ada göre ekler/değiştirir) | remove_state_binding {target, name} | set_connect_data {target, path, ref, data?} (prop'u veri kaynağına BAĞLAR: değer { type: 'connectData', ref: <tanım>, data: <son satırlar> } olur; path düz prop 'rows', nesne içi 'config.series' ya da dizi öğesi 'series.1.data'; data verilmezse bağlı prop'un satırları korunur, bağlı olmayan prop'un statik satırları (iç içe sarmallar açılarak) son satır olarak taşınır — D-11; tanım şekli ve alt küme kuralları istek gitmeden denetlenir — PAGE-035 · CD-004; platform_guide('page') §Kural 1c-3) | remove_connect_data {target, path} (bağlantıyı kaldırır, değer static olur; son satırlar static öğelere sarılarak korunur) — bağlı prop'a replace_prop ile connectData sarmalı, set_binding ya da set_prop_type yazılmaz; replace_prop { value: [ham satırlar] } yalnız örnek satırları değiştirir (CD-005) | batch {gestureId?, label?, ops: [...]} (yalnız gruplamadır: gateway zarfı açar, içindeki op'lar tek tek yazılmış gibi denetlenip düz listeyle gider — PAGE-048; iç içe batch yok). target = elementId. Op'lar yazıldıkları SIRAYLA uygulanır (resize_component / set_prop_type / remove_event dahil — PAGE-050): aynı yamada eklenen düğüm SONRAKİ op'un hedefi olabilir; bir olayın bağını değiştirirken önce remove_event, sonra add_event yazın. İstek atomiktir: tek op reddedilirse hiçbiri yazılmaz.");
|
|
30
31
|
/**
|
|
31
32
|
* PAGE-008 — `set_event` uydurma bir olay adıyla 200 döner ve bağ SESSİZCE ölü kalır: motor olayı
|
|
32
33
|
* komponentin yaydığı adla eşleştirir, eşleşme yoksa akış hiç çalışmaz. Kontrol yalnız hedefin
|
|
33
34
|
* tipini ve o tipin katalogdaki olay listesini pozitif olarak çözebildiğinde konuşur (okunan ağaçta
|
|
34
35
|
* olmayan hedefler — sayfa yamasında layout düğümleri — ve katalogda olay tanımlamayan tipler
|
|
35
36
|
* doğrulanmadan geçer).
|
|
37
|
+
*
|
|
38
|
+
* Emekli tipte KAYITLI düğümde liste yerine geçen bileşenden okunur (`RETIRED_COMPONENTS`): kayıt
|
|
39
|
+
* defteri `table`'ı eski olaylarıyla tutar ama runtime o düğümü `datatable` ile çizer. Kayıtlı
|
|
40
|
+
* tipten okununca denetim tersine dönüyordu — yayılan `rowDoubleClick` reddediliyor, hiç yayılmayan
|
|
41
|
+
* `doubleClick` geçip ölü bağ yazılıyordu (inceleme 2026-10-13).
|
|
36
42
|
*/
|
|
37
43
|
export function unknownEventOps(ops, typesByElementId, eventsBySlug) {
|
|
38
44
|
return ops
|
|
@@ -42,10 +48,11 @@ export function unknownEventOps(ops, typesByElementId, eventsBySlug) {
|
|
|
42
48
|
const target = String(op.target ?? '');
|
|
43
49
|
const event = String(op.event ?? '');
|
|
44
50
|
const type = typesByElementId.get(target);
|
|
45
|
-
const
|
|
51
|
+
const drawnAs = retiredComponent(type)?.replacedBy ?? type;
|
|
52
|
+
const declared = drawnAs ? eventsBySlug.get(drawnAs) : undefined;
|
|
46
53
|
if (!event || !declared || declared.includes(event))
|
|
47
54
|
return [];
|
|
48
|
-
return [`'${target}' (${type}) komponenti '${event}' diye bir olay YAYMAZ. Yaydıkları: ${declared.join(', ')}. Platform bu op'u 200 ile kabul eder ama bağ sessizce ölü kalır — akış hiçbir zaman çalışmaz. Doğru adı component_get(slug:'${type}') çıktısındaki events listesinden alın.`];
|
|
55
|
+
return [`'${target}' (${drawnAs === type ? type : `${type} — emekli tip, runtime ${drawnAs} ile çizer`}) komponenti '${event}' diye bir olay YAYMAZ. Yaydıkları: ${declared.join(', ')}. Platform bu op'u 200 ile kabul eder ama bağ sessizce ölü kalır — akış hiçbir zaman çalışmaz. Doğru adı component_get(slug:'${type}') çıktısındaki events listesinden alın.`];
|
|
49
56
|
});
|
|
50
57
|
}
|
|
51
58
|
/**
|
|
@@ -54,14 +61,15 @@ export function unknownEventOps(ops, typesByElementId, eventsBySlug) {
|
|
|
54
61
|
* toplanır ve tek yanıtta döner. Yama yine ATOMİKTİR — birbirine bağlı op'lar (add_component +
|
|
55
62
|
* set_event) yarım kalmasın diye geçenler de gönderilmez.
|
|
56
63
|
*/
|
|
57
|
-
export function rejectedOpsMessage(unordered) {
|
|
64
|
+
export function rejectedOpsMessage(unordered, indexHint = '') {
|
|
58
65
|
const rejected = [...unordered].sort((left, right) => left.index - right.index);
|
|
59
66
|
const lines = rejected.map(entry => `#${entry.index} ${entry.op}${entry.target ? ` '${entry.target}'` : ''} [${entry.code}]: ${entry.message}`);
|
|
60
67
|
const validationHint = rejected.some(entry => entry.code === 'PAGE-016')
|
|
61
68
|
? " PAGE-016 çalışan biçimi dört alanı da taşır: { type: 'required'|'email'|'regex'|'max-length'|'min-length'|'max-value'|'min-value'|'value-options', message: '<kullanıcıya görünen metin>', value: <eşik/desen/true>, isActive: true }."
|
|
62
69
|
: '';
|
|
63
70
|
const bodyHint = rejected.some(entry => entry.code === 'PAGE-037') ? ` PAGE-037 ${COMPONENT_BODY_RULE}` : '';
|
|
64
|
-
|
|
71
|
+
const retiredHint = rejected.some(entry => entry.code === 'PAGE-051') ? ` PAGE-051 ${RETIRED_TYPE_RULE}` : '';
|
|
72
|
+
return `Ön kontrol ${rejected.length} op'u reddetti; yama atomik olduğu için HİÇBİR op gönderilmedi (istek gönderilmedi). Düşen op'ları düzeltip TÜM listeyi tek çağrıda yeniden gönderin.${indexHint}${validationHint}${bodyHint}${retiredHint}\n${lines.join('\n')}\nrejectedOps: ${JSON.stringify(rejected)}`;
|
|
65
73
|
}
|
|
66
74
|
export function collectTypes(nodes, into) {
|
|
67
75
|
for (const node of nodes ?? []) {
|
|
@@ -70,29 +78,6 @@ export function collectTypes(nodes, into) {
|
|
|
70
78
|
collectTypes(node.children, into);
|
|
71
79
|
}
|
|
72
80
|
}
|
|
73
|
-
/**
|
|
74
|
-
* TB-129 — `replace_prop` yalnız elementId taşır; stil anahtarı çevirisinin komponent TİPİNE
|
|
75
|
-
* bakabilmesi için hedeflerin tipi okunan ağaçtan çıkarılır. Harita YALNIZ `style` prop'u yazan
|
|
76
|
-
* bir op varsa kurulur: başka türlü fazladan bir okuma maliyeti doğardı.
|
|
77
|
-
*/
|
|
78
|
-
export function styleTargetTypesFrom(ops, nodes) {
|
|
79
|
-
if (!ops.some(entry => entry.op === 'replace_prop' && String(entry.prop ?? '') === 'style'))
|
|
80
|
-
return undefined;
|
|
81
|
-
const types = new Map();
|
|
82
|
-
collectTypes(nodes, types);
|
|
83
|
-
return types;
|
|
84
|
-
}
|
|
85
|
-
/** Aynı harita, ağacı tembel okuyan yazma yolu için; okuma düşerse çeviri eski davranışa döner. */
|
|
86
|
-
export async function styleTargetTypes(ops, readHost) {
|
|
87
|
-
if (!ops.some(entry => entry.op === 'replace_prop' && String(entry.prop ?? '') === 'style'))
|
|
88
|
-
return undefined;
|
|
89
|
-
try {
|
|
90
|
-
return styleTargetTypesFrom(ops, (await readHost()).schema);
|
|
91
|
-
}
|
|
92
|
-
catch {
|
|
93
|
-
return undefined;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
81
|
export function removeNodeFromTree(nodes, target, parent) {
|
|
97
82
|
for (let index = 0; index < nodes.length; index++) {
|
|
98
83
|
if (nodes[index].elementId === target)
|
|
@@ -210,9 +195,11 @@ export function resizeServerOps(op) {
|
|
|
210
195
|
* Sunucu hedefi ve bloğu kendisi doğrular; burada okunan sayfadan yapılan kontrol ajana bağlamı
|
|
211
196
|
* olan bir mesaj ve PAGE-019/020 uyarıları içindir. `size` yalnız verilen kenarı taşır: eksik
|
|
212
197
|
* kenar okunan bloktan tamamlanır, yoksa sunucu 0 yazardı.
|
|
198
|
+
* `groups` op başına çevrilmiş sunucu op'larıdır (girdiyle aynı sırada): `serverOpsInOrder` her birini kendi yerine koyar.
|
|
199
|
+
* Uyarı metni yazıldığını İDDİA ETMEZ ("yazılır", "yazılıyor"): aynı plan kuru koşuda da koşar (PAGE-049, TOOL-060).
|
|
213
200
|
*/
|
|
214
201
|
export function planResizes(schema, ops, readTool = 'page_schema_get') {
|
|
215
|
-
const
|
|
202
|
+
const groups = [];
|
|
216
203
|
const applied = [];
|
|
217
204
|
const warnings = [];
|
|
218
205
|
for (const op of ops) {
|
|
@@ -249,13 +236,13 @@ export function planResizes(schema, ops, readTool = 'page_schema_get') {
|
|
|
249
236
|
resolved = { ...op, size: merged };
|
|
250
237
|
applied.push(`${target}.size=${JSON.stringify(merged)}`);
|
|
251
238
|
if (inFlex) {
|
|
252
|
-
warnings.push(`PAGE-019 (uyarı): '${target}' düğümünün ebeveyni flex kapsayıcı; orada yerleşimi 'blocks[].size' DEĞİL appearance (widthType/widthString/heightType/heightString) belirler. Boyut
|
|
239
|
+
warnings.push(`PAGE-019 (uyarı): '${target}' düğümünün ebeveyni flex kapsayıcı; orada yerleşimi 'blocks[].size' DEĞİL appearance (widthType/widthString/heightType/heightString) belirler. Boyut yazılır ama ekranda etkisi olmayabilir — flex'te ölçü vermek için aynı op'a 'appearance' koyun.`);
|
|
253
240
|
}
|
|
254
241
|
}
|
|
255
242
|
if (states) {
|
|
256
243
|
applied.push(`${target}.states=${JSON.stringify(states)}`);
|
|
257
244
|
if (states.isWrapper === true) {
|
|
258
|
-
warnings.push(`PAGE-020 (uyarı): '${target}' düğümüne isWrapper:true
|
|
245
|
+
warnings.push(`PAGE-020 (uyarı): '${target}' düğümüne isWrapper:true yazılıyor — runtime sarmalayıcı düğüme 'min-height: 80vh' veriyor ve bu, sayfanın altına yüzlerce piksel ölü boşluk ekleyebilir (ölçüldü 09-05: dokuz düğüm ~1600px). style ile ezilemez; gerekmiyorsa isWrapper:false bırakın.`);
|
|
259
246
|
}
|
|
260
247
|
}
|
|
261
248
|
if (appearance) {
|
|
@@ -264,9 +251,120 @@ export function planResizes(schema, ops, readTool = 'page_schema_get') {
|
|
|
264
251
|
warnings.push(`PAGE-019 (uyarı): '${target}' düğümünün ebeveyni flex DEĞİL; ızgarada yerleşimi 'blocks[].size' belirler ve appearance genişlik/yükseklik alanları etkisiz kalabilir. Izgarada ölçü vermek için aynı op'a 'size' koyun.`);
|
|
265
252
|
}
|
|
266
253
|
}
|
|
267
|
-
|
|
254
|
+
groups.push(resizeServerOps(resolved));
|
|
255
|
+
}
|
|
256
|
+
return { serverOps: groups.flat(), groups, applied, warnings };
|
|
257
|
+
}
|
|
258
|
+
/** Gateway'in listeden ayırıp kendisi çevirdiği / planladığı op'lar. */
|
|
259
|
+
const EMULATED_OPS = new Set(['resize_component', 'set_prop_type', 'remove_event']);
|
|
260
|
+
/**
|
|
261
|
+
* Yamanın ÇAĞIRANIN SIRASI: `allOps` (ajanın yazdığı liste) ile `records`'u (öykünülen op'lar ayrıldıktan sonra kalan,
|
|
262
|
+
* gateway'in yerinde onardığı liste) tek sıraya dizer. `records` `allOps`'ta olmayan op taşıyabilir — kutu bölümü
|
|
263
|
+
* anahtarı (BX-002, `expandSectionToggles`) eklediklerini tetikleyen op'un hemen arkasına yerleştirir; onlar
|
|
264
|
+
* tetikleyenle birlikte kalır. Eşleme nesne kimliğiyledir, sayarak değil: sayarken eklenen op hizayı kaydırıyor ve
|
|
265
|
+
* `[replace_prop, set_prop_type]` yine ters gidiyordu (inceleme 2026-10-10).
|
|
266
|
+
*/
|
|
267
|
+
export function callerSlots(allOps, records) {
|
|
268
|
+
const written = new Set(allOps);
|
|
269
|
+
const slots = [];
|
|
270
|
+
let cursor = 0;
|
|
271
|
+
for (const op of allOps) {
|
|
272
|
+
if (EMULATED_OPS.has(String(op.op))) {
|
|
273
|
+
slots.push({ emulated: op });
|
|
274
|
+
continue;
|
|
275
|
+
}
|
|
276
|
+
const at = records.indexOf(op, cursor);
|
|
277
|
+
if (at < 0)
|
|
278
|
+
continue;
|
|
279
|
+
let end = at + 1;
|
|
280
|
+
while (end < records.length && !written.has(records[end]))
|
|
281
|
+
end += 1;
|
|
282
|
+
for (let index = cursor; index < end; index += 1)
|
|
283
|
+
slots.push({ record: index });
|
|
284
|
+
cursor = end;
|
|
285
|
+
}
|
|
286
|
+
for (let index = cursor; index < records.length; index += 1)
|
|
287
|
+
slots.push({ record: index });
|
|
288
|
+
return slots;
|
|
289
|
+
}
|
|
290
|
+
/** `records` + `remove_event`'ler, çağıranın sırasıyla: akış silme planı (G-21) yamayı uygulanacağı sırayla benzetir. */
|
|
291
|
+
export function recordsWithEventRemovals(slots, records) {
|
|
292
|
+
return slots.flatMap(slot => {
|
|
293
|
+
if ('record' in slot)
|
|
294
|
+
return records.slice(slot.record, slot.record + 1);
|
|
295
|
+
return slot.emulated.op === 'remove_event' ? [slot.emulated] : [];
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
/**
|
|
299
|
+
* Platforma giden liste, ÇAĞIRANIN SIRASIYLA: gateway'in öykündüğü op (`resize_component`, `set_prop_type`) kendi
|
|
300
|
+
* yerinde çevrilmiş hâliyle, `remove_event` olduğu gibi durur; flex sıra çevirisinin eklediği taşımalar
|
|
301
|
+
* (`flexIndexOrder` `trailing`) sona gelir. Platform op'ları sırayla uygular (`PageSchemaMicroOpApplier.Apply`).
|
|
302
|
+
* 2026-10-10'a dek öykünülen op'lar listenin BAŞINA alınıyordu (ayrı istekle önceden yazıldıkları günden kalma):
|
|
303
|
+
* `[replace_prop, set_prop_type]` ters gidiyor, son yazan statik değer oluyor ve bağ sessizce kayboluyordu —
|
|
304
|
+
* yanıt yine `propTypes: static → code` diyordu (inceleme, `test/page-dry-run-parity.test.ts`).
|
|
305
|
+
*
|
|
306
|
+
* `sent`, `records`'un giden hâlidir ve onunla aynı sıradadır (`orderByIndex` kopyalasa da sırayı korur, eklediklerini
|
|
307
|
+
* sona yazar).
|
|
308
|
+
*/
|
|
309
|
+
export function serverOpsInOrder(slots, parts) {
|
|
310
|
+
let records = 0;
|
|
311
|
+
let resized = 0;
|
|
312
|
+
let propTypes = 0;
|
|
313
|
+
const ordered = slots.flatMap(slot => {
|
|
314
|
+
if ('record' in slot) {
|
|
315
|
+
records += 1;
|
|
316
|
+
return parts.sent.slice(slot.record, slot.record + 1);
|
|
317
|
+
}
|
|
318
|
+
if (slot.emulated.op === 'resize_component')
|
|
319
|
+
return parts.resized[resized++] ?? [];
|
|
320
|
+
if (slot.emulated.op === 'set_prop_type')
|
|
321
|
+
return parts.propTypes.slice(propTypes, ++propTypes);
|
|
322
|
+
return [slot.emulated];
|
|
323
|
+
});
|
|
324
|
+
return [...ordered, ...parts.sent.slice(records)];
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* Öykünülen op'ların planı, ağacın O ANDAKİ hâline göre: yama sırayla benzetilir (ekleme, silme, taşıma, düzen prop'u,
|
|
328
|
+
* önceki `resize_component`'in yazdığı boyut) ve her `resize_component` / `set_prop_type` kendi sırasındaki ağaçta
|
|
329
|
+
* çözülür. Yalnız kayıtlı ağaca bakılırken `[add_component yeni, set_prop_type yeni]` "hedef bulunamadı" ile düşüyor,
|
|
330
|
+
* silinip yeniden eklenen düğümün eksik kenarı ESKİ düğümden tamamlanıyor, ardışık iki `resize_component`'in ikincisi
|
|
331
|
+
* birincinin yazdığı kenarı eziyordu. Öykünülen op yoksa ağaç kopyalanmaz.
|
|
332
|
+
*/
|
|
333
|
+
export function planEmulatedOps(schema, slots, records, readTool = 'page_schema_get') {
|
|
334
|
+
const resized = { groups: [], applied: [], warnings: [] };
|
|
335
|
+
const propTypes = { serverOps: [], applied: [] };
|
|
336
|
+
if (!slots.some(slot => 'emulated' in slot && slot.emulated.op !== 'remove_event'))
|
|
337
|
+
return { resized, propTypes };
|
|
338
|
+
const tree = structuredClone(schema);
|
|
339
|
+
for (const slot of slots) {
|
|
340
|
+
if ('record' in slot) {
|
|
341
|
+
const record = records[slot.record];
|
|
342
|
+
if (record?.op === 'remove_component')
|
|
343
|
+
removeNodeFromTree(tree, String(record.target ?? ''));
|
|
344
|
+
else if (record)
|
|
345
|
+
simulateLayoutOps(tree, [record]);
|
|
346
|
+
continue;
|
|
347
|
+
}
|
|
348
|
+
if (slot.emulated.op === 'resize_component') {
|
|
349
|
+
const plan = planResizes(tree, [slot.emulated], readTool);
|
|
350
|
+
const group = plan.groups[0] ?? [];
|
|
351
|
+
resized.groups.push(group);
|
|
352
|
+
resized.applied.push(...plan.applied);
|
|
353
|
+
resized.warnings.push(...plan.warnings);
|
|
354
|
+
for (const written of group.filter(entry => entry.op === 'set_block')) {
|
|
355
|
+
const blocks = findNode(tree, String(written.target))?.blocks;
|
|
356
|
+
const block = blocks?.find(entry => Number(entry?.breakpoint) === Number(written.breakpoint));
|
|
357
|
+
if (block)
|
|
358
|
+
block.size = written.size;
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
if (slot.emulated.op === 'set_prop_type') {
|
|
362
|
+
const plan = planPropTypes(tree, [slot.emulated], readTool);
|
|
363
|
+
propTypes.serverOps.push(...plan.serverOps);
|
|
364
|
+
propTypes.applied.push(...plan.applied);
|
|
365
|
+
}
|
|
268
366
|
}
|
|
269
|
-
return {
|
|
367
|
+
return { resized, propTypes };
|
|
270
368
|
}
|
|
271
369
|
/**
|
|
272
370
|
* `set_prop_type` (P0-2) 2026-09-14'ten beri platformun op'u; taşıyıcı kuralı
|
|
@@ -64,7 +64,7 @@ export function assertScreenWriteGuards(kind, screen, platform) {
|
|
|
64
64
|
throw new PlatformApiError(`Geçersiz widget düğümü (istek gönderilmedi): ${badWidgets.join(' · ')}`, 400);
|
|
65
65
|
assertComponentNames(kind, screen.schema);
|
|
66
66
|
assertComponentBlocks(screen.schema);
|
|
67
|
-
const nested = nestedRepeaterNodes(screen.schema);
|
|
67
|
+
const nested = nestedRepeaterNodes(screen.schema, platform);
|
|
68
68
|
if (nested.length > 0)
|
|
69
69
|
throw new PlatformApiError(nestedRepeaterMessage(nested, platform), 400);
|
|
70
70
|
}
|
package/dist/tools/screens.js
CHANGED
|
@@ -7,7 +7,7 @@ import { z } from 'zod';
|
|
|
7
7
|
export const hostParam = z.enum(['page', 'layout', 'component'])
|
|
8
8
|
.describe("Akışın barındırıcısı: page | layout | component (widget de component'tir)");
|
|
9
9
|
export const schemaParam = jsonArray(z.array(z.record(z.unknown())))
|
|
10
|
-
.describe("Komponent ağacı (DesignComponentManagementSchema listesi): her düğümde elementId, name (= elementId), type, blocks zorunlu — blocks: [{ breakpoint: 1024, size: { w, h }, position: { x, y } }], gateway doldurmaz (PAGE-037). Verilmezse mevcut şema korunur");
|
|
10
|
+
.describe("Komponent ağacı (DesignComponentManagementSchema listesi): her düğümde elementId, name (= elementId), type, blocks zorunlu — blocks: [{ breakpoint: 1024, size: { w, h }, position: { x, y } }], gateway doldurmaz (PAGE-037). Oluşturmada katalogdan kaldırılan tipte düğüm (component_list'te retired: true) PAGE-051 ile reddedilir. Verilmezse mevcut şema korunur");
|
|
11
11
|
export const eventsParam = jsonArray(z.array(z.record(z.unknown())))
|
|
12
12
|
.describe("Sayfa/layout düzeyi olaylar: [{ name, value }] — value bir flow id'sidir");
|
|
13
13
|
export const modeParam = z.enum(['summary', 'subtree', 'full']).optional().describe("summary (varsayılan): yalnız id/elementId/name/type ağacı — hedef bulmak için bunu kullanın. subtree: componentId ile tek alt ağaç. full: tüm şema.");
|
|
@@ -138,8 +138,8 @@ export function summarize(node, styleSource, nativeTheme) {
|
|
|
138
138
|
};
|
|
139
139
|
// Mobil uygulama: stil CSS değil React Native nesnesidir (`shell` kutu, `text` metin).
|
|
140
140
|
if (nativeTheme !== undefined) {
|
|
141
|
-
const { shell, text, warnings } = nodeNativeStyle(node, nativeTheme, styleSource ?? undefined);
|
|
142
|
-
summary.nativeStyle = { shell, text, ...(warnings.length > 0 ? { warnings } : {}) };
|
|
141
|
+
const { shell, text, motion, bound, warnings } = nodeNativeStyle(node, nativeTheme, styleSource ?? undefined);
|
|
142
|
+
summary.nativeStyle = { shell, text, ...(motion ? { motion } : {}), ...(bound ? { bound } : {}), ...(warnings.length > 0 ? { warnings } : {}) };
|
|
143
143
|
}
|
|
144
144
|
else if (styleSource !== undefined) {
|
|
145
145
|
const report = resolveNodeStyleReport(node, styleSource ?? undefined);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@appaflytech/zeyrek-ai-mcp",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.43",
|
|
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",
|
|
@@ -60,4 +60,4 @@
|
|
|
60
60
|
"typescript": "^5.7.2",
|
|
61
61
|
"vitest": "^3.0.0"
|
|
62
62
|
}
|
|
63
|
-
}
|
|
63
|
+
}
|