@apteva/apteva-kit 0.1.78 → 0.1.80

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/dist/index.js CHANGED
@@ -644,7 +644,8 @@ function parseWidgetsFromText(text) {
644
644
  type: widgetType,
645
645
  id: widgetId,
646
646
  props: widgetType === "table" ? { rows: items, columns: [] } : { items },
647
- isStreaming: true
647
+ isStreaming
648
+ // Use actual streaming state from items array parsing
648
649
  }
649
650
  });
650
651
  hasWidgets = true;
@@ -767,7 +768,11 @@ function generateWidgetContext(enabledWidgets) {
767
768
  const widgets = enabledWidgets || ALL_WIDGET_TYPES;
768
769
  let context = `
769
770
  ## UI Widgets
770
- Render widgets: @ui:type[{props}]. "meta" field (at root level, NOT inside items) holds extended data captured by UI.
771
+ SYNTAX: @ui:type[{json}] - MUST use SQUARE BRACKETS [] around the JSON object.
772
+ CORRECT: @ui:list[{"items": [...]}]
773
+ WRONG: @ui:list{"items": [...]} (missing square brackets)
774
+
775
+ "meta" field (at root level, NOT inside items) holds extended data captured by UI.
771
776
 
772
777
  `;
773
778
  for (const type of widgets) {
@@ -777,14 +782,14 @@ Render widgets: @ui:type[{props}]. "meta" field (at root level, NOT inside items
777
782
  `;
778
783
  }
779
784
  context += `
780
- Meta: @ui:list[{"items": [{"id": "1", "title": "X"}], "meta": {"items": [{"id": "1", "title": "X", "extra": "..."}]}}]
785
+ Meta example: @ui:list[{"items": [{"id": "1", "title": "X"}], "meta": {"items": [{"id": "1", "title": "X", "extra": "..."}]}}]
781
786
  `;
782
787
  return context;
783
788
  }
784
789
  function generateCompactWidgetContext(enabledWidgets) {
785
790
  const widgets = enabledWidgets || ALL_WIDGET_TYPES;
786
791
  return `
787
- Widgets: @ui:type[{props}]. Types: ${widgets.join(", ")}. Add "meta" at root (not inside items) for extended data.
792
+ Widgets: @ui:type[{json}] - MUST use square brackets []. Example: @ui:list[{"items": [...]}]. Types: ${widgets.join(", ")}. Add "meta" at root for extended data.
788
793
  `;
789
794
  }
790
795