@appaflytech/zeyrek-ai-mcp 0.0.32 → 0.0.33
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/.env.example +15 -0
- package/dist/config.js +11 -0
- package/dist/index.js +2 -0
- package/dist/knowledge/access.js +802 -0
- package/dist/knowledge/case.js +41 -0
- package/dist/knowledge/componentCatalog.js +82 -213
- package/dist/knowledge/componentEvents.js +21 -19
- package/dist/knowledge/connectDataBind.js +819 -0
- package/dist/knowledge/connectDataDefinition.js +341 -0
- package/dist/knowledge/connectDataExecute.js +93 -0
- package/dist/knowledge/connectDataRules.js +128 -0
- package/dist/knowledge/decision.js +121 -0
- package/dist/knowledge/expressionPrelude.js +59 -0
- package/dist/knowledge/layoutSummary.js +140 -2
- package/dist/knowledge/microserviceParameters.js +58 -0
- package/dist/knowledge/mining.js +94 -0
- package/dist/knowledge/mobileComponentCatalog.js +864 -0
- package/dist/knowledge/mobileComponentEvents.js +239 -0
- package/dist/knowledge/mobileStore.js +227 -0
- package/dist/knowledge/normalize.js +121 -35
- package/dist/knowledge/platform/lint.js +385 -0
- package/dist/knowledge/platform/mobile.js +142 -0
- package/dist/knowledge/platform/mobileLayoutLint.js +324 -0
- package/dist/knowledge/platform/mobileRules.js +231 -0
- package/dist/knowledge/platform/mobileSpacing.js +82 -0
- package/dist/knowledge/platform/mobileTabs.js +108 -0
- package/dist/knowledge/platform/nativeBoxModel.js +44 -0
- package/dist/knowledge/platform/profile.js +25 -0
- package/dist/knowledge/platform/resolve.js +122 -0
- package/dist/knowledge/platform/web.js +39 -0
- package/dist/knowledge/process.js +510 -0
- package/dist/knowledge/rowFilter.js +43 -0
- package/dist/knowledge/rules.js +291 -19
- package/dist/knowledge/styleResolve.js +55 -38
- package/dist/knowledge/styleResolveNative.js +527 -0
- package/dist/knowledge/themeResolve.js +3 -3
- package/dist/observability/trace.js +1 -1
- package/dist/platform/argumentAliases.js +128 -0
- package/dist/platform/bodyFile.js +103 -0
- package/dist/platform/capture/actions.js +333 -0
- package/dist/platform/capture/browser.js +1 -0
- package/dist/platform/{screenshot.js → capture/capture.js} +81 -519
- package/dist/platform/capture/console-log.js +122 -0
- package/dist/platform/capture/index.js +11 -0
- package/dist/platform/capture/readiness.js +103 -0
- package/dist/platform/capture/summary.js +77 -0
- package/dist/platform/capture/target.js +5 -0
- package/dist/platform/capture/targets/studio-mobile.js +15 -0
- package/dist/platform/capture/targets/studio-web.js +5 -0
- package/dist/platform/diagnostics.js +10 -4
- package/dist/platform/domSummary.js +1 -1
- package/dist/platform/http.js +23 -7
- package/dist/platform/impersonation.js +45 -0
- package/dist/platform/jsonArray.js +24 -0
- package/dist/platform/responses.js +6 -2
- package/dist/platform/schemaReadMemory.js +60 -0
- package/dist/platform/secrets.js +9 -0
- package/dist/platform/strictArguments.js +68 -12
- package/dist/platform/tokenVault.js +187 -4
- package/dist/resources/examples/bpm-gorev-kontrol.json +294 -0
- package/dist/resources/examples/bpm-iso-dokuman.json +228 -0
- package/dist/resources/examples/bpm-satinalma.json +376 -0
- package/dist/resources/examples/connect-data-convert-verify.json +107 -0
- package/dist/resources/examples/connect-data-dropdown-roles.json +66 -0
- package/dist/resources/examples/connect-data-edit-m2m.json +73 -0
- package/dist/resources/examples/connect-data-query-params.json +50 -0
- package/dist/resources/examples/connect-data-table-entity.json +147 -0
- package/dist/resources/examples/connect-data-workflow-microservice.json +65 -0
- package/dist/resources/examples/layout-app-shell.json +229 -707
- package/dist/resources/examples/mobile-app-shell-drawer.json +244 -0
- package/dist/resources/examples/mobile-app-shell-stack.json +157 -0
- package/dist/resources/examples/mobile-app-shell-tab.json +208 -0
- package/dist/resources/examples/mobile-form-screen.json +365 -0
- package/dist/resources/examples/mobile-list-detail-form.json +703 -0
- package/dist/resources/examples/page-flex-sections.json +1 -1
- package/dist/resources/guides/access.md +796 -0
- package/dist/resources/guides/bpm.md +686 -0
- package/dist/resources/guides/case.md +153 -0
- package/dist/resources/guides/component.md +10 -2
- package/dist/resources/guides/decision.md +185 -0
- package/dist/resources/guides/expressions.md +14 -5
- package/dist/resources/guides/functions.md +1 -1
- package/dist/resources/guides/layout.md +55 -58
- package/dist/resources/guides/microservice.md +9 -2
- package/dist/resources/guides/middleware.md +34 -2
- package/dist/resources/guides/mobile-layout.md +193 -0
- package/dist/resources/guides/mobile.md +578 -0
- package/dist/resources/guides/page.md +221 -92
- package/dist/resources/guides/theme.md +8 -2
- package/dist/resources/guides/translation.md +1 -1
- package/dist/resources/guides/workflow.md +7 -1
- package/dist/resources/read.js +41 -0
- package/dist/resources/schema-fingerprint.json +4 -4
- package/dist/resources/schemas/AccessExplanationDto.json +144 -0
- package/dist/resources/schemas/AccessMatrixDto.json +170 -0
- package/dist/resources/schemas/AccessPermissionDto.json +57 -0
- package/dist/resources/schemas/AccessPolicyDto.json +223 -0
- package/dist/resources/schemas/AccessResourceDto.json +86 -0
- package/dist/resources/schemas/AppSessionDto.json +53 -0
- package/dist/resources/schemas/ConnectDataDescribeDto.json +344 -0
- package/dist/resources/schemas/ConnectDataRequestModel.json +202 -0
- package/dist/resources/schemas/ConnectDataResultDto.json +421 -0
- package/dist/resources/schemas/ConnectorCredentialDto.json +70 -0
- package/dist/resources/schemas/ConvertConnectDataToMicroserviceCommand.json +37 -0
- package/dist/resources/schemas/CreateAccessPolicyCommand.json +209 -0
- package/dist/resources/schemas/CreateDecisionCommand.json +221 -0
- package/dist/resources/schemas/CreateProcessDefinitionCommand.json +1337 -0
- package/dist/resources/schemas/DecisionDto.json +302 -0
- package/dist/resources/schemas/DetachConnectDataMicroserviceCommand.json +28 -0
- package/dist/resources/schemas/ExplainAccessQuery.json +33 -0
- package/dist/resources/schemas/GenerateProcessDocumentCommand.json +116 -0
- package/dist/resources/schemas/GlobalFunctionUpdateResultDto.json +3 -1
- package/dist/resources/schemas/MicroserviceDto.json +2 -2
- package/dist/resources/schemas/OrganizationProjectDto.json +335 -0
- package/dist/resources/schemas/OrganizationSchemaDto.json +196 -0
- package/dist/resources/schemas/OrganizationSchemaVersionDto.json +207 -0
- package/dist/resources/schemas/PatchProcessDefinitionCommand.json +76 -0
- package/dist/resources/schemas/ProcessDefinitionDto.json +1480 -0
- package/dist/resources/schemas/ProcessSimulationDto.json +96 -0
- package/dist/resources/schemas/SaveConnectorCredentialCommand.json +90 -0
- package/dist/resources/schemas/SaveProcessEventSourceCommand.json +61 -0
- package/dist/resources/schemas/SaveProcessMailSourceCommand.json +89 -0
- package/dist/resources/schemas/SignProcessTaskCommand.json +73 -0
- package/dist/resources/schemas/SimulateProcessDefinitionQuery.json +92 -0
- package/dist/resources/schemas/StartMobileBuildCommand.json +54 -0
- package/dist/resources/schemas/UpdateAccessPolicyCommand.json +209 -0
- package/dist/resources/schemas/UpdateDecisionCommand.json +216 -0
- package/dist/resources/schemas/UpdateProcessDefinitionCommand.json +1357 -0
- package/dist/resources/schemas/UpsertMobileStoreSettingsCommand.json +259 -0
- package/dist/resources/schemas/ValidateProcessDefinitionQuery.json +1339 -0
- package/dist/server.js +7 -1
- package/dist/tools/accessOperations.js +135 -0
- package/dist/tools/accessPolicies.js +170 -0
- package/dist/tools/accessRuntime.js +203 -0
- package/dist/tools/applications.js +60 -3
- package/dist/tools/bpm.js +343 -0
- package/dist/tools/bpmGovernance.js +266 -0
- package/dist/tools/bpmOperations.js +230 -0
- package/dist/tools/bpmReporting.js +154 -0
- package/dist/tools/bpmRouting.js +150 -0
- package/dist/tools/bpmRuntime.js +396 -0
- package/dist/tools/case.js +178 -0
- package/dist/tools/caseRuntime.js +89 -0
- package/dist/tools/components.js +103 -12
- package/dist/tools/connectData.js +449 -0
- package/dist/tools/connectors.js +193 -0
- package/dist/tools/datasources.js +1 -1
- package/dist/tools/decisions.js +206 -0
- package/dist/tools/designSchemaPatch.js +22 -16
- package/dist/tools/externalComponents.js +25 -4
- package/dist/tools/flows.js +79 -6
- package/dist/tools/layouts.js +44 -12
- package/dist/tools/microservices.js +32 -10
- package/dist/tools/mobile.js +221 -0
- package/dist/tools/mobileStore.js +268 -0
- package/dist/tools/modules.js +48 -0
- package/dist/tools/organizationStructure.js +137 -0
- package/dist/tools/pages.js +391 -92
- package/dist/tools/platformInfo.js +7 -2
- package/dist/tools/profileWrite.js +92 -0
- package/dist/tools/rows.js +7 -1
- package/dist/tools/schemaOps.js +33 -1
- package/dist/tools/screenWrite.js +15 -7
- package/dist/tools/screens.js +90 -3
- package/dist/tools/variables.js +11 -5
- package/package.json +2 -2
- package/dist/knowledge/boxSections.js +0 -184
|
@@ -64,7 +64,9 @@ const guideRouting = {
|
|
|
64
64
|
microfunction: 'kendi runtime\'ında koşan Node/Python fonksiyonu: protokol, yayın döngüsü, step kullanımı',
|
|
65
65
|
entity: "alan tipleri, ilişkiler, hazır entity'ler",
|
|
66
66
|
page: 'sayfa/flow işleri; flex düzen prop grubu ve boyut modları (Kural 1f-2)',
|
|
67
|
-
layout: 'yerleşim kabuğu: tek slot, views,
|
|
67
|
+
layout: 'yerleşim kabuğu: tek slot, views, dar ekranda yığılma, widthType fill/fixed/auto',
|
|
68
|
+
mobile: "mobil UYGULAMA (type:'mobile'): kurulum sırası (mobile_app_create), flex-only yerleşim, tipli stil, sekmeler (properties.mobile.tabs) ve çekmece, adım sözlüğü, MOB-* bulguları, page_screenshot device",
|
|
69
|
+
'mobile-layout': 'mobil ekranın mizanpajı — tek dil: güvenli alan, tek kaydırıcı, 16 dp kenar, gap ritmi, saydam/yüzeyli grup, genişlik, yarıçap/yazı ölçeği; MOB-015…021 reçeteleri ve layoutReport hiza ölçümü',
|
|
68
70
|
component: 'komponent modeli, olay sözleşmeleri, appearance boyut sözlüğü (widthString/heightString)',
|
|
69
71
|
html: 'hazır komponent yetmediğinde tek seferlik kaçış kapısı (Mustache, fireEvent, script kuralları)',
|
|
70
72
|
'external-component': 'kalıcı ihtiyaçta kendi komponentini yazıp yayınlama',
|
|
@@ -92,6 +94,7 @@ export function registerPlatformTools(server, platform) {
|
|
|
92
94
|
'Modülün iş kuralları rehberini döner. Bir modülde İLK yazma işleminden önce ilgili rehberi okuyun:',
|
|
93
95
|
...guides.map(name => `- ${name}${guideRouting[name] ? `: ${guideRouting[name]}` : ''}`),
|
|
94
96
|
"Büyük rehberler (page ~120 KB) section'sız çağrıda TAM METİN DÖNMEZ: giriş + bölüm listesi (outline) döner, truncated: true olur. Gövdeyi section ile bölüm bölüm alın.",
|
|
97
|
+
"Büyük gövdeyi (sayfa şeması, akış adımları, uç/workflow tanımı, patch op'ları) dosyaya yazıp bodyFile ile verin: gövde bağlamınızdan geçmez, satır içiyle aynı doğrulamadan geçer (page_*/flow_*/microservice_*/workflow_* create/update/patch). microservice_execute yanıt başlıkları varsayılan kısadır; ucun kendi başlığı için includeHeaders:'all'.",
|
|
95
98
|
'Örnek gövdeler için ngapps://examples kaynaklarına bakın.'
|
|
96
99
|
].join('\n');
|
|
97
100
|
server.registerTool('platform_whoami', {
|
|
@@ -154,6 +157,7 @@ export function registerPlatformTools(server, platform) {
|
|
|
154
157
|
title: 'Kabiliyet boşluğu bildir',
|
|
155
158
|
description: "Yapmak İSTEDİĞİNİZ ama platform desteklemediği için yapamadığınız her noktada BUNU ÇAĞIRIN — tasarımı sessizce küçültmeyin. Bu çağrı platforma gitmez, yalnızca günlüğe 'KABİLİYET BOŞLUĞU' bloğu yazar; hata günlüğünde görünmeyen bu kayıtlar ürün yol haritasının girdisidir. Önce rehbere bakıp (platform_guide; hazır komponent yetmiyorsa tek seferlik için 'html' kaçış kapısı, kalıcı bir ihtiyaç içinse 'external-component' — kendi komponentinizi yazıp yayınlayabilirsiniz) gerçekten desteklenmediğinden emin olun: desteklenen bir şeyi 'yok' diye bildirmek yanlış yol haritası üretir.",
|
|
156
159
|
inputSchema: {
|
|
160
|
+
project: z.string().min(1).optional().describe("Boşluğun görüldüğü proje (ad ya da slug); kayda yazılır. Bu çağrı platforma gitmez, proje yalnız bağlamdır"),
|
|
157
161
|
goal: z.string().min(1).optional().describe('Ne yapmak istediniz — kullanıcıya görünen sonuç olarak yazın ("randevu listesini hasta adına göre süzmek"). Eşanlamlı kabul edilir: title · summary · what.'),
|
|
158
162
|
blocker: z.string().min(1).optional().describe('Neden yapamadınız — hangi kabiliyetin eksik olduğu ("uçta X yok", "komponentte Y prop\'u yok"). Eşanlamlı kabul edilir: reason · problem · missing · description.'),
|
|
159
163
|
severity: z.string().optional().describe("YOL HARİTASINDAKİ SIRAYI BU ALAN BELİRLER, doldurun. blocker: özellik hiç yapılamadı · workaround: daha kötü bir yolla yapıldı · cosmetic: yalnız görsel/ergonomik kayıp. Eşanlamlılar çevrilir (critical/high/blocking→blocker, medium/major→workaround, low/minor/nit→cosmetic). TANINMAYAN değer reddedilir; verilmezse kayıt düşer ama yanıt 'incomplete' ile uyarır ve bildirim orta kovaya yazılır."),
|
|
@@ -171,9 +175,10 @@ export function registerPlatformTools(server, platform) {
|
|
|
171
175
|
annotations: readOnly
|
|
172
176
|
}, handle(config, async (input) => {
|
|
173
177
|
const gap = normalizeGapReport(input);
|
|
174
|
-
logCapabilityGap({ goal: gap.goal, blocker: gap.blocker, severity: gap.severity, module: gap.module, attempted: gap.attempted, workaround: gap.workaround });
|
|
178
|
+
logCapabilityGap({ goal: gap.goal, blocker: gap.blocker, severity: gap.severity, module: gap.module, attempted: gap.attempted, workaround: gap.workaround, project: input.project });
|
|
175
179
|
return {
|
|
176
180
|
recorded: true,
|
|
181
|
+
...(input.project ? { project: input.project } : {}),
|
|
177
182
|
severity: gap.severity,
|
|
178
183
|
module: gap.module ?? null,
|
|
179
184
|
...(Object.keys(gap.normalizedFrom).length > 0 ? { normalizedFrom: gap.normalizedFrom } : {}),
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { findingLines, profileFindings, stateStorageFindings } from '../knowledge/platform/lint.js';
|
|
2
|
+
import { describeShell, mobileLayoutFindings, newFindings } from '../knowledge/platform/mobileLayoutLint.js';
|
|
3
|
+
import { resolveProfile } from '../knowledge/platform/resolve.js';
|
|
4
|
+
import { fetchCatalogSlugs } from './components.js';
|
|
5
|
+
import { flowPath } from './screens.js';
|
|
6
|
+
/**
|
|
7
|
+
* Sayfa/layout/widget yazma yollarının profil kapısı: mobil profilde `MOB-*` bulgularını
|
|
8
|
+
* `layoutWarnings[]` satırı olarak döner. Web profilinde HİÇBİR istek atmaz ve boş dizi döner —
|
|
9
|
+
* web yanıtı profil öncesiyle aynı kalır (G1 golden).
|
|
10
|
+
*/
|
|
11
|
+
export async function screenProfileWarnings(platform, resolved, project, environment, applicationId, input) {
|
|
12
|
+
if (resolved.profile.platform === 'web')
|
|
13
|
+
return [];
|
|
14
|
+
const catalog = await fetchCatalogSlugs(platform, project, environment, applicationId).catch(() => undefined);
|
|
15
|
+
// Tam kabuk ağacı yazan layout yolları (create/update/patch) mizanpaj iskeletini de denetler (MOB-015…018).
|
|
16
|
+
const layoutTree = resolved.profile.platform === 'mobile' && input.kind === 'layout' && input.nodes !== undefined
|
|
17
|
+
? mobileLayoutFindings({ kind: 'layout', tree: input.nodes })
|
|
18
|
+
: [];
|
|
19
|
+
return findingLines([...profileFindings(resolved.profile, { ...input, ...(catalog ? { catalog } : {}) }), ...layoutTree]);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Sayfa yazımının mizanpaj iskeleti (MOB-015…018): sayfanın kabuğu okunur, çünkü üst pay ve app-bar kabukla
|
|
23
|
+
* birlikte karar verilir. `before` verilirse (yama) yalnız yazımın getirdiği bulgular döner. Web profilinde
|
|
24
|
+
* istek atmaz; kabuk okunamazsa kabuğa bağlı kurallar koşmaz ve bilgi satırı döner.
|
|
25
|
+
*/
|
|
26
|
+
export async function pageLayoutWarnings(platform, resolved, project, environment, applicationId, input) {
|
|
27
|
+
if (resolved.profile.platform !== 'mobile')
|
|
28
|
+
return [];
|
|
29
|
+
const shell = await pageShell(platform, project, environment, applicationId, input.layoutId);
|
|
30
|
+
const after = mobileLayoutFindings({ kind: 'page', tree: input.tree, shell });
|
|
31
|
+
return findingLines(input.before === undefined ? after : newFindings(mobileLayoutFindings({ kind: 'page', tree: input.before, shell }), after));
|
|
32
|
+
}
|
|
33
|
+
/** Kabuk yamasının getirdiği iskelet bulguları (`layout_schema_patch`); web profilinde boş. */
|
|
34
|
+
export function layoutPatchWarnings(resolved, before, after) {
|
|
35
|
+
if (resolved.profile.platform !== 'mobile')
|
|
36
|
+
return [];
|
|
37
|
+
return findingLines(newFindings(mobileLayoutFindings({ kind: 'layout', tree: before }), mobileLayoutFindings({ kind: 'layout', tree: after })));
|
|
38
|
+
}
|
|
39
|
+
async function pageShell(platform, project, environment, applicationId, layoutId) {
|
|
40
|
+
if (typeof layoutId !== 'string' || layoutId === '')
|
|
41
|
+
return { kind: 'none' };
|
|
42
|
+
try {
|
|
43
|
+
const response = await platform.tenant('GET', project, `/layouts/${applicationId}/${layoutId}`, { environment });
|
|
44
|
+
return Array.isArray(response?.data?.views) ? describeShell(response.data.views) : { kind: 'unknown' };
|
|
45
|
+
}
|
|
46
|
+
catch {
|
|
47
|
+
return { kind: 'unknown' };
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* `set_event` ile bağlanan akışların adımları (MOB-005). Akış gövdeleri şemada değil ayrı uçtadır;
|
|
52
|
+
* okunamazsa bulgu üretilmez, yazım yine geçer.
|
|
53
|
+
*/
|
|
54
|
+
export async function boundFlowSteps(platform, resolved, project, environment, host, applicationId, hostId, ops) {
|
|
55
|
+
if (resolved.profile.platform === 'web')
|
|
56
|
+
return [];
|
|
57
|
+
const flowIds = new Set(ops.filter(entry => entry.op === 'set_event').map(entry => String(entry.eventValue ?? '')).filter(id => id.length > 0));
|
|
58
|
+
if (flowIds.size === 0)
|
|
59
|
+
return [];
|
|
60
|
+
try {
|
|
61
|
+
const hosted = await platform.tenant('GET', project, flowPath(host, applicationId, hostId), { environment });
|
|
62
|
+
return (hosted?.data ?? [])
|
|
63
|
+
.filter(flow => flowIds.has(String(flow.id ?? '')))
|
|
64
|
+
.flatMap(flow => [...(Array.isArray(flow.steps) ? flow.steps : []), ...(Array.isArray(flow.errorSteps) ? flow.errorSteps : [])]);
|
|
65
|
+
}
|
|
66
|
+
catch {
|
|
67
|
+
return [];
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Akış yazma yollarının profil kapısı (MOB-005): mobil uygulamada `download`/`setcookie` adımının
|
|
72
|
+
* davranış farkını `platformWarnings`'e yazar. Web profilinde istek atmaz, boş döner.
|
|
73
|
+
*/
|
|
74
|
+
/**
|
|
75
|
+
* Değişken yazma yollarının profil kapısı (MOB-014). Yazılan set saklama türü taşımıyorsa uygulama
|
|
76
|
+
* tipi ÇÖZÜLMEZ — ek istek atılmaz, yanıt profil öncesiyle aynı kalır. Tip çözülemediyse (uygulama
|
|
77
|
+
* okunamadı) bulgu üretilmez: gateway bilmediği platform için "uygulanmıyor" demez.
|
|
78
|
+
*/
|
|
79
|
+
export async function variableProfileWarnings(platform, applicationId, entries) {
|
|
80
|
+
if (!entries.some(entry => entry.storage !== undefined))
|
|
81
|
+
return [];
|
|
82
|
+
const resolved = await resolveProfile(platform, applicationId);
|
|
83
|
+
if (!resolved.known)
|
|
84
|
+
return [];
|
|
85
|
+
return findingLines(stateStorageFindings(resolved.profile, entries));
|
|
86
|
+
}
|
|
87
|
+
export async function flowProfileWarnings(platform, applicationId, steps) {
|
|
88
|
+
const resolved = await resolveProfile(platform, applicationId);
|
|
89
|
+
if (resolved.profile.platform === 'web')
|
|
90
|
+
return [];
|
|
91
|
+
return findingLines(profileFindings(resolved.profile, { kind: 'page', steps }));
|
|
92
|
+
}
|
package/dist/tools/rows.js
CHANGED
|
@@ -4,7 +4,7 @@ import { unmappedMembers, withUnmappedMembers } from '../knowledge/schemaGuard.j
|
|
|
4
4
|
import { withNormalization } from '../knowledge/normalize.js';
|
|
5
5
|
import { RefResolver } from '../platform/refs.js';
|
|
6
6
|
import { attachFindings, evaluatePolicy, enforcePolicy } from '../knowledge/policy.js';
|
|
7
|
-
import { policyRules } from '../knowledge/rules.js';
|
|
7
|
+
import { filterOperatorError, policyRules } from '../knowledge/rules.js';
|
|
8
8
|
import { languageHeader } from '../knowledge/languageCodes.js';
|
|
9
9
|
import { handle } from '../platform/responses.js';
|
|
10
10
|
import { uploadFile } from './files.js';
|
|
@@ -224,6 +224,9 @@ export function registerRowTools(server, platform) {
|
|
|
224
224
|
},
|
|
225
225
|
annotations: readOnly
|
|
226
226
|
}, handle(config, async ({ project, environment, entityId, language, ...body }) => {
|
|
227
|
+
const operatorError = filterOperatorError('row_list', body.filters);
|
|
228
|
+
if (operatorError)
|
|
229
|
+
throw new PlatformApiError(operatorError, 400);
|
|
227
230
|
const notes = [];
|
|
228
231
|
const headers = languageHeader(language, notes);
|
|
229
232
|
const resolver = new RefResolver(platform, project, environment);
|
|
@@ -400,6 +403,9 @@ export function registerRowTools(server, platform) {
|
|
|
400
403
|
if ((scope?.rowIds?.length ?? 0) > maxSelectedRowIds) {
|
|
401
404
|
throw new PlatformApiError(`row_export: ${scope?.rowIds?.length} satır id'si, ${maxSelectedRowIds} sınırının üstünde. Bu kadar satırı seçerek değil filtreyle verin: scope { kind: 'view', filters: [...] }.`);
|
|
402
405
|
}
|
|
406
|
+
const operatorError = filterOperatorError('row_export', scope?.filters);
|
|
407
|
+
if (operatorError)
|
|
408
|
+
throw new PlatformApiError(operatorError, 400);
|
|
403
409
|
const resolvedFormat = format ?? 'xlsx';
|
|
404
410
|
const notes = [];
|
|
405
411
|
const resolver = new RefResolver(platform, project, environment);
|
package/dist/tools/schemaOps.js
CHANGED
|
@@ -24,7 +24,7 @@ export function outlineWriteResponse(response) {
|
|
|
24
24
|
if (Array.isArray(container.appliedPatch))
|
|
25
25
|
container.appliedPatch = outlineAppliedPatch(container.appliedPatch);
|
|
26
26
|
}
|
|
27
|
-
export const opsParam = z.array(z.record(z.unknown())).describe("Micro-op listesi. Op sözlüğü: replace_prop {target, prop, value} (value ham değer, code sarmalı {type: 'code', ref: '{{ … }}'} ya da translation sarmalı {type: 'translation', ref: '<çeviri anahtarı>'} — prop tipini değiştirmek için komponenti silip yeniden EKLEMEYİN, ona yazan setter'ların hedefi silinir (FLOW-018); platform replace_prop'ta expression alanını OKUMAZ — gateway onu code sarmalına çevirir) | set_binding {target, prop, expression: '{{ Page.variables.x }}'} | add_component {parent (üst elementId ya da 'root'), index?, component} | remove_component {target} | move_component {target, parent, index?, position: {x, y}} (index ÇİZİM sırası değildir, runtime çocukları blocks.position'a göre (y, sonra x) çizer. page_schema_patch'te flex kapta gateway index'i görünen sıraya çevirir ve kardeş konumlarını yeniden yazar; ızgara kapta sırayı position.y verir, sona eklemeyen index PAGE-033 uyarısıdır. layout_schema_patch ve component_schema_patch bu çeviriyi YAPMAZ: orada sırayı position.y ile verin) | set_event {target, event, eventValue, replaceBoundFlows?} (olayın BÜTÜN bağlarını bu tek akışa indirir; olayda başka akış bağlıysa gateway PAGE-034 ile reddeder — bilerek değiştirmek için replaceBoundFlows: true) | add_event {target, event, eventValue} (olaya bir akış DAHA bağlar; bağlı akışların hepsi paralel ve birbirinden bağımsız koşar, sıra garantisi yoktur — sıra gerekiyorsa flow-trigger. Aynı
|
|
27
|
+
export const opsParam = z.array(z.record(z.unknown())).describe("Micro-op listesi. Op sözlüğü: replace_prop {target, prop, value} (value ham değer, code sarmalı {type: 'code', ref: '{{ … }}'} ya da translation sarmalı {type: 'translation', ref: '<çeviri anahtarı>'} — prop tipini değiştirmek için komponenti silip yeniden EKLEMEYİN, ona yazan setter'ların hedefi silinir (FLOW-018); platform replace_prop'ta expression alanını OKUMAZ — gateway onu code sarmalına çevirir) | set_binding {target, prop, expression: '{{ Page.variables.x }}'} | add_component {parent (üst elementId ya da 'root'), index?, component} | remove_component {target} | move_component {target, parent, index?, position: {x, y}} (index ÇİZİM sırası değildir, runtime çocukları blocks.position'a göre (y, sonra x) çizer. page_schema_patch'te flex kapta gateway index'i görünen sıraya çevirir ve kardeş konumlarını yeniden yazar; ızgara kapta sırayı position.y verir, sona eklemeyen index PAGE-033 uyarısıdır. layout_schema_patch ve component_schema_patch bu çeviriyi YAPMAZ: orada sırayı position.y ile verin) | set_event {target, event, eventValue, replaceBoundFlows?} (olayın BÜTÜN bağlarını bu tek akışa indirir; olayda başka akış bağlıysa gateway PAGE-034 ile reddeder — bilerek değiştirmek için replaceBoundFlows: true) | add_event {target, event, eventValue} (olaya bir akış DAHA bağlar; bağlı akışların hepsi paralel ve birbirinden bağımsız koşar, sıra garantisi yoktur — sıra gerekiyorsa flow-trigger. Aynı akışı ikinci kez bağlamak etkisizdir (unchanged; tekrar güvenli). Mobil runtime yalnız İLK akışı koşar) | remove_event {target, event, eventValue?} (olayı diziden çıkarır; target: 'page' sayfa düzeyi olaylar. Olaya birden fazla akış bağlıysa eventValue ile hangisi olduğunu verin, yoksa 422 ambiguous-event. set_event ile eventValue: null olay SİLMEZ, değersiz ölü kayıt bırakır. Olmayan olay 422 missing-event) | set_validations {target, validations: [{type, message, value, isActive}]} (komponentin validation listesini TAMAMEN değiştirir; boş dizi hepsini siler) | set_appearance {target, appearance: {heightType?, widthType?, tooltip?, background?, …}} (kurulu düğümün appearance'ına YALNIZ verilen alanları yazar, gerisini korur; null alanı temizler; bilinmeyen alan unknown-appearance-field ile reddedilir. GÖRÜNÜRLÜK appearance'ta DEĞİLDİR: gizlemek için replace_prop {target, prop: 'isHidden', value: true}, koşul için set_binding {prop: 'isHidden'} — add_component gövdesindeki appearance.isHidden'ı gateway props.isHidden'a taşır) | resize_component {target, size?: {w,h}, appearance?: {widthType,widthString,heightType,heightString}, states?: {isWrapper,isScrollable,isSticky,isDroppable,isFloating,isQuickStack}, breakpoint?: 1024} (gateway adı: platforma set_block {target, breakpoint, size} + set_appearance {target, appearance} + set_states {target, states} olarak gider — o üç op'u doğrudan da gönderebilirsiniz. move_component'e konan size reddedilir. Izgarada blocks[].size, flex'te appearance geçerlidir; ebeveynin düzeni yazılanı etkisiz kılıyorsa PAGE-019 uyarısı çıkar. states bir PROP DEĞİL düğüm alanıdır ve replace_prop onu yazamaz — düğümü silmeden isWrapper bayrağını değiştirmenin yolu budur). set_prop_type {target, prop, propType: 'static'|'code'|'translation', ref?, data?} (replace_prop sarmalıyla aynı sonucu verir ve mevcut data'yı tasarım yedeği olarak taşır. Bu op prop'un TİPİNİ yerinde değiştirir. Taşıyıcı alan tipe göre: static → data, code ve translation → ref (runtime data'yı her turda ezer, anahtar yalnız ref'te yaşar). Eksik taşıyıcı istek gönderilmeden reddedilir; page_schema_validate aynı kararı verir) | reorder {parent ('root' ya da elementId), order: [çocuk elementId'lerinin TAMAMI, yeni sırada]} (yalnız DİZİ sırasını değiştirir; çizim sırası blocks.position'dır — görünen sırayı değiştirmek için konumları set_block/move_component ile de yazın) | set_state_binding {target, binding: {name, expression, targets}} (ada göre ekler/değiştirir) | remove_state_binding {target, name} | batch {gestureId?, label?, ops: [...]} (iç içe batch yok). target = elementId. İstek atomiktir: tek op reddedilirse hiçbiri yazılmaz.");
|
|
28
28
|
/**
|
|
29
29
|
* PAGE-008 — `set_event` uydurma bir olay adıyla 200 döner ve bağ SESSİZCE ölü kalır: motor olayı
|
|
30
30
|
* komponentin yaydığı adla eşleştirir, eşleşme yoksa akış hiç çalışmaz. Kontrol yalnız hedefin
|
|
@@ -278,3 +278,35 @@ export function assertOpBodies(opRecords, propTypeOps) {
|
|
|
278
278
|
+ "Çalışan biçim dört alanı da taşır: { type: 'required'|'email'|'regex'|'max-length'|'min-length'|'max-value'|'min-value'|'value-options', message: '<kullanıcıya görünen metin>', value: <eşik/desen/true>, isActive: true }.", 400);
|
|
279
279
|
}
|
|
280
280
|
}
|
|
281
|
+
/** İskelet kurallarının okuduğu prop'lar (düzen grubu dışında). */
|
|
282
|
+
const SKELETON_PROPS = new Set(['edges', 'horizontal', 'refreshable', 'stickyHeader', 'isHidden']);
|
|
283
|
+
/** Yama iskeleti değiştirebilir mi: yalnız o zaman kabuk okunur ve fark hesaplanır. */
|
|
284
|
+
export function reshapesSkeleton(ops) {
|
|
285
|
+
return ops.some(entry => ['add_component', 'move_component', 'remove_component', 'set_appearance', 'set_states'].includes(String(entry.op))
|
|
286
|
+
|| ((entry.op === 'replace_prop' || entry.op === 'set_binding') && (FLEX_LAYOUT_PROP_NAMES.has(String(entry.prop ?? '')) || SKELETON_PROPS.has(String(entry.prop ?? '')))));
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* `simulateLayoutOps`'un uygulamadığı ama iskeleti değiştiren op'lar: silme, görünüm, durum bayrakları ve
|
|
290
|
+
* iskelet prop'ları. Uygulanmasa yama "sabit boy verilen scroll-view"ü gerekçesiz, silinen app-bar'ı ikinci
|
|
291
|
+
* sayardı.
|
|
292
|
+
*/
|
|
293
|
+
export function applySkeletonOps(tree, ops) {
|
|
294
|
+
for (const entry of ops) {
|
|
295
|
+
const target = String(entry.target ?? '');
|
|
296
|
+
if (entry.op === 'remove_component')
|
|
297
|
+
removeNodeFromTree(tree, target);
|
|
298
|
+
if (entry.op === 'set_appearance' || entry.op === 'set_states') {
|
|
299
|
+
const node = findNode(tree, target);
|
|
300
|
+
const field = entry.op === 'set_appearance' ? 'appearance' : 'states';
|
|
301
|
+
const patch = entry[field];
|
|
302
|
+
if (node && patch && typeof patch === 'object')
|
|
303
|
+
node[field] = { ...node[field], ...patch };
|
|
304
|
+
}
|
|
305
|
+
if ((entry.op === 'replace_prop' || entry.op === 'set_binding') && SKELETON_PROPS.has(String(entry.prop ?? ''))) {
|
|
306
|
+
const node = findNode(tree, target);
|
|
307
|
+
const value = entry.op === 'set_binding' ? { type: 'code', ref: entry.expression } : entry.value;
|
|
308
|
+
if (node)
|
|
309
|
+
node.props = { ...node.props, [String(entry.prop)]: value && typeof value === 'object' ? value : { type: 'static', data: value } };
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { invalidScreenEventNames, invalidWidgetTypeNodes, nestedRepeaterNodes, nestedRepeaterMessage, blockSizeNote, heightTypeNote, sizeStringNote } from '../knowledge/normalize.js';
|
|
1
|
+
import { invalidScreenEventNames, invalidWidgetTypeNodes, nestedRepeaterNodes, nestedRepeaterMessage, blockSizeNote, heightTypeNote, sizeStringNote, droppableStatesNote } from '../knowledge/normalize.js';
|
|
2
2
|
import { FUNCTIONS_NAMESPACE } from '../knowledge/functionGuards.js';
|
|
3
|
+
import { reservedExpressionName } from '../knowledge/expressionPrelude.js';
|
|
3
4
|
import { applyCatalogLayoutRules } from './components.js';
|
|
4
5
|
import { PlatformApiError } from '../platform/errors.js';
|
|
5
6
|
const GUARD_CODES = {
|
|
@@ -18,11 +19,16 @@ export function invalidComponentNames(nodes) {
|
|
|
18
19
|
if (typeof name === 'string' && name.length > 0 && !/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(name.replace(/-/g, ''))) {
|
|
19
20
|
found.push(`'${name}' (${node.elementId ?? '?'})`);
|
|
20
21
|
}
|
|
21
|
-
else if (typeof name === 'string' && name
|
|
22
|
+
else if (typeof name === 'string' && reservedExpressionName(name) === FUNCTIONS_NAMESPACE) {
|
|
22
23
|
// K1: preamble her komponent için `const <ad> = Components["<ad>"]` üretir; `Functions` adlı
|
|
23
24
|
// komponent kullanıcı fonksiyonlarının ad alanını ezer ve sayfadaki her Functions.x() ölür.
|
|
24
25
|
found.push(`'${name}' (${node.elementId ?? '?'}) — ayrılmış ad: ${FUNCTIONS_NAMESPACE} kullanıcı fonksiyonlarının ad alanıdır (K1)`);
|
|
25
26
|
}
|
|
27
|
+
else if (typeof name === 'string' && reservedExpressionName(name) !== undefined) {
|
|
28
|
+
// ARC-143: runtime preamble adıyla çakışan komponenti uyarıyla eler — komponent sayfadaki hiçbir
|
|
29
|
+
// ifadede görünmez. Eşleme runtime'ın tire kuralıyla (yalnız ilk `-`) yapılır.
|
|
30
|
+
found.push(`'${name}' (${node.elementId ?? '?'}) — ayrılmış ad: ${reservedExpressionName(name)} ifade preamble'ının adıdır; runtime bu komponenti ifadelerden gizler (ARC-143)`);
|
|
31
|
+
}
|
|
26
32
|
found.push(...invalidComponentNames(node.children));
|
|
27
33
|
}
|
|
28
34
|
return found;
|
|
@@ -35,9 +41,10 @@ export function invalidComponentNames(nodes) {
|
|
|
35
41
|
* PAGE-009 ve PAGE-013'ün layout ayağı 2026-09-09'da eklendi: ikisi de yalnız sayfa yollarında
|
|
36
42
|
* koşuyordu, oysa layout `views`'ü aynı runtime'dan geçer — bozuk ad o layout'a bağlı HER
|
|
37
43
|
* sayfanın ifadelerini öldürür, iç içe repeater'ın geri yazma kırılması ise yapısaldır ve
|
|
38
|
-
* barındıranın sayfa mı layout mu olduğuna bakmaz.
|
|
44
|
+
* barındıranın sayfa mı layout mu olduğuna bakmaz. `platform` yalnız PAGE-013 mesajının önerisini seçer
|
|
45
|
+
* (mobilde `grouped-list`); denetimlerin kendisi iki platformda aynıdır.
|
|
39
46
|
*/
|
|
40
|
-
export function assertScreenWriteGuards(kind, screen) {
|
|
47
|
+
export function assertScreenWriteGuards(kind, screen, platform) {
|
|
41
48
|
const codes = GUARD_CODES[kind];
|
|
42
49
|
const badEvents = invalidScreenEventNames(screen.events, codes.events);
|
|
43
50
|
if (badEvents.length > 0)
|
|
@@ -49,12 +56,13 @@ export function assertScreenWriteGuards(kind, screen) {
|
|
|
49
56
|
if (badNames.length > 0) {
|
|
50
57
|
throw new PlatformApiError(`PAGE-009 — komponent adı JS tanımlayıcısı değil ya da ayrılmış (istek gönderilmedi): ${badNames.join(' · ')}. `
|
|
51
58
|
+ 'Runtime her komponent için `const <ad> = Components["<ad>"]` üretir; boşluklu ya da geçersiz bir ad '
|
|
52
|
-
+ 'SAYFADAKİ TÜM ifadeleri "Missing initializer in const declaration" ile öldürür (layout adları her sayfaya sızar)
|
|
59
|
+
+ 'SAYFADAKİ TÜM ifadeleri "Missing initializer in const declaration" ile öldürür (layout adları her sayfaya sızar); '
|
|
60
|
+
+ 'ifade preamble\'ının ayrılmış adını (Page, state, item, t, event, Row …) taşıyan komponent ise ifadelerden gizlenir. '
|
|
53
61
|
+ `name alanını elementId ile aynı yaz; okunabilir Türkçe başlık için props.title / props.text / props.label kullan (${codes.noun} ${codes.tree}).`, 400);
|
|
54
62
|
}
|
|
55
63
|
const nested = nestedRepeaterNodes(screen.schema);
|
|
56
64
|
if (nested.length > 0)
|
|
57
|
-
throw new PlatformApiError(nestedRepeaterMessage(nested), 400);
|
|
65
|
+
throw new PlatformApiError(nestedRepeaterMessage(nested, platform), 400);
|
|
58
66
|
}
|
|
59
67
|
/**
|
|
60
68
|
* Katalog kurallarını (blok sınırı · auto-height · boyut string'i) ağaca uygular ve
|
|
@@ -65,5 +73,5 @@ export async function screenCatalogNotes(platform, project, environment, applica
|
|
|
65
73
|
if (!Array.isArray(nodes) || nodes.length === 0)
|
|
66
74
|
return [];
|
|
67
75
|
const catalog = await applyCatalogLayoutRules(platform, project, environment, applicationId, nodes);
|
|
68
|
-
return [...blockSizeNote(catalog.clamped), ...heightTypeNote(catalog.heights), ...sizeStringNote(catalog.sizes)];
|
|
76
|
+
return [...blockSizeNote(catalog.clamped), ...heightTypeNote(catalog.heights), ...sizeStringNote(catalog.sizes), ...droppableStatesNote(catalog.states)];
|
|
69
77
|
}
|
package/dist/tools/screens.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { PlatformApiError } from '../platform/errors.js';
|
|
2
2
|
import { resolveNodeStyleReport } from '../knowledge/styleResolve.js';
|
|
3
|
+
import { nodeNativeStyle } from '../knowledge/styleResolveNative.js';
|
|
3
4
|
import { z } from 'zod';
|
|
4
5
|
export const hostParam = z.enum(['page', 'layout', 'component'])
|
|
5
6
|
.describe("Akışın barındırıcısı: page | layout | component (widget de component'tir)");
|
|
@@ -8,26 +9,106 @@ export const schemaParam = z.array(z.record(z.unknown()))
|
|
|
8
9
|
export const eventsParam = z.array(z.record(z.unknown()))
|
|
9
10
|
.describe("Sayfa/layout düzeyi olaylar: [{ name, value }] — value bir flow id'sidir");
|
|
10
11
|
export const modeParam = z.enum(['summary', 'subtree', 'full']).optional().describe("summary (varsayılan): yalnız id/elementId/name/type ağacı — hedef bulmak için bunu kullanın. subtree: componentId ile tek alt ağaç. full: tüm şema.");
|
|
12
|
+
/**
|
|
13
|
+
* Şema ağacındaki TÜM düğümler (kök + iç içe çocuklar); page_get, page_create özeti, page_update
|
|
14
|
+
* ve page_schema_get aynı sayımı kullanır. Parçalı okumanın `deferred` yer tutucuları düğüm değildir.
|
|
15
|
+
*/
|
|
16
|
+
export function countSchemaNodes(nodes) {
|
|
17
|
+
return (nodes ?? []).reduce((total, node) => node.deferred === true ? total : total + 1 + countSchemaNodes(node.children), 0);
|
|
18
|
+
}
|
|
19
|
+
function schemaNodeKey(node) {
|
|
20
|
+
return typeof node.elementId === 'string' ? node.elementId : String(node.id);
|
|
21
|
+
}
|
|
22
|
+
function schemaNodeKeys(nodes) {
|
|
23
|
+
return (nodes ?? []).flatMap(node => [schemaNodeKey(node), ...schemaNodeKeys(node.children)]);
|
|
24
|
+
}
|
|
25
|
+
/** `stored` ağacında olup `sent` ağacında olmayan düğümlerin elementId'leri, ön-sırayla (PAGE-037). */
|
|
26
|
+
export function missingElementIds(stored, sent) {
|
|
27
|
+
const kept = new Set(schemaNodeKeys(sent));
|
|
28
|
+
return schemaNodeKeys(stored).filter(key => !kept.has(key));
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* ZM-28: şemayı her biri `budgetChars` karakteri (JSON uzunluğu, `shrink` ile aynı ölçü) aşmayan
|
|
32
|
+
* parçalara böler. Ön-sıra ve deterministik: alt ağacı sığan düğüm BÜTÜN alınır, sığmayan kabuk olarak
|
|
33
|
+
* yazılır ve çocuklarına inilir; parçaların birleşimi orijinal şemanın birebir aynısıdır.
|
|
34
|
+
*/
|
|
35
|
+
export function splitSchemaIntoParts(schema, budgetChars) {
|
|
36
|
+
const parts = [];
|
|
37
|
+
let current = [];
|
|
38
|
+
let currentChars = 2;
|
|
39
|
+
const place = (item, chars) => {
|
|
40
|
+
if (current.length > 0 && currentChars + 1 + chars > budgetChars) {
|
|
41
|
+
parts.push(current);
|
|
42
|
+
current = [];
|
|
43
|
+
currentChars = 2;
|
|
44
|
+
}
|
|
45
|
+
currentChars += (current.length > 0 ? 1 : 0) + chars;
|
|
46
|
+
current.push(item);
|
|
47
|
+
};
|
|
48
|
+
const visit = (node, parentElementId, index) => {
|
|
49
|
+
const whole = { parentElementId, index, node };
|
|
50
|
+
const wholeChars = JSON.stringify(whole).length;
|
|
51
|
+
if (2 + wholeChars <= budgetChars) {
|
|
52
|
+
place(whole, wholeChars);
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
const children = Array.isArray(node.children) ? node.children : [];
|
|
56
|
+
const shell = {
|
|
57
|
+
parentElementId,
|
|
58
|
+
index,
|
|
59
|
+
node: { ...node, children: children.map(child => ({ elementId: schemaNodeKey(child), deferred: true })) }
|
|
60
|
+
};
|
|
61
|
+
const shellChars = JSON.stringify(shell).length;
|
|
62
|
+
if (children.length === 0 || 2 + shellChars > budgetChars) {
|
|
63
|
+
throw new PlatformApiError(`'${schemaNodeKey(node)}' (${String(node.type)}) düğümünün kendi gövdesi ${children.length === 0 ? wholeChars : shellChars} karakter; parça bütçesi ${budgetChars} karakter olduğu için tek düğüm bile bir yanıta sığmıyor. Düğümün büyük prop'unu page_schema_patch (replace_prop) ile küçültün ya da parçalara bölün; sonra cursor:'0' ile yeniden okuyun.`, 400);
|
|
64
|
+
}
|
|
65
|
+
place(shell, shellChars);
|
|
66
|
+
children.forEach((child, childIndex) => visit(child, schemaNodeKey(node), childIndex));
|
|
67
|
+
};
|
|
68
|
+
schema.forEach((node, index) => visit(node, null, index));
|
|
69
|
+
if (current.length > 0 || parts.length === 0)
|
|
70
|
+
parts.push(current);
|
|
71
|
+
return parts;
|
|
72
|
+
}
|
|
73
|
+
/** Opak parçalı okuma cursor'ı: sürüm değişince eski cursor reddedilir. */
|
|
74
|
+
export function encodeSchemaCursor(version, partIndex) {
|
|
75
|
+
return `${version}:${partIndex}`;
|
|
76
|
+
}
|
|
77
|
+
/** `'0'` sürümsüz ilk parçadır; `<sürüm>:<parça>` sürümü taşır. Çözülemeyen cursor `undefined`. */
|
|
78
|
+
export function decodeSchemaCursor(cursor) {
|
|
79
|
+
if (/^\d+$/.test(cursor))
|
|
80
|
+
return { partIndex: Number(cursor) };
|
|
81
|
+
const separator = cursor.lastIndexOf(':');
|
|
82
|
+
const partIndex = cursor.slice(separator + 1);
|
|
83
|
+
if (separator < 0 || !/^\d+$/.test(partIndex))
|
|
84
|
+
return undefined;
|
|
85
|
+
return { version: cursor.slice(0, separator), partIndex: Number(partIndex) };
|
|
86
|
+
}
|
|
11
87
|
/**
|
|
12
88
|
* Ağacı yalnız kimlik alanlarına indirger; hedef aramak için okunur boyutta tutar.
|
|
13
89
|
* `styleSource` verilirse (undefined DEĞİLSE) her düğüme efektif stil raporu da
|
|
14
90
|
* yazılır: tema componentStyles → preset → düğümün kendi stili kaskadı.
|
|
15
91
|
*/
|
|
16
|
-
export function summarize(node, styleSource) {
|
|
92
|
+
export function summarize(node, styleSource, nativeTheme) {
|
|
17
93
|
const summary = {
|
|
18
94
|
id: node.id,
|
|
19
95
|
elementId: node.elementId,
|
|
20
96
|
name: node.name,
|
|
21
97
|
type: node.type
|
|
22
98
|
};
|
|
23
|
-
|
|
99
|
+
// Mobil uygulama: stil CSS değil React Native nesnesidir (`shell` kutu, `text` metin).
|
|
100
|
+
if (nativeTheme !== undefined) {
|
|
101
|
+
const { shell, text, warnings } = nodeNativeStyle(node, nativeTheme, styleSource ?? undefined);
|
|
102
|
+
summary.nativeStyle = { shell, text, ...(warnings.length > 0 ? { warnings } : {}) };
|
|
103
|
+
}
|
|
104
|
+
else if (styleSource !== undefined) {
|
|
24
105
|
const report = resolveNodeStyleReport(node, styleSource ?? undefined);
|
|
25
106
|
if (report.resolvedStyle !== undefined)
|
|
26
107
|
summary.resolvedStyle = report.resolvedStyle;
|
|
27
108
|
summary.styleLayers = report.styleLayers;
|
|
28
109
|
}
|
|
29
110
|
if (Array.isArray(node.children) && node.children.length > 0) {
|
|
30
|
-
summary.children = node.children.map(child => summarize(child, styleSource));
|
|
111
|
+
summary.children = node.children.map(child => summarize(child, styleSource, nativeTheme));
|
|
31
112
|
}
|
|
32
113
|
return summary;
|
|
33
114
|
}
|
|
@@ -96,6 +177,11 @@ export function flowPath(host, applicationId, hostId, flowId) {
|
|
|
96
177
|
: `/components/${applicationId}/${hostId}/flows`;
|
|
97
178
|
return flowId ? `${root}/${flowId}` : root;
|
|
98
179
|
}
|
|
180
|
+
/**
|
|
181
|
+
* Sayfa PUT gövdesi okunan sayfadan kurulur ve o sayfanın sürümünü `baseVersion` olarak taşır:
|
|
182
|
+
* platform sürümsüz sayfa PUT'unu reddeder (`plans/mobil-plantcare-acigi` b-05, K11). Gövde
|
|
183
|
+
* okunduğu andaki sayfanın üstüne yazar; ajanın planladığı sürümü `page_update` kendisi koyar.
|
|
184
|
+
*/
|
|
99
185
|
export function pageUpdateBody(page, overrides = {}) {
|
|
100
186
|
const layout = (page.layout ?? {});
|
|
101
187
|
return {
|
|
@@ -110,6 +196,7 @@ export function pageUpdateBody(page, overrides = {}) {
|
|
|
110
196
|
middlewareIds: page.middlewareIds ?? [],
|
|
111
197
|
roleIds: Array.isArray(page.roleIds) ? page.roleIds : identifiers(page.roles),
|
|
112
198
|
layoutId: page.layoutId ?? layout.id ?? null,
|
|
199
|
+
baseVersion: page.version === undefined || page.version === null ? undefined : String(page.version),
|
|
113
200
|
...overrides
|
|
114
201
|
};
|
|
115
202
|
}
|
package/dist/tools/variables.js
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { parseVariableEntries, mergeVariableEntries, withNormalization } from '../knowledge/normalize.js';
|
|
2
2
|
import { guid, projectParam, environmentParam, readOnly, writes, updates, destructive } from './common.js';
|
|
3
|
+
import { STATE_STORAGE_KINDS } from '../knowledge/platform/profile.js';
|
|
4
|
+
import { variableProfileWarnings } from './profileWrite.js';
|
|
3
5
|
import { handle } from '../platform/responses.js';
|
|
4
6
|
import { z } from 'zod';
|
|
5
7
|
const variablePath = (applicationId, pageId) => pageId ? `/variables/${applicationId}/${pageId}` : `/variables/${applicationId}`;
|
|
6
8
|
const variablesParam = z.array(z.object({
|
|
7
9
|
key: z.string().min(1).describe("Değişken adı; sayfada state.page.<key> ile okunur"),
|
|
8
|
-
value: z.unknown().describe('Herhangi bir JSON değeri; nesne verirseniz alanlarına state.page.<key>.<alan> ile erişilir')
|
|
10
|
+
value: z.unknown().describe('Herhangi bir JSON değeri; nesne verirseniz alanlarına state.page.<key>.<alan> ile erişilir'),
|
|
11
|
+
storage: z.enum(['memory', ...STATE_STORAGE_KINDS]).optional()
|
|
12
|
+
.describe("Değerin yaşadığı yer (yalnız mobil uygulamada uygulanır, MOB-014). Verilmezse kayıttaki tür korunur; yeni değişkende bellektir — state her sayfa açılışında buradaki value'dan başlar. 'device': cihaz deposu (AsyncStorage karşılığı), uygulama kapanıp açılınca son yazılan değer geri gelir. 'secure': güvenli depo (expo-secure-store), token gibi gizli ve küçük değerler için. 'memory': türü kaldırır. Çıkışta ikisi de silinir.")
|
|
9
13
|
})).min(1).describe("Değişken listesi: [{ key: 'MyTest', value: { isActive: true } }]. Gateway bunu platformun beklediği JSON string'e çevirir.");
|
|
10
14
|
const replaceParam = z.boolean().optional()
|
|
11
15
|
.describe('true: seti komple bunlarla değiştir (diğer değişkenler silinir). Varsayılan false — gateway mevcut setle birleştirir.');
|
|
@@ -22,7 +26,7 @@ export function registerVariableTools(server, platform) {
|
|
|
22
26
|
}
|
|
23
27
|
};
|
|
24
28
|
const write = async (method, { project, environment, applicationId, pageId, variables, replace }) => {
|
|
25
|
-
const incoming = variables.map(entry => ({ key: entry.key, value: entry.value
|
|
29
|
+
const incoming = variables.map(entry => ({ key: entry.key, value: entry.value, ...(entry.storage ? { storage: entry.storage } : {}) }));
|
|
26
30
|
const existing = replace === true ? [] : await readEntries(project, environment, applicationId, pageId);
|
|
27
31
|
const merged = mergeVariableEntries(existing, incoming, replace === true);
|
|
28
32
|
const response = await platform.tenant(method, project, variablePath(applicationId, pageId), {
|
|
@@ -33,9 +37,11 @@ export function registerVariableTools(server, platform) {
|
|
|
33
37
|
data: JSON.stringify(merged.entries)
|
|
34
38
|
}
|
|
35
39
|
});
|
|
40
|
+
const platformWarnings = await variableProfileWarnings(platform, applicationId, merged.entries.filter(entry => incoming.some(current => current.key === entry.key)));
|
|
36
41
|
return withNormalization({
|
|
37
42
|
scope: pageId ? 'page' : 'application',
|
|
38
43
|
variables: merged.entries.map(entry => entry.key),
|
|
44
|
+
...(platformWarnings.length > 0 ? { platformWarnings } : {}),
|
|
39
45
|
response
|
|
40
46
|
}, [
|
|
41
47
|
...merged.fixes,
|
|
@@ -44,7 +50,7 @@ export function registerVariableTools(server, platform) {
|
|
|
44
50
|
};
|
|
45
51
|
server.registerTool('variable_list', {
|
|
46
52
|
title: 'Değişkenleri getir',
|
|
47
|
-
description: "Application (pageId verilirse sayfa) değişken setini getirir. Platform seti tek kayıtta ve JSON STRING olarak tutar; gateway çözüp [{key, value}] dizisi döndürür. Sayfada okuma yolu: state.page.<key> (uygulama düzeyinde state.app.<key>).",
|
|
53
|
+
description: "Application (pageId verilirse sayfa) değişken setini getirir. Platform seti tek kayıtta ve JSON STRING olarak tutar; gateway çözüp [{key, value, storage?}] dizisi döndürür; storage yoksa değişken bellektedir. Sayfada okuma yolu: state.page.<key> (uygulama düzeyinde state.app.<key>).",
|
|
48
54
|
inputSchema: { project: projectParam, environment: environmentParam, applicationId: guid, pageId: guid.optional() },
|
|
49
55
|
annotations: readOnly
|
|
50
56
|
}, handle(config, async ({ project, environment, applicationId, pageId }) => ({
|
|
@@ -61,7 +67,7 @@ export function registerVariableTools(server, platform) {
|
|
|
61
67
|
}, handle(config, ({ project, environment, applicationId }) => platform.tenant('GET', project, `/variables/${applicationId}/pages`, { environment })));
|
|
62
68
|
server.registerTool('variable_create', {
|
|
63
69
|
title: 'Değişken tanımla',
|
|
64
|
-
description: "Application (pageId verilirse sayfa) değişkeni tanımlar. Platform uygulama/sayfa başına TEK kayıt tutar ve seti komple değiştirir; gateway mevcut setle birleştirir (replace: true ile ezersiniz). Sayfada kullanım: prop { type:'code', ref:\"{{ state.page.<key>.<alan> }}\" } ya da flow'da value { type:'state', ref:'<key>' }.",
|
|
70
|
+
description: "Application (pageId verilirse sayfa) değişkeni tanımlar. Platform uygulama/sayfa başına TEK kayıt tutar ve seti komple değiştirir; gateway mevcut setle birleştirir (replace: true ile ezersiniz). Sayfada kullanım: prop { type:'code', ref:\"{{ state.page.<key>.<alan> }}\" } ya da flow'da value { type:'state', ref:'<key>' }. State varsayılan olarak BELLEKTEDİR: sayfa her açıldığında value'dan başlar. Mobil uygulamada kalıcı olması için variables[].storage verin (platform_guide('mobile') §Kalıcı state).",
|
|
65
71
|
inputSchema: {
|
|
66
72
|
project: projectParam,
|
|
67
73
|
environment: environmentParam,
|
|
@@ -74,7 +80,7 @@ export function registerVariableTools(server, platform) {
|
|
|
74
80
|
}, handle(config, input => write('POST', input)));
|
|
75
81
|
server.registerTool('variable_update', {
|
|
76
82
|
title: 'Değişken güncelle',
|
|
77
|
-
description: "Var olan değişken setini günceller (variable_create zaten kayıt varsa update'e düşer; ikisi de aynı sonucu verir). Anahtar bazında birleştirir, replace: true ile seti komple değiştirir.",
|
|
83
|
+
description: "Var olan değişken setini günceller (variable_create zaten kayıt varsa update'e düşer; ikisi de aynı sonucu verir). Anahtar bazında birleştirir, replace: true ile seti komple değiştirir. storage vermediğiniz değişkenin kayıttaki saklama türü korunur.",
|
|
78
84
|
inputSchema: {
|
|
79
85
|
project: projectParam,
|
|
80
86
|
environment: environmentParam,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@appaflytech/zeyrek-ai-mcp",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.33",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Zeyrek (NgApps) platform APIs as MCP tools — data, logic and Studio design surface in one gateway",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -60,4 +60,4 @@
|
|
|
60
60
|
"typescript": "^5.7.2",
|
|
61
61
|
"vitest": "^3.0.0"
|
|
62
62
|
}
|
|
63
|
-
}
|
|
63
|
+
}
|