@upstart.gg/sdk 0.0.135 → 0.0.136

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.
Files changed (258) hide show
  1. package/dist/shared/ai/schemas.d.ts +11 -2
  2. package/dist/shared/ai/schemas.d.ts.map +1 -1
  3. package/dist/shared/ai/schemas.js +43 -8
  4. package/dist/shared/ai/schemas.js.map +1 -1
  5. package/dist/shared/ai/types.d.ts +125 -65
  6. package/dist/shared/ai/types.d.ts.map +1 -1
  7. package/dist/shared/ajv.js +2 -2
  8. package/dist/shared/attributes.d.ts +3 -1
  9. package/dist/shared/attributes.d.ts.map +1 -1
  10. package/dist/shared/attributes.js +9 -9
  11. package/dist/shared/brick-manifest.js +4 -4
  12. package/dist/shared/bricks/manifests/_types.d.ts +9 -0
  13. package/dist/shared/bricks/manifests/_types.d.ts.map +1 -0
  14. package/dist/shared/bricks/manifests/_types.js +3 -0
  15. package/dist/shared/bricks/manifests/_types.js.map +1 -0
  16. package/dist/shared/bricks/manifests/accordion.manifest.d.ts +2 -6
  17. package/dist/shared/bricks/manifests/accordion.manifest.d.ts.map +1 -1
  18. package/dist/shared/bricks/manifests/accordion.manifest.js +5 -5
  19. package/dist/shared/bricks/manifests/all-manifests.d.ts.map +1 -1
  20. package/dist/shared/bricks/manifests/all-manifests.js +28 -28
  21. package/dist/shared/bricks/manifests/box.manifest.d.ts +2 -6
  22. package/dist/shared/bricks/manifests/box.manifest.d.ts.map +1 -1
  23. package/dist/shared/bricks/manifests/box.manifest.js +5 -5
  24. package/dist/shared/bricks/manifests/button.manifest.d.ts +2 -6
  25. package/dist/shared/bricks/manifests/button.manifest.d.ts.map +1 -1
  26. package/dist/shared/bricks/manifests/button.manifest.js +5 -5
  27. package/dist/shared/bricks/manifests/card.manifest.d.ts +8 -7
  28. package/dist/shared/bricks/manifests/card.manifest.d.ts.map +1 -1
  29. package/dist/shared/bricks/manifests/card.manifest.js +5 -5
  30. package/dist/shared/bricks/manifests/carousel.manifest.d.ts +2 -6
  31. package/dist/shared/bricks/manifests/carousel.manifest.d.ts.map +1 -1
  32. package/dist/shared/bricks/manifests/carousel.manifest.js +5 -5
  33. package/dist/shared/bricks/manifests/footer.manifest.d.ts +2 -6
  34. package/dist/shared/bricks/manifests/footer.manifest.d.ts.map +1 -1
  35. package/dist/shared/bricks/manifests/footer.manifest.js +5 -5
  36. package/dist/shared/bricks/manifests/form.manifest.d.ts +2 -6
  37. package/dist/shared/bricks/manifests/form.manifest.d.ts.map +1 -1
  38. package/dist/shared/bricks/manifests/form.manifest.js +5 -5
  39. package/dist/shared/bricks/manifests/hero.manifest.d.ts +2 -6
  40. package/dist/shared/bricks/manifests/hero.manifest.d.ts.map +1 -1
  41. package/dist/shared/bricks/manifests/hero.manifest.js +5 -5
  42. package/dist/shared/bricks/manifests/html.manifest.d.ts +2 -6
  43. package/dist/shared/bricks/manifests/html.manifest.d.ts.map +1 -1
  44. package/dist/shared/bricks/manifests/html.manifest.js +5 -5
  45. package/dist/shared/bricks/manifests/icon.manifest.d.ts +2 -6
  46. package/dist/shared/bricks/manifests/icon.manifest.d.ts.map +1 -1
  47. package/dist/shared/bricks/manifests/icon.manifest.js +5 -5
  48. package/dist/shared/bricks/manifests/image.manifest.d.ts +1 -0
  49. package/dist/shared/bricks/manifests/image.manifest.d.ts.map +1 -1
  50. package/dist/shared/bricks/manifests/image.manifest.js +5 -5
  51. package/dist/shared/bricks/manifests/images-gallery.manifest.d.ts +2 -6
  52. package/dist/shared/bricks/manifests/images-gallery.manifest.d.ts.map +1 -1
  53. package/dist/shared/bricks/manifests/images-gallery.manifest.js +5 -5
  54. package/dist/shared/bricks/manifests/map.manifest.d.ts +2 -6
  55. package/dist/shared/bricks/manifests/map.manifest.d.ts.map +1 -1
  56. package/dist/shared/bricks/manifests/map.manifest.js +5 -5
  57. package/dist/shared/bricks/manifests/navbar.manifest.d.ts +2 -6
  58. package/dist/shared/bricks/manifests/navbar.manifest.d.ts.map +1 -1
  59. package/dist/shared/bricks/manifests/navbar.manifest.js +5 -5
  60. package/dist/shared/bricks/manifests/sidebar.manifest.d.ts +2 -6
  61. package/dist/shared/bricks/manifests/sidebar.manifest.d.ts.map +1 -1
  62. package/dist/shared/bricks/manifests/sidebar.manifest.js +5 -5
  63. package/dist/shared/bricks/manifests/social-links.manifest.d.ts +2 -6
  64. package/dist/shared/bricks/manifests/social-links.manifest.d.ts.map +1 -1
  65. package/dist/shared/bricks/manifests/social-links.manifest.js +5 -5
  66. package/dist/shared/bricks/manifests/spacer.manifest.d.ts +2 -6
  67. package/dist/shared/bricks/manifests/spacer.manifest.d.ts.map +1 -1
  68. package/dist/shared/bricks/manifests/spacer.manifest.js +5 -5
  69. package/dist/shared/bricks/manifests/table.manifest.d.ts +2 -6
  70. package/dist/shared/bricks/manifests/table.manifest.d.ts.map +1 -1
  71. package/dist/shared/bricks/manifests/table.manifest.js +5 -5
  72. package/dist/shared/bricks/manifests/tabs.manifest.d.ts +2 -6
  73. package/dist/shared/bricks/manifests/tabs.manifest.d.ts.map +1 -1
  74. package/dist/shared/bricks/manifests/tabs.manifest.js +5 -5
  75. package/dist/shared/bricks/manifests/testimonials.manifest.d.ts +2 -6
  76. package/dist/shared/bricks/manifests/testimonials.manifest.d.ts.map +1 -1
  77. package/dist/shared/bricks/manifests/testimonials.manifest.js +5 -5
  78. package/dist/shared/bricks/manifests/text.manifest.d.ts +2 -6
  79. package/dist/shared/bricks/manifests/text.manifest.d.ts.map +1 -1
  80. package/dist/shared/bricks/manifests/text.manifest.js +5 -5
  81. package/dist/shared/bricks/manifests/timeline.manifest.d.ts +2 -6
  82. package/dist/shared/bricks/manifests/timeline.manifest.d.ts.map +1 -1
  83. package/dist/shared/bricks/manifests/timeline.manifest.js +5 -5
  84. package/dist/shared/bricks/manifests/video.manifest.d.ts +2 -6
  85. package/dist/shared/bricks/manifests/video.manifest.d.ts.map +1 -1
  86. package/dist/shared/bricks/manifests/video.manifest.js +5 -5
  87. package/dist/shared/bricks/props/dynamic.js +2 -2
  88. package/dist/shared/bricks/props/geolocation.js +1 -1
  89. package/dist/shared/bricks/props/string.js +1 -1
  90. package/dist/shared/bricks.d.ts +5 -3
  91. package/dist/shared/bricks.d.ts.map +1 -1
  92. package/dist/shared/bricks.js +31 -29
  93. package/dist/shared/{chunk-CKFRSHR2.js → chunk-2IHKVMKW.js} +3 -3
  94. package/dist/shared/chunk-2IHKVMKW.js.map +1 -0
  95. package/dist/shared/{chunk-P3RH5URN.js → chunk-2VDR4ZYY.js} +3 -3
  96. package/dist/shared/chunk-2VDR4ZYY.js.map +1 -0
  97. package/dist/shared/{chunk-MLZT7MRQ.js → chunk-36PLZKMW.js} +4 -4
  98. package/dist/shared/chunk-36PLZKMW.js.map +1 -0
  99. package/dist/shared/{chunk-QQQ3FYPG.js → chunk-42OUNI7C.js} +123 -5
  100. package/dist/shared/chunk-42OUNI7C.js.map +1 -0
  101. package/dist/shared/{chunk-2HO4FHLM.js → chunk-4MNWMEMM.js} +118 -152
  102. package/dist/shared/chunk-4MNWMEMM.js.map +1 -0
  103. package/dist/shared/chunk-CRS7QCPZ.js +308 -0
  104. package/dist/shared/chunk-CRS7QCPZ.js.map +1 -0
  105. package/dist/shared/{chunk-WGDUJSSS.js → chunk-DFAFDBYZ.js} +4 -4
  106. package/dist/shared/chunk-DFAFDBYZ.js.map +1 -0
  107. package/dist/shared/{chunk-FVU5PXRC.js → chunk-DV3G7X34.js} +2 -2
  108. package/dist/shared/{chunk-TB3X4LRQ.js → chunk-EVLRH6VG.js} +2 -2
  109. package/dist/shared/{chunk-Z35I5JM5.js → chunk-F247VKAE.js} +3 -3
  110. package/dist/shared/chunk-F247VKAE.js.map +1 -0
  111. package/dist/shared/{chunk-QL3T5HJQ.js → chunk-FOGAVJC2.js} +2 -2
  112. package/dist/shared/chunk-FOGAVJC2.js.map +1 -0
  113. package/dist/shared/{chunk-4WI23M7W.js → chunk-FQDR2BBZ.js} +3 -3
  114. package/dist/shared/chunk-FQDR2BBZ.js.map +1 -0
  115. package/dist/shared/{chunk-3KLRW4I2.js → chunk-GFAQWQER.js} +182 -124
  116. package/dist/shared/chunk-GFAQWQER.js.map +1 -0
  117. package/dist/shared/{chunk-DRTGM2UJ.js → chunk-GIGFNQBO.js} +2 -2
  118. package/dist/shared/chunk-GIGFNQBO.js.map +1 -0
  119. package/dist/shared/{chunk-SHUGHJ7V.js → chunk-GQTZPN5D.js} +3 -3
  120. package/dist/shared/chunk-GQTZPN5D.js.map +1 -0
  121. package/dist/shared/{chunk-D4YQ6ABM.js → chunk-H5JM2M2T.js} +211 -34
  122. package/dist/shared/chunk-H5JM2M2T.js.map +1 -0
  123. package/dist/shared/{chunk-NT3IW52F.js → chunk-HTUSL2U7.js} +2 -2
  124. package/dist/shared/{chunk-BW6EFRSF.js → chunk-IQIISR22.js} +2 -2
  125. package/dist/shared/{chunk-BW6EFRSF.js.map → chunk-IQIISR22.js.map} +1 -1
  126. package/dist/shared/{chunk-Z2NTDFB4.js → chunk-KEM5N6GJ.js} +4 -4
  127. package/dist/shared/chunk-KEM5N6GJ.js.map +1 -0
  128. package/dist/shared/{chunk-V3UA3LRK.js → chunk-KIDICX3Y.js} +32 -7
  129. package/dist/shared/chunk-KIDICX3Y.js.map +1 -0
  130. package/dist/shared/chunk-KILJYJFE.js +354 -0
  131. package/dist/shared/chunk-KILJYJFE.js.map +1 -0
  132. package/dist/shared/{chunk-GRMY35BU.js → chunk-L6C7HUSA.js} +148 -20
  133. package/dist/shared/chunk-L6C7HUSA.js.map +1 -0
  134. package/dist/shared/{chunk-GCQURRVB.js → chunk-LCJ2VFPM.js} +4 -4
  135. package/dist/shared/chunk-LCJ2VFPM.js.map +1 -0
  136. package/dist/shared/{chunk-QSND5IWT.js → chunk-LLNPH3XR.js} +19 -36
  137. package/dist/shared/chunk-LLNPH3XR.js.map +1 -0
  138. package/dist/shared/{chunk-LXAO3JA6.js → chunk-LTIJI7Y3.js} +4 -4
  139. package/dist/shared/chunk-LTIJI7Y3.js.map +1 -0
  140. package/dist/shared/{chunk-6E42XWFH.js → chunk-MFNHFN2B.js} +3 -3
  141. package/dist/shared/{chunk-6E42XWFH.js.map → chunk-MFNHFN2B.js.map} +1 -1
  142. package/dist/shared/{chunk-TEO6TJOM.js → chunk-N3BEBLWF.js} +27 -26
  143. package/dist/shared/{chunk-TEO6TJOM.js.map → chunk-N3BEBLWF.js.map} +1 -1
  144. package/dist/shared/{chunk-UQF52PWK.js → chunk-N3ZTQD5I.js} +2 -2
  145. package/dist/shared/chunk-N3ZTQD5I.js.map +1 -0
  146. package/dist/shared/{chunk-EQMU6NIU.js → chunk-TNTFKLCR.js} +16 -13
  147. package/dist/shared/chunk-TNTFKLCR.js.map +1 -0
  148. package/dist/shared/{chunk-EWSPTRDL.js → chunk-U5ZECCJM.js} +102 -16
  149. package/dist/shared/chunk-U5ZECCJM.js.map +1 -0
  150. package/dist/shared/{chunk-O5PLB3YB.js → chunk-UXTASZ23.js} +16 -10
  151. package/dist/shared/chunk-UXTASZ23.js.map +1 -0
  152. package/dist/shared/{chunk-BMWRR4DI.js → chunk-YWOTQWIQ.js} +3 -3
  153. package/dist/shared/chunk-YWOTQWIQ.js.map +1 -0
  154. package/dist/shared/{chunk-GPCI2N2A.js → chunk-ZR6R6Z6O.js} +106 -5
  155. package/dist/shared/chunk-ZR6R6Z6O.js.map +1 -0
  156. package/dist/shared/{chunk-U7TVEPKA.js → chunk-ZRRAK5NS.js} +3 -3
  157. package/dist/shared/chunk-ZRRAK5NS.js.map +1 -0
  158. package/dist/shared/context.d.ts +1 -0
  159. package/dist/shared/context.d.ts.map +1 -1
  160. package/dist/shared/datarecords/types.d.ts +7 -60
  161. package/dist/shared/datarecords/types.d.ts.map +1 -1
  162. package/dist/shared/datarecords/types.js +3 -5
  163. package/dist/shared/datasources/external/threads/media/fetcher.js +3 -3
  164. package/dist/shared/datasources/types.js +2 -2
  165. package/dist/shared/datasources.d.ts +1 -1
  166. package/dist/shared/datasources.d.ts.map +1 -1
  167. package/dist/shared/datasources.js +1 -3
  168. package/dist/shared/datasources.js.map +1 -1
  169. package/dist/shared/page.d.ts.map +1 -1
  170. package/dist/shared/page.js +31 -31
  171. package/dist/shared/site.d.ts +6 -6
  172. package/dist/shared/site.js +36 -36
  173. package/dist/shared/site.js.map +1 -1
  174. package/dist/shared/sitemap.d.ts +6 -5
  175. package/dist/shared/sitemap.d.ts.map +1 -1
  176. package/dist/shared/sitemap.js +32 -32
  177. package/dist/shared/theme.js +3 -3
  178. package/dist/shared/utils/llm.js +2 -2
  179. package/dist/shared/utils/schema-registry.js +2 -2
  180. package/dist/shared/utils/schema.js +3 -3
  181. package/package.json +2 -2
  182. package/src/shared/ai/schemas.ts +46 -10
  183. package/src/shared/ai/types.ts +128 -60
  184. package/src/shared/attributes.ts +11 -3
  185. package/src/shared/bricks/manifests/_types.ts +9 -0
  186. package/src/shared/bricks/manifests/accordion.manifest.ts +128 -161
  187. package/src/shared/bricks/manifests/all-manifests.ts +1 -0
  188. package/src/shared/bricks/manifests/box.manifest.ts +195 -129
  189. package/src/shared/bricks/manifests/button.manifest.ts +158 -71
  190. package/src/shared/bricks/manifests/card.manifest.ts +200 -28
  191. package/src/shared/bricks/manifests/carousel.manifest.ts +154 -22
  192. package/src/shared/bricks/manifests/footer.manifest.ts +2 -5
  193. package/src/shared/bricks/manifests/form.manifest.ts +122 -7
  194. package/src/shared/bricks/manifests/hero.manifest.ts +103 -18
  195. package/src/shared/bricks/manifests/html.manifest.ts +2 -5
  196. package/src/shared/bricks/manifests/icon.manifest.ts +216 -36
  197. package/src/shared/bricks/manifests/image.manifest.ts +103 -2
  198. package/src/shared/bricks/manifests/images-gallery.manifest.ts +2 -5
  199. package/src/shared/bricks/manifests/map.manifest.ts +2 -5
  200. package/src/shared/bricks/manifests/navbar.manifest.ts +2 -5
  201. package/src/shared/bricks/manifests/sidebar.manifest.ts +2 -5
  202. package/src/shared/bricks/manifests/social-links.manifest.ts +2 -5
  203. package/src/shared/bricks/manifests/spacer.manifest.ts +2 -5
  204. package/src/shared/bricks/manifests/table.manifest.ts +2 -5
  205. package/src/shared/bricks/manifests/tabs.manifest.ts +2 -5
  206. package/src/shared/bricks/manifests/testimonials.manifest.ts +2 -5
  207. package/src/shared/bricks/manifests/text.manifest.ts +31 -10
  208. package/src/shared/bricks/manifests/timeline.manifest.ts +2 -5
  209. package/src/shared/bricks/manifests/video.manifest.ts +2 -5
  210. package/src/shared/bricks/props/string.ts +1 -1
  211. package/src/shared/bricks.ts +12 -9
  212. package/src/shared/context.ts +1 -0
  213. package/src/shared/datarecords/types.ts +47 -37
  214. package/src/shared/datasources.ts +2 -4
  215. package/src/shared/page.ts +0 -1
  216. package/src/shared/site.ts +3 -3
  217. package/src/shared/sitemap.ts +2 -0
  218. package/src/shared/tests/schema-registry.test.ts +0 -2
  219. package/src/shared/utils/schema-registry.ts +5 -5
  220. package/src/shared/utils/tests/schema.test.ts +43 -2
  221. package/dist/shared/chunk-2HO4FHLM.js.map +0 -1
  222. package/dist/shared/chunk-3KLRW4I2.js.map +0 -1
  223. package/dist/shared/chunk-4WI23M7W.js.map +0 -1
  224. package/dist/shared/chunk-BMWRR4DI.js.map +0 -1
  225. package/dist/shared/chunk-CKFRSHR2.js.map +0 -1
  226. package/dist/shared/chunk-D4YQ6ABM.js.map +0 -1
  227. package/dist/shared/chunk-DRTGM2UJ.js.map +0 -1
  228. package/dist/shared/chunk-EQMU6NIU.js.map +0 -1
  229. package/dist/shared/chunk-EWSPTRDL.js.map +0 -1
  230. package/dist/shared/chunk-GCQURRVB.js.map +0 -1
  231. package/dist/shared/chunk-GPCI2N2A.js.map +0 -1
  232. package/dist/shared/chunk-GRMY35BU.js.map +0 -1
  233. package/dist/shared/chunk-LXAO3JA6.js.map +0 -1
  234. package/dist/shared/chunk-MLZT7MRQ.js.map +0 -1
  235. package/dist/shared/chunk-O5PLB3YB.js.map +0 -1
  236. package/dist/shared/chunk-P3RH5URN.js.map +0 -1
  237. package/dist/shared/chunk-QL3T5HJQ.js.map +0 -1
  238. package/dist/shared/chunk-QQQ3FYPG.js.map +0 -1
  239. package/dist/shared/chunk-QSND5IWT.js.map +0 -1
  240. package/dist/shared/chunk-SHUGHJ7V.js.map +0 -1
  241. package/dist/shared/chunk-U7TVEPKA.js.map +0 -1
  242. package/dist/shared/chunk-UQF52PWK.js.map +0 -1
  243. package/dist/shared/chunk-V3UA3LRK.js.map +0 -1
  244. package/dist/shared/chunk-WGDUJSSS.js.map +0 -1
  245. package/dist/shared/chunk-X6N463D4.js +0 -222
  246. package/dist/shared/chunk-X6N463D4.js.map +0 -1
  247. package/dist/shared/chunk-X75YV73Q.js +0 -178
  248. package/dist/shared/chunk-X75YV73Q.js.map +0 -1
  249. package/dist/shared/chunk-Z2NTDFB4.js.map +0 -1
  250. package/dist/shared/chunk-Z35I5JM5.js.map +0 -1
  251. package/dist/shared/schema-registry.d.ts +0 -5
  252. package/dist/shared/schema-registry.d.ts.map +0 -1
  253. package/dist/shared/schema-registry.js +0 -119
  254. package/dist/shared/schema-registry.js.map +0 -1
  255. package/src/shared/schema-registry.ts +0 -82
  256. /package/dist/shared/{chunk-FVU5PXRC.js.map → chunk-DV3G7X34.js.map} +0 -0
  257. /package/dist/shared/{chunk-TB3X4LRQ.js.map → chunk-EVLRH6VG.js.map} +0 -0
  258. /package/dist/shared/{chunk-NT3IW52F.js.map → chunk-HTUSL2U7.js.map} +0 -0
@@ -1,4 +1,5 @@
1
1
  import { type Static, Type } from "@sinclair/typebox";
2
+ import { StringEnum } from "../utils/string-enum";
2
3
 
3
4
  export const waitingMessageSchema = Type.Object({
4
5
  waitingMessage: Type.String({
@@ -7,18 +8,21 @@ export const waitingMessageSchema = Type.Object({
7
8
  }),
8
9
  });
9
10
 
10
- export type WaitingMessageSchema = Static<typeof waitingMessageSchema>;
11
+ export type ToolInputWaitingMessageType = { waitingMessage: string };
12
+ export type ToolInputInstructionsType = { instructions: string };
11
13
 
12
14
  export const askUserChoiceInput = Type.Object({
13
- question: Type.String({
14
- description:
15
- "The question to ask the user, in the user language. Example: 'Do you want a blog page?' or 'Do you want me to generate some images?'",
16
- }),
17
- choices: Type.Array(Type.String(), {
18
- description: "The list of choices to present to the user. Can be a maximum of 6 choices.",
19
- maxItems: 6,
20
- minItems: 2,
21
- }),
15
+ choices: Type.Array(
16
+ Type.String({
17
+ minLength: 2,
18
+ maxLength: 60,
19
+ }),
20
+ {
21
+ description: "The list of choices to present to the user. Minimum 2 choices, max 6.",
22
+ maxItems: 6,
23
+ minItems: 2,
24
+ },
25
+ ),
22
26
  allowMultiple: Type.Optional(
23
27
  Type.Boolean({
24
28
  description: "Whether to allow multiple choices to be selected by the user. Default to false.",
@@ -27,3 +31,35 @@ export const askUserChoiceInput = Type.Object({
27
31
  });
28
32
 
29
33
  export type AskUserChoiceInput = Static<typeof askUserChoiceInput>;
34
+
35
+ export const getDocInput = Type.Object(
36
+ {
37
+ entityType: StringEnum(
38
+ [
39
+ "site-attributes",
40
+ "page-attributes",
41
+ "datasource",
42
+ "datarecord",
43
+ "site-query",
44
+ "page-query",
45
+ "section",
46
+ "brick-type",
47
+ ],
48
+ {
49
+ description: "The type of entity to get the schema documentation for.",
50
+ },
51
+ ),
52
+ // Only used when entityType is brick-type
53
+ brickType: Type.Optional(
54
+ Type.String({
55
+ description:
56
+ "The brick type to get the schema documentation for. Required if entityType is 'brick-type'.",
57
+ }),
58
+ ),
59
+ },
60
+ {
61
+ additionalProperties: false,
62
+ },
63
+ );
64
+
65
+ export type GetDocInput = Static<typeof getDocInput>;
@@ -1,146 +1,214 @@
1
1
  // Define your custom message type once
2
2
  import type { UIMessage } from "ai";
3
3
  import type { Theme } from "../theme";
4
- import type { Sitemap } from "../sitemap";
5
- import type { VersionedPage } from "../page";
6
- import type { PageAttributes, SiteAttributes } from "../attributes";
7
- import type { Brick, Section } from "../bricks";
8
- import type { AskUserChoiceInput, WaitingMessageSchema } from "./schemas";
4
+ import type { Sitemap, SitemapWithPlans } from "../sitemap";
5
+ import type { Page, VersionedPage } from "../page";
6
+ import type {
7
+ PageAttributes,
8
+ PageAttributesNoQueries,
9
+ SiteAttributes,
10
+ SiteAttributesNoQueries,
11
+ } from "../attributes";
12
+ import type { Brick, Section, SectionSchemaNoBricks } from "../bricks";
13
+ import type {
14
+ AskUserChoiceInput,
15
+ ToolInputWaitingMessageType,
16
+ ToolInputInstructionsType,
17
+ GetDocInput,
18
+ } from "./schemas";
9
19
  import type { Datarecord, InternalDatarecord } from "../datarecords/types";
10
20
  import type { InternalDatasource } from "../datasources/types";
11
21
  import type { ImageSearchResultsType } from "../images";
12
22
  import type { NavbarProps } from "../bricks/manifests/navbar.manifest";
13
23
  import type { FooterProps } from "../bricks/manifests/footer.manifest";
24
+ import type { Site } from "../site";
14
25
  // ... import your tool and data part types
15
26
 
16
27
  export type Tools = {
28
+ setSitePrompt: {
29
+ input: { prompt: string };
30
+ output: string;
31
+ };
32
+ getBrickDocs: {
33
+ input: { type: string };
34
+ output: string; // The schema documentation in markdown format
35
+ };
17
36
  askUserChoice: {
18
37
  input: AskUserChoiceInput;
19
38
  output: string | string[] | null; // The user's choice(s
20
39
  };
40
+ setSiteAttributes: {
41
+ input: SiteAttributesNoQueries;
42
+ output: SiteAttributesNoQueries;
43
+ };
44
+ setPageAttributes: {
45
+ input: PageAttributesNoQueries;
46
+ output: PageAttributesNoQueries;
47
+ };
21
48
  generateImages: {
22
- input: { prompt: string; count: number; aspectRatio: string };
49
+ input: ToolInputWaitingMessageType & { prompt: string; count: number; aspectRatio: string };
23
50
  output: ImageSearchResultsType;
24
51
  };
52
+ getCurrentSite: {
53
+ input: unknown;
54
+ output: Site;
55
+ };
25
56
  listThemes: {
26
- input: null; // Just type the waiting message for now
57
+ input: unknown;
27
58
  output: Theme[];
28
59
  };
29
60
  createSection: {
30
- input: WaitingMessageSchema; // Just type the waiting message for now
61
+ input: SectionSchemaNoBricks;
31
62
  output: Section;
32
63
  };
33
64
  editSection: {
34
- input: { id: string } & WaitingMessageSchema; // Just type the waiting message for now
65
+ input: { id: string; data: Partial<SectionSchemaNoBricks> };
35
66
  output: Section;
36
67
  };
68
+ deleteSection: {
69
+ input: { id: string };
70
+ output: { sections: Section[]; deleted: Section }; // Updated sections or error string if failed
71
+ };
37
72
  getSection: {
38
- input: { id: string }; // Just type the waiting message for now
39
- output: Section | string; // Error string if not found
73
+ input: { id: string };
74
+ output: Section; // Error string if not found
40
75
  };
41
76
  listSections: {
42
- input: null; // Just type the waiting message for now
77
+ input: unknown;
43
78
  output: Section[];
44
79
  };
45
80
  createThemes: {
46
- input: WaitingMessageSchema; // Just type the waiting message for now
81
+ input: ToolInputWaitingMessageType & ToolInputInstructionsType & { count: number };
47
82
  output: Theme[];
48
83
  };
49
84
  getCurrentTheme: {
50
- input: null; // Just type the waiting message for now
85
+ input: unknown;
51
86
  output: Theme; // Theme or message if no theme applied yet
52
87
  };
53
88
  createSitemap: {
54
- input: WaitingMessageSchema; // Just type the waiting message for now
55
- output: Sitemap;
56
- };
57
- getSitemap: {
58
- input: null; // Just type the waiting message for now
59
- output: Sitemap;
89
+ input: ToolInputWaitingMessageType & ToolInputInstructionsType;
90
+ output: SitemapWithPlans;
60
91
  };
61
92
  createPage: {
62
- input: WaitingMessageSchema; // Just type the waiting message for now
93
+ input: Omit<Page, "sections">;
63
94
  output: VersionedPage;
64
95
  };
65
- editPage: {
66
- input: WaitingMessageSchema; // Just type the waiting message for now
67
- output: VersionedPage;
96
+ undo: {
97
+ input: {
98
+ steps?: number;
99
+ };
100
+ output: boolean;
101
+ };
102
+ setSiteLabel: {
103
+ input: { label: string };
104
+ output: string;
105
+ };
106
+ // editPage: {
107
+ // input: ToolInputWaitingMessageType;
108
+ // output: VersionedPage;
109
+ // };
110
+ listPages: {
111
+ input: unknown;
112
+ output: Sitemap;
68
113
  };
69
114
  getCurrentPage: {
70
- input: null; // Just type the waiting message for now
115
+ input: unknown;
71
116
  output: VersionedPage;
72
117
  };
73
- createNavbar: {
74
- input: WaitingMessageSchema; // Just type the waiting message for now
75
- output: NavbarProps;
76
- };
77
- createFooter: {
78
- input: WaitingMessageSchema; // Just type the waiting message for now
79
- output: FooterProps;
118
+ analyzeUrl: {
119
+ input: {
120
+ url: string;
121
+ prompt: string;
122
+ };
123
+ output: string;
80
124
  };
81
125
  createBrick: {
82
- input: WaitingMessageSchema & { sectionId: string; index: number }; // Just type the waiting message for now
126
+ input: {
127
+ instructions: string;
128
+ otherBrickTypes: string[];
129
+ sectionId: string;
130
+ id: string;
131
+ type: string;
132
+ insertAt: { type: "section"; index: number } | { type: "brick"; id: string; index: number };
133
+ };
83
134
  output: Brick;
84
135
  };
85
136
  editBrick: {
86
- input: WaitingMessageSchema & { id: string }; // Just type the waiting message for now
137
+ input: { id: string; instructions: string; otherBrickTypes: string[] };
87
138
  output: Brick;
88
139
  };
89
140
  listImages: {
90
- input: null; // Just type the waiting message for now
141
+ input: unknown;
91
142
  output: ImageSearchResultsType;
92
143
  };
93
144
  listSiteQueries: {
94
- input: null; // Just type the waiting message for now
145
+ input: unknown;
95
146
  output: NonNullable<SiteAttributes["queries"]>;
96
147
  };
148
+ listPageQueries: {
149
+ input: unknown;
150
+ output: NonNullable<PageAttributes["queries"]>;
151
+ };
97
152
  createSiteQueries: {
98
- input: WaitingMessageSchema & { instructions: string }; // Just type the waiting message for now
153
+ input: ToolInputWaitingMessageType & { instructions: string };
99
154
  output: NonNullable<SiteAttributes["queries"]>;
100
155
  };
101
- editSiteQueries: {
102
- input: WaitingMessageSchema & { instructions: string }; // Just type the waiting message for now
103
- output: NonNullable<SiteAttributes["queries"]>;
156
+ setTheme: {
157
+ input: { id: string };
158
+ output: Theme;
104
159
  };
160
+ // editSiteQueries: {
161
+ // input: ToolInputWaitingMessageType & { instructions: string };
162
+ // output: NonNullable<SiteAttributes["queries"]>;
163
+ // };
105
164
  createPageQueries: {
106
- input: WaitingMessageSchema & { instructions: string }; // Just type the waiting message for now
165
+ input: ToolInputWaitingMessageType & { instructions: string };
107
166
  output: NonNullable<PageAttributes["queries"]>;
108
167
  };
109
- editPageQueries: {
110
- input: WaitingMessageSchema & { instructions: string }; // Just type the waiting message for now
111
- output: NonNullable<PageAttributes["queries"]>;
112
- };
113
- createSiteAttributes: {
114
- input: WaitingMessageSchema; // Just type the waiting message for now
115
- output: SiteAttributes;
116
- };
117
- getSiteAttributes: {
118
- input: null; // Just type the waiting message for now
119
- output: SiteAttributes;
120
- };
168
+ // editPageQueries: {
169
+ // input: ToolInputWaitingMessageType & { instructions: string };
170
+ // output: NonNullable<PageAttributes["queries"]>;
171
+ // };
172
+ // createSiteAttributes: {
173
+ // input: ToolInputWaitingMessageType;
174
+ // output: SiteAttributes;
175
+ // };
176
+ // getSiteAttributes: {
177
+ // input: unknown;
178
+ // output: SiteAttributes;
179
+ // };
180
+
121
181
  createDatasource: {
122
- input: WaitingMessageSchema; // Just type the waiting message for now
182
+ input: ToolInputWaitingMessageType & ToolInputInstructionsType & { id: string };
123
183
  output: InternalDatasource;
124
184
  };
125
185
  listDatasources: {
126
- input: null; // Just type the waiting message for now
186
+ input: unknown;
127
187
  output: InternalDatasource[];
128
188
  };
129
189
  createDatarecord: {
130
- input: WaitingMessageSchema; // Just type the waiting message for now
190
+ input: ToolInputWaitingMessageType & ToolInputInstructionsType & { id: string };
131
191
  output: Datarecord;
132
192
  };
133
193
  listDatarecords: {
134
- input: null; // Just type the waiting message for now
194
+ input: unknown;
135
195
  output: Datarecord[];
136
196
  };
137
197
  searchImages: {
138
- input: WaitingMessageSchema & { query: string }; // Just type the waiting message for now
198
+ input: ToolInputWaitingMessageType & { query: string };
139
199
  output: ImageSearchResultsType;
140
200
  };
141
201
  deleteBrick: {
142
- input: { id: string; waitingMessage: string }; // Just type the waiting message for now
143
- output: boolean | string; // true if deleted, error message if failed
202
+ input: { id: string };
203
+ output: Brick;
204
+ };
205
+ deleteSiteQuery: {
206
+ input: { id: string };
207
+ output: NonNullable<SiteAttributes["queries"]>; // Updated queries or error message if failed
208
+ };
209
+ deletePageQuery: {
210
+ input: { alias: string };
211
+ output: NonNullable<PageAttributes["queries"]>; // Updated queries or error message if failed
144
212
  };
145
213
  };
146
214
 
@@ -30,12 +30,18 @@ export const pageAttributesSchema = Type.Object(
30
30
  }),
31
31
  ),
32
32
  tags: Type.Optional(
33
- Type.Array(string("Tag"), {
33
+ Type.Array(Type.String({ description: "A tag for the page. Should be url-safe." }), {
34
34
  title: "Tags",
35
35
  description:
36
36
  "Use tags to organize, group and filter pages in navigation elements and in the dashboard. By default, the navbar element display pages having the 'navbar' tag, while the sidebar displays the pages with the tag 'sidebar'.",
37
37
  "ui:field": "tags",
38
- examples: [["navbar", "navbar"], ["navbar", "sidebar"], ["sidebar"]],
38
+ examples: [
39
+ ["navbar", "important"],
40
+ ["navbar", "sidebar"],
41
+ ["sidebar"],
42
+ ["campaign-landing-20250610"],
43
+ ],
44
+ maxItems: 8,
39
45
  }),
40
46
  ),
41
47
  path: string("URL path", {
@@ -379,13 +385,15 @@ export const siteAttributesSchema = Type.Object(
379
385
  },
380
386
  );
381
387
 
382
- export const siteAttributesNowQueriesSchema = Type.Omit(siteAttributesSchema, ["queries"]);
388
+ export const siteAttributesNoQueriesSchema = Type.Omit(siteAttributesSchema, ["queries"]);
383
389
  export const pageAttributesNoQueriesSchema = Type.Omit(pageAttributesSchema, ["queries"]);
384
390
  export const siteQueriesSchema = Type.Array(querySchema);
385
391
  export const siteQueriesSchemaLLM = toLLMSchema(siteQueriesSchema);
386
392
 
387
393
  export type PageAttributes = Static<typeof pageAttributesSchema>;
388
394
  export type SiteAttributes = Static<typeof siteAttributesSchema>;
395
+ export type SiteAttributesNoQueries = Static<typeof siteAttributesNoQueriesSchema>;
396
+ export type PageAttributesNoQueries = Static<typeof pageAttributesNoQueriesSchema>;
389
397
 
390
398
  export function resolvePageAttributes(data: Partial<PageAttributes> = {}) {
391
399
  const defaultAttrValues = getSchemaDefaults(pageAttributesSchema);
@@ -0,0 +1,9 @@
1
+ import type { BrickManifest } from "~/shared/brick-manifest";
2
+ import type { BrickProps } from "../props/types";
3
+
4
+ export type BrickExample<Manifest extends BrickManifest> = {
5
+ description: string;
6
+ type: string;
7
+ props: BrickProps<Manifest>["brick"]["props"];
8
+ mobileProps?: Partial<BrickProps<Manifest>["brick"]["props"]>;
9
+ };