@appaflytech/zeyrek-ai-mcp 0.0.63 → 0.0.65

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.
Files changed (41) hide show
  1. package/dist/knowledge/access.js +29 -0
  2. package/dist/knowledge/componentCatalog.js +1 -1
  3. package/dist/knowledge/componentEvents.js +5 -2
  4. package/dist/knowledge/previewLimits.js +72 -0
  5. package/dist/knowledge/rules.js +256 -4
  6. package/dist/knowledge/storeImport.js +22 -0
  7. package/dist/platform/bodyFile.js +22 -87
  8. package/dist/platform/capture/actions.js +43 -1
  9. package/dist/platform/capture/capture.js +84 -13
  10. package/dist/platform/localFiles.js +197 -0
  11. package/dist/platform/responses.js +2 -2
  12. package/dist/platform/storeArt/deck.js +22 -15
  13. package/dist/platform/storeArt/gallery.js +11 -4
  14. package/dist/resources/examples/workflow-push-own-profile.json +100 -0
  15. package/dist/resources/guides/deployment.md +32 -0
  16. package/dist/resources/guides/entity.md +2 -0
  17. package/dist/resources/guides/expressions.md +4 -2
  18. package/dist/resources/guides/microservice.md +7 -3
  19. package/dist/resources/guides/mobile-publish.md +25 -5
  20. package/dist/resources/guides/mobile-steps.md +19 -1
  21. package/dist/resources/guides/mobile.md +6 -6
  22. package/dist/resources/guides/translation.md +6 -0
  23. package/dist/resources/guides/workflow.md +23 -5
  24. package/dist/resources/schema-fingerprint.json +3 -3
  25. package/dist/tools/applications.js +1 -1
  26. package/dist/tools/bpmGovernance.js +22 -19
  27. package/dist/tools/bpmReporting.js +6 -3
  28. package/dist/tools/case.js +10 -14
  29. package/dist/tools/common.js +1 -1
  30. package/dist/tools/decisions.js +10 -14
  31. package/dist/tools/deployments.js +160 -18
  32. package/dist/tools/externalComponents.js +28 -27
  33. package/dist/tools/files.js +15 -14
  34. package/dist/tools/mobileStore.js +22 -13
  35. package/dist/tools/mobileStoreImport.js +22 -12
  36. package/dist/tools/pages.js +32 -11
  37. package/dist/tools/queries.js +15 -2
  38. package/dist/tools/rows.js +70 -33
  39. package/dist/tools/translations.js +16 -18
  40. package/dist/tools/workflows.js +13 -6
  41. package/package.json +1 -1
@@ -505,6 +505,35 @@ export async function identityMiddlewareFindings(platform, project, environment,
505
505
  guide: 'ngapps://guides/access'
506
506
  }], policyOverride);
507
507
  }
508
+ /**
509
+ * WF-042 (derdini-dok DD-3, K3): simple projede uygulama oturumu çözülmez (`AppSessionMiddleware.cs:25`), push cihazı
510
+ * kullanıcıya bağlanmaz (`PushDevice.AppUserId` boş) — `to.users` hiçbir telefona ulaşmaz ve adım `deviceCount: 0`
511
+ * ile BAŞARI dalından sürer (kök ADR 0032). Yol kurulum kimliğidir: istemci `Device.installationId`'yi kendi
512
+ * tablosuna yazar, akış `to.installations` verir. Proje türü gövdeden okunamaz; yalnız `to.users` yazılmış push
513
+ * adımında sorulur, okunamazsa susar.
514
+ */
515
+ export async function simpleProjectPushUserFindings(platform, project, environment, definition, policyOverride = false) {
516
+ if (platform.config.policyMode === 'off')
517
+ return [];
518
+ const steps = workflowSteps(definition).filter(step => {
519
+ const expression = asObject(step.rule)?.expression;
520
+ // İnceleme 2026-11-05: desen gövdedeki her `users:` anahtarını (ör. data: { users: n }) yakalıyordu; yalnız `to`
521
+ // nesnesinin içi aranır (bir düzey iç içe süslü parantez taşıyabilir).
522
+ const target = typeof expression === 'string' ? /(?<![\w$.])to\s*:\s*\{((?:[^{}]|\{[^{}]*\})*)\}/.exec(expression)?.[1] : undefined;
523
+ return step.type === 'push' && target !== undefined && /(?<![\w$.])users\s*:/.test(target);
524
+ });
525
+ if (steps.length === 0)
526
+ return [];
527
+ const context = await projectAccessContext(platform, project, environment);
528
+ if (context?.accessModel !== 'simple')
529
+ return [];
530
+ return applyPolicyMode(platform.config, steps.map(step => ({
531
+ ruleId: 'WF-042',
532
+ severity: 'warn',
533
+ message: `'${String(step.name ?? step.id ?? 'push')}' push adımı to.users veriyor ama proje simple erişim modelinde: uygulama oturumu çözülmez, telefon kullanıcıya bağlanmaz — to.users hiçbir cihaza ulaşmaz ve adım deviceCount: 0 ile başarı dalından sürer. Kendi kullanıcı tablonuzla hedefleyin: istemci Device.installationId'yi (kabuğun deviceInstallationId yeteneği; web önizlemede null) kendi satırına yazar, akış alıcının kurulum kimliklerini table/query adımıyla okuyup to.installations verir. Tarif: platform_guide('workflow') §Push adımı, ngapps://examples/workflow-push-own-profile.`,
534
+ guide: 'ngapps://guides/workflow'
535
+ })), policyOverride);
536
+ }
508
537
  /**
509
538
  * ACC-008: kompleks projede eski rol listeleri (`page.roleIds`, `microservice.roles`) karar girdisi
510
539
  * DEĞİLDİR — `enforce`'ta tek kapı PDP'dir (K-29). Liste yalnız `triggerSource.roles`'a geçer ve
@@ -389,7 +389,7 @@ export const componentKnowledge = {
389
389
  size: "'shrink' (çocuklar flex: 0 1 auto, varsayılan) | 'grow' (flex: 1 1 auto — çocuklar boşluğu paylaşır).",
390
390
  gap: "none | small | medium (varsayılan) | large → tema değişkenleri: 0 / var(--ng-spacing-sm) / --ng-spacing-md / --ng-spacing-lg (varsayılan temada 8/16/32px). Alan allowCustom'dır: '18px' ya da 'var(--ng-spacing-xl)' gibi ham CSS değeri de geçer. Çocuk genişlik formülünden payı düşülür, böylece w toplamı 12 olan satır tam kapanır.",
391
391
  wrap: "flex-wrap: wrap. Varsayılan AÇIK (2026-09-01'de flipledi): w:12 çocuklar alt satıra sararak dikey akar. Kapatırsan satıra sığmayan çocuklar sıkışır, alta inmez. AMA prop hiç yazılmamışsa SARMAZ (flex-layout.ts eksik wrap'i nowrap okur — varsayılan yalnız Studio'da sürüklenip kurulan düğüme materyalize olur): page_schema_patch ile kurduğun flex kapta sarma istiyorsan wrap:true'yu AÇIKÇA yaz. Studio paneli de 2026-09-30'dan beri eksik wrap'i 'kapalı', eksik layout'u 'Grid' gösterir (designer.absent, QA CT-001) — ekranla aynı.",
392
- title: "Varsayılanı boştur. isWrapper:false kapta yalnız açıkça doluysa başlık çizer; page_container'da ise dolu değer tarayıcı sekmesinin adını yazar (browserTitle).",
392
+ title: "Varsayılanı boştur. isWrapper:false kapta yalnız açıkça doluysa başlık çizer; page_container'da ise dolu değer tarayıcı sekmesinin adını yazar (browserTitle); uygulamanın sekme öneki (properties.web.browserTitle) varsa önüne gelir: \"IMS | <title>\".",
393
393
  description: "Başlığın ALTINDAKİ ikinci satır (2026-09-18): ikincil metin renginde, başlıktan küçük punto. Varsayılanı boştur ve boşken eleman hiç çizilmez, bandın yüksekliğini değiştirmez. Yalnız description yazmak başlık bandını açar (title boş kalabilir); sarmalayıcı kipte (page_container, yerleşim kökü) title gibi o da çizilmez. Kart başlığının altına açıklama yazmak için artık içine text bileşeni bırakmak gerekmez.",
394
394
  isLoading: "Gövdeyi 100px'e kısar, slot'u gizler ve spinner gösterir — ama YALNIZ çalışma anında ve önizlemede. Kanvasta (editör kipi) gövde kırpılmaz, yalnız yükleyici çizilir ve bırakma alanı çalışmaya devam eder (2026-09-18). page_container'da sayfa açılış akışının yükleniyor bayrağıdır; kanvas toolbar'ından tek tıkla açılır. Spinner gövdenin kendi kutusunu kaplayan katmanda ortalanır (2026-09-30, QA CT-002): önceden gizlenen çocukların boyuna göre ortalanıp alçak gövdede yarıdan kesiliyordu ve gövde 4px/2px kayıyordu.",
395
395
  isHidden: "Ortak katman görünürlüğü (RenderComponent okur): true iken düğüm ve bütün çocukları hiç çizilmez. Kanvas toolbar'ında tek tıkla açılır.",
@@ -323,11 +323,14 @@ export const componentEventContracts = {
323
323
  payload: {},
324
324
  reads: 'Butonun kendisine basılınca (menüyü açan/kapatan tıklama) yayılır — menü açılmasa bile. isDisabled/isLoading iken hiç yayılmaz. Menü SATIRI bu olayı yaymaz.'
325
325
  },
326
+ // DD-6 (plans/derdini-dok-platform-eksikleri f-04, 2026-11-05): yük düğüme yazılıyordu ama `params` gitmediği için
327
+ // event.data boştu; web DropdownButton.svelte + native dropdown-button-logic.ts artık params.data gönderir.
326
328
  clickItem: {
327
329
  payload: {
328
- currentItem: 'tıklanan menü öğesinin TAMAMI ({ key, text, icon, flow, isDanger, isDisabled… }) — akışta self.currentItem ile okunur'
330
+ currentItem: 'tıklanan menü öğesinin TAMAMI ({ key, text, icon, flow, isDanger, isDisabled… }) — event.data.currentItem ya da self.currentItem',
331
+ index: "number (öğenin options dizisindeki GERÇEK yeri; gizli öğe sırayı kaydırmaz, liste dizi değilse -1) — yalnız event.data'da"
329
332
  },
330
- reads: "Her satır tıklamasında yayılır. Satırın kendi flow'u (options[].flow) varsa o akış AYRICA çalışır ve aynı currentItem'ı görür; yani flow bağlı bir satır iki akış tetikleyebilir."
333
+ reads: "event.data.currentItem ve event.data.index ile oku; currentItem ayrıca self.currentItem'a yazılır, index self'e YAZILMAZ. selectedItem diye bir anahtar YOKTUR (o ad liste türlerinindir). Her satır tıklamasında yayılır. Satırın kendi flow'u (options[].flow) varsa o akış AYRICA çalışır ve aynı event.data'yı görür; yani flow bağlı bir satır iki akış tetikleyebilir."
331
334
  }
332
335
  },
333
336
  'confirm-bar': {
@@ -0,0 +1,72 @@
1
+ /**
2
+ * g-08 (derdini-dok DD-14, K5 — benzetim yok, görünür iz): mobil önizleme (Studio, react-native-web) cihaz davranışlarını
3
+ * benzetmez. Satırların sırası sabittir; metinler `platform_guide('mobile-steps')` §Önizleme sınırları ile aynıdır.
4
+ * Kaynak: f-07 (`share-unavailable`, `back-unavailable` — ng-apps-ui-native `runtime-tasks.ts`), page.md §Kural 1g-4
5
+ * (kuyruk ve `offlineQueueChange` önizlemede yok), mobil katalog `scroll-view` (`refreshable` → `refresh` olayı; RNW'de
6
+ * çekme jesti yok), mobile.md §Uzak push (kayıt ve izin cihazda).
7
+ */
8
+ const limits = [
9
+ {
10
+ feature: 'share',
11
+ stepType: 'share',
12
+ reason: "share adımı önizlemede paylaşım penceresi açamaz: runtimeErrors'a share-unavailable düşer, akış 'always' ile sürer. Pencere ve içerik cihazda doğrulanır."
13
+ },
14
+ {
15
+ feature: 'back',
16
+ stepType: 'back',
17
+ reason: "back adımı önizleme yığınının kökünde gidecek yer bulamaz: runtimeErrors'a back-unavailable düşer. Geri dönüşü önce ileri giden bir eylemle kurun ya da cihazda doğrulayın."
18
+ },
19
+ {
20
+ feature: 'push-permission',
21
+ stepType: 'notification-permission',
22
+ reason: 'notification-permission adımı önizlemede sistem izin penceresi açmaz ve cihaz push kaydı yapılmaz; izin ve bildirimin gelişi cihazda (dev build ya da mağaza sürümü) doğrulanır.'
23
+ },
24
+ {
25
+ feature: 'offline-queue',
26
+ event: 'offlineQueueChange',
27
+ reason: "Önizlemede yazma kuyruğu yoktur: offlineQueueChange hiç koşmaz, ağsız yazma 'error' dalından gider. Kuyruklu senaryo cihazda (uçak kipi) doğrulanır."
28
+ },
29
+ {
30
+ feature: 'pull-to-refresh',
31
+ event: 'refresh',
32
+ reason: 'refresh olayı (çekerek yenile) önizlemede tetiklenmez: react-native-web çekme jestini çizmez, page_screenshot bu jesti süremez. Cihazda doğrulanır.'
33
+ }
34
+ ];
35
+ /**
36
+ * Sayfanın runtime paketinde (GET /{app}/p/{slug} gövdesi; sayfa, layout ve gömülü akışlar) cihaz davranışı taşıyan
37
+ * adımları (`steps` + `errorSteps`) ve bağlı olayları (`events[].value` dolu) arar. Paketin şekli sabitlenmez: ağaç
38
+ * gezilir, yalnız `steps`/`errorSteps`/`events` dizileri okunur.
39
+ */
40
+ export function previewLimits(pagePackage) {
41
+ const stepTypes = new Set();
42
+ const events = new Set();
43
+ const pending = [pagePackage];
44
+ while (pending.length > 0) {
45
+ const value = pending.pop();
46
+ // İnceleme 2026-11-05: `push(...dizi)` argüman sınırını aşan dizide (büyük satır listesi) RangeError atıyordu.
47
+ if (Array.isArray(value)) {
48
+ for (const item of value)
49
+ pending.push(item);
50
+ continue;
51
+ }
52
+ if (!value || typeof value !== 'object')
53
+ continue;
54
+ const record = value;
55
+ for (const key of ['steps', 'errorSteps']) {
56
+ for (const step of Array.isArray(record[key]) ? record[key] : []) {
57
+ if (step && typeof step === 'object' && typeof step.type === 'string')
58
+ stepTypes.add(step.type);
59
+ }
60
+ }
61
+ for (const event of Array.isArray(record.events) ? record.events : []) {
62
+ const { name, value: flowId } = (event && typeof event === 'object' ? event : {});
63
+ if (typeof name === 'string' && typeof flowId === 'string' && flowId.trim() !== '')
64
+ events.add(name);
65
+ }
66
+ for (const key of Object.keys(record))
67
+ pending.push(record[key]);
68
+ }
69
+ return limits
70
+ .filter(limit => (limit.stepType !== undefined && stepTypes.has(limit.stepType)) || (limit.event !== undefined && events.has(limit.event)))
71
+ .map(limit => ({ feature: limit.feature, reason: limit.reason, verifyOn: 'device' }));
72
+ }
@@ -129,6 +129,125 @@ function literalShapeOf(expression) {
129
129
  return 'array';
130
130
  return undefined;
131
131
  }
132
+ function closingQuote(text, start) {
133
+ for (let index = start + 1; index < text.length; index++) {
134
+ if (text[index] === '\\')
135
+ index++;
136
+ else if (text[index] === text[start])
137
+ return index;
138
+ }
139
+ return -1;
140
+ }
141
+ /**
142
+ * İfade BÜTÜNÜYLE bir nesne literaliyse (`({ a: 1, 'b': x, ...y })`) üst düzey sabit anahtarları döner;
143
+ * değilse (`kayit.data`, `({ a }).a`, IIFE) `undefined` — anahtar kümesi çalışma anında belli olur.
144
+ * Hesaplanan (`[k]:`) ve yayılan (`...y`) anahtarlar sayılmaz. WF-040'ın tek okuyucusu.
145
+ */
146
+ export function objectLiteralKeys(expression) {
147
+ const text = expression.trim();
148
+ let index = 0;
149
+ let wrappers = 0;
150
+ while (text[index] === '(' || /\s/.test(text[index] ?? '')) {
151
+ if (text[index] === '(')
152
+ wrappers++;
153
+ index++;
154
+ }
155
+ if (text[index] !== '{')
156
+ return undefined;
157
+ const keys = [];
158
+ let depth = 0;
159
+ let expectKey = false;
160
+ for (; index < text.length; index++) {
161
+ const char = text.charAt(index);
162
+ if (depth === 1 && expectKey) {
163
+ if (/\s/.test(char))
164
+ continue;
165
+ expectKey = false;
166
+ const identifier = /^[A-Za-z_$][\w$]*/.exec(text.slice(index));
167
+ if (identifier) {
168
+ keys.push(identifier[0]);
169
+ index += identifier[0].length - 1;
170
+ continue;
171
+ }
172
+ if (char === '"' || char === "'") {
173
+ const end = closingQuote(text, index);
174
+ if (end < 0)
175
+ return undefined;
176
+ keys.push(text.slice(index + 1, end));
177
+ index = end;
178
+ continue;
179
+ }
180
+ }
181
+ if (char === '"' || char === "'" || char === '`') {
182
+ const end = closingQuote(text, index);
183
+ if (end < 0)
184
+ return undefined;
185
+ index = end;
186
+ }
187
+ else if (char === '{' || char === '(' || char === '[') {
188
+ depth++;
189
+ if (depth === 1)
190
+ expectKey = true;
191
+ }
192
+ else if (char === '}' || char === ')' || char === ']') {
193
+ depth--;
194
+ if (depth === 0)
195
+ break;
196
+ }
197
+ else if (char === ',' && depth === 1) {
198
+ expectKey = true;
199
+ }
200
+ }
201
+ if (depth !== 0)
202
+ return undefined;
203
+ const rest = text.slice(index + 1).replace(/;\s*$/, '').replace(/\s/g, '');
204
+ return rest === ')'.repeat(wrappers) ? keys : undefined;
205
+ }
206
+ /**
207
+ * 2xx gövdesi `returnDtoId` şemasından geçen response adımı: `httpStatusCode` boş/0 (platform 200 döner)
208
+ * ya da 200–299. 2xx dışı gövde DTO'suz değerlendirilir (ResponseStep.cs:62-69).
209
+ */
210
+ function isSuccessResponse(step) {
211
+ if (step.type !== 'response')
212
+ return false;
213
+ const status = Number((step.rule ?? {}).httpStatusCode ?? 0);
214
+ return !(status > 0) || (status >= 200 && status < 300);
215
+ }
216
+ const arrayReadingTableOperations = new Set(['get', 'update', 'delete', 'upsert']);
217
+ const arrayMembers = new Set(['length', 'map', 'filter', 'find', 'findIndex', 'forEach', 'some', 'every', 'reduce', 'slice', 'concat', 'includes', 'indexOf', 'join', 'flatMap', 'sort', 'at', 'reverse', 'entries', 'keys', 'values']);
218
+ /**
219
+ * Adımın `data`'sı DİZİ mi: tablo `get/update/delete/upsert` + `isSingle` true değil (TableStep.cs:245-246,279,293,420),
220
+ * özel sorgu + `queryOutputType` `array`/boş (PostgreSqlConnector.cs:345-354). Kayıtlı (library) sorgunun çıktı tipi
221
+ * sorgu kaydındadır, gövdeden görülmez — susar. Dönen metin bulgu mesajındaki gerekçe ve reçetedir.
222
+ */
223
+ function arrayOutputReason(step) {
224
+ const rule = (step.rule ?? {});
225
+ if (step.type === 'table') {
226
+ const operation = String(rule.operation ?? '').toLowerCase();
227
+ if (!arrayReadingTableOperations.has(operation) || rule.isSingle === true)
228
+ return undefined;
229
+ return { shape: `table ${operation} + isSingle: ${rule.isSingle === false ? 'false' : 'boş'}`, recipe: 'adımda isSingle: true verin (tek satır bekleniyorsa)' };
230
+ }
231
+ if (step.type === 'query' && String(rule.queryStepSourceType ?? '').toLowerCase() === 'custom') {
232
+ const outputType = String(rule.queryOutputType ?? '').toLowerCase();
233
+ if (outputType === 'object')
234
+ return undefined;
235
+ return { shape: `özel sorgu + queryOutputType: ${outputType === '' ? 'boş' : outputType}`, recipe: "adımda queryOutputType: 'object' verin (tek satır bekleniyorsa)" };
236
+ }
237
+ return undefined;
238
+ }
239
+ function stringLeaves(value) {
240
+ if (typeof value === 'string')
241
+ return [value];
242
+ if (Array.isArray(value))
243
+ return value.flatMap(stringLeaves);
244
+ if (value && typeof value === 'object')
245
+ return Object.values(value).flatMap(stringLeaves);
246
+ return [];
247
+ }
248
+ function escapeRegExp(text) {
249
+ return text.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
250
+ }
132
251
  /**
133
252
  * Start'tan başlayıp `global-error` dalları HARİÇ tüm dalları izleyerek erişilen adımlar.
134
253
  * Gateway her `workflow`/`middleware` tanımına global-error dalının ucunda bir `response` adımı
@@ -768,7 +887,7 @@ export const policyRules = [
768
887
  return [{
769
888
  ruleId: 'MS-018',
770
889
  severity: 'block',
771
- message: `Uç komutunda DTO sözleşmesi alanı YOK — gövdeye yazılan ${written.join(', ')} platforma gitse 200 dönerdi ve alan SESSİZCE düşerdi; uç sözleşmesiz kalır (ölçüldü 2026-09-09, S-2). table/query/view kaynaklı ucun yanıt şekli kaynağın KENDİSİNDEN türer (selectFields / sorgunun returnScheme'i / view indeksi); açık yanıt sözleşmesi WORKFLOW kavramıdır. Reçete: ucu source:'workflow' + workflowId ile kurun, DTO'yu workflow'a bağlayın — ${patch}. WF-002: type:'workflow' akışta returnDtoId ZORUNLUDUR, returnBehavior'ı boş bırakırsanız gateway 'object' ile doldurur. Sözleşme yalnız 2xx yanıtlarda uygulanır (WF-026). Uç gövdesinden bu alanları çıkarıp yeniden çağırın.`,
890
+ message: `Uç komutunda DTO sözleşmesi alanı YOK — gövdeye yazılan ${written.join(', ')} platforma gitse 200 dönerdi ve alan SESSİZCE düşerdi; uç sözleşmesiz kalır (ölçüldü 2026-09-09, S-2). table/query/view kaynaklı ucun yanıt şekli kaynağın KENDİSİNDEN türer (selectFields / sorgunun returnScheme'i / view indeksi); açık yanıt sözleşmesi WORKFLOW kavramıdır. Reçete: ucu source:'workflow' + workflowId ile kurun, DTO'yu workflow'a bağlayın — ${patch}. WF-002: başarı yolunda 2xx response adımı olan type:'workflow' akışta returnDtoId ZORUNLUDUR (yanıtsız akış muaf), returnBehavior'ı boş bırakırsanız gateway 'object' ile doldurur. Sözleşme yalnız 2xx yanıtlarda uygulanır (WF-026). Uç gövdesinden bu alanları çıkarıp yeniden çağırın.`,
772
891
  guide: 'ngapps://guides/microservice'
773
892
  }];
774
893
  }
@@ -911,15 +1030,15 @@ export const policyRules = [
911
1030
  id: 'WF-002',
912
1031
  module: 'workflow',
913
1032
  appliesTo: ['create', 'update'],
914
- sourceRef: 'KAPI testi; iş kuralı: workflow tipinde ReturnDto zorunlu (automation/middleware muaf)',
1033
+ sourceRef: "KAPI testi; iş kuralı: yanıt gövdesi üreten workflow'da ReturnDto zorunlu (automation/middleware muaf). DD-20 · K8 (derdini-dok, 2026-11-05): yalnız başarı yolunda 2xx response adımı varsa — schedule-job'un çağırdığı ya da iç alt akış yanıt üretmez, zamanlayıcı gövdeyi kullanmaz (MicroserviceJob.cs:102-113), backend zorunlu tutmaz (CreateWorkflowCommand.cs:44-49); gateway'in global-error dalına eklediği 500 response sayılmaz",
915
1034
  check: (definition, context) => {
916
1035
  const body = workflowBody(definition, context.workflowKind);
917
1036
  const kind = context.workflowKind ?? body.type;
918
- if (kind === 'workflow' && !body.returnDtoId) {
1037
+ if (kind === 'workflow' && !body.returnDtoId && successPathSteps(workflowSteps(body)).some(isSuccessResponse)) {
919
1038
  return [{
920
1039
  ruleId: 'WF-002',
921
1040
  severity: 'block',
922
- message: "type='workflow' için returnDtoId zorunludur (backend nullable bırakır ama iş kuralı zorunlu; automation ve middleware muaftır). Önce DataTransferObject oluşturup id'sini returnDtoId'ye verin.",
1041
+ message: "Başarı yolunda 2xx yanıt döndüren response adımı olan type='workflow' akışında returnDtoId zorunludur (backend nullable bırakır ama iş kuralı zorunlu; automation ve middleware muaftır). Önce DataTransferObject oluşturup id'sini returnDtoId'ye verin. Başarı yolunda response adımı olmayan akış (zamanlanmış işin ya da başka akışın gövdesini kullanmadan çağırdığı) muaftır.",
923
1042
  guide: 'ngapps://guides/workflow'
924
1043
  }];
925
1044
  }
@@ -966,6 +1085,91 @@ export const policyRules = [
966
1085
  return [];
967
1086
  }
968
1087
  },
1088
+ {
1089
+ id: 'WF-039',
1090
+ module: 'workflow',
1091
+ appliesTo: ['create', 'update', 'preview'],
1092
+ sourceRef: "DD-18 (derdini-dok, 2026-11-05) + 09-04 Y-15 / 09-05 S-5: tablo adımı isSingle'a göre nesne/dizi döndürür (TableStep.cs:245-246,279,293,420), özel sorgu queryOutputType'a göre (PostgreSqlConnector.cs:345-354, boş = dizi). Diziye <adım>.data.<alan> undefined döner; sonraki yazma NULL yazar ya da RowValidationFailed ile düşer ve hata şekli söylemez. İfade aynı adımın .data[…] ya da .data.length'ine de bakıyorsa şekli zaten ele alıyordur — susar",
1093
+ check: (definition, context) => {
1094
+ const steps = workflowSteps(workflowBody(definition, context.workflowKind));
1095
+ const findings = [];
1096
+ const seen = new Set();
1097
+ for (const producer of steps) {
1098
+ const reason = arrayOutputReason(producer);
1099
+ const name = String(producer.name ?? '');
1100
+ if (!reason || !/^[A-Za-z_$][\w$]*$/.test(name))
1101
+ continue;
1102
+ const escaped = escapeRegExp(name);
1103
+ const read = new RegExp(`(?<![\\w$.])${escaped}\\.data\\.([A-Za-z_$][\\w$]*)`, 'g');
1104
+ const shapeAware = new RegExp(`(?<![\\w$.])${escaped}\\.data(\\s*\\[|\\.length\\b)`);
1105
+ for (const reader of steps) {
1106
+ for (const expression of stringLeaves(reader.rule)) {
1107
+ if (shapeAware.test(expression))
1108
+ continue;
1109
+ for (const match of expression.matchAll(read)) {
1110
+ const field = match[1] ?? '';
1111
+ const key = `${stepLabel(reader)}|${name}|${field}`;
1112
+ if (arrayMembers.has(field) || seen.has(key))
1113
+ continue;
1114
+ seen.add(key);
1115
+ findings.push({
1116
+ ruleId: 'WF-039',
1117
+ severity: 'warn',
1118
+ message: `'${stepLabel(reader)}' adımının ifadesi ${name}.data.${field} okuyor ama '${name}' adımı (${reason.shape}) DİZİ döndürür: ${name}.data.${field} undefined olur; sonraki yazma NULL yazar ya da adım RowValidationFailed / 23502 ile düşer ve hata şekli söylemez. Ya ${name}.data[0].${field} yazın ya da ${reason.recipe}. Şekli bilmiyorsanız platform_guide('workflow') §Table step kuralları'ndaki savunmalı yazımı kullanın.`,
1119
+ guide: 'ngapps://guides/workflow'
1120
+ });
1121
+ }
1122
+ }
1123
+ }
1124
+ }
1125
+ return findings;
1126
+ }
1127
+ },
1128
+ {
1129
+ id: 'WF-041',
1130
+ module: 'workflow',
1131
+ appliesTo: ['create', 'update', 'preview'],
1132
+ sourceRef: "DD-2 (derdini-dok, 2026-11-05): crypto.SHA256.encode = Hasher.Hash = PBKDF2-HMAC-SHA512, tuz = girdi, 350 000 tur, 128 büyük harf hex (WorkflowContext.cs:422-425, Hasher.cs:8-23) — platformun parola özeti; dışarıda üretilen SHA-256 ile eşleşmez. Standart özet crypto.hash.sha256/sha512, HMAC crypto.hmac.sha256 (b-02). Parola doğrulaması (alanla karşılaştırma) ve platformun 128 haneli özeti susar",
1133
+ check: (definition, context) => {
1134
+ const findings = [];
1135
+ for (const step of workflowSteps(workflowBody(definition, context.workflowKind))) {
1136
+ const flagged = stringLeaves(step.rule).some(expression => {
1137
+ const calls = [...expression.matchAll(/SHA256\s*\.\s*encode\s*\(/g)];
1138
+ // İnceleme 2026-11-05: ifadenin herhangi bir yerindeki 64 haneli hex sabit uyarı veriyordu; yalnız çağrının
1139
+ // karşılaştırma işleneni sayılır.
1140
+ if (calls.length === 0)
1141
+ return false;
1142
+ return calls.some(call => {
1143
+ let depth = 0;
1144
+ let close = -1;
1145
+ for (let index = (call.index ?? 0) + call[0].length - 1; index < expression.length; index += 1) {
1146
+ if (expression[index] === '(')
1147
+ depth += 1;
1148
+ if (expression[index] === ')')
1149
+ depth -= 1;
1150
+ if (depth === 0) {
1151
+ close = index;
1152
+ break;
1153
+ }
1154
+ }
1155
+ const start = (call.index ?? 0) - (/crypto\s*\.\s*$/.exec(expression.slice(0, call.index))?.[0].length ?? 0);
1156
+ const literal = (close === -1 ? undefined : /^\s*[!=]==?\s*(['"`])((?:(?!\1).)*)\1/.exec(expression.slice(close + 1))?.[2])
1157
+ ?? /(['"`])((?:(?!\1).)*)\1\s*[!=]==?\s*$/.exec(expression.slice(0, start))?.[2];
1158
+ return literal !== undefined && !/^[0-9A-F]{128}$/.test(literal);
1159
+ });
1160
+ });
1161
+ if (!flagged)
1162
+ continue;
1163
+ findings.push({
1164
+ ruleId: 'WF-041',
1165
+ severity: 'warn',
1166
+ message: `'${stepLabel(step)}' adımı crypto.SHA256.encode sonucunu bir sabitle ya da 64 haneli hex özetle karşılaştırıyor: SHA256.encode adına rağmen SHA-256 DEĞİLDİR — platformun parola özetidir (PBKDF2-HMAC-SHA512, tuz = girdi, 128 büyük harf hex) ve dışarıda üretilen hiçbir özetle eşleşmez. Standart özet için crypto.hash.sha256(metin) / crypto.hash.sha512(metin) (UTF-8, küçük harf hex), imza doğrulaması için crypto.hmac.sha256(anahtar, metin) kullanın. SHA256.encode yalnız platformun kendi sakladığı parola özetiyle karşılaştırılır.`,
1167
+ guide: 'ngapps://guides/expressions'
1168
+ });
1169
+ }
1170
+ return findings;
1171
+ }
1172
+ },
969
1173
  {
970
1174
  id: 'WF-005',
971
1175
  module: 'workflow',
@@ -4385,3 +4589,51 @@ export async function undefinedInputFieldFindings(platform, project, environment
4385
4589
  });
4386
4590
  return applyPolicyMode(platform.config, findings, policyOverride);
4387
4591
  }
4592
+ /**
4593
+ * WF-040 — başarı yolundaki 2xx response adımının gövdesi nesne literaliyse ve bir anahtarı akışın dönüş DTO'sunda
4594
+ * (`returnDtoId`) yoksa uyarır. Platform 2xx gövdeyi DTO şemasından geçirir ve tanımsız anahtarı iz bırakmadan siler
4595
+ * (`DataTransferObjectValue.IgnoreFieldsNotInSchema` :206-208, DD-19 derdini-dok 2026-11-05). Şemanın üst düzeyinde
4596
+ * `file` tipli alan varsa o düzeyde hiçbir anahtar silinmez (:206) ve şema çocuksuzsa süzme yoktur — iki durumda da
4597
+ * susar. Dinamik gövdede (nesne literali değil), dizi davranışlı dönüşte ve şema okunamazsa (WF-031 gerekçesi) susar.
4598
+ * Şema `/datatransferobjects/{id}/scheme` yolları `a`, `a.b` biçiminde döner; üst düzey anahtar noktasız addır.
4599
+ */
4600
+ export async function responseDtoFieldFindings(platform, project, environment, definition, kind, policyOverride = false) {
4601
+ if (platform.config.policyMode === 'off')
4602
+ return [];
4603
+ const body = workflowBody(definition, kind);
4604
+ if (!hasText(body.returnDtoId) || String(body.returnBehavior ?? '').toLowerCase() === 'array')
4605
+ return [];
4606
+ const candidates = successPathSteps(workflowSteps(body))
4607
+ .filter(isSuccessResponse)
4608
+ .map(step => ({ step, keys: objectLiteralKeys(String((step.rule ?? {}).bodyExpression ?? '')) }))
4609
+ .filter((candidate) => candidate.keys !== undefined && candidate.keys.length > 0);
4610
+ if (candidates.length === 0)
4611
+ return [];
4612
+ let topLevel;
4613
+ try {
4614
+ const payload = await platform.tenant('GET', project, `/datatransferobjects/${String(body.returnDtoId)}/scheme`, { environment });
4615
+ topLevel = asArray(payload?.data ?? payload)
4616
+ .filter((item) => Boolean(item) && typeof item === 'object')
4617
+ .filter(item => hasText(item.name) && !String(item.name).includes('.'));
4618
+ }
4619
+ catch (error) {
4620
+ if (error instanceof PlatformApiError)
4621
+ return [];
4622
+ throw error;
4623
+ }
4624
+ if (topLevel.length === 0 || topLevel.some(item => String(item.type ?? '').toLowerCase() === 'file'))
4625
+ return [];
4626
+ const declared = new Set(topLevel.map(item => String(item.name)));
4627
+ const findings = candidates.flatMap(({ step, keys }) => {
4628
+ const missing = [...new Set(keys.filter(key => !declared.has(key)))];
4629
+ return missing.length > 0
4630
+ ? [{
4631
+ ruleId: 'WF-040',
4632
+ severity: 'warn',
4633
+ message: `'${stepLabel(step)}' adımının gövdesi ${missing.join(', ')} anahtarlarını döndürüyor ama akışın dönüş DTO'sunda (returnDtoId: ${String(body.returnDtoId)}) bu alanlar YOK: platform 2xx gövdeyi DTO şemasından geçirir ve tanımsız anahtarı iz bırakmadan siler — istemci alanı hiç görmez, yanıt yine 200. Alanı DTO'ya ekleyin (dto_update) ya da gövdeden çıkarın. workflow_preview'da response adımının meta'sı düşen yolları droppedFields olarak gösterir (bu alanı taşıyan backend'de).`,
4634
+ guide: 'ngapps://guides/workflow'
4635
+ }]
4636
+ : [];
4637
+ });
4638
+ return applyPolicyMode(platform.config, findings, policyOverride);
4639
+ }
@@ -41,6 +41,28 @@ export function importReportOutline(record, section) {
41
41
  appliedAt: record.appliedAt
42
42
  };
43
43
  }
44
+ /**
45
+ * Backend `MobileStoreImportConstants.Issue*` kimlik satırları (b-05, DD-15): Zeyrek'in mağazadan okuyamadığı gizli bilgi.
46
+ * Yükleme insanın işidir (Studio › Yayın › Hesaplar ve kimlik bilgileri); metin EAS ile yayınlanmış uygulamada nereden
47
+ * alınacağını da söyler (`platform_guide('mobile-publish')` §Mağazadan taşıma).
48
+ */
49
+ const CREDENTIAL_FIXES = {
50
+ keystore_missing: "Android upload anahtarı Zeyrek'te yok: eski derleme EAS ile yapıldıysa `eas credentials -p android` → upload keystore'u indirin (anahtar ve parolalarıyla) ve Studio › Yayın › Hesaplar ve kimlik bilgileri'ne yükleyin; keystore yoksa Play Console'da upload anahtarı sıfırlama isteyin. Yüklenmeden Play'e derleme gönderilemez (P-27).",
51
+ push_key_missing: "Bundle'da push açık ama Zeyrek'te Apple push anahtarı (.p8, APNs) yok: Apple Developer › Keys'te yeni bir APNs anahtarı üretin (EAS'ın anahtarı varsa `eas credentials -p ios` hangi anahtarın kullanıldığını gösterir; .p8 yalnız üretimde bir kez indirilir) ve Studio'ya yükleyin. Yüklenmezse derleme push'suz çıkar (P-11 push_expected).",
52
+ push_unverified: "Push hazırlığı doğrulanamadı: uygulama push kullanıyorsa iOS'ta APNs .p8 anahtarını, Android'de Firebase konsolundan google-services.json'u ve FCM v1 için yeni bir hizmet hesabı anahtarını Studio › Yayın › Hesaplar ve kimlik bilgileri'ne yükleyin; kullanmıyorsa satırı yok sayın."
53
+ };
54
+ /** Bağla yanıtının `connection.credentials` satırları: alan, mağaza, kova, kod, eksik parçalar ve düzeltme yeri. */
55
+ export function importCredentialsOutline(connection) {
56
+ const rows = isObject(connection) ? items(connection.credentials) : [];
57
+ return rows.flatMap(row => (Array.isArray(row.issues) ? row.issues : []).filter((issue) => typeof issue === 'string').map(issue => ({
58
+ field: row.field,
59
+ store: row.store,
60
+ bucket: row.bucket,
61
+ issue,
62
+ ...(typeof row.suggestion === 'string' && row.suggestion !== '' ? { missing: row.suggestion } : {}),
63
+ fix: CREDENTIAL_FIXES[issue] ?? "Gizli bilgi eksik: Studio › Yayın › Hesaplar ve kimlik bilgileri'nde tamamlanır (MCP yazmaz)."
64
+ })));
65
+ }
44
66
  /** Fark: değişmeyen satırlar sayılır, gösterilmez; çakışmalar ve gönderilecek alanlar ayrı listelenir. */
45
67
  export function diffOutline(diff) {
46
68
  const rows = items(diff.rows);
@@ -1,8 +1,8 @@
1
- import { open, realpath, stat } from 'node:fs/promises';
2
- import { constants } from 'node:fs';
3
- import { dirname, extname, isAbsolute, resolve, sep } from 'node:path';
1
+ import { realpath } from 'node:fs/promises';
2
+ import { dirname, isAbsolute, resolve } from 'node:path';
4
3
  import { z } from 'zod';
5
4
  import { PlatformApiError } from './errors.js';
5
+ import { allowedRoots, localBase, readLocalFile } from './localFiles.js';
6
6
  /**
7
7
  * g-08 (`plans/mobil-plantcare-acigi`): tanım yazan araçlar gövdeyi dosyadan alabilir. Koşuda en
8
8
  * büyük bağlam tasarrufu, ajanın kendi yazdığı "dosyadan MCP'ye" betiğinden geldi; o iş buraya
@@ -54,9 +54,14 @@ export async function loadBodyFile(tool, args, config) {
54
54
  }
55
55
  // g-21 (D-21): göreli yol gateway sürecinin çalışma dizinine göre çözülüyordu ve ajan o dizini bilmez. Ajanın
56
56
  // bildiği kök .env'deki MCP_INPUT_DIR'dir; tanımsızsa eski davranış (çalışma dizini) sürer.
57
- const base = config.inputDirectory ? { source: 'MCP_INPUT_DIR', path: resolve(config.inputDirectory) } : { source: 'cwd', path: process.cwd() };
57
+ const base = localBase(config);
58
58
  const roots = await allowedRoots(config);
59
- const body = await readGuardedFile(tool, 'bodyFile', resolve(base.path, bodyFile), ['.json'], maxBodyFileBytes, roots, config);
59
+ const body = await readLocalFile(tool, bodyFile, {
60
+ label: 'bodyFile',
61
+ extensions: ['.json'],
62
+ maxBytes: maxBodyFileBytes,
63
+ tooLarge: () => "5 MB sınırını aşıyor. Tanımı parçalara bölün — sayfa için page_schema_patch'e birden çok batch, akış için flow_patch."
64
+ }, config, roots);
60
65
  let value;
61
66
  try {
62
67
  value = JSON.parse(body.buffer.toString('utf8'));
@@ -78,85 +83,6 @@ export async function loadBodyFile(tool, args, config) {
78
83
  }
79
84
  };
80
85
  }
81
- /** MCP_INPUT_DIR önce gelir: dosya iki kökün de altındaysa yanıt ajanın bildiği kökü söyler. */
82
- async function allowedRoots(config) {
83
- const candidates = [
84
- ...(config.inputDirectory ? [{ source: 'MCP_INPUT_DIR', path: config.inputDirectory }] : []),
85
- { source: 'cwd', path: process.cwd() }
86
- ];
87
- const resolved = await Promise.all(candidates.map(async (root) => ({ source: root.source, path: await realpath(resolve(root.path)).catch(() => undefined) })));
88
- return resolved.filter((root) => root.path !== undefined);
89
- }
90
- /**
91
- * bodyFile'ın ve her `$file` eklemesinin ORTAK okuma kapısı: uzantı (yol ve bağın hedefi), izinli kök, düzenli dosya
92
- * ve bayt sınırı. O_NONBLOCK FIFO'nun çağrıyı bekletmesini önler; boyut dosyanın büyüklüğüne değil okunan bayta bakar.
93
- *
94
- * `realpath` ile `open` atomik DEĞİLDİR: O_NOFOLLOW yalnız SON bileşenin sonradan bağa çevrilmesini önler, yolun
95
- * ortasındaki bir klasör denetimden sonra dışarıyı gösteren bağa çevrilirse `open` dışarıdaki dosyayı açar (g-22
96
- * incelemesi, `test/body-file-race.test.ts`). Açtıktan sonra tutamacın aygıt/düğümü yolun taze `stat`'ıyla
97
- * karşılaştırılır ve `realpath` yeniden koşturulur: yol aynı yere çözülmüyor ya da izinli kökün dışına düşüyorsa okuma
98
- * reddedilir. Bu pencereyi DARALTIR, kapatmaz — iki denetim arasında geri çevrilen bir bağ yine görülmez; tam çözüm
99
- * (`openat2` RESOLVE_BENEATH) Node'da yoktur. Okunan bayt yine de açılan tutamaçtan gelir.
100
- */
101
- async function readGuardedFile(tool, label, absolute, extensions, maxBytes, roots, config, tooLarge) {
102
- const accepted = extensions.join(', ');
103
- if (!extensions.includes(extname(absolute).toLowerCase())) {
104
- throw new PlatformApiError(`${tool}: ${label} yalnız ${accepted} okur — verilen: ${absolute}. İstek gönderilmedi.`, 400);
105
- }
106
- let real;
107
- try {
108
- real = await realpath(absolute);
109
- }
110
- catch (error) {
111
- throw new PlatformApiError(`${tool}: ${label} okunamadı — ${absolute} (${error instanceof Error ? error.message : String(error)}). Yol gateway sürecinin çalıştığı makineye göre çözülür. İstek gönderilmedi.`, 400);
112
- }
113
- if (!extensions.includes(extname(real).toLowerCase())) {
114
- throw new PlatformApiError(`${tool}: ${label} hedefi ${accepted} değil — ${real} (${absolute} bağının hedefi). İstek gönderilmedi.`, 400);
115
- }
116
- const root = roots.find(candidate => real === candidate.path || real.startsWith(`${candidate.path}${sep}`));
117
- if (!root) {
118
- throw new PlatformApiError(`${tool}: ${label} izinli dizinlerin dışında — ${real}${real !== absolute ? ` (${absolute} bağının hedefi)` : ''}. Gateway yalnız çalışma dizininin (${process.cwd()}) ve .env'deki MCP_INPUT_DIR'in (${config.inputDirectory ?? 'tanımsız'}) altındaki dosyaları okur. İstek gönderilmedi.`, 400);
119
- }
120
- let handle;
121
- try {
122
- handle = await open(real, constants.O_RDONLY | constants.O_NOFOLLOW | constants.O_NONBLOCK);
123
- }
124
- catch (error) {
125
- throw new PlatformApiError(`${tool}: ${label} açılamadı — ${real} (${error instanceof Error ? error.message : String(error)}). İstek gönderilmedi.`, 400);
126
- }
127
- try {
128
- const info = await handle.stat();
129
- if (!info.isFile()) {
130
- throw new PlatformApiError(`${tool}: ${label} düzenli dosya değil — ${real}. İstek gönderilmedi.`, 400);
131
- }
132
- const fresh = await stat(real).catch(() => undefined);
133
- const again = await realpath(absolute).catch(() => undefined);
134
- const stillInside = again !== undefined && (again === root.path || again.startsWith(`${root.path}${sep}`));
135
- if (!fresh || fresh.dev !== info.dev || fresh.ino !== info.ino || again !== real || !stillInside) {
136
- throw new PlatformApiError(`${tool}: ${label} yolu denetimden sonra değişti — ${real} artık ${again ?? 'çözülemeyen bir yere'} gösteriyor (araya bir bağ girdi). Okunmadı. İstek gönderilmedi.`, 400);
137
- }
138
- const buffer = Buffer.alloc(maxBytes + 1);
139
- let bytesRead = 0;
140
- // Tek `read` dosyanın tamamını döndürmek zorunda değildir; EOF'a ya da sınırın bir baytı ötesine kadar okunur.
141
- while (bytesRead < buffer.length) {
142
- const chunk = await handle.read(buffer, bytesRead, buffer.length - bytesRead, bytesRead);
143
- if (chunk.bytesRead === 0)
144
- break;
145
- bytesRead += chunk.bytesRead;
146
- }
147
- if (bytesRead > maxBytes) {
148
- if (tooLarge)
149
- throw new PlatformApiError(`${tool}: ${label} ${tooLarge} İstek gönderilmedi.`, 400);
150
- throw new PlatformApiError(maxBytes === maxBodyFileBytes
151
- ? `${tool}: ${label} 5 MB sınırını aşıyor. Tanımı parçalara bölün — sayfa için page_schema_patch'e birden çok batch, akış için flow_patch. İstek gönderilmedi.`
152
- : `${tool}: ${label} ${maxBytes / (1024 * 1024)} MB sınırını aşıyor — ${real}. Kodu birden çok dosyaya bölün. İstek gönderilmedi.`, 400);
153
- }
154
- return { real, root, buffer: buffer.subarray(0, bytesRead) };
155
- }
156
- finally {
157
- await handle.close();
158
- }
159
- }
160
86
  /** Kök JSON Pointer'ı boş dizgidir; mesajda `''` ile `/` (adı boş anahtar) karışmasın diye adıyla yazılır. */
161
87
  function pointerLabel(at) {
162
88
  return at === '' ? '(kök)' : at;
@@ -245,7 +171,12 @@ async function includeFiles(tool, value, folder, bodyBytes, roots, config) {
245
171
  let total = bodyBytes;
246
172
  for (const site of sites) {
247
173
  const label = `$file (${pointerLabel(site.at)} → '${site.file}')`;
248
- const read = await readGuardedFile(tool, label, resolve(folder, site.file), includedExtensions, maxIncludedFileBytes, roots, config);
174
+ const read = await readLocalFile(tool, resolve(folder, site.file), {
175
+ label,
176
+ extensions: includedExtensions,
177
+ maxBytes: maxIncludedFileBytes,
178
+ tooLarge: real => `${maxIncludedFileBytes / (1024 * 1024)} MB sınırını aşıyor — ${real}. Kodu birden çok dosyaya bölün.`
179
+ }, config, roots);
249
180
  total += read.buffer.length;
250
181
  if (total > maxBodyFileBytes) {
251
182
  throw new PlatformApiError(`${tool}: bodyFile ve $file eklemeleri birlikte 5 MB toplam gövde sınırını aşıyor (${pointerLabel(site.at)} eklemesinde). Tanımı parçalara bölün. İstek gönderilmedi.`, 400);
@@ -279,7 +210,11 @@ export async function loadCodeFile(tool, args, config) {
279
210
  if (rest.code !== undefined) {
280
211
  throw new PlatformApiError(`${tool}: codeFile ile 'code' birlikte verilemez — kod ya dosyadan ya satır içinden gelir. Birini kaldırın. İstek gönderilmedi.`, 400);
281
212
  }
282
- const base = config.inputDirectory ? resolve(config.inputDirectory) : process.cwd();
283
- const code = await readGuardedFile(tool, 'codeFile', resolve(base, codeFile), ['.js', '.py'], maxCodeFileBytes, await allowedRoots(config), config, "512 KB inline sınırını (backend MaxInlineCodeBytes) aşıyor. Paketi küçültün (minify, yinelenen bağımlılık) ya da sourceKind: 'archive' ile zip'i Studio'dan yükleyin.");
213
+ const code = await readLocalFile(tool, codeFile, {
214
+ label: 'codeFile',
215
+ extensions: ['.js', '.py'],
216
+ maxBytes: maxCodeFileBytes,
217
+ tooLarge: () => "512 KB inline sınırını (backend MaxInlineCodeBytes) aşıyor. Paketi küçültün (minify, yinelenen bağımlılık) ya da sourceKind: 'archive' ile zip'i Studio'dan yükleyin."
218
+ }, config);
284
219
  return { args: { ...rest, code: code.buffer.toString('utf8') }, note: `${code.real} → code (${code.buffer.length} B)` };
285
220
  }