index.ts 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. // Types
  2. export type {
  3. DynamicValue,
  4. DynamicString,
  5. DynamicNumber,
  6. DynamicBoolean,
  7. UIElement,
  8. FlatElement,
  9. Spec,
  10. VisibilityCondition,
  11. StateCondition,
  12. ItemCondition,
  13. IndexCondition,
  14. SingleCondition,
  15. AndCondition,
  16. OrCondition,
  17. StateModel,
  18. StateStore,
  19. ComponentSchema,
  20. ValidationMode,
  21. PatchOp,
  22. JsonPatch,
  23. // SpecStream types
  24. SpecStreamLine,
  25. SpecStreamCompiler,
  26. // Mixed stream types (chat + GenUI)
  27. MixedStreamCallbacks,
  28. MixedStreamParser,
  29. // AI SDK stream transform
  30. StreamChunk,
  31. SpecDataPart,
  32. } from "./types";
  33. export {
  34. DynamicValueSchema,
  35. DynamicStringSchema,
  36. DynamicNumberSchema,
  37. DynamicBooleanSchema,
  38. resolveDynamicValue,
  39. getByPath,
  40. setByPath,
  41. addByPath,
  42. removeByPath,
  43. findFormValue,
  44. // SpecStream - streaming format for building specs (RFC 6902)
  45. parseSpecStreamLine,
  46. applySpecStreamPatch,
  47. applySpecPatch,
  48. nestedToFlat,
  49. compileSpecStream,
  50. createSpecStreamCompiler,
  51. // Mixed stream parser (chat + GenUI)
  52. createMixedStreamParser,
  53. // AI SDK stream transform
  54. createJsonRenderTransform,
  55. pipeJsonRender,
  56. SPEC_DATA_PART,
  57. SPEC_DATA_PART_TYPE,
  58. } from "./types";
  59. // State Store
  60. export type { StoreAdapterConfig } from "./state-store";
  61. export { createStateStore } from "./state-store";
  62. // Visibility
  63. export type { VisibilityContext } from "./visibility";
  64. export {
  65. VisibilityConditionSchema,
  66. evaluateVisibility,
  67. visibility,
  68. } from "./visibility";
  69. // Prop Expressions
  70. export type {
  71. PropExpression,
  72. PropResolutionContext,
  73. ComputedFunction,
  74. } from "./props";
  75. export {
  76. resolvePropValue,
  77. resolveElementProps,
  78. resolveBindings,
  79. resolveActionParam,
  80. } from "./props";
  81. // Actions
  82. export type {
  83. ActionBinding,
  84. /** @deprecated Use ActionBinding instead */
  85. Action,
  86. ActionConfirm,
  87. ActionOnSuccess,
  88. ActionOnError,
  89. ActionHandler,
  90. ActionDefinition,
  91. ResolvedAction,
  92. ActionExecutionContext,
  93. } from "./actions";
  94. export {
  95. ActionBindingSchema,
  96. /** @deprecated Use ActionBindingSchema instead */
  97. ActionSchema,
  98. ActionConfirmSchema,
  99. ActionOnSuccessSchema,
  100. ActionOnErrorSchema,
  101. resolveAction,
  102. executeAction,
  103. interpolateString,
  104. actionBinding,
  105. /** @deprecated Use actionBinding instead */
  106. action,
  107. } from "./actions";
  108. // Validation
  109. export type {
  110. ValidationCheck,
  111. ValidationConfig,
  112. ValidationFunction,
  113. ValidationFunctionDefinition,
  114. ValidationCheckResult,
  115. ValidationResult,
  116. ValidationContext,
  117. } from "./validation";
  118. export {
  119. ValidationCheckSchema,
  120. ValidationConfigSchema,
  121. builtInValidationFunctions,
  122. runValidationCheck,
  123. runValidation,
  124. check,
  125. } from "./validation";
  126. // Spec Structural Validation
  127. export type {
  128. SpecIssueSeverity,
  129. SpecIssue,
  130. SpecValidationIssues,
  131. ValidateSpecOptions,
  132. } from "./spec-validator";
  133. export { validateSpec, autoFixSpec, formatSpecIssues } from "./spec-validator";
  134. // Schema — defines the grammar (how specs and catalogs are structured)
  135. export type {
  136. SchemaBuilder,
  137. SchemaType,
  138. SchemaDefinition,
  139. Schema,
  140. PromptTemplate,
  141. SchemaOptions,
  142. BuiltInAction,
  143. } from "./schema";
  144. export { defineSchema } from "./schema";
  145. // Catalog — defines the vocabulary (what components and actions are available)
  146. export type {
  147. Catalog,
  148. JsonSchemaOptions,
  149. PromptOptions,
  150. PromptContext,
  151. SpecValidationResult,
  152. InferCatalogInput,
  153. InferSpec,
  154. InferCatalogComponents,
  155. InferCatalogActions,
  156. InferComponentProps,
  157. InferActionParams,
  158. } from "./schema";
  159. export { defineCatalog } from "./schema";
  160. // User Prompt Builder
  161. export type { UserPromptOptions } from "./prompt";
  162. export { buildUserPrompt } from "./prompt";