index.ts 4.5 KB

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