index.ts 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  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. // Custom Directives
  82. export type { DirectiveDefinition, DirectiveRegistry } from "./directives";
  83. export {
  84. defineDirective,
  85. createDirectiveRegistry,
  86. findDirective,
  87. } from "./directives";
  88. // Actions
  89. export type {
  90. ActionBinding,
  91. /** @deprecated Use ActionBinding instead */
  92. Action,
  93. ActionConfirm,
  94. ActionOnSuccess,
  95. ActionOnError,
  96. ActionHandler,
  97. ActionDefinition,
  98. ResolvedAction,
  99. ActionExecutionContext,
  100. } from "./actions";
  101. // Action observer (devtools hook)
  102. export type {
  103. ActionDispatchInfo,
  104. ActionSettleInfo,
  105. ActionObserver,
  106. } from "./action-observer";
  107. export {
  108. registerActionObserver,
  109. notifyActionDispatch,
  110. notifyActionSettle,
  111. nextActionDispatchId,
  112. } from "./action-observer";
  113. // Devtools active flag
  114. export {
  115. markDevtoolsActive,
  116. isDevtoolsActive,
  117. subscribeDevtoolsActive,
  118. } from "./devtools-flag";
  119. export {
  120. ActionBindingSchema,
  121. /** @deprecated Use ActionBindingSchema instead */
  122. ActionSchema,
  123. ActionConfirmSchema,
  124. ActionOnSuccessSchema,
  125. ActionOnErrorSchema,
  126. resolveAction,
  127. executeAction,
  128. interpolateString,
  129. actionBinding,
  130. /** @deprecated Use actionBinding instead */
  131. action,
  132. } from "./actions";
  133. // Validation
  134. export type {
  135. ValidationCheck,
  136. ValidationConfig,
  137. ValidationFunction,
  138. ValidationFunctionDefinition,
  139. ValidationCheckResult,
  140. ValidationResult,
  141. ValidationContext,
  142. } from "./validation";
  143. export {
  144. ValidationCheckSchema,
  145. ValidationConfigSchema,
  146. builtInValidationFunctions,
  147. runValidationCheck,
  148. runValidation,
  149. check,
  150. } from "./validation";
  151. // Spec Structural Validation
  152. export type {
  153. SpecIssueSeverity,
  154. SpecIssue,
  155. SpecValidationIssues,
  156. ValidateSpecOptions,
  157. } from "./spec-validator";
  158. export { validateSpec, autoFixSpec, formatSpecIssues } from "./spec-validator";
  159. // Schema — defines the grammar (how specs and catalogs are structured)
  160. export type {
  161. SchemaBuilder,
  162. SchemaType,
  163. SchemaDefinition,
  164. Schema,
  165. PromptTemplate,
  166. SchemaOptions,
  167. BuiltInAction,
  168. } from "./schema";
  169. export { defineSchema } from "./schema";
  170. // Catalog — defines the vocabulary (what components and actions are available)
  171. export type {
  172. Catalog,
  173. JsonSchemaOptions,
  174. PromptOptions,
  175. PromptContext,
  176. SpecValidationResult,
  177. InferCatalogInput,
  178. InferSpec,
  179. InferCatalogComponents,
  180. InferCatalogActions,
  181. InferComponentProps,
  182. InferActionParams,
  183. } from "./schema";
  184. export { defineCatalog } from "./schema";
  185. // User Prompt Builder
  186. export type { UserPromptOptions } from "./prompt";
  187. export { buildUserPrompt } from "./prompt";
  188. // Object diff & merge (format-agnostic)
  189. export { deepMergeSpec } from "./merge";
  190. export { diffToPatches } from "./diff";
  191. // Edit modes
  192. export type {
  193. EditMode,
  194. EditConfig,
  195. BuildEditUserPromptOptions,
  196. } from "./edit-modes";
  197. export {
  198. buildEditInstructions,
  199. buildEditUserPrompt,
  200. isNonEmptySpec,
  201. } from "./edit-modes";