@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
package/src/workflows.js CHANGED
@@ -1470,9 +1470,9 @@ function renderCandidateComponent(component) {
1470
1470
  const region = component.region || "results";
1471
1471
  return ensureTrailingNewline(
1472
1472
  [
1473
- `component ${component.id_hint} {`,
1473
+ `widget ${component.id_hint} {`,
1474
1474
  ` name "${component.label || component.id_hint}"`,
1475
- ' description "Candidate reusable component inferred from imported UI evidence. Review props, behavior, events, and reuse before adoption."',
1475
+ ' description "Candidate reusable widget inferred from imported UI evidence. Review props, behavior, events, and reuse before adoption."',
1476
1476
  " category collection",
1477
1477
  " props {",
1478
1478
  ` ${propName} array required`,
@@ -1540,7 +1540,7 @@ function renderProjectionPatchDoc(patch) {
1540
1540
  if ((patch.missing_auth_permissions || []).length > 0) {
1541
1541
  lines.push("## Inferred Permission Rules", "");
1542
1542
  for (const entry of patch.missing_auth_permissions) {
1543
- lines.push(`- ${formatAuthPermissionHintInline(entry)} on ${entry.projection_surface === "ui_visibility" ? "`ui_visibility`" : "`http_authz`"} for ${entry.related_capabilities.length ? entry.related_capabilities.map((item) => `\`${item}\``).join(", ") : "_no direct capability match_"}`);
1543
+ lines.push(`- ${formatAuthPermissionHintInline(entry)} on ${entry.projection_surface === "visibility_rules" ? "`visibility_rules`" : "`authorization`"} for ${entry.related_capabilities.length ? entry.related_capabilities.map((item) => `\`${item}\``).join(", ") : "_no direct capability match_"}`);
1544
1544
  lines.push(` - why inferred: ${entry.why_inferred || entry.explanation}`);
1545
1545
  lines.push(` - review next: ${entry.review_guidance || buildAuthPermissionReviewGuidance(entry)}`);
1546
1546
  }
@@ -1550,7 +1550,7 @@ function renderProjectionPatchDoc(patch) {
1550
1550
  if ((patch.missing_auth_claims || []).length > 0) {
1551
1551
  lines.push("## Inferred Auth Claim Rules", "");
1552
1552
  for (const entry of patch.missing_auth_claims) {
1553
- lines.push(`- ${formatAuthClaimHintInline(entry)} on ${entry.projection_surface === "ui_visibility" ? "`ui_visibility`" : "`http_authz`"} for ${entry.related_capabilities.length ? entry.related_capabilities.map((item) => `\`${item}\``).join(", ") : "_no direct capability match_"}`);
1553
+ lines.push(`- ${formatAuthClaimHintInline(entry)} on ${entry.projection_surface === "visibility_rules" ? "`visibility_rules`" : "`authorization`"} for ${entry.related_capabilities.length ? entry.related_capabilities.map((item) => `\`${item}\``).join(", ") : "_no direct capability match_"}`);
1554
1554
  lines.push(` - why inferred: ${entry.why_inferred || entry.explanation}`);
1555
1555
  lines.push(` - review next: ${entry.review_guidance || buildAuthClaimReviewGuidance(entry)}`);
1556
1556
  }
@@ -1560,7 +1560,7 @@ function renderProjectionPatchDoc(patch) {
1560
1560
  if ((patch.missing_auth_ownerships || []).length > 0) {
1561
1561
  lines.push("## Inferred Ownership Rules", "");
1562
1562
  for (const entry of patch.missing_auth_ownerships) {
1563
- lines.push(`- ${formatAuthOwnershipHintInline(entry)} on \`http_authz\` for ${entry.related_capabilities.length ? entry.related_capabilities.map((item) => `\`${item}\``).join(", ") : "_no direct capability match_"}`);
1563
+ lines.push(`- ${formatAuthOwnershipHintInline(entry)} on \`authorization\` for ${entry.related_capabilities.length ? entry.related_capabilities.map((item) => `\`${item}\``).join(", ") : "_no direct capability match_"}`);
1564
1564
  lines.push(` - why inferred: ${entry.why_inferred || entry.explanation}`);
1565
1565
  lines.push(` - review next: ${entry.review_guidance || buildAuthOwnershipReviewGuidance(entry)}`);
1566
1566
  }
@@ -1710,7 +1710,7 @@ function buildBundleOperatorSummary(bundle) {
1710
1710
  const evidenceKinds = [
1711
1711
  (bundle.entities || []).length > 0 ? "entity evidence" : null,
1712
1712
  (bundle.capabilities || []).length > 0 ? "API capability evidence" : null,
1713
- (bundle.components || []).length > 0 ? "UI component evidence" : null,
1713
+ (bundle.components || []).length > 0 ? "UI widget evidence" : null,
1714
1714
  (bundle.screens || []).length > 0 || (bundle.uiRoutes || []).length > 0 ? "UI screen/route evidence" : null,
1715
1715
  (bundle.workflows || []).length > 0 ? "workflow evidence" : null,
1716
1716
  (bundle.docs || []).length > 0 ? "doc evidence" : null,
@@ -2715,7 +2715,7 @@ function renderCandidateBundleReadme(bundle, proposalSurfaces = []) {
2715
2715
  `Enums: ${bundle.enums.length}`,
2716
2716
  `Capabilities: ${bundle.capabilities.length}`,
2717
2717
  `Shapes: ${bundle.shapes.length}`,
2718
- `Components: ${bundle.components.length}`,
2718
+ `Widgets: ${bundle.components.length}`,
2719
2719
  `Screens: ${bundle.screens.length}`,
2720
2720
  `UI routes: ${bundle.uiRoutes.length}`,
2721
2721
  `UI actions: ${bundle.uiActions.length}`,
@@ -2733,7 +2733,7 @@ function renderCandidateBundleReadme(bundle, proposalSurfaces = []) {
2733
2733
  `- Primary entity: ${summary.primaryEntityId ? `\`${summary.primaryEntityId}\`` : "_none_"}`,
2734
2734
  `- Participants: ${summary.participants.label}`,
2735
2735
  `- Main capabilities: ${summarizeBundleSurface(bundle, summary.capabilityIds)}`,
2736
- `- Main components: ${summarizeBundleSurface(bundle, summary.componentIds)}`,
2736
+ `- Main widgets: ${summarizeBundleSurface(bundle, summary.componentIds)}`,
2737
2737
  `- Main screens: ${summarizeBundleSurface(bundle, summary.screenIds)}`,
2738
2738
  `- Main routes: ${summarizeBundleSurface(bundle, summary.routePaths)}`,
2739
2739
  `- Main workflows: ${summarizeBundleSurface(bundle, summary.workflowIds)}`,
@@ -3013,15 +3013,15 @@ function capabilityEntityTargets(capability) {
3013
3013
  }
3014
3014
 
3015
3015
  function projectionKindForImpact(projection) {
3016
- if ((projection.http || []).length > 0 || projection.platform === "dotnet") {
3016
+ if ((projection.http || []).length > 0 || projection.platform === "api_contract") {
3017
3017
  return "api";
3018
3018
  }
3019
3019
  if (
3020
3020
  (projection.uiRoutes || []).length > 0 ||
3021
3021
  (projection.uiWeb || []).length > 0 ||
3022
3022
  (projection.uiIos || []).length > 0 ||
3023
- projection.platform === "ui_web" ||
3024
- projection.platform === "ui_ios"
3023
+ projection.platform === "web_surface" ||
3024
+ projection.platform === "ios_surface"
3025
3025
  ) {
3026
3026
  return "ui";
3027
3027
  }
@@ -3190,14 +3190,14 @@ function buildBundleAdoptionPlan(bundle, canonicalShapeIndex) {
3190
3190
  }
3191
3191
  for (const entry of bundle.components || []) {
3192
3192
  steps.push({
3193
- action: "promote_component",
3193
+ action: "promote_widget",
3194
3194
  item: entry.id_hint,
3195
3195
  target: null,
3196
3196
  confidence: entry.confidence || "low",
3197
3197
  inference_summary: entry.inference_summary || null,
3198
3198
  related_capabilities: [entry.data_source].filter(Boolean),
3199
- source_path: `candidates/reconcile/model/bundles/${bundle.slug}/components/${entry.id_hint}.tg`,
3200
- canonical_rel_path: `components/${dashedTopogramId(entry.id_hint)}.tg`
3199
+ source_path: `candidates/reconcile/model/bundles/${bundle.slug}/widgets/${entry.id_hint}.tg`,
3200
+ canonical_rel_path: `widgets/${dashedTopogramId(entry.id_hint)}.tg`
3201
3201
  });
3202
3202
  }
3203
3203
  for (const screen of bundle.screens) {
@@ -3247,7 +3247,7 @@ function buildBundleAdoptionPlan(bundle, canonicalShapeIndex) {
3247
3247
  item: `projection_ownership_patch:${patch.projection_id}:${hint.ownership_field}`,
3248
3248
  target: patch.projection_id,
3249
3249
  projection_kind: patch.kind,
3250
- projection_surface: "http_authz",
3250
+ projection_surface: "authorization",
3251
3251
  ownership: hint.ownership,
3252
3252
  ownership_field: hint.ownership_field,
3253
3253
  confidence: hint.confidence || "low",
@@ -3295,7 +3295,7 @@ function buildUiImpacts(bundle, graph) {
3295
3295
  if ((bundle.screens || []).length === 0) {
3296
3296
  return [];
3297
3297
  }
3298
- const uiProjections = (graph?.byKind.projection || []).filter((projection) => ["ui_shared", "ui_web"].includes(projection.platform));
3298
+ const uiProjections = (graph?.byKind.projection || []).filter((projection) => ["ui_contract", "web_surface"].includes(projection.platform));
3299
3299
  const bundleScreenIds = bundle.screens.map((screen) => screen.id_hint);
3300
3300
  return uiProjections
3301
3301
  .map((projection) => {
@@ -3418,7 +3418,7 @@ function buildProjectionPatchCandidates(bundle) {
3418
3418
  if (relatedCapabilities.length === 0) {
3419
3419
  continue;
3420
3420
  }
3421
- const projectionSurface = impact.kind === "ui" ? "ui_visibility" : "http_authz";
3421
+ const projectionSurface = impact.kind === "ui" ? "visibility_rules" : "authorization";
3422
3422
  const entry = {
3423
3423
  claim: hint.claim,
3424
3424
  claim_value: hint.claim_value,
@@ -3466,7 +3466,7 @@ function buildProjectionPatchCandidates(bundle) {
3466
3466
  if (relatedCapabilities.length === 0) {
3467
3467
  continue;
3468
3468
  }
3469
- const projectionSurface = impact.kind === "ui" ? "ui_visibility" : "http_authz";
3469
+ const projectionSurface = impact.kind === "ui" ? "visibility_rules" : "authorization";
3470
3470
  const entry = {
3471
3471
  permission: hint.permission,
3472
3472
  confidence: hint.confidence,
@@ -4014,7 +4014,7 @@ function buildCandidateModelFiles(graph, appImport, topogramRoot) {
4014
4014
  files[`${bundleRoot}/verifications/${entry.id_hint}.tg`] = renderCandidateVerification(entry, entry.scenarios || []);
4015
4015
  }
4016
4016
  for (const entry of bundle.components || []) {
4017
- files[`${bundleRoot}/components/${entry.id_hint}.tg`] = renderCandidateComponent(entry);
4017
+ files[`${bundleRoot}/widgets/${entry.id_hint}.tg`] = renderCandidateComponent(entry);
4018
4018
  }
4019
4019
  for (const entry of bundle.docs) {
4020
4020
  if (entry.existing_canonical) {
@@ -4085,8 +4085,8 @@ function canonicalRelativePathForItem(kind, item) {
4085
4085
  return `shapes/${dashedTopogramId(item)}.tg`;
4086
4086
  case "capability":
4087
4087
  return `capabilities/${dashedTopogramId(item)}.tg`;
4088
- case "component":
4089
- return `components/${dashedTopogramId(item)}.tg`;
4088
+ case "widget":
4089
+ return `widgets/${dashedTopogramId(item)}.tg`;
4090
4090
  case "verification":
4091
4091
  return `verifications/${dashedTopogramId(item)}.tg`;
4092
4092
  default:
@@ -4114,8 +4114,8 @@ function candidateSourcePathForItem(bundle, kind, item) {
4114
4114
  return `${base}/shapes/${item}.tg`;
4115
4115
  case "capability":
4116
4116
  return `${base}/capabilities/${item}.tg`;
4117
- case "component":
4118
- return `${base}/components/${item}.tg`;
4117
+ case "widget":
4118
+ return `${base}/widgets/${item}.tg`;
4119
4119
  case "verification":
4120
4120
  return `${base}/verifications/${item}.tg`;
4121
4121
  default:
@@ -4137,8 +4137,8 @@ function reasonForAdoptionItem(step) {
4137
4137
  return step.target ? `Promote this shape to support concept ${step.target}.` : "Promote this imported shape into canonical Topogram.";
4138
4138
  case "promote_capability":
4139
4139
  return "Promote this imported capability into canonical Topogram.";
4140
- case "promote_component":
4141
- return "Promote this imported reusable UI component into canonical Topogram.";
4140
+ case "promote_widget":
4141
+ return "Promote this imported reusable UI widget into canonical Topogram.";
4142
4142
  case "merge_capability_into_existing_entity":
4143
4143
  return `Adopt this capability while preserving the existing canonical entity ${step.target}.`;
4144
4144
  case "promote_doc":
@@ -4184,8 +4184,8 @@ function recommendationForAdoptionItem(step) {
4184
4184
  if (step.action === "apply_projection_ownership_patch") {
4185
4185
  return `Update \`${step.target}\` with inferred ownership auth rules for ${(step.related_capabilities || []).map((item) => `\`${item}\``).join(", ") || "the related capabilities"}.`;
4186
4186
  }
4187
- if (step.action === "promote_component") {
4188
- return "Promote this reviewed component candidate before binding or reusing it from canonical projections.";
4187
+ if (step.action === "promote_widget") {
4188
+ return "Promote this reviewed widget candidate before binding or reusing it from canonical projections.";
4189
4189
  }
4190
4190
  if (!["promote_actor", "promote_role"].includes(step.action)) {
4191
4191
  return null;
@@ -4305,7 +4305,7 @@ function buildAdoptionPlan(bundles) {
4305
4305
  step.action.includes("doc") ? "doc" :
4306
4306
  step.action.includes("decision") ? "decision" :
4307
4307
  step.action.includes("verification") ? "verification" :
4308
- step.action.includes("component") ? "component" :
4308
+ step.action.includes("widget") ? "widget" :
4309
4309
  step.action.includes("ui_") ? "ui" :
4310
4310
  step.action.includes("actor") ? "actor" :
4311
4311
  step.action.includes("role") ? "role" :
@@ -4477,7 +4477,7 @@ function buildAdoptionPlan(bundles) {
4477
4477
  );
4478
4478
  }
4479
4479
 
4480
- const ADOPT_SELECTORS = new Set(["from-plan", "actors", "roles", "enums", "shapes", "entities", "capabilities", "components", "docs", "journeys", "workflows", "verification", "ui"]);
4480
+ const ADOPT_SELECTORS = new Set(["from-plan", "actors", "roles", "enums", "shapes", "entities", "capabilities", "widgets", "docs", "journeys", "workflows", "verification", "ui"]);
4481
4481
 
4482
4482
  function readAdoptionPlan(paths) {
4483
4483
  return readJsonIfExists(path.join(paths.topogramRoot, "candidates", "reconcile", "adoption-plan.json"));
@@ -4671,8 +4671,8 @@ function applyProjectionAuthPatchToTopogram(baseContents, item) {
4671
4671
  const realizesResult = ensureProjectionRealizes(lines, capabilities);
4672
4672
  changed = changed || realizesResult.changed;
4673
4673
 
4674
- if (item.projection_surface === "http_authz") {
4675
- const block = ensureProjectionBlock(lines, "http_authz");
4674
+ if (item.projection_surface === "authorization") {
4675
+ const block = ensureProjectionBlock(lines, "authorization");
4676
4676
  for (const capabilityId of capabilities) {
4677
4677
  const lineIndex = lines.findIndex((line, index) =>
4678
4678
  index > block.startIndex &&
@@ -4723,8 +4723,8 @@ function applyProjectionAuthPatchToTopogram(baseContents, item) {
4723
4723
  }
4724
4724
  }
4725
4725
 
4726
- if (item.projection_surface === "ui_visibility") {
4727
- const block = ensureProjectionBlock(lines, "ui_visibility");
4726
+ if (item.projection_surface === "visibility_rules") {
4727
+ const block = ensureProjectionBlock(lines, "visibility_rules");
4728
4728
  for (const capabilityId of capabilities) {
4729
4729
  if (item.suggested_action === "apply_projection_permission_patch") {
4730
4730
  const hasExistingPermissionRule = lines.some((line, index) =>
@@ -6511,7 +6511,7 @@ function collectUiImport(paths) {
6511
6511
  }
6512
6512
  const provenance = relativeTo(paths.repoRoot, path.join(rootDir, "src", "App.tsx"));
6513
6513
  findings.push({
6514
- kind: "react_ui_routes",
6514
+ kind: "react_screen_routes",
6515
6515
  file: provenance,
6516
6516
  routes
6517
6517
  });
@@ -6576,7 +6576,7 @@ function collectUiImport(paths) {
6576
6576
  }
6577
6577
  const provenance = relativeTo(paths.repoRoot, path.join(rootDir, "src", "routes"));
6578
6578
  findings.push({
6579
- kind: "sveltekit_ui_routes",
6579
+ kind: "sveltekit_screen_routes",
6580
6580
  file: provenance,
6581
6581
  routes
6582
6582
  });
@@ -6975,7 +6975,7 @@ function collectCanonicalUiSurface(graph) {
6975
6975
  const screens = new Set();
6976
6976
  const routes = new Set();
6977
6977
  for (const projection of graph.byKind.projection || []) {
6978
- if (!["ui_shared", "ui_web"].includes(projection.platform)) {
6978
+ if (!["ui_contract", "web_surface"].includes(projection.platform)) {
6979
6979
  continue;
6980
6980
  }
6981
6981
  for (const screen of projection.uiScreens || []) {
@@ -7588,6 +7588,7 @@ function reconcileWorkflow(inputPath, options = {}) {
7588
7588
  capabilities: bundle.capabilities.map((entry) => entry.id_hint),
7589
7589
  shapes: bundle.shapes.map((entry) => entry.id),
7590
7590
  components: bundle.components.map((entry) => entry.id_hint),
7591
+ widgets: bundle.components.map((entry) => entry.id_hint),
7591
7592
  screens: bundle.screens.map((entry) => entry.id_hint),
7592
7593
  workflows: bundle.workflows.map((entry) => entry.id_hint),
7593
7594
  docs: bundle.docs.map((entry) => entry.id),
@@ -7611,11 +7612,11 @@ function reconcileWorkflow(inputPath, options = {}) {
7611
7612
  : "## Promoted Canonical Items";
7612
7613
  files["candidates/reconcile/report.json"] = `${stableStringify(report)}\n`;
7613
7614
  const candidateModelBundlesMarkdown = report.candidate_model_bundles.length
7614
- ? report.candidate_model_bundles.map((bundle) => `- \`${bundle.slug}\` (${bundle.actors.length} actors, ${bundle.roles.length} roles, ${bundle.entities.length} entities, ${bundle.enums.length} enums, ${bundle.capabilities.length} capabilities, ${bundle.shapes.length} shapes, ${bundle.components.length} components, ${bundle.screens.length} screens, ${bundle.workflows.length} workflows, ${bundle.docs.length} docs)
7615
+ ? report.candidate_model_bundles.map((bundle) => `- \`${bundle.slug}\` (${bundle.actors.length} actors, ${bundle.roles.length} roles, ${bundle.entities.length} entities, ${bundle.enums.length} enums, ${bundle.capabilities.length} capabilities, ${bundle.shapes.length} shapes, ${bundle.components.length} widgets, ${bundle.screens.length} screens, ${bundle.workflows.length} workflows, ${bundle.docs.length} docs)
7615
7616
  - primary concept \`${bundle.operator_summary.primaryConcept}\`${bundle.operator_summary.primaryEntityId ? `, primary entity \`${bundle.operator_summary.primaryEntityId}\`` : ""}
7616
7617
  - participants ${bundle.operator_summary.participants.label}
7617
7618
  - main capabilities ${summarizeBundleSurface(bundle, bundle.operator_summary.capabilityIds)}
7618
- - main components ${summarizeBundleSurface(bundle, bundle.operator_summary.componentIds)}
7619
+ - main widgets ${summarizeBundleSurface(bundle, bundle.operator_summary.componentIds)}
7619
7620
  - main routes ${summarizeBundleSurface(bundle, bundle.operator_summary.routePaths)}
7620
7621
  - candidate maintained seam mappings ${renderMaintainedSeamCandidatesInline(bundle)}
7621
7622
  - permission hints ${bundle.auth_permission_hints?.length ? bundle.auth_permission_hints.map((entry) => formatAuthPermissionHintInline(entry)).join(", ") : "_none_"}
@@ -1,5 +1,5 @@
1
1
  export {
2
- hasReactComponentRegion,
3
- reactComponentUsagesForRegion,
4
- renderReactComponentRegion
5
- } from "../src/generator/surfaces/web/react-components.js";
2
+ hasReactWidgetRegion,
3
+ reactWidgetUsagesForRegion,
4
+ renderReactWidgetRegion
5
+ } from "../src/generator/surfaces/web/react-widgets.js";
@@ -1,5 +1,5 @@
1
1
  export {
2
- hasSvelteKitComponentRegion,
3
- renderSvelteKitComponentRegion,
4
- svelteKitComponentUsagesForRegion
5
- } from "../src/generator/surfaces/web/sveltekit-components.js";
2
+ hasSvelteKitWidgetRegion,
3
+ renderSvelteKitWidgetRegion,
4
+ svelteKitWidgetUsagesForRegion
5
+ } from "../src/generator/surfaces/web/sveltekit-widgets.js";
@@ -1,39 +0,0 @@
1
- function stableSortedComponents(graph) {
2
- return [...(graph?.byKind?.component || [])].sort((a, b) => a.id.localeCompare(b.id));
3
- }
4
-
5
- function componentContract(component) {
6
- return component.componentContract || {
7
- type: "component_contract",
8
- id: component.id,
9
- name: component.name || component.id,
10
- description: component.description || null,
11
- category: component.category || null,
12
- version: component.version || null,
13
- status: component.status || null,
14
- props: component.props || [],
15
- events: component.events || [],
16
- slots: component.slots || [],
17
- behavior: component.behavior || [],
18
- behaviors: component.behaviors || [],
19
- patterns: component.patterns || [],
20
- regions: component.regions || [],
21
- approvals: component.approvals || [],
22
- lookups: component.lookups || [],
23
- dependencies: component.dependencies || []
24
- };
25
- }
26
-
27
- export function generateUiComponentContract(graph, options = {}) {
28
- if (options.componentId) {
29
- const component = (graph?.byKind?.component || []).find((entry) => entry.id === options.componentId);
30
- if (!component) {
31
- throw new Error(`No component found with id '${options.componentId}'`);
32
- }
33
- return componentContract(component);
34
- }
35
-
36
- return Object.fromEntries(
37
- stableSortedComponents(graph).map((component) => [component.id, componentContract(component)])
38
- );
39
- }
File without changes