@dxos/plugin-assistant 0.8.4-main.28f8d3d → 0.8.4-main.406dc2a

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 (476) hide show
  1. package/dist/lib/browser/{BlueprintContainer-H7H4BQ2C.mjs → BlueprintContainer-WX2SSDVI.mjs} +6 -7
  2. package/dist/lib/browser/{BlueprintContainer-H7H4BQ2C.mjs.map → BlueprintContainer-WX2SSDVI.mjs.map} +3 -3
  3. package/dist/lib/browser/ChatCompanion-BDZ55ZRF.mjs +150 -0
  4. package/dist/lib/browser/ChatCompanion-BDZ55ZRF.mjs.map +7 -0
  5. package/dist/lib/browser/{ChatContainer-OUVSX5V5.mjs → ChatContainer-RYGNN73X.mjs} +20 -23
  6. package/dist/lib/browser/ChatContainer-RYGNN73X.mjs.map +7 -0
  7. package/dist/lib/browser/{ChatDialog-P4FLEOHG.mjs → ChatDialog-MVHH2U66.mjs} +12 -12
  8. package/dist/lib/browser/ChatDialog-MVHH2U66.mjs.map +7 -0
  9. package/dist/lib/browser/{SequenceContainer-627OQ557.mjs → SequenceContainer-2FEWMQGW.mjs} +6 -19
  10. package/dist/lib/browser/SequenceContainer-2FEWMQGW.mjs.map +7 -0
  11. package/dist/lib/browser/ai-service-ERTZBTP3.mjs +19 -0
  12. package/dist/lib/browser/ai-service-ERTZBTP3.mjs.map +7 -0
  13. package/dist/lib/browser/{app-graph-builder-AVHHQ3KV.mjs → app-graph-builder-2U7SLCRX.mjs} +22 -34
  14. package/dist/lib/browser/app-graph-builder-2U7SLCRX.mjs.map +7 -0
  15. package/dist/lib/browser/blueprint-definition-NSJARW5U.mjs +12 -0
  16. package/dist/lib/browser/blueprint-definition-NSJARW5U.mjs.map +7 -0
  17. package/dist/lib/browser/{blueprint-definition-CMGIZAOW.mjs → chunk-2CE2KPKZ.mjs} +69 -40
  18. package/dist/lib/browser/chunk-2CE2KPKZ.mjs.map +7 -0
  19. package/dist/lib/browser/chunk-43I2LR6O.mjs +216 -0
  20. package/dist/lib/browser/chunk-43I2LR6O.mjs.map +7 -0
  21. package/dist/lib/browser/chunk-5EGXHCAZ.mjs +16 -0
  22. package/dist/lib/browser/chunk-5EGXHCAZ.mjs.map +7 -0
  23. package/dist/lib/browser/chunk-5RICKAMN.mjs +18 -0
  24. package/dist/lib/browser/chunk-5RICKAMN.mjs.map +7 -0
  25. package/dist/lib/browser/chunk-CQ7UHYTT.mjs +296 -0
  26. package/dist/lib/browser/chunk-CQ7UHYTT.mjs.map +7 -0
  27. package/dist/lib/browser/{chunk-HRLMD35M.mjs → chunk-FP56WB24.mjs} +36 -15
  28. package/dist/lib/browser/chunk-FP56WB24.mjs.map +7 -0
  29. package/dist/lib/browser/chunk-JZRZVB2A.mjs +170 -0
  30. package/dist/lib/browser/chunk-JZRZVB2A.mjs.map +7 -0
  31. package/dist/lib/browser/chunk-WRJGOT5P.mjs +1794 -0
  32. package/dist/lib/browser/chunk-WRJGOT5P.mjs.map +7 -0
  33. package/dist/lib/browser/edge-model-resolver-O6OFYIO2.mjs +18 -0
  34. package/dist/lib/browser/edge-model-resolver-O6OFYIO2.mjs.map +7 -0
  35. package/dist/lib/browser/index.mjs +127 -54
  36. package/dist/lib/browser/index.mjs.map +4 -4
  37. package/dist/lib/browser/{intent-resolver-MVOIEJXZ.mjs → intent-resolver-3GOJMBXJ.mjs} +48 -15
  38. package/dist/lib/browser/intent-resolver-3GOJMBXJ.mjs.map +7 -0
  39. package/dist/lib/browser/local-model-resolver-GO6ZEMLL.mjs +17 -0
  40. package/dist/lib/browser/local-model-resolver-GO6ZEMLL.mjs.map +7 -0
  41. package/dist/lib/browser/meta.json +1 -1
  42. package/dist/lib/browser/{react-surface-4HXS3YLT.mjs → react-surface-FTKCE6GG.mjs} +20 -76
  43. package/dist/lib/browser/react-surface-FTKCE6GG.mjs.map +7 -0
  44. package/dist/lib/browser/{settings-G2EZXMWT.mjs → settings-HBF32KV6.mjs} +5 -5
  45. package/dist/lib/browser/{settings-G2EZXMWT.mjs.map → settings-HBF32KV6.mjs.map} +1 -1
  46. package/dist/lib/browser/state-LXTS54DI.mjs +21 -0
  47. package/dist/lib/browser/state-LXTS54DI.mjs.map +7 -0
  48. package/dist/lib/browser/toolkit-NQ2GXCF5.mjs +199 -0
  49. package/dist/lib/browser/toolkit-NQ2GXCF5.mjs.map +7 -0
  50. package/dist/lib/browser/types/index.mjs +2 -2
  51. package/dist/lib/node-esm/{BlueprintContainer-VH4EE4CM.mjs → BlueprintContainer-4MKN6ZRB.mjs} +6 -7
  52. package/dist/lib/node-esm/{BlueprintContainer-VH4EE4CM.mjs.map → BlueprintContainer-4MKN6ZRB.mjs.map} +3 -3
  53. package/dist/lib/node-esm/ChatCompanion-XFNXVZIP.mjs +151 -0
  54. package/dist/lib/node-esm/ChatCompanion-XFNXVZIP.mjs.map +7 -0
  55. package/dist/lib/node-esm/{ChatContainer-D5FABDNE.mjs → ChatContainer-UTJGCQXF.mjs} +20 -23
  56. package/dist/lib/node-esm/ChatContainer-UTJGCQXF.mjs.map +7 -0
  57. package/dist/lib/node-esm/{ChatDialog-NKWVXHJP.mjs → ChatDialog-QEYZ4IOV.mjs} +12 -12
  58. package/dist/lib/node-esm/ChatDialog-QEYZ4IOV.mjs.map +7 -0
  59. package/dist/lib/node-esm/{SequenceContainer-EQ5NP2PG.mjs → SequenceContainer-PGGJUQ46.mjs} +6 -19
  60. package/dist/lib/node-esm/SequenceContainer-PGGJUQ46.mjs.map +7 -0
  61. package/dist/lib/node-esm/ai-service-MUYLV3NT.mjs +20 -0
  62. package/dist/lib/node-esm/ai-service-MUYLV3NT.mjs.map +7 -0
  63. package/dist/lib/node-esm/{app-graph-builder-RMOUJMMG.mjs → app-graph-builder-OKNLR7H2.mjs} +22 -34
  64. package/dist/lib/node-esm/app-graph-builder-OKNLR7H2.mjs.map +7 -0
  65. package/dist/lib/node-esm/blueprint-definition-WD2IVMAI.mjs +13 -0
  66. package/dist/lib/node-esm/blueprint-definition-WD2IVMAI.mjs.map +7 -0
  67. package/dist/lib/node-esm/chunk-73ABYRYX.mjs +20 -0
  68. package/dist/lib/node-esm/chunk-73ABYRYX.mjs.map +7 -0
  69. package/dist/lib/node-esm/chunk-DSE2IILK.mjs +217 -0
  70. package/dist/lib/node-esm/chunk-DSE2IILK.mjs.map +7 -0
  71. package/dist/lib/node-esm/chunk-E2WXZND7.mjs +297 -0
  72. package/dist/lib/node-esm/chunk-E2WXZND7.mjs.map +7 -0
  73. package/dist/lib/node-esm/chunk-HXIBCBH4.mjs +171 -0
  74. package/dist/lib/node-esm/chunk-HXIBCBH4.mjs.map +7 -0
  75. package/dist/lib/node-esm/{chunk-F7RXCX5Y.mjs → chunk-TNR46C3L.mjs} +36 -15
  76. package/dist/lib/node-esm/chunk-TNR46C3L.mjs.map +7 -0
  77. package/dist/lib/node-esm/{blueprint-definition-AEWYMW6I.mjs → chunk-U2NYUS2N.mjs} +69 -39
  78. package/dist/lib/node-esm/chunk-U2NYUS2N.mjs.map +7 -0
  79. package/dist/lib/node-esm/chunk-UFKLCEAE.mjs +1795 -0
  80. package/dist/lib/node-esm/chunk-UFKLCEAE.mjs.map +7 -0
  81. package/dist/lib/node-esm/{chunk-X6AANUHZ.mjs → chunk-XQGWSZ4T.mjs} +4 -4
  82. package/dist/lib/node-esm/chunk-XQGWSZ4T.mjs.map +7 -0
  83. package/dist/lib/node-esm/edge-model-resolver-2ARXDOYS.mjs +19 -0
  84. package/dist/lib/node-esm/edge-model-resolver-2ARXDOYS.mjs.map +7 -0
  85. package/dist/lib/node-esm/index.mjs +127 -54
  86. package/dist/lib/node-esm/index.mjs.map +4 -4
  87. package/dist/lib/node-esm/{intent-resolver-DTDNCX3C.mjs → intent-resolver-6XLVTRDJ.mjs} +48 -15
  88. package/dist/lib/node-esm/intent-resolver-6XLVTRDJ.mjs.map +7 -0
  89. package/dist/lib/node-esm/local-model-resolver-WOQ2D2R2.mjs +18 -0
  90. package/dist/lib/node-esm/local-model-resolver-WOQ2D2R2.mjs.map +7 -0
  91. package/dist/lib/node-esm/meta.json +1 -1
  92. package/dist/lib/node-esm/{react-surface-V6JNEZVO.mjs → react-surface-K7ZXQLAP.mjs} +20 -76
  93. package/dist/lib/node-esm/react-surface-K7ZXQLAP.mjs.map +7 -0
  94. package/dist/lib/node-esm/{settings-AIP5FOJG.mjs → settings-CWP6MTWP.mjs} +5 -5
  95. package/dist/lib/node-esm/{settings-AIP5FOJG.mjs.map → settings-CWP6MTWP.mjs.map} +1 -1
  96. package/dist/lib/node-esm/state-BO6GUFLB.mjs +22 -0
  97. package/dist/lib/node-esm/state-BO6GUFLB.mjs.map +7 -0
  98. package/dist/lib/node-esm/toolkit-V57PRJNG.mjs +200 -0
  99. package/dist/lib/node-esm/toolkit-V57PRJNG.mjs.map +7 -0
  100. package/dist/lib/node-esm/types/index.mjs +2 -2
  101. package/dist/types/src/AssistantPlugin.d.ts +1 -1
  102. package/dist/types/src/AssistantPlugin.d.ts.map +1 -1
  103. package/dist/types/src/capabilities/ai-service.d.ts +2 -3
  104. package/dist/types/src/capabilities/ai-service.d.ts.map +1 -1
  105. package/dist/types/src/capabilities/app-graph-builder.d.ts +1 -1
  106. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  107. package/dist/types/src/capabilities/blueprint-definition.d.ts +5 -1
  108. package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -1
  109. package/dist/types/src/capabilities/capabilities.d.ts +8 -8
  110. package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
  111. package/dist/types/src/capabilities/edge-model-resolver.d.ts +2 -3
  112. package/dist/types/src/capabilities/edge-model-resolver.d.ts.map +1 -1
  113. package/dist/types/src/capabilities/index.d.ts +7 -4
  114. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  115. package/dist/types/src/capabilities/intent-resolver.d.ts +1 -1
  116. package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
  117. package/dist/types/src/capabilities/local-model-resolver.d.ts +10 -0
  118. package/dist/types/src/capabilities/local-model-resolver.d.ts.map +1 -0
  119. package/dist/types/src/capabilities/react-surface.d.ts +1 -1
  120. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  121. package/dist/types/src/capabilities/settings.d.ts +1 -1
  122. package/dist/types/src/capabilities/state.d.ts +4 -0
  123. package/dist/types/src/capabilities/state.d.ts.map +1 -0
  124. package/dist/types/src/capabilities/toolkit.d.ts +2 -3
  125. package/dist/types/src/capabilities/toolkit.d.ts.map +1 -1
  126. package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts.map +1 -1
  127. package/dist/types/src/components/Chat/Chat.d.ts +16 -10
  128. package/dist/types/src/components/Chat/Chat.d.ts.map +1 -1
  129. package/dist/types/src/components/Chat/events.d.ts +5 -0
  130. package/dist/types/src/components/Chat/events.d.ts.map +1 -1
  131. package/dist/types/src/components/ChatCompanion.d.ts +13 -0
  132. package/dist/types/src/components/ChatCompanion.d.ts.map +1 -0
  133. package/dist/types/src/components/ChatContainer.d.ts +3 -4
  134. package/dist/types/src/components/ChatContainer.d.ts.map +1 -1
  135. package/dist/types/src/components/ChatProgress/ChatProgress.d.ts +7 -0
  136. package/dist/types/src/components/ChatProgress/ChatProgress.d.ts.map +1 -0
  137. package/dist/types/src/components/ChatProgress/index.d.ts +2 -0
  138. package/dist/types/src/components/ChatProgress/index.d.ts.map +1 -0
  139. package/dist/types/src/components/ChatPrompt/ChatActions.d.ts.map +1 -1
  140. package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts +11 -4
  141. package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts.map +1 -1
  142. package/dist/types/src/components/ChatPrompt/ChatPresets.d.ts.map +1 -1
  143. package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts +3 -4
  144. package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts.map +1 -1
  145. package/dist/types/src/components/ChatPrompt/ChatStatusIndicator.d.ts +6 -4
  146. package/dist/types/src/components/ChatPrompt/ChatStatusIndicator.d.ts.map +1 -1
  147. package/dist/types/src/components/ChatThread/ChatThread.d.ts +12 -7
  148. package/dist/types/src/components/ChatThread/ChatThread.d.ts.map +1 -1
  149. package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts +112 -56
  150. package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts.map +1 -1
  151. package/dist/types/src/components/ChatThread/Link.d.ts.map +1 -1
  152. package/dist/types/src/components/ChatThread/reducers.d.ts +40 -0
  153. package/dist/types/src/components/ChatThread/reducers.d.ts.map +1 -0
  154. package/dist/types/src/components/ChatThread/registry.d.ts +11 -0
  155. package/dist/types/src/components/ChatThread/registry.d.ts.map +1 -0
  156. package/dist/types/src/components/ChatThread/sync.d.ts +36 -0
  157. package/dist/types/src/components/ChatThread/sync.d.ts.map +1 -0
  158. package/dist/types/src/components/ChatThread/sync.test.d.ts +2 -0
  159. package/dist/types/src/components/ChatThread/sync.test.d.ts.map +1 -0
  160. package/dist/types/src/components/PromptSettings.d.ts.map +1 -1
  161. package/dist/types/src/components/SequenceContainer.d.ts.map +1 -1
  162. package/dist/types/src/components/SequenceEditor/SequenceEditor.d.ts +1 -1
  163. package/dist/types/src/components/SequenceEditor/SequenceEditor.d.ts.map +1 -1
  164. package/dist/types/src/components/SequenceEditor/SequenceEditor.stories.d.ts +264 -3
  165. package/dist/types/src/components/SequenceEditor/SequenceEditor.stories.d.ts.map +1 -1
  166. package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts +0 -5
  167. package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts.map +1 -1
  168. package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts +262 -7
  169. package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts.map +1 -1
  170. package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts +1 -1
  171. package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts.map +1 -1
  172. package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts +259 -2
  173. package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts.map +1 -1
  174. package/dist/types/src/components/TemplateEditor/handlebars-extension.d.ts +12 -0
  175. package/dist/types/src/components/TemplateEditor/handlebars-extension.d.ts.map +1 -0
  176. package/dist/types/src/components/ToolBlock/ToolBlock.d.ts +19 -0
  177. package/dist/types/src/components/ToolBlock/ToolBlock.d.ts.map +1 -0
  178. package/dist/types/src/components/ToolBlock/ToolBlockWidget.d.ts +2 -0
  179. package/dist/types/src/components/ToolBlock/ToolBlockWidget.d.ts.map +1 -0
  180. package/dist/types/src/components/ToolBlock/index.d.ts +3 -0
  181. package/dist/types/src/components/ToolBlock/index.d.ts.map +1 -0
  182. package/dist/types/src/components/Toolbar/Toolbar.d.ts +5 -0
  183. package/dist/types/src/components/Toolbar/Toolbar.d.ts.map +1 -0
  184. package/dist/types/src/components/Toolbar/index.d.ts +2 -0
  185. package/dist/types/src/components/Toolbar/index.d.ts.map +1 -0
  186. package/dist/types/src/components/Toolbar/useChatToolbarActions.d.ts +11 -0
  187. package/dist/types/src/components/Toolbar/useChatToolbarActions.d.ts.map +1 -0
  188. package/dist/types/src/components/Toolbox/Toolbox.d.ts +1 -3
  189. package/dist/types/src/components/Toolbox/Toolbox.d.ts.map +1 -1
  190. package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts +263 -5
  191. package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts.map +1 -1
  192. package/dist/types/src/components/index.d.ts +4 -2
  193. package/dist/types/src/components/index.d.ts.map +1 -1
  194. package/dist/types/src/functions/analysis.d.ts.map +1 -1
  195. package/dist/types/src/functions/list.d.ts.map +1 -1
  196. package/dist/types/src/functions/load.d.ts +1 -1
  197. package/dist/types/src/functions/load.d.ts.map +1 -1
  198. package/dist/types/src/hooks/index.d.ts +4 -4
  199. package/dist/types/src/hooks/index.d.ts.map +1 -1
  200. package/dist/types/src/hooks/useBlueprintRegistry.d.ts +5 -1
  201. package/dist/types/src/hooks/useBlueprintRegistry.d.ts.map +1 -1
  202. package/dist/types/src/hooks/useChatProcessor.d.ts +4 -10
  203. package/dist/types/src/hooks/useChatProcessor.d.ts.map +1 -1
  204. package/dist/types/src/hooks/useChatServices.d.ts +5 -5
  205. package/dist/types/src/hooks/useChatServices.d.ts.map +1 -1
  206. package/dist/types/src/hooks/useContextBinder.d.ts +4 -0
  207. package/dist/types/src/hooks/useContextBinder.d.ts.map +1 -0
  208. package/dist/types/src/hooks/useContextObjects.d.ts +15 -0
  209. package/dist/types/src/hooks/useContextObjects.d.ts.map +1 -0
  210. package/dist/types/src/hooks/useFlush.d.ts.map +1 -0
  211. package/dist/types/src/hooks/useItemTypes.d.ts +4 -0
  212. package/dist/types/src/hooks/useItemTypes.d.ts.map +1 -0
  213. package/dist/types/src/hooks/usePresets.d.ts +2 -2
  214. package/dist/types/src/hooks/usePresets.d.ts.map +1 -1
  215. package/dist/types/src/index.d.ts +2 -0
  216. package/dist/types/src/index.d.ts.map +1 -1
  217. package/dist/types/src/meta.d.ts +1 -2
  218. package/dist/types/src/meta.d.ts.map +1 -1
  219. package/dist/types/src/processor/index.d.ts +3 -0
  220. package/dist/types/src/processor/index.d.ts.map +1 -0
  221. package/dist/types/src/{hooks → processor}/presets.d.ts +1 -1
  222. package/dist/types/src/processor/presets.d.ts.map +1 -0
  223. package/dist/types/src/processor/processor.d.ts +74 -0
  224. package/dist/types/src/processor/processor.d.ts.map +1 -0
  225. package/dist/types/src/processor/processor.test.d.ts +2 -0
  226. package/dist/types/src/processor/processor.test.d.ts.map +1 -0
  227. package/dist/types/src/testing/index.d.ts +1 -1
  228. package/dist/types/src/testing/index.d.ts.map +1 -1
  229. package/dist/types/src/testing/test-generator.d.ts +7 -0
  230. package/dist/types/src/testing/test-generator.d.ts.map +1 -0
  231. package/dist/types/src/testing/test-sequence.d.ts +0 -4
  232. package/dist/types/src/testing/test-sequence.d.ts.map +1 -1
  233. package/dist/types/src/testing/test-services.d.ts +2 -2
  234. package/dist/types/src/testing/test-services.d.ts.map +1 -1
  235. package/dist/types/src/translations.d.ts +27 -16
  236. package/dist/types/src/translations.d.ts.map +1 -1
  237. package/dist/types/src/types/Assistant.d.ts +16 -5
  238. package/dist/types/src/types/Assistant.d.ts.map +1 -1
  239. package/dist/types/src/types/AssistantAction.d.ts +23 -6
  240. package/dist/types/src/types/AssistantAction.d.ts.map +1 -1
  241. package/dist/types/src/types/service.d.ts +21 -18
  242. package/dist/types/src/types/service.d.ts.map +1 -1
  243. package/dist/types/tsconfig.tsbuildinfo +1 -1
  244. package/package.json +90 -96
  245. package/src/AssistantPlugin.tsx +138 -116
  246. package/src/capabilities/ai-service.ts +6 -7
  247. package/src/capabilities/app-graph-builder.ts +39 -45
  248. package/src/capabilities/blueprint-definition.ts +51 -19
  249. package/src/capabilities/capabilities.ts +8 -12
  250. package/src/capabilities/edge-model-resolver.ts +17 -21
  251. package/src/capabilities/index.ts +5 -2
  252. package/src/capabilities/intent-resolver.ts +38 -15
  253. package/src/capabilities/local-model-resolver.ts +30 -0
  254. package/src/capabilities/react-surface.tsx +9 -63
  255. package/src/capabilities/state.ts +20 -0
  256. package/src/capabilities/toolkit.ts +93 -31
  257. package/src/components/AssistantSettings/AssistantSettings.tsx +82 -75
  258. package/src/components/BlueprintContainer.tsx +2 -2
  259. package/src/components/Chat/Chat.tsx +167 -172
  260. package/src/components/Chat/events.ts +7 -0
  261. package/src/components/ChatCompanion.tsx +136 -0
  262. package/src/components/ChatContainer.tsx +13 -31
  263. package/src/components/ChatDialog.tsx +11 -11
  264. package/src/components/ChatProgress/ChatProgress.tsx +67 -0
  265. package/src/components/ChatProgress/index.ts +5 -0
  266. package/src/components/ChatPrompt/ChatActions.tsx +10 -24
  267. package/src/components/ChatPrompt/ChatOptions.tsx +200 -34
  268. package/src/components/ChatPrompt/ChatPresets.tsx +1 -0
  269. package/src/components/ChatPrompt/ChatReferences.tsx +29 -36
  270. package/src/components/ChatPrompt/ChatStatusIndicator.tsx +25 -22
  271. package/src/components/ChatThread/ChatThread.stories.tsx +74 -205
  272. package/src/components/ChatThread/ChatThread.tsx +69 -29
  273. package/src/components/ChatThread/Link.tsx +8 -21
  274. package/src/components/ChatThread/reducers.ts +151 -0
  275. package/src/components/ChatThread/registry.tsx +184 -0
  276. package/src/components/ChatThread/sync.test.ts +81 -0
  277. package/src/components/ChatThread/sync.ts +113 -0
  278. package/src/components/PromptSettings.tsx +1 -0
  279. package/src/components/SequenceContainer.tsx +27 -29
  280. package/src/components/SequenceEditor/SequenceEditor.stories.tsx +8 -6
  281. package/src/components/SequenceEditor/SequenceEditor.tsx +2 -2
  282. package/src/components/TemplateEditor/TemplateEditor.stories.tsx +17 -13
  283. package/src/components/TemplateEditor/TemplateEditor.tsx +16 -50
  284. package/src/components/TemplateEditor/TemplateForm.stories.tsx +6 -8
  285. package/src/components/TemplateEditor/TemplateForm.tsx +2 -1
  286. package/src/components/TemplateEditor/handlebars-extension.ts +165 -0
  287. package/src/components/ToolBlock/ToolBlock.tsx +152 -0
  288. package/src/components/ToolBlock/ToolBlockWidget.tsx +5 -0
  289. package/src/components/ToolBlock/index.ts +6 -0
  290. package/src/components/Toolbar/Toolbar.tsx +21 -0
  291. package/src/components/{Timeline → Toolbar}/index.ts +1 -1
  292. package/src/components/Toolbar/useChatToolbarActions.ts +126 -0
  293. package/src/components/Toolbox/Toolbox.stories.tsx +9 -12
  294. package/src/components/Toolbox/Toolbox.tsx +10 -16
  295. package/src/components/index.ts +3 -1
  296. package/src/functions/analysis.ts +6 -4
  297. package/src/functions/list.ts +9 -3
  298. package/src/functions/load.ts +8 -5
  299. package/src/hooks/index.ts +4 -5
  300. package/src/hooks/useBlueprintRegistry.ts +24 -9
  301. package/src/hooks/useChatProcessor.ts +19 -26
  302. package/src/hooks/useChatServices.ts +30 -53
  303. package/src/hooks/useContextBinder.ts +30 -0
  304. package/src/hooks/useContextObjects.ts +58 -0
  305. package/src/hooks/useItemTypes.ts +37 -0
  306. package/src/hooks/usePresets.ts +4 -5
  307. package/src/index.ts +2 -0
  308. package/src/meta.ts +4 -6
  309. package/src/processor/index.ts +6 -0
  310. package/src/{hooks → processor}/presets.ts +10 -3
  311. package/src/processor/processor.test.ts +81 -0
  312. package/src/processor/processor.ts +302 -0
  313. package/src/queue-logger.ts +5 -5
  314. package/src/testing/index.ts +1 -1
  315. package/src/testing/test-generator.ts +261 -0
  316. package/src/testing/test-sequence.ts +1 -26
  317. package/src/testing/test-services.ts +2 -8
  318. package/src/translations.ts +29 -17
  319. package/src/types/Assistant.ts +9 -4
  320. package/src/types/AssistantAction.ts +11 -3
  321. package/src/types/service.ts +15 -7
  322. package/src/vite-env.d.ts +30 -0
  323. package/dist/lib/browser/ChatContainer-OUVSX5V5.mjs.map +0 -7
  324. package/dist/lib/browser/ChatDialog-P4FLEOHG.mjs.map +0 -7
  325. package/dist/lib/browser/SequenceContainer-627OQ557.mjs.map +0 -7
  326. package/dist/lib/browser/ai-service-7KJ5LXBT.mjs +0 -22
  327. package/dist/lib/browser/ai-service-7KJ5LXBT.mjs.map +0 -7
  328. package/dist/lib/browser/app-graph-builder-AVHHQ3KV.mjs.map +0 -7
  329. package/dist/lib/browser/blueprint-definition-CMGIZAOW.mjs.map +0 -7
  330. package/dist/lib/browser/chunk-BRLHDHOF.mjs +0 -244
  331. package/dist/lib/browser/chunk-BRLHDHOF.mjs.map +0 -7
  332. package/dist/lib/browser/chunk-HRLMD35M.mjs.map +0 -7
  333. package/dist/lib/browser/chunk-LKP65RPA.mjs +0 -20
  334. package/dist/lib/browser/chunk-LKP65RPA.mjs.map +0 -7
  335. package/dist/lib/browser/chunk-NZDCKQ6W.mjs +0 -89
  336. package/dist/lib/browser/chunk-NZDCKQ6W.mjs.map +0 -7
  337. package/dist/lib/browser/chunk-QB7OVS6Z.mjs +0 -16
  338. package/dist/lib/browser/chunk-QB7OVS6Z.mjs.map +0 -7
  339. package/dist/lib/browser/chunk-VEBVAHNM.mjs +0 -2231
  340. package/dist/lib/browser/chunk-VEBVAHNM.mjs.map +0 -7
  341. package/dist/lib/browser/edge-model-resolver-2HB4PCWH.mjs +0 -24
  342. package/dist/lib/browser/edge-model-resolver-2HB4PCWH.mjs.map +0 -7
  343. package/dist/lib/browser/intent-resolver-MVOIEJXZ.mjs.map +0 -7
  344. package/dist/lib/browser/react-surface-4HXS3YLT.mjs.map +0 -7
  345. package/dist/lib/browser/toolkit-IW4FBLLB.mjs +0 -105
  346. package/dist/lib/browser/toolkit-IW4FBLLB.mjs.map +0 -7
  347. package/dist/lib/node-esm/ChatContainer-D5FABDNE.mjs.map +0 -7
  348. package/dist/lib/node-esm/ChatDialog-NKWVXHJP.mjs.map +0 -7
  349. package/dist/lib/node-esm/SequenceContainer-EQ5NP2PG.mjs.map +0 -7
  350. package/dist/lib/node-esm/ai-service-LDD32477.mjs +0 -23
  351. package/dist/lib/node-esm/ai-service-LDD32477.mjs.map +0 -7
  352. package/dist/lib/node-esm/app-graph-builder-RMOUJMMG.mjs.map +0 -7
  353. package/dist/lib/node-esm/blueprint-definition-AEWYMW6I.mjs.map +0 -7
  354. package/dist/lib/node-esm/chunk-3SOC5GOP.mjs +0 -2232
  355. package/dist/lib/node-esm/chunk-3SOC5GOP.mjs.map +0 -7
  356. package/dist/lib/node-esm/chunk-F7RXCX5Y.mjs.map +0 -7
  357. package/dist/lib/node-esm/chunk-GAWXJ7K5.mjs +0 -90
  358. package/dist/lib/node-esm/chunk-GAWXJ7K5.mjs.map +0 -7
  359. package/dist/lib/node-esm/chunk-KOC6ESG7.mjs +0 -22
  360. package/dist/lib/node-esm/chunk-KOC6ESG7.mjs.map +0 -7
  361. package/dist/lib/node-esm/chunk-RD755HN3.mjs +0 -245
  362. package/dist/lib/node-esm/chunk-RD755HN3.mjs.map +0 -7
  363. package/dist/lib/node-esm/chunk-X6AANUHZ.mjs.map +0 -7
  364. package/dist/lib/node-esm/edge-model-resolver-UDDR2IA6.mjs +0 -25
  365. package/dist/lib/node-esm/edge-model-resolver-UDDR2IA6.mjs.map +0 -7
  366. package/dist/lib/node-esm/intent-resolver-DTDNCX3C.mjs.map +0 -7
  367. package/dist/lib/node-esm/react-surface-V6JNEZVO.mjs.map +0 -7
  368. package/dist/lib/node-esm/toolkit-2VNUL77B.mjs +0 -106
  369. package/dist/lib/node-esm/toolkit-2VNUL77B.mjs.map +0 -7
  370. package/dist/types/src/components/ChatThread/ChatMessage.d.ts +0 -18
  371. package/dist/types/src/components/ChatThread/ChatMessage.d.ts.map +0 -1
  372. package/dist/types/src/components/ChatThread/ToolBlock.d.ts +0 -19
  373. package/dist/types/src/components/ChatThread/ToolBlock.d.ts.map +0 -1
  374. package/dist/types/src/components/ChatThread/reducer.d.ts +0 -12
  375. package/dist/types/src/components/ChatThread/reducer.d.ts.map +0 -1
  376. package/dist/types/src/components/Timeline/Timeline.d.ts +0 -24
  377. package/dist/types/src/components/Timeline/Timeline.d.ts.map +0 -1
  378. package/dist/types/src/components/Timeline/Timeline.stories.d.ts +0 -9
  379. package/dist/types/src/components/Timeline/Timeline.stories.d.ts.map +0 -1
  380. package/dist/types/src/components/Timeline/index.d.ts +0 -2
  381. package/dist/types/src/components/Timeline/index.d.ts.map +0 -1
  382. package/dist/types/src/hooks/chat-processor.d.ts +0 -72
  383. package/dist/types/src/hooks/chat-processor.d.ts.map +0 -1
  384. package/dist/types/src/hooks/errors.d.ts +0 -4
  385. package/dist/types/src/hooks/errors.d.ts.map +0 -1
  386. package/dist/types/src/hooks/presets.d.ts.map +0 -1
  387. package/dist/types/src/hooks/useResolveRef.d.ts +0 -4
  388. package/dist/types/src/hooks/useResolveRef.d.ts.map +0 -1
  389. package/dist/types/src/parser/filter-generator.d.ts +0 -4
  390. package/dist/types/src/parser/filter-generator.d.ts.map +0 -1
  391. package/dist/types/src/parser/filter-generator.test.d.ts +0 -2
  392. package/dist/types/src/parser/filter-generator.test.d.ts.map +0 -1
  393. package/dist/types/src/parser/index.d.ts +0 -4
  394. package/dist/types/src/parser/index.d.ts.map +0 -1
  395. package/dist/types/src/parser/query-parser.d.ts +0 -15
  396. package/dist/types/src/parser/query-parser.d.ts.map +0 -1
  397. package/dist/types/src/parser/query-parser.test.d.ts +0 -2
  398. package/dist/types/src/parser/query-parser.test.d.ts.map +0 -1
  399. package/dist/types/src/parser/types.d.ts +0 -24
  400. package/dist/types/src/parser/types.d.ts.map +0 -1
  401. package/dist/types/src/stories/Chat.stories.d.ts +0 -268
  402. package/dist/types/src/stories/Chat.stories.d.ts.map +0 -1
  403. package/dist/types/src/stories/components/BlueprintContainer.d.ts +0 -5
  404. package/dist/types/src/stories/components/BlueprintContainer.d.ts.map +0 -1
  405. package/dist/types/src/stories/components/ChatContainer.d.ts +0 -5
  406. package/dist/types/src/stories/components/ChatContainer.d.ts.map +0 -1
  407. package/dist/types/src/stories/components/GraphContainer.d.ts +0 -6
  408. package/dist/types/src/stories/components/GraphContainer.d.ts.map +0 -1
  409. package/dist/types/src/stories/components/LoggingContainer.d.ts +0 -5
  410. package/dist/types/src/stories/components/LoggingContainer.d.ts.map +0 -1
  411. package/dist/types/src/stories/components/SurfaceContainer.d.ts +0 -8
  412. package/dist/types/src/stories/components/SurfaceContainer.d.ts.map +0 -1
  413. package/dist/types/src/stories/components/TasksContainer.d.ts +0 -5
  414. package/dist/types/src/stories/components/TasksContainer.d.ts.map +0 -1
  415. package/dist/types/src/stories/components/index.d.ts +0 -8
  416. package/dist/types/src/stories/components/index.d.ts.map +0 -1
  417. package/dist/types/src/stories/components/types.d.ts +0 -7
  418. package/dist/types/src/stories/components/types.d.ts.map +0 -1
  419. package/dist/types/src/stories/hooks/index.d.ts +0 -3
  420. package/dist/types/src/stories/hooks/index.d.ts.map +0 -1
  421. package/dist/types/src/stories/hooks/useFlush.d.ts.map +0 -1
  422. package/dist/types/src/stories/hooks/useMatcherExtension.d.ts +0 -3
  423. package/dist/types/src/stories/hooks/useMatcherExtension.d.ts.map +0 -1
  424. package/dist/types/src/stories/testing/data.d.ts +0 -142
  425. package/dist/types/src/stories/testing/data.d.ts.map +0 -1
  426. package/dist/types/src/stories/testing/index.d.ts +0 -3
  427. package/dist/types/src/stories/testing/index.d.ts.map +0 -1
  428. package/dist/types/src/stories/testing/testing.d.ts +0 -26
  429. package/dist/types/src/stories/testing/testing.d.ts.map +0 -1
  430. package/dist/types/src/testing/test-functions.d.ts +0 -6
  431. package/dist/types/src/testing/test-functions.d.ts.map +0 -1
  432. package/dist/types/src/tools/function.d.ts +0 -5
  433. package/dist/types/src/tools/function.d.ts.map +0 -1
  434. package/dist/types/src/tools/index.d.ts +0 -3
  435. package/dist/types/src/tools/index.d.ts.map +0 -1
  436. package/dist/types/src/tools/openapi.d.ts +0 -10
  437. package/dist/types/src/tools/openapi.d.ts.map +0 -1
  438. package/dist/types/src/tools/openapi.test.d.ts +0 -2
  439. package/dist/types/src/tools/openapi.test.d.ts.map +0 -1
  440. package/src/components/ChatThread/ChatMessage.tsx +0 -282
  441. package/src/components/ChatThread/ToolBlock.tsx +0 -125
  442. package/src/components/ChatThread/reducer.ts +0 -52
  443. package/src/components/Timeline/Timeline.stories.tsx +0 -53
  444. package/src/components/Timeline/Timeline.tsx +0 -159
  445. package/src/hooks/chat-processor.ts +0 -260
  446. package/src/hooks/errors.ts +0 -8
  447. package/src/hooks/useResolveRef.ts +0 -33
  448. package/src/parser/filter-generator.test.ts +0 -32
  449. package/src/parser/filter-generator.ts +0 -74
  450. package/src/parser/index.ts +0 -7
  451. package/src/parser/query-parser.test.ts +0 -139
  452. package/src/parser/query-parser.ts +0 -199
  453. package/src/parser/types.ts +0 -34
  454. package/src/shims.d.ts +0 -8
  455. package/src/stories/Chat.stories.tsx +0 -317
  456. package/src/stories/components/BlueprintContainer.tsx +0 -34
  457. package/src/stories/components/ChatContainer.tsx +0 -80
  458. package/src/stories/components/GraphContainer.tsx +0 -118
  459. package/src/stories/components/LoggingContainer.tsx +0 -22
  460. package/src/stories/components/SurfaceContainer.tsx +0 -62
  461. package/src/stories/components/TasksContainer.tsx +0 -51
  462. package/src/stories/components/index.ts +0 -12
  463. package/src/stories/components/types.ts +0 -11
  464. package/src/stories/hooks/index.ts +0 -6
  465. package/src/stories/hooks/useMatcherExtension.ts +0 -45
  466. package/src/stories/testing/data.ts +0 -130
  467. package/src/stories/testing/index.ts +0 -6
  468. package/src/stories/testing/testing.tsx +0 -162
  469. package/src/testing/test-functions.ts +0 -16
  470. package/src/tools/function.ts +0 -49
  471. package/src/tools/index.ts +0 -6
  472. package/src/tools/openapi.test.ts +0 -219
  473. package/src/tools/openapi.ts +0 -341
  474. package/src/typings.d.ts +0 -9
  475. /package/dist/types/src/{stories/hooks → hooks}/useFlush.d.ts +0 -0
  476. /package/src/{stories/hooks → hooks}/useFlush.ts +0 -0
@@ -1,142 +0,0 @@
1
- import { type Space } from '@dxos/client/echo';
2
- import { type Type } from '@dxos/echo';
3
- export declare const testTypes: (Type.obj<import("effect/Schema").Struct<{
4
- id: import("@dxos/keys").ObjectIdClass;
5
- name: import("effect/Schema").optional<import("effect/Schema").SchemaClass<string, string, never>>;
6
- description: import("effect/Schema").optional<import("effect/Schema").SchemaClass<string, string, never>>;
7
- status: import("effect/Schema").optional<import("effect/Schema").Literal<["prospect", "qualified", "active", "commit", "reject"]>>;
8
- image: import("effect/Schema").optional<import("effect/Schema").SchemaClass<string, string, never>>;
9
- website: import("effect/Schema").optional<import("effect/Schema").SchemaClass<string, string, never>>;
10
- }>> | Type.obj<import("effect/Schema").Struct<{
11
- fullName: import("effect/Schema").optional<import("effect/Schema").SchemaClass<string, string, never>>;
12
- preferredName: import("effect/Schema").optional<import("effect/Schema").SchemaClass<string, string, never>>;
13
- nickname: import("effect/Schema").optional<import("effect/Schema").SchemaClass<string, string, never>>;
14
- image: import("effect/Schema").optional<import("effect/Schema").SchemaClass<string, string, never>>;
15
- organization: import("effect/Schema").optional<import("effect/Schema").Schema<import("@dxos/echo-schema").Ref<import("@dxos/echo/Type").OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
16
- id: string;
17
- name?: string | undefined;
18
- description?: string | undefined;
19
- status?: "prospect" | "qualified" | "active" | "commit" | "reject" | undefined;
20
- image?: string | undefined;
21
- website?: string | undefined;
22
- }>, import("@dxos/echo-protocol").EncodedReference, never>>;
23
- jobTitle: import("effect/Schema").optional<import("effect/Schema").SchemaClass<string, string, never>>;
24
- department: import("effect/Schema").optional<import("effect/Schema").SchemaClass<string, string, never>>;
25
- notes: import("effect/Schema").optional<import("effect/Schema").SchemaClass<string, string, never>>;
26
- emails: import("effect/Schema").optional<import("effect/Schema").mutable<import("effect/Schema").Array$<import("effect/Schema").Struct<{
27
- label: import("effect/Schema").optional<typeof import("effect/Schema").String>;
28
- value: import("effect/Schema").refine<string, typeof import("effect/Schema").String>;
29
- }>>>>;
30
- identities: import("effect/Schema").optional<import("effect/Schema").mutable<import("effect/Schema").Array$<import("effect/Schema").Struct<{
31
- label: import("effect/Schema").optional<typeof import("effect/Schema").String>;
32
- value: typeof import("effect/Schema").String;
33
- }>>>>;
34
- phoneNumbers: import("effect/Schema").optional<import("effect/Schema").mutable<import("effect/Schema").Array$<import("effect/Schema").Struct<{
35
- label: import("effect/Schema").optional<typeof import("effect/Schema").String>;
36
- value: typeof import("effect/Schema").String;
37
- }>>>>;
38
- addresses: import("effect/Schema").optional<import("effect/Schema").mutable<import("effect/Schema").Array$<import("effect/Schema").Struct<{
39
- label: import("effect/Schema").optional<typeof import("effect/Schema").String>;
40
- value: import("effect/Schema").Struct<{
41
- street: import("effect/Schema").optional<import("effect/Schema").SchemaClass<string, string, never>>;
42
- extended: import("effect/Schema").optional<import("effect/Schema").SchemaClass<string, string, never>>;
43
- locality: import("effect/Schema").optional<import("effect/Schema").SchemaClass<string, string, never>>;
44
- region: import("effect/Schema").optional<import("effect/Schema").SchemaClass<string, string, never>>;
45
- postalCode: import("effect/Schema").optional<import("effect/Schema").SchemaClass<string, string, never>>;
46
- postOfficeBoxNumber: import("effect/Schema").optional<import("effect/Schema").SchemaClass<string, string, never>>;
47
- country: import("effect/Schema").optional<import("effect/Schema").SchemaClass<string, string, never>>;
48
- }>;
49
- }>>>>;
50
- urls: import("effect/Schema").optional<import("effect/Schema").mutable<import("effect/Schema").Array$<import("effect/Schema").Struct<{
51
- label: import("effect/Schema").optional<typeof import("effect/Schema").String>;
52
- value: import("effect/Schema").refine<string, typeof import("effect/Schema").String>;
53
- }>>>>;
54
- birthday: import("effect/Schema").optional<import("effect/Schema").SchemaClass<string, string, never>>;
55
- fields: import("effect/Schema").optional<import("effect/Schema").mutable<import("effect/Schema").Array$<import("effect/Schema").Struct<{
56
- category: import("effect/Schema").optional<typeof import("effect/Schema").String>;
57
- label: typeof import("effect/Schema").String;
58
- value: typeof import("effect/Schema").String;
59
- }>>>>;
60
- }>> | Type.relation<import("effect/Schema").Struct<{
61
- id: import("@dxos/keys").ObjectIdClass;
62
- role: import("effect/Schema").optional<typeof import("effect/Schema").String>;
63
- active: import("effect/Schema").optional<typeof import("effect/Schema").Boolean>;
64
- startDate: import("effect/Schema").optional<typeof import("effect/Schema").String>;
65
- endDate: import("effect/Schema").optional<typeof import("effect/Schema").String>;
66
- }>, Type.obj<import("effect/Schema").Struct<{
67
- fullName: import("effect/Schema").optional<import("effect/Schema").SchemaClass<string, string, never>>;
68
- preferredName: import("effect/Schema").optional<import("effect/Schema").SchemaClass<string, string, never>>;
69
- nickname: import("effect/Schema").optional<import("effect/Schema").SchemaClass<string, string, never>>;
70
- image: import("effect/Schema").optional<import("effect/Schema").SchemaClass<string, string, never>>;
71
- organization: import("effect/Schema").optional<import("effect/Schema").Schema<import("@dxos/echo-schema").Ref<import("@dxos/echo/Type").OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
72
- id: string;
73
- name?: string | undefined;
74
- description?: string | undefined;
75
- status?: "prospect" | "qualified" | "active" | "commit" | "reject" | undefined;
76
- image?: string | undefined;
77
- website?: string | undefined;
78
- }>, import("@dxos/echo-protocol").EncodedReference, never>>;
79
- jobTitle: import("effect/Schema").optional<import("effect/Schema").SchemaClass<string, string, never>>;
80
- department: import("effect/Schema").optional<import("effect/Schema").SchemaClass<string, string, never>>;
81
- notes: import("effect/Schema").optional<import("effect/Schema").SchemaClass<string, string, never>>;
82
- emails: import("effect/Schema").optional<import("effect/Schema").mutable<import("effect/Schema").Array$<import("effect/Schema").Struct<{
83
- label: import("effect/Schema").optional<typeof import("effect/Schema").String>;
84
- value: import("effect/Schema").refine<string, typeof import("effect/Schema").String>;
85
- }>>>>;
86
- identities: import("effect/Schema").optional<import("effect/Schema").mutable<import("effect/Schema").Array$<import("effect/Schema").Struct<{
87
- label: import("effect/Schema").optional<typeof import("effect/Schema").String>;
88
- value: typeof import("effect/Schema").String;
89
- }>>>>;
90
- phoneNumbers: import("effect/Schema").optional<import("effect/Schema").mutable<import("effect/Schema").Array$<import("effect/Schema").Struct<{
91
- label: import("effect/Schema").optional<typeof import("effect/Schema").String>;
92
- value: typeof import("effect/Schema").String;
93
- }>>>>;
94
- addresses: import("effect/Schema").optional<import("effect/Schema").mutable<import("effect/Schema").Array$<import("effect/Schema").Struct<{
95
- label: import("effect/Schema").optional<typeof import("effect/Schema").String>;
96
- value: import("effect/Schema").Struct<{
97
- street: import("effect/Schema").optional<import("effect/Schema").SchemaClass<string, string, never>>;
98
- extended: import("effect/Schema").optional<import("effect/Schema").SchemaClass<string, string, never>>;
99
- locality: import("effect/Schema").optional<import("effect/Schema").SchemaClass<string, string, never>>;
100
- region: import("effect/Schema").optional<import("effect/Schema").SchemaClass<string, string, never>>;
101
- postalCode: import("effect/Schema").optional<import("effect/Schema").SchemaClass<string, string, never>>;
102
- postOfficeBoxNumber: import("effect/Schema").optional<import("effect/Schema").SchemaClass<string, string, never>>;
103
- country: import("effect/Schema").optional<import("effect/Schema").SchemaClass<string, string, never>>;
104
- }>;
105
- }>>>>;
106
- urls: import("effect/Schema").optional<import("effect/Schema").mutable<import("effect/Schema").Array$<import("effect/Schema").Struct<{
107
- label: import("effect/Schema").optional<typeof import("effect/Schema").String>;
108
- value: import("effect/Schema").refine<string, typeof import("effect/Schema").String>;
109
- }>>>>;
110
- birthday: import("effect/Schema").optional<import("effect/Schema").SchemaClass<string, string, never>>;
111
- fields: import("effect/Schema").optional<import("effect/Schema").mutable<import("effect/Schema").Array$<import("effect/Schema").Struct<{
112
- category: import("effect/Schema").optional<typeof import("effect/Schema").String>;
113
- label: typeof import("effect/Schema").String;
114
- value: typeof import("effect/Schema").String;
115
- }>>>>;
116
- }>>, Type.obj<import("effect/Schema").Struct<{
117
- id: import("@dxos/keys").ObjectIdClass;
118
- name: import("effect/Schema").optional<import("effect/Schema").SchemaClass<string, string, never>>;
119
- description: import("effect/Schema").optional<import("effect/Schema").SchemaClass<string, string, never>>;
120
- status: import("effect/Schema").optional<import("effect/Schema").Literal<["prospect", "qualified", "active", "commit", "reject"]>>;
121
- image: import("effect/Schema").optional<import("effect/Schema").SchemaClass<string, string, never>>;
122
- website: import("effect/Schema").optional<import("effect/Schema").SchemaClass<string, string, never>>;
123
- }>>> | Type.relation<import("effect/Schema").Struct<{
124
- id: import("@dxos/keys").ObjectIdClass;
125
- kind: import("effect/Schema").SchemaClass<string, string, never>;
126
- }>, Type.obj<import("effect/Schema").Struct<{
127
- id: import("@dxos/keys").ObjectIdClass;
128
- name: import("effect/Schema").optional<import("effect/Schema").SchemaClass<string, string, never>>;
129
- description: import("effect/Schema").optional<import("effect/Schema").SchemaClass<string, string, never>>;
130
- status: import("effect/Schema").optional<import("effect/Schema").Literal<["prospect", "qualified", "active", "commit", "reject"]>>;
131
- image: import("effect/Schema").optional<import("effect/Schema").SchemaClass<string, string, never>>;
132
- website: import("effect/Schema").optional<import("effect/Schema").SchemaClass<string, string, never>>;
133
- }>>, Type.obj<import("effect/Schema").Struct<{
134
- id: import("@dxos/keys").ObjectIdClass;
135
- name: import("effect/Schema").optional<import("effect/Schema").SchemaClass<string, string, never>>;
136
- description: import("effect/Schema").optional<import("effect/Schema").SchemaClass<string, string, never>>;
137
- status: import("effect/Schema").optional<import("effect/Schema").Literal<["prospect", "qualified", "active", "commit", "reject"]>>;
138
- image: import("effect/Schema").optional<import("effect/Schema").SchemaClass<string, string, never>>;
139
- website: import("effect/Schema").optional<import("effect/Schema").SchemaClass<string, string, never>>;
140
- }>>>)[];
141
- export declare const addTestData: (space: Space) => Promise<void>;
142
- //# sourceMappingURL=data.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../../src/stories/testing/data.ts"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAiB,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AAItD,eAAO,MAAM,SAAS;;;;;;;;;;;;;;YAyH261B,CAAC;mBAA6C,CAAC;cAAwC,CAAC;aAA0F,CAAC;eAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAA+wV,CAAC;mBAA6C,CAAC;cAAwC,CAAC;aAA0F,CAAC;eAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAzH9hsC,CAAC;AAwF7G,eAAO,MAAM,WAAW,GAAU,OAAO,KAAK,KAAG,OAAO,CAAC,IAAI,CAgC5D,CAAC"}
@@ -1,3 +0,0 @@
1
- export * from './data';
2
- export * from './testing';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/stories/testing/index.ts"],"names":[],"mappings":"AAIA,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC"}
@@ -1,26 +0,0 @@
1
- import { type Plugin } from '@dxos/app-framework';
2
- import { AiContextBinder } from '@dxos/assistant';
3
- import { type Space } from '@dxos/client/echo';
4
- import { type ClientPluginOptions } from '@dxos/plugin-client/types';
5
- import { Config } from '@dxos/react-client';
6
- import { type DataType } from '@dxos/schema';
7
- import { Assistant } from '../../types';
8
- export declare const config: {
9
- remote: Config;
10
- persistent: Config;
11
- };
12
- type DecoratorsProps = Omit<ClientPluginOptions, 'onClientInitialized' | 'onSpacesReady'> & {
13
- plugins?: Plugin[];
14
- accessTokens?: DataType.AccessToken[];
15
- onInit?: (props: {
16
- space: Space;
17
- chat: Assistant.Chat;
18
- binder: AiContextBinder;
19
- }) => Promise<void>;
20
- };
21
- /**
22
- * Create storybook decorators.
23
- */
24
- export declare const getDecorators: ({ types, plugins, accessTokens, onInit, ...props }: DecoratorsProps) => import("@storybook/react").Decorator[];
25
- export {};
26
- //# sourceMappingURL=testing.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../../../../../src/stories/testing/testing.tsx"],"names":[],"mappings":"AAIA,OAAO,EAIL,KAAK,MAAM,EAKZ,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAalD,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAK/C,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAIrE,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,cAAc,CAAC;AAI7C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC,eAAO,MAAM,MAAM;;;CA+BlB,CAAC;AAEF,KAAK,eAAe,GAAG,IAAI,CAAC,mBAAmB,EAAE,qBAAqB,GAAG,eAAe,CAAC,GAAG;IAC1F,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,YAAY,CAAC,EAAE,QAAQ,CAAC,WAAW,EAAE,CAAC;IACtC,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,KAAK,EAAE,KAAK,CAAC;QAAC,IAAI,EAAE,SAAS,CAAC,IAAI,CAAC;QAAC,MAAM,EAAE,eAAe,CAAA;KAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACpG,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,GAAI,oDAAmE,eAAe,2CA0E/G,CAAC"}
@@ -1,6 +0,0 @@
1
- import { type AiChatProcessorOptions } from '../hooks';
2
- /**
3
- * @deprecated
4
- */
5
- export declare const createProcessorOptions: () => Pick<AiChatProcessorOptions, "model" | "system">;
6
- //# sourceMappingURL=test-functions.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"test-functions.d.ts","sourceRoot":"","sources":["../../../../src/testing/test-functions.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAEvD;;GAEG;AACH,eAAO,MAAM,sBAAsB,QAAO,IAAI,CAAC,sBAAsB,EAAE,OAAO,GAAG,QAAQ,CAGvF,CAAC"}
@@ -1,5 +0,0 @@
1
- import { type ExecutableTool } from '@dxos/ai';
2
- import { type FunctionType } from '@dxos/functions';
3
- import { type SpaceId } from '@dxos/react-client/echo';
4
- export declare const convertFunctionToTool: (fn: FunctionType, edgeUrl: string, spaceId?: SpaceId | undefined) => ExecutableTool | undefined;
5
- //# sourceMappingURL=function.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"function.d.ts","sourceRoot":"","sources":["../../../../src/tools/function.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,cAAc,EAA0B,MAAM,UAAU,CAAC;AAGvE,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAIvD,eAAO,MAAM,qBAAqB,GAChC,IAAI,YAAY,EAChB,SAAS,MAAM,EACf,UAAU,OAAO,GAAG,SAAS,KAC5B,cAAc,GAAG,SA6BnB,CAAC"}
@@ -1,3 +0,0 @@
1
- export * from './function';
2
- export * from './openapi';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/tools/index.ts"],"names":[],"mappings":"AAIA,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC"}
@@ -1,10 +0,0 @@
1
- import { type ExecutableTool } from '@dxos/ai';
2
- import type { ApiAuthorization, ServiceType } from '../types';
3
- export type CreateToolsFromApiOptions = {
4
- authorization?: ApiAuthorization;
5
- instructions?: string;
6
- };
7
- export declare const createToolsFromService: (service: ServiceType) => Promise<ExecutableTool[]>;
8
- export declare const createToolsFromApi: (url: string, options?: CreateToolsFromApiOptions) => Promise<ExecutableTool[]>;
9
- export declare const resolveAuthorization: (authorization: ApiAuthorization) => Promise<string>;
10
- //# sourceMappingURL=openapi.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"openapi.d.ts","sourceRoot":"","sources":["../../../../src/tools/openapi.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,KAAK,cAAc,EAA6B,MAAM,UAAU,CAAC;AAO1E,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE9D,MAAM,MAAM,yBAAyB,GAAG;IACtC,aAAa,CAAC,EAAE,gBAAgB,CAAC;IACjC,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAAU,SAAS,WAAW,KAAG,OAAO,CAAC,cAAc,EAAE,CAM3F,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAC7B,KAAK,MAAM,EACX,UAAU,yBAAyB,KAClC,OAAO,CAAC,cAAc,EAAE,CAuF1B,CAAC;AA2KF,eAAO,MAAM,oBAAoB,GAAU,eAAe,gBAAgB,KAAG,OAAO,CAAC,MAAM,CAqB1F,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=openapi.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"openapi.test.d.ts","sourceRoot":"","sources":["../../../../src/tools/openapi.test.ts"],"names":[],"mappings":""}
@@ -1,282 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import React, { type FC, Fragment, type PropsWithChildren } from 'react';
6
-
7
- import { type Tool } from '@dxos/ai';
8
- import { ErrorBoundary, Surface } from '@dxos/app-framework';
9
- import { Obj } from '@dxos/echo';
10
- import { invariant } from '@dxos/invariant';
11
- import { DXN, DXN_ECHO_REGEXP } from '@dxos/keys';
12
- import { type Space } from '@dxos/react-client/echo';
13
- import { Button, IconButton, type ThemedClassName, useTranslation } from '@dxos/react-ui';
14
- import {
15
- MarkdownViewer,
16
- ToggleContainer as NativeToggleContainer,
17
- type ToggleContainerProps,
18
- } from '@dxos/react-ui-components';
19
- import { mx } from '@dxos/react-ui-theme';
20
- import { type ContentBlock, type DataType } from '@dxos/schema';
21
- import { safeParseJson } from '@dxos/util';
22
-
23
- import { meta } from '../../meta';
24
- import { type ChatEvent } from '../Chat';
25
- import { Toolbox } from '../Toolbox';
26
-
27
- import { ObjectLink } from './Link';
28
- import { Json, ToolBlock, isToolMessage } from './ToolBlock';
29
-
30
- const panelClasses = 'flex flex-col is-full bg-activeSurface rounded-sm';
31
- const marginClasses = 'pie-4 pis-4';
32
- const paddingClasses = 'pis-2 pie-2 pbs-0.5 pbe-0.5';
33
-
34
- export type ChatMessageProps = ThemedClassName<{
35
- debug?: boolean;
36
- space?: Space;
37
- message: DataType.Message;
38
- tools?: Tool[];
39
- onEvent?: (event: ChatEvent) => void;
40
- onDelete?: () => void;
41
- }>;
42
-
43
- export const ChatMessage = ({ classNames, debug, space, message, tools, onEvent, onDelete }: ChatMessageProps) => {
44
- const { t } = useTranslation(meta.id);
45
- const {
46
- sender: { role },
47
- blocks,
48
- } = message;
49
-
50
- // TODO(burdon): Consolidate tools upstream?
51
- if (isToolMessage(message)) {
52
- return (
53
- <MessageItem classNames={mx(classNames, 'animate-[fadeIn_0.5s]')}>
54
- <ToolBlock classNames={panelClasses} message={message} tools={tools} />
55
- </MessageItem>
56
- );
57
- }
58
-
59
- return (
60
- <>
61
- {debug && (
62
- <div className={mx('flex justify-end text-subdued', marginClasses)}>
63
- <pre className='text-xs'>{JSON.stringify({ created: message.created })}</pre>
64
- </div>
65
- )}
66
-
67
- {blocks.map((block, idx) => {
68
- // TODO(burdon): Filter empty messages.
69
- if (block._tag === 'text' && block.text.replaceAll(/\s+/g, '').length === 0) {
70
- return null;
71
- }
72
-
73
- const Component: ContentBlockComponent = components[block._tag] ?? components.default!;
74
- if (!Component) {
75
- return null;
76
- }
77
-
78
- return (
79
- <Fragment key={idx}>
80
- <MessageItem classNames={classNames} user={block._tag === 'text' && role === 'user'}>
81
- <ErrorBoundary data={block}>
82
- <Component space={space} block={block} onEvent={onEvent} />
83
- </ErrorBoundary>
84
- </MessageItem>
85
- {debug && (
86
- <div className={mx('flex justify-end text-subdued', marginClasses)}>
87
- <pre className='text-xs'>{JSON.stringify({ block: block._tag })}</pre>
88
- </div>
89
- )}
90
- </Fragment>
91
- );
92
- })}
93
-
94
- {onDelete && (
95
- <div className={mx('flex justify-end pbs-2 pbe-2 opacity-50 hover:opacity-100', marginClasses)}>
96
- <IconButton
97
- classNames='animate-[fadeIn_0.5s]'
98
- icon='ph--trash--regular'
99
- iconOnly
100
- label={t('button delete message')}
101
- onClick={() => onDelete()}
102
- />
103
- </div>
104
- )}
105
- </>
106
- );
107
- };
108
-
109
- type ContentBlockProps = {
110
- space?: Space;
111
- block: ContentBlock.Any;
112
- onEvent?: (event: ChatEvent) => void;
113
- };
114
-
115
- type ContentBlockComponent = FC<ContentBlockProps>;
116
-
117
- /**
118
- * Components for rendering content blocks.
119
- */
120
- const components: Partial<Record<ContentBlock.Any['_tag'] | 'default', ContentBlockComponent>> = {
121
- //
122
- // Text
123
- //
124
- ['text' as const]: ({ space, block }) => {
125
- invariant(block._tag === 'text');
126
- return (
127
- <MarkdownViewer
128
- content={preprocessTextContent(block.text)}
129
- components={{
130
- a: ({ node: { properties }, children, href, ...props }) => {
131
- if (space && typeof properties?.href === 'string' && properties?.href?.startsWith('dxn')) {
132
- try {
133
- // TODO(burdon): Check valid length (since serialized).
134
- const dxn = DXN.parse(properties.href);
135
- return <ObjectLink space={space} dxn={dxn} />;
136
- } catch {}
137
- }
138
-
139
- // TODO(burdon): Can we revert to the default handler?
140
- return (
141
- <a
142
- href={href}
143
- className='text-primary-500 hover:text-primary-500' // TODO(burdon): Token.
144
- target='_blank'
145
- rel='noopener noreferrer'
146
- {...props}
147
- >
148
- {children}
149
- </a>
150
- );
151
- },
152
- }}
153
- />
154
- );
155
- },
156
-
157
- //
158
- // Suggest
159
- //
160
- ['suggest' as const]: ({ block, onEvent }) => {
161
- const { t } = useTranslation(meta.id);
162
- invariant(block._tag === 'suggest');
163
- return (
164
- <IconButton
165
- icon='ph--lightning--regular'
166
- label={block.text}
167
- title={t('button suggest')}
168
- onClick={() => onEvent?.({ type: 'submit', text: block.text })}
169
- />
170
- );
171
- },
172
-
173
- //
174
- // Select
175
- //
176
- ['select' as const]: ({ block, onEvent }) => {
177
- const { t } = useTranslation(meta.id);
178
- invariant(block._tag === 'select');
179
- return (
180
- <div className='flex flex-wrap gap-1'>
181
- {block.options.map((option, idx) => (
182
- <Button
183
- classNames={'animate-[fadeIn_0.5s] rounded-sm text-sm'}
184
- key={idx}
185
- onClick={() => onEvent?.({ type: 'submit', text: option })}
186
- title={t('button select option')}
187
- >
188
- {option}
189
- </Button>
190
- ))}
191
- </div>
192
- );
193
- },
194
-
195
- //
196
- // Toolkit
197
- //
198
- ['toolkit' as const]: ({ block }) => {
199
- invariant(block._tag === 'toolkit');
200
- return (
201
- <ToggleContainer title='Toolbox' classNames={panelClasses} defaultOpen>
202
- <Toolbox classNames={marginClasses} />
203
- </ToggleContainer>
204
- );
205
- },
206
-
207
- //
208
- // JSON
209
- //
210
- ['json' as const]: ({ block, onEvent }) => {
211
- invariant(block._tag === 'json');
212
-
213
- // TODO(burdon): Disposition is deprecated.
214
- switch (block.disposition) {
215
- case 'graph': {
216
- return (
217
- <div className='flex flex-wrap gap-1'>
218
- <Surface
219
- role='card'
220
- data={{ subject: JSON.parse(block.data ?? '{}') }}
221
- limit={1}
222
- fallback={<div className='font-mono text-xs text-pre'>{block.data}</div>}
223
- />
224
- {onEvent && (
225
- <IconButton
226
- icon='ph--plus--regular'
227
- label='Add to graph'
228
- onClick={() => onEvent?.({ type: 'add', object: JSON.parse(block.data ?? '{}') })}
229
- />
230
- )}
231
- </div>
232
- );
233
- }
234
-
235
- default: {
236
- return (
237
- <ToggleContainer title={block.disposition ?? block._tag}>
238
- <Json data={safeParseJson(block.data ?? block)} />
239
- </ToggleContainer>
240
- );
241
- }
242
- }
243
- },
244
-
245
- //
246
- // Fallback
247
- //
248
- default: ({ block }) => {
249
- return (
250
- <ToggleContainer title={block._tag}>
251
- <Json data={block} />
252
- </ToggleContainer>
253
- );
254
- },
255
- };
256
-
257
- /**
258
- * Wrapper for each message.
259
- */
260
- const MessageItem = ({ classNames, children, user }: ThemedClassName<PropsWithChildren<{ user?: boolean }>>) => {
261
- if (!children) {
262
- return null;
263
- }
264
-
265
- return (
266
- <div role='list-item' className={mx('flex is-full', user && 'justify-end', marginClasses, classNames)}>
267
- <div className={mx(user ? ['rounded-sm', 'bg-[--user-fill] text-accentSurfaceText', paddingClasses] : 'is-full')}>
268
- {children}
269
- </div>
270
- </div>
271
- );
272
- };
273
-
274
- const ToggleContainer = (props: ToggleContainerProps) => {
275
- return <NativeToggleContainer {...props} classNames={mx(panelClasses, props.classNames)} />;
276
- };
277
-
278
- export const renderObjectLink = (obj: Obj.Any) => `[${Obj.getLabel(obj)}](${Obj.getDXN(obj).toString()})`;
279
-
280
- // TODO(burdon): Move to parser.
281
- const preprocessTextContent = (content: string) =>
282
- content.replaceAll(new RegExp(DXN_ECHO_REGEXP, 'g'), (_, dxn) => `<${dxn}>`);
@@ -1,125 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import React, { type FC, useEffect, useMemo, useRef, useState } from 'react';
6
-
7
- import { type AgentStatus, type Tool } from '@dxos/ai';
8
- import { type ThemedClassName, useTranslation } from '@dxos/react-ui';
9
- import { NumericTabs, StatusRoll, ToggleContainer } from '@dxos/react-ui-components';
10
- import { type JsonProps, Json as NativeJson } from '@dxos/react-ui-syntax-highlighter';
11
- import { type DataType } from '@dxos/schema';
12
- import { isNonNullable, isNotFalsy } from '@dxos/util';
13
-
14
- import { meta } from '../../meta';
15
-
16
- export const isToolMessage = (message: DataType.Message) => {
17
- return message.blocks.some((block) => block._tag === 'toolCall' || block._tag === 'toolResult');
18
- };
19
-
20
- const getToolName = (tool: Tool) => {
21
- return tool.namespace && tool.function ? `${tool.namespace}:${tool.function}` : tool.name.split('_').pop();
22
- };
23
-
24
- export type ToolBlockProps = ThemedClassName<{
25
- message: DataType.Message;
26
- tools?: Tool[];
27
- }>;
28
-
29
- export const ToolBlock: FC<ToolBlockProps> = ({ classNames, message, tools }) => {
30
- const { t } = useTranslation(meta.id);
31
- const { blocks = [] } = message;
32
-
33
- const getToolCaption = (tool?: Tool, status?: AgentStatus) => {
34
- if (!tool) {
35
- return t('calling tool label');
36
- }
37
-
38
- return status?.message ?? tool.caption ?? [t('calling label') + getToolName(tool)].join(' ');
39
- };
40
-
41
- let request: { tool: Tool | undefined; block: any } | undefined;
42
- const toolBlocks = blocks.filter((block) => block._tag === 'toolCall' || block._tag === 'toolResult');
43
- const items = toolBlocks
44
- .map((block) => {
45
- switch (block._tag) {
46
- case 'toolCall': {
47
- // TODO(burdon): Skip these updates?
48
- if (block.pending && request?.block.toolCallId === block.toolCallId) {
49
- return null;
50
- }
51
-
52
- request = { tool: tools?.find((tool) => tool.name === block.name), block };
53
- return {
54
- title: getToolCaption(request.tool, request.block.status),
55
- block,
56
- };
57
- }
58
-
59
- case 'toolResult': {
60
- if (!request || block.error) {
61
- return {
62
- title: t('error label'),
63
- block,
64
- };
65
- }
66
-
67
- return {
68
- title: getToolCaption(request.tool, request.block.status),
69
- block,
70
- };
71
- }
72
-
73
- default: {
74
- request = undefined;
75
- return {
76
- title: t('error label'),
77
- block,
78
- };
79
- }
80
- }
81
- })
82
- .filter(isNonNullable);
83
-
84
- return <ToolContainer classNames={classNames} items={items} />;
85
- };
86
-
87
- export const ToolContainer: FC<ThemedClassName<{ items: { title: string; block: any }[] }>> = ({
88
- classNames,
89
- items,
90
- }) => {
91
- const tabsRef = useRef<HTMLDivElement>(null);
92
- const [selected, setSelected] = useState(0);
93
- const [open, setOpen] = useState(false);
94
- useEffect(() => {
95
- if (open) {
96
- tabsRef.current?.focus();
97
- }
98
- }, [open]);
99
-
100
- const handleSelect = (index: number) => {
101
- if (index === selected) {
102
- setOpen(false);
103
- } else {
104
- setSelected(index);
105
- }
106
- };
107
-
108
- const title = useMemo(() => {
109
- const lines = items.map((item) => item.title).filter(isNotFalsy);
110
- return <StatusRoll key='status-roll' lines={lines} duration={1_000} autoAdvance />;
111
- }, [items]);
112
-
113
- return (
114
- <ToggleContainer classNames={['flex flex-col', classNames]} title={title} open={open} onChangeOpen={setOpen}>
115
- <div className='w-full grid grid-cols-[32px_1fr]'>
116
- <NumericTabs ref={tabsRef} length={items.length} selected={selected} onSelect={handleSelect} />
117
- <Json data={items[selected].block} />
118
- </div>
119
- </ToggleContainer>
120
- );
121
- };
122
-
123
- export const Json = ({ data }: Pick<JsonProps, 'data'>) => (
124
- <NativeJson data={data} classNames='!p-1 text-xs bg-transparent' />
125
- );