openuispec 0.1.39 → 0.1.40

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.
@@ -68,7 +68,10 @@ Spec files (YAML) are the single source of truth for all UI across platforms.
68
68
 
69
69
  MANDATORY WORKFLOW for any UI-related request (screens, navigation, layout, tokens, flows, localization):
70
70
  1. BEFORE writing or modifying any UI code, call openuispec_prepare with the target platform.
71
- This returns the spec context, platform config, and generation constraints you must follow.
71
+ This returns the spec context, platform config, generation constraints, AND the full contents
72
+ of every spec file (tokens, screens, flows, contracts, locales, platform overrides).
73
+ Use the spec_contents field as the authoritative source — do NOT paraphrase from memory.
74
+ Cross-reference exact token values, contract must_handle lists, and locale keys from the inline content.
72
75
  2. If the request requires spec changes, update the spec files FIRST, then call openuispec_check to validate.
73
76
  3. Only then generate or update the platform UI code based on the prepare output.
74
77
 
@@ -82,7 +85,7 @@ or explicitly platform-specific polish that doesn't affect shared UI semantics.`
82
85
  server.registerTool(
83
86
  "openuispec_prepare",
84
87
  {
85
- description: "Build AI-ready work bundle for a target platform. REQUIRED before any UI code generation. Returns spec context, platform config, semantic changes, and generation constraints.",
88
+ description: "Build AI-ready work bundle for a target platform. REQUIRED before any UI code generation. Returns spec context, platform config, semantic changes, generation constraints, AND the full contents of every spec file inline. Use spec_contents as the authoritative source for tokens, screens, contracts, and locales — do not paraphrase from memory.",
86
89
  inputSchema: { target: targetSchema },
87
90
  },
88
91
  async ({ target }) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openuispec",
3
- "version": "0.1.39",
3
+ "version": "0.1.40",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "description": "A semantic UI specification format for AI-native, platform-native app development",
package/prepare/index.ts CHANGED
@@ -116,6 +116,12 @@ interface PrepareBootstrapBundle {
116
116
  reference_examples: string[];
117
117
  }
118
118
 
119
+ interface SpecFileContent {
120
+ path: string;
121
+ category: string;
122
+ content: string;
123
+ }
124
+
119
125
  export interface PrepareResult {
120
126
  mode: "bootstrap" | "update";
121
127
  project: string;
@@ -138,6 +144,7 @@ export interface PrepareResult {
138
144
  explanation_note?: string;
139
145
  items: PrepareItem[];
140
146
  bootstrap?: PrepareBootstrapBundle;
147
+ spec_contents: SpecFileContent[];
141
148
  next_steps: string[];
142
149
  }
143
150
 
@@ -842,6 +849,17 @@ function generationWarnings(target: string, platformConfig: PreparePlatformConfi
842
849
  return warnings;
843
850
  }
844
851
 
852
+ function readAllSpecContents(projectDir: string): SpecFileContent[] {
853
+ return discoverSpecFiles(projectDir).map((filePath) => {
854
+ const relPath = relative(projectDir, filePath);
855
+ return {
856
+ path: relPath,
857
+ category: categorizeSpecFile(relPath),
858
+ content: readFileSync(filePath, "utf-8"),
859
+ };
860
+ });
861
+ }
862
+
845
863
  function bootstrapSpecFiles(projectDir: string, target: string): BootstrapSpecFile[] {
846
864
  return discoverSpecFiles(projectDir)
847
865
  .map((filePath) => {
@@ -1106,6 +1124,7 @@ function buildBootstrapPrepareResult(cwd: string, target: string): PrepareResult
1106
1124
  changes_available: false,
1107
1125
  explanation_note: "No snapshot exists yet. This is a first-time generation bundle.",
1108
1126
  items: [],
1127
+ spec_contents: readAllSpecContents(projectDir),
1109
1128
  bootstrap: {
1110
1129
  output_exists: existsSync(outputDir),
1111
1130
  generation_ready: missingDecisions.length === 0 && backendContextReady && !pendingUserConfirmation,
@@ -1176,6 +1195,7 @@ function buildUpdatePrepareResult(cwd: string, target: string): PrepareResult {
1176
1195
  changes_available: result.explanation?.available ?? false,
1177
1196
  explanation_note: result.explanation?.note,
1178
1197
  items,
1198
+ spec_contents: readAllSpecContents(projectDir),
1179
1199
  next_steps: nextSteps,
1180
1200
  };
1181
1201
  }