@dxos/plugin-script 0.8.4-main.3fbcb4aa9b → 0.8.4-main.4668b7de9b

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 (241) hide show
  1. package/LICENSE +102 -5
  2. package/PLUGIN.mdl +515 -0
  3. package/dist/lib/neutral/{DeploymentDialog-6DBF3V6C.mjs → DeploymentDialog-M3AFYQHC.mjs} +4 -2
  4. package/dist/lib/neutral/{DeploymentDialog-6DBF3V6C.mjs.map → DeploymentDialog-M3AFYQHC.mjs.map} +3 -3
  5. package/dist/lib/neutral/{NotebookContainer-FIAQI3A2.mjs → NotebookArticle-NV4AHOOS.mjs} +15 -12
  6. package/dist/lib/neutral/NotebookArticle-NV4AHOOS.mjs.map +7 -0
  7. package/dist/lib/neutral/{ScriptContainer-2OPBAXFB.mjs → ScriptArticle-UBT27SB6.mjs} +4 -4
  8. package/dist/lib/neutral/{ScriptContainer-2OPBAXFB.mjs.map → ScriptArticle-UBT27SB6.mjs.map} +4 -4
  9. package/dist/lib/neutral/ScriptPlugin.mjs +12 -0
  10. package/dist/lib/neutral/ScriptPlugin.mjs.map +4 -4
  11. package/dist/lib/neutral/ScriptPlugin.workerd.mjs +21 -0
  12. package/dist/lib/neutral/ScriptPlugin.workerd.mjs.map +7 -0
  13. package/dist/lib/neutral/{ScriptProperties-F6NE6M4H.mjs → ScriptProperties-RLXNAN3N.mjs} +9 -8
  14. package/dist/lib/neutral/ScriptProperties-RLXNAN3N.mjs.map +7 -0
  15. package/dist/lib/neutral/{TestContainer-JNFPLAJX.mjs → TestContainer-AFVTBYSJ.mjs} +5 -5
  16. package/dist/lib/neutral/TestContainer-AFVTBYSJ.mjs.map +7 -0
  17. package/dist/lib/neutral/blueprints/index.mjs +3 -3
  18. package/dist/lib/neutral/capabilities/index.mjs +4 -4
  19. package/dist/lib/neutral/capabilities/node.mjs +3 -3
  20. package/dist/lib/neutral/{chunk-D7DFASAE.mjs → chunk-2REUEDUA.mjs} +8 -4
  21. package/dist/lib/neutral/chunk-2REUEDUA.mjs.map +7 -0
  22. package/dist/lib/neutral/{chunk-BDRB6ZX2.mjs → chunk-BDHDBPVM.mjs} +2 -2
  23. package/dist/lib/neutral/{chunk-PDB6UOSB.mjs → chunk-C4O7EV6M.mjs} +11 -13
  24. package/dist/lib/neutral/chunk-C4O7EV6M.mjs.map +7 -0
  25. package/dist/lib/neutral/chunk-H2BRWQMY.mjs +96 -0
  26. package/dist/lib/neutral/chunk-H2BRWQMY.mjs.map +7 -0
  27. package/dist/lib/neutral/{chunk-B4FVQEHV.mjs → chunk-LHEJXJEL.mjs} +2 -2
  28. package/dist/lib/neutral/{chunk-B4FVQEHV.mjs.map → chunk-LHEJXJEL.mjs.map} +2 -2
  29. package/dist/lib/neutral/chunk-NQOIENTU.mjs +8 -0
  30. package/dist/lib/neutral/{chunk-MI6X5CTJ.mjs → chunk-TRKXIP2Q.mjs} +30 -21
  31. package/dist/lib/neutral/chunk-TRKXIP2Q.mjs.map +7 -0
  32. package/dist/lib/neutral/chunk-UA3BWOCZ.mjs +38 -0
  33. package/dist/lib/neutral/chunk-UA3BWOCZ.mjs.map +7 -0
  34. package/dist/lib/neutral/{chunk-4RJALG6K.mjs → chunk-VXDJH6OL.mjs} +9 -10
  35. package/dist/lib/neutral/chunk-VXDJH6OL.mjs.map +7 -0
  36. package/dist/lib/neutral/{compiler-SMVIP5UN.mjs → compiler-ODK4UA2N.mjs} +2 -2
  37. package/dist/lib/neutral/components/index.mjs +93 -148
  38. package/dist/lib/neutral/components/index.mjs.map +4 -4
  39. package/dist/lib/neutral/containers/index.mjs +7 -7
  40. package/dist/lib/neutral/containers/index.mjs.map +3 -3
  41. package/dist/lib/neutral/{create-OZRIZ7RN.mjs → create-WQJXMOUE.mjs} +7 -5
  42. package/dist/lib/neutral/create-WQJXMOUE.mjs.map +7 -0
  43. package/dist/lib/neutral/{create-object-F2NWICFV.mjs → create-object-FZM5ASWM.mjs} +4 -3
  44. package/dist/lib/neutral/create-object-FZM5ASWM.mjs.map +7 -0
  45. package/dist/lib/neutral/{create-script-VBA3SLSU.mjs → create-script-66DO3UJO.mjs} +3 -3
  46. package/dist/lib/neutral/{delete-PAUWA2QM.mjs → delete-HCQIQFVP.mjs} +2 -2
  47. package/dist/lib/neutral/{deploy-CXVW54JJ.mjs → deploy-7JVMMHSH.mjs} +6 -5
  48. package/dist/lib/neutral/{deploy-CXVW54JJ.mjs.map → deploy-7JVMMHSH.mjs.map} +3 -3
  49. package/dist/lib/neutral/hooks/index.mjs +2 -2
  50. package/dist/lib/neutral/index.mjs +7 -7
  51. package/dist/lib/neutral/{inspect-invocations-LEOEP5I2.mjs → inspect-invocations-6MW73SDV.mjs} +3 -3
  52. package/dist/lib/neutral/{inspect-invocations-LEOEP5I2.mjs.map → inspect-invocations-6MW73SDV.mjs.map} +3 -3
  53. package/dist/lib/neutral/{install-function-5N24Q45W.mjs → install-function-FJIE2JAI.mjs} +7 -9
  54. package/dist/lib/neutral/install-function-FJIE2JAI.mjs.map +7 -0
  55. package/dist/lib/neutral/{invoke-5QVEZ3X5.mjs → invoke-3HVWY2KF.mjs} +7 -8
  56. package/dist/lib/neutral/invoke-3HVWY2KF.mjs.map +7 -0
  57. package/dist/lib/neutral/meta.json +1 -1
  58. package/dist/lib/neutral/meta.mjs +1 -1
  59. package/dist/lib/neutral/{operation-handler-OTCWYDFI.mjs → operation-handler-X44IGZXS.mjs} +3 -3
  60. package/dist/lib/neutral/operations/index.mjs +1 -1
  61. package/dist/lib/neutral/plugin.mjs +2 -2
  62. package/dist/lib/neutral/{query-deployed-functions-FVD7NYPA.mjs → query-deployed-functions-F4FHJNWO.mjs} +14 -10
  63. package/dist/lib/neutral/query-deployed-functions-F4FHJNWO.mjs.map +7 -0
  64. package/dist/lib/neutral/{react-surface-JH2AOK7V.mjs → react-surface-ACNZ35FV.mjs} +17 -13
  65. package/dist/lib/neutral/react-surface-ACNZ35FV.mjs.map +7 -0
  66. package/dist/lib/neutral/{read-FFOSK6A3.mjs → read-RQESBAQI.mjs} +2 -2
  67. package/dist/lib/neutral/templates/index.mjs +1 -1
  68. package/dist/lib/neutral/translations.mjs +3 -2
  69. package/dist/lib/neutral/translations.mjs.map +3 -3
  70. package/dist/lib/neutral/types/index.mjs +2 -2
  71. package/dist/lib/neutral/{update-PJS5GG3Y.mjs → update-JZUNJYZM.mjs} +3 -3
  72. package/dist/lib/neutral/{update-PJS5GG3Y.mjs.map → update-JZUNJYZM.mjs.map} +3 -3
  73. package/dist/types/src/ScriptPlugin.d.ts.map +1 -1
  74. package/dist/types/src/ScriptPlugin.workerd.d.ts +4 -0
  75. package/dist/types/src/ScriptPlugin.workerd.d.ts.map +1 -0
  76. package/dist/types/src/blueprints/functions/create.d.ts.map +1 -1
  77. package/dist/types/src/blueprints/functions/definitions.d.ts +24 -30
  78. package/dist/types/src/blueprints/functions/definitions.d.ts.map +1 -1
  79. package/dist/types/src/blueprints/functions/delete.d.ts +4 -5
  80. package/dist/types/src/blueprints/functions/deploy.d.ts +4 -5
  81. package/dist/types/src/blueprints/functions/inspect-invocations.d.ts +4 -5
  82. package/dist/types/src/blueprints/functions/invoke.d.ts +5 -6
  83. package/dist/types/src/blueprints/functions/invoke.d.ts.map +1 -1
  84. package/dist/types/src/blueprints/functions/read.d.ts +4 -5
  85. package/dist/types/src/blueprints/functions/update.d.ts +4 -5
  86. package/dist/types/src/capabilities/create-object.d.ts.map +1 -1
  87. package/dist/types/src/compiler/compiler.d.ts.map +1 -1
  88. package/dist/types/src/components/NotebookStack/NotebookStack.d.ts.map +1 -1
  89. package/dist/types/src/components/QueryEditor/QueryEditor.d.ts.map +1 -1
  90. package/dist/types/src/components/ScriptToolbar/ScriptToolbar.d.ts.map +1 -1
  91. package/dist/types/src/components/TestPanel/TestPanel.d.ts.map +1 -1
  92. package/dist/types/src/components/TypescriptEditor/TypescriptEditor.d.ts.map +1 -1
  93. package/dist/types/src/components/index.d.ts +0 -1
  94. package/dist/types/src/components/index.d.ts.map +1 -1
  95. package/dist/types/src/constants.d.ts +2 -1
  96. package/dist/types/src/constants.d.ts.map +1 -1
  97. package/dist/types/src/containers/NotebookArticle/NotebookArticle.d.ts +7 -0
  98. package/dist/types/src/containers/NotebookArticle/NotebookArticle.d.ts.map +1 -0
  99. package/dist/types/src/containers/NotebookArticle/NotebookArticle.stories.d.ts +7 -0
  100. package/dist/types/src/containers/NotebookArticle/NotebookArticle.stories.d.ts.map +1 -0
  101. package/dist/types/src/containers/NotebookArticle/index.d.ts +2 -0
  102. package/dist/types/src/containers/{ScriptContainer → NotebookArticle}/index.d.ts.map +1 -1
  103. package/dist/types/src/containers/{ScriptContainer/ScriptContainer.d.ts → ScriptArticle/ScriptArticle.d.ts} +2 -2
  104. package/dist/types/src/containers/ScriptArticle/ScriptArticle.d.ts.map +1 -0
  105. package/dist/types/src/containers/{ScriptContainer/ScriptContainer.stories.d.ts → ScriptArticle/ScriptArticle.stories.d.ts} +1 -1
  106. package/dist/types/src/containers/ScriptArticle/ScriptArticle.stories.d.ts.map +1 -0
  107. package/dist/types/src/containers/ScriptArticle/index.d.ts +2 -0
  108. package/dist/types/src/containers/ScriptArticle/index.d.ts.map +1 -0
  109. package/dist/types/src/containers/ScriptProperties/BlueprintEditor.d.ts.map +1 -1
  110. package/dist/types/src/containers/ScriptProperties/ScriptProperties.stories.d.ts.map +1 -1
  111. package/dist/types/src/containers/index.d.ts +2 -2
  112. package/dist/types/src/containers/index.d.ts.map +1 -1
  113. package/dist/types/src/hooks/deploy.d.ts +5 -6
  114. package/dist/types/src/hooks/deploy.d.ts.map +1 -1
  115. package/dist/types/src/meta.d.ts +1 -1
  116. package/dist/types/src/meta.d.ts.map +1 -1
  117. package/dist/types/src/operations/index.d.ts.map +1 -1
  118. package/dist/types/src/templates/chess-bot.d.ts +4 -2
  119. package/dist/types/src/templates/chess-bot.d.ts.map +1 -1
  120. package/dist/types/src/templates/commentary.d.ts +6 -4
  121. package/dist/types/src/templates/commentary.d.ts.map +1 -1
  122. package/dist/types/src/templates/index.d.ts +0 -5
  123. package/dist/types/src/templates/index.d.ts.map +1 -1
  124. package/dist/types/src/testing/test-script.d.ts.map +1 -1
  125. package/dist/types/src/translations.d.ts.map +1 -1
  126. package/dist/types/src/types/Notebook.d.ts +28 -47
  127. package/dist/types/src/types/Notebook.d.ts.map +1 -1
  128. package/dist/types/src/types/ScriptOperation.d.ts +6 -6
  129. package/dist/types/src/types/ScriptOperation.d.ts.map +1 -1
  130. package/dist/types/tsconfig.tsbuildinfo +1 -1
  131. package/package.json +84 -84
  132. package/src/ScriptPlugin.tsx +6 -0
  133. package/src/ScriptPlugin.workerd.ts +18 -0
  134. package/src/blueprints/functions/create.ts +3 -3
  135. package/src/blueprints/functions/definitions.ts +20 -11
  136. package/src/blueprints/functions/deploy.ts +3 -2
  137. package/src/blueprints/functions/inspect-invocations.ts +1 -1
  138. package/src/blueprints/functions/install-function.ts +5 -5
  139. package/src/blueprints/functions/invoke.ts +4 -5
  140. package/src/blueprints/functions/query-deployed-functions.ts +11 -7
  141. package/src/blueprints/functions/update.ts +1 -1
  142. package/src/capabilities/create-object.ts +3 -2
  143. package/src/capabilities/react-surface.tsx +6 -6
  144. package/src/compiler/compiler.ts +4 -0
  145. package/src/components/NotebookStack/NotebookCell.tsx +2 -2
  146. package/src/components/NotebookStack/NotebookStack.stories.tsx +2 -2
  147. package/src/components/NotebookStack/NotebookStack.tsx +1 -1
  148. package/src/components/QueryEditor/QueryEditor.tsx +3 -1
  149. package/src/components/ScriptToolbar/ScriptToolbar.stories.tsx +3 -3
  150. package/src/components/ScriptToolbar/ScriptToolbar.tsx +1 -1
  151. package/src/components/TestPanel/TestPanel.tsx +2 -1
  152. package/src/components/TypescriptEditor/TypescriptEditor.tsx +1 -1
  153. package/src/components/index.ts +0 -1
  154. package/src/constants.ts +3 -1
  155. package/src/containers/DeploymentDialog/DeploymentDialog.stories.tsx +3 -3
  156. package/src/containers/DeploymentDialog/DeploymentDialog.tsx +1 -1
  157. package/src/containers/{NotebookContainer/NotebookContainer.stories.tsx → NotebookArticle/NotebookArticle.stories.tsx} +10 -10
  158. package/src/containers/{NotebookContainer/NotebookContainer.tsx → NotebookArticle/NotebookArticle.tsx} +10 -9
  159. package/src/containers/NotebookArticle/index.ts +5 -0
  160. package/src/containers/{ScriptContainer/ScriptContainer.stories.tsx → ScriptArticle/ScriptArticle.stories.tsx} +6 -5
  161. package/src/containers/{ScriptContainer/ScriptContainer.tsx → ScriptArticle/ScriptArticle.tsx} +1 -1
  162. package/src/containers/ScriptArticle/index.ts +5 -0
  163. package/src/containers/ScriptProperties/BlueprintEditor.tsx +8 -7
  164. package/src/containers/ScriptProperties/ScriptProperties.stories.tsx +3 -2
  165. package/src/containers/TestContainer/TestContainer.tsx +4 -4
  166. package/src/containers/index.ts +2 -2
  167. package/src/meta.ts +13 -7
  168. package/src/operations/index.ts +1 -4
  169. package/src/templates/anthropic.ts +2 -1
  170. package/src/templates/chess-bot.ts +2 -2
  171. package/src/templates/commentary.ts +19 -17
  172. package/src/templates/data-generator.ts +1 -1
  173. package/src/templates/discord.ts +5 -5
  174. package/src/templates/forex-effect.ts +2 -1
  175. package/src/templates/forex.ts +2 -1
  176. package/src/templates/gmail.ts +5 -5
  177. package/src/templates/index.ts +0 -7
  178. package/src/templates/ping.ts +2 -1
  179. package/src/testing/test-notebook.ts +2 -2
  180. package/src/testing/test-script.ts +1 -2
  181. package/src/translations.ts +3 -2
  182. package/src/types/Notebook.ts +5 -11
  183. package/src/types/ScriptOperation.ts +4 -4
  184. package/src/util/deploy.ts +1 -1
  185. package/src/util/functions.ts +4 -4
  186. package/src/vite-env.d.ts +5 -0
  187. package/dist/lib/neutral/NotebookContainer-FIAQI3A2.mjs.map +0 -7
  188. package/dist/lib/neutral/ScriptProperties-F6NE6M4H.mjs.map +0 -7
  189. package/dist/lib/neutral/TestContainer-JNFPLAJX.mjs.map +0 -7
  190. package/dist/lib/neutral/access-token-created-ENMCEGVU.mjs +0 -34
  191. package/dist/lib/neutral/access-token-created-ENMCEGVU.mjs.map +0 -7
  192. package/dist/lib/neutral/chunk-2DMPFVUM.mjs +0 -8
  193. package/dist/lib/neutral/chunk-4RJALG6K.mjs.map +0 -7
  194. package/dist/lib/neutral/chunk-BUKQITZT.mjs +0 -105
  195. package/dist/lib/neutral/chunk-BUKQITZT.mjs.map +0 -7
  196. package/dist/lib/neutral/chunk-D7DFASAE.mjs.map +0 -7
  197. package/dist/lib/neutral/chunk-MI6X5CTJ.mjs.map +0 -7
  198. package/dist/lib/neutral/chunk-P2F3STZN.mjs +0 -8
  199. package/dist/lib/neutral/chunk-P2F3STZN.mjs.map +0 -7
  200. package/dist/lib/neutral/chunk-PDB6UOSB.mjs.map +0 -7
  201. package/dist/lib/neutral/chunk-UYR3YH4Q.mjs +0 -31
  202. package/dist/lib/neutral/chunk-UYR3YH4Q.mjs.map +0 -7
  203. package/dist/lib/neutral/create-OZRIZ7RN.mjs.map +0 -7
  204. package/dist/lib/neutral/create-object-F2NWICFV.mjs.map +0 -7
  205. package/dist/lib/neutral/install-function-5N24Q45W.mjs.map +0 -7
  206. package/dist/lib/neutral/invoke-5QVEZ3X5.mjs.map +0 -7
  207. package/dist/lib/neutral/query-deployed-functions-FVD7NYPA.mjs.map +0 -7
  208. package/dist/lib/neutral/react-surface-JH2AOK7V.mjs.map +0 -7
  209. package/dist/types/src/capabilities/artifact-definition.d.ts +0 -12
  210. package/dist/types/src/capabilities/artifact-definition.d.ts.map +0 -1
  211. package/dist/types/src/components/FramePanel/FramePanel.d.ts +0 -12
  212. package/dist/types/src/components/FramePanel/FramePanel.d.ts.map +0 -1
  213. package/dist/types/src/components/FramePanel/index.d.ts +0 -2
  214. package/dist/types/src/components/FramePanel/index.d.ts.map +0 -1
  215. package/dist/types/src/containers/NotebookContainer/NotebookContainer.d.ts +0 -7
  216. package/dist/types/src/containers/NotebookContainer/NotebookContainer.d.ts.map +0 -1
  217. package/dist/types/src/containers/NotebookContainer/NotebookContainer.stories.d.ts +0 -7
  218. package/dist/types/src/containers/NotebookContainer/NotebookContainer.stories.d.ts.map +0 -1
  219. package/dist/types/src/containers/NotebookContainer/index.d.ts +0 -2
  220. package/dist/types/src/containers/NotebookContainer/index.d.ts.map +0 -1
  221. package/dist/types/src/containers/ScriptContainer/ScriptContainer.d.ts.map +0 -1
  222. package/dist/types/src/containers/ScriptContainer/ScriptContainer.stories.d.ts.map +0 -1
  223. package/dist/types/src/containers/ScriptContainer/index.d.ts +0 -2
  224. package/dist/types/src/operations/access-token-created.d.ts +0 -5
  225. package/dist/types/src/operations/access-token-created.d.ts.map +0 -1
  226. package/dist/types/src/templates/chat.d.ts +0 -6
  227. package/dist/types/src/templates/chat.d.ts.map +0 -1
  228. package/src/capabilities/artifact-definition.ts +0 -226
  229. package/src/components/FramePanel/FramePanel.tsx +0 -85
  230. package/src/components/FramePanel/index.ts +0 -5
  231. package/src/containers/NotebookContainer/index.ts +0 -5
  232. package/src/containers/ScriptContainer/index.ts +0 -5
  233. package/src/operations/access-token-created.ts +0 -37
  234. package/src/templates/chat.ts +0 -96
  235. /package/dist/lib/neutral/{chunk-BDRB6ZX2.mjs.map → chunk-BDHDBPVM.mjs.map} +0 -0
  236. /package/dist/lib/neutral/{chunk-2DMPFVUM.mjs.map → chunk-NQOIENTU.mjs.map} +0 -0
  237. /package/dist/lib/neutral/{compiler-SMVIP5UN.mjs.map → compiler-ODK4UA2N.mjs.map} +0 -0
  238. /package/dist/lib/neutral/{create-script-VBA3SLSU.mjs.map → create-script-66DO3UJO.mjs.map} +0 -0
  239. /package/dist/lib/neutral/{delete-PAUWA2QM.mjs.map → delete-HCQIQFVP.mjs.map} +0 -0
  240. /package/dist/lib/neutral/{operation-handler-OTCWYDFI.mjs.map → operation-handler-X44IGZXS.mjs.map} +0 -0
  241. /package/dist/lib/neutral/{read-FFOSK6A3.mjs.map → read-RQESBAQI.mjs.map} +0 -0
@@ -1,107 +1,50 @@
1
1
  import {
2
2
  Compiler
3
- } from "../chunk-D7DFASAE.mjs";
3
+ } from "../chunk-2REUEDUA.mjs";
4
4
  import "../chunk-J5LGTIGS.mjs";
5
5
 
6
6
  // src/components/index.ts
7
7
  import { lazy } from "react";
8
8
 
9
- // src/components/FramePanel/FramePanel.tsx
10
- import React, { useEffect, useRef } from "react";
11
- import { clientServiceBundle } from "@dxos/client-protocol";
12
- import { invariant } from "@dxos/invariant";
13
- import { log } from "@dxos/log";
14
- import { useClient } from "@dxos/react-client";
15
- import { createProtoRpcPeer } from "@dxos/rpc";
16
- import { createIFramePort } from "@dxos/rpc-tunnel";
17
- import { mx } from "@dxos/ui-theme";
18
- var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-script/src/components/FramePanel/FramePanel.tsx";
19
- var FramePanel = ({ containerUrl, result, debug = true }) => {
20
- const client = useClient();
21
- const iframeRef = useRef(null);
22
- useEffect(() => {
23
- if (iframeRef.current) {
24
- const rpc = createProtoRpcPeer({
25
- exposed: clientServiceBundle,
26
- handlers: client._services.services,
27
- port: createIFramePort({
28
- channel: "frame",
29
- iframe: iframeRef.current,
30
- origin: "*"
31
- })
32
- });
33
- rpc.open().catch((e) => log.catch(e, void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 29, S: void 0 }));
34
- return () => {
35
- rpc.close().catch((e) => log.catch(e, void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 31, S: void 0 }));
36
- };
37
- }
38
- }, [
39
- iframeRef
40
- ]);
41
- invariant(result.sourceHash, "Source hash is required.", { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 38, S: void 0, A: ["result.sourceHash", "'Source hash is required.'"] });
42
- const sourceHash = Buffer.from(result.sourceHash).toString("hex");
43
- const src = "bundle" in result ? `${containerUrl}?ts=${sourceHash}#code=${encodeURIComponent(new TextDecoder().decode(Object.values(result.bundle)[0]))}` : void 0;
44
- return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("iframe", {
45
- ref: iframeRef,
46
- sandbox: "allow-scripts",
47
- src,
48
- style: {
49
- width: "100%",
50
- height: "100%"
51
- }
52
- }), debug && /* @__PURE__ */ React.createElement("div", {
53
- className: "relative"
54
- }, /* @__PURE__ */ React.createElement("div", {
55
- className: mx("flex absolute right-2 bottom-2 w-[30rem] h-[200px] bg-base-surface ring rounded-sm", "z-20 overflow-x-hidden overflow-y-auto")
56
- }, /* @__PURE__ */ React.createElement("pre", {
57
- className: "text-xs whitespace-break-spaces break-all p-2"
58
- }, JSON.stringify({
59
- timestamp: result.timestamp,
60
- sourceHash,
61
- error: "error" in result ? result.error : void 0,
62
- src
63
- }, void 0, 2)))));
64
- };
65
-
66
9
  // src/components/NotebookStack/NotebookMenu.tsx
67
- import React2 from "react";
10
+ import React from "react";
68
11
  import { DropdownMenu, useTranslation } from "@dxos/react-ui";
69
12
  import { meta } from "#meta";
70
13
  var NotebookMenu = ({ cell, onCellInsert, onCellDelete }) => {
71
14
  const { t } = useTranslation(meta.id);
72
- return /* @__PURE__ */ React2.createElement(DropdownMenu.Portal, null, /* @__PURE__ */ React2.createElement(DropdownMenu.Content, null, /* @__PURE__ */ React2.createElement(DropdownMenu.Viewport, null, /* @__PURE__ */ React2.createElement(DropdownMenu.Item, {
15
+ return /* @__PURE__ */ React.createElement(DropdownMenu.Portal, null, /* @__PURE__ */ React.createElement(DropdownMenu.Content, null, /* @__PURE__ */ React.createElement(DropdownMenu.Viewport, null, /* @__PURE__ */ React.createElement(DropdownMenu.Item, {
73
16
  onClick: () => onCellInsert?.("script", cell?.id)
74
- }, t("notebook-cell-insert-script.label")), /* @__PURE__ */ React2.createElement(DropdownMenu.Item, {
17
+ }, t("notebook-cell-insert-script.label")), /* @__PURE__ */ React.createElement(DropdownMenu.Item, {
75
18
  onClick: () => onCellInsert?.("prompt", cell?.id)
76
- }, t("notebook-cell-insert-prompt.label")), /* @__PURE__ */ React2.createElement(DropdownMenu.Item, {
19
+ }, t("notebook-cell-insert-prompt.label")), /* @__PURE__ */ React.createElement(DropdownMenu.Item, {
77
20
  onClick: () => onCellInsert?.("query", cell?.id)
78
- }, t("notebook-cell-insert-query.label")), /* @__PURE__ */ React2.createElement(DropdownMenu.Item, {
21
+ }, t("notebook-cell-insert-query.label")), /* @__PURE__ */ React.createElement(DropdownMenu.Item, {
79
22
  onClick: () => onCellInsert?.("markdown", cell?.id)
80
- }, t("notebook-cell-insert-markdown.label")), cell && onCellDelete && /* @__PURE__ */ React2.createElement(DropdownMenu.Item, {
23
+ }, t("notebook-cell-insert-markdown.label")), cell && onCellDelete && /* @__PURE__ */ React.createElement(DropdownMenu.Item, {
81
24
  onClick: () => onCellDelete?.(cell.id)
82
- }, t("notebook-cell-delete.label"))), /* @__PURE__ */ React2.createElement(DropdownMenu.Arrow, null)));
25
+ }, t("notebook-cell-delete.label"))), /* @__PURE__ */ React.createElement(DropdownMenu.Arrow, null)));
83
26
  };
84
27
 
85
28
  // src/components/NotebookStack/NotebookStack.tsx
86
- import React5 from "react";
29
+ import React4 from "react";
87
30
  import { DropdownMenu as DropdownMenu2, IconButton, useTranslation as useTranslation3 } from "@dxos/react-ui";
31
+ import { composable as composable2, composableProps as composableProps2 } from "@dxos/react-ui";
88
32
  import { Stack, StackItem } from "@dxos/react-ui-stack";
89
- import { composable as composable2, composableProps as composableProps2 } from "@dxos/ui-theme";
90
33
  import { meta as meta3 } from "#meta";
91
34
 
92
35
  // src/components/NotebookStack/NotebookCell.tsx
93
- import React4, { useCallback, useMemo } from "react";
36
+ import React3, { useCallback, useMemo } from "react";
94
37
  import { Surface } from "@dxos/app-framework/ui";
95
38
  import { AppSurface } from "@dxos/app-toolkit/ui";
96
39
  import { Obj } from "@dxos/echo";
97
40
  import { createDocAccessor } from "@dxos/echo-db";
98
- import { invariant as invariant2 } from "@dxos/invariant";
41
+ import { invariant } from "@dxos/invariant";
99
42
  import { TemplateEditor } from "@dxos/plugin-assistant/components";
100
43
  import { useThemeContext as useThemeContext2, useTranslation as useTranslation2 } from "@dxos/react-ui";
101
44
  import { QueryEditor } from "@dxos/react-ui-components";
102
45
  import { Editor } from "@dxos/react-ui-editor";
103
46
  import { createBasicExtensions as createBasicExtensions2, createDataExtensions, createMarkdownExtensions, createThemeExtensions as createThemeExtensions2, decorateMarkdown } from "@dxos/ui-editor";
104
- import { mx as mx2 } from "@dxos/ui-theme";
47
+ import { mx } from "@dxos/ui-theme";
105
48
  import { isNonNullable as isNonNullable2 } from "@dxos/util";
106
49
  import { meta as meta2 } from "#meta";
107
50
 
@@ -116,12 +59,12 @@ import { tags } from "@lezer/highlight";
116
59
  import { composeRefs } from "@radix-ui/react-compose-refs";
117
60
  import { continueKeymap } from "@valtown/codemirror-continue";
118
61
  import { tsAutocomplete, tsFacet, tsHover, tsLinter, tsSync } from "@valtown/codemirror-ts";
119
- import React3 from "react";
62
+ import React2 from "react";
120
63
  import { useThemeContext } from "@dxos/react-ui";
64
+ import { composable, composableProps } from "@dxos/react-ui";
121
65
  import { useTextEditor } from "@dxos/react-ui-editor";
122
66
  import { Domino } from "@dxos/ui";
123
67
  import { InputModeExtensions, createBasicExtensions, createThemeExtensions, defaultStyles } from "@dxos/ui-editor";
124
- import { composable, composableProps } from "@dxos/ui-theme";
125
68
  import { isNonNullable } from "@dxos/util";
126
69
  var TypescriptEditor = composable(({ classNames, id, role = "article", inputMode = "vscode", env, options, initialValue, extensions, scrollTo, selection, ...props }, forwardedRef) => {
127
70
  const { themeMode } = useThemeContext();
@@ -182,7 +125,7 @@ var TypescriptEditor = composable(({ classNames, id, role = "article", inputMode
182
125
  scrollTo,
183
126
  env
184
127
  ]);
185
- return /* @__PURE__ */ React3.createElement("div", {
128
+ return /* @__PURE__ */ React2.createElement("div", {
186
129
  ...composableProps(props, {
187
130
  classNames,
188
131
  ...focusAttributes
@@ -215,7 +158,7 @@ var createTooltipRenderer = (themeMode) => {
215
158
  };
216
159
 
217
160
  // src/components/NotebookStack/NotebookCell.tsx
218
- var __dxlog_file2 = "/__w/dxos/dxos/packages/plugins/plugin-script/src/components/NotebookStack/NotebookCell.tsx";
161
+ var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-script/src/components/NotebookStack/NotebookCell.tsx";
219
162
  var editorStyles = "p-2 ps-3";
220
163
  var valueStyles = "p-1 ps-3";
221
164
  var NotebookCell = ({ db, graph, dragging, cell, promptResults, env }) => {
@@ -234,7 +177,7 @@ var NotebookCell = ({ db, graph, dragging, cell, promptResults, env }) => {
234
177
  ]);
235
178
  const explorerGraph = cell.graph?.target;
236
179
  const handleQueryChange = useCallback((value) => {
237
- invariant2(cell.source?.target, void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file2, L: 38, S: void 0, A: ["cell.source?.target", ""] });
180
+ invariant(cell.source?.target, void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 38, S: void 0, A: ["cell.source?.target", ""] });
238
181
  Obj.update(cell.source.target, (obj) => {
239
182
  obj.content = value;
240
183
  });
@@ -246,7 +189,7 @@ var NotebookCell = ({ db, graph, dragging, cell, promptResults, env }) => {
246
189
  if (!cell.source?.target) {
247
190
  return null;
248
191
  }
249
- return /* @__PURE__ */ React4.createElement(NotebookTextEditor, {
192
+ return /* @__PURE__ */ React3.createElement(NotebookTextEditor, {
250
193
  id: cell.id,
251
194
  classNames: editorStyles,
252
195
  initialValue: cell.source.target.content,
@@ -256,7 +199,7 @@ var NotebookCell = ({ db, graph, dragging, cell, promptResults, env }) => {
256
199
  if (!cell.source?.target) {
257
200
  return null;
258
201
  }
259
- return /* @__PURE__ */ React4.createElement(React4.Fragment, null, /* @__PURE__ */ React4.createElement(TypescriptEditor, {
202
+ return /* @__PURE__ */ React3.createElement(React3.Fragment, null, /* @__PURE__ */ React3.createElement(TypescriptEditor, {
260
203
  id: cell.id,
261
204
  role: "section",
262
205
  classNames: editorStyles,
@@ -268,7 +211,7 @@ var NotebookCell = ({ db, graph, dragging, cell, promptResults, env }) => {
268
211
  highlightActiveLine: false,
269
212
  lineNumbers: false
270
213
  }
271
- }), /* @__PURE__ */ React4.createElement(NotebookCellValue, {
214
+ }), /* @__PURE__ */ React3.createElement(NotebookCellValue, {
272
215
  cell,
273
216
  graph
274
217
  }));
@@ -276,9 +219,9 @@ var NotebookCell = ({ db, graph, dragging, cell, promptResults, env }) => {
276
219
  if (!cell.source?.target) {
277
220
  return null;
278
221
  }
279
- return /* @__PURE__ */ React4.createElement("div", {
280
- className: mx2("h-full overflow-hidden grid", explorerGraph && !dragging && "grid-rows-[min-content_1fr]")
281
- }, /* @__PURE__ */ React4.createElement(QueryEditor, {
222
+ return /* @__PURE__ */ React3.createElement("div", {
223
+ className: mx("h-full overflow-hidden grid", explorerGraph && !dragging && "grid-rows-[min-content_1fr]")
224
+ }, /* @__PURE__ */ React3.createElement(QueryEditor, {
282
225
  id: cell.id,
283
226
  classNames: [
284
227
  editorStyles,
@@ -287,7 +230,7 @@ var NotebookCell = ({ db, graph, dragging, cell, promptResults, env }) => {
287
230
  db,
288
231
  value: cell.source.target.content,
289
232
  onChange: handleQueryChange
290
- }), explorerGraph && !dragging && /* @__PURE__ */ React4.createElement(Surface.Surface, {
233
+ }), explorerGraph && !dragging && /* @__PURE__ */ React3.createElement(Surface.Surface, {
291
234
  type: AppSurface.Section,
292
235
  limit: 1,
293
236
  data: {
@@ -300,12 +243,12 @@ var NotebookCell = ({ db, graph, dragging, cell, promptResults, env }) => {
300
243
  if (!cell.prompt?.target) {
301
244
  return null;
302
245
  }
303
- return /* @__PURE__ */ React4.createElement(React4.Fragment, null, /* @__PURE__ */ React4.createElement(TemplateEditor, {
246
+ return /* @__PURE__ */ React3.createElement(React3.Fragment, null, /* @__PURE__ */ React3.createElement(TemplateEditor, {
304
247
  id: cell.id,
305
- template: cell.prompt.target.instructions,
248
+ source: cell.prompt.target.instructions,
306
249
  lineNumbers: false,
307
250
  classNames: editorStyles
308
- }), /* @__PURE__ */ React4.createElement(NotebookPromptResult, {
251
+ }), /* @__PURE__ */ React3.createElement(NotebookPromptResult, {
309
252
  cell,
310
253
  promptResults
311
254
  }));
@@ -319,25 +262,25 @@ var NotebookCellValue = ({ cell, graph }) => {
319
262
  if (value == null) {
320
263
  return null;
321
264
  }
322
- return /* @__PURE__ */ React4.createElement("div", {
323
- className: mx2("flex w-full bg-group-surface border-y border-subdued-separator text-description font-mono", valueStyles)
324
- }, name && /* @__PURE__ */ React4.createElement(React4.Fragment, null, /* @__PURE__ */ React4.createElement("span", {
265
+ return /* @__PURE__ */ React3.createElement("div", {
266
+ className: mx("flex w-full bg-group-surface border-y border-subdued-separator text-description font-mono", valueStyles)
267
+ }, name && /* @__PURE__ */ React3.createElement(React3.Fragment, null, /* @__PURE__ */ React3.createElement("span", {
325
268
  className: "text-success-text"
326
- }, name), /* @__PURE__ */ React4.createElement("span", {
269
+ }, name), /* @__PURE__ */ React3.createElement("span", {
327
270
  className: "text-description"
328
- }, "\xA0=\xA0")), /* @__PURE__ */ React4.createElement("span", null, value));
271
+ }, "\xA0=\xA0")), /* @__PURE__ */ React3.createElement("span", null, value));
329
272
  };
330
273
  var NotebookPromptResult = ({ cell, promptResults }) => {
331
274
  if (!cell.prompt) {
332
275
  return null;
333
276
  }
334
- const value = promptResults?.[cell.prompt.dxn.toString()];
277
+ const value = promptResults?.[cell.prompt.uri];
335
278
  if (value == null) {
336
279
  return null;
337
280
  }
338
- return /* @__PURE__ */ React4.createElement("div", {
339
- className: mx2("flex w-full bg-group-surface text-description border-y border-subdued-separator", valueStyles)
340
- }, /* @__PURE__ */ React4.createElement(NotebookTextEditor, {
281
+ return /* @__PURE__ */ React3.createElement("div", {
282
+ className: mx("flex w-full bg-group-surface text-description border-y border-subdued-separator", valueStyles)
283
+ }, /* @__PURE__ */ React3.createElement(NotebookTextEditor, {
341
284
  readOnly: true,
342
285
  value
343
286
  }));
@@ -362,7 +305,7 @@ var NotebookTextEditor = ({ extensions: extensionsProp, readOnly, ...props }) =>
362
305
  }, [
363
306
  extensionsProp
364
307
  ]);
365
- return /* @__PURE__ */ React4.createElement(Editor.Root, null, /* @__PURE__ */ React4.createElement(Editor.View, {
308
+ return /* @__PURE__ */ React3.createElement(Editor.Root, null, /* @__PURE__ */ React3.createElement(Editor.View, {
366
309
  ...props,
367
310
  extensions,
368
311
  selectionEnd: true
@@ -380,14 +323,14 @@ var NotebookStack = composable2(({ notebook, onRearrange, db, graph, promptResul
380
323
  onCellDelete,
381
324
  env
382
325
  };
383
- return /* @__PURE__ */ React5.createElement(Stack, {
326
+ return /* @__PURE__ */ React4.createElement(Stack, {
384
327
  ...composableProps2(props),
385
328
  orientation: "vertical",
386
329
  size: "contain",
387
330
  rail: true,
388
331
  onRearrange,
389
332
  ref: forwardedRef
390
- }, notebook?.cells.map((cell, i) => /* @__PURE__ */ React5.createElement(NotebookSection, {
333
+ }, notebook?.cells.map((cell, i) => /* @__PURE__ */ React4.createElement(NotebookSection, {
391
334
  key: i,
392
335
  cell,
393
336
  ...sectionProps
@@ -396,41 +339,41 @@ var NotebookStack = composable2(({ notebook, onRearrange, db, graph, promptResul
396
339
  var NotebookSection = ({ cell, db, env, promptResults, onCellInsert, onCellDelete, ...props }) => {
397
340
  const { t } = useTranslation3(meta3.id);
398
341
  const resizable = cell.type === "query";
399
- return /* @__PURE__ */ React5.createElement(StackItem.Root, {
342
+ return /* @__PURE__ */ React4.createElement(StackItem.Root, {
400
343
  role: "section",
401
344
  item: cell,
402
345
  draggable: true,
403
346
  classNames: resizable && minSectionHeight
404
- }, /* @__PURE__ */ React5.createElement(StackItem.Heading, {
347
+ }, /* @__PURE__ */ React4.createElement(StackItem.Heading, {
405
348
  classNames: "h-full p-1 justify-between dx-attention-surface"
406
- }, /* @__PURE__ */ React5.createElement(StackItem.DragHandle, {
349
+ }, /* @__PURE__ */ React4.createElement(StackItem.DragHandle, {
407
350
  asChild: true
408
- }, /* @__PURE__ */ React5.createElement(IconButton, {
351
+ }, /* @__PURE__ */ React4.createElement(IconButton, {
409
352
  variant: "ghost",
410
353
  icon: "ph--dots-six-vertical--regular",
411
354
  iconOnly: true,
412
355
  label: "Drag handle"
413
- })), /* @__PURE__ */ React5.createElement(DropdownMenu2.Root, null, /* @__PURE__ */ React5.createElement(DropdownMenu2.Trigger, {
356
+ })), /* @__PURE__ */ React4.createElement(DropdownMenu2.Root, null, /* @__PURE__ */ React4.createElement(DropdownMenu2.Trigger, {
414
357
  asChild: true
415
- }, /* @__PURE__ */ React5.createElement(IconButton, {
358
+ }, /* @__PURE__ */ React4.createElement(IconButton, {
416
359
  variant: "ghost",
417
360
  icon: "ph--dots-three--regular",
418
361
  iconOnly: true,
419
362
  label: t("notebook-cell-insert.label")
420
- })), /* @__PURE__ */ React5.createElement(NotebookMenu, {
363
+ })), /* @__PURE__ */ React4.createElement(NotebookMenu, {
421
364
  cell,
422
365
  onCellInsert,
423
366
  onCellDelete
424
- })), resizable && /* @__PURE__ */ React5.createElement(StackItem.ResizeHandle, null)), /* @__PURE__ */ React5.createElement(StackItem.DragPreview, null, ({ item: cell2 }) => /* @__PURE__ */ React5.createElement(StackItem.Content, {
367
+ })), resizable && /* @__PURE__ */ React4.createElement(StackItem.ResizeHandle, null)), /* @__PURE__ */ React4.createElement(StackItem.DragPreview, null, ({ item: cell2 }) => /* @__PURE__ */ React4.createElement(StackItem.Content, {
425
368
  classNames: "overflow-visible bg-group-surface border border-subdued-separator"
426
- }, /* @__PURE__ */ React5.createElement(NotebookCell, {
369
+ }, /* @__PURE__ */ React4.createElement(NotebookCell, {
427
370
  db,
428
371
  cell: cell2,
429
372
  env,
430
373
  dragging: true
431
- }))), /* @__PURE__ */ React5.createElement(StackItem.Content, {
374
+ }))), /* @__PURE__ */ React4.createElement(StackItem.Content, {
432
375
  classNames: "overflow-visible"
433
- }, /* @__PURE__ */ React5.createElement(NotebookCell, {
376
+ }, /* @__PURE__ */ React4.createElement(NotebookCell, {
434
377
  db,
435
378
  cell,
436
379
  env,
@@ -440,8 +383,8 @@ var NotebookSection = ({ cell, db, env, promptResults, onCellInsert, onCellDelet
440
383
  };
441
384
 
442
385
  // src/components/QueryEditor/QueryEditor.tsx
443
- import React6, { useState } from "react";
444
- import { ScriptTarget } from "typescript";
386
+ import React5, { useState } from "react";
387
+ import { ModuleResolutionKind, ScriptTarget } from "typescript";
445
388
  import queryApi from "@dxos/echo-query/api.d.ts?raw";
446
389
  import { useAsyncEffect } from "@dxos/react-ui";
447
390
  var GLOBALS = `
@@ -464,7 +407,9 @@ var QueryEditor2 = (props) => {
464
407
  lib: [
465
408
  "ES5"
466
409
  ],
467
- target: ScriptTarget.ES2022
410
+ target: ScriptTarget.ES2022,
411
+ // Avoid `@typescript/vfs`'s deprecated `node10` default (rejected by TS 6).
412
+ moduleResolution: ModuleResolutionKind.Bundler
468
413
  });
469
414
  await compiler2.initialize(GLOBALS);
470
415
  setCompiler(compiler2);
@@ -472,7 +417,7 @@ var QueryEditor2 = (props) => {
472
417
  if (!compiler) {
473
418
  return null;
474
419
  }
475
- return /* @__PURE__ */ React6.createElement(TypescriptEditor, {
420
+ return /* @__PURE__ */ React5.createElement(TypescriptEditor, {
476
421
  ...props,
477
422
  env: compiler.environment
478
423
  });
@@ -480,10 +425,10 @@ var QueryEditor2 = (props) => {
480
425
 
481
426
  // src/components/ScriptToolbar/ScriptToolbar.tsx
482
427
  import { Atom } from "@effect-atom/atom-react";
483
- import React7, { useMemo as useMemo2 } from "react";
428
+ import React6, { useMemo as useMemo2 } from "react";
484
429
  import { ElevationProvider, useTranslation as useTranslation4 } from "@dxos/react-ui";
430
+ import { composable as composable3, composableProps as composableProps3 } from "@dxos/react-ui";
485
431
  import { Menu, createGapSeparator, useMenuActions } from "@dxos/react-ui-menu";
486
- import { composable as composable3, composableProps as composableProps3 } from "@dxos/ui-theme";
487
432
  import { createDeploy, createFormat, createTemplateSelect, useDeployDeps } from "#hooks";
488
433
  import { meta as meta4 } from "#meta";
489
434
  var ScriptToolbar = composable3(({ script, attendableId, role, state, ...props }, forwardedRef) => {
@@ -503,12 +448,12 @@ var ScriptToolbar = composable3(({ script, attendableId, role, state, ...props }
503
448
  t
504
449
  ]);
505
450
  const menuActions = useMenuActions(menuCreator);
506
- return /* @__PURE__ */ React7.createElement(ElevationProvider, {
451
+ return /* @__PURE__ */ React6.createElement(ElevationProvider, {
507
452
  elevation: role === "section" ? "positioned" : "base"
508
- }, /* @__PURE__ */ React7.createElement(Menu.Root, {
453
+ }, /* @__PURE__ */ React6.createElement(Menu.Root, {
509
454
  ...menuActions,
510
455
  attendableId
511
- }, /* @__PURE__ */ React7.createElement(Menu.Toolbar, {
456
+ }, /* @__PURE__ */ React6.createElement(Menu.Toolbar, {
512
457
  ...composableProps3(props),
513
458
  ref: forwardedRef
514
459
  })));
@@ -540,20 +485,21 @@ var createToolbarActions = ({ state, script, ...options }) => Atom.make((get) =>
540
485
  });
541
486
 
542
487
  // src/components/TestPanel/TestPanel.tsx
543
- import React8, { forwardRef, useRef as useRef2, useState as useState2 } from "react";
544
- import { log as log2 } from "@dxos/log";
488
+ import React7, { forwardRef, useRef, useState as useState2 } from "react";
489
+ import { log } from "@dxos/log";
545
490
  import { Avatar, Icon, Input, ScrollArea, Toolbar, useTranslation as useTranslation5 } from "@dxos/react-ui";
491
+ import { composable as composable4, composableProps as composableProps4 } from "@dxos/react-ui";
546
492
  import { JsonHighlighter } from "@dxos/react-ui-syntax-highlighter";
547
- import { composable as composable4, composableProps as composableProps4, mx as mx3 } from "@dxos/ui-theme";
493
+ import { mx as mx2 } from "@dxos/ui-theme";
548
494
  import { meta as meta5 } from "#meta";
549
- var __dxlog_file3 = "/__w/dxos/dxos/packages/plugins/plugin-script/src/components/TestPanel/TestPanel.tsx";
495
+ var __dxlog_file2 = "/__w/dxos/dxos/packages/plugins/plugin-script/src/components/TestPanel/TestPanel.tsx";
550
496
  var TestPanel = composable4(({ classNames, onInvoke, ...props }, forwardedRef) => {
551
497
  const { t } = useTranslation5(meta5.id);
552
- const inputRef = useRef2(null);
498
+ const inputRef = useRef(null);
553
499
  const [input, setInput] = useState2("");
554
500
  const [state, setState] = useState2(null);
555
501
  const [history, setHistory] = useState2([]);
556
- const scrollerRef = useRef2(null);
502
+ const scrollerRef = useRef(null);
557
503
  const handleScroll = () => {
558
504
  if (scrollerRef.current) {
559
505
  scrollerRef.current.scrollTop = scrollerRef.current.scrollHeight;
@@ -624,10 +570,10 @@ var TestPanel = composable4(({ classNames, onInvoke, ...props }, forwardedRef) =
624
570
  handleResponse({
625
571
  error
626
572
  });
627
- log2.catch(err, void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file3, L: 89, S: void 0 });
573
+ log.catch(err, void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file2, L: 90, S: void 0 });
628
574
  }
629
575
  };
630
- return /* @__PURE__ */ React8.createElement("div", {
576
+ return /* @__PURE__ */ React7.createElement("div", {
631
577
  ...composableProps4(props, {
632
578
  classNames: [
633
579
  "flex flex-col h-full overflow-hidden",
@@ -635,23 +581,23 @@ var TestPanel = composable4(({ classNames, onInvoke, ...props }, forwardedRef) =
635
581
  ]
636
582
  }),
637
583
  ref: forwardedRef
638
- }, /* @__PURE__ */ React8.createElement(MessageThread, {
584
+ }, /* @__PURE__ */ React7.createElement(MessageThread, {
639
585
  ref: scrollerRef,
640
586
  state,
641
587
  history
642
- }), /* @__PURE__ */ React8.createElement(Toolbar.Root, null, /* @__PURE__ */ React8.createElement(Input.Root, null, /* @__PURE__ */ React8.createElement(Input.TextInput, {
588
+ }), /* @__PURE__ */ React7.createElement(Toolbar.Root, null, /* @__PURE__ */ React7.createElement(Input.Root, null, /* @__PURE__ */ React7.createElement(Input.TextInput, {
643
589
  ref: inputRef,
644
590
  autoFocus: true,
645
591
  placeholder: t("function-request.placeholder"),
646
592
  value: input,
647
593
  onChange: (ev) => setInput(ev.target.value),
648
594
  onKeyDown: (ev) => ev.key === "Enter" && handleRequest(input)
649
- })), /* @__PURE__ */ React8.createElement(Toolbar.IconButton, {
595
+ })), /* @__PURE__ */ React7.createElement(Toolbar.IconButton, {
650
596
  icon: "ph--play--regular",
651
597
  label: "Execute",
652
598
  iconOnly: true,
653
599
  onClick: () => handleRequest(input)
654
- }), /* @__PURE__ */ React8.createElement(Toolbar.IconButton, {
600
+ }), /* @__PURE__ */ React7.createElement(Toolbar.IconButton, {
655
601
  icon: "ph--trash--regular",
656
602
  label: "Clear",
657
603
  iconOnly: true,
@@ -659,26 +605,26 @@ var TestPanel = composable4(({ classNames, onInvoke, ...props }, forwardedRef) =
659
605
  })));
660
606
  });
661
607
  var MessageThread = /* @__PURE__ */ forwardRef(({ state, history }, forwardedRef) => {
662
- return /* @__PURE__ */ React8.createElement(ScrollArea.Root, {
608
+ return /* @__PURE__ */ React7.createElement(ScrollArea.Root, {
663
609
  orientation: "vertical",
664
610
  classNames: "h-full",
665
611
  ref: forwardedRef
666
- }, /* @__PURE__ */ React8.createElement(ScrollArea.Viewport, {
612
+ }, /* @__PURE__ */ React7.createElement(ScrollArea.Viewport, {
667
613
  classNames: "gap-6 p-2"
668
- }, history.map((message, i) => /* @__PURE__ */ React8.createElement("div", {
614
+ }, history.map((message, i) => /* @__PURE__ */ React7.createElement("div", {
669
615
  key: i,
670
616
  className: "grid grid-cols-[2rem_1fr_2rem]"
671
- }, /* @__PURE__ */ React8.createElement("div", {
617
+ }, /* @__PURE__ */ React7.createElement("div", {
672
618
  className: "p-1"
673
- }, message.type === "response" && /* @__PURE__ */ React8.createElement(RobotAvatar, null)), /* @__PURE__ */ React8.createElement("div", {
619
+ }, message.type === "response" && /* @__PURE__ */ React7.createElement(RobotAvatar, null)), /* @__PURE__ */ React7.createElement("div", {
674
620
  className: "overflow-auto"
675
- }, /* @__PURE__ */ React8.createElement(MessageItem, {
621
+ }, /* @__PURE__ */ React7.createElement(MessageItem, {
676
622
  message
677
- })))), state === "pending" && /* @__PURE__ */ React8.createElement("div", {
623
+ })))), state === "pending" && /* @__PURE__ */ React7.createElement("div", {
678
624
  className: "grid grid-cols-[2rem_1fr_2rem]"
679
- }, /* @__PURE__ */ React8.createElement("div", {
625
+ }, /* @__PURE__ */ React7.createElement("div", {
680
626
  className: "p-1"
681
- }, /* @__PURE__ */ React8.createElement(Icon, {
627
+ }, /* @__PURE__ */ React7.createElement(Icon, {
682
628
  icon: "ph--spinner--regular",
683
629
  size: 6,
684
630
  classNames: "animate-spin"
@@ -687,18 +633,18 @@ var MessageThread = /* @__PURE__ */ forwardRef(({ state, history }, forwardedRef
687
633
  var MessageItem = ({ classNames, message }) => {
688
634
  const { type, text, data, error } = message;
689
635
  const wrapper = "p-1 px-2 rounded-md bg-hover-surface overflow-auto";
690
- return /* @__PURE__ */ React8.createElement("div", {
691
- className: mx3("flex", type === "request" ? "ml-[1rem] justify-end" : "mr-[1rem]", classNames)
692
- }, error && /* @__PURE__ */ React8.createElement("div", {
693
- className: mx3(wrapper, "whitespace-pre text-error-text")
694
- }, String(error)), text !== void 0 && /* @__PURE__ */ React8.createElement("div", {
695
- className: mx3(wrapper, type === "request" && "bg-primary-500 dark:bg-primary-600")
696
- }, text || "\xD8"), data && /* @__PURE__ */ React8.createElement(JsonHighlighter, {
636
+ return /* @__PURE__ */ React7.createElement("div", {
637
+ className: mx2("flex", type === "request" ? "ml-[1rem] justify-end" : "mr-[1rem]", classNames)
638
+ }, error && /* @__PURE__ */ React7.createElement("div", {
639
+ className: mx2(wrapper, "whitespace-pre text-error-text")
640
+ }, String(error)), text !== void 0 && /* @__PURE__ */ React7.createElement("div", {
641
+ className: mx2(wrapper, type === "request" && "bg-primary-500 dark:bg-primary-600")
642
+ }, text || "\xD8"), data && /* @__PURE__ */ React7.createElement(JsonHighlighter, {
697
643
  data,
698
- classNames: mx3(wrapper, "text-xs")
644
+ classNames: mx2(wrapper, "text-xs")
699
645
  }));
700
646
  };
701
- var RobotAvatar = () => /* @__PURE__ */ React8.createElement(Avatar.Root, null, /* @__PURE__ */ React8.createElement(Avatar.Content, {
647
+ var RobotAvatar = () => /* @__PURE__ */ React7.createElement(Avatar.Root, null, /* @__PURE__ */ React7.createElement(Avatar.Content, {
702
648
  size: 6,
703
649
  variant: "circle",
704
650
  icon: "ph--drone--regular"
@@ -707,7 +653,6 @@ var RobotAvatar = () => /* @__PURE__ */ React8.createElement(Avatar.Root, null,
707
653
  // src/components/index.ts
708
654
  var ScriptPluginSettings = lazy(() => import("../ScriptPluginSettings-T4JMUSHN.mjs"));
709
655
  export {
710
- FramePanel,
711
656
  NotebookMenu,
712
657
  NotebookStack,
713
658
  QueryEditor2 as QueryEditor,