@dxos/plugin-script 0.8.4-main.c85a9c8dae → 0.8.4-main.dfabb4ec29
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.
- package/dist/lib/{browser/DeploymentDialog-IIOXAS47.mjs → neutral/DeploymentDialog-6DBF3V6C.mjs} +22 -48
- package/dist/lib/neutral/DeploymentDialog-6DBF3V6C.mjs.map +7 -0
- package/dist/lib/{browser/NotebookContainer-VVZOKGRC.mjs → neutral/NotebookContainer-FIAQI3A2.mjs} +49 -139
- package/dist/lib/neutral/NotebookContainer-FIAQI3A2.mjs.map +7 -0
- package/dist/lib/{browser/ScriptContainer-A5SSIUH6.mjs → neutral/ScriptContainer-2OPBAXFB.mjs} +13 -27
- package/dist/lib/neutral/ScriptContainer-2OPBAXFB.mjs.map +7 -0
- package/dist/lib/neutral/ScriptPlugin.mjs +39 -0
- package/dist/lib/neutral/ScriptPlugin.mjs.map +7 -0
- package/dist/lib/neutral/ScriptPlugin.node.mjs +27 -0
- package/dist/lib/neutral/ScriptPlugin.node.mjs.map +7 -0
- package/dist/lib/neutral/ScriptPluginSettings-T4JMUSHN.mjs +31 -0
- package/dist/lib/neutral/ScriptPluginSettings-T4JMUSHN.mjs.map +7 -0
- package/dist/lib/neutral/ScriptProperties-F6NE6M4H.mjs +296 -0
- package/dist/lib/neutral/ScriptProperties-F6NE6M4H.mjs.map +7 -0
- package/dist/lib/neutral/TestContainer-JNFPLAJX.mjs +44 -0
- package/dist/lib/neutral/TestContainer-JNFPLAJX.mjs.map +7 -0
- package/dist/lib/neutral/access-token-created-ENMCEGVU.mjs +34 -0
- package/dist/lib/neutral/access-token-created-ENMCEGVU.mjs.map +7 -0
- package/dist/lib/neutral/app-graph-builder-7AWFCEQF.mjs +52 -0
- package/dist/lib/neutral/app-graph-builder-7AWFCEQF.mjs.map +7 -0
- package/dist/lib/{browser/blueprint-definition-YMZEJBAZ.mjs → neutral/blueprint-definition-T33SBPP2.mjs} +4 -6
- package/dist/lib/neutral/blueprint-definition-T33SBPP2.mjs.map +7 -0
- package/dist/lib/{browser → neutral}/blueprints/index.mjs +3 -1
- package/dist/lib/neutral/capabilities/index.mjs +21 -0
- package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
- package/dist/lib/neutral/capabilities/node.mjs +17 -0
- package/dist/lib/neutral/capabilities/node.mjs.map +7 -0
- package/dist/lib/neutral/chunk-2DMPFVUM.mjs +8 -0
- package/dist/lib/neutral/chunk-2DMPFVUM.mjs.map +7 -0
- package/dist/lib/{browser/chunk-G3XIOLLI.mjs → neutral/chunk-4RJALG6K.mjs} +21 -44
- package/dist/lib/neutral/chunk-4RJALG6K.mjs.map +7 -0
- package/dist/lib/neutral/chunk-B4FVQEHV.mjs +8 -0
- package/dist/lib/neutral/chunk-B4FVQEHV.mjs.map +7 -0
- package/dist/lib/neutral/chunk-BDRB6ZX2.mjs +52 -0
- package/dist/lib/neutral/chunk-BDRB6ZX2.mjs.map +7 -0
- package/dist/lib/{browser/chunk-J7PGML5B.mjs → neutral/chunk-BUKQITZT.mjs} +29 -29
- package/dist/lib/neutral/chunk-BUKQITZT.mjs.map +7 -0
- package/dist/lib/{browser/chunk-ATTZUDT7.mjs → neutral/chunk-D7DFASAE.mjs} +5 -20
- package/dist/lib/neutral/chunk-D7DFASAE.mjs.map +7 -0
- package/dist/lib/neutral/chunk-MI6X5CTJ.mjs +336 -0
- package/dist/lib/neutral/chunk-MI6X5CTJ.mjs.map +7 -0
- package/dist/lib/neutral/chunk-P2F3STZN.mjs +8 -0
- package/dist/lib/neutral/chunk-P2F3STZN.mjs.map +7 -0
- package/dist/lib/neutral/chunk-PDB6UOSB.mjs +125 -0
- package/dist/lib/neutral/chunk-PDB6UOSB.mjs.map +7 -0
- package/dist/lib/{browser/chunk-WYR4QHPE.mjs → neutral/chunk-UYR3YH4Q.mjs} +3 -3
- package/dist/lib/{browser/chunk-WYR4QHPE.mjs.map → neutral/chunk-UYR3YH4Q.mjs.map} +3 -3
- package/dist/lib/{browser/compiler-53G6ZHQM.mjs → neutral/compiler-SMVIP5UN.mjs} +24 -22
- package/dist/lib/neutral/compiler-SMVIP5UN.mjs.map +7 -0
- package/dist/lib/{browser/chunk-PLDBKKYO.mjs → neutral/components/index.mjs} +163 -233
- package/dist/lib/neutral/components/index.mjs.map +7 -0
- package/dist/lib/neutral/containers/index.mjs +17 -0
- package/dist/lib/neutral/containers/index.mjs.map +7 -0
- package/dist/lib/neutral/create-OZRIZ7RN.mjs +44 -0
- package/dist/lib/neutral/create-OZRIZ7RN.mjs.map +7 -0
- package/dist/lib/neutral/create-object-F2NWICFV.mjs +44 -0
- package/dist/lib/neutral/create-object-F2NWICFV.mjs.map +7 -0
- package/dist/lib/neutral/create-script-VBA3SLSU.mjs +45 -0
- package/dist/lib/neutral/create-script-VBA3SLSU.mjs.map +7 -0
- package/dist/lib/neutral/delete-PAUWA2QM.mjs +21 -0
- package/dist/lib/neutral/delete-PAUWA2QM.mjs.map +7 -0
- package/dist/lib/neutral/deploy-CXVW54JJ.mjs +62 -0
- package/dist/lib/neutral/deploy-CXVW54JJ.mjs.map +7 -0
- package/dist/lib/{browser/chunk-MUEVLYXJ.mjs → neutral/hooks/index.mjs} +52 -80
- package/dist/lib/neutral/hooks/index.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +41 -0
- package/dist/lib/neutral/inspect-invocations-LEOEP5I2.mjs +59 -0
- package/dist/lib/neutral/inspect-invocations-LEOEP5I2.mjs.map +7 -0
- package/dist/lib/neutral/install-function-5N24Q45W.mjs +51 -0
- package/dist/lib/neutral/install-function-5N24Q45W.mjs.map +7 -0
- package/dist/lib/neutral/invoke-5QVEZ3X5.mjs +33 -0
- package/dist/lib/neutral/invoke-5QVEZ3X5.mjs.map +7 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/neutral/meta.mjs +10 -0
- package/dist/lib/neutral/operation-handler-OTCWYDFI.mjs +18 -0
- package/dist/lib/neutral/operation-handler-OTCWYDFI.mjs.map +7 -0
- package/dist/lib/neutral/operations/index.mjs +8 -0
- package/dist/lib/neutral/plugin.mjs +16 -0
- package/dist/lib/neutral/plugin.mjs.map +7 -0
- package/dist/lib/neutral/query-deployed-functions-FVD7NYPA.mjs +30 -0
- package/dist/lib/neutral/query-deployed-functions-FVD7NYPA.mjs.map +7 -0
- package/dist/lib/neutral/react-surface-JH2AOK7V.mjs +117 -0
- package/dist/lib/neutral/react-surface-JH2AOK7V.mjs.map +7 -0
- package/dist/lib/neutral/read-FFOSK6A3.mjs +26 -0
- package/dist/lib/neutral/read-FFOSK6A3.mjs.map +7 -0
- package/dist/lib/{browser/settings-76UM7442.mjs → neutral/settings-VJBW4OMK.mjs} +6 -12
- package/dist/lib/neutral/settings-VJBW4OMK.mjs.map +7 -0
- package/dist/lib/{browser → neutral}/templates/index.mjs +1 -1
- package/dist/lib/neutral/translations.mjs +104 -0
- package/dist/lib/neutral/translations.mjs.map +7 -0
- package/dist/lib/neutral/types/index.mjs +17 -0
- package/dist/lib/neutral/update-PJS5GG3Y.mjs +63 -0
- package/dist/lib/neutral/update-PJS5GG3Y.mjs.map +7 -0
- package/dist/types/src/ScriptPlugin.d.ts +1 -0
- package/dist/types/src/ScriptPlugin.d.ts.map +1 -1
- package/dist/types/src/ScriptPlugin.node.d.ts +4 -0
- package/dist/types/src/ScriptPlugin.node.d.ts.map +1 -0
- package/dist/types/src/ScriptPlugin.test.d.ts +2 -0
- package/dist/types/src/ScriptPlugin.test.d.ts.map +1 -0
- package/dist/types/src/blueprints/functions/create.d.ts +11 -0
- package/dist/types/src/blueprints/functions/create.d.ts.map +1 -0
- package/dist/types/src/blueprints/functions/definitions.d.ts +141 -0
- package/dist/types/src/blueprints/functions/definitions.d.ts.map +1 -0
- package/dist/types/src/blueprints/functions/delete.d.ts +18 -0
- package/dist/types/src/blueprints/functions/delete.d.ts.map +1 -0
- package/dist/types/src/blueprints/functions/deploy.d.ts +22 -0
- package/dist/types/src/blueprints/functions/deploy.d.ts.map +1 -0
- package/dist/types/src/blueprints/functions/index.d.ts +4 -0
- package/dist/types/src/blueprints/functions/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/functions/inspect-invocations.d.ts +29 -0
- package/dist/types/src/blueprints/functions/inspect-invocations.d.ts.map +1 -0
- package/dist/types/src/blueprints/functions/install-function.d.ts +11 -0
- package/dist/types/src/blueprints/functions/install-function.d.ts.map +1 -0
- package/dist/types/src/blueprints/functions/invoke.d.ts +22 -0
- package/dist/types/src/blueprints/functions/invoke.d.ts.map +1 -0
- package/dist/types/src/blueprints/functions/query-deployed-functions.d.ts +13 -0
- package/dist/types/src/blueprints/functions/query-deployed-functions.d.ts.map +1 -0
- package/dist/types/src/blueprints/functions/read.d.ts +22 -0
- package/dist/types/src/blueprints/functions/read.d.ts.map +1 -0
- package/dist/types/src/blueprints/functions/update.d.ts +27 -0
- package/dist/types/src/blueprints/functions/update.d.ts.map +1 -0
- package/dist/types/src/blueprints/script-blueprint.d.ts +2 -2
- package/dist/types/src/blueprints/script-blueprint.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/artifact-definition.d.ts.map +1 -0
- package/dist/types/src/capabilities/blueprint-definition.d.ts +6 -0
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -0
- package/dist/types/src/capabilities/compiler.d.ts +6 -0
- package/dist/types/src/capabilities/compiler.d.ts.map +1 -0
- package/dist/types/src/capabilities/create-object.d.ts +16 -0
- package/dist/types/src/capabilities/create-object.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +19 -6
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/node.d.ts +18 -0
- package/dist/types/src/capabilities/node.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/{settings/settings.d.ts → settings.d.ts} +2 -5
- package/dist/types/src/capabilities/settings.d.ts.map +1 -0
- package/dist/types/src/compiler/compiler.d.ts.map +1 -1
- package/dist/types/src/components/{FrameContainer/FrameContainer.d.ts → FramePanel/FramePanel.d.ts} +3 -3
- package/dist/types/src/components/FramePanel/FramePanel.d.ts.map +1 -0
- package/dist/types/src/components/FramePanel/index.d.ts +2 -0
- package/dist/types/src/components/FramePanel/index.d.ts.map +1 -0
- package/dist/types/src/components/NotebookStack/NotebookCell.d.ts +1 -1
- package/dist/types/src/components/NotebookStack/NotebookCell.d.ts.map +1 -1
- package/dist/types/src/components/NotebookStack/NotebookMenu.d.ts +1 -1
- package/dist/types/src/components/NotebookStack/NotebookMenu.d.ts.map +1 -1
- package/dist/types/src/components/NotebookStack/NotebookStack.d.ts +4 -2
- package/dist/types/src/components/NotebookStack/NotebookStack.d.ts.map +1 -1
- package/dist/types/src/components/NotebookStack/NotebookStack.stories.d.ts +219 -228
- package/dist/types/src/components/NotebookStack/NotebookStack.stories.d.ts.map +1 -1
- package/dist/types/src/components/QueryEditor/QueryEditor.d.ts.map +1 -1
- package/dist/types/src/components/QueryEditor/QueryEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/ScriptPluginSettings/ScriptPluginSettings.d.ts +8 -0
- package/dist/types/src/components/ScriptPluginSettings/ScriptPluginSettings.d.ts.map +1 -0
- package/dist/types/src/components/ScriptPluginSettings/ScriptPluginSettings.stories.d.ts +241 -0
- package/dist/types/src/components/ScriptPluginSettings/ScriptPluginSettings.stories.d.ts.map +1 -0
- package/dist/types/src/components/ScriptPluginSettings/index.d.ts +2 -0
- package/dist/types/src/components/ScriptPluginSettings/index.d.ts.map +1 -0
- package/dist/types/src/components/ScriptToolbar/ScriptToolbar.d.ts +7 -6
- package/dist/types/src/components/ScriptToolbar/ScriptToolbar.d.ts.map +1 -1
- package/dist/types/src/components/ScriptToolbar/ScriptToolbar.stories.d.ts +219 -228
- package/dist/types/src/components/ScriptToolbar/ScriptToolbar.stories.d.ts.map +1 -1
- package/dist/types/src/components/TestPanel/TestPanel.d.ts +4 -2
- package/dist/types/src/components/TestPanel/TestPanel.d.ts.map +1 -1
- package/dist/types/src/components/TypescriptEditor/TypescriptEditor.d.ts +5 -2
- package/dist/types/src/components/TypescriptEditor/TypescriptEditor.d.ts.map +1 -1
- package/dist/types/src/components/TypescriptEditor/TypescriptEditor.stories.d.ts +3 -1
- package/dist/types/src/components/TypescriptEditor/TypescriptEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +3 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/DeploymentDialog/DeploymentDialog.d.ts.map +1 -1
- package/dist/types/src/containers/DeploymentDialog/DeploymentDialog.stories.d.ts +219 -228
- package/dist/types/src/containers/DeploymentDialog/DeploymentDialog.stories.d.ts.map +1 -1
- package/dist/types/src/containers/DeploymentDialog/index.d.ts +1 -2
- package/dist/types/src/containers/DeploymentDialog/index.d.ts.map +1 -1
- package/dist/types/src/containers/NotebookContainer/NotebookContainer.d.ts +5 -5
- package/dist/types/src/containers/NotebookContainer/NotebookContainer.d.ts.map +1 -1
- package/dist/types/src/containers/NotebookContainer/NotebookContainer.stories.d.ts.map +1 -1
- package/dist/types/src/containers/NotebookContainer/index.d.ts +1 -2
- package/dist/types/src/containers/NotebookContainer/index.d.ts.map +1 -1
- package/dist/types/src/containers/ScriptContainer/ScriptContainer.d.ts +7 -7
- package/dist/types/src/containers/ScriptContainer/ScriptContainer.d.ts.map +1 -1
- package/dist/types/src/containers/ScriptContainer/ScriptContainer.stories.d.ts +242 -0
- package/dist/types/src/containers/ScriptContainer/ScriptContainer.stories.d.ts.map +1 -0
- package/dist/types/src/containers/ScriptContainer/index.d.ts +1 -2
- package/dist/types/src/containers/ScriptContainer/index.d.ts.map +1 -1
- package/dist/types/src/containers/ScriptProperties/BlueprintEditor.d.ts +7 -0
- package/dist/types/src/containers/ScriptProperties/BlueprintEditor.d.ts.map +1 -0
- package/dist/types/src/containers/ScriptProperties/FunctionBinding.d.ts +7 -0
- package/dist/types/src/containers/ScriptProperties/FunctionBinding.d.ts.map +1 -0
- package/dist/types/src/containers/ScriptProperties/FunctionPublishing.d.ts +7 -0
- package/dist/types/src/containers/ScriptProperties/FunctionPublishing.d.ts.map +1 -0
- package/dist/types/src/containers/ScriptProperties/ScriptProperties.d.ts +4 -5
- package/dist/types/src/containers/ScriptProperties/ScriptProperties.d.ts.map +1 -1
- package/dist/types/src/containers/ScriptProperties/ScriptProperties.stories.d.ts +242 -0
- package/dist/types/src/containers/ScriptProperties/ScriptProperties.stories.d.ts.map +1 -0
- package/dist/types/src/containers/ScriptProperties/index.d.ts +1 -2
- package/dist/types/src/containers/ScriptProperties/index.d.ts.map +1 -1
- package/dist/types/src/containers/TestContainer/TestContainer.d.ts +1 -1
- package/dist/types/src/containers/TestContainer/TestContainer.d.ts.map +1 -1
- package/dist/types/src/containers/TestContainer/index.d.ts +1 -2
- package/dist/types/src/containers/TestContainer/index.d.ts.map +1 -1
- package/dist/types/src/containers/index.d.ts +0 -2
- package/dist/types/src/containers/index.d.ts.map +1 -1
- package/dist/types/src/hooks/deploy.d.ts +17 -5
- package/dist/types/src/hooks/deploy.d.ts.map +1 -1
- package/dist/types/src/hooks/format.d.ts +1 -1
- package/dist/types/src/hooks/format.d.ts.map +1 -1
- package/dist/types/src/hooks/template.d.ts +1 -1
- package/dist/types/src/hooks/template.d.ts.map +1 -1
- package/dist/types/src/hooks/useCompiler.d.ts.map +1 -1
- package/dist/types/src/hooks/useCreateAndDeployScriptTemplates.d.ts.map +1 -1
- package/dist/types/src/hooks/useToolbarState.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +2 -4
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/notebook/compute-graph.d.ts +1 -1
- package/dist/types/src/notebook/compute-graph.d.ts.map +1 -1
- package/dist/types/src/notebook/eval.d.ts.map +1 -1
- package/dist/types/src/notebook/vfs-parser.d.ts.map +1 -1
- package/dist/types/src/operations/access-token-created.d.ts +5 -0
- package/dist/types/src/operations/access-token-created.d.ts.map +1 -0
- package/dist/types/src/operations/create-script.d.ts +5 -0
- package/dist/types/src/operations/create-script.d.ts.map +1 -0
- package/dist/types/src/operations/index.d.ts +3 -0
- package/dist/types/src/operations/index.d.ts.map +1 -0
- package/dist/types/src/plugin.d.ts +4 -0
- package/dist/types/src/plugin.d.ts.map +1 -0
- package/dist/types/src/templates/anthropic.d.ts +4 -5
- package/dist/types/src/templates/anthropic.d.ts.map +1 -1
- package/dist/types/src/templates/chat.d.ts.map +1 -1
- package/dist/types/src/templates/chess-bot.d.ts +8 -12
- package/dist/types/src/templates/chess-bot.d.ts.map +1 -1
- package/dist/types/src/templates/commentary.d.ts +8 -11
- package/dist/types/src/templates/commentary.d.ts.map +1 -1
- package/dist/types/src/templates/data-generator.d.ts.map +1 -1
- package/dist/types/src/templates/discord.d.ts.map +1 -1
- package/dist/types/src/templates/email.d.ts.map +1 -1
- package/dist/types/src/templates/forex-effect.d.ts +3 -2
- package/dist/types/src/templates/forex-effect.d.ts.map +1 -1
- package/dist/types/src/templates/forex.d.ts +3 -2
- package/dist/types/src/templates/forex.d.ts.map +1 -1
- package/dist/types/src/templates/gmail.d.ts.map +1 -1
- package/dist/types/src/templates/index.d.ts +29 -29
- package/dist/types/src/templates/index.d.ts.map +1 -1
- package/dist/types/src/templates/ping.d.ts +2 -1
- package/dist/types/src/templates/ping.d.ts.map +1 -1
- package/dist/types/src/testing/index.d.ts +2 -1
- package/dist/types/src/testing/index.d.ts.map +1 -1
- package/dist/types/src/testing/test-notebook.d.ts +3 -0
- package/dist/types/src/testing/test-notebook.d.ts.map +1 -0
- package/dist/types/src/testing/test-script.d.ts +7 -0
- package/dist/types/src/testing/test-script.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +222 -92
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Notebook.d.ts +37 -25
- package/dist/types/src/types/Notebook.d.ts.map +1 -1
- package/dist/types/src/types/ScriptCapabilities.d.ts +6 -0
- package/dist/types/src/types/ScriptCapabilities.d.ts.map +1 -0
- package/dist/types/src/types/ScriptEvents.d.ts +3 -0
- package/dist/types/src/types/ScriptEvents.d.ts.map +1 -0
- package/dist/types/src/types/ScriptOperation.d.ts +29 -0
- package/dist/types/src/types/ScriptOperation.d.ts.map +1 -0
- package/dist/types/src/types/Settings.d.ts +7 -0
- package/dist/types/src/types/Settings.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +4 -4
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +1 -5
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/src/util/deploy.d.ts +2 -2
- package/dist/types/src/util/deploy.d.ts.map +1 -1
- package/dist/types/src/util/functions.d.ts +2 -2
- package/dist/types/src/util/functions.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +153 -104
- package/src/ScriptPlugin.node.ts +21 -0
- package/src/ScriptPlugin.test.ts +31 -0
- package/src/ScriptPlugin.tsx +11 -43
- package/src/blueprints/functions/create.ts +47 -0
- package/src/blueprints/functions/definitions.ts +323 -0
- package/src/blueprints/functions/delete.ts +23 -0
- package/src/blueprints/functions/deploy.ts +70 -0
- package/src/blueprints/functions/index.ts +19 -0
- package/src/blueprints/functions/inspect-invocations.ts +56 -0
- package/src/blueprints/functions/install-function.ts +56 -0
- package/src/blueprints/functions/invoke.ts +35 -0
- package/src/blueprints/functions/query-deployed-functions.ts +31 -0
- package/src/blueprints/functions/read.ts +29 -0
- package/src/blueprints/functions/update.ts +68 -0
- package/src/blueprints/script-blueprint.ts +32 -8
- package/src/capabilities/app-graph-builder.ts +47 -0
- package/src/capabilities/{artifact-definition/artifact-definition.ts → artifact-definition.ts} +4 -5
- package/src/capabilities/{blueprint-definition/blueprint-definition.ts → blueprint-definition.ts} +3 -1
- package/src/capabilities/{compiler/compiler.ts → compiler.ts} +17 -9
- package/src/capabilities/create-object.ts +48 -0
- package/src/capabilities/index.ts +14 -6
- package/src/capabilities/node.ts +16 -0
- package/src/capabilities/operation-handler.ts +21 -0
- package/src/capabilities/react-surface.tsx +130 -0
- package/src/capabilities/{settings/settings.ts → settings.ts} +4 -4
- package/src/compiler/compiler.ts +8 -1
- package/src/components/{FrameContainer/FrameContainer.tsx → FramePanel/FramePanel.tsx} +2 -2
- package/src/components/{FrameContainer → FramePanel}/index.ts +1 -1
- package/src/components/NotebookStack/NotebookCell.tsx +23 -12
- package/src/components/NotebookStack/NotebookMenu.tsx +7 -7
- package/src/components/NotebookStack/NotebookStack.stories.tsx +8 -9
- package/src/components/NotebookStack/NotebookStack.tsx +24 -13
- package/src/components/QueryEditor/QueryEditor.stories.tsx +5 -11
- package/src/components/ScriptPluginSettings/ScriptPluginSettings.stories.tsx +32 -0
- package/src/components/ScriptPluginSettings/ScriptPluginSettings.tsx +42 -0
- package/src/components/ScriptPluginSettings/index.ts +5 -0
- package/src/components/ScriptToolbar/ScriptToolbar.stories.tsx +5 -5
- package/src/components/ScriptToolbar/ScriptToolbar.tsx +24 -26
- package/src/components/TestPanel/TestPanel.tsx +91 -177
- package/src/components/TypescriptEditor/TypescriptEditor.stories.tsx +4 -4
- package/src/components/TypescriptEditor/TypescriptEditor.tsx +25 -18
- package/src/components/index.ts +5 -1
- package/src/constants.ts +2 -2
- package/src/containers/DeploymentDialog/DeploymentDialog.stories.tsx +5 -3
- package/src/containers/DeploymentDialog/DeploymentDialog.tsx +26 -26
- package/src/containers/DeploymentDialog/index.ts +1 -3
- package/src/containers/NotebookContainer/NotebookContainer.stories.tsx +21 -23
- package/src/containers/NotebookContainer/NotebookContainer.tsx +39 -53
- package/src/containers/NotebookContainer/index.ts +1 -3
- package/src/containers/ScriptContainer/ScriptContainer.stories.tsx +106 -0
- package/src/containers/ScriptContainer/ScriptContainer.tsx +14 -13
- package/src/containers/ScriptContainer/index.ts +1 -3
- package/src/containers/ScriptProperties/BlueprintEditor.tsx +101 -0
- package/src/containers/ScriptProperties/FunctionBinding.tsx +83 -0
- package/src/containers/ScriptProperties/FunctionPublishing.tsx +121 -0
- package/src/containers/ScriptProperties/ScriptProperties.stories.tsx +75 -0
- package/src/containers/ScriptProperties/ScriptProperties.tsx +12 -21
- package/src/containers/ScriptProperties/index.ts +1 -3
- package/src/containers/TestContainer/TestContainer.tsx +24 -8
- package/src/containers/TestContainer/index.ts +1 -3
- package/src/containers/index.ts +0 -2
- package/src/e2e/ai.test.ts +7 -6
- package/src/e2e/deploy.test.ts +6 -4
- package/src/hooks/deploy.ts +10 -8
- package/src/hooks/format.ts +5 -5
- package/src/hooks/template.ts +7 -6
- package/src/hooks/useCompiler.ts +3 -2
- package/src/hooks/useCreateAndDeployScriptTemplates.ts +4 -3
- package/src/index.ts +2 -5
- package/src/meta.ts +2 -2
- package/src/notebook/compute-graph.test.ts +7 -7
- package/src/notebook/compute-graph.ts +1 -1
- package/src/notebook/vfs-parser.ts +10 -3
- package/src/operations/access-token-created.ts +37 -0
- package/src/operations/create-script.ts +46 -0
- package/src/operations/index.ts +10 -0
- package/src/plugin.ts +11 -0
- package/src/templates/anthropic.ts +19 -12
- package/src/templates/chat.ts +1 -1
- package/src/templates/chess-bot.ts +42 -37
- package/src/templates/commentary.ts +179 -161
- package/src/templates/data-generator.ts +1 -1
- package/src/templates/discord.ts +3 -3
- package/src/templates/forex-effect.ts +30 -19
- package/src/templates/forex.ts +24 -15
- package/src/templates/gmail.ts +4 -4
- package/src/templates/index.ts +18 -18
- package/src/templates/ping.ts +16 -8
- package/src/testing/index.ts +2 -1
- package/src/testing/simulator.test.ts +3 -4
- package/src/testing/{data.ts → test-notebook.ts} +11 -12
- package/src/testing/test-script.ts +29 -0
- package/src/translations.ts +86 -87
- package/src/types/Notebook.ts +9 -5
- package/src/types/ScriptCapabilities.ts +18 -0
- package/src/types/ScriptEvents.ts +11 -0
- package/src/types/ScriptOperation.ts +42 -0
- package/src/types/Settings.ts +20 -0
- package/src/types/index.ts +5 -4
- package/src/types/types.ts +1 -11
- package/src/util/deploy.ts +13 -11
- package/src/util/functions.ts +9 -8
- package/dist/lib/browser/DeploymentDialog-IIOXAS47.mjs.map +0 -7
- package/dist/lib/browser/NotebookContainer-VVZOKGRC.mjs.map +0 -7
- package/dist/lib/browser/ScriptContainer-A5SSIUH6.mjs.map +0 -7
- package/dist/lib/browser/ScriptObjectSettings-HYYC7KXC.mjs +0 -294
- package/dist/lib/browser/ScriptObjectSettings-HYYC7KXC.mjs.map +0 -7
- package/dist/lib/browser/ScriptPluginSettings-UTWA7CBT.mjs +0 -55
- package/dist/lib/browser/ScriptPluginSettings-UTWA7CBT.mjs.map +0 -7
- package/dist/lib/browser/ScriptProperties-HREPUE65.mjs +0 -28
- package/dist/lib/browser/ScriptProperties-HREPUE65.mjs.map +0 -7
- package/dist/lib/browser/TestContainer-D4Y2K2TT.mjs +0 -39
- package/dist/lib/browser/TestContainer-D4Y2K2TT.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-66ZDI72K.mjs +0 -69
- package/dist/lib/browser/app-graph-builder-66ZDI72K.mjs.map +0 -7
- package/dist/lib/browser/blueprint-definition-YMZEJBAZ.mjs.map +0 -7
- package/dist/lib/browser/chunk-6IXFDTAI.mjs +0 -113
- package/dist/lib/browser/chunk-6IXFDTAI.mjs.map +0 -7
- package/dist/lib/browser/chunk-ATTZUDT7.mjs.map +0 -7
- package/dist/lib/browser/chunk-G3XIOLLI.mjs.map +0 -7
- package/dist/lib/browser/chunk-J7PGML5B.mjs.map +0 -7
- package/dist/lib/browser/chunk-MUEVLYXJ.mjs.map +0 -7
- package/dist/lib/browser/chunk-PLDBKKYO.mjs.map +0 -7
- package/dist/lib/browser/chunk-Q66L5EUR.mjs +0 -20
- package/dist/lib/browser/chunk-Q66L5EUR.mjs.map +0 -7
- package/dist/lib/browser/chunk-TW27W3EL.mjs +0 -29
- package/dist/lib/browser/chunk-TW27W3EL.mjs.map +0 -7
- package/dist/lib/browser/chunk-ZYU2LP6U.mjs +0 -11
- package/dist/lib/browser/chunk-ZYU2LP6U.mjs.map +0 -7
- package/dist/lib/browser/compiler-53G6ZHQM.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -250
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/operation-resolver-CYEISDDK.mjs +0 -79
- package/dist/lib/browser/operation-resolver-CYEISDDK.mjs.map +0 -7
- package/dist/lib/browser/react-surface-26P6HAFD.mjs +0 -141
- package/dist/lib/browser/react-surface-26P6HAFD.mjs.map +0 -7
- package/dist/lib/browser/settings-76UM7442.mjs.map +0 -7
- package/dist/lib/browser/types/index.mjs +0 -18
- package/dist/lib/node-esm/DeploymentDialog-ZHPHEV2H.mjs +0 -139
- package/dist/lib/node-esm/DeploymentDialog-ZHPHEV2H.mjs.map +0 -7
- package/dist/lib/node-esm/NotebookContainer-ZLWTNMQA.mjs +0 -851
- package/dist/lib/node-esm/NotebookContainer-ZLWTNMQA.mjs.map +0 -7
- package/dist/lib/node-esm/ScriptContainer-S4UKQAWP.mjs +0 -94
- package/dist/lib/node-esm/ScriptContainer-S4UKQAWP.mjs.map +0 -7
- package/dist/lib/node-esm/ScriptObjectSettings-C5QBRERY.mjs +0 -295
- package/dist/lib/node-esm/ScriptObjectSettings-C5QBRERY.mjs.map +0 -7
- package/dist/lib/node-esm/ScriptPluginSettings-MFACDW4R.mjs +0 -56
- package/dist/lib/node-esm/ScriptPluginSettings-MFACDW4R.mjs.map +0 -7
- package/dist/lib/node-esm/ScriptProperties-FMNIX3KU.mjs +0 -29
- package/dist/lib/node-esm/ScriptProperties-FMNIX3KU.mjs.map +0 -7
- package/dist/lib/node-esm/TestContainer-AO45YPGV.mjs +0 -40
- package/dist/lib/node-esm/TestContainer-AO45YPGV.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-IGAZTJ45.mjs +0 -70
- package/dist/lib/node-esm/app-graph-builder-IGAZTJ45.mjs.map +0 -7
- package/dist/lib/node-esm/blueprint-definition-5MGY6BRQ.mjs +0 -18
- package/dist/lib/node-esm/blueprint-definition-5MGY6BRQ.mjs.map +0 -7
- package/dist/lib/node-esm/blueprints/index.mjs +0 -9
- package/dist/lib/node-esm/chunk-5BG7OJGQ.mjs +0 -176
- package/dist/lib/node-esm/chunk-5BG7OJGQ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-5HSJPAK7.mjs +0 -33
- package/dist/lib/node-esm/chunk-5HSJPAK7.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-H46R2RS5.mjs +0 -790
- package/dist/lib/node-esm/chunk-H46R2RS5.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +0 -11
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-JGN7TDJH.mjs +0 -69
- package/dist/lib/node-esm/chunk-JGN7TDJH.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-QG6ANK4B.mjs +0 -107
- package/dist/lib/node-esm/chunk-QG6ANK4B.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-S7DSCLOW.mjs +0 -31
- package/dist/lib/node-esm/chunk-S7DSCLOW.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-TZ2EBTPQ.mjs +0 -22
- package/dist/lib/node-esm/chunk-TZ2EBTPQ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-UFBVE33O.mjs +0 -12
- package/dist/lib/node-esm/chunk-UFBVE33O.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-WWD5LUU6.mjs +0 -114
- package/dist/lib/node-esm/chunk-WWD5LUU6.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ZDJ2FI7E.mjs +0 -398
- package/dist/lib/node-esm/chunk-ZDJ2FI7E.mjs.map +0 -7
- package/dist/lib/node-esm/compiler-HHQW7EP3.mjs +0 -100
- package/dist/lib/node-esm/compiler-HHQW7EP3.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -251
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/operation-resolver-HFFDXWND.mjs +0 -80
- package/dist/lib/node-esm/operation-resolver-HFFDXWND.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-THCIK266.mjs +0 -142
- package/dist/lib/node-esm/react-surface-THCIK266.mjs.map +0 -7
- package/dist/lib/node-esm/settings-CCHDPLFJ.mjs +0 -37
- package/dist/lib/node-esm/settings-CCHDPLFJ.mjs.map +0 -7
- package/dist/lib/node-esm/templates/index.mjs +0 -11
- package/dist/lib/node-esm/types/index.mjs +0 -19
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +0 -1
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts +0 -3
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/artifact-definition/artifact-definition.d.ts.map +0 -1
- package/dist/types/src/capabilities/artifact-definition/index.d.ts +0 -3
- package/dist/types/src/capabilities/artifact-definition/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts +0 -6
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts.map +0 -1
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts +0 -3
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/compiler/compiler.d.ts +0 -6
- package/dist/types/src/capabilities/compiler/compiler.d.ts.map +0 -1
- package/dist/types/src/capabilities/compiler/index.d.ts +0 -3
- package/dist/types/src/capabilities/compiler/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-resolver/index.d.ts +0 -3
- package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +0 -5
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
- package/dist/types/src/capabilities/settings/index.d.ts +0 -7
- package/dist/types/src/capabilities/settings/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/settings/settings.d.ts.map +0 -1
- package/dist/types/src/components/FrameContainer/FrameContainer.d.ts.map +0 -1
- package/dist/types/src/components/FrameContainer/frame.d.ts +0 -2
- package/dist/types/src/components/FrameContainer/frame.d.ts.map +0 -1
- package/dist/types/src/components/FrameContainer/index.d.ts +0 -2
- package/dist/types/src/components/FrameContainer/index.d.ts.map +0 -1
- package/dist/types/src/containers/ScriptObjectSettings/ScriptObjectSettings.d.ts +0 -7
- package/dist/types/src/containers/ScriptObjectSettings/ScriptObjectSettings.d.ts.map +0 -1
- package/dist/types/src/containers/ScriptObjectSettings/index.d.ts +0 -3
- package/dist/types/src/containers/ScriptObjectSettings/index.d.ts.map +0 -1
- package/dist/types/src/containers/ScriptPluginSettings/ScriptPluginSettings.d.ts +0 -8
- package/dist/types/src/containers/ScriptPluginSettings/ScriptPluginSettings.d.ts.map +0 -1
- package/dist/types/src/containers/ScriptPluginSettings/index.d.ts +0 -3
- package/dist/types/src/containers/ScriptPluginSettings/index.d.ts.map +0 -1
- package/dist/types/src/testing/data.d.ts +0 -3
- package/dist/types/src/testing/data.d.ts.map +0 -1
- package/dist/types/src/types/actions.d.ts +0 -40
- package/dist/types/src/types/actions.d.ts.map +0 -1
- package/dist/types/src/types/capabilities.d.ts +0 -12
- package/dist/types/src/types/capabilities.d.ts.map +0 -1
- package/dist/types/src/types/events.d.ts +0 -5
- package/dist/types/src/types/events.d.ts.map +0 -1
- package/src/capabilities/app-graph-builder/app-graph-builder.ts +0 -56
- package/src/capabilities/app-graph-builder/index.ts +0 -7
- package/src/capabilities/artifact-definition/index.ts +0 -7
- package/src/capabilities/blueprint-definition/index.ts +0 -7
- package/src/capabilities/compiler/index.ts +0 -7
- package/src/capabilities/operation-resolver/index.ts +0 -7
- package/src/capabilities/operation-resolver/operation-resolver.ts +0 -75
- package/src/capabilities/react-surface/index.ts +0 -7
- package/src/capabilities/react-surface/react-surface.tsx +0 -121
- package/src/capabilities/settings/index.ts +0 -7
- package/src/components/FrameContainer/frame.html +0 -25
- package/src/components/FrameContainer/frame.tsx +0 -51
- package/src/containers/ScriptObjectSettings/ScriptObjectSettings.tsx +0 -291
- package/src/containers/ScriptObjectSettings/index.ts +0 -7
- package/src/containers/ScriptPluginSettings/ScriptPluginSettings.tsx +0 -66
- package/src/containers/ScriptPluginSettings/index.ts +0 -7
- package/src/types/actions.ts +0 -45
- package/src/types/capabilities.ts +0 -17
- package/src/types/events.ts +0 -11
- /package/dist/lib/{browser → neutral}/blueprints/index.mjs.map +0 -0
- /package/dist/lib/{browser → neutral}/chunk-J5LGTIGS.mjs +0 -0
- /package/dist/lib/{browser → neutral}/chunk-J5LGTIGS.mjs.map +0 -0
- /package/dist/lib/{browser/templates → neutral}/index.mjs.map +0 -0
- /package/dist/lib/{browser/types/index.mjs.map → neutral/meta.mjs.map} +0 -0
- /package/dist/lib/{node-esm/blueprints → neutral/operations}/index.mjs.map +0 -0
- /package/dist/lib/{node-esm → neutral}/templates/index.mjs.map +0 -0
- /package/dist/lib/{node-esm → neutral}/types/index.mjs.map +0 -0
- /package/dist/types/src/capabilities/{app-graph-builder/app-graph-builder.d.ts → app-graph-builder.d.ts} +0 -0
- /package/dist/types/src/capabilities/{artifact-definition/artifact-definition.d.ts → artifact-definition.d.ts} +0 -0
- /package/dist/types/src/capabilities/{react-surface/react-surface.d.ts → react-surface.d.ts} +0 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { next as A, type Doc } from '@automerge/automerge';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
7
|
+
|
|
8
|
+
import { type Script, Operation } from '@dxos/compute';
|
|
9
|
+
import { Database, Obj } from '@dxos/echo';
|
|
10
|
+
import { DocAccessor, createDocAccessor } from '@dxos/echo-db';
|
|
11
|
+
|
|
12
|
+
import { Update } from './definitions';
|
|
13
|
+
|
|
14
|
+
export default Update.pipe(
|
|
15
|
+
Operation.withHandler(
|
|
16
|
+
Effect.fn(function* ({ function: fn, name, description, edits }) {
|
|
17
|
+
const loaded = yield* Database.load(fn);
|
|
18
|
+
if (!loaded.source) {
|
|
19
|
+
return yield* Effect.fail(new Error('Function has no source script.'));
|
|
20
|
+
}
|
|
21
|
+
const script = (yield* Database.load(loaded.source)) as Script.Script;
|
|
22
|
+
|
|
23
|
+
if (name !== undefined || description !== undefined) {
|
|
24
|
+
Obj.update(script, (script) => {
|
|
25
|
+
if (name !== undefined) {
|
|
26
|
+
script.name = name;
|
|
27
|
+
}
|
|
28
|
+
if (description !== undefined) {
|
|
29
|
+
script.description = description;
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (edits && edits.length > 0) {
|
|
35
|
+
const text = yield* Database.load(script.source);
|
|
36
|
+
const accessor = createDocAccessor(text, ['content']);
|
|
37
|
+
|
|
38
|
+
for (const edit of edits) {
|
|
39
|
+
accessor.handle.change((doc: Doc<typeof text>) => {
|
|
40
|
+
const source = DocAccessor.getValue<string>(accessor);
|
|
41
|
+
if (edit.replaceAll) {
|
|
42
|
+
let idx = source.indexOf(edit.oldString);
|
|
43
|
+
while (idx !== -1) {
|
|
44
|
+
A.splice(doc, accessor.path as A.Prop[], idx, edit.oldString.length, edit.newString);
|
|
45
|
+
const updated = DocAccessor.getValue<string>(accessor);
|
|
46
|
+
idx = updated.indexOf(edit.oldString, idx + edit.newString.length);
|
|
47
|
+
}
|
|
48
|
+
} else {
|
|
49
|
+
const idx = source.indexOf(edit.oldString);
|
|
50
|
+
if (idx === -1) {
|
|
51
|
+
throw new Error(`Edit not found: ${JSON.stringify(edit.oldString)}`);
|
|
52
|
+
}
|
|
53
|
+
A.splice(doc, accessor.path as A.Prop[], idx, edit.oldString.length, edit.newString);
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
Obj.update(script, (script) => {
|
|
59
|
+
script.changed = true;
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return {
|
|
64
|
+
function: Obj.getDXN(loaded).toString(),
|
|
65
|
+
};
|
|
66
|
+
}),
|
|
67
|
+
),
|
|
68
|
+
);
|
|
@@ -2,29 +2,53 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
import { Blueprint, Template } from '@dxos/blueprints';
|
|
5
|
+
import { Blueprint, Template } from '@dxos/compute';
|
|
7
6
|
import { trim } from '@dxos/util';
|
|
8
7
|
|
|
9
|
-
|
|
8
|
+
import {
|
|
9
|
+
Create,
|
|
10
|
+
Read,
|
|
11
|
+
Update,
|
|
12
|
+
Delete,
|
|
13
|
+
Deploy,
|
|
14
|
+
Invoke,
|
|
15
|
+
InspectInvocations,
|
|
16
|
+
QueryDeployedFunctions,
|
|
17
|
+
InstallFunction,
|
|
18
|
+
} from './functions';
|
|
10
19
|
|
|
11
|
-
const
|
|
20
|
+
const BLUEPRINT_KEY = 'org.dxos.blueprint.script';
|
|
12
21
|
|
|
13
22
|
const make = () =>
|
|
14
23
|
Blueprint.make({
|
|
15
24
|
key: BLUEPRINT_KEY,
|
|
16
25
|
name: 'Script',
|
|
17
|
-
|
|
26
|
+
agentCanEnable: true,
|
|
27
|
+
tools: Blueprint.toolDefinitions({
|
|
28
|
+
operations: [
|
|
29
|
+
Create,
|
|
30
|
+
Read,
|
|
31
|
+
Update,
|
|
32
|
+
Delete,
|
|
33
|
+
Deploy,
|
|
34
|
+
Invoke,
|
|
35
|
+
InspectInvocations,
|
|
36
|
+
QueryDeployedFunctions,
|
|
37
|
+
InstallFunction,
|
|
38
|
+
],
|
|
39
|
+
}),
|
|
18
40
|
instructions: Template.make({
|
|
19
41
|
source: trim`
|
|
20
|
-
You can create
|
|
42
|
+
You can create, read, update, and delete scripts which contain TypeScript code.
|
|
43
|
+
You can deploy scripts to the Edge runtime and invoke deployed scripts.
|
|
44
|
+
You can inspect the invocation history of a deployed script.
|
|
45
|
+
You can query all functions deployed to the EDGE runtime and install them into the current space.
|
|
21
46
|
`,
|
|
22
47
|
}),
|
|
23
48
|
});
|
|
24
49
|
|
|
25
|
-
const blueprint:
|
|
50
|
+
const blueprint: Blueprint.Definition = {
|
|
26
51
|
key: BLUEPRINT_KEY,
|
|
27
|
-
functions,
|
|
28
52
|
make,
|
|
29
53
|
};
|
|
30
54
|
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capability } from '@dxos/app-framework';
|
|
8
|
+
import { AppCapabilities, AppNode } from '@dxos/app-toolkit';
|
|
9
|
+
import { Script } from '@dxos/compute';
|
|
10
|
+
import { GraphBuilder } from '@dxos/plugin-graph';
|
|
11
|
+
|
|
12
|
+
import { meta } from '#meta';
|
|
13
|
+
|
|
14
|
+
export default Capability.makeModule(
|
|
15
|
+
Effect.fnUntraced(function* () {
|
|
16
|
+
const extensions = yield* Effect.all([
|
|
17
|
+
GraphBuilder.createTypeExtension({
|
|
18
|
+
id: 'execute',
|
|
19
|
+
type: Script.Script,
|
|
20
|
+
connector: () =>
|
|
21
|
+
Effect.succeed([
|
|
22
|
+
AppNode.makeCompanion({
|
|
23
|
+
id: 'execute',
|
|
24
|
+
label: ['script-test.label', { ns: meta.id }],
|
|
25
|
+
icon: 'ph--terminal--regular',
|
|
26
|
+
data: 'execute',
|
|
27
|
+
}),
|
|
28
|
+
]),
|
|
29
|
+
}),
|
|
30
|
+
GraphBuilder.createTypeExtension({
|
|
31
|
+
id: 'logs',
|
|
32
|
+
type: Script.Script,
|
|
33
|
+
connector: () =>
|
|
34
|
+
Effect.succeed([
|
|
35
|
+
AppNode.makeCompanion({
|
|
36
|
+
id: 'logs',
|
|
37
|
+
label: ['script-logs.label', { ns: meta.id }],
|
|
38
|
+
icon: 'ph--clock-countdown--regular',
|
|
39
|
+
data: 'logs',
|
|
40
|
+
}),
|
|
41
|
+
]),
|
|
42
|
+
}),
|
|
43
|
+
]);
|
|
44
|
+
|
|
45
|
+
return Capability.contributes(AppCapabilities.AppGraphBuilder, extensions);
|
|
46
|
+
}),
|
|
47
|
+
);
|
package/src/capabilities/{artifact-definition/artifact-definition.ts → artifact-definition.ts}
RENAMED
|
@@ -11,14 +11,13 @@ import * as Schema from 'effect/Schema';
|
|
|
11
11
|
import { ToolResult, createTool } from '@dxos/ai';
|
|
12
12
|
import { Capabilities, Capability, type PromiseIntentDispatcher, createIntent } from '@dxos/app-framework';
|
|
13
13
|
import { ArtifactId, createArtifactElement } from '@dxos/assistant';
|
|
14
|
-
import { defineArtifact } from '@dxos/
|
|
14
|
+
import { defineArtifact, ScriptType } from '@dxos/compute';
|
|
15
15
|
import { Filter, Obj, Ref } from '@dxos/echo';
|
|
16
|
-
import { ScriptType } from '@dxos/functions';
|
|
17
16
|
import { invariant } from '@dxos/invariant';
|
|
18
|
-
import { SpaceAction } from '@dxos/plugin-space
|
|
17
|
+
import { SpaceAction } from '@dxos/plugin-space';
|
|
19
18
|
import { type Space } from '@dxos/react-client/echo';
|
|
20
19
|
|
|
21
|
-
import { meta } from '
|
|
20
|
+
import { meta } from '#meta';
|
|
22
21
|
|
|
23
22
|
// TODO(burdon): Factor out.
|
|
24
23
|
declare global {
|
|
@@ -160,7 +159,7 @@ export default Capability.makeModule(() =>
|
|
|
160
159
|
execute: async ({ name, code }, { extensions }) => {
|
|
161
160
|
invariant(extensions?.space, 'No space');
|
|
162
161
|
invariant(extensions?.dispatch, 'No intent dispatcher');
|
|
163
|
-
const script = Obj.make(ScriptType, { name, source: Ref.make(Text.make(code)) });
|
|
162
|
+
const script = Obj.make(ScriptType, { name, source: Ref.make(Text.make({ content: code })) });
|
|
164
163
|
extensions.space.db.add(script);
|
|
165
164
|
await extensions.space.db.flush();
|
|
166
165
|
|
package/src/capabilities/{blueprint-definition/blueprint-definition.ts → blueprint-definition.ts}
RENAMED
|
@@ -6,8 +6,10 @@ import * as Effect from 'effect/Effect';
|
|
|
6
6
|
|
|
7
7
|
import { Capability } from '@dxos/app-framework';
|
|
8
8
|
import { AppCapabilities } from '@dxos/app-toolkit';
|
|
9
|
+
// eslint-disable-next-line unused-imports/no-unused-imports
|
|
10
|
+
import type { Blueprint } from '@dxos/compute';
|
|
9
11
|
|
|
10
|
-
import { ScriptBlueprint } from '
|
|
12
|
+
import { ScriptBlueprint } from '#blueprints';
|
|
11
13
|
|
|
12
14
|
const blueprintDefinition = Capability.makeModule<
|
|
13
15
|
[],
|
|
@@ -15,8 +15,9 @@ import { initializeBundler } from '@dxos/functions-runtime/bundler';
|
|
|
15
15
|
import { log } from '@dxos/log';
|
|
16
16
|
import { trim } from '@dxos/util';
|
|
17
17
|
|
|
18
|
-
import {
|
|
19
|
-
|
|
18
|
+
import { ScriptCapabilities } from '#types';
|
|
19
|
+
|
|
20
|
+
import { Compiler } from '../compiler';
|
|
20
21
|
|
|
21
22
|
// TODO(burdon): Document.
|
|
22
23
|
const SCRIPT_PACKAGES_BUCKET = 'https://pub-5745ae82e450484aa28f75fc6a175935.r2.dev/dev/';
|
|
@@ -25,11 +26,16 @@ const NO_TYPES = true; // Types temopararly disabled due to compiler erorrs.
|
|
|
25
26
|
|
|
26
27
|
export default Capability.makeModule(() =>
|
|
27
28
|
Effect.gen(function* () {
|
|
28
|
-
yield* Effect.tryPromise(
|
|
29
|
+
yield* Effect.tryPromise({
|
|
30
|
+
try: () => initializeBundler({ wasmUrl }),
|
|
31
|
+
catch: (error) => new Error(`Failed to initialize bundler: ${error}`),
|
|
32
|
+
});
|
|
29
33
|
|
|
30
34
|
const runtimeModules = yield* fetchRuntimeModules().pipe(Effect.provide(FetchHttpClient.layer));
|
|
31
35
|
|
|
32
36
|
const compiler = new Compiler({
|
|
37
|
+
target: ts.ScriptTarget.ES2022,
|
|
38
|
+
lib: ['lib.es2022.d.ts', 'lib.dom.d.ts'],
|
|
33
39
|
skipLibCheck: true,
|
|
34
40
|
moduleResolution: ts.ModuleResolutionKind.Bundler,
|
|
35
41
|
allowImportingTsExtensions: true,
|
|
@@ -39,12 +45,14 @@ export default Capability.makeModule(() =>
|
|
|
39
45
|
paths: Object.fromEntries(runtimeModules.map((mod: any) => [mod.moduleName, [`./src/${mod.filename}`]])),
|
|
40
46
|
});
|
|
41
47
|
|
|
42
|
-
yield* Effect.tryPromise(
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
+
yield* Effect.tryPromise({
|
|
49
|
+
try: () =>
|
|
50
|
+
compiler.initialize(trim`
|
|
51
|
+
declare module 'https://*';
|
|
52
|
+
${NO_TYPES ? '' : 'declare module "*";'}
|
|
53
|
+
`),
|
|
54
|
+
catch: (error) => new Error(`Failed to initialize compiler: ${error}`),
|
|
55
|
+
});
|
|
48
56
|
if (!NO_TYPES) {
|
|
49
57
|
for (const mod of runtimeModules) {
|
|
50
58
|
compiler.setFile(`/src/${mod.filename}`, mod.content);
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capability } from '@dxos/app-framework';
|
|
8
|
+
import { Operation, Script } from '@dxos/compute';
|
|
9
|
+
import { SpaceOperation } from '@dxos/plugin-space';
|
|
10
|
+
import { SpaceCapabilities } from '@dxos/plugin-space';
|
|
11
|
+
|
|
12
|
+
import { ScriptOperation } from '#types';
|
|
13
|
+
import { Notebook } from '#types';
|
|
14
|
+
|
|
15
|
+
export default Capability.makeModule(
|
|
16
|
+
Effect.fnUntraced(function* () {
|
|
17
|
+
return [
|
|
18
|
+
Capability.contributes(SpaceCapabilities.CreateObjectEntry, {
|
|
19
|
+
id: Script.Script.typename,
|
|
20
|
+
inputSchema: ScriptOperation.ScriptProps,
|
|
21
|
+
createObject: (props, options) =>
|
|
22
|
+
Effect.gen(function* () {
|
|
23
|
+
const { object } = yield* Operation.invoke(ScriptOperation.CreateScript, props);
|
|
24
|
+
return yield* Operation.invoke(SpaceOperation.AddObject, {
|
|
25
|
+
object,
|
|
26
|
+
target: options.target,
|
|
27
|
+
hidden: true,
|
|
28
|
+
targetNodeId: options.targetNodeId,
|
|
29
|
+
});
|
|
30
|
+
}),
|
|
31
|
+
}),
|
|
32
|
+
Capability.contributes(SpaceCapabilities.CreateObjectEntry, {
|
|
33
|
+
id: Notebook.Notebook.typename,
|
|
34
|
+
inputSchema: ScriptOperation.NotebookProps,
|
|
35
|
+
createObject: (props, options) =>
|
|
36
|
+
Effect.gen(function* () {
|
|
37
|
+
const object = Notebook.make(props);
|
|
38
|
+
return yield* Operation.invoke(SpaceOperation.AddObject, {
|
|
39
|
+
object,
|
|
40
|
+
target: options.target,
|
|
41
|
+
hidden: true,
|
|
42
|
+
targetNodeId: options.targetNodeId,
|
|
43
|
+
});
|
|
44
|
+
}),
|
|
45
|
+
}),
|
|
46
|
+
];
|
|
47
|
+
}),
|
|
48
|
+
);
|
|
@@ -2,9 +2,17 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export
|
|
10
|
-
export
|
|
5
|
+
import { Capability } from '@dxos/app-framework';
|
|
6
|
+
// eslint-disable-next-line unused-imports/no-unused-imports
|
|
7
|
+
import type { Blueprint, OperationHandlerSet } from '@dxos/compute';
|
|
8
|
+
|
|
9
|
+
export const AppGraphBuilder = Capability.lazy('AppGraphBuilder', () => import('./app-graph-builder'));
|
|
10
|
+
export const BlueprintDefinition = Capability.lazy('BlueprintDefinition', () => import('./blueprint-definition'));
|
|
11
|
+
export const CreateObject = Capability.lazy('CreateObject', () => import('./create-object'));
|
|
12
|
+
export const Compiler = Capability.lazy('Compiler', () => import('./compiler'));
|
|
13
|
+
export const OperationHandler = Capability.lazy<OperationHandlerSet.OperationHandlerSet>(
|
|
14
|
+
'OperationHandler',
|
|
15
|
+
() => import('./operation-handler'),
|
|
16
|
+
);
|
|
17
|
+
export const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));
|
|
18
|
+
export const ScriptSettings = Capability.lazy('ScriptSettings', () => import('./settings'));
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Capability } from '@dxos/app-framework';
|
|
6
|
+
// eslint-disable-next-line unused-imports/no-unused-imports
|
|
7
|
+
import type { Blueprint, OperationHandlerSet } from '@dxos/compute';
|
|
8
|
+
|
|
9
|
+
export const AppGraphBuilder = Capability.lazy('AppGraphBuilder', () => import('./app-graph-builder'));
|
|
10
|
+
export const BlueprintDefinition = Capability.lazy('BlueprintDefinition', () => import('./blueprint-definition'));
|
|
11
|
+
export const CreateObject = Capability.lazy('CreateObject', () => import('./create-object'));
|
|
12
|
+
export const Compiler = Capability.lazy('Compiler', () => import('./compiler'));
|
|
13
|
+
export const OperationHandler = Capability.lazy<OperationHandlerSet.OperationHandlerSet>(
|
|
14
|
+
'OperationHandler',
|
|
15
|
+
() => import('./operation-handler'),
|
|
16
|
+
);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
8
|
+
import { OperationHandlerSet } from '@dxos/compute';
|
|
9
|
+
|
|
10
|
+
import { ScriptOperationHandlerSet } from '#operations';
|
|
11
|
+
|
|
12
|
+
import { ScriptHandlers } from '../blueprints/functions';
|
|
13
|
+
|
|
14
|
+
export default Capability.makeModule<OperationHandlerSet.OperationHandlerSet>(
|
|
15
|
+
Effect.fnUntraced(function* () {
|
|
16
|
+
return Capability.contributes(
|
|
17
|
+
Capabilities.OperationHandler,
|
|
18
|
+
OperationHandlerSet.merge(ScriptOperationHandlerSet, ScriptHandlers),
|
|
19
|
+
);
|
|
20
|
+
}),
|
|
21
|
+
);
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
import React, { type ComponentProps } from 'react';
|
|
7
|
+
|
|
8
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
9
|
+
import { Surface, useAtomCapability, useSettingsState } from '@dxos/app-framework/ui';
|
|
10
|
+
import { AppSurface } from '@dxos/app-toolkit/ui';
|
|
11
|
+
import { Script } from '@dxos/compute';
|
|
12
|
+
import { InvocationTraceContainer } from '@dxos/devtools';
|
|
13
|
+
import { Feed } from '@dxos/echo';
|
|
14
|
+
import { useClient } from '@dxos/react-client';
|
|
15
|
+
import { getSpace } from '@dxos/react-client/echo';
|
|
16
|
+
import { Panel } from '@dxos/react-ui';
|
|
17
|
+
|
|
18
|
+
import { ScriptPluginSettings } from '#components';
|
|
19
|
+
import { DeploymentDialog, NotebookContainer, ScriptContainer, ScriptProperties, TestContainer } from '#containers';
|
|
20
|
+
import { useCompiler } from '#hooks';
|
|
21
|
+
import { meta } from '#meta';
|
|
22
|
+
import { Notebook, ScriptCapabilities, type Settings } from '#types';
|
|
23
|
+
|
|
24
|
+
import { DEPLOYMENT_DIALOG } from '../constants';
|
|
25
|
+
import { getAccessCredential } from '../util';
|
|
26
|
+
|
|
27
|
+
export default Capability.makeModule(() =>
|
|
28
|
+
Effect.succeed(
|
|
29
|
+
Capability.contributes(Capabilities.ReactSurface, [
|
|
30
|
+
Surface.create({
|
|
31
|
+
id: 'plugin-settings',
|
|
32
|
+
filter: AppSurface.settings(AppSurface.Article, meta.id),
|
|
33
|
+
component: ({ data: { subject } }) => {
|
|
34
|
+
const { settings, updateSettings } = useSettingsState<Settings.Settings>(subject.atom);
|
|
35
|
+
const client = useClient();
|
|
36
|
+
// TODO(burdon): Check token.
|
|
37
|
+
const handleAuthenticate = async () => {
|
|
38
|
+
const { identityKey } = client.halo.identity.get()!;
|
|
39
|
+
await client.halo.writeCredentials([getAccessCredential(identityKey)]);
|
|
40
|
+
};
|
|
41
|
+
return (
|
|
42
|
+
<ScriptPluginSettings
|
|
43
|
+
settings={settings}
|
|
44
|
+
onSettingsChange={updateSettings}
|
|
45
|
+
onAuthenticate={handleAuthenticate}
|
|
46
|
+
/>
|
|
47
|
+
);
|
|
48
|
+
},
|
|
49
|
+
}),
|
|
50
|
+
Surface.create({
|
|
51
|
+
id: 'script.article',
|
|
52
|
+
// TODO(wittjosiah): Split into multiple surfaces if this filter proves too strict for non-article roles.
|
|
53
|
+
filter: AppSurface.oneOf(
|
|
54
|
+
AppSurface.object(AppSurface.Article, Script.Script),
|
|
55
|
+
AppSurface.object(AppSurface.Section, Script.Script),
|
|
56
|
+
),
|
|
57
|
+
component: ({ data, role }) => {
|
|
58
|
+
const compiler = useCompiler();
|
|
59
|
+
const settings = useAtomCapability(ScriptCapabilities.Settings);
|
|
60
|
+
return (
|
|
61
|
+
<ScriptContainer
|
|
62
|
+
role={role}
|
|
63
|
+
subject={data.subject}
|
|
64
|
+
attendableId={data.attendableId}
|
|
65
|
+
settings={settings}
|
|
66
|
+
env={compiler?.environment}
|
|
67
|
+
/>
|
|
68
|
+
);
|
|
69
|
+
},
|
|
70
|
+
}),
|
|
71
|
+
Surface.create({
|
|
72
|
+
id: 'notebook.article',
|
|
73
|
+
filter: AppSurface.object(AppSurface.Article, Notebook.Notebook),
|
|
74
|
+
component: ({ data, role }) => {
|
|
75
|
+
const compiler = useCompiler();
|
|
76
|
+
return (
|
|
77
|
+
<NotebookContainer
|
|
78
|
+
role={role}
|
|
79
|
+
subject={data.subject}
|
|
80
|
+
attendableId={data.attendableId}
|
|
81
|
+
env={compiler?.environment}
|
|
82
|
+
/>
|
|
83
|
+
);
|
|
84
|
+
},
|
|
85
|
+
}),
|
|
86
|
+
Surface.create({
|
|
87
|
+
id: 'properties',
|
|
88
|
+
filter: AppSurface.object(AppSurface.ObjectProperties, Script.Script),
|
|
89
|
+
component: ({ data, role }) => <ScriptProperties role={role} subject={data.subject} />,
|
|
90
|
+
}),
|
|
91
|
+
Surface.create({
|
|
92
|
+
id: 'companion.execute',
|
|
93
|
+
filter: AppSurface.allOf(
|
|
94
|
+
AppSurface.literal(AppSurface.Article, 'execute'),
|
|
95
|
+
AppSurface.companion(AppSurface.Article, Script.Script),
|
|
96
|
+
),
|
|
97
|
+
component: ({ data, role }) => <TestContainer script={data.companionTo} role={role} />,
|
|
98
|
+
}),
|
|
99
|
+
Surface.create({
|
|
100
|
+
id: 'companion.logs',
|
|
101
|
+
filter: AppSurface.allOf(
|
|
102
|
+
AppSurface.literal(AppSurface.Article, 'logs'),
|
|
103
|
+
AppSurface.companion(AppSurface.Article, Script.Script),
|
|
104
|
+
),
|
|
105
|
+
component: ({ data, role }) => {
|
|
106
|
+
const space = getSpace(data.companionTo);
|
|
107
|
+
const feed = space?.properties.invocationTraceFeed?.target;
|
|
108
|
+
const queueDxn = feed ? Feed.getQueueDxn(feed) : undefined;
|
|
109
|
+
return (
|
|
110
|
+
<Panel.Root role={role}>
|
|
111
|
+
<Panel.Content>
|
|
112
|
+
<InvocationTraceContainer
|
|
113
|
+
db={space?.db}
|
|
114
|
+
queueDxn={queueDxn}
|
|
115
|
+
target={data.companionTo}
|
|
116
|
+
detailAxis='block'
|
|
117
|
+
/>
|
|
118
|
+
</Panel.Content>
|
|
119
|
+
</Panel.Root>
|
|
120
|
+
);
|
|
121
|
+
},
|
|
122
|
+
}),
|
|
123
|
+
Surface.create({
|
|
124
|
+
id: DEPLOYMENT_DIALOG,
|
|
125
|
+
filter: AppSurface.component<ComponentProps<typeof DeploymentDialog>>(AppSurface.Dialog, DEPLOYMENT_DIALOG),
|
|
126
|
+
component: ({ data }) => <DeploymentDialog {...data.props} />,
|
|
127
|
+
}),
|
|
128
|
+
]),
|
|
129
|
+
),
|
|
130
|
+
);
|
|
@@ -8,14 +8,14 @@ import { Capability } from '@dxos/app-framework';
|
|
|
8
8
|
import { AppCapabilities } from '@dxos/app-toolkit';
|
|
9
9
|
import { createKvsStore } from '@dxos/effect';
|
|
10
10
|
|
|
11
|
-
import { meta } from '
|
|
12
|
-
import { ScriptCapabilities,
|
|
11
|
+
import { meta } from '#meta';
|
|
12
|
+
import { ScriptCapabilities, Settings } from '#types';
|
|
13
13
|
|
|
14
14
|
export default Capability.makeModule(() =>
|
|
15
15
|
Effect.sync(() => {
|
|
16
16
|
const settingsAtom = createKvsStore({
|
|
17
17
|
key: meta.id,
|
|
18
|
-
schema:
|
|
18
|
+
schema: Settings.Settings,
|
|
19
19
|
defaultValue: () => ({
|
|
20
20
|
editorInputMode: 'vscode' as const,
|
|
21
21
|
}),
|
|
@@ -25,7 +25,7 @@ export default Capability.makeModule(() =>
|
|
|
25
25
|
Capability.contributes(ScriptCapabilities.Settings, settingsAtom),
|
|
26
26
|
Capability.contributes(AppCapabilities.Settings, {
|
|
27
27
|
prefix: meta.id,
|
|
28
|
-
schema:
|
|
28
|
+
schema: Settings.Settings,
|
|
29
29
|
atom: settingsAtom,
|
|
30
30
|
}),
|
|
31
31
|
];
|
package/src/compiler/compiler.ts
CHANGED
|
@@ -14,6 +14,13 @@ import { invariant } from '@dxos/invariant';
|
|
|
14
14
|
|
|
15
15
|
const GLOBALS = 'globals.d.ts';
|
|
16
16
|
|
|
17
|
+
/** TS version hosted on playgroundcdn.typescriptlang.org used to fetch lib .d.ts files.
|
|
18
|
+
* Pinned to 5.6.3 because 5.7+ removed lib.es2022.sharedmemory.d.ts from the CDN.
|
|
19
|
+
* The remaining 404s (lib.core.d.ts, lib.core.es6/7.d.ts, lib.es7.d.ts) are phantom
|
|
20
|
+
* entries in @typescript/vfs's hardcoded file list and are harmlessly caught.
|
|
21
|
+
*/
|
|
22
|
+
const CDN_TS_VERSION = '5.6.3';
|
|
23
|
+
|
|
17
24
|
const defaultOptions: ts.CompilerOptions = {
|
|
18
25
|
lib: ['DOM', 'es2022'],
|
|
19
26
|
target: ts.ScriptTarget.ES2022,
|
|
@@ -32,7 +39,7 @@ export class Compiler {
|
|
|
32
39
|
|
|
33
40
|
// TODO(wittjosiah): Figure out how to get workers working in plugin packages.
|
|
34
41
|
// https://github.com/val-town/codemirror-ts?tab=readme-ov-file#setup-worker
|
|
35
|
-
this._fsMap = await createDefaultMapFromCDN(this._options,
|
|
42
|
+
this._fsMap = await createDefaultMapFromCDN(this._options, CDN_TS_VERSION, true, ts);
|
|
36
43
|
if (globals) {
|
|
37
44
|
this._fsMap.set(GLOBALS, globals);
|
|
38
45
|
}
|
|
@@ -13,7 +13,7 @@ import { createProtoRpcPeer } from '@dxos/rpc';
|
|
|
13
13
|
import { createIFramePort } from '@dxos/rpc-tunnel';
|
|
14
14
|
import { mx } from '@dxos/ui-theme';
|
|
15
15
|
|
|
16
|
-
export type
|
|
16
|
+
export type FramePanelProps = {
|
|
17
17
|
containerUrl: string;
|
|
18
18
|
result: BundleResult;
|
|
19
19
|
debug?: boolean;
|
|
@@ -22,7 +22,7 @@ export type FrameContainerProps = {
|
|
|
22
22
|
/**
|
|
23
23
|
* IFrame container for the compiled script.
|
|
24
24
|
*/
|
|
25
|
-
export const
|
|
25
|
+
export const FramePanel = ({ containerUrl, result, debug = true }: FramePanelProps) => {
|
|
26
26
|
const client = useClient();
|
|
27
27
|
const iframeRef = useRef<HTMLIFrameElement>(null);
|
|
28
28
|
useEffect(() => {
|