@topogram/cli 0.3.51 → 0.3.52

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/ARCHITECTURE.md +4 -4
  2. package/CHANGELOG.md +11 -11
  3. package/package.json +1 -1
  4. package/src/adoption/plan.js +2 -2
  5. package/src/agent-ops/query-builders.js +42 -33
  6. package/src/cli.js +174 -129
  7. package/src/generator/adapters.d.ts +1 -0
  8. package/src/generator/adapters.js +64 -39
  9. package/src/generator/check.js +19 -12
  10. package/src/generator/context/diff.js +9 -9
  11. package/src/generator/context/domain-coverage.js +11 -10
  12. package/src/generator/context/domain-page.js +6 -6
  13. package/src/generator/context/shared.js +37 -21
  14. package/src/generator/context/slice.js +70 -65
  15. package/src/generator/index.js +12 -12
  16. package/src/generator/output.js +21 -20
  17. package/src/generator/registry.js +61 -49
  18. package/src/generator/runtime/app-bundle.js +15 -15
  19. package/src/generator/runtime/compile-check.js +7 -7
  20. package/src/generator/runtime/deployment.js +9 -9
  21. package/src/generator/runtime/environment.js +39 -39
  22. package/src/generator/runtime/runtime-check.js +5 -5
  23. package/src/generator/runtime/shared.js +40 -38
  24. package/src/generator/runtime/smoke.js +5 -5
  25. package/src/generator/surfaces/databases/contract.js +1 -1
  26. package/src/generator/surfaces/databases/lifecycle-shared.js +6 -5
  27. package/src/generator/surfaces/databases/postgres/drizzle.js +3 -2
  28. package/src/generator/surfaces/databases/postgres/prisma.js +3 -2
  29. package/src/generator/surfaces/databases/shared.js +3 -2
  30. package/src/generator/surfaces/databases/snapshot.js +1 -1
  31. package/src/generator/surfaces/databases/sqlite/prisma.js +3 -2
  32. package/src/generator/surfaces/native/swiftui-app.js +3 -3
  33. package/src/generator/surfaces/native/swiftui-templates/Package.swift.txt +1 -1
  34. package/src/generator/surfaces/native/swiftui-templates/README.generated.md +3 -3
  35. package/src/generator/surfaces/native/swiftui-templates/runtime/DynamicScreens.swift +3 -3
  36. package/src/generator/surfaces/services/persistence-wiring.js +3 -2
  37. package/src/generator/surfaces/services/server-contract.js +4 -4
  38. package/src/generator/surfaces/shared.js +2 -2
  39. package/src/generator/surfaces/web/design-intent.js +1 -1
  40. package/src/generator/surfaces/web/index.js +7 -7
  41. package/src/generator/surfaces/web/{react-components.js → react-widgets.js} +53 -53
  42. package/src/generator/surfaces/web/react.js +36 -36
  43. package/src/generator/surfaces/web/{sveltekit-components.js → sveltekit-widgets.js} +53 -53
  44. package/src/generator/surfaces/web/sveltekit.js +34 -34
  45. package/src/generator/surfaces/web/{ui-web-contract.js → ui-surface-contract.js} +8 -8
  46. package/src/generator/surfaces/web/vanilla.js +6 -6
  47. package/src/generator/{component-conformance.js → widget-conformance.js} +129 -128
  48. package/src/generator/widgets.js +40 -0
  49. package/src/generator-policy.js +10 -12
  50. package/src/import/core/runner.js +34 -34
  51. package/src/import/core/shared.js +1 -1
  52. package/src/import/extractors/ui/android-compose.js +1 -1
  53. package/src/import/extractors/ui/blazor.js +1 -1
  54. package/src/import/extractors/ui/razor-pages.js +1 -1
  55. package/src/import/extractors/ui/react-router.js +4 -4
  56. package/src/import/extractors/ui/sveltekit.js +4 -4
  57. package/src/import/extractors/ui/swiftui.js +1 -1
  58. package/src/import/extractors/ui/uikit.js +1 -1
  59. package/src/new-project.js +19 -18
  60. package/src/project-config.js +92 -42
  61. package/src/proofs/contract-audit.js +1 -1
  62. package/src/proofs/ios-parity.js +1 -1
  63. package/src/proofs/issues-parity.js +1 -1
  64. package/src/realization/backend/build-backend-runtime-realization.js +2 -2
  65. package/src/realization/ui/build-ui-shared-realization.js +33 -33
  66. package/src/realization/ui/build-web-realization.js +23 -20
  67. package/src/reconcile/journeys.js +1 -1
  68. package/src/resolver/index.js +148 -65
  69. package/src/validator/index.js +473 -423
  70. package/src/validator/kinds.js +36 -36
  71. package/src/validator/per-kind/{component.js → widget.js} +47 -47
  72. package/src/{component-behavior.js → widget-behavior.js} +3 -3
  73. package/src/workflows.js +39 -38
  74. package/template-helpers/react.js +4 -4
  75. package/template-helpers/sveltekit.js +4 -4
  76. package/src/generator/components.js +0 -39
  77. /package/src/resolver/enrich/{component.js → widget.js} +0 -0
@@ -388,7 +388,7 @@ function parseReferenceNodes(values) {
388
388
 
389
389
  function buildComponentContract(statement) {
390
390
  return {
391
- type: "component_contract",
391
+ type: "ui_widget_contract",
392
392
  id: statement.id,
393
393
  name: statement.name || statement.id,
394
394
  description: statement.description || null,
@@ -478,12 +478,44 @@ function buildDecisionRecord(statement) {
478
478
  function buildProjectionPlan(statement) {
479
479
  return {
480
480
  type: "projection_plan",
481
- platform: statement.platform,
481
+ projectionType: statement.type,
482
482
  realizes: statement.realizes.map((ref, index) => ({
483
483
  order: index,
484
484
  target: ref.target || { id: ref.id, kind: null }
485
485
  })),
486
486
  outputs: parseSymbolNodes(statement.outputs),
487
+ endpoints: statement.http,
488
+ errorResponses: statement.httpErrors,
489
+ wireFields: statement.httpFields,
490
+ responses: statement.httpResponses,
491
+ preconditions: statement.httpPreconditions,
492
+ idempotency: statement.httpIdempotency,
493
+ cache: statement.httpCache,
494
+ deleteSemantics: statement.httpDelete,
495
+ asyncJobs: statement.httpAsync,
496
+ asyncStatus: statement.httpStatus,
497
+ downloads: statement.httpDownload,
498
+ authorization: statement.httpAuthz,
499
+ callbacks: statement.httpCallbacks,
500
+ screens: statement.uiScreens,
501
+ collectionViews: statement.uiCollections,
502
+ screenActions: statement.uiActions,
503
+ visibilityRules: statement.uiVisibility,
504
+ fieldLookups: statement.uiLookups,
505
+ screenRoutes: statement.uiRoutes,
506
+ webHints: statement.uiWeb,
507
+ iosHints: statement.uiIos,
508
+ appShell: statement.uiAppShell,
509
+ designTokens: statement.uiDesign,
510
+ navigation: statement.uiNavigation,
511
+ screenRegions: statement.uiScreenRegions,
512
+ widgetBindings: statement.uiComponents,
513
+ tables: statement.dbTables,
514
+ columns: statement.dbColumns,
515
+ keys: statement.dbKeys,
516
+ indexes: statement.dbIndexes,
517
+ relations: statement.dbRelations,
518
+ lifecycle: statement.dbLifecycle,
487
519
  http: statement.http,
488
520
  httpErrors: statement.httpErrors,
489
521
  httpFields: statement.httpFields,
@@ -645,7 +677,7 @@ function parseOverridesBlock(statement) {
645
677
  }
646
678
 
647
679
  function parseProjectionHttpBlock(statement, registry) {
648
- return blockEntries(getFieldValue(statement, "http")).map((entry) => {
680
+ return blockEntries(getFieldValue(statement, "endpoints")).map((entry) => {
649
681
  const capabilityId = tokenValue(entry.items[0]);
650
682
  const directives = {};
651
683
 
@@ -677,7 +709,7 @@ function parseProjectionHttpBlock(statement, registry) {
677
709
  }
678
710
 
679
711
  function parseProjectionHttpErrorsBlock(statement, registry) {
680
- return blockEntries(getFieldValue(statement, "http_errors")).map((entry) => ({
712
+ return blockEntries(getFieldValue(statement, "error_responses")).map((entry) => ({
681
713
  type: "http_error_mapping",
682
714
  capability: tokenValue(entry.items[0])
683
715
  ? {
@@ -693,7 +725,7 @@ function parseProjectionHttpErrorsBlock(statement, registry) {
693
725
  }
694
726
 
695
727
  function parseProjectionHttpFieldsBlock(statement, registry) {
696
- return blockEntries(getFieldValue(statement, "http_fields")).map((entry) => ({
728
+ return blockEntries(getFieldValue(statement, "wire_fields")).map((entry) => ({
697
729
  type: "http_field_binding",
698
730
  capability: tokenValue(entry.items[0])
699
731
  ? {
@@ -711,7 +743,7 @@ function parseProjectionHttpFieldsBlock(statement, registry) {
711
743
  }
712
744
 
713
745
  function parseProjectionHttpResponsesBlock(statement, registry) {
714
- return blockEntries(getFieldValue(statement, "http_responses")).map((entry) => {
746
+ return blockEntries(getFieldValue(statement, "responses")).map((entry) => {
715
747
  const capabilityId = tokenValue(entry.items[0]);
716
748
  const directives = parseProjectionHttpResponseDirectives(entry.items.slice(1));
717
749
 
@@ -756,7 +788,7 @@ function parseProjectionHttpResponsesBlock(statement, registry) {
756
788
  }
757
789
 
758
790
  function parseProjectionHttpPreconditionsBlock(statement, registry) {
759
- return blockEntries(getFieldValue(statement, "http_preconditions")).map((entry) => {
791
+ return blockEntries(getFieldValue(statement, "preconditions")).map((entry) => {
760
792
  const capabilityId = tokenValue(entry.items[0]);
761
793
  const directives = {};
762
794
 
@@ -788,7 +820,7 @@ function parseProjectionHttpPreconditionsBlock(statement, registry) {
788
820
  }
789
821
 
790
822
  function parseProjectionHttpIdempotencyBlock(statement, registry) {
791
- return blockEntries(getFieldValue(statement, "http_idempotency")).map((entry) => {
823
+ return blockEntries(getFieldValue(statement, "idempotency")).map((entry) => {
792
824
  const capabilityId = tokenValue(entry.items[0]);
793
825
  const directives = {};
794
826
 
@@ -801,7 +833,7 @@ function parseProjectionHttpIdempotencyBlock(statement, registry) {
801
833
  }
802
834
 
803
835
  return {
804
- type: "http_idempotency",
836
+ type: "idempotency",
805
837
  capability: capabilityId
806
838
  ? {
807
839
  id: capabilityId,
@@ -819,7 +851,7 @@ function parseProjectionHttpIdempotencyBlock(statement, registry) {
819
851
  }
820
852
 
821
853
  function parseProjectionHttpCacheBlock(statement, registry) {
822
- return blockEntries(getFieldValue(statement, "http_cache")).map((entry) => {
854
+ return blockEntries(getFieldValue(statement, "cache")).map((entry) => {
823
855
  const capabilityId = tokenValue(entry.items[0]);
824
856
  const directives = {};
825
857
 
@@ -832,7 +864,7 @@ function parseProjectionHttpCacheBlock(statement, registry) {
832
864
  }
833
865
 
834
866
  return {
835
- type: "http_cache",
867
+ type: "cache",
836
868
  capability: capabilityId
837
869
  ? {
838
870
  id: capabilityId,
@@ -852,7 +884,7 @@ function parseProjectionHttpCacheBlock(statement, registry) {
852
884
  }
853
885
 
854
886
  function parseProjectionHttpDeleteBlock(statement, registry) {
855
- return blockEntries(getFieldValue(statement, "http_delete")).map((entry) => {
887
+ return blockEntries(getFieldValue(statement, "delete_semantics")).map((entry) => {
856
888
  const capabilityId = tokenValue(entry.items[0]);
857
889
  const directives = {};
858
890
 
@@ -865,7 +897,7 @@ function parseProjectionHttpDeleteBlock(statement, registry) {
865
897
  }
866
898
 
867
899
  return {
868
- type: "http_delete",
900
+ type: "delete_semantics",
869
901
  capability: capabilityId
870
902
  ? {
871
903
  id: capabilityId,
@@ -883,7 +915,7 @@ function parseProjectionHttpDeleteBlock(statement, registry) {
883
915
  }
884
916
 
885
917
  function parseProjectionHttpAsyncBlock(statement, registry) {
886
- return blockEntries(getFieldValue(statement, "http_async")).map((entry) => {
918
+ return blockEntries(getFieldValue(statement, "async_jobs")).map((entry) => {
887
919
  const capabilityId = tokenValue(entry.items[0]);
888
920
  const directives = {};
889
921
 
@@ -896,7 +928,7 @@ function parseProjectionHttpAsyncBlock(statement, registry) {
896
928
  }
897
929
 
898
930
  return {
899
- type: "http_async",
931
+ type: "async_jobs",
900
932
  capability: capabilityId
901
933
  ? {
902
934
  id: capabilityId,
@@ -927,7 +959,7 @@ function parseProjectionHttpAsyncBlock(statement, registry) {
927
959
  }
928
960
 
929
961
  function parseProjectionHttpStatusBlock(statement, registry) {
930
- return blockEntries(getFieldValue(statement, "http_status")).map((entry) => {
962
+ return blockEntries(getFieldValue(statement, "async_status")).map((entry) => {
931
963
  const capabilityId = tokenValue(entry.items[0]);
932
964
  const directives = {};
933
965
 
@@ -940,7 +972,7 @@ function parseProjectionHttpStatusBlock(statement, registry) {
940
972
  }
941
973
 
942
974
  return {
943
- type: "http_status",
975
+ type: "async_status",
944
976
  capability: capabilityId
945
977
  ? {
946
978
  id: capabilityId,
@@ -972,7 +1004,7 @@ function parseProjectionHttpStatusBlock(statement, registry) {
972
1004
  }
973
1005
 
974
1006
  function parseProjectionHttpDownloadBlock(statement, registry) {
975
- return blockEntries(getFieldValue(statement, "http_download")).map((entry) => {
1007
+ return blockEntries(getFieldValue(statement, "downloads")).map((entry) => {
976
1008
  const capabilityId = tokenValue(entry.items[0]);
977
1009
  const directives = {};
978
1010
 
@@ -985,7 +1017,7 @@ function parseProjectionHttpDownloadBlock(statement, registry) {
985
1017
  }
986
1018
 
987
1019
  return {
988
- type: "http_download",
1020
+ type: "downloads",
989
1021
  capability: capabilityId
990
1022
  ? {
991
1023
  id: capabilityId,
@@ -1008,7 +1040,7 @@ function parseProjectionHttpDownloadBlock(statement, registry) {
1008
1040
  }
1009
1041
 
1010
1042
  function parseProjectionHttpAuthzBlock(statement, registry) {
1011
- return blockEntries(getFieldValue(statement, "http_authz")).map((entry) => {
1043
+ return blockEntries(getFieldValue(statement, "authorization")).map((entry) => {
1012
1044
  const capabilityId = tokenValue(entry.items[0]);
1013
1045
  const directives = {};
1014
1046
 
@@ -1021,7 +1053,7 @@ function parseProjectionHttpAuthzBlock(statement, registry) {
1021
1053
  }
1022
1054
 
1023
1055
  return {
1024
- type: "http_authz",
1056
+ type: "authorization",
1025
1057
  capability: capabilityId
1026
1058
  ? {
1027
1059
  id: capabilityId,
@@ -1041,7 +1073,7 @@ function parseProjectionHttpAuthzBlock(statement, registry) {
1041
1073
  }
1042
1074
 
1043
1075
  function parseProjectionHttpCallbacksBlock(statement, registry) {
1044
- return blockEntries(getFieldValue(statement, "http_callbacks")).map((entry) => {
1076
+ return blockEntries(getFieldValue(statement, "callbacks")).map((entry) => {
1045
1077
  const capabilityId = tokenValue(entry.items[0]);
1046
1078
  const directives = {};
1047
1079
 
@@ -1078,7 +1110,7 @@ function parseProjectionHttpCallbacksBlock(statement, registry) {
1078
1110
  }
1079
1111
 
1080
1112
  function parseProjectionUiScreensBlock(statement, registry) {
1081
- return blockEntries(getFieldValue(statement, "ui_screens")).map((entry) => {
1113
+ return blockEntries(getFieldValue(statement, "screens")).map((entry) => {
1082
1114
  const directives = {};
1083
1115
 
1084
1116
  for (let i = 2; i < entry.items.length; i += 2) {
@@ -1130,7 +1162,7 @@ function parseProjectionUiScreensBlock(statement, registry) {
1130
1162
  }
1131
1163
 
1132
1164
  function parseProjectionUiCollectionsBlock(statement) {
1133
- return blockEntries(getFieldValue(statement, "ui_collections")).map((entry) => {
1165
+ return blockEntries(getFieldValue(statement, "collection_views")).map((entry) => {
1134
1166
  const operation = tokenValue(entry.items[2]);
1135
1167
  const primaryValue = tokenValue(entry.items[3]) || null;
1136
1168
  const secondaryValue = tokenValue(entry.items[4]) || null;
@@ -1150,7 +1182,7 @@ function parseProjectionUiCollectionsBlock(statement) {
1150
1182
  }
1151
1183
 
1152
1184
  function parseProjectionUiActionsBlock(statement, registry) {
1153
- return blockEntries(getFieldValue(statement, "ui_actions")).map((entry) => ({
1185
+ return blockEntries(getFieldValue(statement, "screen_actions")).map((entry) => ({
1154
1186
  type: "ui_action_binding",
1155
1187
  screenId: tokenValue(entry.items[1]),
1156
1188
  capability: tokenValue(entry.items[3])
@@ -1167,7 +1199,7 @@ function parseProjectionUiActionsBlock(statement, registry) {
1167
1199
  }
1168
1200
 
1169
1201
  function parseProjectionUiVisibilityBlock(statement, registry) {
1170
- return blockEntries(getFieldValue(statement, "ui_visibility")).map((entry) => {
1202
+ return blockEntries(getFieldValue(statement, "visibility_rules")).map((entry) => {
1171
1203
  const directives = {};
1172
1204
  for (let i = 5; i < entry.items.length; i += 2) {
1173
1205
  const key = tokenValue(entry.items[i]);
@@ -1178,7 +1210,7 @@ function parseProjectionUiVisibilityBlock(statement, registry) {
1178
1210
  }
1179
1211
 
1180
1212
  return {
1181
- type: "ui_visibility_rule",
1213
+ type: "visibility_rules_rule",
1182
1214
  capability: tokenValue(entry.items[1])
1183
1215
  ? {
1184
1216
  id: tokenValue(entry.items[1]),
@@ -1195,7 +1227,7 @@ function parseProjectionUiVisibilityBlock(statement, registry) {
1195
1227
  }
1196
1228
 
1197
1229
  function parseProjectionUiLookupsBlock(statement, registry) {
1198
- return blockEntries(getFieldValue(statement, "ui_lookups")).map((entry) => ({
1230
+ return blockEntries(getFieldValue(statement, "field_lookups")).map((entry) => ({
1199
1231
  type: "ui_lookup_binding",
1200
1232
  screenId: tokenValue(entry.items[1]),
1201
1233
  field: tokenValue(entry.items[3]) || null,
@@ -1213,7 +1245,7 @@ function parseProjectionUiLookupsBlock(statement, registry) {
1213
1245
  }
1214
1246
 
1215
1247
  function parseProjectionUiRoutesBlock(statement) {
1216
- return blockEntries(getFieldValue(statement, "ui_routes")).map((entry) => ({
1248
+ return blockEntries(getFieldValue(statement, "screen_routes")).map((entry) => ({
1217
1249
  type: "ui_route",
1218
1250
  screenId: tokenValue(entry.items[1]),
1219
1251
  path: tokenValue(entry.items[3]) || null,
@@ -1223,8 +1255,8 @@ function parseProjectionUiRoutesBlock(statement) {
1223
1255
  }
1224
1256
 
1225
1257
  function parseProjectionUiIosBlock(statement, registry) {
1226
- return blockEntries(getFieldValue(statement, "ui_ios")).map((entry) => ({
1227
- type: "ui_ios_binding",
1258
+ return blockEntries(getFieldValue(statement, "ios_hints")).map((entry) => ({
1259
+ type: "ios_hint_binding",
1228
1260
  targetKind: tokenValue(entry.items[0]),
1229
1261
  targetId: tokenValue(entry.items[1]),
1230
1262
  capability:
@@ -1242,8 +1274,8 @@ function parseProjectionUiIosBlock(statement, registry) {
1242
1274
  }
1243
1275
 
1244
1276
  function parseProjectionUiWebBlock(statement, registry) {
1245
- return blockEntries(getFieldValue(statement, "ui_web")).map((entry) => ({
1246
- type: "ui_web_binding",
1277
+ return blockEntries(getFieldValue(statement, "web_hints")).map((entry) => ({
1278
+ type: "web_hint_binding",
1247
1279
  targetKind: tokenValue(entry.items[0]),
1248
1280
  targetId: tokenValue(entry.items[1]),
1249
1281
  capability:
@@ -1261,8 +1293,8 @@ function parseProjectionUiWebBlock(statement, registry) {
1261
1293
  }
1262
1294
 
1263
1295
  function parseProjectionUiAppShellBlock(statement) {
1264
- return blockEntries(getFieldValue(statement, "ui_app_shell")).map((entry) => ({
1265
- type: "ui_app_shell_binding",
1296
+ return blockEntries(getFieldValue(statement, "app_shell")).map((entry) => ({
1297
+ type: "app_shell_binding",
1266
1298
  key: tokenValue(entry.items[0]) || null,
1267
1299
  value: tokenValue(entry.items[1]) || null,
1268
1300
  raw: normalizeSequence(entry.items),
@@ -1271,8 +1303,8 @@ function parseProjectionUiAppShellBlock(statement) {
1271
1303
  }
1272
1304
 
1273
1305
  function parseProjectionUiDesignBlock(statement) {
1274
- return blockEntries(getFieldValue(statement, "ui_design")).map((entry) => ({
1275
- type: "ui_design_token",
1306
+ return blockEntries(getFieldValue(statement, "design_tokens")).map((entry) => ({
1307
+ type: "design_tokens_token",
1276
1308
  key: tokenValue(entry.items[0]) || null,
1277
1309
  role: tokenValue(entry.items[1]) || null,
1278
1310
  value: tokenValue(entry.items[2]) || null,
@@ -1282,7 +1314,7 @@ function parseProjectionUiDesignBlock(statement) {
1282
1314
  }
1283
1315
 
1284
1316
  function parseProjectionUiNavigationBlock(statement) {
1285
- return blockEntries(getFieldValue(statement, "ui_navigation")).map((entry) => {
1317
+ return blockEntries(getFieldValue(statement, "navigation")).map((entry) => {
1286
1318
  const directives = {};
1287
1319
  for (let i = 2; i < entry.items.length; i += 2) {
1288
1320
  const key = tokenValue(entry.items[i]);
@@ -1293,7 +1325,7 @@ function parseProjectionUiNavigationBlock(statement) {
1293
1325
  }
1294
1326
 
1295
1327
  return {
1296
- type: "ui_navigation_binding",
1328
+ type: "navigation_binding",
1297
1329
  targetKind: tokenValue(entry.items[0]) || null,
1298
1330
  targetId: tokenValue(entry.items[1]) || null,
1299
1331
  directives,
@@ -1304,7 +1336,7 @@ function parseProjectionUiNavigationBlock(statement) {
1304
1336
  }
1305
1337
 
1306
1338
  function parseProjectionUiScreenRegionsBlock(statement) {
1307
- return blockEntries(getFieldValue(statement, "ui_screen_regions")).map((entry) => {
1339
+ return blockEntries(getFieldValue(statement, "screen_regions")).map((entry) => {
1308
1340
  const directives = {};
1309
1341
  for (let i = 4; i < entry.items.length; i += 2) {
1310
1342
  const key = tokenValue(entry.items[i]);
@@ -1329,8 +1361,9 @@ function parseProjectionUiScreenRegionsBlock(statement) {
1329
1361
  });
1330
1362
  }
1331
1363
 
1332
- function parseProjectionUiComponentsBlock(statement, registry) {
1333
- return blockEntries(getFieldValue(statement, "ui_components")).map((entry) => {
1364
+ function parseProjectionUiComponentsBlock(statement, registry, options = {}) {
1365
+ const includeComponentAlias = options.includeComponentAlias !== false;
1366
+ return blockEntries(getFieldValue(statement, "widget_bindings")).map((entry) => {
1334
1367
  const dataBindings = [];
1335
1368
  const eventBindings = [];
1336
1369
 
@@ -1371,22 +1404,29 @@ function parseProjectionUiComponentsBlock(statement, registry) {
1371
1404
  i += 1;
1372
1405
  }
1373
1406
 
1374
- const componentId = tokenValue(entry.items[5]);
1375
- return {
1376
- type: "ui_component_binding",
1407
+ const widgetId = tokenValue(entry.items[5]);
1408
+ const widgetRef = widgetId
1409
+ ? {
1410
+ id: widgetId,
1411
+ kind: registry.get(widgetId)?.kind || null
1412
+ }
1413
+ : null;
1414
+ const binding = {
1415
+ type: "widget_binding",
1377
1416
  screenId: tokenValue(entry.items[1]) || null,
1378
1417
  region: tokenValue(entry.items[3]) || null,
1379
- component: componentId
1380
- ? {
1381
- id: componentId,
1382
- kind: registry.get(componentId)?.kind || null
1383
- }
1384
- : null,
1418
+ widget: widgetRef,
1385
1419
  dataBindings,
1386
1420
  eventBindings,
1387
1421
  raw: normalizeSequence(entry.items),
1388
1422
  loc: entry.loc
1389
1423
  };
1424
+ if (includeComponentAlias) {
1425
+ // Internal compatibility for existing generator adapters during the
1426
+ // coordinated public DSL rename. Public contracts should expose widget.
1427
+ binding.component = widgetRef;
1428
+ }
1429
+ return binding;
1390
1430
  });
1391
1431
  }
1392
1432
 
@@ -1401,7 +1441,7 @@ function parseProjectionGeneratorDefaultsBlock(statement) {
1401
1441
  }
1402
1442
 
1403
1443
  function parseProjectionDbTablesBlock(statement, registry) {
1404
- return blockEntries(getFieldValue(statement, "db_tables")).map((entry) => ({
1444
+ return blockEntries(getFieldValue(statement, "tables")).map((entry) => ({
1405
1445
  type: "db_table_mapping",
1406
1446
  entity: tokenValue(entry.items[0])
1407
1447
  ? {
@@ -1416,7 +1456,7 @@ function parseProjectionDbTablesBlock(statement, registry) {
1416
1456
  }
1417
1457
 
1418
1458
  function parseProjectionDbColumnsBlock(statement, registry) {
1419
- return blockEntries(getFieldValue(statement, "db_columns")).map((entry) => ({
1459
+ return blockEntries(getFieldValue(statement, "columns")).map((entry) => ({
1420
1460
  type: "db_column_mapping",
1421
1461
  entity: tokenValue(entry.items[0])
1422
1462
  ? {
@@ -1432,7 +1472,7 @@ function parseProjectionDbColumnsBlock(statement, registry) {
1432
1472
  }
1433
1473
 
1434
1474
  function parseProjectionDbKeysBlock(statement, registry) {
1435
- return blockEntries(getFieldValue(statement, "db_keys")).map((entry) => ({
1475
+ return blockEntries(getFieldValue(statement, "keys")).map((entry) => ({
1436
1476
  type: "db_key",
1437
1477
  entity: tokenValue(entry.items[0])
1438
1478
  ? {
@@ -1448,7 +1488,7 @@ function parseProjectionDbKeysBlock(statement, registry) {
1448
1488
  }
1449
1489
 
1450
1490
  function parseProjectionDbIndexesBlock(statement, registry) {
1451
- return blockEntries(getFieldValue(statement, "db_indexes")).map((entry) => ({
1491
+ return blockEntries(getFieldValue(statement, "indexes")).map((entry) => ({
1452
1492
  type: "db_index",
1453
1493
  entity: tokenValue(entry.items[0])
1454
1494
  ? {
@@ -1464,7 +1504,7 @@ function parseProjectionDbIndexesBlock(statement, registry) {
1464
1504
  }
1465
1505
 
1466
1506
  function parseProjectionDbRelationsBlock(statement, registry) {
1467
- return blockEntries(getFieldValue(statement, "db_relations")).map((entry) => {
1507
+ return blockEntries(getFieldValue(statement, "relations")).map((entry) => {
1468
1508
  const targetRef = tokenValue(entry.items[4]) || null;
1469
1509
  const [targetEntityId, targetField] = (targetRef || "").split(".");
1470
1510
  return {
@@ -1492,7 +1532,7 @@ function parseProjectionDbRelationsBlock(statement, registry) {
1492
1532
  }
1493
1533
 
1494
1534
  function parseProjectionDbLifecycleBlock(statement, registry) {
1495
- return blockEntries(getFieldValue(statement, "db_lifecycle")).map((entry) => {
1535
+ return blockEntries(getFieldValue(statement, "lifecycle")).map((entry) => {
1496
1536
  const directives = {};
1497
1537
  for (let i = 2; i < entry.items.length; i += 2) {
1498
1538
  const key = tokenValue(entry.items[i]);
@@ -1503,7 +1543,7 @@ function parseProjectionDbLifecycleBlock(statement, registry) {
1503
1543
  }
1504
1544
 
1505
1545
  return {
1506
- type: "db_lifecycle",
1546
+ type: "lifecycle",
1507
1547
  entity: tokenValue(entry.items[0])
1508
1548
  ? {
1509
1549
  id: tokenValue(entry.items[0]),
@@ -1803,7 +1843,7 @@ export function normalizeStatement(statement, registry) {
1803
1843
  output: resolveReferenceList(registry, getFieldValue(statement, "output")),
1804
1844
  resolvedDomain: resolveDomainTag(statement, registry)
1805
1845
  };
1806
- case "component":
1846
+ case "widget":
1807
1847
  return {
1808
1848
  ...base,
1809
1849
  category: symbolValue(getFieldValue(statement, "category")),
@@ -1856,9 +1896,25 @@ export function normalizeStatement(statement, registry) {
1856
1896
  case "projection":
1857
1897
  return {
1858
1898
  ...base,
1859
- platform: symbolValue(getFieldValue(statement, "platform")),
1899
+ type: symbolValue(getFieldValue(statement, "type")),
1900
+ // Internal compatibility for existing generator adapters during the
1901
+ // coordinated public DSL rename. Public contracts should expose type.
1902
+ platform: symbolValue(getFieldValue(statement, "type")),
1860
1903
  realizes: resolveReferenceList(registry, getFieldValue(statement, "realizes")),
1861
1904
  outputs: symbolValues(getFieldValue(statement, "outputs")),
1905
+ endpoints: parseProjectionHttpBlock(statement, registry),
1906
+ errorResponses: parseProjectionHttpErrorsBlock(statement, registry),
1907
+ wireFields: parseProjectionHttpFieldsBlock(statement, registry),
1908
+ responses: parseProjectionHttpResponsesBlock(statement, registry),
1909
+ preconditions: parseProjectionHttpPreconditionsBlock(statement, registry),
1910
+ idempotency: parseProjectionHttpIdempotencyBlock(statement, registry),
1911
+ cache: parseProjectionHttpCacheBlock(statement, registry),
1912
+ deleteSemantics: parseProjectionHttpDeleteBlock(statement, registry),
1913
+ asyncJobs: parseProjectionHttpAsyncBlock(statement, registry),
1914
+ asyncStatus: parseProjectionHttpStatusBlock(statement, registry),
1915
+ downloads: parseProjectionHttpDownloadBlock(statement, registry),
1916
+ authorization: parseProjectionHttpAuthzBlock(statement, registry),
1917
+ callbacks: parseProjectionHttpCallbacksBlock(statement, registry),
1862
1918
  http: parseProjectionHttpBlock(statement, registry),
1863
1919
  httpErrors: parseProjectionHttpErrorsBlock(statement, registry),
1864
1920
  httpFields: parseProjectionHttpFieldsBlock(statement, registry),
@@ -1873,24 +1929,43 @@ export function normalizeStatement(statement, registry) {
1873
1929
  httpAuthz: parseProjectionHttpAuthzBlock(statement, registry),
1874
1930
  httpCallbacks: parseProjectionHttpCallbacksBlock(statement, registry),
1875
1931
  uiScreens: parseProjectionUiScreensBlock(statement, registry),
1932
+ screens: parseProjectionUiScreensBlock(statement, registry),
1876
1933
  uiCollections: parseProjectionUiCollectionsBlock(statement),
1934
+ collectionViews: parseProjectionUiCollectionsBlock(statement),
1877
1935
  uiActions: parseProjectionUiActionsBlock(statement, registry),
1936
+ screenActions: parseProjectionUiActionsBlock(statement, registry),
1878
1937
  uiVisibility: parseProjectionUiVisibilityBlock(statement, registry),
1938
+ visibilityRules: parseProjectionUiVisibilityBlock(statement, registry),
1879
1939
  uiLookups: parseProjectionUiLookupsBlock(statement, registry),
1940
+ fieldLookups: parseProjectionUiLookupsBlock(statement, registry),
1880
1941
  uiRoutes: parseProjectionUiRoutesBlock(statement),
1942
+ screenRoutes: parseProjectionUiRoutesBlock(statement),
1881
1943
  uiWeb: parseProjectionUiWebBlock(statement, registry),
1944
+ webHints: parseProjectionUiWebBlock(statement, registry),
1882
1945
  uiIos: parseProjectionUiIosBlock(statement, registry),
1946
+ iosHints: parseProjectionUiIosBlock(statement, registry),
1883
1947
  uiAppShell: parseProjectionUiAppShellBlock(statement),
1948
+ appShell: parseProjectionUiAppShellBlock(statement),
1884
1949
  uiDesign: parseProjectionUiDesignBlock(statement),
1950
+ designTokens: parseProjectionUiDesignBlock(statement),
1885
1951
  uiNavigation: parseProjectionUiNavigationBlock(statement),
1952
+ navigation: parseProjectionUiNavigationBlock(statement),
1886
1953
  uiScreenRegions: parseProjectionUiScreenRegionsBlock(statement),
1954
+ screenRegions: parseProjectionUiScreenRegionsBlock(statement),
1887
1955
  uiComponents: parseProjectionUiComponentsBlock(statement, registry),
1956
+ widgetBindings: parseProjectionUiComponentsBlock(statement, registry, { includeComponentAlias: false }),
1888
1957
  dbTables: parseProjectionDbTablesBlock(statement, registry),
1958
+ tables: parseProjectionDbTablesBlock(statement, registry),
1889
1959
  dbColumns: parseProjectionDbColumnsBlock(statement, registry),
1960
+ columns: parseProjectionDbColumnsBlock(statement, registry),
1890
1961
  dbKeys: parseProjectionDbKeysBlock(statement, registry),
1962
+ keys: parseProjectionDbKeysBlock(statement, registry),
1891
1963
  dbIndexes: parseProjectionDbIndexesBlock(statement, registry),
1964
+ indexes: parseProjectionDbIndexesBlock(statement, registry),
1892
1965
  dbRelations: parseProjectionDbRelationsBlock(statement, registry),
1966
+ relations: parseProjectionDbRelationsBlock(statement, registry),
1893
1967
  dbLifecycle: parseProjectionDbLifecycleBlock(statement, registry),
1968
+ lifecycle: parseProjectionDbLifecycleBlock(statement, registry),
1894
1969
  generatorDefaults: parseProjectionGeneratorDefaultsBlock(statement)
1895
1970
  };
1896
1971
  case "orchestration":
@@ -2270,9 +2345,12 @@ export function resolveWorkspace(workspaceAst) {
2270
2345
  ...statement,
2271
2346
  flow: buildCapabilityFlow(statement)
2272
2347
  };
2273
- case "component":
2274
- return {
2275
- ...statement,
2348
+ case "widget":
2349
+ return {
2350
+ ...statement,
2351
+ widgetContract: buildComponentContract(statement),
2352
+ // Internal compatibility for existing generator adapters during the
2353
+ // coordinated public DSL rename. Public contracts should expose widgetContract.
2276
2354
  componentContract: buildComponentContract(statement)
2277
2355
  };
2278
2356
  case "rule":
@@ -2359,7 +2437,7 @@ export function resolveWorkspace(workspaceAst) {
2359
2437
  });
2360
2438
 
2361
2439
  // After per-kind enrichment, add `affectedBy*` lists onto the targets
2362
- // (capability/entity/rule/projection/component/orchestration/operation) and
2440
+ // (capability/entity/rule/projection/widget/orchestration/operation) and
2363
2441
  // the change-tracking lists onto the carrier kinds (rule, decision).
2364
2442
  const affectedByPitches = sdlcIndex.affectedByPitches;
2365
2443
  const affectedByRequirements = sdlcIndex.affectedByRequirements;
@@ -2376,7 +2454,7 @@ export function resolveWorkspace(workspaceAst) {
2376
2454
  case "capability":
2377
2455
  case "entity":
2378
2456
  case "projection":
2379
- case "component":
2457
+ case "widget":
2380
2458
  case "orchestration":
2381
2459
  case "operation":
2382
2460
  return {
@@ -2419,6 +2497,11 @@ export function resolveWorkspace(workspaceAst) {
2419
2497
  };
2420
2498
  });
2421
2499
  const finalByKind = groupBy(finalStatements, (statement) => statement.kind);
2500
+ if (finalByKind.widget && !finalByKind.component) {
2501
+ // Internal compatibility for existing generator/context modules while the
2502
+ // public DSL moves from component to widget in one coordinated release.
2503
+ finalByKind.component = finalByKind.widget;
2504
+ }
2422
2505
 
2423
2506
  const graph = mergeArchivedIntoGraph({
2424
2507
  root: workspaceAst.root,