@appaflytech/zeyrek-ai-mcp 0.0.33 → 0.0.35
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 +0 -15
- package/dist/config.js +0 -11
- package/dist/index.js +0 -2
- package/dist/knowledge/boxSections.js +184 -0
- package/dist/knowledge/componentCatalog.js +634 -255
- package/dist/knowledge/componentEvents.js +38 -32
- package/dist/knowledge/layoutSummary.js +2 -140
- package/dist/knowledge/normalize.js +144 -117
- package/dist/knowledge/rules.js +42 -291
- package/dist/knowledge/styleResolve.js +53 -58
- package/dist/knowledge/themeResolve.js +4 -4
- package/dist/knowledge/themeSchema.js +2 -1
- package/dist/observability/trace.js +1 -1
- package/dist/platform/diagnostics.js +4 -10
- package/dist/platform/domSummary.js +1 -1
- package/dist/platform/http.js +7 -23
- package/dist/platform/responses.js +2 -6
- package/dist/platform/screenshot.js +1162 -0
- package/dist/platform/secrets.js +0 -9
- package/dist/platform/strictArguments.js +12 -68
- package/dist/platform/tokenVault.js +4 -187
- package/dist/resources/examples/layout-app-shell.json +707 -229
- package/dist/resources/examples/page-flex-sections.json +1 -1
- package/dist/resources/guides/component.md +6 -14
- package/dist/resources/guides/entity.md +5 -3
- package/dist/resources/guides/expressions.md +5 -14
- package/dist/resources/guides/functions.md +1 -1
- package/dist/resources/guides/layout.md +58 -55
- package/dist/resources/guides/microservice.md +2 -9
- package/dist/resources/guides/middleware.md +2 -34
- package/dist/resources/guides/page.md +179 -256
- package/dist/resources/guides/theme.md +3 -8
- package/dist/resources/guides/translation.md +1 -1
- package/dist/resources/guides/workflow.md +1 -7
- package/dist/resources/schema-fingerprint.json +4 -4
- package/dist/resources/schemas/GlobalFunctionUpdateResultDto.json +1 -3
- package/dist/resources/schemas/MicroserviceDto.json +2 -2
- package/dist/server.js +1 -7
- package/dist/tools/applications.js +3 -60
- package/dist/tools/components.js +16 -103
- package/dist/tools/datasources.js +1 -1
- package/dist/tools/designSchemaPatch.js +19 -23
- package/dist/tools/externalComponents.js +4 -25
- package/dist/tools/flows.js +13 -80
- package/dist/tools/layouts.js +20 -48
- package/dist/tools/microservices.js +10 -32
- package/dist/tools/pages.js +115 -396
- package/dist/tools/platformInfo.js +2 -7
- package/dist/tools/rows.js +1 -7
- package/dist/tools/schemaOps.js +4 -35
- package/dist/tools/screenWrite.js +37 -25
- package/dist/tools/screens.js +4 -91
- package/dist/tools/variables.js +5 -11
- package/package.json +2 -2
- package/dist/knowledge/access.js +0 -802
- package/dist/knowledge/case.js +0 -41
- package/dist/knowledge/connectDataBind.js +0 -819
- package/dist/knowledge/connectDataDefinition.js +0 -341
- package/dist/knowledge/connectDataExecute.js +0 -93
- package/dist/knowledge/connectDataRules.js +0 -128
- package/dist/knowledge/decision.js +0 -121
- package/dist/knowledge/expressionPrelude.js +0 -59
- package/dist/knowledge/microserviceParameters.js +0 -58
- package/dist/knowledge/mining.js +0 -94
- package/dist/knowledge/mobileComponentCatalog.js +0 -864
- package/dist/knowledge/mobileComponentEvents.js +0 -239
- package/dist/knowledge/mobileStore.js +0 -227
- package/dist/knowledge/platform/lint.js +0 -385
- package/dist/knowledge/platform/mobile.js +0 -142
- package/dist/knowledge/platform/mobileLayoutLint.js +0 -324
- package/dist/knowledge/platform/mobileRules.js +0 -231
- package/dist/knowledge/platform/mobileSpacing.js +0 -82
- package/dist/knowledge/platform/mobileTabs.js +0 -108
- package/dist/knowledge/platform/nativeBoxModel.js +0 -44
- package/dist/knowledge/platform/profile.js +0 -25
- package/dist/knowledge/platform/resolve.js +0 -122
- package/dist/knowledge/platform/web.js +0 -39
- package/dist/knowledge/process.js +0 -510
- package/dist/knowledge/rowFilter.js +0 -43
- package/dist/knowledge/styleResolveNative.js +0 -527
- package/dist/platform/argumentAliases.js +0 -128
- package/dist/platform/bodyFile.js +0 -103
- package/dist/platform/capture/actions.js +0 -333
- package/dist/platform/capture/browser.js +0 -1
- package/dist/platform/capture/capture.js +0 -659
- package/dist/platform/capture/console-log.js +0 -122
- package/dist/platform/capture/index.js +0 -11
- package/dist/platform/capture/readiness.js +0 -103
- package/dist/platform/capture/summary.js +0 -77
- package/dist/platform/capture/target.js +0 -5
- package/dist/platform/capture/targets/studio-mobile.js +0 -15
- package/dist/platform/capture/targets/studio-web.js +0 -5
- package/dist/platform/impersonation.js +0 -45
- package/dist/platform/jsonArray.js +0 -24
- package/dist/platform/schemaReadMemory.js +0 -60
- package/dist/resources/examples/bpm-gorev-kontrol.json +0 -294
- package/dist/resources/examples/bpm-iso-dokuman.json +0 -228
- package/dist/resources/examples/bpm-satinalma.json +0 -376
- package/dist/resources/examples/connect-data-convert-verify.json +0 -107
- package/dist/resources/examples/connect-data-dropdown-roles.json +0 -66
- package/dist/resources/examples/connect-data-edit-m2m.json +0 -73
- package/dist/resources/examples/connect-data-query-params.json +0 -50
- package/dist/resources/examples/connect-data-table-entity.json +0 -147
- package/dist/resources/examples/connect-data-workflow-microservice.json +0 -65
- package/dist/resources/examples/mobile-app-shell-drawer.json +0 -244
- package/dist/resources/examples/mobile-app-shell-stack.json +0 -157
- package/dist/resources/examples/mobile-app-shell-tab.json +0 -208
- package/dist/resources/examples/mobile-form-screen.json +0 -365
- package/dist/resources/examples/mobile-list-detail-form.json +0 -703
- package/dist/resources/guides/access.md +0 -796
- package/dist/resources/guides/bpm.md +0 -686
- package/dist/resources/guides/case.md +0 -153
- package/dist/resources/guides/decision.md +0 -185
- package/dist/resources/guides/mobile-layout.md +0 -193
- package/dist/resources/guides/mobile.md +0 -578
- package/dist/resources/read.js +0 -41
- package/dist/resources/schemas/AccessExplanationDto.json +0 -144
- package/dist/resources/schemas/AccessMatrixDto.json +0 -170
- package/dist/resources/schemas/AccessPermissionDto.json +0 -57
- package/dist/resources/schemas/AccessPolicyDto.json +0 -223
- package/dist/resources/schemas/AccessResourceDto.json +0 -86
- package/dist/resources/schemas/AppSessionDto.json +0 -53
- package/dist/resources/schemas/ConnectDataDescribeDto.json +0 -344
- package/dist/resources/schemas/ConnectDataRequestModel.json +0 -202
- package/dist/resources/schemas/ConnectDataResultDto.json +0 -421
- package/dist/resources/schemas/ConnectorCredentialDto.json +0 -70
- package/dist/resources/schemas/ConvertConnectDataToMicroserviceCommand.json +0 -37
- package/dist/resources/schemas/CreateAccessPolicyCommand.json +0 -209
- package/dist/resources/schemas/CreateDecisionCommand.json +0 -221
- package/dist/resources/schemas/CreateProcessDefinitionCommand.json +0 -1337
- package/dist/resources/schemas/DecisionDto.json +0 -302
- package/dist/resources/schemas/DetachConnectDataMicroserviceCommand.json +0 -28
- package/dist/resources/schemas/ExplainAccessQuery.json +0 -33
- package/dist/resources/schemas/GenerateProcessDocumentCommand.json +0 -116
- package/dist/resources/schemas/OrganizationProjectDto.json +0 -335
- package/dist/resources/schemas/OrganizationSchemaDto.json +0 -196
- package/dist/resources/schemas/OrganizationSchemaVersionDto.json +0 -207
- package/dist/resources/schemas/PatchProcessDefinitionCommand.json +0 -76
- package/dist/resources/schemas/ProcessDefinitionDto.json +0 -1480
- package/dist/resources/schemas/ProcessSimulationDto.json +0 -96
- package/dist/resources/schemas/SaveConnectorCredentialCommand.json +0 -90
- package/dist/resources/schemas/SaveProcessEventSourceCommand.json +0 -61
- package/dist/resources/schemas/SaveProcessMailSourceCommand.json +0 -89
- package/dist/resources/schemas/SignProcessTaskCommand.json +0 -73
- package/dist/resources/schemas/SimulateProcessDefinitionQuery.json +0 -92
- package/dist/resources/schemas/StartMobileBuildCommand.json +0 -54
- package/dist/resources/schemas/UpdateAccessPolicyCommand.json +0 -209
- package/dist/resources/schemas/UpdateDecisionCommand.json +0 -216
- package/dist/resources/schemas/UpdateProcessDefinitionCommand.json +0 -1357
- package/dist/resources/schemas/UpsertMobileStoreSettingsCommand.json +0 -259
- package/dist/resources/schemas/ValidateProcessDefinitionQuery.json +0 -1339
- package/dist/tools/accessOperations.js +0 -135
- package/dist/tools/accessPolicies.js +0 -170
- package/dist/tools/accessRuntime.js +0 -203
- package/dist/tools/bpm.js +0 -343
- package/dist/tools/bpmGovernance.js +0 -266
- package/dist/tools/bpmOperations.js +0 -230
- package/dist/tools/bpmReporting.js +0 -154
- package/dist/tools/bpmRouting.js +0 -150
- package/dist/tools/bpmRuntime.js +0 -396
- package/dist/tools/case.js +0 -178
- package/dist/tools/caseRuntime.js +0 -89
- package/dist/tools/connectData.js +0 -449
- package/dist/tools/connectors.js +0 -193
- package/dist/tools/decisions.js +0 -206
- package/dist/tools/mobile.js +0 -221
- package/dist/tools/mobileStore.js +0 -268
- package/dist/tools/modules.js +0 -48
- package/dist/tools/organizationStructure.js +0 -137
- package/dist/tools/profileWrite.js +0 -92
|
@@ -18,6 +18,7 @@ yazmalarının aksine burada "önce development'ta dene" diye bir ayrım YOKTUR.
|
|
|
18
18
|
| Alan | Ne yapar | Ürettiği değişken(ler) |
|
|
19
19
|
|---|---|---|
|
|
20
20
|
| `mode` | `'light'` (varsayılan) \| `'dark'` — yayınlanan uygulamanın modu | palet tabanını seçer |
|
|
21
|
+
| `direction` | `'ltr'` \| `'rtl'` \| `'auto'` — sayfanın okuma yönü; `auto` uygulama dilinden türetir (`ar` `he` `fa` `ur` `ps` `sd` `ug` `yi` `dv` → rtl). Ayar YOKSA `dir` hiç yazılmaz (sayfa üst öğenin yönünü miras alır): `ar` ile kurulmuş mevcut proje bu ayar açılmadan aynalanmaz. Sayfa oluşturucu tuvali yönü uygulamaz. Grid yerleşimi kendiliğinden aynalanır; bileşenlerin ok simgeleri ve fiziksel `left/right` CSS'i bileşen bazında düzeltilir (ADR 0006) | CSS değişkeni üretmez, kap `dir` özniteliğine yazılır |
|
|
21
22
|
| `palette` | AYDINLIK moddaki renk override'ları; `accent.onPrimary` isteğe bağlıdır — accent ÜSTÜNDEKİ metin, verilmezse kontrasttan türer (`#4787FA` gibi açık bir mavi siyah metin üretir, tasarımda beyazsa buraya yazın) | `--ng-accent-*` · `--ng-background-*` · `--ng-text-*` · `--ng-border-*` · `--ng-status-*` · `--ng-text-on-accent` |
|
|
22
23
|
| `paletteDark` | KARANLIK moddaki renk override'ları | aynı küme |
|
|
23
24
|
| `fontFamily` · `headingFontFamily` | Gövde ve başlık yazı tipi (Google Fonts adı) | `--ng-font` · `--ng-font-heading` |
|
|
@@ -47,10 +48,7 @@ Değişkenlerin tam listesi ve o projedeki değerleri: `theme_get(view:'resolved
|
|
|
47
48
|
sırası bellidir: projenin tamamı için tema token'ı (`theme_update`), tekrar eden bir kalıp için
|
|
48
49
|
adlı preset (`presets` + `style.$preset`), yalnız o düğüme özgü karar için düğümün kendi
|
|
49
50
|
`style`'ı. Sabit hex yazmak yerine `var(--ng-accent-primary)` yazmak, düğümü temaya BAĞLI
|
|
50
|
-
tutar.
|
|
51
|
-
yüzeyler `--ng-background-surface`, `--ng-background-surface-alt`, `--ng-background-canvas`). Mobil
|
|
52
|
-
çizici yalnız bunları çözer; `var(--ng-surface)` gibi tanımsız bir ad cihazda saydam kalır ve iOS
|
|
53
|
-
gölgesi içeriğe düşer (THEME-012 uyarısı).
|
|
51
|
+
tutar.
|
|
54
52
|
|
|
55
53
|
**2. Marka rengi tek çağrıdır.** `theme_update({ palette: { accent: { primary, hover } } })`
|
|
56
54
|
sayfadaki her butonu, odak halkasını, seçili satırı ve grafik serisini birden çevirir. Komponent
|
|
@@ -101,10 +99,7 @@ theme_update({ theme: {
|
|
|
101
99
|
```
|
|
102
100
|
|
|
103
101
|
**Yazı tipi ve ölçek:** `fontFamily` panelin Google Fonts listesinden bir ad olmalı — runtime
|
|
104
|
-
fontu ADIYLA Google'dan çeker, tanınmayan ad sessizce sans-serif'e düşer (THEME-008).
|
|
105
|
-
aynı kural geçerlidir: cihaz aynı adı Google Fonts'tan TTF olarak indirip `expo-font` ile yükler
|
|
106
|
-
(400 ve 700 kalınlık) — Android'de kalın yüz SENTETİKTİR (iOS gerçek kalın dosyayı çizer,
|
|
107
|
-
ZM-10, 2026-09-26).
|
|
102
|
+
fontu ADIYLA Google'dan çeker, tanınmayan ad sessizce sans-serif'e düşer (THEME-008).
|
|
108
103
|
|
|
109
104
|
```jsonc
|
|
110
105
|
theme_update({ theme: {
|
|
@@ -208,7 +208,7 @@ gerekmez — `schema.ts`'e dokunulmaz, katalog yeniden yüklenmez.
|
|
|
208
208
|
`translation_update` artık uygulamanın bütün sayfalarının önbellek satırlarını düşürüyor
|
|
209
209
|
(`RefreshPageCacheWhenTranslationChangedCommand`), okuma yolu cache-aside olduğu için bir
|
|
210
210
|
sonraki `page_runtime_get` taze değeri kurar. Yazmadan hemen sonra okuyabilirsin.
|
|
211
|
-
- Mobil
|
|
211
|
+
- Mobil runtime (`apps/mobile`) bu özelliği henüz beslemiyor — yalnız web.
|
|
212
212
|
|
|
213
213
|
## Backend doğrulama sınırları (TR-001)
|
|
214
214
|
|
|
@@ -651,15 +651,9 @@ Tam örnek, ölçülen çıktı şekli ve `code` çocuğu tuzağının çıkış
|
|
|
651
651
|
|
|
652
652
|
```js
|
|
653
653
|
// dizi (isSingle:false) · nesne (isSingle:true) · düz değer (yalnız pk dönen yazma)
|
|
654
|
-
(
|
|
654
|
+
(Array.isArray(x.data) ? (x.data[0] && x.data[0].id) : (x.data && x.data.id !== undefined ? x.data.id : x.data))
|
|
655
655
|
```
|
|
656
656
|
|
|
657
|
-
Diziyi `Array.isArray` ile değil `.length` ile tanıyın: 2026-09-27'den önceki backend'de tablo
|
|
658
|
-
adımının listesi Jint'e sarılı bir CLR nesnesi olarak iniyordu ve `Array.isArray(x.data)` `false`
|
|
659
|
-
dönüyordu — koşuda (2026-09-24) giriş akışı bu yüzden her kullanıcıyı 401 ile reddetti
|
|
660
|
-
(`zeyrek-backend/docs/incident-log.md` #89). `.length`, `.map`, `.filter` o sürümde de çalışıyordu;
|
|
661
|
-
düzeltilmiş backend'de `Array.isArray` de doğrudur.
|
|
662
|
-
|
|
663
657
|
Şekli bilmiyorsan bu yazımı kullan; `workflow_preview` çıktısında `steps[].output`'a bakarak
|
|
664
658
|
hangi vakada olduğunu da görebilirsin.
|
|
665
659
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
-
"hash": "
|
|
3
|
-
"generatedAt": "2026-
|
|
4
|
-
"types":
|
|
5
|
-
"files":
|
|
2
|
+
"hash": "06f7d6b64937424fcbe7a9c8751e90a5224556e0c970199fb199cfa3a147c7d2",
|
|
3
|
+
"generatedAt": "2026-09-28T09:04:34.182Z",
|
|
4
|
+
"types": 186,
|
|
5
|
+
"files": 108,
|
|
6
6
|
"note": "Şemaları üreten backend kaynaklarının parmak izi. Elle düzenlemeyin: 'npm run generate-schemas' yazar, 'npm run schema:check' denetler.",
|
|
7
7
|
"missing": [
|
|
8
8
|
"NgApps.Infrastructure.Models.IdNamePair`1[[System.Guid, System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]"
|
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
"roles": {
|
|
108
108
|
"type": "array",
|
|
109
109
|
"items": {
|
|
110
|
-
"$ref": "#/components/schemas/NgApps.Infrastructure.Models.IdNamePair`1[[System.Guid, System.Private.CoreLib, Version=
|
|
110
|
+
"$ref": "#/components/schemas/NgApps.Infrastructure.Models.IdNamePair`1[[System.Guid, System.Private.CoreLib, Version=10.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]"
|
|
111
111
|
},
|
|
112
112
|
"nullable": true
|
|
113
113
|
},
|
|
@@ -398,7 +398,7 @@
|
|
|
398
398
|
},
|
|
399
399
|
"additionalProperties": false
|
|
400
400
|
},
|
|
401
|
-
"NgApps.Infrastructure.Models.IdNamePair`1[[System.Guid, System.Private.CoreLib, Version=
|
|
401
|
+
"NgApps.Infrastructure.Models.IdNamePair`1[[System.Guid, System.Private.CoreLib, Version=10.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]": {
|
|
402
402
|
"type": "object",
|
|
403
403
|
"properties": {
|
|
404
404
|
"id": {
|
package/dist/server.js
CHANGED
|
@@ -39,8 +39,6 @@ import { registerMergeTools } from "./tools/merges.js";
|
|
|
39
39
|
import { registerRevisionTools } from "./tools/revisions.js";
|
|
40
40
|
import { registerActivityTools } from "./tools/activities.js";
|
|
41
41
|
import { registerDtoTools } from "./tools/dtos.js";
|
|
42
|
-
import { registerMobileTools } from "./tools/mobile.js";
|
|
43
|
-
import { registerMobileStoreTools } from "./tools/mobileStore.js";
|
|
44
42
|
const moduleRegistrations = {
|
|
45
43
|
platform: registerPlatformTools,
|
|
46
44
|
project: registerProjectTools,
|
|
@@ -82,13 +80,9 @@ const moduleRegistrations = {
|
|
|
82
80
|
merge: registerMergeTools,
|
|
83
81
|
activity: registerActivityTools,
|
|
84
82
|
revision: registerRevisionTools,
|
|
85
|
-
mobile: (server, platform) => {
|
|
86
|
-
registerMobileTools(server, platform);
|
|
87
|
-
registerMobileStoreTools(server, platform);
|
|
88
|
-
},
|
|
89
83
|
};
|
|
90
84
|
export function createGatewayServer(platform) {
|
|
91
|
-
const server = rejectUnknownArguments(instrumentServer(new McpServer({ name: "ngapps", version: "0.1.0" }), platform.config)
|
|
85
|
+
const server = rejectUnknownArguments(instrumentServer(new McpServer({ name: "ngapps", version: "0.1.0" }), platform.config));
|
|
92
86
|
for (const moduleName of platform.config.modules) {
|
|
93
87
|
moduleRegistrations[moduleName](server, platform);
|
|
94
88
|
}
|
|
@@ -1,44 +1,6 @@
|
|
|
1
1
|
import { guid, pagingParams, readOnly, writes, updates, destructive } from './common.js';
|
|
2
2
|
import { handle } from '../platform/responses.js';
|
|
3
|
-
import { forgetApplication, readApplicationPlatform, resolveApplication } from '../knowledge/platform/resolve.js';
|
|
4
|
-
import { mobileTabsProblems, readMobileTabs } from '../knowledge/platform/mobileTabs.js';
|
|
5
|
-
import { findingLine } from '../knowledge/platform/profile.js';
|
|
6
3
|
import { z } from 'zod';
|
|
7
|
-
/**
|
|
8
|
-
* MOB-007 (sekme ayarı) — `properties.mobile.tabs` yazan mobil uygulama çağrısının denetimi. Yazım
|
|
9
|
-
* platforma YİNE gider (D3; backend `properties`'i doğrulamaz): bulgu `platformWarnings`'e düşer.
|
|
10
|
-
* Sayfa ve widget listesi okunamazsa o denetimler atlanır, biçim denetimi yine koşar.
|
|
11
|
-
*/
|
|
12
|
-
export async function mobileTabsWarnings(platform, applicationId, projectSlug, homepageId, properties) {
|
|
13
|
-
const tabs = readMobileTabs(properties);
|
|
14
|
-
if (tabs === undefined)
|
|
15
|
-
return [];
|
|
16
|
-
const pages = applicationId && projectSlug
|
|
17
|
-
? await platform.tenant('GET', projectSlug, `/pages/${applicationId}`, { query: { pageIndex: 0, pageLength: 200 } })
|
|
18
|
-
.then(response => (response?.data ?? []).map(page => ({ id: String(page.id ?? '') })))
|
|
19
|
-
.catch(() => undefined)
|
|
20
|
-
: undefined;
|
|
21
|
-
const widgetIds = applicationId && projectSlug
|
|
22
|
-
? await platform.tenant('GET', projectSlug, `/components/${applicationId}`, { query: { pageIndex: 0, pageLength: 999 } })
|
|
23
|
-
.then(response => new Set((response?.data ?? []).filter(entry => entry.kind === 'widget').map(entry => String(entry.id ?? ''))))
|
|
24
|
-
.catch(() => undefined)
|
|
25
|
-
: undefined;
|
|
26
|
-
return mobileTabsProblems(tabs, {
|
|
27
|
-
...(pages ? { pages } : {}),
|
|
28
|
-
...(homepageId ? { homepageId } : {}),
|
|
29
|
-
...(widgetIds ? { widgetIds } : {})
|
|
30
|
-
}).map(message => findingLine({
|
|
31
|
-
code: 'MOB-007',
|
|
32
|
-
severity: 'warn',
|
|
33
|
-
message,
|
|
34
|
-
guide: "platform_guide('mobile') §Gezinme"
|
|
35
|
-
}));
|
|
36
|
-
}
|
|
37
|
-
function withPlatformWarnings(response, warnings) {
|
|
38
|
-
if (warnings.length === 0 || !response || typeof response !== 'object' || Array.isArray(response))
|
|
39
|
-
return response;
|
|
40
|
-
return { ...response, platformWarnings: warnings };
|
|
41
|
-
}
|
|
42
4
|
export function registerApplicationTools(server, platform) {
|
|
43
5
|
const config = platform.config;
|
|
44
6
|
server.registerTool('application_list', {
|
|
@@ -72,14 +34,7 @@ export function registerApplicationTools(server, platform) {
|
|
|
72
34
|
notFoundPageId: guid.optional()
|
|
73
35
|
},
|
|
74
36
|
annotations: writes
|
|
75
|
-
}, handle(config,
|
|
76
|
-
const warnings = readApplicationPlatform(body.type) === 'mobile'
|
|
77
|
-
? await mobileTabsWarnings(platform, undefined, undefined, undefined, body.properties)
|
|
78
|
-
: [];
|
|
79
|
-
const response = await platform.org('POST', `/applications/${projectId}`, { body });
|
|
80
|
-
forgetApplication(platform);
|
|
81
|
-
return withPlatformWarnings(response, warnings);
|
|
82
|
-
}));
|
|
37
|
+
}, handle(config, ({ projectId, ...body }) => platform.org('POST', `/applications/${projectId}`, { body })));
|
|
83
38
|
server.registerTool('application_update', {
|
|
84
39
|
title: 'Application güncelle',
|
|
85
40
|
description: 'Application bilgilerini günceller; homepageId zorunludur (mevcut değeri application_get ile alın).',
|
|
@@ -94,23 +49,11 @@ export function registerApplicationTools(server, platform) {
|
|
|
94
49
|
notFoundPageId: guid.optional()
|
|
95
50
|
},
|
|
96
51
|
annotations: updates
|
|
97
|
-
}, handle(config,
|
|
98
|
-
const current = await resolveApplication(platform, id);
|
|
99
|
-
const warnings = current?.platform === 'mobile'
|
|
100
|
-
? await mobileTabsWarnings(platform, id, current.projectSlug, body.homepageId, body.properties)
|
|
101
|
-
: [];
|
|
102
|
-
const response = await platform.org('PUT', `/applications/${id}`, { body });
|
|
103
|
-
forgetApplication(platform, id);
|
|
104
|
-
return withPlatformWarnings(response, warnings);
|
|
105
|
-
}));
|
|
52
|
+
}, handle(config, ({ id, ...body }) => platform.org('PUT', `/applications/${id}`, { body })));
|
|
106
53
|
server.registerTool('application_delete', {
|
|
107
54
|
title: 'Application sil',
|
|
108
55
|
description: 'Application\'ı kalıcı olarak siler.',
|
|
109
56
|
inputSchema: { id: guid },
|
|
110
57
|
annotations: destructive
|
|
111
|
-
}, handle(config,
|
|
112
|
-
const response = await platform.org('DELETE', `/applications/${args.id}`);
|
|
113
|
-
forgetApplication(platform, args.id);
|
|
114
|
-
return response;
|
|
115
|
-
}));
|
|
58
|
+
}, handle(config, args => platform.org('DELETE', `/applications/${args.id}`)));
|
|
116
59
|
}
|
package/dist/tools/components.js
CHANGED
|
@@ -1,81 +1,25 @@
|
|
|
1
1
|
import { guid, projectParam, environmentParam, readOnly, writes, updates, destructive } from './common.js';
|
|
2
|
-
import { normalizeComponentDefaults, componentDefaultsNote, clampBlockSizes, blockSizeNote, normalizeHeightTypes, heightTypeNote, normalizeSizeStrings, sizeStringNote,
|
|
2
|
+
import { normalizeComponentDefaults, componentDefaultsNote, assertComponentBlocks, clampBlockSizes, blockSizeNote, normalizeHeightTypes, heightTypeNote, normalizeSizeStrings, sizeStringNote, withNormalization } from '../knowledge/normalize.js';
|
|
3
3
|
import { eventContractsFor, eventPayloadNote } from '../knowledge/componentEvents.js';
|
|
4
4
|
import { componentPresetDefaults, readProjectTheme } from '../knowledge/themeSchema.js';
|
|
5
5
|
import { knowledgeFor, knowledgeNote, APPEARANCE_TOKEN_SETS, STATE_FLAG_NOTES, INTERNAL_ROLES_BY_TYPE } from '../knowledge/componentCatalog.js';
|
|
6
|
-
import { MOBILE_STATE_FLAG_NOTES, mobileComponentKnowledge } from '../knowledge/mobileComponentCatalog.js';
|
|
7
|
-
import { mobileComponentEventContracts } from '../knowledge/mobileComponentEvents.js';
|
|
8
6
|
import { componentUpdateBody, fetchHost, schemaParam, unwrap } from './screens.js';
|
|
9
7
|
import { PlatformApiError } from '../platform/errors.js';
|
|
10
8
|
import { handle } from '../platform/responses.js';
|
|
11
|
-
import { applicationTypeField, resolveProfile } from '../knowledge/platform/resolve.js';
|
|
12
|
-
import { mobileComponentNotes } from '../knowledge/platform/mobileRules.js';
|
|
13
|
-
import { randomUUID } from 'node:crypto';
|
|
14
9
|
import { z } from 'zod';
|
|
15
|
-
const typeParam = z.enum(['web', 'mobile']).optional().describe('Hedef platform
|
|
10
|
+
const typeParam = z.enum(['web', 'mobile']).optional().describe('Hedef platform; varsayılan web');
|
|
16
11
|
const kindParam = z.enum(['component', 'widget']).optional()
|
|
17
12
|
.describe("component: sayfaya konan tekil eleman. widget: kendi şeması olan kapsayıcı (container/modal/drawer)");
|
|
18
13
|
const widgetTypeParam = z.enum(['container', 'modal', 'drawer']).optional()
|
|
19
14
|
.describe("kind:'widget' iken zorunlu");
|
|
20
|
-
/**
|
|
21
|
-
* Uç `type` verilmezse WEB kataloğunu döner (`GetComponentsQuery` `Type ?? Web`); mobil uygulamanın
|
|
22
|
-
* paleti, doğrulayıcısı ve widget'ları `type=mobile` satırlarıdır. Profil mobil derse sorgu tipi
|
|
23
|
-
* taşır; web'de sorgu profil öncesiyle aynıdır (G1 kilidi).
|
|
24
|
-
*/
|
|
25
15
|
async function listComponents(platform, project, environment, applicationId, scope) {
|
|
26
16
|
const path = scope === 'all' ? `/components/${applicationId}/all` : `/components/${applicationId}`;
|
|
27
|
-
const catalogType = scope === 'all' ? 'web' : (await resolveProfile(platform, applicationId)).profile.catalogType;
|
|
28
17
|
const response = await platform.tenant('GET', project, path, {
|
|
29
18
|
environment,
|
|
30
|
-
query: scope === 'all' ? undefined : { pageIndex: 0, pageLength: 999
|
|
19
|
+
query: scope === 'all' ? undefined : { pageIndex: 0, pageLength: 999 }
|
|
31
20
|
});
|
|
32
21
|
return response?.data ?? [];
|
|
33
22
|
}
|
|
34
|
-
/**
|
|
35
|
-
* CMP-002 (ARC-081) — runtime widget'ın kökünü yalnız `widget-area` (container) ya da `modal`/`drawer`
|
|
36
|
-
* tipinden tanır (`runtime-compose.ts` `getRuntimeWidgetRootNode`); düz `container` kökle kaydedilen
|
|
37
|
-
* widget her yüzeyde boş çizilir. Tipli kök yoksa düğümler Studio'nun `createWidgetRootNode`'u
|
|
38
|
-
* (`widget.functions.ts`) ile aynı şekilde bir köke sarılır: prop'lar uygulamanın kataloğundaki kök
|
|
39
|
-
* tipinin `definition.defaults`'ı, yükseklik `fixed`, kök bırakılabilir.
|
|
40
|
-
*/
|
|
41
|
-
function wrapWidgetRoot(schema, widgetType, components) {
|
|
42
|
-
const rootType = widgetType === 'container' ? 'widget-area' : widgetType;
|
|
43
|
-
// Runtime istenen tipin kökü yoksa öteki tipli köklere de düşer (`legacyRoot()`); tip değiştiren
|
|
44
|
-
// güncellemenin eski kökü ikinci kez sarılmaz.
|
|
45
|
-
const hasRoot = schema.some(node => node?.kind === 'component' && ['widget-area', 'modal', 'drawer'].includes(String(node.type)));
|
|
46
|
-
if (hasRoot)
|
|
47
|
-
return { schema, notes: [] };
|
|
48
|
-
const definition = (components.find(component => component.slug === rootType)?.definition ?? {});
|
|
49
|
-
const desktopBlock = Array.isArray(definition.blocks)
|
|
50
|
-
? definition.blocks.find(block => block?.breakpoint === 1024)
|
|
51
|
-
: undefined;
|
|
52
|
-
const elementId = `${rootType}${randomUUID().slice(0, 4)}`;
|
|
53
|
-
const root = {
|
|
54
|
-
id: randomUUID(),
|
|
55
|
-
elementId,
|
|
56
|
-
name: widgetType === 'container' ? 'container' : elementId,
|
|
57
|
-
widgetType,
|
|
58
|
-
kind: 'component',
|
|
59
|
-
type: rootType,
|
|
60
|
-
children: schema,
|
|
61
|
-
events: [],
|
|
62
|
-
props: { ...(definition.defaults ?? {}) },
|
|
63
|
-
blocks: desktopBlock ? [{ breakpoint: 1024, size: desktopBlock.size, position: { x: 0, y: 0 } }] : [],
|
|
64
|
-
validations: [],
|
|
65
|
-
appearance: { heightType: 'fixed' },
|
|
66
|
-
states: { isDroppable: true },
|
|
67
|
-
stateBindings: []
|
|
68
|
-
};
|
|
69
|
-
return {
|
|
70
|
-
schema: [root],
|
|
71
|
-
notes: [`CMP-002: widget şemasında '${rootType}' kökü yoktu; ${schema.length} düğüm '${elementId}' köküne sarıldı (Studio'nun kurduğu şekil). Runtime widget'ı yalnız widget-area/modal/drawer kökünden çizer.`]
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
/** Uygulamanın kayıtlı bileşen slug'ları (mobil profilin MOB-003 denetimi). */
|
|
75
|
-
export async function fetchCatalogSlugs(platform, project, environment, applicationId) {
|
|
76
|
-
const components = await listComponents(platform, project, environment, applicationId);
|
|
77
|
-
return new Set(components.map(component => String(component.slug ?? '')).filter(slug => slug.length > 0));
|
|
78
|
-
}
|
|
79
23
|
/**
|
|
80
24
|
* Yerleşim normalizasyonlarının ikisi de aynı katalog listesinden beslenir; tek okumada
|
|
81
25
|
* çıkarılır ki yazma yolları fazladan istek atmasın. Uygulamanın kendi sözlüğü okunur
|
|
@@ -94,17 +38,12 @@ export async function fetchComponentLayoutRules(platform, project, environment,
|
|
|
94
38
|
export function componentLayoutRules(components) {
|
|
95
39
|
const maxSizes = new Map();
|
|
96
40
|
const autoHeights = new Map();
|
|
97
|
-
const droppable = new Map();
|
|
98
41
|
for (const component of components) {
|
|
99
42
|
const slug = typeof component.slug === 'string' ? component.slug : undefined;
|
|
100
43
|
if (!slug)
|
|
101
44
|
continue;
|
|
102
45
|
if (typeof component.isDefaultAutoHeight === 'boolean')
|
|
103
46
|
autoHeights.set(slug, component.isDefaultAutoHeight);
|
|
104
|
-
// Kap bilgisi sözlükten gelir; düğümün `states.isDroppable`ı onu izler (Studio paleti de
|
|
105
|
-
// aynı alanı katalogdan yazar). `true` gören tip kap sayılır.
|
|
106
|
-
if (typeof component.isDroppable === 'boolean')
|
|
107
|
-
droppable.set(slug, component.isDroppable);
|
|
108
47
|
const blocks = (component.definition ?? {}).blocks;
|
|
109
48
|
if (!Array.isArray(blocks))
|
|
110
49
|
continue;
|
|
@@ -119,7 +58,7 @@ export function componentLayoutRules(components) {
|
|
|
119
58
|
});
|
|
120
59
|
}
|
|
121
60
|
}
|
|
122
|
-
return { maxSizes, autoHeights
|
|
61
|
+
return { maxSizes, autoHeights };
|
|
123
62
|
}
|
|
124
63
|
/**
|
|
125
64
|
* Katalog okuması başarısız olsa da yazma isteği gitmeli, ama iki normalizasyonun düşüş davranışı
|
|
@@ -130,21 +69,14 @@ export function componentLayoutRules(components) {
|
|
|
130
69
|
* varsayılanını (`fixed`, `DesignComponentManagementSchema.cs:24`) kabul etmek demektir; en fazla
|
|
131
70
|
* sekiz tipte (auth-layout/html/image/layout/qrcode/table/text-editor/video) fazladan yükseklik
|
|
132
71
|
* üretir, atlamak ise her tipte içerik kırpar.
|
|
133
|
-
* - `states.isDroppable` atlanır — katalog okunamadığında hangi tipin kap olduğu bilinmez ve
|
|
134
|
-
* uydurulmaz; düğüm bugünkü hâliyle yazılır.
|
|
135
72
|
*/
|
|
136
73
|
export async function applyCatalogLayoutRules(platform, project, environment, applicationId, nodes) {
|
|
137
74
|
try {
|
|
138
75
|
const rules = await fetchComponentLayoutRules(platform, project, environment, applicationId);
|
|
139
|
-
return {
|
|
140
|
-
clamped: clampBlockSizes(nodes, rules.maxSizes),
|
|
141
|
-
heights: normalizeHeightTypes(nodes, rules.autoHeights),
|
|
142
|
-
sizes: normalizeSizeStrings(nodes),
|
|
143
|
-
states: normalizeDroppableStates(nodes, rules.droppable)
|
|
144
|
-
};
|
|
76
|
+
return { clamped: clampBlockSizes(nodes, rules.maxSizes), heights: normalizeHeightTypes(nodes, rules.autoHeights), sizes: normalizeSizeStrings(nodes) };
|
|
145
77
|
}
|
|
146
78
|
catch {
|
|
147
|
-
return { clamped: [], heights: normalizeHeightTypes(nodes, new Map()), sizes: normalizeSizeStrings(nodes)
|
|
79
|
+
return { clamped: [], heights: normalizeHeightTypes(nodes, new Map()), sizes: normalizeSizeStrings(nodes) };
|
|
148
80
|
}
|
|
149
81
|
}
|
|
150
82
|
/**
|
|
@@ -184,7 +116,6 @@ export function registerComponentTools(server, platform) {
|
|
|
184
116
|
}, handle(config, async ({ project, environment, applicationId, scope, includeHidden }) => {
|
|
185
117
|
const components = await listComponents(platform, project, environment, applicationId, scope);
|
|
186
118
|
return {
|
|
187
|
-
...applicationTypeField(await resolveProfile(platform, applicationId)),
|
|
188
119
|
components: components
|
|
189
120
|
.filter(component => includeHidden === true || component.isHide !== true)
|
|
190
121
|
.map(component => ({
|
|
@@ -230,15 +161,6 @@ export function registerComponentTools(server, platform) {
|
|
|
230
161
|
: [];
|
|
231
162
|
const componentSlug = typeof component.slug === 'string' ? component.slug : undefined;
|
|
232
163
|
const knowledge = knowledgeFor(componentSlug);
|
|
233
|
-
// Mobil uygulamada kayıt mobil kataloğun satırıdır (`listComponents` type=mobile); davranış
|
|
234
|
-
// notları web runtime'ından gelir (`knowledge` — mobil şema web sınıfını genişletir), bileşenin
|
|
235
|
-
// mobil farkları `mobileKnowledge`'ta, bütün mobil bileşenlere geçen notlar `mobileNotes`'ta (G4).
|
|
236
|
-
// Web ikizi olmayan bileşende (`app-bar`, `tooltip`…) bilgi yalnız `mobileKnowledge`'tadır; olay
|
|
237
|
-
// yükleri de önce mobil sözlükten okunur (`mobileComponentEvents.ts`).
|
|
238
|
-
const mobile = (await resolveProfile(platform, applicationId)).profile.platform === 'mobile';
|
|
239
|
-
const mobileKnowledge = mobile && componentSlug !== undefined && Object.hasOwn(mobileComponentKnowledge, componentSlug)
|
|
240
|
-
? mobileComponentKnowledge[componentSlug]
|
|
241
|
-
: undefined;
|
|
242
164
|
// S-3 — `defaults` HAM katalogdur; Studio'da bırakılan düğüm ise temanın bileşen preseti
|
|
243
165
|
// kaplanmış katalogdan kurulur (`withThemeComponentDefaults`). Tema okunamazsa (uç düşer,
|
|
244
166
|
// yetki yoksa) alan yanıta HİÇ girmez: uydurulmuş bir varsayılan yanlış bilgidir.
|
|
@@ -255,7 +177,7 @@ export function registerComponentTools(server, platform) {
|
|
|
255
177
|
isDroppable: component.isDroppable,
|
|
256
178
|
props: definition.props,
|
|
257
179
|
defaults: definition.defaults,
|
|
258
|
-
events: eventContractsFor(componentSlug, eventNames
|
|
180
|
+
events: eventContractsFor(componentSlug, eventNames),
|
|
259
181
|
eventPayloadNote,
|
|
260
182
|
...(knowledge
|
|
261
183
|
? {
|
|
@@ -266,7 +188,7 @@ export function registerComponentTools(server, platform) {
|
|
|
266
188
|
},
|
|
267
189
|
...(knowledge.guide ? { guide: knowledge.guide } : {})
|
|
268
190
|
}
|
|
269
|
-
:
|
|
191
|
+
: { knowledgeNote }),
|
|
270
192
|
...(componentSlug && INTERNAL_ROLES_BY_TYPE[componentSlug]
|
|
271
193
|
? {
|
|
272
194
|
internalRoles: INTERNAL_ROLES_BY_TYPE[componentSlug],
|
|
@@ -274,9 +196,8 @@ export function registerComponentTools(server, platform) {
|
|
|
274
196
|
}
|
|
275
197
|
: {}),
|
|
276
198
|
...(themeDefaults ? { themeDefaults } : {}),
|
|
277
|
-
...(mobile ? { platform: 'mobile', ...(mobileKnowledge ? { mobileKnowledge } : {}), mobileNotes: mobileComponentNotes(componentSlug) } : {}),
|
|
278
199
|
appearanceValues: APPEARANCE_TOKEN_SETS,
|
|
279
|
-
stateFlags:
|
|
200
|
+
stateFlags: STATE_FLAG_NOTES,
|
|
280
201
|
validations: definition.validations,
|
|
281
202
|
sizes: definition.blocks
|
|
282
203
|
};
|
|
@@ -309,27 +230,21 @@ export function registerComponentTools(server, platform) {
|
|
|
309
230
|
if (body.kind === 'widget' && !body.widgetType) {
|
|
310
231
|
throw new PlatformApiError("kind:'widget' için widgetType (container | modal | drawer) zorunludur.");
|
|
311
232
|
}
|
|
312
|
-
const wrapped = body.kind === 'widget' && body.widgetType && (body.schema ?? []).length > 0
|
|
313
|
-
? wrapWidgetRoot(body.schema ?? [], body.widgetType, await listComponents(platform, project, environment, applicationId).catch(() => []))
|
|
314
|
-
: { schema: body.schema, notes: [] };
|
|
315
|
-
body.schema = wrapped.schema;
|
|
316
233
|
const fixed = normalizeComponentDefaults(body.schema);
|
|
317
234
|
const catalog = (body.schema ?? []).length > 0
|
|
318
235
|
? await applyCatalogLayoutRules(platform, project, environment, applicationId, body.schema)
|
|
319
236
|
: { clamped: [], heights: [], sizes: [] };
|
|
320
|
-
// Mobil uygulamanın widget'ı mobil katalog satırıdır; tip verilmezse uygulamanın tipi.
|
|
321
|
-
const defaultType = body.type ?? (await resolveProfile(platform, applicationId)).profile.catalogType;
|
|
322
237
|
return platform.tenant('POST', project, `/components/${applicationId}`, {
|
|
323
238
|
environment,
|
|
324
239
|
body: {
|
|
325
240
|
kind: 'component',
|
|
326
|
-
type:
|
|
241
|
+
type: 'web',
|
|
327
242
|
categories: [],
|
|
328
243
|
definition: {},
|
|
329
244
|
schema: [],
|
|
330
245
|
...Object.fromEntries(Object.entries(body).filter(([, value]) => value !== undefined))
|
|
331
246
|
}
|
|
332
|
-
}).then(response => withNormalization(response, [...
|
|
247
|
+
}).then(response => withNormalization(response, [...componentDefaultsNote(fixed), ...blockSizeNote(catalog.clamped), ...heightTypeNote(catalog.heights), ...sizeStringNote(catalog.sizes)]));
|
|
333
248
|
}));
|
|
334
249
|
server.registerTool('component_update', {
|
|
335
250
|
title: 'Komponent güncelle',
|
|
@@ -355,6 +270,10 @@ export function registerComponentTools(server, platform) {
|
|
|
355
270
|
},
|
|
356
271
|
annotations: updates
|
|
357
272
|
}, handle(config, async ({ project, environment, applicationId, slug, ...changes }) => {
|
|
273
|
+
// PAGE-037: UpdateComponentCommand de UpsertRange'ten geçer, blocks'suz widget düğümü kayıtta
|
|
274
|
+
// 500 verir. component_create bu kapıdan geçmez — CreateComponentCommand revizyon kapsamı
|
|
275
|
+
// açmıyor ve platform orada blocks'suz düğümü blocks: [] gibi kaydediyor (2026-10-04, kod okuması).
|
|
276
|
+
assertComponentBlocks(changes.schema);
|
|
358
277
|
const components = await listComponents(platform, project, environment, applicationId);
|
|
359
278
|
const current = components.find(entry => entry.slug === slug);
|
|
360
279
|
if (!current) {
|
|
@@ -364,12 +283,6 @@ export function registerComponentTools(server, platform) {
|
|
|
364
283
|
? await fetchHost(platform, 'component', project, environment, applicationId, String(current.id))
|
|
365
284
|
: current;
|
|
366
285
|
const overrides = Object.fromEntries(Object.entries(changes).filter(([, value]) => value !== undefined));
|
|
367
|
-
const widgetType = changes.widgetType ?? detailed.widgetType;
|
|
368
|
-
const wrapped = detailed.kind === 'widget' && typeof widgetType === 'string' && changes.schema !== undefined && changes.schema.length > 0
|
|
369
|
-
? wrapWidgetRoot(changes.schema, widgetType, components)
|
|
370
|
-
: { schema: changes.schema, notes: [] };
|
|
371
|
-
if (overrides.schema !== undefined)
|
|
372
|
-
overrides.schema = wrapped.schema;
|
|
373
286
|
const fixed = normalizeComponentDefaults(overrides.schema);
|
|
374
287
|
const rules = componentLayoutRules(components);
|
|
375
288
|
const clamped = overrides.schema === undefined ? [] : clampBlockSizes(overrides.schema, rules.maxSizes);
|
|
@@ -377,7 +290,7 @@ export function registerComponentTools(server, platform) {
|
|
|
377
290
|
const sizes = overrides.schema === undefined ? [] : normalizeSizeStrings(overrides.schema);
|
|
378
291
|
const body = componentUpdateBody({ ...detailed, applicationId }, overrides);
|
|
379
292
|
await platform.tenant('PUT', project, `/components/${applicationId}/${slug}`, { environment, body });
|
|
380
|
-
return withNormalization({ slug, changed: Object.keys(overrides), preserved: { schemaNodes: body.schema.length } }, [...
|
|
293
|
+
return withNormalization({ slug, changed: Object.keys(overrides), preserved: { schemaNodes: body.schema.length } }, [...componentDefaultsNote(fixed), ...blockSizeNote(clamped), ...heightTypeNote(heights), ...sizeStringNote(sizes)]);
|
|
381
294
|
}));
|
|
382
295
|
server.registerTool('component_delete', {
|
|
383
296
|
title: 'Komponent sil',
|
|
@@ -118,7 +118,7 @@ export function registerDatasourceTools(server, platform) {
|
|
|
118
118
|
}, handle(config, ({ project, environment }) => platform.tenant('GET', project, '/datasources/resources', { environment })));
|
|
119
119
|
server.registerTool('datasource_configuration_options', {
|
|
120
120
|
title: 'Yapılandırma seçenekleri',
|
|
121
|
-
description: "Datasource'un alan tipi kataloğunu döner: commonType başına dbType listesi, varsayılan tip, tipin kabul ettiği seçenek anahtarları (length/precision/collation/...) ve dönüştürülebilir tipler; ayrıca ilişki kuralları (onUpdate/onDelete) ve identity generation tipleri.
|
|
121
|
+
description: "Datasource'un alan tipi kataloğunu döner: commonType başına dbType listesi, varsayılan tip, tipin kabul ettiği seçenek anahtarları (length/precision/collation/...) ve dönüştürülebilir tipler; ayrıca ilişki kuralları (onUpdate/onDelete) ve identity generation tipleri. VARSAYILAN YANIT ÖZETTİR (~5 KB): collation DEĞER listesi (816 kayıt, tam yanıtın %79'u) dışarıdadır — tipin collation kabul edip etmediği zaten options'ta yazar. Collation değerleri gerçekten gerekiyorsa includeCollations: true ile tam yanıtı isteyin (~45 KB).",
|
|
122
122
|
inputSchema: {
|
|
123
123
|
project: projectParam,
|
|
124
124
|
environment: environmentParam,
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import { orphanedFlowWarnings, orphanedFlowPlan, orphanedFlowMessage, boundEventOps, stripGatewayEventFields, staleSetterWarnings, normalizeSchemaOps, validationNote, componentDefaultsNote, replacePropNote, flexSizeWarnings, nestedRepeaterNodes, nestedRepeaterMessage, stringStyleNodes, stringStyleWarning, inertFlexPropNodes, inertFlexPropWarning, verticalGapWarnings, withNormalization, FLEX_LAYOUT_PROP_NAMES } from '../knowledge/normalize.js';
|
|
2
|
-
import { opsParam, writeViewParam, outlineWriteResponse, unknownEventOps, collectTypes, simulateLayoutOps, removeNodeFromTree, planEventRemovals, planResizes, planPropTypes, assertOpBodies
|
|
1
|
+
import { orphanedFlowWarnings, orphanedFlowPlan, orphanedFlowMessage, boundEventOps, stripGatewayEventFields, staleSetterWarnings, normalizeSchemaOps, assertAddComponentIds, validationNote, componentNameNote, componentDefaultsNote, replacePropNote, flexSizeWarnings, nestedRepeaterNodes, nestedRepeaterMessage, stringStyleNodes, stringStyleWarning, inertFlexPropNodes, inertFlexPropWarning, verticalGapWarnings, withNormalization, FLEX_LAYOUT_PROP_NAMES } from '../knowledge/normalize.js';
|
|
2
|
+
import { opsParam, writeViewParam, outlineWriteResponse, unknownEventOps, collectTypes, simulateLayoutOps, removeNodeFromTree, planEventRemovals, planResizes, planPropTypes, assertOpBodies } from './schemaOps.js';
|
|
3
3
|
import { guid, projectParam, environmentParam, updates, microOps } from './common.js';
|
|
4
4
|
import { fetchHost, hostPath } from './screens.js';
|
|
5
5
|
import { assertScreenWriteGuards, screenCatalogNotes } from './screenWrite.js';
|
|
6
6
|
import { emptyWriteDiff, schemaOpDrops, withWriteDiff } from '../platform/writeDiff.js';
|
|
7
7
|
import { fetchComponentEventNames } from './components.js';
|
|
8
|
+
import { boxSectionNote, collectIds, ensureBoxSections, expandSectionToggles } from '../knowledge/boxSections.js';
|
|
8
9
|
import { PlatformApiError } from '../platform/errors.js';
|
|
9
10
|
import { handle } from '../platform/responses.js';
|
|
10
11
|
import { slotWarning } from './layouts.js';
|
|
11
|
-
import { applicationTypeField, resolveProfile } from '../knowledge/platform/resolve.js';
|
|
12
|
-
import { boundFlowSteps, layoutPatchWarnings, screenProfileWarnings } from './profileWrite.js';
|
|
13
12
|
import { z } from 'zod';
|
|
14
13
|
const HOSTS = {
|
|
15
14
|
layout: {
|
|
@@ -62,6 +61,7 @@ export function registerDesignSchemaPatchTool(server, platform, host) {
|
|
|
62
61
|
const opRecords = allOps.filter(entry => !['remove_event', 'resize_component', 'set_prop_type'].includes(String(entry.op)));
|
|
63
62
|
const normalized = normalizeSchemaOps(opRecords);
|
|
64
63
|
assertOpBodies(opRecords, propTypeOps);
|
|
64
|
+
assertAddComponentIds(opRecords);
|
|
65
65
|
const record = await fetchHost(platform, host, project, environment, applicationId, id);
|
|
66
66
|
// Platform ucu kaydın türüne bakmaz: sıradan bir komponentin id'si verilirse kataloğundaki
|
|
67
67
|
// tanımın yanına bir şema yazılırdı.
|
|
@@ -69,6 +69,13 @@ export function registerDesignSchemaPatchTool(server, platform, host) {
|
|
|
69
69
|
throw new PlatformApiError(`component_schema_patch yalnız widget kaydına yazar; '${String(record.slug ?? id)}' bir widget değil (kind: ${String(record.kind ?? 'yok')}). Komponent kaydını component_update ile güncelleyin.`, 400);
|
|
70
70
|
}
|
|
71
71
|
const nodes = (record[spec.tree] ?? []);
|
|
72
|
+
// BX-002: bölge anahtarı Studio'da düğüm kurar; layout ve widget ağaçlarında da aynısı.
|
|
73
|
+
const sectionIds = collectIds(nodes, new Set());
|
|
74
|
+
const addedBodies = opRecords.filter(entry => entry.op === 'add_component').map(entry => entry.component);
|
|
75
|
+
collectIds(addedBodies, sectionIds);
|
|
76
|
+
const createdSections = ensureBoxSections(addedBodies, sectionIds);
|
|
77
|
+
const sectionToggles = expandSectionToggles(opRecords, nodes, sectionIds);
|
|
78
|
+
const sectionNotes = boxSectionNote([...createdSections, ...sectionToggles.created], sectionToggles.removed);
|
|
72
79
|
const events = host === 'layout' ? record.events : undefined;
|
|
73
80
|
if (opRecords.some(entry => entry.op === 'set_event' || entry.op === 'add_event')) {
|
|
74
81
|
const bound = boundEventOps(nodes, opRecords);
|
|
@@ -87,8 +94,7 @@ export function registerDesignSchemaPatchTool(server, platform, host) {
|
|
|
87
94
|
if (deletedFlows.length > 0 && allowFlowDeletion !== true)
|
|
88
95
|
throw new PlatformApiError(orphanedFlowMessage(deletedFlows), 400);
|
|
89
96
|
const added = opRecords.filter(entry => entry.op === 'add_component').map(entry => entry.component);
|
|
90
|
-
|
|
91
|
-
assertScreenWriteGuards(spec.kind, { schema: added }, resolved.profile.platform);
|
|
97
|
+
assertScreenWriteGuards(spec.kind, { schema: added });
|
|
92
98
|
const catalogNotes = await screenCatalogNotes(platform, project, environment, applicationId, added);
|
|
93
99
|
const flowWarnings = opRecords.some(entry => entry.op === 'remove_component')
|
|
94
100
|
? [...orphanedFlowWarnings(nodes, events, opRecords), ...staleSetterWarnings(Array.isArray(record.flows) ? record.flows : [], opRecords, nodes)]
|
|
@@ -103,28 +109,17 @@ export function registerDesignSchemaPatchTool(server, platform, host) {
|
|
|
103
109
|
|| (entry.op === 'replace_prop' && FLEX_LAYOUT_PROP_NAMES.has(String(entry.prop ?? ''))));
|
|
104
110
|
const nested = simulatable ? nestedRepeaterNodes(simulated) : [];
|
|
105
111
|
if (nested.length > 0)
|
|
106
|
-
throw new PlatformApiError(nestedRepeaterMessage(nested
|
|
112
|
+
throw new PlatformApiError(nestedRepeaterMessage(nested), 400);
|
|
107
113
|
const reshaped = simulatable || opRecords.some(entry => entry.op === 'remove_component');
|
|
108
|
-
const profileWarnings = await screenProfileWarnings(platform, resolved, project, environment, applicationId, {
|
|
109
|
-
kind: spec.kind,
|
|
110
|
-
ops: [...opRecords, ...propTypeOps],
|
|
111
|
-
savedNodes: nodes,
|
|
112
|
-
steps: await boundFlowSteps(platform, resolved, project, environment, host, applicationId, id, opRecords)
|
|
113
|
-
});
|
|
114
114
|
const layoutWarnings = reshaped
|
|
115
115
|
? [
|
|
116
|
-
...
|
|
116
|
+
...verticalGapWarnings(simulated, spec.codes.gap, touched),
|
|
117
117
|
...stringStyleWarning(stringStyleNodes(simulated)),
|
|
118
|
-
...
|
|
118
|
+
...inertFlexPropWarning(inertFlexPropNodes(simulated)),
|
|
119
119
|
...flexSizeWarnings(simulated, spec.codes.flexMismatch, spec.codes.flexInvalid),
|
|
120
120
|
...(host === 'layout' ? slotWarning(simulated) : [])
|
|
121
121
|
]
|
|
122
122
|
: [];
|
|
123
|
-
if (host === 'layout' && reshapesSkeleton(opRecords)) {
|
|
124
|
-
const skeleton = structuredClone(simulated);
|
|
125
|
-
applySkeletonOps(skeleton, opRecords);
|
|
126
|
-
layoutWarnings.push(...layoutPatchWarnings(resolved, nodes, skeleton));
|
|
127
|
-
}
|
|
128
123
|
const removedEvents = planEventRemovals(removeEventOps);
|
|
129
124
|
const resized = resizeOps.length > 0 ? planResizes(nodes, resizeOps, spec.readTool) : { serverOps: [], applied: [], warnings: [] };
|
|
130
125
|
const propTypes = propTypeOps.length > 0 ? planPropTypes(nodes, propTypeOps, spec.readTool) : { serverOps: [], applied: [] };
|
|
@@ -147,9 +142,8 @@ export function registerDesignSchemaPatchTool(server, platform, host) {
|
|
|
147
142
|
response.deletedFlows = deletedFlows;
|
|
148
143
|
if (flowWarnings.length > 0)
|
|
149
144
|
response.flowWarnings = flowWarnings;
|
|
150
|
-
if (layoutWarnings.length > 0
|
|
151
|
-
response.layoutWarnings =
|
|
152
|
-
Object.assign(response, applicationTypeField(resolved));
|
|
145
|
+
if (layoutWarnings.length > 0)
|
|
146
|
+
response.layoutWarnings = layoutWarnings;
|
|
153
147
|
const contentOps = opRecords.filter(entry => entry.op === 'add_component' || entry.op === 'replace_prop');
|
|
154
148
|
let opDrops = emptyWriteDiff();
|
|
155
149
|
if (contentOps.length > 0) {
|
|
@@ -162,6 +156,8 @@ export function registerDesignSchemaPatchTool(server, platform, host) {
|
|
|
162
156
|
}
|
|
163
157
|
}
|
|
164
158
|
return withWriteDiff(withNormalization(response, [
|
|
159
|
+
...componentNameNote(normalized.names),
|
|
160
|
+
...sectionNotes,
|
|
165
161
|
...componentDefaultsNote(normalized.components),
|
|
166
162
|
...validationNote(normalized.validations),
|
|
167
163
|
...catalogNotes,
|