@appaflytech/zeyrek-ai-mcp 0.0.70 → 0.0.72
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 +19 -0
- package/dist/knowledge/componentEvents.js +6 -0
- package/dist/knowledge/coverage.js +193 -0
- package/dist/knowledge/normalize.js +41 -0
- package/dist/knowledge/rules.js +16 -0
- package/dist/platform/capture/capture.js +5 -0
- package/dist/resources/guides/deployment.md +6 -5
- package/dist/resources/guides/microservice.md +36 -0
- package/dist/resources/schema-fingerprint.json +2 -2
- package/dist/resources/schemas/CreateMicroserviceCommand.json +3 -0
- package/dist/resources/schemas/MicroserviceDto.json +3 -0
- package/dist/resources/schemas/UpdateMicroserviceCommand.json +3 -0
- package/dist/tools/deployments.js +1 -1
- package/dist/tools/designSchemaPatch.js +2 -2
- package/dist/tools/files.js +1 -1
- package/dist/tools/flows.js +35 -1
- package/dist/tools/microservices.js +69 -3
- package/dist/tools/pages.js +20 -5
- package/dist/tools/projects.js +46 -3
- package/package.json +1 -1
|
@@ -2124,6 +2124,25 @@ export const componentKnowledge = {
|
|
|
2124
2124
|
},
|
|
2125
2125
|
guide: 'translation'
|
|
2126
2126
|
},
|
|
2127
|
+
captcha: {
|
|
2128
|
+
summary: 'Formun gönderilmeden önce güvenlik doğrulamasından (Turnstile / reCAPTCHA / hCaptcha) geçmesini ister; kodu platform sunucuda sağlayıcıya sorar (ADR 0035).',
|
|
2129
|
+
behavior: [
|
|
2130
|
+
'Sağlayıcı ve anahtarlar bileşende DEĞİL proje ayarındadır (Studio › proje ayarları › Captcha; gizli anahtarı insan girer, MCP bu ayarı YAZAMAZ). Ayar var mı ve hangi sağlayıcı: project_get yanıtındaki captcha bloğu ({ configured, provider }). Ayar yoksa kutu yerine "Captcha ayarlı değil" çizilir ve form gönderilemez; ayarsız projede captcha eklemek CAPTCHA-003 uyarısı alır.',
|
|
2131
|
+
'Form içindeki captcha HER ZAMAN zorunludur (kilitli kural, panelde kapatılamaz): çözülmeden submit yayılmaz. Bileşenin validations bildirimi yoktur.',
|
|
2132
|
+
"Gizli captcha da zorunludur: form gizli alanları doğrulamadan çıkarır ama kilitli kuralı olanı çıkarmaz — isHidden: true (ya da koşulla gizlenen) captcha'yı kullanıcı çözemez ve form hiç gönderilmez. Captcha'yı görünür bırak; isHidden yazımı CAPTCHA-004 uyarısı alır.",
|
|
2133
|
+
"Form başına BİR captcha: formdaki her captcha zorunludur, servis ise tek kodu (X-Captcha-Token) doğrular ve akış yalnız bağlı olanı yeniler. İkinci captcha CAPTCHA-005 uyarısı alır.",
|
|
2134
|
+
"Sunucu kapısı servistedir: servisi requiresCaptcha: true yap ve servis adımının 'X-Captcha-Token' parametresini source: 'header' ile YALNIZ bu bileşenin value'suna bağla (value type:'property'; source'suz parametre başlıkta gitmez; ifade bağı kabul edilmez — kutu yenilenmez). Bağın hedefi sayfadaki bir captcha düğümü olmalı; captcha olmayan ya da sayfada olmayan düğüm FLOW-049 alır. Akışların zaten çağırdığı servisi sonradan işaretlemek MS-029 ile kodsuz çağıran akışları listeler. İşaretli servis kodsuz/geçersiz isteği akışa sokmadan reddeder: CaptchaRequiredException / CaptchaInvalidException (422), CaptchaNotConfiguredException (422), CaptchaUnavailableException (503).",
|
|
2135
|
+
'Kod tek kullanımlıktır: servis adımı istek döndükten sonra (başarılı ya da hatalı) bağlı captcha’nın value’sunu boşaltır, kutu kendini yeniler. Akıştan value’yu boşaltmak da kutuyu sıfırlar.',
|
|
2136
|
+
"mode: 'invisible' yalnız Turnstile'da çalışır; sağlayıcı görünmezi yürütemiyorsa ya da projede görünmez anahtarı yoksa kutucuk çizilir.",
|
|
2137
|
+
'Yerel kurulumda (test kipi) sağlayıcının "hep geçer" test anahtarları kullanılır; gerçek captcha gerçek alan adında görünür. Tasarım kanvasında script yüklenmez, yer tutucu çizilir.'
|
|
2138
|
+
],
|
|
2139
|
+
propNotes: {
|
|
2140
|
+
value: "Runtime yazar: '<görünüm>:<kod>' (ör. 'checkbox:...'); panelde çizilmez, elle yazılmaz — page_schema_patch dolu değeri CAPTCHA-001 ile reddeder (boşaltma '' serbest).",
|
|
2141
|
+
rejection: "Runtime yazar: servis isteği captcha yüzünden reddedilince (Captcha*Exception) akış hata kodunu yazar ve kutunun altında dile göre ileti çıkar; sonraki başarılı istek boşaltır. Başlığa bağlı captcha yoksa ret sayfadaki bütün captcha'lara yazılır. Elle yazılmaz.",
|
|
2142
|
+
mode: "'checkbox' (varsayılan) ya da 'invisible' (yalnız Turnstile).",
|
|
2143
|
+
size: "'normal' ya da 'compact'."
|
|
2144
|
+
}
|
|
2145
|
+
},
|
|
2127
2146
|
otpinput: {
|
|
2128
2147
|
summary: 'Tek haneli kutulardan oluşan tek kullanımlık kod girişi (2–12 hane); yapıştırma kutulara dağılır.',
|
|
2129
2148
|
behavior: [
|
|
@@ -546,6 +546,12 @@ export const componentEventContracts = {
|
|
|
546
546
|
reads: "event.data.reason — kapatma düğmesi 'user', zaman aşımı 'timeout'. Bandı yeniden açmak akışın işidir: props.isHidden false yazılmadıkça kapalı kalır. 2026-09-17'den önce bu emit toggled adıyla yayılıyordu ve şemada bildirilmediği için akışa BAĞLANAMIYORDU"
|
|
547
547
|
}
|
|
548
548
|
},
|
|
549
|
+
captcha: {
|
|
550
|
+
mount: NO_DATA,
|
|
551
|
+
change: valueChange("string ('<görünüm>:<kod>'; süre dolunca ve kod gönderilince '')"),
|
|
552
|
+
expire: NO_DATA,
|
|
553
|
+
error: NO_DATA
|
|
554
|
+
},
|
|
549
555
|
otpinput: {
|
|
550
556
|
mount: NO_DATA,
|
|
551
557
|
change: valueChange('string (birleşik kod)'),
|
|
@@ -4,6 +4,199 @@ function asObjects(value) {
|
|
|
4
4
|
const FORM_TYPES = new Set(['form']);
|
|
5
5
|
const WRITE_METHODS = new Set(['post', 'put', 'patch']);
|
|
6
6
|
const SIGN_IN_PATTERN = /giri[sş]|login|sign-?in|oturum/i;
|
|
7
|
+
const CAPTCHA_TYPE = 'captcha';
|
|
8
|
+
const CAPTCHA_TOKEN = 'X-Captcha-Token';
|
|
9
|
+
const VALUE_WRITING_OPS = new Set(['replace_prop', 'set_binding', 'set_prop_type', 'set_connect_data']);
|
|
10
|
+
function nodeTypes(nodes, into = new Map()) {
|
|
11
|
+
for (const node of asObjects(nodes)) {
|
|
12
|
+
if (typeof node.elementId === 'string')
|
|
13
|
+
into.set(node.elementId, String(node.type ?? ''));
|
|
14
|
+
nodeTypes(node.children, into);
|
|
15
|
+
}
|
|
16
|
+
return into;
|
|
17
|
+
}
|
|
18
|
+
function isEmptyValue(value) {
|
|
19
|
+
if (value === undefined || value === '')
|
|
20
|
+
return true;
|
|
21
|
+
const wrapper = value;
|
|
22
|
+
return Boolean(wrapper) && typeof wrapper === 'object' && wrapper.type === 'static' && (wrapper.data === '' || wrapper.data === undefined);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* CAPTCHA-001 (2026-11-06 ajan testi Y-1) — captcha'nın `value`'sunu runtime yazar (`<görünüm>:<kod>`). Elle yazılan değer
|
|
26
|
+
* formun "çözülmeden gönderme" kilidini açar: ajan `checkbox:elle-yazilmis-kod` yazınca form captcha çözülmeden gönderildi;
|
|
27
|
+
* `value: null` ile geri alma da gövdede değersiz bir sarmal bıraktı ve kilit geri gelmedi. Yalnız boşaltma (`''`) serbesttir.
|
|
28
|
+
* Hedefin tipi kayıtlı ağaçtan ya da aynı yamada eklenen gövdeden okunur. Döner: kuralı çiğneyen düğümlerin elementId'leri.
|
|
29
|
+
*/
|
|
30
|
+
export function captchaValueWrites(ops, schema) {
|
|
31
|
+
const operations = asObjects(ops);
|
|
32
|
+
const types = nodeTypes(schema);
|
|
33
|
+
const offending = [];
|
|
34
|
+
for (const op of operations.filter(op => op.op === 'add_component')) {
|
|
35
|
+
const component = (op.component ?? {});
|
|
36
|
+
if (typeof component.elementId === 'string')
|
|
37
|
+
types.set(component.elementId, String(component.type ?? ''));
|
|
38
|
+
if (String(component.type ?? '') !== CAPTCHA_TYPE)
|
|
39
|
+
continue;
|
|
40
|
+
if (!isEmptyValue((component.props ?? {}).value))
|
|
41
|
+
offending.push(String(component.elementId ?? '?'));
|
|
42
|
+
}
|
|
43
|
+
for (const op of operations.filter(op => VALUE_WRITING_OPS.has(String(op.op)))) {
|
|
44
|
+
const target = String(op.target ?? '');
|
|
45
|
+
if (types.get(target) !== CAPTCHA_TYPE || (op.prop ?? op.path) !== 'value')
|
|
46
|
+
continue;
|
|
47
|
+
if (op.op === 'replace_prop' && isEmptyValue(op.value))
|
|
48
|
+
continue;
|
|
49
|
+
offending.push(target);
|
|
50
|
+
}
|
|
51
|
+
return [...new Set(offending)];
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* FLOW-049'un bağ denetimi (ADR 0035 K-2, B-14). Kod `X-Captcha-Token` başlığında (`source: 'header'`), sayfadaki captcha
|
|
55
|
+
* düğümünün `value`'sundan (`type: 'property'`) gider. 2026-11-06 2. tur ajan testi: textinput'a ve rehber örneğinin yer
|
|
56
|
+
* tutucusuna (`<captcha düğümü>`) bağlanan token uyarısız geçti, her gönderim 422 aldı, textinput her gönderimden sonra
|
|
57
|
+
* boşaldı (MCP-1); altı farklı yanlış bağ aynı iletiyi aldı (MCP-8). Döner: bağın neden tutmadığı, bağ doğruysa
|
|
58
|
+
* `undefined`. Barındırıcının ağacı boşsa (okunamadı ya da şema kurulmadı) hedefin varlığı ve tipi denetlenmez.
|
|
59
|
+
*/
|
|
60
|
+
export function captchaTokenProblem(parameters, hostNodes) {
|
|
61
|
+
const token = asObjects(parameters).find(parameter => parameter.name === CAPTCHA_TOKEN);
|
|
62
|
+
if (!token)
|
|
63
|
+
return `'${CAPTCHA_TOKEN}' parametresi yok`;
|
|
64
|
+
if (token.source !== 'header')
|
|
65
|
+
return token.source === undefined ? 'parametrede source yok, kod başlıkta gitmez' : `parametre source: '${String(token.source)}', kod başlıkta gitmez`;
|
|
66
|
+
const value = (token.value ?? {});
|
|
67
|
+
if (value.type !== 'property')
|
|
68
|
+
return value.type === undefined ? 'parametrenin bağı yok' : `bağ '${String(value.type)}' tipinde, bileşen bağı (type: 'property') değil: akış kod gönderildikten sonra kutuyu yenileyemez`;
|
|
69
|
+
const ref = (value.ref ?? {});
|
|
70
|
+
const element = typeof ref.element === 'string' ? ref.element : '';
|
|
71
|
+
if (element === '')
|
|
72
|
+
return 'bağda bileşen seçilmemiş (ref.element boş)';
|
|
73
|
+
if (ref.property !== 'value')
|
|
74
|
+
return `bağ '${element}' bileşeninin '${String(ref.property ?? '')}' özelliğine gidiyor, kod value'dadır`;
|
|
75
|
+
const types = nodeTypes(hostNodes);
|
|
76
|
+
if (types.size === 0)
|
|
77
|
+
return undefined;
|
|
78
|
+
const type = types.get(element);
|
|
79
|
+
const captchas = [...types].filter(([, nodeType]) => nodeType === CAPTCHA_TYPE).map(([id]) => id);
|
|
80
|
+
const known = captchas.length > 0 ? `sayfadaki captcha düğümleri: ${captchas.join(', ')}` : 'sayfada captcha düğümü yok';
|
|
81
|
+
if (type === undefined)
|
|
82
|
+
return `'${element}' sayfada yok (${known})`;
|
|
83
|
+
if (type !== CAPTCHA_TYPE)
|
|
84
|
+
return `'${element}' bir captcha değil (${type}); ${known}`;
|
|
85
|
+
return undefined;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* CAPTCHA-003 (2026-11-06 2. tur ajan testi MCP-3) — ayarsız projede captcha ekleme, servis işaretleme ve akış bağlama
|
|
89
|
+
* uyarısız geçiyordu; form hiç gönderilemedi ve son kullanıcı dolduramayacağı bir alan için "zorunlu" iletisi gördü.
|
|
90
|
+
* `cause` neyin captcha istediğini söyler (eklenen captcha, işaretlenen servis, captcha zorunlu servise giden adım).
|
|
91
|
+
*/
|
|
92
|
+
export function captchaNotConfiguredMessage(project, cause) {
|
|
93
|
+
return `CAPTCHA-003: '${project}' projesinde captcha ayarı yok — ${cause}. Sayfada captcha 'Captcha ayarlı değil' diye çizilir, kullanıcı onu çözemez ve form gönderilemez; kodlu çağrı 422 CaptchaNotConfiguredException alır. Ayarı bir insan Studio'da Project › Settings › Captcha'dan kurar (sağlayıcı ve anahtarlar MCP'den yazılmaz); durumu project_get yanıtındaki captcha bloğundan okuyun.`;
|
|
94
|
+
}
|
|
95
|
+
/** Bu yamanın eklediği captcha düğümleri; eklenen gövdenin içindekiler dahil (CAPTCHA-003). */
|
|
96
|
+
export function addedCaptchaIds(ops) {
|
|
97
|
+
return asObjects(ops)
|
|
98
|
+
.filter(op => op.op === 'add_component')
|
|
99
|
+
.flatMap(op => [...nodeTypes([op.component])].filter(([, type]) => type === CAPTCHA_TYPE).map(([elementId]) => elementId));
|
|
100
|
+
}
|
|
101
|
+
export function captchaValueMessage(elementIds) {
|
|
102
|
+
return `CAPTCHA-001 — captcha'nın value'sunu runtime yazar (istek gönderilmedi): ${elementIds.join(' · ')}. Değer sağlayıcının çözülmüş kodudur ('<görünüm>:<kod>'); elle yazılan değer formun "çözülmeden gönderme" kilidini açar ve servis kodu yine reddeder. value'ya yazmayın; daha önce yazılmış bir değeri temizlemek için yalnız replace_prop { prop: 'value', value: '' } kabul edilir.`;
|
|
103
|
+
}
|
|
104
|
+
function captchaForms(nodes, form, into) {
|
|
105
|
+
for (const node of asObjects(nodes)) {
|
|
106
|
+
const type = String(node.type ?? '');
|
|
107
|
+
if (type === CAPTCHA_TYPE && typeof node.elementId === 'string')
|
|
108
|
+
into.set(node.elementId, form);
|
|
109
|
+
captchaForms(node.children, FORM_TYPES.has(type) && typeof node.elementId === 'string' ? node.elementId : form, into);
|
|
110
|
+
}
|
|
111
|
+
return into;
|
|
112
|
+
}
|
|
113
|
+
function touchedElementIds(ops) {
|
|
114
|
+
const touched = new Set();
|
|
115
|
+
for (const op of asObjects(ops)) {
|
|
116
|
+
if (op.op === 'add_component')
|
|
117
|
+
for (const elementId of nodeTypes([op.component]).keys())
|
|
118
|
+
touched.add(elementId);
|
|
119
|
+
if (op.op === 'move_component')
|
|
120
|
+
touched.add(String(op.target ?? ''));
|
|
121
|
+
}
|
|
122
|
+
return touched;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* CAPTCHA-002 (2026-11-06 ajan testi Y-2) — captcha'nın kilidi formdadır: form dışındaki captcha zorunlu değildir, akış onu
|
|
126
|
+
* hiçbir gönderimde beklemez. Yalnız bu yamanın eklediği (eklenen gövdenin içindekiler dahil) ya da taşıdığı captcha'lar, yama
|
|
127
|
+
* uygulanmış ağaçta denetlenir.
|
|
128
|
+
*/
|
|
129
|
+
export function captchaOutsideFormWarnings(simulated, ops) {
|
|
130
|
+
const touched = touchedElementIds(ops);
|
|
131
|
+
return [...captchaForms(simulated, null, new Map()).entries()]
|
|
132
|
+
.filter(([elementId, form]) => touched.has(elementId) && form === null)
|
|
133
|
+
.map(([elementId]) => `CAPTCHA-002: '${elementId}' captcha'sı bir formun içinde değil — kilidi form uygular (çözülmeden submit yayılmaz); form dışındaki captcha hiçbir gönderimi beklemez ve kodu bir servise bağlansa da kullanıcı onu çözmeden gönderebilir. Captcha'yı formun içine taşıyın (move_component { target: '${elementId}', parent: '<form elementId>' }).`);
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* CAPTCHA-005 (2026-11-06 2. tur ajan testi MCP-5) — formdaki her captcha zorunludur: iki captcha'lı formu kullanıcı ikisini de
|
|
137
|
+
* çözmeden gönderemez, servis ise tek kod (`X-Captcha-Token`) doğrular ve akış yalnız bağlı olanı yeniler. Yama uygulanmış
|
|
138
|
+
* ağaçta, bu yamanın eklediği ya da taşıdığı bir captcha'yı tutan form denetlenir.
|
|
139
|
+
*/
|
|
140
|
+
export function captchaPerFormWarnings(simulated, ops) {
|
|
141
|
+
const touched = touchedElementIds(ops);
|
|
142
|
+
const byForm = new Map();
|
|
143
|
+
for (const [elementId, form] of captchaForms(simulated, null, new Map())) {
|
|
144
|
+
if (form !== null)
|
|
145
|
+
byForm.set(form, [...(byForm.get(form) ?? []), elementId]);
|
|
146
|
+
}
|
|
147
|
+
return [...byForm.entries()]
|
|
148
|
+
.filter(([, captchas]) => captchas.length > 1 && captchas.some(elementId => touched.has(elementId)))
|
|
149
|
+
.map(([form, captchas]) => `CAPTCHA-005: '${form}' formunda ${captchas.length} captcha var (${captchas.join(', ')}) — formdaki her captcha zorunludur, kullanıcı hepsini çözmeden gönderemez; servis yalnız tek kodu (X-Captcha-Token) doğrular ve akış yalnız bağlı olanı yeniler. Form başına bir captcha bırakın: remove_component { target: '<fazla captcha>' }.`);
|
|
150
|
+
}
|
|
151
|
+
function hiddenState(value) {
|
|
152
|
+
if (value === true)
|
|
153
|
+
return 'hidden';
|
|
154
|
+
if (!value || typeof value !== 'object')
|
|
155
|
+
return undefined;
|
|
156
|
+
const wrapper = value;
|
|
157
|
+
if (wrapper.type === 'static')
|
|
158
|
+
return wrapper.data === true ? 'hidden' : undefined;
|
|
159
|
+
return 'conditional';
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* CAPTCHA-004 (2026-11-06 2. tur ajan testi MCP-4 · UI-1) — gizli captcha da zorunludur (ADR 0035 kilitli kural; frontend
|
|
163
|
+
* `skipsHiddenValidation`): kullanıcı gizli kutuyu çözemez ve form hiç gönderilmez. Eskiden form gizli captcha'yı denetimden
|
|
164
|
+
* çıkarıyordu, gönderim kodsuz gidip 422 alıyordu ve ekranda ileti yoktu. `isHidden`'a yazan op (sabit `true` → gizli; ifade,
|
|
165
|
+
* bağ ya da tip değişimi → koşullu) ve aynı yamada `isHidden`'ı dolu eklenen captcha yakalanır; hedefin tipi kayıtlı ağaçtan
|
|
166
|
+
* ya da eklenen gövdeden okunur.
|
|
167
|
+
*/
|
|
168
|
+
export function captchaHiddenWarnings(ops, schema) {
|
|
169
|
+
const operations = asObjects(ops);
|
|
170
|
+
const types = nodeTypes(schema);
|
|
171
|
+
const found = new Map();
|
|
172
|
+
for (const op of operations.filter(op => op.op === 'add_component')) {
|
|
173
|
+
for (const node of nodesOf([op.component])) {
|
|
174
|
+
if (typeof node.elementId === 'string')
|
|
175
|
+
types.set(node.elementId, String(node.type ?? ''));
|
|
176
|
+
const state = String(node.type ?? '') === CAPTCHA_TYPE ? hiddenState((node.props ?? {}).isHidden) : undefined;
|
|
177
|
+
if (state && typeof node.elementId === 'string')
|
|
178
|
+
found.set(node.elementId, state);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
for (const op of operations.filter(op => VALUE_WRITING_OPS.has(String(op.op)))) {
|
|
182
|
+
const target = String(op.target ?? '');
|
|
183
|
+
if (types.get(target) !== CAPTCHA_TYPE || (op.prop ?? op.path) !== 'isHidden')
|
|
184
|
+
continue;
|
|
185
|
+
const state = op.op === 'replace_prop' ? hiddenState(op.value) : op.op === 'set_prop_type' && op.propType === 'static' ? undefined : 'conditional';
|
|
186
|
+
if (state)
|
|
187
|
+
found.set(target, state);
|
|
188
|
+
}
|
|
189
|
+
return [...found.entries()].map(([elementId, state]) => state === 'hidden'
|
|
190
|
+
? `CAPTCHA-004: '${elementId}' captcha'sı gizli (isHidden) — gizli captcha da zorunludur: kullanıcı kutuyu göremez, çözemez ve form hiç gönderilmez. Captcha'yı görünür bırakın (replace_prop { target: '${elementId}', prop: 'isHidden', value: false }).`
|
|
191
|
+
: `CAPTCHA-004: '${elementId}' captcha'sının görünürlüğü bir koşula bağlandı — koşul captcha'yı gizlediği sürece form gönderilemez (gizli captcha da zorunludur, kullanıcı onu çözemez). Captcha'yı koşulsuz görünür bırakın; formun bir bölümünü gizlemek gerekiyorsa captcha'yı o bölümün dışına koyun.`);
|
|
192
|
+
}
|
|
193
|
+
function nodesOf(nodes, into = []) {
|
|
194
|
+
for (const node of asObjects(nodes)) {
|
|
195
|
+
into.push(node);
|
|
196
|
+
nodesOf(node.children, into);
|
|
197
|
+
}
|
|
198
|
+
return into;
|
|
199
|
+
}
|
|
7
200
|
/**
|
|
8
201
|
* FORM-001 — `form` komponenti eklendi ama `submit` olayı bağlanmadı: kullanıcı formu doldurur,
|
|
9
202
|
* "Kaydet" hiçbir şey yapmaz. Kontrol plan-yereldir (aynı patch çağrısı); bağlamayı sonraki
|
|
@@ -2552,6 +2552,47 @@ export function staleSetterWarnings(flows, ops, schema) {
|
|
|
2552
2552
|
}
|
|
2553
2553
|
return warnings;
|
|
2554
2554
|
}
|
|
2555
|
+
/**
|
|
2556
|
+
* FLOW-048 (2026-11-06 captcha ajan testi, K-2). `staleSetterWarnings` silinen düğüme YAZAN setter'ı söyler; burası
|
|
2557
|
+
* silinen düğümden OKUYAN adım parametresini (`value.type: 'property'`, `ref.element`). Bağ akışta kalır ve istek o
|
|
2558
|
+
* değeri boş gönderir: captcha silinince `X-Captcha-Token` bağı yerinde durdu, her gönderim 422 aldı ve ne yama, ne
|
|
2559
|
+
* doğrulama, ne akış okuma bir şey söyledi. Silinen kapsayıcının altındaki düğümler de sayılır; aynı yamada aynı
|
|
2560
|
+
* elementId ile yeniden eklenen düğüm sayılmaz.
|
|
2561
|
+
*/
|
|
2562
|
+
export function removedParameterSourceWarnings(flows, ops, schema) {
|
|
2563
|
+
const opList = asObjects(ops);
|
|
2564
|
+
const removed = new Set(opList
|
|
2565
|
+
.filter(op => op.op === 'remove_component')
|
|
2566
|
+
.map(op => String(op.target ?? ''))
|
|
2567
|
+
.filter(target => target.length > 0));
|
|
2568
|
+
if (removed.size === 0)
|
|
2569
|
+
return [];
|
|
2570
|
+
for (const target of [...removed]) {
|
|
2571
|
+
const doomed = findNodeByElementId(asObjects(schema), target);
|
|
2572
|
+
if (doomed)
|
|
2573
|
+
collectElementIds(doomed.children, removed);
|
|
2574
|
+
}
|
|
2575
|
+
const readded = new Set();
|
|
2576
|
+
for (const op of opList.filter(op => op.op === 'add_component'))
|
|
2577
|
+
collectElementIds(op.component, readded);
|
|
2578
|
+
const warnings = [];
|
|
2579
|
+
for (const flow of asObjects(flows)) {
|
|
2580
|
+
const flowName = String(flow.name ?? flow.slug ?? flow.id ?? 'adsız akış');
|
|
2581
|
+
for (const step of [...asObjects(flow.steps), ...asObjects(flow.errorSteps)]) {
|
|
2582
|
+
const stepName = String(step.name ?? step.stepId ?? 'adsız adım');
|
|
2583
|
+
for (const parameter of asObjects((step.args ?? {}).parameters)) {
|
|
2584
|
+
const value = (parameter.value ?? {});
|
|
2585
|
+
const ref = (value.ref ?? {});
|
|
2586
|
+
const element = value.type === 'property' && typeof ref.element === 'string' ? ref.element : '';
|
|
2587
|
+
if (!removed.has(element) || readded.has(element))
|
|
2588
|
+
continue;
|
|
2589
|
+
const name = String(parameter.name ?? '?');
|
|
2590
|
+
warnings.push(`FLOW-048 (uyarı): '${element}' siliniyor ama '${flowName}' akışının '${stepName}' adımı '${name}' parametresini ondan okuyor — bağ akışta kalır ve istek bu değeri BOŞ gönderir${name === 'X-Captcha-Token' ? ' (captcha zorunlu serviste her gönderim 422 CaptchaRequiredException alır)' : ''}. Parametreyi flow_update ile başka bir komponente bağlayın ya da adımı kaldırın.`);
|
|
2591
|
+
}
|
|
2592
|
+
}
|
|
2593
|
+
}
|
|
2594
|
+
return warnings;
|
|
2595
|
+
}
|
|
2555
2596
|
/**
|
|
2556
2597
|
* FLOW-018'in yazma SONRASI ayağı (G-04). Uyarı yamadan önce "kopabilir" der ama sonucu bilemez:
|
|
2557
2598
|
* backend aynı yamada silinip aynı elementId ile eklenen düğüme eski kimliğini geri verir; o düzeltme
|
package/dist/knowledge/rules.js
CHANGED
|
@@ -857,6 +857,22 @@ export const policyRules = [
|
|
|
857
857
|
}];
|
|
858
858
|
}
|
|
859
859
|
},
|
|
860
|
+
{
|
|
861
|
+
id: 'MS-030',
|
|
862
|
+
module: 'microservice',
|
|
863
|
+
appliesTo: ['create', 'update'],
|
|
864
|
+
sourceRef: "ADR 0035 (B-17, 2026-11-05): kuyruğa giren yazma ağ dönünce aynı captcha koduyla yeniden gider; kod tek kullanımlık ve birkaç dakika geçerli olduğu için her denemede reddedilir. Backend aynı birleşimi 422 CaptchaOfflineWritableConflictException ile reddeder; kural isteği göndermeden durdurur",
|
|
865
|
+
check: definition => {
|
|
866
|
+
if (definition.requiresCaptcha !== true || definition.offlineWritable !== true)
|
|
867
|
+
return [];
|
|
868
|
+
return [{
|
|
869
|
+
ruleId: 'MS-030',
|
|
870
|
+
severity: 'block',
|
|
871
|
+
message: "requiresCaptcha ile offlineWritable birlikte olamaz: kuyruğa giren yazma ağ dönünce kullanılmış ya da süresi dolmuş captcha koduyla yeniden gider ve her seferinde reddedilir (backend 422 CaptchaOfflineWritableConflictException). Birini kapatın.",
|
|
872
|
+
guide: 'ngapps://guides/microservice'
|
|
873
|
+
}];
|
|
874
|
+
}
|
|
875
|
+
},
|
|
860
876
|
{
|
|
861
877
|
id: 'QRY-006',
|
|
862
878
|
module: 'query',
|
|
@@ -669,6 +669,11 @@ export class StudioScreenshotter {
|
|
|
669
669
|
}
|
|
670
670
|
await context.addInitScript(`try { localStorage.setItem(${JSON.stringify(VIEWER_MODE_STORAGE_KEY)}, ${JSON.stringify(request.colorScheme)}) } catch (error) { /* localStorage kapalıysa proje varsayılanı çizilir */ }`);
|
|
671
671
|
}
|
|
672
|
+
// Eylemin istek sayacı kaynak zamanlama kayıtlarının farkıdır; tarayıcının tamponu varsayılan 250 kayıtta dolar ve
|
|
673
|
+
// sonrası kaydedilmez. Vite geliştirme sunucusu modül istekleriyle tamponu açılışta doldurur: ölçüldü 2026-11-06,
|
|
674
|
+
// yerel runtime'da istekten önce ve sonra 250 — gönderim servisi çağırdığı hâlde her eylem "0 ağ isteği" diyordu.
|
|
675
|
+
// Tampon sayfanın script'lerinden önce büyütülür; yeteneği olmayan bağlamda sayaç eskisi gibi kalır.
|
|
676
|
+
await context.addInitScript?.('try { performance.setResourceTimingBufferSize(100000) } catch (error) { /* eski tarayıcı: sayaç tamponla sınırlı kalır */ }');
|
|
672
677
|
const page = await context.newPage();
|
|
673
678
|
openPage = page;
|
|
674
679
|
// Konsol ve istisna dinleyicileri navigasyondan ÖNCE takılır: modül yüklenirken patlayan
|
|
@@ -137,11 +137,12 @@ Dosya production'a **aynı id'yle** yazılır. Production'da o id zaten varsa ya
|
|
|
137
137
|
içerik yeniden yüklenmez ve kaynakta değişen içerik production'a geçmez.
|
|
138
138
|
|
|
139
139
|
**Sabit URL tuzağı.** Sayfaya metin olarak yazılmış bir dosya adresi (görselin `src`'sine düz URL,
|
|
140
|
-
html içeriği, stil) deploy'da **
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
140
|
+
html içeriği, stil) deploy'da **değişmez**: `…/d/…` production sayfasında da `…/d/…` kalır ve
|
|
141
|
+
**development dosyasını** gösterir, dosya development'tan silinince kırılır. Dosyanın kendisi de
|
|
142
|
+
kopyalanmaz. Görseli production'a taşımak için onu dosya tipli prop'a (`ref`) ya da taşınan bir
|
|
143
|
+
satırın dosya sütununa bağlayın: adres yanıt anında ortamın önekiyle kurulur (`/d/`, `/p/`, dal).
|
|
144
|
+
Akış adımında seçilen dosya (`zeyrek-file-serve:/…` değeri) adresini ortamdan alır ama dosyayı
|
|
145
|
+
taşımaz: yalnız akıştan bağlı dosya production'da 404 verir.
|
|
145
146
|
|
|
146
147
|
## Dağıtımdan sonra doğrula
|
|
147
148
|
|
|
@@ -419,6 +419,42 @@ onay gibi işlerde ikinci yol tercih edilir çünkü yetkisi yetmeyen satır öt
|
|
|
419
419
|
akış "0 onaylandı · 2 reddedildi" döndürdü). Döngüdeki uç, çağıranın kimliğiyle denetlenir —
|
|
420
420
|
akış içinden yazmak yetki YÜKSELTMEZ.
|
|
421
421
|
|
|
422
|
+
### Captcha zorunlu servis (MS-029, MS-030, FLOW-049, CAPTCHA-003…005)
|
|
423
|
+
|
|
424
|
+
Herkese açık bir formun arkasındaki servisi botlardan korumak için servisi `requiresCaptcha: true` yap. Platform kodu
|
|
425
|
+
sunucuda sağlayıcıya (Turnstile / reCAPTCHA / hCaptcha) sorar; geçmeyen istek akışa ve veritabanı işlemine girmeden
|
|
426
|
+
reddedilir. Kapı servisi çalıştıran her dış yoldadır: `m/`, CSV dışa aktarma, debug, veri bağla (kök ADR 0035).
|
|
427
|
+
|
|
428
|
+
1. **Proje ayarı insanın işidir:** sağlayıcı ve anahtarlar Studio › proje ayarları › Captcha'ya girilir. Ajan gizli
|
|
429
|
+
anahtar yazmaz; MCP ayarı yazamaz, yalnız okur: `project_get` yanıtındaki `captcha` bloğu `{ configured: false }`
|
|
430
|
+
ise ayar yoktur, `{ configured: true, provider }` kurulu sağlayıcıyı söyler. Ayarsız projede captcha eklemek, servisi
|
|
431
|
+
işaretlemek ve captcha zorunlu servise adım bağlamak CAPTCHA-003 uyarısı alır: kutu yerine "Captcha ayarlı değil"
|
|
432
|
+
çizilir ve form gönderilemez. Ayar yoksa kodlu istek `CaptchaNotConfiguredException` (422) döner; kodsuz istek ayara
|
|
433
|
+
bakılmadan `CaptchaRequiredException` alır (sıra aşağıdaki tabloda).
|
|
434
|
+
2. Sayfaya `captcha` bileşenini forma koy (form onu her zaman zorunlu sayar). **Form başına bir captcha** (ikincisi
|
|
435
|
+
CAPTCHA-005) ve **görünür** bırak: gizli captcha da zorunludur, kullanıcı onu çözemez ve form gönderilmez (CAPTCHA-004).
|
|
436
|
+
3. Servis adımında `X-Captcha-Token` başlık parametresini **yalnız** bileşenin `value`'suna bağla:
|
|
437
|
+
`{ name: 'X-Captcha-Token', type: 'text', source: 'header', value: { type: 'property', ref: { element: '<captcha elementId>', property: 'value' } } }`.
|
|
438
|
+
`element` sayfadaki captcha düğümünün elementId'sidir. `source: 'header'` şarttır: kaynağı olmayan ya da başka
|
|
439
|
+
kaynaklı parametre başlıkta gitmez ve her gönderim 422 alır. Bağsız, başlıkta olmayan, ifade bağlı ya da captcha
|
|
440
|
+
olmayan / sayfada olmayan düğüme bağlı adım FLOW-049 uyarısı alır; uyarı hangi koşulun tutmadığını söyler.
|
|
441
|
+
4. **Akışların zaten çağırdığı servisi sonradan işaretlemek** o akışları kodsuz bırakır: `microservice_patch` /
|
|
442
|
+
`microservice_update` bayrağı açarken bağımlı akışları okur ve kodu göndermeyenleri MS-029 ile adıyla listeler.
|
|
443
|
+
Her birine 3. adımdaki bağı kurun.
|
|
444
|
+
|
|
445
|
+
Sunucu sırayla bakar; ilk tutan satır döner:
|
|
446
|
+
|
|
447
|
+
| Durum | Sonuç |
|
|
448
|
+
|---|---|
|
|
449
|
+
| Başlık yok / biçim `<görünüm>:<kod>` değil (projenin ayarı olsa da olmasa da) | 422 `CaptchaRequiredException` |
|
|
450
|
+
| Başlık var ama projede captcha ayarı ya da o görünümün anahtarı yok | 422 `CaptchaNotConfiguredException` |
|
|
451
|
+
| Sağlayıcı kodu geçirmedi (kullanılmış, süresi dolmuş, sahte) — yerel test kipinde her kod geçer, bu satır görülmez | 422 `CaptchaInvalidException` |
|
|
452
|
+
| Sağlayıcıya ulaşılamadı (5 sn) ya da reCAPTCHA kotası doldu | 503 `CaptchaUnavailableException` |
|
|
453
|
+
| `requiresCaptcha` + `offlineWritable` | MS-030 engeller; platform 422 `CaptchaOfflineWritableConflictException` |
|
|
454
|
+
|
|
455
|
+
Kod tek kullanımlıktır: adım istek döndükten sonra captcha'nın değerini boşaltır ve kutu yenilenir. Yerel kurulumda
|
|
456
|
+
test anahtarları çalışır (Turnstile kutusu `XXXX.DUMMY.TOKEN.XXXX` üretir).
|
|
457
|
+
|
|
422
458
|
### Toplu yazmada sahiplik (MS-027)
|
|
423
459
|
|
|
424
460
|
`bulk-update` ve `bulk-delete` ucunun `filters`'ı **kapsamdır**: gövdedeki her kimlik yalnız bu kapsamın içindeyse
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"hash": "
|
|
3
|
-
"generatedAt": "2026-11-
|
|
2
|
+
"hash": "710a1deb21a5d0fb0a8f89dac79dd5938ca6595acf41377e23ff7b59eaa59d4e",
|
|
3
|
+
"generatedAt": "2026-11-06T14:59:01.092Z",
|
|
4
4
|
"types": 377,
|
|
5
5
|
"files": 196,
|
|
6
6
|
"note": "Şemaları üreten backend kaynaklarının parmak izi. Elle düzenlemeyin: 'npm run generate-schemas' yazar, 'npm run schema:check' denetler.",
|
|
@@ -134,7 +134,7 @@ export function registerDeploymentTools(server, platform) {
|
|
|
134
134
|
const config = platform.config;
|
|
135
135
|
server.registerTool('deployment_start', {
|
|
136
136
|
title: 'Deployment başlat',
|
|
137
|
-
description: 'Projeyi kaynak environment\'tan hedef environment\'a deploy eder. Asenkron bir saga\'dır: sonuç bu yanıtta bitmez, deployment_status ile izleyin. Environment id\'lerini project_get çıktısından alın. BPM: süreç tanımları ve iş takvimleri taşınır — hedefte farklı aktif model yeni sürüm olarak yayınlanır (production\'da gelişte aktif), hedefin uyarlaması korunur; uyarlama, örnek, görev ve defter taşınmaz; kaynakta olmayan tanım silinir, açık örneği varsa emekliye ayrılır. KAYNAK YALNIZ DEVELOPMENT\'TIR: dal ya da production kaynak verilirse 400 (CantDeployFromBranchException) — dalı önce development\'a merge edin. ÖN DENETİM: deploy başlamadan production verisi denetlenir; veriyi bozacak ya da silecek her değişiklik 400 (DeploymentDataRiskException) ile listelenir ve deploy BAŞLAMAZ — biçim \'tablo.alan: tür (satır)\', türler not-null | unique | field-removed | table-removed | localization-move. YALNIZ TANIM TAŞINIR: tablo satırları ancak tabloda recordTransferMode (\'all\' | \'specific\' + transferRowIds) açıksa gider, çeviri ve junction satırları ana tabloyla birlikte. Yanıt, kaynakta kayıt taşıması açık tabloları recordTransfer ({ entity, mode, rows, skipExisting }) ve recordTransferNote ile listeler (DEP-010): \'specific\' + transferRowIds tanımda KALICIDIR, sonraki her dağıtımda yeniden gider — tek seferlik veri tarifi: ayarı aç → bir dağıtım → development\'ta kapat; metin düzeltmesinde recordTransferSkipExisting o dağıtım için kapalı olmalı (platform_guide(\'deployment\') §Tek seferlik veri). Kayıt taşıması \'all\' olan tabloda production development\'ın AYNASIDIR (kaynakta olmayan satır ve çevirisi silinir) — tabloda recordTransferSkipExisting açıksa ayna yoktur, production\'da var olan satır güncellenmez, yalnız eksik satır eklenir. DOSYA yalnız id referansıyla gider (file tipli prop { type:\'file\', ref:<fileId> } ya da taşınan satırın dosya sütunu); sayfaya düz yazılan /d/ serve URL\'si
|
|
137
|
+
description: 'Projeyi kaynak environment\'tan hedef environment\'a deploy eder. Asenkron bir saga\'dır: sonuç bu yanıtta bitmez, deployment_status ile izleyin. Environment id\'lerini project_get çıktısından alın. BPM: süreç tanımları ve iş takvimleri taşınır — hedefte farklı aktif model yeni sürüm olarak yayınlanır (production\'da gelişte aktif), hedefin uyarlaması korunur; uyarlama, örnek, görev ve defter taşınmaz; kaynakta olmayan tanım silinir, açık örneği varsa emekliye ayrılır. KAYNAK YALNIZ DEVELOPMENT\'TIR: dal ya da production kaynak verilirse 400 (CantDeployFromBranchException) — dalı önce development\'a merge edin. ÖN DENETİM: deploy başlamadan production verisi denetlenir; veriyi bozacak ya da silecek her değişiklik 400 (DeploymentDataRiskException) ile listelenir ve deploy BAŞLAMAZ — biçim \'tablo.alan: tür (satır)\', türler not-null | unique | field-removed | table-removed | localization-move. YALNIZ TANIM TAŞINIR: tablo satırları ancak tabloda recordTransferMode (\'all\' | \'specific\' + transferRowIds) açıksa gider, çeviri ve junction satırları ana tabloyla birlikte. Yanıt, kaynakta kayıt taşıması açık tabloları recordTransfer ({ entity, mode, rows, skipExisting }) ve recordTransferNote ile listeler (DEP-010): \'specific\' + transferRowIds tanımda KALICIDIR, sonraki her dağıtımda yeniden gider — tek seferlik veri tarifi: ayarı aç → bir dağıtım → development\'ta kapat; metin düzeltmesinde recordTransferSkipExisting o dağıtım için kapalı olmalı (platform_guide(\'deployment\') §Tek seferlik veri). Kayıt taşıması \'all\' olan tabloda production development\'ın AYNASIDIR (kaynakta olmayan satır ve çevirisi silinir) — tabloda recordTransferSkipExisting açıksa ayna yoktur, production\'da var olan satır güncellenmez, yalnız eksik satır eklenir. DOSYA yalnız id referansıyla gider (file tipli prop { type:\'file\', ref:<fileId> } ya da taşınan satırın dosya sütunu); sayfaya düz yazılan /d/ serve URL\'si olduğu gibi kalır ve dosya kopyalanmaz, production sayfası development dosyasını gösterir — platform_guide(\'deployment\'). Microfunction\'ın yalnız YAYINLANMIŞ kodu taşınır ve hedefte yayınlanır; hiç yayınlanmamış olan hedefte taslak kalır. Zamanlanmış işin duraklatma durumu taşınır. YAYINLANMAMIŞ TASLAK TAŞINMAZ: kaynakta taslağı olan süreçler yanıtta unpublishedDrafts ({ slug, name, draftVersionNumber, activeVersionNumber }) ve note ile listelenir; hedefte aktif sürüm kalır. Taşımak için taslağı kaynakta yayınlayın (requireGreenScenarios açıksa önce senaryoları taslak üzerinde koşun), sonra yeniden deploy edin. DELTA (varsayılan): yalnız içerik özeti production\'dakinden farklı tanımlar taşınır, kaynakta olmayan tanım silinir; entity, rol, erişim politikası, bileşen, dosya, süreç tanımı, organizasyon yapısı ve tablo satırları her deploy\'da tam taşınır; klasör silme taşınmaz. Kaynağın ya da production\'ın özeti güvenilir değilse (son tamamlanmış özet denetimi güncel biçimde bir fill ya da farksız bir check değilse) deploy kendiliğinden tam koşar; fullMode:true her tanımı taşır. Hangi kipte koştuğu ve modül başına sayılar deployment_status yanıtında (mode, counters).',
|
|
138
138
|
inputSchema: {
|
|
139
139
|
projectId: guid,
|
|
140
140
|
sourceEnvironmentId: guid,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { orphanedFlowWarnings, orphanedFlowPlan, orphanedFlowMessage, boundEventOps, flowIdEventOps, stripGatewayEventFields, staleSetterWarnings, normalizeSchemaOps, assertAddComponentIds, assertNoRetiredTypes, validationNote, componentNameNote, componentDefaultsNote, replacePropNote, flexSizeWarnings, nestedRepeaterNodes, nestedRepeaterMessage, stringStyleNodes, stringStyleWarning, inertFlexPropNodes, inertFlexPropWarning, verticalGapWarnings, withNormalization, FLEX_LAYOUT_PROP_NAMES } from '../knowledge/normalize.js';
|
|
1
|
+
import { orphanedFlowWarnings, orphanedFlowPlan, orphanedFlowMessage, boundEventOps, flowIdEventOps, stripGatewayEventFields, staleSetterWarnings, removedParameterSourceWarnings, normalizeSchemaOps, assertAddComponentIds, assertNoRetiredTypes, validationNote, componentNameNote, componentDefaultsNote, replacePropNote, flexSizeWarnings, nestedRepeaterNodes, nestedRepeaterMessage, stringStyleNodes, stringStyleWarning, inertFlexPropNodes, inertFlexPropWarning, verticalGapWarnings, withNormalization, FLEX_LAYOUT_PROP_NAMES } from '../knowledge/normalize.js';
|
|
2
2
|
import { opsParam, writeViewParam, outlineWriteResponse, unknownEventOps, collectTypes, simulateLayoutOps, removeNodeFromTree, planEventRemovals, callerSlots, planEmulatedOps, recordsWithEventRemovals, serverOpsInOrder, assertOpBodies, applySkeletonOps, reshapesSkeleton } from './schemaOps.js';
|
|
3
3
|
import { guid, projectParam, environmentParam, updates, microOps } from './common.js';
|
|
4
4
|
import { fetchHost, hostPath } from './screens.js';
|
|
@@ -133,7 +133,7 @@ export function registerDesignSchemaPatchTool(server, platform, host) {
|
|
|
133
133
|
assertScreenWriteGuards(spec.kind, { schema: added }, resolved.profile.platform);
|
|
134
134
|
const catalogNotes = await screenCatalogNotes(platform, project, environment, applicationId, added);
|
|
135
135
|
const flowWarnings = opRecords.some(entry => entry.op === 'remove_component')
|
|
136
|
-
? [...orphanedFlowWarnings(nodes, events, opRecords), ...staleSetterWarnings(Array.isArray(record.flows) ? record.flows : [], opRecords, nodes)]
|
|
136
|
+
? [...orphanedFlowWarnings(nodes, events, opRecords), ...staleSetterWarnings(Array.isArray(record.flows) ? record.flows : [], opRecords, nodes), ...removedParameterSourceWarnings(Array.isArray(record.flows) ? record.flows : [], opRecords, nodes)]
|
|
137
137
|
: [];
|
|
138
138
|
const simulated = structuredClone(nodes);
|
|
139
139
|
for (const entry of opRecords.filter(entry => entry.op === 'remove_component'))
|
package/dist/tools/files.js
CHANGED
|
@@ -104,7 +104,7 @@ export function registerFileTools(server, platform) {
|
|
|
104
104
|
}, handle(config, ({ project, environment, id }) => platform.tenant('GET', project, `/files/${id}`, { environment })));
|
|
105
105
|
server.registerTool('file_upload', {
|
|
106
106
|
title: 'Dosya yükle',
|
|
107
|
-
description: "Dosyayı projenin depolamasına yükler ve FileDto (id + serve adresleri) döner. İçerik ÜÇ yoldan verilir: `text` — düz metin içerik (SVG, CSV, Markdown, JSON…) + `filename`; base64'e çevirmeye gerek yok, bunu gateway yapar. `path` — gateway sürecinin okuyabildiği yerel yol (büyük ve ikili dosyalar için). `content` — base64 (8 MB'a kadar) + `filename`. Platform sınırı 50 MB; dosya adı \\|!#~$%&/=?»«@£§€{};'<>, karakterlerini içeremez. Yüklenen dosya sayfada `image`/`file-viewer` komponentiyle gösterilir ya da satır alanına yol olarak yazılır. DEPLOY dosyayı yalnız id referansıyla production'a taşır (sayfada file tipli prop `{ type:'file', ref:<fileId> }` ya da kayıt taşıması açık tablonun dosya sütunu); sayfaya düz yazılan serve URL'
|
|
107
|
+
description: "Dosyayı projenin depolamasına yükler ve FileDto (id + serve adresleri) döner. İçerik ÜÇ yoldan verilir: `text` — düz metin içerik (SVG, CSV, Markdown, JSON…) + `filename`; base64'e çevirmeye gerek yok, bunu gateway yapar. `path` — gateway sürecinin okuyabildiği yerel yol (büyük ve ikili dosyalar için). `content` — base64 (8 MB'a kadar) + `filename`. Platform sınırı 50 MB; dosya adı \\|!#~$%&/=?»«@£§€{};'<>, karakterlerini içeremez. Yüklenen dosya sayfada `image`/`file-viewer` komponentiyle gösterilir ya da satır alanına yol olarak yazılır. DEPLOY dosyayı yalnız id referansıyla production'a taşır (sayfada file tipli prop `{ type:'file', ref:<fileId> }` ya da kayıt taşıması açık tablonun dosya sütunu); sayfaya düz yazılan serve URL'si olduğu gibi kalır ve dosya kopyalanmaz: production sayfası development dosyasını gösterir, dosya development'tan silinirse kırılır; production'da bu araç da 400 CantWriteInProductionException ile reddedilir — platform_guide('deployment') §Dosyalar.",
|
|
108
108
|
inputSchema: {
|
|
109
109
|
project: projectParam,
|
|
110
110
|
environment: environmentParam,
|
package/dist/tools/flows.js
CHANGED
|
@@ -3,7 +3,8 @@ import { guid, projectParam, environmentParam, readOnly, writes, updates, destru
|
|
|
3
3
|
import { applyPolicyMode, evaluatePolicy, enforcePolicy, attachFindings } from '../knowledge/policy.js';
|
|
4
4
|
import { connectedSetterFindings } from '../knowledge/connectDataDefinition.js';
|
|
5
5
|
import { flowBindings, normalizeFlowSteps, targetlessSetterWarnings, unknownSetterTargetWarnings, withNormalization } from '../knowledge/normalize.js';
|
|
6
|
-
import { flowBodyWarnings } from '../knowledge/coverage.js';
|
|
6
|
+
import { captchaNotConfiguredMessage, captchaTokenProblem, flowBodyWarnings } from '../knowledge/coverage.js';
|
|
7
|
+
import { projectCaptchaProvider } from './projects.js';
|
|
7
8
|
import { PlatformApiError } from '../platform/errors.js';
|
|
8
9
|
import { handle } from '../platform/responses.js';
|
|
9
10
|
import { emptyWriteDiff, writeDiff, withWriteDiff } from '../platform/writeDiff.js';
|
|
@@ -385,6 +386,36 @@ async function queuedBranchWarnings(platform, applicationId, steps, errorSteps,
|
|
|
385
386
|
}
|
|
386
387
|
return warnings;
|
|
387
388
|
}
|
|
389
|
+
/**
|
|
390
|
+
* FLOW-049 (ADR 0035, K-2 · B-14). "Captcha zorunlu" servise giden `microservice` adımı `X-Captcha-Token` başlık
|
|
391
|
+
* parametresini (`source: 'header'`) sayfadaki captcha bileşeninin `value`'suna (`property`) bağlamalı: bağsız ya da başlıkta
|
|
392
|
+
* olmayan istek 422 CaptchaRequiredException alır, ifade (`code`) bağında akış hangi kutuyu yenileyeceğini bilemez ve sonraki gönderim kullanılmış kodla reddedilir.
|
|
393
|
+
* Bağın hedefi barındırıcının ağacında bir captcha olmalıdır (`captchaTokenProblem`, 2026-11-06 2. tur MCP-1). Captcha
|
|
394
|
+
* zorunlu servise giden adım varsa projenin captcha ayarı da okunur: ayarsız projede doğru bağ da çalışmaz (CAPTCHA-003,
|
|
395
|
+
* MCP-3). Bildirim servis tanımından okunur; okunamayan servis ya da ayar uyarı üretmez.
|
|
396
|
+
*/
|
|
397
|
+
async function captchaBindingWarnings(steps, errorSteps, readService, nodes, platform, project) {
|
|
398
|
+
const serviceSteps = [...(Array.isArray(steps) ? steps : []), ...(Array.isArray(errorSteps) ? errorSteps : [])].filter(isRecord)
|
|
399
|
+
.filter(step => String(step.type ?? '') === 'microservice');
|
|
400
|
+
const warnings = [];
|
|
401
|
+
const gatedSteps = [];
|
|
402
|
+
for (const step of serviceSteps) {
|
|
403
|
+
const args = step.args;
|
|
404
|
+
const microserviceId = args?.microserviceId;
|
|
405
|
+
const definition = typeof microserviceId === 'string' ? await readService(microserviceId) : undefined;
|
|
406
|
+
if (definition?.requiresCaptcha !== true)
|
|
407
|
+
continue;
|
|
408
|
+
gatedSteps.push(String(step.stepId ?? step.name ?? '?'));
|
|
409
|
+
const problem = captchaTokenProblem(args?.parameters, nodes);
|
|
410
|
+
if (problem === undefined)
|
|
411
|
+
continue;
|
|
412
|
+
warnings.push(`FLOW-049: '${String(step.stepId ?? step.name ?? '?')}' adımı '${String(definition.slug ?? microserviceId)}' servisine gidiyor ve servis requiresCaptcha, ama ${problem}. 'X-Captcha-Token' başlık parametresini sayfadaki captcha bileşeninin value'suna bağlayın — { name: 'X-Captcha-Token', type: 'text', source: 'header', value: { type: 'property', ref: { element: '<captcha elementId>', property: 'value' } } }. source: 'header' şarttır: source'suz ya da başka kaynaklı parametre başlıkta gitmez. Bağsız istek 422 CaptchaRequiredException alır; ifade (code) bağında kutu kod gönderildikten sonra yenilenmez.`);
|
|
413
|
+
}
|
|
414
|
+
if (gatedSteps.length > 0 && await projectCaptchaProvider(platform, project) === null) {
|
|
415
|
+
warnings.push(captchaNotConfiguredMessage(platform.resolveProject(project), `${gatedSteps.map(step => `'${step}'`).join(', ')} adımı captcha zorunlu servise gidiyor`));
|
|
416
|
+
}
|
|
417
|
+
return warnings;
|
|
418
|
+
}
|
|
388
419
|
/**
|
|
389
420
|
* FLOW-044 (plans/mobil-cevrimdisi-calisma g-03, telefon turu 2026-10-22). Veri önbelleği yalnız GET okumayı saklar
|
|
390
421
|
* (frontend `isCacheableMethod`): okuyan uca (görünüm kaynağı ya da tablo `get`/`count` — MS-025 ile aynı tanım) GET dışı
|
|
@@ -647,6 +678,7 @@ export function registerFlowTools(server, platform) {
|
|
|
647
678
|
...unknownSetterTargetWarnings(steps, errorSteps ?? [], hostNodes(hostRecord)),
|
|
648
679
|
...microserviceAlwaysDataWarnings(steps, errorSteps ?? []),
|
|
649
680
|
...await queuedBranchWarnings(platform, applicationId, steps, errorSteps ?? [], readService),
|
|
681
|
+
...await captchaBindingWarnings(steps, errorSteps ?? [], readService, hostNodes(hostRecord), platform, project),
|
|
650
682
|
...await uncachedReadWarnings(platform, applicationId, steps, errorSteps ?? [], readService),
|
|
651
683
|
...purchase.warnings
|
|
652
684
|
];
|
|
@@ -741,6 +773,7 @@ export function registerFlowTools(server, platform) {
|
|
|
741
773
|
...unknownSetterTargetWarnings(flow.steps, flow.errorSteps, hostNodes(hostRecord)),
|
|
742
774
|
...microserviceAlwaysDataWarnings(flow.steps, flow.errorSteps),
|
|
743
775
|
...await queuedBranchWarnings(platform, applicationId, flow.steps, flow.errorSteps, readService),
|
|
776
|
+
...await captchaBindingWarnings(flow.steps, flow.errorSteps, readService, hostNodes(hostRecord), platform, project),
|
|
744
777
|
...await uncachedReadWarnings(platform, applicationId, flow.steps, flow.errorSteps, readService),
|
|
745
778
|
...purchase.warnings
|
|
746
779
|
];
|
|
@@ -810,6 +843,7 @@ export function registerFlowTools(server, platform) {
|
|
|
810
843
|
...unknownSetterTargetWarnings(flow.steps, flow.errorSteps, hostNodes(hostRecord)),
|
|
811
844
|
...microserviceAlwaysDataWarnings(flow.steps, flow.errorSteps),
|
|
812
845
|
...await queuedBranchWarnings(platform, applicationId, flow.steps, flow.errorSteps, readService),
|
|
846
|
+
...await captchaBindingWarnings(flow.steps, flow.errorSteps, readService, hostNodes(hostRecord), platform, project),
|
|
813
847
|
...await uncachedReadWarnings(platform, applicationId, flow.steps, flow.errorSteps, readService),
|
|
814
848
|
...purchase.warnings
|
|
815
849
|
];
|
|
@@ -18,6 +18,9 @@ import { outlineWrite, recordWriteViewParam } from '../platform/writeView.js';
|
|
|
18
18
|
import { handle } from '../platform/responses.js';
|
|
19
19
|
import { assertNoPushInProduction } from './workflows.js';
|
|
20
20
|
import { headersForMode } from '../platform/http.js';
|
|
21
|
+
import { fetchHost, flowPath, unwrap } from './screens.js';
|
|
22
|
+
import { captchaNotConfiguredMessage, captchaTokenProblem } from '../knowledge/coverage.js';
|
|
23
|
+
import { projectCaptchaProvider } from './projects.js';
|
|
21
24
|
import fastJsonPatch from 'fast-json-patch';
|
|
22
25
|
import { jsonArray } from '../platform/jsonArray.js';
|
|
23
26
|
import { z } from 'zod';
|
|
@@ -109,6 +112,58 @@ function runIdentity(anonymous, asUser, cookies, headers) {
|
|
|
109
112
|
function hasAuthorization(headers) {
|
|
110
113
|
return Object.keys(headers ?? {}).some(name => name.toLowerCase() === 'authorization');
|
|
111
114
|
}
|
|
115
|
+
const SCREEN_HOSTS = new Set(['page', 'layout', 'component']);
|
|
116
|
+
/**
|
|
117
|
+
* Servis `requiresCaptcha: true` olurken (2026-11-06 captcha 2. tur ajan testi MCP-2, MCP-3). CAPTCHA-003: projede captcha
|
|
118
|
+
* ayarı yoksa işaretli servis hiçbir çağrıyı geçirmez. MS-029: servisi ZATEN çağıran akışlar kodsuz kalır — Studio adımı
|
|
119
|
+
* satırı gösterir ama bağ kurulmadıkça her çağrı 422 alır. Bağımlı akışlar `GET /dependencies/microservice/{id}`'den, her
|
|
120
|
+
* akışın barındırıcısı `GET /dependencies/flow/{id}`'den, gövdesi ve düğümleri barındırıcıdan okunur; bağ FLOW-049'un
|
|
121
|
+
* denetimiyle (`captchaTokenProblem`) değerlendirilir. Okunamayan akış adıyla "doğrulanamadı" der, okunamayan ayar susar.
|
|
122
|
+
*/
|
|
123
|
+
async function captchaGateFindings(platform, project, environment, applicationId, microserviceId, slug) {
|
|
124
|
+
const findings = [];
|
|
125
|
+
const guide = 'ngapps://guides/microservice';
|
|
126
|
+
if (await projectCaptchaProvider(platform, project) === null) {
|
|
127
|
+
findings.push({ ruleId: 'CAPTCHA-003', severity: 'warn', message: captchaNotConfiguredMessage(platform.resolveProject(project), `'${slug}' servisi requiresCaptcha oluyor`), guide });
|
|
128
|
+
}
|
|
129
|
+
const dependents = await platform.tenant('GET', project, `/dependencies/microservice/${microserviceId}`, { environment })
|
|
130
|
+
.then(payload => unwrap(payload).depended)
|
|
131
|
+
.catch(() => undefined);
|
|
132
|
+
const flows = (Array.isArray(dependents) ? dependents : []).filter((node) => Boolean(node) && typeof node === 'object' && node.module === 'flow');
|
|
133
|
+
const unbound = [];
|
|
134
|
+
const unread = [];
|
|
135
|
+
for (const flow of flows) {
|
|
136
|
+
const label = `'${String(flow.name ?? flow.id)}'${flow.componentName ? ` (${String(flow.componentName)} · ${String(flow.eventName ?? '?')})` : ''}`;
|
|
137
|
+
try {
|
|
138
|
+
const owners = unwrap(await platform.tenant('GET', project, `/dependencies/flow/${String(flow.id)}`, { environment })).depended;
|
|
139
|
+
const owner = (Array.isArray(owners) ? owners : []).find(node => SCREEN_HOSTS.has(String(node?.module)));
|
|
140
|
+
if (!owner) {
|
|
141
|
+
unread.push(label);
|
|
142
|
+
continue;
|
|
143
|
+
}
|
|
144
|
+
const host = String(owner.module);
|
|
145
|
+
const record = await fetchHost(platform, host, project, environment, applicationId, String(owner.id));
|
|
146
|
+
const body = unwrap(await platform.tenant('GET', project, flowPath(host, applicationId, String(owner.id), String(flow.id)), { environment }));
|
|
147
|
+
const problem = [...(Array.isArray(body.steps) ? body.steps : []), ...(Array.isArray(body.errorSteps) ? body.errorSteps : [])]
|
|
148
|
+
.map(step => step)
|
|
149
|
+
.filter(step => step.type === 'microservice' && step.args?.microserviceId === microserviceId)
|
|
150
|
+
.map(step => captchaTokenProblem(step.args.parameters, record.schema ?? record.views ?? []))
|
|
151
|
+
.find(entry => entry !== undefined);
|
|
152
|
+
if (problem !== undefined)
|
|
153
|
+
unbound.push(`${label}: ${problem}`);
|
|
154
|
+
}
|
|
155
|
+
catch {
|
|
156
|
+
unread.push(label);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
if (unbound.length > 0) {
|
|
160
|
+
findings.push({ ruleId: 'MS-029', severity: 'warn', message: `requiresCaptcha açıldı ama bu servisi çağıran ${unbound.length} akış captcha kodunu göndermiyor — bundan sonra o akışların her çağrısı 422 CaptchaRequiredException alır: ${unbound.join(' | ')}. Her akışın servis adımına 'X-Captcha-Token' başlık parametresini sayfadaki captcha'nın value'suna bağlayın (flow_get → flow_update; bağın şeklini FLOW-049 söyler).`, guide });
|
|
161
|
+
}
|
|
162
|
+
if (unread.length > 0) {
|
|
163
|
+
findings.push({ ruleId: 'MS-029', severity: 'warn', message: `requiresCaptcha açıldı; şu akışların captcha bağı okunamadı: ${unread.join(', ')} — flow_get ile bakın, kodsuz çağıran akış 422 CaptchaRequiredException alır.`, guide });
|
|
164
|
+
}
|
|
165
|
+
return findings;
|
|
166
|
+
}
|
|
112
167
|
/**
|
|
113
168
|
* Debug çıktısındaki `executionItems` ucun kendi adımlarıdır; middleware AYRI bir workflow olarak
|
|
114
169
|
* ucun ÖNÜNDE koşar ve ağaçta hiç görünmez — 09-04 koşusunda sessizce açık kalan şirket kapısı
|
|
@@ -396,7 +451,11 @@ export function registerMicroserviceTools(server, platform) {
|
|
|
396
451
|
: await platform.tenant('PUT', project, `/microservices/${resolvedApplicationId}/${String(existing.id)}`, { environment, body: definition });
|
|
397
452
|
const saved = payload?.data;
|
|
398
453
|
const rename = ifExists === 'duplicate' ? platformRename(definition, saved, 'dash') : { sent: definition };
|
|
399
|
-
|
|
454
|
+
// CAPTCHA-003: yeni servisi çağıran akış henüz yoktur (MS-029 yalnız update/patch'te); ayarsız proje burada da söylenir.
|
|
455
|
+
const captchaFindings = definition.requiresCaptcha === true && await projectCaptchaProvider(platform, project) === null
|
|
456
|
+
? [{ ruleId: 'CAPTCHA-003', severity: 'warn', message: captchaNotConfiguredMessage(platform.resolveProject(project), `'${String(definition.slug ?? definition.name ?? '?')}' servisi requiresCaptcha`), guide: 'ngapps://guides/microservice' }]
|
|
457
|
+
: [];
|
|
458
|
+
return attachFindings(withUnmappedMembers(withWriteDiff(withResolved(withRename(withNormalization(withOutcome(outlineWrite(payload, view, MICROSERVICE_OUTLINE_KEYS), existing), normalized), rename.renamed), [...resolver.resolved, ...hydrated]), writeDiff(rename.sent, payload)), drift), [...findings, ...captchaFindings]);
|
|
400
459
|
}));
|
|
401
460
|
server.registerTool('microservice_update', {
|
|
402
461
|
title: 'Microservice güncelle',
|
|
@@ -414,8 +473,12 @@ export function registerMicroserviceTools(server, platform) {
|
|
|
414
473
|
...await legacyRoleListFindings(platform, project, environment, definition, 'microservice', policyOverride)
|
|
415
474
|
];
|
|
416
475
|
const drift = unmappedMembers('UpdateMicroserviceCommand', definition);
|
|
476
|
+
// MS-029 / CAPTCHA-003: kayıtlı tanım yalnız bayrağı açan gövdede okunur — bayrak bu yazımla mı açılıyor?
|
|
477
|
+
const flagging = definition.requiresCaptcha === true
|
|
478
|
+
&& unwrap(await platform.tenant('GET', project, `/microservices/${resolvedApplicationId}/${id}`, { environment }).catch(() => undefined)).requiresCaptcha !== true;
|
|
417
479
|
const payload = await platform.tenant('PUT', project, `/microservices/${resolvedApplicationId}/${id}`, { environment, body: definition });
|
|
418
|
-
|
|
480
|
+
const captchaFindings = flagging ? await captchaGateFindings(platform, project, environment, resolvedApplicationId, id, String(definition.slug ?? id)) : [];
|
|
481
|
+
return attachFindings(withUnmappedMembers(withWriteDiff(withResolved(withNormalization(outlineWrite(payload, view, MICROSERVICE_OUTLINE_KEYS), normalized), [...resolver.resolved, ...hydrated]), writeDiff(definition, payload)), drift), [...findings, ...captchaFindings]);
|
|
419
482
|
}));
|
|
420
483
|
server.registerTool('microservice_patch', {
|
|
421
484
|
title: 'Microservice\'e patch uygula',
|
|
@@ -456,7 +519,10 @@ export function registerMicroserviceTools(server, platform) {
|
|
|
456
519
|
body: { baseVersion: baseVersionOf(definition, 'microservice_get'), ops: netOps }
|
|
457
520
|
});
|
|
458
521
|
const written = patchResult(saved, patched);
|
|
459
|
-
|
|
522
|
+
const captchaFindings = definition.requiresCaptcha !== true && patched.requiresCaptcha === true
|
|
523
|
+
? await captchaGateFindings(platform, project, environment, resolvedApplicationId, id, String(patched.slug ?? id))
|
|
524
|
+
: [];
|
|
525
|
+
return attachFindings(withUnmappedMembers(withWriteDiff(withResolved(withNormalization({ applied: operations.length, newVersion: written.newVersion, outline: microserviceOutline(written.data) }, [...roleNotes, ...normalized, ...resolved.notes.map(note => `patch yolu seçiciden indekse çözüldü: ${note}`)]), resolver.resolved), writeDiff(patched, written.data)), drift), [...findings, ...captchaFindings]);
|
|
460
526
|
}));
|
|
461
527
|
server.registerTool('microservice_delete', {
|
|
462
528
|
title: 'Microservice sil',
|
package/dist/tools/pages.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { guid, projectParam, environmentParam, pagingParams, asUserIdParam, readOnly, writes, updates, destructive, microOps, isBranchName, branchSlug } from './common.js';
|
|
2
|
-
import { orphanedFlowWarnings, orphanedFlowPlan, orphanedFlowMessage, boundEventOps, flowIdEventOps, stripGatewayEventFields, staleSetterWarnings, lostSetterTargets, fillComponentNames, componentNameNote, normalizeComponentDefaults, normalizeSchemaOps, schemaOpValidationErrors, codePropTemplateErrors, addComponentIdErrors, missingBlocksNodes, retiredTypeNodes, assertNoRetiredNodes, validationNote, componentDefaultsNote, replacePropNote, ensurePageContainer, retargetRootAdds, rootAddsNote, flexSizeWarnings, spacingLayerWarnings, reorderSchemaBlocks, reorderNote, nestedRepeaterNodes, nestedRepeaterMessage, stringStyleNodes, stringStyleWarning, inertFlexPropNodes, inertFlexPropWarning, FLEX_LAYOUT_PROP_NAMES, resetPageContainerPosition, pageContainerPositionWarning, verticalGapWarnings, flexIndexOrder, flexIndexOrderNote, withNormalization, parseVariableEntries, PAGE_CONTAINER_ELEMENT_ID, screenEventsNeedPlatform } from '../knowledge/normalize.js';
|
|
2
|
+
import { orphanedFlowWarnings, orphanedFlowPlan, orphanedFlowMessage, boundEventOps, flowIdEventOps, stripGatewayEventFields, staleSetterWarnings, removedParameterSourceWarnings, lostSetterTargets, fillComponentNames, componentNameNote, normalizeComponentDefaults, normalizeSchemaOps, schemaOpValidationErrors, codePropTemplateErrors, addComponentIdErrors, missingBlocksNodes, retiredTypeNodes, assertNoRetiredNodes, validationNote, componentDefaultsNote, replacePropNote, ensurePageContainer, retargetRootAdds, rootAddsNote, flexSizeWarnings, spacingLayerWarnings, reorderSchemaBlocks, reorderNote, nestedRepeaterNodes, nestedRepeaterMessage, stringStyleNodes, stringStyleWarning, inertFlexPropNodes, inertFlexPropWarning, FLEX_LAYOUT_PROP_NAMES, resetPageContainerPosition, pageContainerPositionWarning, verticalGapWarnings, flexIndexOrder, flexIndexOrderNote, withNormalization, parseVariableEntries, PAGE_CONTAINER_ELEMENT_ID, screenEventsNeedPlatform } from '../knowledge/normalize.js';
|
|
3
3
|
import { functionSignature } from '../knowledge/functionGuards.js';
|
|
4
4
|
import { attachFindings } from '../knowledge/policy.js';
|
|
5
5
|
import { fetchHost, pageUpdateBody, schemaParam, eventsParam, unwrap, modeParam, summarize, findNode, flowPath, countSchemaNodes, missingElementIds, readFullSchema } from './screens.js';
|
|
6
6
|
import { fetchComponentEventNames } from './components.js';
|
|
7
7
|
import { assertScreenWriteGuards, screenCatalogNotes, assertScreenCatalog, unknownPropOps } from './screenWrite.js';
|
|
8
8
|
import { opsParam, writeViewParam, outlineWriteResponse, unknownEventOps, collectTypes, simulateLayoutOps, applySkeletonOps, reshapesSkeleton, planEventRemovals, callerSlots, planEmulatedOps, recordsWithEventRemovals, serverOpsInOrder, rejectedOpsMessage } from './schemaOps.js';
|
|
9
|
-
import { formBindingWarnings, formSubmitButtonWarnings } from '../knowledge/coverage.js';
|
|
9
|
+
import { addedCaptchaIds, captchaHiddenWarnings, captchaNotConfiguredMessage, captchaOutsideFormWarnings, captchaPerFormWarnings, captchaValueMessage, captchaValueWrites, formBindingWarnings, formSubmitButtonWarnings } from '../knowledge/coverage.js';
|
|
10
|
+
import { projectCaptchaProvider } from './projects.js';
|
|
10
11
|
import { emptyWriteDiff, pageWriteDrops, schemaOpDrops, unwrapProps, withWriteDiff, writeDiff } from '../platform/writeDiff.js';
|
|
11
12
|
import { PlatformApiError } from '../platform/errors.js';
|
|
12
13
|
import { existingMatch, ifExistsParam, listAll, withOutcome } from '../platform/ifExists.js';
|
|
@@ -960,8 +961,20 @@ export function registerPageTools(server, platform, injectedScreenshotter, injec
|
|
|
960
961
|
.filter(entry => entry.op === 'add_component')
|
|
961
962
|
.map(entry => entry.component);
|
|
962
963
|
assertScreenWriteGuards('page', { schema: added }, resolved.profile.platform);
|
|
964
|
+
// CAPTCHA-001: hedefin tipi kayıtlı ağaçtan okunur; ağaç yalnız bir op `value` yazıyorsa okunur.
|
|
965
|
+
const valueOps = [...opRecords, ...propTypeOps];
|
|
966
|
+
const captchaWrites = captchaValueWrites(valueOps, valueOps.some(entry => (entry.prop ?? entry.path) === 'value') ? (await readPage()).schema : []);
|
|
967
|
+
if (captchaWrites.length > 0)
|
|
968
|
+
throw new PlatformApiError(captchaValueMessage(captchaWrites), 400);
|
|
969
|
+
// CAPTCHA-004: ağaç yalnız bir op `isHidden` yazıyorsa okunur; okunamazsa yalnız eklenen gövdeler denetlenir, yama durmaz.
|
|
970
|
+
// CAPTCHA-003: proje ayarı yalnız captcha eklenirse okunur.
|
|
971
|
+
const hiddenCaptchas = captchaHiddenWarnings(valueOps, valueOps.some(entry => (entry.prop ?? entry.path) === 'isHidden') ? await readPage().then(page => page.schema).catch(() => []) : []);
|
|
972
|
+
const addedCaptchas = addedCaptchaIds(sentOps);
|
|
973
|
+
const unconfiguredCaptcha = addedCaptchas.length > 0 && await projectCaptchaProvider(platform, project) === null
|
|
974
|
+
? [captchaNotConfiguredMessage(platform.resolveProject(project), `bu yama captcha ekliyor (${addedCaptchas.join(', ')})`)]
|
|
975
|
+
: [];
|
|
963
976
|
const catalogNotes = await screenCatalogNotes(platform, project, environment, applicationId, added);
|
|
964
|
-
const formWarnings = [...formBindingWarnings(opRecords), ...formSubmitButtonWarnings(opRecords)];
|
|
977
|
+
const formWarnings = [...formBindingWarnings(opRecords), ...formSubmitButtonWarnings(opRecords), ...hiddenCaptchas, ...unconfiguredCaptcha];
|
|
965
978
|
let flowWarnings = [];
|
|
966
979
|
let layoutWarnings = [];
|
|
967
980
|
let flowsBeforePatch;
|
|
@@ -979,7 +992,7 @@ export function registerPageTools(server, platform, injectedScreenshotter, injec
|
|
|
979
992
|
const hosted = await platform.tenant('GET', project, flowPath('page', applicationId, pageId), { environment });
|
|
980
993
|
const page = await readPage();
|
|
981
994
|
flowsBeforePatch = hosted?.data ?? [];
|
|
982
|
-
flowWarnings = [...flowWarnings, ...staleSetterWarnings(flowsBeforePatch, opRecords, page.schema)];
|
|
995
|
+
flowWarnings = [...flowWarnings, ...staleSetterWarnings(flowsBeforePatch, opRecords, page.schema), ...removedParameterSourceWarnings(flowsBeforePatch, opRecords, page.schema)];
|
|
983
996
|
}
|
|
984
997
|
catch {
|
|
985
998
|
// akış listesi okunamadı
|
|
@@ -1002,7 +1015,9 @@ export function registerPageTools(server, platform, injectedScreenshotter, injec
|
|
|
1002
1015
|
...stringStyleWarning(stringStyleNodes(simulated)),
|
|
1003
1016
|
...(resolved.profile.layout.modes.has('grid') ? inertFlexPropWarning(inertFlexPropNodes(simulated)) : []),
|
|
1004
1017
|
...flexSizeWarnings(simulated, 'PAGE-017 (uyarı)', 'PAGE-018 (uyarı)'),
|
|
1005
|
-
...spacingLayerWarnings(simulated, 'PAGE-029 (uyarı)', 'PAGE-030 (uyarı)')
|
|
1018
|
+
...spacingLayerWarnings(simulated, 'PAGE-029 (uyarı)', 'PAGE-030 (uyarı)'),
|
|
1019
|
+
...captchaOutsideFormWarnings(simulated, sentOps),
|
|
1020
|
+
...captchaPerFormWarnings(simulated, sentOps)
|
|
1006
1021
|
];
|
|
1007
1022
|
}
|
|
1008
1023
|
catch {
|
package/dist/tools/projects.js
CHANGED
|
@@ -96,6 +96,49 @@ async function withPublishedSchemaVersion(platform, payload) {
|
|
|
96
96
|
return withNormalization(payload, ["organizationSchema.latestVersion doğrulanamadı (slug ucu GET /p/{slug} sürüm taşımaz, GET /projects/{id} okunamadı): yokluğu 'yayınlı şema yok' demek DEĞİLDİR — organization_schema_get ile doğrulayın (TB-67)."]);
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
|
+
async function captchaProviderOf(platform, projectId) {
|
|
100
|
+
try {
|
|
101
|
+
const setting = await platform.org('GET', `/projects/${projectId}/captcha-settings`);
|
|
102
|
+
if (!setting?.data || typeof setting.data !== 'object')
|
|
103
|
+
return undefined;
|
|
104
|
+
return typeof setting.data.provider === 'string' && setting.data.provider !== '' ? setting.data.provider : null;
|
|
105
|
+
}
|
|
106
|
+
catch {
|
|
107
|
+
return undefined;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Projenin captcha sağlayıcısı (kök ADR 0035; 2026-11-06 2. tur ajan testi MCP-3): ayar Organization.API'dedir
|
|
112
|
+
* (`GET /projects/{id}/captcha-settings`, gizli anahtarlar dönmez). Ayar yoksa `null`; proje ya da ayar okunamazsa
|
|
113
|
+
* `undefined` — bilmediğimizi uyarı diye söylemeyiz (CAPTCHA-003).
|
|
114
|
+
*/
|
|
115
|
+
export async function projectCaptchaProvider(platform, project) {
|
|
116
|
+
try {
|
|
117
|
+
const payload = await platform.org('GET', `/p/${platform.resolveProject(project)}`);
|
|
118
|
+
return typeof payload?.data?.id === 'string' ? await captchaProviderOf(platform, payload.data.id) : undefined;
|
|
119
|
+
}
|
|
120
|
+
catch {
|
|
121
|
+
return undefined;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Ayarı okuyan araç yoktu: ajan ayarsız projede captcha kurdu, uyarı almadı ve form hiç gönderilemedi (2026-11-06 2. tur
|
|
126
|
+
* MCP-3). Platformun `data`'sı değiştirilmez, blok kardeş alandır; okuma düşerse blok yazılmaz.
|
|
127
|
+
*/
|
|
128
|
+
async function withCaptcha(platform, payload) {
|
|
129
|
+
const id = payload?.data?.id;
|
|
130
|
+
if (typeof id !== 'string' || !payload || typeof payload !== 'object' || Array.isArray(payload))
|
|
131
|
+
return payload;
|
|
132
|
+
const provider = await captchaProviderOf(platform, id);
|
|
133
|
+
if (provider === undefined)
|
|
134
|
+
return payload;
|
|
135
|
+
return {
|
|
136
|
+
...payload,
|
|
137
|
+
captcha: provider === null
|
|
138
|
+
? { configured: false, note: "Projede captcha ayarı yok: captcha 'Captcha ayarlı değil' diye çizilir ve form gönderilemez. Ayarı bir insan Studio'da Project › Settings › Captcha'dan kurar; sağlayıcı ve anahtarlar MCP'den yazılmaz." }
|
|
139
|
+
: { configured: true, provider }
|
|
140
|
+
};
|
|
141
|
+
}
|
|
99
142
|
const applicationInput = z.object({
|
|
100
143
|
slug: z.string().min(1),
|
|
101
144
|
name: z.string().min(1),
|
|
@@ -156,7 +199,7 @@ export function registerProjectTools(server, platform) {
|
|
|
156
199
|
}, handle(config, args => platform.org('GET', '/projects', { query: args })));
|
|
157
200
|
server.registerTool('project_get', {
|
|
158
201
|
title: 'Proje getir',
|
|
159
|
-
description: "Tek projeyi id ya da slug ile getirir; environment listesi de yanıttadır (her ortamda enforcementMode: off | shadow | enforce). Yanıttaki 'localization' bloğu gateway'in eklediği türetilmiş alandır: platform dil alanlarını null olduklarında serileştirmede düşürüyor, blok bunu görünür kılar ve runtime'ın çevirileri çözüp çözemeyeceğini söyler. accessModel projenin türüdür; organizationSchema { receiveUpdates, appliedVersion, latestVersion, customizedAt } kompleks projenin şema aboneliğidir — gateway null alanları düşürür: customizedAt YOKSA proje özelleştirilmemiştir, appliedVersion yoksa şema hiç uygulanmamıştır, latestVersion yoksa organizasyonda yayınlı şema yoktur (platform_guide('getting-started') §'Basit mi kompleks mi'). slug ile çağrıda platformun slug ucu latestVersion'ı taşımaz; gateway organizationSchema bloğunu GET /projects/{id}'den alır, o okuma düşerse yanıtta gatewayNormalized notu olur ve latestVersion'ın yokluğu bir şey söylemez (TB-67).",
|
|
202
|
+
description: "Tek projeyi id ya da slug ile getirir; environment listesi de yanıttadır (her ortamda enforcementMode: off | shadow | enforce). Yanıttaki 'localization' bloğu gateway'in eklediği türetilmiş alandır: platform dil alanlarını null olduklarında serileştirmede düşürüyor, blok bunu görünür kılar ve runtime'ın çevirileri çözüp çözemeyeceğini söyler. accessModel projenin türüdür; organizationSchema { receiveUpdates, appliedVersion, latestVersion, customizedAt } kompleks projenin şema aboneliğidir — gateway null alanları düşürür: customizedAt YOKSA proje özelleştirilmemiştir, appliedVersion yoksa şema hiç uygulanmamıştır, latestVersion yoksa organizasyonda yayınlı şema yoktur (platform_guide('getting-started') §'Basit mi kompleks mi'). slug ile çağrıda platformun slug ucu latestVersion'ı taşımaz; gateway organizationSchema bloğunu GET /projects/{id}'den alır, o okuma düşerse yanıtta gatewayNormalized notu olur ve latestVersion'ın yokluğu bir şey söylemez (TB-67). 'captcha' bloğu da gateway'in eklediği alandır: { configured: false, note } projede captcha ayarı yok demektir (captcha bileşeni çalışmaz, ayarı bir insan Studio'da Project › Settings › Captcha'dan kurar), { configured: true, provider } kurulu sağlayıcıyı söyler (turnstile | recaptcha | hcaptcha); ayar okunamazsa blok yoktur.",
|
|
160
203
|
inputSchema: { id: guid.optional(), slug: z.string().optional().describe('id verilmediyse zorunlu') },
|
|
161
204
|
annotations: readOnly
|
|
162
205
|
}, handle(config, async (args) => {
|
|
@@ -164,8 +207,8 @@ export function registerProjectTools(server, platform) {
|
|
|
164
207
|
throw new Error("'id' ya da 'slug' parametrelerinden biri zorunlu.");
|
|
165
208
|
}
|
|
166
209
|
if (args.id)
|
|
167
|
-
return withLocalization(await platform.org('GET', `/projects/${args.id}`));
|
|
168
|
-
return withLocalization(await withPublishedSchemaVersion(platform, await platform.org('GET', `/p/${args.slug}`)));
|
|
210
|
+
return withCaptcha(platform, withLocalization(await platform.org('GET', `/projects/${args.id}`)));
|
|
211
|
+
return withCaptcha(platform, withLocalization(await withPublishedSchemaVersion(platform, await platform.org('GET', `/p/${args.slug}`))));
|
|
169
212
|
}));
|
|
170
213
|
server.registerTool('project_create', {
|
|
171
214
|
title: 'Proje oluştur',
|
package/package.json
CHANGED