@dxos/plugin-script 0.8.4-main.66e292d → 0.8.4-main.69d29f4

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 (372) hide show
  1. package/dist/lib/browser/DeploymentDialog-OSL6RMPA.mjs +14 -0
  2. package/dist/lib/browser/{NotebookContainer-MHY3DXDE.mjs → NotebookContainer-NBAXYESH.mjs} +266 -238
  3. package/dist/lib/browser/NotebookContainer-NBAXYESH.mjs.map +7 -0
  4. package/dist/lib/browser/ScriptContainer-WD33CJMI.mjs +149 -0
  5. package/dist/lib/browser/ScriptContainer-WD33CJMI.mjs.map +7 -0
  6. package/dist/lib/browser/app-graph-builder-7VO7AUI6.mjs +68 -0
  7. package/dist/lib/browser/app-graph-builder-7VO7AUI6.mjs.map +7 -0
  8. package/dist/lib/browser/blueprint-definition-OSOUYI7A.mjs +17 -0
  9. package/dist/lib/browser/blueprint-definition-OSOUYI7A.mjs.map +7 -0
  10. package/dist/lib/browser/blueprints/index.mjs +8 -0
  11. package/dist/lib/browser/chunk-BTWHM6FH.mjs +270 -0
  12. package/dist/lib/browser/chunk-BTWHM6FH.mjs.map +7 -0
  13. package/dist/lib/browser/{chunk-ULJFT73Q.mjs → chunk-C53UJGSU.mjs} +232 -188
  14. package/dist/lib/browser/chunk-C53UJGSU.mjs.map +7 -0
  15. package/dist/lib/browser/chunk-F3QKSKSF.mjs +35 -0
  16. package/dist/lib/browser/chunk-F3QKSKSF.mjs.map +7 -0
  17. package/dist/lib/browser/chunk-I7CSE6T3.mjs +110 -0
  18. package/dist/lib/browser/chunk-I7CSE6T3.mjs.map +7 -0
  19. package/dist/lib/browser/chunk-TWX2NMZN.mjs +137 -0
  20. package/dist/lib/browser/chunk-TWX2NMZN.mjs.map +7 -0
  21. package/dist/lib/browser/chunk-UUR4JNNB.mjs +113 -0
  22. package/dist/lib/browser/chunk-UUR4JNNB.mjs.map +7 -0
  23. package/dist/lib/browser/{chunk-2G2NA6DQ.mjs → chunk-UX4GHJ5E.mjs} +28 -11
  24. package/dist/lib/browser/chunk-UX4GHJ5E.mjs.map +7 -0
  25. package/dist/lib/browser/{chunk-EB6AXFXO.mjs → chunk-WYR4QHPE.mjs} +1 -1
  26. package/dist/lib/browser/chunk-WYR4QHPE.mjs.map +7 -0
  27. package/dist/lib/browser/chunk-XCN4D3Z5.mjs +606 -0
  28. package/dist/lib/browser/chunk-XCN4D3Z5.mjs.map +7 -0
  29. package/dist/lib/browser/compiler-76F3QAXC.mjs +161 -0
  30. package/dist/lib/browser/compiler-76F3QAXC.mjs.map +7 -0
  31. package/dist/lib/browser/index.mjs +92 -116
  32. package/dist/lib/browser/index.mjs.map +4 -4
  33. package/dist/lib/browser/meta.json +1 -1
  34. package/dist/lib/browser/operation-resolver-HUILPPKT.mjs +82 -0
  35. package/dist/lib/browser/operation-resolver-HUILPPKT.mjs.map +7 -0
  36. package/dist/lib/browser/{react-surface-R245YN52.mjs → react-surface-O6GKHB2J.mjs} +53 -42
  37. package/dist/lib/browser/react-surface-O6GKHB2J.mjs.map +7 -0
  38. package/dist/lib/browser/settings-3ENI25PI.mjs +35 -0
  39. package/dist/lib/browser/settings-3ENI25PI.mjs.map +7 -0
  40. package/dist/lib/browser/templates/index.mjs +1 -1
  41. package/dist/lib/browser/types/index.mjs +9 -5
  42. package/dist/lib/node-esm/{DeploymentDialog-2ULNOZQH.mjs → DeploymentDialog-OGBJPVIX.mjs} +6 -6
  43. package/dist/lib/node-esm/DeploymentDialog-OGBJPVIX.mjs.map +7 -0
  44. package/dist/lib/node-esm/{NotebookContainer-U4C2HQ4T.mjs → NotebookContainer-IUAYVJSD.mjs} +266 -238
  45. package/dist/lib/node-esm/NotebookContainer-IUAYVJSD.mjs.map +7 -0
  46. package/dist/lib/node-esm/ScriptContainer-K7JCEU5Z.mjs +150 -0
  47. package/dist/lib/node-esm/ScriptContainer-K7JCEU5Z.mjs.map +7 -0
  48. package/dist/lib/node-esm/app-graph-builder-NVE3EVBG.mjs +69 -0
  49. package/dist/lib/node-esm/app-graph-builder-NVE3EVBG.mjs.map +7 -0
  50. package/dist/lib/node-esm/blueprint-definition-NC7NNJGI.mjs +18 -0
  51. package/dist/lib/node-esm/blueprint-definition-NC7NNJGI.mjs.map +7 -0
  52. package/dist/lib/node-esm/blueprints/index.mjs +9 -0
  53. package/dist/lib/node-esm/blueprints/index.mjs.map +7 -0
  54. package/dist/lib/node-esm/{chunk-57JA6XL5.mjs → chunk-4F5FJZ36.mjs} +28 -11
  55. package/dist/lib/node-esm/chunk-4F5FJZ36.mjs.map +7 -0
  56. package/dist/lib/node-esm/chunk-4QNZMXW6.mjs +607 -0
  57. package/dist/lib/node-esm/chunk-4QNZMXW6.mjs.map +7 -0
  58. package/dist/lib/node-esm/{chunk-IBV2DR36.mjs → chunk-5HSJPAK7.mjs} +1 -1
  59. package/dist/lib/node-esm/chunk-5HSJPAK7.mjs.map +7 -0
  60. package/dist/lib/node-esm/{chunk-VJSRZRLI.mjs → chunk-BX5PP6AW.mjs} +232 -188
  61. package/dist/lib/node-esm/chunk-BX5PP6AW.mjs.map +7 -0
  62. package/dist/lib/node-esm/chunk-G3J76DWP.mjs +114 -0
  63. package/dist/lib/node-esm/chunk-G3J76DWP.mjs.map +7 -0
  64. package/dist/lib/node-esm/chunk-SLU3KRV3.mjs +112 -0
  65. package/dist/lib/node-esm/chunk-SLU3KRV3.mjs.map +7 -0
  66. package/dist/lib/node-esm/chunk-VQPIA4VF.mjs +138 -0
  67. package/dist/lib/node-esm/chunk-VQPIA4VF.mjs.map +7 -0
  68. package/dist/lib/node-esm/chunk-VWOLKNMO.mjs +271 -0
  69. package/dist/lib/node-esm/chunk-VWOLKNMO.mjs.map +7 -0
  70. package/dist/lib/node-esm/chunk-Y3G5NCTP.mjs +36 -0
  71. package/dist/lib/node-esm/chunk-Y3G5NCTP.mjs.map +7 -0
  72. package/dist/lib/node-esm/compiler-FNZH6TFN.mjs +162 -0
  73. package/dist/lib/node-esm/compiler-FNZH6TFN.mjs.map +7 -0
  74. package/dist/lib/node-esm/index.mjs +92 -116
  75. package/dist/lib/node-esm/index.mjs.map +4 -4
  76. package/dist/lib/node-esm/meta.json +1 -1
  77. package/dist/lib/node-esm/operation-resolver-JTCIY6HU.mjs +83 -0
  78. package/dist/lib/node-esm/operation-resolver-JTCIY6HU.mjs.map +7 -0
  79. package/dist/lib/node-esm/{react-surface-MHT3PJ6C.mjs → react-surface-RLANMVMB.mjs} +53 -42
  80. package/dist/lib/node-esm/react-surface-RLANMVMB.mjs.map +7 -0
  81. package/dist/lib/node-esm/settings-7AYC5VXN.mjs +36 -0
  82. package/dist/lib/node-esm/settings-7AYC5VXN.mjs.map +7 -0
  83. package/dist/lib/node-esm/templates/index.mjs +1 -1
  84. package/dist/lib/node-esm/types/index.mjs +9 -5
  85. package/dist/types/src/ScriptPlugin.d.ts +2 -1
  86. package/dist/types/src/ScriptPlugin.d.ts.map +1 -1
  87. package/dist/types/src/blueprints/index.d.ts +2 -0
  88. package/dist/types/src/blueprints/index.d.ts.map +1 -0
  89. package/dist/types/src/blueprints/script-blueprint.d.ts +22 -0
  90. package/dist/types/src/blueprints/script-blueprint.d.ts.map +1 -0
  91. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +6 -0
  92. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -0
  93. package/dist/types/src/capabilities/app-graph-builder/index.d.ts +3 -0
  94. package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +1 -0
  95. package/dist/types/src/capabilities/artifact-definition/artifact-definition.d.ts +12 -0
  96. package/dist/types/src/capabilities/artifact-definition/artifact-definition.d.ts.map +1 -0
  97. package/dist/types/src/capabilities/artifact-definition/index.d.ts +3 -0
  98. package/dist/types/src/capabilities/artifact-definition/index.d.ts.map +1 -0
  99. package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts +9 -0
  100. package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts.map +1 -0
  101. package/dist/types/src/capabilities/blueprint-definition/index.d.ts +3 -0
  102. package/dist/types/src/capabilities/blueprint-definition/index.d.ts.map +1 -0
  103. package/dist/types/src/capabilities/compiler/compiler.d.ts +6 -0
  104. package/dist/types/src/capabilities/compiler/compiler.d.ts.map +1 -0
  105. package/dist/types/src/capabilities/compiler/index.d.ts +3 -0
  106. package/dist/types/src/capabilities/compiler/index.d.ts.map +1 -0
  107. package/dist/types/src/capabilities/index.d.ts +6 -7
  108. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  109. package/dist/types/src/capabilities/operation-resolver/index.d.ts +3 -0
  110. package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +1 -0
  111. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +5 -0
  112. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -0
  113. package/dist/types/src/capabilities/react-surface/index.d.ts +3 -0
  114. package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
  115. package/dist/types/src/capabilities/react-surface/react-surface.d.ts +5 -0
  116. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
  117. package/dist/types/src/capabilities/settings/index.d.ts +7 -0
  118. package/dist/types/src/capabilities/settings/index.d.ts.map +1 -0
  119. package/dist/types/src/capabilities/settings/settings.d.ts +9 -0
  120. package/dist/types/src/capabilities/settings/settings.d.ts.map +1 -0
  121. package/dist/types/src/compiler/compiler.d.ts +1 -1
  122. package/dist/types/src/compiler/compiler.d.ts.map +1 -1
  123. package/dist/types/src/components/DeploymentDialog/DeploymentDialog.d.ts.map +1 -1
  124. package/dist/types/src/components/DeploymentDialog/DeploymentDialog.stories.d.ts +1 -3
  125. package/dist/types/src/components/DeploymentDialog/DeploymentDialog.stories.d.ts.map +1 -1
  126. package/dist/types/src/components/FrameContainer/FrameContainer.d.ts.map +1 -1
  127. package/dist/types/src/components/NotebookContainer.d.ts +3 -5
  128. package/dist/types/src/components/NotebookContainer.d.ts.map +1 -1
  129. package/dist/types/src/components/NotebookContainer.stories.d.ts +3 -250
  130. package/dist/types/src/components/NotebookContainer.stories.d.ts.map +1 -1
  131. package/dist/types/src/components/NotebookStack/NotebookCell.d.ts +3 -3
  132. package/dist/types/src/components/NotebookStack/NotebookCell.d.ts.map +1 -1
  133. package/dist/types/src/components/NotebookStack/NotebookStack.d.ts +1 -1
  134. package/dist/types/src/components/NotebookStack/NotebookStack.d.ts.map +1 -1
  135. package/dist/types/src/components/NotebookStack/NotebookStack.stories.d.ts +2 -1
  136. package/dist/types/src/components/NotebookStack/NotebookStack.stories.d.ts.map +1 -1
  137. package/dist/types/src/components/QueryEditor/QueryEditor.d.ts +5 -0
  138. package/dist/types/src/components/QueryEditor/QueryEditor.d.ts.map +1 -0
  139. package/dist/types/src/components/QueryEditor/QueryEditor.stories.d.ts +13 -0
  140. package/dist/types/src/components/QueryEditor/QueryEditor.stories.d.ts.map +1 -0
  141. package/dist/types/src/components/QueryEditor/index.d.ts +2 -0
  142. package/dist/types/src/components/QueryEditor/index.d.ts.map +1 -0
  143. package/dist/types/src/components/ScriptContainer.d.ts +4 -5
  144. package/dist/types/src/components/ScriptContainer.d.ts.map +1 -1
  145. package/dist/types/src/components/ScriptToolbar/ScriptToolbar.d.ts +2 -2
  146. package/dist/types/src/components/ScriptToolbar/ScriptToolbar.d.ts.map +1 -1
  147. package/dist/types/src/components/ScriptToolbar/ScriptToolbar.stories.d.ts +2 -1
  148. package/dist/types/src/components/ScriptToolbar/ScriptToolbar.stories.d.ts.map +1 -1
  149. package/dist/types/src/components/Settings/ScriptObjectSettings.d.ts.map +1 -1
  150. package/dist/types/src/components/Settings/ScriptPluginSettings.d.ts +4 -2
  151. package/dist/types/src/components/Settings/ScriptPluginSettings.d.ts.map +1 -1
  152. package/dist/types/src/components/TestPanel/TestContainer.d.ts +1 -1
  153. package/dist/types/src/components/TestPanel/TestContainer.d.ts.map +1 -1
  154. package/dist/types/src/components/TypescriptEditor/TypescriptEditor.d.ts +3 -2
  155. package/dist/types/src/components/TypescriptEditor/TypescriptEditor.d.ts.map +1 -1
  156. package/dist/types/src/components/TypescriptEditor/TypescriptEditor.stories.d.ts +1 -1
  157. package/dist/types/src/components/TypescriptEditor/TypescriptEditor.stories.d.ts.map +1 -1
  158. package/dist/types/src/components/index.d.ts +2 -2
  159. package/dist/types/src/components/index.d.ts.map +1 -1
  160. package/dist/types/src/e2e/ai.test.d.ts +2 -0
  161. package/dist/types/src/e2e/ai.test.d.ts.map +1 -0
  162. package/dist/types/src/e2e/deploy.test.d.ts +2 -0
  163. package/dist/types/src/e2e/deploy.test.d.ts.map +1 -0
  164. package/dist/types/src/hooks/deploy.d.ts +9 -26
  165. package/dist/types/src/hooks/deploy.d.ts.map +1 -1
  166. package/dist/types/src/hooks/format.d.ts +2 -2
  167. package/dist/types/src/hooks/format.d.ts.map +1 -1
  168. package/dist/types/src/hooks/index.d.ts +1 -0
  169. package/dist/types/src/hooks/index.d.ts.map +1 -1
  170. package/dist/types/src/hooks/template.d.ts +2 -2
  171. package/dist/types/src/hooks/template.d.ts.map +1 -1
  172. package/dist/types/src/hooks/useCompiler.d.ts +7 -0
  173. package/dist/types/src/hooks/useCompiler.d.ts.map +1 -0
  174. package/dist/types/src/hooks/useCreateAndDeployScriptTemplates.d.ts.map +1 -1
  175. package/dist/types/src/hooks/useToolbarState.d.ts +8 -1
  176. package/dist/types/src/hooks/useToolbarState.d.ts.map +1 -1
  177. package/dist/types/src/index.d.ts +1 -1
  178. package/dist/types/src/index.d.ts.map +1 -1
  179. package/dist/types/src/meta.d.ts +2 -2
  180. package/dist/types/src/meta.d.ts.map +1 -1
  181. package/dist/types/src/notebook/compute-graph.d.ts +24 -11
  182. package/dist/types/src/notebook/compute-graph.d.ts.map +1 -1
  183. package/dist/types/src/templates/anthropic.d.ts +8 -0
  184. package/dist/types/src/templates/anthropic.d.ts.map +1 -0
  185. package/dist/types/src/templates/chess-bot.d.ts +16 -0
  186. package/dist/types/src/templates/chess-bot.d.ts.map +1 -0
  187. package/dist/types/src/templates/commentary.d.ts +16 -0
  188. package/dist/types/src/templates/commentary.d.ts.map +1 -0
  189. package/dist/types/src/templates/forex-effect.d.ts +4 -1
  190. package/dist/types/src/templates/forex-effect.d.ts.map +1 -1
  191. package/dist/types/src/templates/forex.d.ts +4 -1
  192. package/dist/types/src/templates/forex.d.ts.map +1 -1
  193. package/dist/types/src/templates/index.d.ts +12 -3
  194. package/dist/types/src/templates/index.d.ts.map +1 -1
  195. package/dist/types/src/templates/ping.d.ts +1 -4
  196. package/dist/types/src/templates/ping.d.ts.map +1 -1
  197. package/dist/types/src/testing/simulator.test.d.ts +2 -0
  198. package/dist/types/src/testing/simulator.test.d.ts.map +1 -0
  199. package/dist/types/src/types/Notebook.d.ts +88 -19
  200. package/dist/types/src/types/Notebook.d.ts.map +1 -1
  201. package/dist/types/src/types/actions.d.ts +30 -44
  202. package/dist/types/src/types/actions.d.ts.map +1 -1
  203. package/dist/types/src/types/capabilities.d.ts +12 -0
  204. package/dist/types/src/types/capabilities.d.ts.map +1 -0
  205. package/dist/types/src/types/events.d.ts +5 -0
  206. package/dist/types/src/types/events.d.ts.map +1 -0
  207. package/dist/types/src/types/index.d.ts +2 -0
  208. package/dist/types/src/types/index.d.ts.map +1 -1
  209. package/dist/types/src/util/deploy.d.ts.map +1 -1
  210. package/dist/types/src/util/functions.d.ts.map +1 -1
  211. package/dist/types/tsconfig.tsbuildinfo +1 -1
  212. package/package.json +113 -88
  213. package/src/ScriptPlugin.tsx +34 -60
  214. package/src/blueprints/index.ts +5 -0
  215. package/src/blueprints/script-blueprint.ts +24 -0
  216. package/src/capabilities/app-graph-builder/app-graph-builder.ts +55 -0
  217. package/src/capabilities/app-graph-builder/index.ts +7 -0
  218. package/src/capabilities/{artifact-definition.ts → artifact-definition/artifact-definition.ts} +97 -94
  219. package/src/capabilities/artifact-definition/index.ts +7 -0
  220. package/src/capabilities/blueprint-definition/blueprint-definition.ts +23 -0
  221. package/src/capabilities/blueprint-definition/index.ts +7 -0
  222. package/src/capabilities/compiler/compiler.ts +103 -0
  223. package/src/capabilities/compiler/index.ts +7 -0
  224. package/src/capabilities/index.ts +6 -10
  225. package/src/capabilities/operation-resolver/index.ts +7 -0
  226. package/src/capabilities/operation-resolver/operation-resolver.ts +74 -0
  227. package/src/capabilities/react-surface/index.ts +7 -0
  228. package/src/capabilities/react-surface/react-surface.tsx +118 -0
  229. package/src/capabilities/settings/index.ts +7 -0
  230. package/src/capabilities/settings/settings.ts +32 -0
  231. package/src/compiler/compiler.ts +10 -3
  232. package/src/components/DeploymentDialog/DeploymentDialog.stories.tsx +27 -23
  233. package/src/components/DeploymentDialog/DeploymentDialog.tsx +22 -42
  234. package/src/components/FrameContainer/FrameContainer.tsx +4 -2
  235. package/src/components/NotebookContainer.stories.tsx +23 -19
  236. package/src/components/NotebookContainer.tsx +51 -40
  237. package/src/components/NotebookStack/NotebookCell.tsx +16 -15
  238. package/src/components/NotebookStack/NotebookStack.stories.tsx +19 -18
  239. package/src/components/NotebookStack/NotebookStack.tsx +4 -4
  240. package/src/components/QueryEditor/QueryEditor.stories.tsx +100 -0
  241. package/src/components/QueryEditor/QueryEditor.tsx +47 -0
  242. package/src/components/QueryEditor/index.ts +5 -0
  243. package/src/components/ScriptContainer.tsx +46 -32
  244. package/src/components/ScriptToolbar/ScriptToolbar.stories.tsx +38 -15
  245. package/src/components/ScriptToolbar/ScriptToolbar.tsx +14 -17
  246. package/src/components/Settings/ScriptObjectSettings.tsx +40 -29
  247. package/src/components/Settings/ScriptPluginSettings.tsx +8 -3
  248. package/src/components/TestPanel/TestContainer.tsx +5 -5
  249. package/src/components/TestPanel/TestPanel.tsx +1 -1
  250. package/src/components/TypescriptEditor/TypescriptEditor.stories.tsx +12 -7
  251. package/src/components/TypescriptEditor/TypescriptEditor.tsx +69 -68
  252. package/src/e2e/ai.test.ts +92 -0
  253. package/src/e2e/deploy.test.ts +64 -0
  254. package/src/hooks/deploy.ts +33 -26
  255. package/src/hooks/format.ts +5 -1
  256. package/src/hooks/index.ts +1 -0
  257. package/src/hooks/template.ts +15 -9
  258. package/src/hooks/useCompiler.ts +24 -0
  259. package/src/hooks/useCreateAndDeployScriptTemplates.ts +13 -19
  260. package/src/hooks/useToolbarState.ts +29 -5
  261. package/src/index.ts +1 -1
  262. package/src/meta.ts +2 -2
  263. package/src/notebook/compute-graph.test.ts +20 -8
  264. package/src/notebook/compute-graph.ts +45 -21
  265. package/src/templates/anthropic.ts +42 -0
  266. package/src/templates/chess-bot.ts +58 -0
  267. package/src/templates/commentary.ts +232 -0
  268. package/src/templates/data-generator.ts +1 -1
  269. package/src/templates/forex-effect.ts +22 -27
  270. package/src/templates/forex.ts +7 -6
  271. package/src/templates/index.ts +18 -5
  272. package/src/templates/ping.ts +14 -5
  273. package/src/testing/simulator.test.ts +40 -0
  274. package/src/types/Notebook.ts +7 -8
  275. package/src/types/actions.ts +17 -25
  276. package/src/types/capabilities.ts +17 -0
  277. package/src/types/events.ts +11 -0
  278. package/src/types/index.ts +2 -0
  279. package/src/types/types.ts +1 -1
  280. package/src/util/deploy.ts +19 -25
  281. package/src/util/functions.ts +24 -22
  282. package/src/vite-env.d.ts +2 -0
  283. package/dist/lib/browser/DeploymentDialog-5TKNGPVR.mjs +0 -14
  284. package/dist/lib/browser/NotebookContainer-MHY3DXDE.mjs.map +0 -7
  285. package/dist/lib/browser/ScriptContainer-CW6YN3DQ.mjs +0 -148
  286. package/dist/lib/browser/ScriptContainer-CW6YN3DQ.mjs.map +0 -7
  287. package/dist/lib/browser/app-graph-builder-2WR2ATTJ.mjs +0 -66
  288. package/dist/lib/browser/app-graph-builder-2WR2ATTJ.mjs.map +0 -7
  289. package/dist/lib/browser/blueprint-definition-6PZWZM2Y.mjs +0 -30
  290. package/dist/lib/browser/blueprint-definition-6PZWZM2Y.mjs.map +0 -7
  291. package/dist/lib/browser/chunk-2G2NA6DQ.mjs.map +0 -7
  292. package/dist/lib/browser/chunk-ALS6X4HU.mjs +0 -304
  293. package/dist/lib/browser/chunk-ALS6X4HU.mjs.map +0 -7
  294. package/dist/lib/browser/chunk-EB6AXFXO.mjs.map +0 -7
  295. package/dist/lib/browser/chunk-M6KJPUJK.mjs +0 -111
  296. package/dist/lib/browser/chunk-M6KJPUJK.mjs.map +0 -7
  297. package/dist/lib/browser/chunk-N5EYLQOT.mjs +0 -647
  298. package/dist/lib/browser/chunk-N5EYLQOT.mjs.map +0 -7
  299. package/dist/lib/browser/chunk-QIZ3BPRK.mjs +0 -103
  300. package/dist/lib/browser/chunk-QIZ3BPRK.mjs.map +0 -7
  301. package/dist/lib/browser/chunk-SAN5Y7FI.mjs +0 -155
  302. package/dist/lib/browser/chunk-SAN5Y7FI.mjs.map +0 -7
  303. package/dist/lib/browser/chunk-ULJFT73Q.mjs.map +0 -7
  304. package/dist/lib/browser/chunk-UOQ6NCH3.mjs +0 -15
  305. package/dist/lib/browser/chunk-UOQ6NCH3.mjs.map +0 -7
  306. package/dist/lib/browser/compiler-4KHRSX7J.mjs +0 -86
  307. package/dist/lib/browser/compiler-4KHRSX7J.mjs.map +0 -7
  308. package/dist/lib/browser/intent-resolver-TXTBWOVD.mjs +0 -104
  309. package/dist/lib/browser/intent-resolver-TXTBWOVD.mjs.map +0 -7
  310. package/dist/lib/browser/react-surface-R245YN52.mjs.map +0 -7
  311. package/dist/lib/browser/settings-MHJXRGDF.mjs +0 -26
  312. package/dist/lib/browser/settings-MHJXRGDF.mjs.map +0 -7
  313. package/dist/lib/node-esm/NotebookContainer-U4C2HQ4T.mjs.map +0 -7
  314. package/dist/lib/node-esm/ScriptContainer-VRPEKB4T.mjs +0 -149
  315. package/dist/lib/node-esm/ScriptContainer-VRPEKB4T.mjs.map +0 -7
  316. package/dist/lib/node-esm/app-graph-builder-NCVLUL5R.mjs +0 -67
  317. package/dist/lib/node-esm/app-graph-builder-NCVLUL5R.mjs.map +0 -7
  318. package/dist/lib/node-esm/blueprint-definition-5R6YCSZZ.mjs +0 -31
  319. package/dist/lib/node-esm/blueprint-definition-5R6YCSZZ.mjs.map +0 -7
  320. package/dist/lib/node-esm/chunk-55JZVM6K.mjs +0 -16
  321. package/dist/lib/node-esm/chunk-55JZVM6K.mjs.map +0 -7
  322. package/dist/lib/node-esm/chunk-57JA6XL5.mjs.map +0 -7
  323. package/dist/lib/node-esm/chunk-HDKR5WCD.mjs +0 -113
  324. package/dist/lib/node-esm/chunk-HDKR5WCD.mjs.map +0 -7
  325. package/dist/lib/node-esm/chunk-IBV2DR36.mjs.map +0 -7
  326. package/dist/lib/node-esm/chunk-ND4BPYPR.mjs +0 -156
  327. package/dist/lib/node-esm/chunk-ND4BPYPR.mjs.map +0 -7
  328. package/dist/lib/node-esm/chunk-UEVZP5DN.mjs +0 -648
  329. package/dist/lib/node-esm/chunk-UEVZP5DN.mjs.map +0 -7
  330. package/dist/lib/node-esm/chunk-VJSRZRLI.mjs.map +0 -7
  331. package/dist/lib/node-esm/chunk-VTRMJSQL.mjs +0 -305
  332. package/dist/lib/node-esm/chunk-VTRMJSQL.mjs.map +0 -7
  333. package/dist/lib/node-esm/chunk-XYKKDWUR.mjs +0 -104
  334. package/dist/lib/node-esm/chunk-XYKKDWUR.mjs.map +0 -7
  335. package/dist/lib/node-esm/compiler-DU5NQISX.mjs +0 -87
  336. package/dist/lib/node-esm/compiler-DU5NQISX.mjs.map +0 -7
  337. package/dist/lib/node-esm/intent-resolver-D6AVAQRA.mjs +0 -105
  338. package/dist/lib/node-esm/intent-resolver-D6AVAQRA.mjs.map +0 -7
  339. package/dist/lib/node-esm/react-surface-MHT3PJ6C.mjs.map +0 -7
  340. package/dist/lib/node-esm/settings-BVJORMMJ.mjs +0 -27
  341. package/dist/lib/node-esm/settings-BVJORMMJ.mjs.map +0 -7
  342. package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -4
  343. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
  344. package/dist/types/src/capabilities/artifact-definition.d.ts +0 -11
  345. package/dist/types/src/capabilities/artifact-definition.d.ts.map +0 -1
  346. package/dist/types/src/capabilities/blueprint-definition.d.ts +0 -5
  347. package/dist/types/src/capabilities/blueprint-definition.d.ts.map +0 -1
  348. package/dist/types/src/capabilities/capabilities.d.ts +0 -5
  349. package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
  350. package/dist/types/src/capabilities/compiler.d.ts +0 -4
  351. package/dist/types/src/capabilities/compiler.d.ts.map +0 -1
  352. package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
  353. package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
  354. package/dist/types/src/capabilities/react-surface.d.ts +0 -4
  355. package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
  356. package/dist/types/src/capabilities/settings.d.ts +0 -4
  357. package/dist/types/src/capabilities/settings.d.ts.map +0 -1
  358. package/dist/types/src/events.d.ts +0 -4
  359. package/dist/types/src/events.d.ts.map +0 -1
  360. package/dist/types/src/templates/chess.d.ts +0 -3
  361. package/dist/types/src/templates/chess.d.ts.map +0 -1
  362. package/src/capabilities/app-graph-builder.ts +0 -65
  363. package/src/capabilities/blueprint-definition.ts +0 -30
  364. package/src/capabilities/capabilities.ts +0 -12
  365. package/src/capabilities/compiler.ts +0 -34
  366. package/src/capabilities/intent-resolver.ts +0 -86
  367. package/src/capabilities/react-surface.tsx +0 -103
  368. package/src/capabilities/settings.ts +0 -21
  369. package/src/events.ts +0 -11
  370. package/src/templates/chess.ts +0 -49
  371. /package/dist/lib/browser/{DeploymentDialog-5TKNGPVR.mjs.map → DeploymentDialog-OSL6RMPA.mjs.map} +0 -0
  372. /package/dist/lib/{node-esm/DeploymentDialog-2ULNOZQH.mjs.map → browser/blueprints/index.mjs.map} +0 -0
@@ -2,39 +2,36 @@ import { createRequire } from 'node:module';const require = createRequire(import
2
2
  import {
3
3
  NotebookMenu,
4
4
  NotebookStack
5
- } from "./chunk-VTRMJSQL.mjs";
6
- import "./chunk-HDKR5WCD.mjs";
5
+ } from "./chunk-VWOLKNMO.mjs";
6
+ import "./chunk-SLU3KRV3.mjs";
7
7
  import {
8
8
  meta
9
- } from "./chunk-IBV2DR36.mjs";
9
+ } from "./chunk-5HSJPAK7.mjs";
10
10
  import "./chunk-HSLMI22Q.mjs";
11
11
 
12
12
  // src/components/NotebookContainer.tsx
13
- import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
13
+ import { RegistryContext } from "@effect-atom/atom-react";
14
14
  import * as Cause from "effect/Cause";
15
15
  import * as Effect from "effect/Effect";
16
16
  import * as Exit from "effect/Exit";
17
- import React, { useCallback, useMemo, useState } from "react";
17
+ import React, { useCallback, useContext, useMemo, useState } from "react";
18
18
  import { Agent } from "@dxos/assistant-toolkit";
19
19
  import { Blueprint, Prompt } from "@dxos/blueprints";
20
20
  import { Filter, Obj, Query, Ref } from "@dxos/echo";
21
21
  import { QueryBuilder } from "@dxos/echo-query";
22
- import { FunctionInvocationService } from "@dxos/functions";
23
- import { InvocationTracer } from "@dxos/functions-runtime";
24
- import { TracingServiceExt } from "@dxos/functions-runtime";
22
+ import { FunctionInvocationService, TracingService } from "@dxos/functions";
25
23
  import { invariant as invariant2 } from "@dxos/invariant";
26
24
  import { log as log2 } from "@dxos/log";
27
25
  import { useComputeRuntimeCallback } from "@dxos/plugin-automation";
28
26
  import { Graph } from "@dxos/plugin-explorer/types";
29
- import { getSpace } from "@dxos/react-client/echo";
30
27
  import { DropdownMenu, IconButton, Toolbar, useTranslation } from "@dxos/react-ui";
31
28
  import { useAttention } from "@dxos/react-ui-attention";
32
- import { StackItem } from "@dxos/react-ui-stack";
29
+ import { Layout } from "@dxos/react-ui-mosaic";
33
30
  import { Text, View } from "@dxos/schema";
34
31
  import { isNonNullable } from "@dxos/util";
35
32
 
36
33
  // src/notebook/compute-graph.ts
37
- import { signal } from "@preact/signals-core";
34
+ import { Atom } from "@effect-atom/atom-react";
38
35
  import { log } from "@dxos/log";
39
36
 
40
37
  // src/notebook/eval.ts
@@ -389,44 +386,64 @@ var VirtualTypeScriptParser = class {
389
386
  var __dxlog_file2 = "/__w/dxos/dxos/packages/plugins/plugin-script/src/notebook/compute-graph.ts";
390
387
  var ComputeGraph = class {
391
388
  _notebook;
389
+ _registry;
392
390
  _parser = new VirtualTypeScriptParser();
393
- _expressions = signal({});
394
- _valuesByCellId = signal({});
395
- _valuesByName = signal({});
396
- constructor(_notebook) {
391
+ _expressionsAtom = Atom.make({});
392
+ _valuesByCellIdAtom = Atom.make({});
393
+ _valuesByNameAtom = Atom.make({});
394
+ constructor(_notebook, _registry) {
397
395
  this._notebook = _notebook;
396
+ this._registry = _registry;
398
397
  }
399
398
  /**
400
- * Parsed expressions by cell ID.
399
+ * Atom for parsed expressions by cell ID.
401
400
  */
402
401
  get expressions() {
403
- return this._expressions;
402
+ return this._expressionsAtom;
404
403
  }
405
404
  /**
406
- * Computed values by cell ID.
405
+ * Get current expressions by cell ID.
406
+ */
407
+ getExpressions() {
408
+ return this._registry.get(this._expressionsAtom);
409
+ }
410
+ /**
411
+ * Atom for computed values by cell ID.
407
412
  */
408
413
  get values() {
409
- return this._valuesByCellId;
414
+ return this._valuesByCellIdAtom;
410
415
  }
411
416
  /**
412
- * Computed values by name.
417
+ * Get computed values by cell ID.
418
+ */
419
+ getValues() {
420
+ return this._registry.get(this._valuesByCellIdAtom);
421
+ }
422
+ /**
423
+ * Atom for computed values by name.
413
424
  */
414
425
  get valuesByName() {
415
- return this._valuesByName;
426
+ return this._valuesByNameAtom;
427
+ }
428
+ /**
429
+ * Get current values by name.
430
+ */
431
+ getValuesByName() {
432
+ return this._registry.get(this._valuesByNameAtom);
416
433
  }
417
434
  /**
418
435
  * Get computed value by cell ID.
419
436
  */
420
437
  getValue(cellId) {
421
- return this._valuesByCellId.value[cellId];
438
+ return this._registry.get(this._valuesByCellIdAtom)[cellId];
422
439
  }
423
440
  /**
424
441
  * Compute values.
425
442
  */
426
443
  async evaluate() {
427
444
  const { expressions, dependencyGraph } = this.parse();
428
- this._valuesByCellId.value = {};
429
- this._valuesByName.value = {};
445
+ this._registry.set(this._valuesByCellIdAtom, {});
446
+ this._registry.set(this._valuesByNameAtom, {});
430
447
  const cellExpressions = /* @__PURE__ */ new Map();
431
448
  Object.entries(expressions).forEach(([id, expr]) => {
432
449
  cellExpressions.set(id, expr);
@@ -441,7 +458,7 @@ var ComputeGraph = class {
441
458
  cellId
442
459
  }, {
443
460
  F: __dxlog_file2,
444
- L: 81,
461
+ L: 105,
445
462
  S: this,
446
463
  C: (f, a) => f(...a)
447
464
  });
@@ -453,7 +470,7 @@ var ComputeGraph = class {
453
470
  cellId
454
471
  }, {
455
472
  F: __dxlog_file2,
456
- L: 87,
473
+ L: 111,
457
474
  S: this,
458
475
  C: (f, a) => f(...a)
459
476
  });
@@ -486,14 +503,14 @@ var ComputeGraph = class {
486
503
  error
487
504
  }, {
488
505
  F: __dxlog_file2,
489
- L: 123,
506
+ L: 147,
490
507
  S: this,
491
508
  C: (f, a) => f(...a)
492
509
  });
493
510
  }
494
511
  }
495
- this._valuesByCellId.value = valuesByCellId;
496
- this._valuesByName.value = valuesByName;
512
+ this._registry.set(this._valuesByCellIdAtom, valuesByCellId);
513
+ this._registry.set(this._valuesByNameAtom, valuesByName);
497
514
  return valuesByCellId;
498
515
  }
499
516
  async eval(source, values) {
@@ -512,7 +529,7 @@ var ComputeGraph = class {
512
529
  return acc;
513
530
  }, {});
514
531
  const dependencyGraph = this.buildDependencyGraph(expressions);
515
- this._expressions.value = expressions;
532
+ this._registry.set(this._expressionsAtom, expressions);
516
533
  return {
517
534
  expressions,
518
535
  dependencyGraph
@@ -559,222 +576,233 @@ var INCLUDE_BLUEPRINTS = [
559
576
  "dxos.org/blueprint/assistant",
560
577
  "dxos.org/blueprint/markdown"
561
578
  ];
562
- var NotebookContainer = ({ notebook, env }) => {
563
- var _effect = _useSignals();
564
- try {
565
- const { t } = useTranslation(meta.id);
566
- const space = getSpace(notebook);
567
- const attendableId = notebook ? Obj.getDXN(notebook).toString() : "";
568
- const { hasAttention } = useAttention(attendableId);
569
- const graph = useMemo(() => notebook && new ComputeGraph(notebook), [
570
- notebook
571
- ]);
572
- const [queryValues, setQueryValues] = useState({});
573
- const handleExecQueries = useCallback(async () => {
574
- invariant2(space, void 0, {
575
- F: __dxlog_file3,
576
- L: 56,
577
- S: void 0,
578
- A: [
579
- "space",
580
- ""
581
- ]
582
- });
583
- const builder = new QueryBuilder();
584
- for (const cell of notebook?.cells ?? []) {
585
- if (cell.type === "query") {
586
- if (cell.source?.target) {
587
- const source = cell.source.target.content;
588
- const { name, filter } = builder.build(source);
589
- if (filter) {
590
- const ast = Query.select(filter).ast;
591
- const graph2 = cell.graph?.target;
592
- if (!graph2) {
593
- const { view } = await View.makeFromSpace({
594
- space
595
- });
596
- const graph3 = Graph.make({
597
- query: {
598
- ast
599
- },
600
- view
601
- });
602
- cell.graph = Ref.make(graph3);
603
- cell.name = name;
604
- } else {
605
- graph2.query.ast = ast;
606
- }
579
+ var NotebookContainer = ({ role, subject: notebook, env }) => {
580
+ const { t } = useTranslation(meta.id);
581
+ const registry = useContext(RegistryContext);
582
+ const db = notebook && Obj.getDatabase(notebook);
583
+ const attendableId = notebook ? Obj.getDXN(notebook).toString() : "";
584
+ const { hasAttention } = useAttention(attendableId);
585
+ const graph = useMemo(() => notebook && new ComputeGraph(notebook, registry), [
586
+ notebook,
587
+ registry
588
+ ]);
589
+ const [queryValues, setQueryValues] = useState({});
590
+ const handleExecQueries = useCallback(async () => {
591
+ invariant2(db, void 0, {
592
+ F: __dxlog_file3,
593
+ L: 54,
594
+ S: void 0,
595
+ A: [
596
+ "db",
597
+ ""
598
+ ]
599
+ });
600
+ const builder = new QueryBuilder();
601
+ for (const cell of notebook?.cells ?? []) {
602
+ if (cell.type === "query") {
603
+ if (cell.source?.target) {
604
+ const source = cell.source.target.content;
605
+ const { name, filter } = builder.build(source);
606
+ if (filter) {
607
+ const ast = Query.select(filter).ast;
608
+ const graph2 = cell.graph?.target;
609
+ if (!graph2) {
610
+ const { view } = await View.makeFromDatabase({
611
+ db
612
+ });
613
+ const newGraph = Graph.make({
614
+ query: {
615
+ ast
616
+ },
617
+ view
618
+ });
619
+ Obj.change(notebook, (n) => {
620
+ const c = n.cells.find((c2) => c2.id === cell.id);
621
+ if (c) {
622
+ c.graph = Ref.make(newGraph);
623
+ c.name = name;
624
+ }
625
+ });
626
+ } else {
627
+ Obj.change(graph2, (g) => {
628
+ g.query.ast = ast;
629
+ });
607
630
  }
608
631
  }
609
- if (cell.name && cell.graph?.target) {
610
- const graph2 = Obj.getSnapshot(cell.graph?.target);
611
- const query = Query.fromAst(graph2.query.ast);
612
- const result = await space?.db.query(query).run();
613
- const objectIds = result?.objects?.map((obj) => obj.id);
614
- setQueryValues((prev) => ({
615
- ...prev,
616
- [cell.name]: objectIds
617
- }));
618
- }
619
632
  }
620
- }
621
- }, [
622
- space,
623
- notebook,
624
- graph
625
- ]);
626
- const [promptResults, setPromptResults] = useState({});
627
- const handleExecPrompts = useComputeRuntimeCallback(space, Effect.fnUntraced(function* () {
628
- invariant2(graph, void 0, {
629
- F: __dxlog_file3,
630
- L: 93,
631
- S: this,
632
- A: [
633
- "graph",
634
- ""
635
- ]
636
- });
637
- const prompts = notebook?.cells.filter((cell) => cell.type === "prompt").map((cell) => cell.prompt).filter(isNonNullable) ?? [];
638
- for (const prompt of prompts) {
639
- yield* runPrompt({
640
- prompt,
641
- input: {
642
- ...queryValues,
643
- ...graph.valuesByName.value
644
- },
645
- onResult: (result) => setPromptResults((prev) => ({
633
+ if (cell.name && cell.graph?.target) {
634
+ const graph2 = Obj.getSnapshot(cell.graph?.target);
635
+ const query = Query.fromAst(graph2.query.ast);
636
+ const objects = await db.query(query).run();
637
+ const objectIds = objects?.map((obj) => obj.id);
638
+ setQueryValues((prev) => ({
646
639
  ...prev,
647
- [prompt.dxn.toString()]: result
648
- }))
649
- });
640
+ [cell.name]: objectIds
641
+ }));
642
+ }
650
643
  }
651
- }), [
652
- notebook,
653
- graph,
654
- queryValues
655
- ]);
656
- const handleCompute = useCallback(async () => {
657
- await graph?.evaluate();
658
- await handleExecQueries();
659
- await handleExecPrompts();
660
- }, [
661
- graph,
662
- handleExecQueries,
663
- handleExecPrompts
664
- ]);
665
- const handleRearrange = useCallback((source, target) => {
666
- invariant2(notebook, void 0, {
667
- F: __dxlog_file3,
668
- L: 126,
669
- S: void 0,
670
- A: [
671
- "notebook",
672
- ""
673
- ]
644
+ }
645
+ }, [
646
+ db,
647
+ notebook,
648
+ graph
649
+ ]);
650
+ const [promptResults, setPromptResults] = useState({});
651
+ const handleExecPrompts = useComputeRuntimeCallback(db?.spaceId, Effect.fnUntraced(function* () {
652
+ invariant2(graph, void 0, {
653
+ F: __dxlog_file3,
654
+ L: 98,
655
+ S: this,
656
+ A: [
657
+ "graph",
658
+ ""
659
+ ]
660
+ });
661
+ const prompts = notebook?.cells.filter((cell) => cell.type === "prompt").map((cell) => cell.prompt).filter(isNonNullable) ?? [];
662
+ for (const prompt of prompts) {
663
+ yield* runPrompt({
664
+ prompt,
665
+ input: {
666
+ ...queryValues,
667
+ ...graph.getValuesByName()
668
+ },
669
+ onResult: (result) => setPromptResults((prev) => ({
670
+ ...prev,
671
+ [prompt.dxn.toString()]: result
672
+ }))
674
673
  });
675
- const from = notebook.cells.findIndex((cell) => cell.id === source.id);
676
- const to = notebook.cells.findIndex((cell) => cell.id === target.id);
677
- if (from != null && to != null) {
678
- const cell = notebook.cells.splice(from, 1)[0];
674
+ }
675
+ }), [
676
+ notebook,
677
+ graph,
678
+ queryValues
679
+ ]);
680
+ const handleCompute = useCallback(async () => {
681
+ await graph?.evaluate();
682
+ await handleExecQueries();
683
+ await handleExecPrompts();
684
+ }, [
685
+ graph,
686
+ handleExecQueries,
687
+ handleExecPrompts
688
+ ]);
689
+ const handleRearrange = useCallback((source, target) => {
690
+ invariant2(notebook, void 0, {
691
+ F: __dxlog_file3,
692
+ L: 131,
693
+ S: void 0,
694
+ A: [
695
+ "notebook",
696
+ ""
697
+ ]
698
+ });
699
+ const from = notebook.cells.findIndex((cell) => cell.id === source.id);
700
+ const to = notebook.cells.findIndex((cell) => cell.id === target.id);
701
+ if (from != null && to != null) {
702
+ Obj.change(notebook, (n) => {
703
+ const cell = n.cells.splice(from, 1)[0];
679
704
  if (cell) {
680
- notebook.cells.splice(to, 0, cell);
705
+ n.cells.splice(to, 0, cell);
681
706
  }
682
- }
683
- }, [
684
- notebook
685
- ]);
686
- const handleCellInsert = useCallback(async (type, after) => {
687
- invariant2(notebook, void 0, {
688
- F: __dxlog_file3,
689
- L: 141,
690
- S: void 0,
691
- A: [
692
- "notebook",
693
- ""
694
- ]
695
707
  });
696
- const cell = {
697
- id: crypto.randomUUID(),
698
- type
699
- };
700
- switch (type) {
701
- case "markdown":
702
- case "script":
703
- case "query": {
704
- cell.source = Ref.make(Text.make());
705
- break;
706
- }
707
- case "prompt": {
708
- if (space) {
709
- const result = await space.db.query(Query.select(Filter.type(Blueprint.Blueprint))).run();
710
- const blueprints = result.objects.filter((blueprint) => INCLUDE_BLUEPRINTS.includes(blueprint.key)).map((blueprint) => Ref.make(blueprint));
711
- cell.prompt = Ref.make(Prompt.make({
712
- instructions: "",
713
- blueprints
714
- }));
715
- }
716
- break;
708
+ }
709
+ }, [
710
+ notebook
711
+ ]);
712
+ const handleCellInsert = useCallback(async (type, after) => {
713
+ invariant2(notebook, void 0, {
714
+ F: __dxlog_file3,
715
+ L: 148,
716
+ S: void 0,
717
+ A: [
718
+ "notebook",
719
+ ""
720
+ ]
721
+ });
722
+ const cell = {
723
+ id: crypto.randomUUID(),
724
+ type
725
+ };
726
+ switch (type) {
727
+ case "markdown":
728
+ case "script":
729
+ case "query": {
730
+ cell.source = Ref.make(Text.make());
731
+ break;
732
+ }
733
+ case "prompt": {
734
+ if (db) {
735
+ const objects = await db.query(Query.select(Filter.type(Blueprint.Blueprint))).run();
736
+ const blueprints = objects.filter((blueprint) => INCLUDE_BLUEPRINTS.includes(blueprint.key)).map((blueprint) => Ref.make(blueprint));
737
+ cell.prompt = Ref.make(Prompt.make({
738
+ instructions: "",
739
+ blueprints
740
+ }));
717
741
  }
742
+ break;
718
743
  }
719
- const idx = after ? notebook.cells.findIndex((cell2) => cell2.id === after) : notebook.cells.length;
720
- notebook.cells.splice(idx, 0, cell);
721
- }, [
722
- space,
723
- notebook
724
- ]);
725
- const handleCellDelete = useCallback((id) => {
726
- invariant2(notebook, void 0, {
727
- F: __dxlog_file3,
728
- L: 171,
729
- S: void 0,
730
- A: [
731
- "notebook",
732
- ""
733
- ]
744
+ }
745
+ const idx = after ? notebook.cells.findIndex((cell2) => cell2.id === after) : notebook.cells.length;
746
+ Obj.change(notebook, (n) => {
747
+ n.cells.splice(idx, 0, cell);
748
+ });
749
+ }, [
750
+ db,
751
+ notebook
752
+ ]);
753
+ const handleCellDelete = useCallback((id) => {
754
+ invariant2(notebook, void 0, {
755
+ F: __dxlog_file3,
756
+ L: 180,
757
+ S: void 0,
758
+ A: [
759
+ "notebook",
760
+ ""
761
+ ]
762
+ });
763
+ const idx = notebook.cells.findIndex((cell) => cell.id === id);
764
+ if (idx !== -1) {
765
+ Obj.change(notebook, (n) => {
766
+ n.cells.splice(idx, 1);
734
767
  });
735
- const idx = notebook.cells.findIndex((cell) => cell.id === id);
736
- if (idx !== -1) {
737
- notebook.cells.splice(idx, 1);
738
- }
739
- }, [
740
- notebook
741
- ]);
742
- return /* @__PURE__ */ React.createElement(StackItem.Content, {
743
- toolbar: true
744
- }, /* @__PURE__ */ React.createElement(Toolbar.Root, {
745
- disabled: !hasAttention,
746
- textBlockWidth: true
747
- }, /* @__PURE__ */ React.createElement(DropdownMenu.Root, null, /* @__PURE__ */ React.createElement(DropdownMenu.Trigger, {
748
- asChild: true
749
- }, /* @__PURE__ */ React.createElement(IconButton, {
750
- icon: "ph--plus--regular",
751
- iconOnly: true,
752
- label: t("notebook cell insert label")
753
- })), /* @__PURE__ */ React.createElement(NotebookMenu, {
754
- onCellInsert: handleCellInsert
755
- })), /* @__PURE__ */ React.createElement(Toolbar.IconButton, {
756
- icon: "ph--play--fill",
757
- iconOnly: true,
758
- label: t("compute label"),
759
- classNames: "text-green-500",
760
- onClick: handleCompute
761
- })), /* @__PURE__ */ React.createElement("div", {
762
- role: "none",
763
- className: "flex bs-full overflow-hidden -mis-[1px] -mie-[1px]"
764
- }, /* @__PURE__ */ React.createElement(NotebookStack, {
765
- classNames: "container-max-width border-l border-r border-subduedSeparator",
766
- space,
767
- notebook,
768
- graph,
769
- env,
770
- promptResults,
771
- onRearrange: handleRearrange,
772
- onCellInsert: handleCellInsert,
773
- onCellDelete: handleCellDelete
774
- })));
775
- } finally {
776
- _effect.f();
777
- }
768
+ }
769
+ }, [
770
+ notebook
771
+ ]);
772
+ return /* @__PURE__ */ React.createElement(Layout.Main, {
773
+ role,
774
+ toolbar: true
775
+ }, /* @__PURE__ */ React.createElement(Toolbar.Root, {
776
+ disabled: !hasAttention,
777
+ textBlockWidth: true
778
+ }, /* @__PURE__ */ React.createElement(DropdownMenu.Root, null, /* @__PURE__ */ React.createElement(DropdownMenu.Trigger, {
779
+ asChild: true
780
+ }, /* @__PURE__ */ React.createElement(IconButton, {
781
+ icon: "ph--plus--regular",
782
+ iconOnly: true,
783
+ label: t("notebook cell insert label")
784
+ })), /* @__PURE__ */ React.createElement(NotebookMenu, {
785
+ onCellInsert: handleCellInsert
786
+ })), /* @__PURE__ */ React.createElement(Toolbar.IconButton, {
787
+ icon: "ph--play--fill",
788
+ iconOnly: true,
789
+ label: t("compute label"),
790
+ classNames: "text-green-500",
791
+ onClick: handleCompute
792
+ })), /* @__PURE__ */ React.createElement("div", {
793
+ role: "none",
794
+ className: "flex bs-full overflow-hidden -mis-[1px] -mie-[1px]"
795
+ }, /* @__PURE__ */ React.createElement(NotebookStack, {
796
+ classNames: "container-max-width border-l border-r border-subduedSeparator",
797
+ db,
798
+ notebook,
799
+ graph,
800
+ env,
801
+ promptResults,
802
+ onRearrange: handleRearrange,
803
+ onCellInsert: handleCellInsert,
804
+ onCellDelete: handleCellDelete
805
+ })));
778
806
  };
779
807
  var NotebookContainer_default = NotebookContainer;
780
808
  var runPrompt = Effect.fn(function* ({ prompt, input, onResult }) {
@@ -782,20 +810,20 @@ var runPrompt = Effect.fn(function* ({ prompt, input, onResult }) {
782
810
  prompt,
783
811
  input
784
812
  };
785
- const tracer = yield* InvocationTracer;
813
+ const tracer = yield* TracingService;
786
814
  const trace = yield* tracer.traceInvocationStart({
787
815
  target: void 0,
788
816
  payload: {
789
817
  data: {}
790
818
  }
791
819
  });
792
- const result = yield* FunctionInvocationService.invokeFunction(Agent.prompt, inputData).pipe(Effect.provide(TracingServiceExt.layerQueue(trace.invocationTraceQueue)), Effect.exit);
820
+ const result = yield* FunctionInvocationService.invokeFunction(Agent.prompt, inputData).pipe(Effect.provide(trace.invocationTraceQueue ? TracingService.layerInvocation(trace) : TracingService.layerNoop), Effect.exit);
793
821
  Exit.match(result, {
794
822
  onFailure: (cause) => {
795
823
  const error = Cause.prettyErrors(cause)[0];
796
824
  log2.error(error.message, error.cause ?? error.stack, {
797
825
  F: __dxlog_file3,
798
- L: 247,
826
+ L: 258,
799
827
  S: this,
800
828
  C: (f, a) => f(...a)
801
829
  });
@@ -815,4 +843,4 @@ export {
815
843
  NotebookContainer,
816
844
  NotebookContainer_default as default
817
845
  };
818
- //# sourceMappingURL=NotebookContainer-U4C2HQ4T.mjs.map
846
+ //# sourceMappingURL=NotebookContainer-IUAYVJSD.mjs.map