@dxos/plugin-script 0.8.4-main.c4373fc → 0.8.4-main.d9fc60f731
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/LICENSE +102 -5
- package/PLUGIN.mdl +515 -0
- package/README.md +15 -13
- package/dist/lib/neutral/DeploymentDialog-M3AFYQHC.mjs +114 -0
- package/dist/lib/neutral/DeploymentDialog-M3AFYQHC.mjs.map +7 -0
- package/dist/lib/neutral/NotebookArticle-NV4AHOOS.mjs +763 -0
- package/dist/lib/neutral/NotebookArticle-NV4AHOOS.mjs.map +7 -0
- package/dist/lib/neutral/ScriptArticle-UBT27SB6.mjs +79 -0
- package/dist/lib/neutral/ScriptArticle-UBT27SB6.mjs.map +7 -0
- package/dist/lib/neutral/ScriptPlugin.mjs +51 -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/ScriptPlugin.workerd.mjs +21 -0
- package/dist/lib/neutral/ScriptPlugin.workerd.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-RLXNAN3N.mjs +297 -0
- package/dist/lib/neutral/ScriptProperties-RLXNAN3N.mjs.map +7 -0
- package/dist/lib/neutral/TestContainer-AFVTBYSJ.mjs +44 -0
- package/dist/lib/neutral/TestContainer-AFVTBYSJ.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/neutral/blueprint-definition-T33SBPP2.mjs +15 -0
- package/dist/lib/neutral/blueprint-definition-T33SBPP2.mjs.map +7 -0
- package/dist/lib/neutral/blueprints/index.mjs +10 -0
- 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-2REUEDUA.mjs +56 -0
- package/dist/lib/neutral/chunk-2REUEDUA.mjs.map +7 -0
- package/dist/lib/neutral/chunk-BDHDBPVM.mjs +52 -0
- package/dist/lib/neutral/chunk-BDHDBPVM.mjs.map +7 -0
- package/dist/lib/neutral/chunk-C4O7EV6M.mjs +123 -0
- package/dist/lib/neutral/chunk-C4O7EV6M.mjs.map +7 -0
- package/dist/lib/neutral/chunk-H2BRWQMY.mjs +96 -0
- package/dist/lib/neutral/chunk-H2BRWQMY.mjs.map +7 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/neutral/chunk-LHEJXJEL.mjs +8 -0
- package/dist/lib/neutral/chunk-LHEJXJEL.mjs.map +7 -0
- package/dist/lib/neutral/chunk-NQOIENTU.mjs +8 -0
- package/dist/lib/neutral/chunk-NQOIENTU.mjs.map +7 -0
- package/dist/lib/neutral/chunk-TRKXIP2Q.mjs +345 -0
- package/dist/lib/neutral/chunk-TRKXIP2Q.mjs.map +7 -0
- package/dist/lib/neutral/chunk-UA3BWOCZ.mjs +38 -0
- package/dist/lib/neutral/chunk-UA3BWOCZ.mjs.map +7 -0
- package/dist/lib/neutral/chunk-VXDJH6OL.mjs +150 -0
- package/dist/lib/neutral/chunk-VXDJH6OL.mjs.map +7 -0
- package/dist/lib/neutral/compiler-ODK4UA2N.mjs +101 -0
- package/dist/lib/neutral/compiler-ODK4UA2N.mjs.map +7 -0
- package/dist/lib/neutral/components/index.mjs +664 -0
- 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-WQJXMOUE.mjs +46 -0
- package/dist/lib/neutral/create-WQJXMOUE.mjs.map +7 -0
- package/dist/lib/neutral/create-object-FZM5ASWM.mjs +45 -0
- package/dist/lib/neutral/create-object-FZM5ASWM.mjs.map +7 -0
- package/dist/lib/neutral/create-script-66DO3UJO.mjs +45 -0
- package/dist/lib/neutral/create-script-66DO3UJO.mjs.map +7 -0
- package/dist/lib/neutral/delete-HCQIQFVP.mjs +21 -0
- package/dist/lib/neutral/delete-HCQIQFVP.mjs.map +7 -0
- package/dist/lib/neutral/deploy-7JVMMHSH.mjs +63 -0
- package/dist/lib/neutral/deploy-7JVMMHSH.mjs.map +7 -0
- package/dist/lib/neutral/hooks/index.mjs +369 -0
- package/dist/lib/neutral/hooks/index.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +41 -0
- package/dist/lib/neutral/inspect-invocations-6MW73SDV.mjs +59 -0
- package/dist/lib/neutral/inspect-invocations-6MW73SDV.mjs.map +7 -0
- package/dist/lib/neutral/install-function-FJIE2JAI.mjs +49 -0
- package/dist/lib/neutral/install-function-FJIE2JAI.mjs.map +7 -0
- package/dist/lib/neutral/invoke-3HVWY2KF.mjs +32 -0
- package/dist/lib/neutral/invoke-3HVWY2KF.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-X44IGZXS.mjs +18 -0
- package/dist/lib/neutral/operation-handler-X44IGZXS.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-F4FHJNWO.mjs +34 -0
- package/dist/lib/neutral/query-deployed-functions-F4FHJNWO.mjs.map +7 -0
- package/dist/lib/neutral/react-surface-ACNZ35FV.mjs +121 -0
- package/dist/lib/neutral/react-surface-ACNZ35FV.mjs.map +7 -0
- package/dist/lib/neutral/read-RQESBAQI.mjs +26 -0
- package/dist/lib/neutral/read-RQESBAQI.mjs.map +7 -0
- package/dist/lib/neutral/settings-VJBW4OMK.mjs +30 -0
- package/dist/lib/neutral/settings-VJBW4OMK.mjs.map +7 -0
- package/dist/lib/{browser → neutral}/templates/index.mjs +2 -1
- package/dist/lib/neutral/translations.mjs +105 -0
- package/dist/lib/neutral/translations.mjs.map +7 -0
- package/dist/lib/neutral/types/index.mjs +17 -0
- package/dist/lib/neutral/types/index.mjs.map +7 -0
- package/dist/lib/neutral/update-JZUNJYZM.mjs +63 -0
- package/dist/lib/neutral/update-JZUNJYZM.mjs.map +7 -0
- package/dist/types/src/ScriptPlugin.d.ts +3 -1
- 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/ScriptPlugin.workerd.d.ts +4 -0
- package/dist/types/src/ScriptPlugin.workerd.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 +135 -0
- package/dist/types/src/blueprints/functions/definitions.d.ts.map +1 -0
- package/dist/types/src/blueprints/functions/delete.d.ts +17 -0
- package/dist/types/src/blueprints/functions/delete.d.ts.map +1 -0
- package/dist/types/src/blueprints/functions/deploy.d.ts +21 -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 +28 -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 +21 -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 +21 -0
- package/dist/types/src/blueprints/functions/read.d.ts.map +1 -0
- package/dist/types/src/blueprints/functions/update.d.ts +26 -0
- package/dist/types/src/blueprints/functions/update.d.ts.map +1 -0
- package/dist/types/src/blueprints/index.d.ts +2 -0
- package/dist/types/src/blueprints/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/script-blueprint.d.ts +4 -0
- package/dist/types/src/blueprints/script-blueprint.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts +4 -2
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/blueprint-definition.d.ts +5 -4
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -1
- package/dist/types/src/capabilities/compiler.d.ts +3 -1
- package/dist/types/src/capabilities/compiler.d.ts.map +1 -1
- 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 -7
- 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 +3 -2
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings.d.ts +5 -2
- package/dist/types/src/capabilities/settings.d.ts.map +1 -1
- package/dist/types/src/compiler/compiler.d.ts +1 -1
- package/dist/types/src/compiler/compiler.d.ts.map +1 -1
- package/dist/types/src/components/NotebookStack/NotebookCell.d.ts +15 -0
- package/dist/types/src/components/NotebookStack/NotebookCell.d.ts.map +1 -0
- package/dist/types/src/components/NotebookStack/NotebookMenu.d.ts +9 -0
- package/dist/types/src/components/NotebookStack/NotebookMenu.d.ts.map +1 -0
- package/dist/types/src/components/NotebookStack/NotebookStack.d.ts +11 -11
- package/dist/types/src/components/NotebookStack/NotebookStack.d.ts.map +1 -1
- package/dist/types/src/components/NotebookStack/NotebookStack.stories.d.ts +221 -212
- package/dist/types/src/components/NotebookStack/NotebookStack.stories.d.ts.map +1 -1
- package/dist/types/src/components/NotebookStack/index.d.ts +1 -0
- package/dist/types/src/components/NotebookStack/index.d.ts.map +1 -1
- package/dist/types/src/components/QueryEditor/QueryEditor.d.ts +5 -0
- package/dist/types/src/components/QueryEditor/QueryEditor.d.ts.map +1 -0
- package/dist/types/src/components/QueryEditor/QueryEditor.stories.d.ts +13 -0
- package/dist/types/src/components/QueryEditor/QueryEditor.stories.d.ts.map +1 -0
- package/dist/types/src/components/QueryEditor/index.d.ts +2 -0
- package/dist/types/src/components/QueryEditor/index.d.ts.map +1 -0
- 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 +10 -9
- package/dist/types/src/components/ScriptToolbar/ScriptToolbar.d.ts.map +1 -1
- package/dist/types/src/components/ScriptToolbar/ScriptToolbar.stories.d.ts +222 -212
- 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/TestPanel/index.d.ts +0 -1
- package/dist/types/src/components/TestPanel/index.d.ts.map +1 -1
- package/dist/types/src/components/TypescriptEditor/TypescriptEditor.d.ts +6 -2
- package/dist/types/src/components/TypescriptEditor/TypescriptEditor.d.ts.map +1 -1
- package/dist/types/src/components/TypescriptEditor/TypescriptEditor.stories.d.ts +3 -7
- package/dist/types/src/components/TypescriptEditor/TypescriptEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +5 -5
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/constants.d.ts +3 -0
- package/dist/types/src/constants.d.ts.map +1 -0
- package/dist/types/src/{components → containers}/DeploymentDialog/DeploymentDialog.d.ts +2 -4
- package/dist/types/src/containers/DeploymentDialog/DeploymentDialog.d.ts.map +1 -0
- package/dist/types/src/containers/DeploymentDialog/DeploymentDialog.stories.d.ts +240 -0
- package/dist/types/src/containers/DeploymentDialog/DeploymentDialog.stories.d.ts.map +1 -0
- package/dist/types/src/containers/DeploymentDialog/index.d.ts +2 -0
- package/dist/types/src/containers/DeploymentDialog/index.d.ts.map +1 -0
- package/dist/types/src/containers/NotebookArticle/NotebookArticle.d.ts +7 -0
- package/dist/types/src/containers/NotebookArticle/NotebookArticle.d.ts.map +1 -0
- package/dist/types/src/containers/NotebookArticle/NotebookArticle.stories.d.ts +7 -0
- package/dist/types/src/containers/NotebookArticle/NotebookArticle.stories.d.ts.map +1 -0
- package/dist/types/src/containers/NotebookArticle/index.d.ts +2 -0
- package/dist/types/src/containers/NotebookArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/ScriptArticle/ScriptArticle.d.ts +10 -0
- package/dist/types/src/containers/ScriptArticle/ScriptArticle.d.ts.map +1 -0
- package/dist/types/src/containers/ScriptArticle/ScriptArticle.stories.d.ts +242 -0
- package/dist/types/src/containers/ScriptArticle/ScriptArticle.stories.d.ts.map +1 -0
- package/dist/types/src/containers/ScriptArticle/index.d.ts +2 -0
- package/dist/types/src/containers/ScriptArticle/index.d.ts.map +1 -0
- 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 +6 -0
- package/dist/types/src/containers/ScriptProperties/ScriptProperties.d.ts.map +1 -0
- 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 +2 -0
- package/dist/types/src/containers/ScriptProperties/index.d.ts.map +1 -0
- package/dist/types/src/containers/TestContainer/TestContainer.d.ts +8 -0
- package/dist/types/src/containers/TestContainer/TestContainer.d.ts.map +1 -0
- package/dist/types/src/containers/TestContainer/index.d.ts +2 -0
- package/dist/types/src/containers/TestContainer/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +7 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/e2e/ai.test.d.ts +2 -0
- package/dist/types/src/e2e/ai.test.d.ts.map +1 -0
- package/dist/types/src/e2e/deploy.test.d.ts +2 -0
- package/dist/types/src/e2e/deploy.test.d.ts.map +1 -0
- package/dist/types/src/hooks/deploy.d.ts +27 -30
- package/dist/types/src/hooks/deploy.d.ts.map +1 -1
- package/dist/types/src/hooks/format.d.ts +5 -4
- package/dist/types/src/hooks/format.d.ts.map +1 -1
- package/dist/types/src/hooks/index.d.ts +1 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/template.d.ts +7 -16
- package/dist/types/src/hooks/template.d.ts.map +1 -1
- package/dist/types/src/hooks/useCompiler.d.ts +7 -0
- package/dist/types/src/hooks/useCompiler.d.ts.map +1 -0
- package/dist/types/src/hooks/useCreateAndDeployScriptTemplates.d.ts.map +1 -1
- package/dist/types/src/hooks/useToolbarState.d.ts +8 -1
- package/dist/types/src/hooks/useToolbarState.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +2 -3
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/notebook/compute-graph.d.ts +58 -0
- package/dist/types/src/notebook/compute-graph.d.ts.map +1 -0
- package/dist/types/src/notebook/compute-graph.test.d.ts +2 -0
- package/dist/types/src/notebook/compute-graph.test.d.ts.map +1 -0
- package/dist/types/src/notebook/eval.d.ts +13 -0
- package/dist/types/src/notebook/eval.d.ts.map +1 -0
- package/dist/types/src/notebook/index.d.ts +1 -1
- package/dist/types/src/notebook/index.d.ts.map +1 -1
- package/dist/types/src/notebook/vfs-parser.d.ts.map +1 -1
- 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 +7 -0
- package/dist/types/src/templates/anthropic.d.ts.map +1 -0
- package/dist/types/src/templates/chess-bot.d.ts +14 -0
- package/dist/types/src/templates/chess-bot.d.ts.map +1 -0
- package/dist/types/src/templates/commentary.d.ts +15 -0
- package/dist/types/src/templates/commentary.d.ts.map +1 -0
- 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 +5 -1
- package/dist/types/src/templates/forex-effect.d.ts.map +1 -1
- package/dist/types/src/templates/forex.d.ts +5 -1
- 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 +47 -1
- package/dist/types/src/templates/index.d.ts.map +1 -1
- package/dist/types/src/templates/ping.d.ts +4 -0
- package/dist/types/src/templates/ping.d.ts.map +1 -0
- 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/simulator.test.d.ts +2 -0
- package/dist/types/src/testing/simulator.test.d.ts.map +1 -0
- 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 -84
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Notebook.d.ts +101 -0
- package/dist/types/src/types/Notebook.d.ts.map +1 -0
- 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 +5 -2
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +2 -0
- package/dist/types/src/types/types.d.ts.map +1 -0
- package/dist/types/src/util/deploy.d.ts +4 -4
- package/dist/types/src/util/deploy.d.ts.map +1 -1
- package/dist/types/src/util/functions.d.ts +3 -3
- package/dist/types/src/util/functions.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +186 -102
- package/src/ScriptPlugin.node.ts +21 -0
- package/src/ScriptPlugin.test.ts +31 -0
- package/src/ScriptPlugin.tsx +29 -96
- package/src/ScriptPlugin.workerd.ts +18 -0
- package/src/blueprints/functions/create.ts +47 -0
- package/src/blueprints/functions/definitions.ts +332 -0
- package/src/blueprints/functions/delete.ts +23 -0
- package/src/blueprints/functions/deploy.ts +71 -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 +34 -0
- package/src/blueprints/functions/query-deployed-functions.ts +35 -0
- package/src/blueprints/functions/read.ts +29 -0
- package/src/blueprints/functions/update.ts +68 -0
- package/src/blueprints/index.ts +5 -0
- package/src/blueprints/script-blueprint.ts +55 -0
- package/src/capabilities/app-graph-builder.ts +40 -58
- package/src/capabilities/blueprint-definition.ts +13 -24
- package/src/capabilities/compiler.ts +100 -23
- package/src/capabilities/create-object.ts +49 -0
- package/src/capabilities/index.ts +13 -9
- package/src/capabilities/node.ts +16 -0
- package/src/capabilities/operation-handler.ts +21 -0
- package/src/capabilities/react-surface.tsx +120 -92
- package/src/capabilities/settings.ts +26 -14
- package/src/compiler/compiler.ts +21 -3
- package/src/components/NotebookStack/NotebookCell.tsx +226 -0
- package/src/components/NotebookStack/NotebookMenu.tsx +47 -0
- package/src/components/NotebookStack/NotebookStack.stories.tsx +34 -17
- package/src/components/NotebookStack/NotebookStack.tsx +75 -91
- package/src/components/NotebookStack/index.ts +1 -0
- package/src/components/QueryEditor/QueryEditor.stories.tsx +96 -0
- package/src/components/QueryEditor/QueryEditor.tsx +49 -0
- package/src/components/QueryEditor/index.ts +5 -0
- 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 +48 -25
- package/src/components/ScriptToolbar/ScriptToolbar.tsx +43 -48
- package/src/components/TestPanel/TestPanel.tsx +125 -185
- package/src/components/TestPanel/index.ts +0 -1
- package/src/components/TypescriptEditor/TypescriptEditor.stories.tsx +27 -26
- package/src/components/TypescriptEditor/TypescriptEditor.tsx +74 -71
- package/src/components/index.ts +5 -7
- package/src/constants.ts +9 -0
- package/src/containers/DeploymentDialog/DeploymentDialog.stories.tsx +63 -0
- package/src/containers/DeploymentDialog/DeploymentDialog.tsx +99 -0
- package/src/containers/DeploymentDialog/index.ts +5 -0
- package/src/containers/NotebookArticle/NotebookArticle.stories.tsx +85 -0
- package/src/containers/NotebookArticle/NotebookArticle.tsx +255 -0
- package/src/containers/NotebookArticle/index.ts +5 -0
- package/src/containers/ScriptArticle/ScriptArticle.stories.tsx +107 -0
- package/src/containers/ScriptArticle/ScriptArticle.tsx +85 -0
- package/src/containers/ScriptArticle/index.ts +5 -0
- package/src/containers/ScriptProperties/BlueprintEditor.tsx +102 -0
- package/src/containers/ScriptProperties/FunctionBinding.tsx +83 -0
- package/src/containers/ScriptProperties/FunctionPublishing.tsx +121 -0
- package/src/containers/ScriptProperties/ScriptProperties.stories.tsx +76 -0
- package/src/containers/ScriptProperties/ScriptProperties.tsx +24 -0
- package/src/containers/ScriptProperties/index.ts +5 -0
- package/src/containers/TestContainer/TestContainer.tsx +44 -0
- package/src/containers/TestContainer/index.ts +5 -0
- package/src/containers/index.ts +11 -0
- package/src/e2e/ai.test.ts +93 -0
- package/src/e2e/deploy.test.ts +66 -0
- package/src/hooks/deploy.ts +47 -37
- package/src/hooks/format.ts +10 -5
- package/src/hooks/index.ts +1 -0
- package/src/hooks/template.ts +23 -26
- package/src/hooks/useCompiler.ts +25 -0
- package/src/hooks/useCreateAndDeployScriptTemplates.ts +15 -16
- package/src/hooks/useToolbarState.ts +29 -4
- package/src/index.ts +2 -4
- package/src/meta.ts +17 -7
- package/src/notebook/compute-graph.test.ts +82 -0
- package/src/notebook/{notebook.ts → compute-graph.ts} +76 -34
- package/src/notebook/eval.ts +105 -0
- package/src/notebook/index.ts +1 -1
- package/src/notebook/vfs-parser.ts +53 -85
- package/src/operations/create-script.ts +46 -0
- package/src/operations/index.ts +7 -0
- package/src/plugin.ts +11 -0
- package/src/templates/anthropic.ts +50 -0
- package/src/templates/chess-bot.ts +63 -0
- package/src/templates/commentary.ts +251 -0
- package/src/templates/data-generator.ts +2 -2
- package/src/templates/discord.ts +8 -8
- package/src/templates/forex-effect.ts +36 -29
- package/src/templates/forex.ts +28 -17
- package/src/templates/gmail.ts +10 -11
- package/src/templates/index.ts +34 -28
- package/src/templates/ping.ts +26 -0
- package/src/testing/index.ts +2 -1
- package/src/testing/simulator.test.ts +39 -0
- package/src/testing/test-notebook.ts +71 -0
- package/src/testing/test-script.ts +28 -0
- package/src/translations.ts +89 -81
- package/src/types/Notebook.ts +39 -0
- 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 +6 -2
- package/src/types/types.ts +5 -0
- package/src/util/deploy.ts +33 -41
- package/src/util/functions.ts +35 -30
- package/src/vite-env.d.ts +7 -0
- package/dist/lib/browser/DeploymentDialog-7FNPALCV.mjs +0 -12
- package/dist/lib/browser/NotebookContainer-ZSXYRRZB.mjs +0 -578
- package/dist/lib/browser/NotebookContainer-ZSXYRRZB.mjs.map +0 -7
- package/dist/lib/browser/ScriptContainer-24LLLTLB.mjs +0 -149
- package/dist/lib/browser/ScriptContainer-24LLLTLB.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-DPYULSME.mjs +0 -65
- package/dist/lib/browser/app-graph-builder-DPYULSME.mjs.map +0 -7
- package/dist/lib/browser/blueprint-definition-ET5KZ46I.mjs +0 -28
- package/dist/lib/browser/blueprint-definition-ET5KZ46I.mjs.map +0 -7
- package/dist/lib/browser/chunk-DXWTBOND.mjs +0 -282
- package/dist/lib/browser/chunk-DXWTBOND.mjs.map +0 -7
- package/dist/lib/browser/chunk-ETFBQURU.mjs +0 -254
- package/dist/lib/browser/chunk-ETFBQURU.mjs.map +0 -7
- package/dist/lib/browser/chunk-EZVXV6DA.mjs +0 -26
- package/dist/lib/browser/chunk-EZVXV6DA.mjs.map +0 -7
- package/dist/lib/browser/chunk-I3THDIT5.mjs +0 -90
- package/dist/lib/browser/chunk-I3THDIT5.mjs.map +0 -7
- package/dist/lib/browser/chunk-N6M34EUC.mjs +0 -112
- package/dist/lib/browser/chunk-N6M34EUC.mjs.map +0 -7
- package/dist/lib/browser/chunk-NNYSARXK.mjs +0 -153
- package/dist/lib/browser/chunk-NNYSARXK.mjs.map +0 -7
- package/dist/lib/browser/chunk-OKXN2N7M.mjs +0 -15
- package/dist/lib/browser/chunk-OKXN2N7M.mjs.map +0 -7
- package/dist/lib/browser/chunk-SRSEZWDY.mjs +0 -646
- package/dist/lib/browser/chunk-SRSEZWDY.mjs.map +0 -7
- package/dist/lib/browser/chunk-SWBZUZDX.mjs +0 -80
- package/dist/lib/browser/chunk-SWBZUZDX.mjs.map +0 -7
- package/dist/lib/browser/chunk-VFJJA4WR.mjs +0 -88
- package/dist/lib/browser/chunk-VFJJA4WR.mjs.map +0 -7
- package/dist/lib/browser/compiler-G2N2CG63.mjs +0 -98
- package/dist/lib/browser/compiler-G2N2CG63.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -266
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-FYZRLYNT.mjs +0 -105
- package/dist/lib/browser/intent-resolver-FYZRLYNT.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/react-surface-CFRYAL2P.mjs +0 -127
- package/dist/lib/browser/react-surface-CFRYAL2P.mjs.map +0 -7
- package/dist/lib/browser/settings-L3HCZRBP.mjs +0 -24
- package/dist/lib/browser/settings-L3HCZRBP.mjs.map +0 -7
- package/dist/lib/browser/types/index.mjs +0 -12
- package/dist/lib/node-esm/DeploymentDialog-AKAGR37W.mjs +0 -13
- package/dist/lib/node-esm/NotebookContainer-2O3N3XPE.mjs +0 -579
- package/dist/lib/node-esm/NotebookContainer-2O3N3XPE.mjs.map +0 -7
- package/dist/lib/node-esm/ScriptContainer-IKOB6FHQ.mjs +0 -150
- package/dist/lib/node-esm/ScriptContainer-IKOB6FHQ.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-UXJGHXSL.mjs +0 -66
- package/dist/lib/node-esm/app-graph-builder-UXJGHXSL.mjs.map +0 -7
- package/dist/lib/node-esm/blueprint-definition-AIYFOT7Q.mjs +0 -30
- package/dist/lib/node-esm/blueprint-definition-AIYFOT7Q.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-5IKGUOMI.mjs +0 -154
- package/dist/lib/node-esm/chunk-5IKGUOMI.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-7MR2L4T3.mjs +0 -283
- package/dist/lib/node-esm/chunk-7MR2L4T3.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-C33FKUSC.mjs +0 -91
- package/dist/lib/node-esm/chunk-C33FKUSC.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-NUXZQQ6P.mjs +0 -16
- package/dist/lib/node-esm/chunk-NUXZQQ6P.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-OG2SIKHE.mjs +0 -28
- package/dist/lib/node-esm/chunk-OG2SIKHE.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-OQGBKNYU.mjs +0 -90
- package/dist/lib/node-esm/chunk-OQGBKNYU.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-PMQ3D535.mjs +0 -647
- package/dist/lib/node-esm/chunk-PMQ3D535.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-U4CZGISN.mjs +0 -255
- package/dist/lib/node-esm/chunk-U4CZGISN.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-VRSDE4CI.mjs +0 -114
- package/dist/lib/node-esm/chunk-VRSDE4CI.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ZF5ULKED.mjs +0 -81
- package/dist/lib/node-esm/chunk-ZF5ULKED.mjs.map +0 -7
- package/dist/lib/node-esm/compiler-PLDAZ5GJ.mjs +0 -99
- package/dist/lib/node-esm/compiler-PLDAZ5GJ.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -267
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-6J3CFL5T.mjs +0 -106
- package/dist/lib/node-esm/intent-resolver-6J3CFL5T.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/react-surface-NPKEO7SA.mjs +0 -128
- package/dist/lib/node-esm/react-surface-NPKEO7SA.mjs.map +0 -7
- package/dist/lib/node-esm/settings-YWGZP4EW.mjs +0 -25
- package/dist/lib/node-esm/settings-YWGZP4EW.mjs.map +0 -7
- package/dist/lib/node-esm/templates/index.mjs +0 -10
- package/dist/lib/node-esm/types/index.mjs +0 -13
- package/dist/types/src/capabilities/artifact-definition.d.ts +0 -11
- package/dist/types/src/capabilities/artifact-definition.d.ts.map +0 -1
- package/dist/types/src/capabilities/capabilities.d.ts +0 -5
- package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
- package/dist/types/src/components/DeploymentDialog/DeploymentDialog.d.ts.map +0 -1
- package/dist/types/src/components/DeploymentDialog/DeploymentDialog.stories.d.ts +0 -230
- package/dist/types/src/components/DeploymentDialog/DeploymentDialog.stories.d.ts.map +0 -1
- package/dist/types/src/components/DeploymentDialog/index.d.ts +0 -4
- package/dist/types/src/components/DeploymentDialog/index.d.ts.map +0 -1
- package/dist/types/src/components/FrameContainer/FrameContainer.d.ts +0 -12
- 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/components/NotebookContainer.d.ts +0 -10
- package/dist/types/src/components/NotebookContainer.d.ts.map +0 -1
- package/dist/types/src/components/NotebookContainer.stories.d.ts +0 -231
- package/dist/types/src/components/NotebookContainer.stories.d.ts.map +0 -1
- package/dist/types/src/components/ScriptContainer.d.ts +0 -12
- package/dist/types/src/components/ScriptContainer.d.ts.map +0 -1
- package/dist/types/src/components/Settings/ScriptObjectSettings.d.ts +0 -8
- package/dist/types/src/components/Settings/ScriptObjectSettings.d.ts.map +0 -1
- package/dist/types/src/components/Settings/ScriptPluginSettings.d.ts +0 -6
- package/dist/types/src/components/Settings/ScriptPluginSettings.d.ts.map +0 -1
- package/dist/types/src/components/Settings/index.d.ts +0 -3
- package/dist/types/src/components/Settings/index.d.ts.map +0 -1
- package/dist/types/src/components/TestPanel/TestContainer.d.ts +0 -8
- package/dist/types/src/components/TestPanel/TestContainer.d.ts.map +0 -1
- package/dist/types/src/events.d.ts +0 -4
- package/dist/types/src/events.d.ts.map +0 -1
- package/dist/types/src/notebook/notebook.d.ts +0 -39
- package/dist/types/src/notebook/notebook.d.ts.map +0 -1
- package/dist/types/src/notebook/notebook.test.d.ts +0 -2
- package/dist/types/src/notebook/notebook.test.d.ts.map +0 -1
- package/dist/types/src/templates/chat.d.ts +0 -6
- package/dist/types/src/templates/chat.d.ts.map +0 -1
- package/dist/types/src/templates/chess.d.ts +0 -3
- package/dist/types/src/templates/chess.d.ts.map +0 -1
- package/dist/types/src/templates/echo.d.ts +0 -6
- package/dist/types/src/templates/echo.d.ts.map +0 -1
- package/dist/types/src/testing/data.d.ts +0 -10
- package/dist/types/src/testing/data.d.ts.map +0 -1
- package/dist/types/src/types/actions.d.ts +0 -58
- package/dist/types/src/types/actions.d.ts.map +0 -1
- package/dist/types/src/types/schema.d.ts +0 -35
- package/dist/types/src/types/schema.d.ts.map +0 -1
- package/src/capabilities/artifact-definition.ts +0 -225
- package/src/capabilities/capabilities.ts +0 -12
- package/src/capabilities/intent-resolver.ts +0 -87
- package/src/components/DeploymentDialog/DeploymentDialog.stories.tsx +0 -53
- package/src/components/DeploymentDialog/DeploymentDialog.tsx +0 -106
- package/src/components/DeploymentDialog/index.ts +0 -9
- package/src/components/FrameContainer/FrameContainer.tsx +0 -84
- package/src/components/FrameContainer/frame.html +0 -25
- package/src/components/FrameContainer/frame.tsx +0 -51
- package/src/components/FrameContainer/index.ts +0 -5
- package/src/components/NotebookContainer.stories.tsx +0 -36
- package/src/components/NotebookContainer.tsx +0 -82
- package/src/components/ScriptContainer.tsx +0 -69
- package/src/components/Settings/ScriptObjectSettings.tsx +0 -286
- package/src/components/Settings/ScriptPluginSettings.tsx +0 -61
- package/src/components/Settings/index.ts +0 -6
- package/src/components/TestPanel/TestContainer.tsx +0 -27
- package/src/events.ts +0 -11
- package/src/notebook/notebook.test.ts +0 -38
- package/src/templates/chat.ts +0 -96
- package/src/templates/chess.ts +0 -49
- package/src/templates/echo.ts +0 -8
- package/src/testing/data.ts +0 -37
- package/src/types/actions.ts +0 -49
- package/src/types/schema.ts +0 -42
- /package/dist/lib/{browser/templates → neutral/blueprints}/index.mjs.map +0 -0
- /package/dist/lib/{browser/DeploymentDialog-7FNPALCV.mjs.map → neutral/chunk-J5LGTIGS.mjs.map} +0 -0
- /package/dist/lib/{browser/types → neutral}/index.mjs.map +0 -0
- /package/dist/lib/{node-esm/DeploymentDialog-AKAGR37W.mjs.map → neutral/meta.mjs.map} +0 -0
- /package/dist/lib/{node-esm/templates → neutral/operations}/index.mjs.map +0 -0
- /package/dist/lib/{node-esm/types → neutral/templates}/index.mjs.map +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.getURI(loaded),
|
|
65
|
+
};
|
|
66
|
+
}),
|
|
67
|
+
),
|
|
68
|
+
);
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Blueprint, Template } from '@dxos/compute';
|
|
6
|
+
import { trim } from '@dxos/util';
|
|
7
|
+
|
|
8
|
+
import {
|
|
9
|
+
Create,
|
|
10
|
+
Read,
|
|
11
|
+
Update,
|
|
12
|
+
Delete,
|
|
13
|
+
Deploy,
|
|
14
|
+
Invoke,
|
|
15
|
+
InspectInvocations,
|
|
16
|
+
QueryDeployedFunctions,
|
|
17
|
+
InstallFunction,
|
|
18
|
+
} from './functions';
|
|
19
|
+
|
|
20
|
+
const BLUEPRINT_KEY = 'org.dxos.blueprint.script';
|
|
21
|
+
|
|
22
|
+
const make = () =>
|
|
23
|
+
Blueprint.make({
|
|
24
|
+
key: BLUEPRINT_KEY,
|
|
25
|
+
name: 'Script',
|
|
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
|
+
}),
|
|
40
|
+
instructions: Template.make({
|
|
41
|
+
source: trim`
|
|
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.
|
|
46
|
+
`,
|
|
47
|
+
}),
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
const blueprint: Blueprint.Definition = {
|
|
51
|
+
key: BLUEPRINT_KEY,
|
|
52
|
+
make,
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export default blueprint;
|
|
@@ -2,64 +2,46 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
6
|
-
import * as Function from 'effect/Function';
|
|
7
|
-
import * as Option from 'effect/Option';
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
8
6
|
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { createExtension } from '@dxos/plugin-graph';
|
|
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';
|
|
14
11
|
|
|
15
|
-
import { meta } from '
|
|
12
|
+
import { meta } from '#meta';
|
|
16
13
|
|
|
17
|
-
export default (
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
{
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
id: [node.id, 'logs'].join(ATTENDABLE_PATH_SEPARATOR),
|
|
52
|
-
type: PLANK_COMPANION_TYPE,
|
|
53
|
-
data: 'logs',
|
|
54
|
-
properties: {
|
|
55
|
-
label: ['script logs label', { ns: meta.id }],
|
|
56
|
-
icon: 'ph--clock-countdown--regular',
|
|
57
|
-
disposition: 'hidden',
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
]),
|
|
61
|
-
Option.getOrElse(() => []),
|
|
62
|
-
),
|
|
63
|
-
),
|
|
64
|
-
}),
|
|
65
|
-
]);
|
|
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
|
+
);
|
|
@@ -2,29 +2,18 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
6
|
-
import { Blueprint, Template } from '@dxos/blueprints';
|
|
7
|
-
import { type FunctionDefinition } from '@dxos/functions';
|
|
8
|
-
import { trim } from '@dxos/util';
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
9
6
|
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
import { Capability } from '@dxos/app-framework';
|
|
8
|
+
import { AppCapabilities } from '@dxos/app-toolkit';
|
|
9
|
+
// eslint-disable-next-line unused-imports/no-unused-imports
|
|
10
|
+
import type { Blueprint } from '@dxos/compute';
|
|
12
11
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
tools: Blueprint.toolDefinitions({ functions, tools }),
|
|
22
|
-
instructions: Template.make({
|
|
23
|
-
source: trim`
|
|
24
|
-
You can create and update scripts which contain Typescript code.
|
|
25
|
-
`,
|
|
26
|
-
}),
|
|
27
|
-
}),
|
|
28
|
-
),
|
|
29
|
-
];
|
|
30
|
-
};
|
|
12
|
+
import { ScriptBlueprint } from '#blueprints';
|
|
13
|
+
|
|
14
|
+
const blueprintDefinition = Capability.makeModule<
|
|
15
|
+
[],
|
|
16
|
+
Capability.Capability<typeof AppCapabilities.BlueprintDefinition>[]
|
|
17
|
+
>(() => Effect.succeed([Capability.contributes(AppCapabilities.BlueprintDefinition, ScriptBlueprint)]));
|
|
18
|
+
|
|
19
|
+
export default blueprintDefinition;
|
|
@@ -2,33 +2,110 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
import * as FetchHttpClient from '@effect/platform/FetchHttpClient';
|
|
6
|
+
import * as HttpClient from '@effect/platform/HttpClient';
|
|
7
|
+
import * as Effect from 'effect/Effect';
|
|
8
|
+
import * as Schedule from 'effect/Schedule';
|
|
9
|
+
import * as Schema from 'effect/Schema';
|
|
6
10
|
import wasmUrl from 'esbuild-wasm/esbuild.wasm?url';
|
|
11
|
+
import * as ts from 'typescript';
|
|
7
12
|
|
|
8
|
-
import {
|
|
9
|
-
import { initializeBundler } from '@dxos/functions/bundler';
|
|
13
|
+
import { Capability } from '@dxos/app-framework';
|
|
14
|
+
import { initializeBundler } from '@dxos/functions-runtime/bundler';
|
|
15
|
+
import { log } from '@dxos/log';
|
|
16
|
+
import { trim } from '@dxos/util';
|
|
17
|
+
|
|
18
|
+
import { ScriptCapabilities } from '#types';
|
|
10
19
|
|
|
11
20
|
import { Compiler } from '../compiler';
|
|
12
21
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
22
|
+
// TODO(burdon): Document.
|
|
23
|
+
const SCRIPT_PACKAGES_BUCKET = 'https://pub-5745ae82e450484aa28f75fc6a175935.r2.dev/dev/';
|
|
24
|
+
const DECLARATION_EXTS = ['.d.ts', '.d.mts'];
|
|
25
|
+
const NO_TYPES = true; // Types temopararly disabled due to compiler erorrs.
|
|
26
|
+
|
|
27
|
+
export default Capability.makeModule(() =>
|
|
28
|
+
Effect.gen(function* () {
|
|
29
|
+
yield* Effect.tryPromise({
|
|
30
|
+
try: () => initializeBundler({ wasmUrl }),
|
|
31
|
+
catch: (error) => new Error(`Failed to initialize bundler: ${error}`),
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
const runtimeModules = yield* fetchRuntimeModules().pipe(Effect.provide(FetchHttpClient.layer));
|
|
35
|
+
|
|
36
|
+
const compiler = new Compiler({
|
|
37
|
+
target: ts.ScriptTarget.ES2022,
|
|
38
|
+
lib: ['lib.es2022.d.ts', 'lib.dom.d.ts'],
|
|
39
|
+
skipLibCheck: true,
|
|
40
|
+
moduleResolution: ts.ModuleResolutionKind.Bundler,
|
|
41
|
+
allowImportingTsExtensions: true,
|
|
42
|
+
noEmit: true,
|
|
43
|
+
strict: true,
|
|
44
|
+
esModuleInterop: true,
|
|
45
|
+
paths: Object.fromEntries(runtimeModules.map((mod: any) => [mod.moduleName, [`./src/${mod.filename}`]])),
|
|
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
|
+
});
|
|
56
|
+
if (!NO_TYPES) {
|
|
57
|
+
for (const mod of runtimeModules) {
|
|
58
|
+
compiler.setFile(`/src/${mod.filename}`, mod.content);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return Capability.contributes(ScriptCapabilities.Compiler, compiler);
|
|
63
|
+
}),
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
const fetchRuntimeModules = Effect.fnUntraced(function* () {
|
|
67
|
+
// { key, size, contentType }
|
|
68
|
+
const manifest = yield* HttpClient.get(new URL('manifest.json', SCRIPT_PACKAGES_BUCKET)).pipe(
|
|
69
|
+
Effect.flatMap((_) => _.json),
|
|
70
|
+
Effect.flatMap(
|
|
71
|
+
Schema.decodeUnknown(
|
|
72
|
+
Schema.Struct({
|
|
73
|
+
files: Schema.Array(
|
|
74
|
+
Schema.Struct({
|
|
75
|
+
key: Schema.String,
|
|
76
|
+
}),
|
|
77
|
+
),
|
|
78
|
+
}),
|
|
79
|
+
),
|
|
80
|
+
),
|
|
81
|
+
Effect.map((manifest) => ({ ...manifest, files: manifest.files.map((f) => f.key) })),
|
|
82
|
+
);
|
|
83
|
+
|
|
84
|
+
const declarationFiles = manifest.files.filter((file) => DECLARATION_EXTS.some((ext) => file.endsWith(ext)));
|
|
85
|
+
|
|
86
|
+
let fetched = 0;
|
|
87
|
+
const modules = yield* Effect.forEach(
|
|
88
|
+
declarationFiles,
|
|
89
|
+
Effect.fnUntraced(
|
|
90
|
+
function* (filename) {
|
|
91
|
+
const response = yield* HttpClient.get(new URL(filename, SCRIPT_PACKAGES_BUCKET)).pipe(
|
|
92
|
+
Effect.retry(Schedule.exponential(1_000).pipe(Schedule.compose(Schedule.recurs(3)))),
|
|
93
|
+
);
|
|
94
|
+
const content = yield* response.text;
|
|
95
|
+
const moduleName = filename.replace(/\.d\.(ts|mts)$/, '');
|
|
96
|
+
fetched++;
|
|
97
|
+
|
|
98
|
+
return {
|
|
99
|
+
moduleName,
|
|
100
|
+
filename,
|
|
101
|
+
content,
|
|
102
|
+
};
|
|
103
|
+
},
|
|
104
|
+
Effect.retry(Schedule.exponential(1_000).pipe(Schedule.compose(Schedule.recurs(3)))),
|
|
105
|
+
),
|
|
106
|
+
{ concurrency: 20 },
|
|
30
107
|
);
|
|
31
|
-
await initializeBundler({ wasmUrl });
|
|
32
108
|
|
|
33
|
-
|
|
34
|
-
|
|
109
|
+
log.info('runtime modules', { manifest: manifest.files.length, files: declarationFiles.length, fetched });
|
|
110
|
+
return modules;
|
|
111
|
+
});
|
|
@@ -0,0 +1,49 @@
|
|
|
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 { Type } from '@dxos/echo';
|
|
10
|
+
import { SpaceOperation } from '@dxos/plugin-space';
|
|
11
|
+
import { SpaceCapabilities } from '@dxos/plugin-space';
|
|
12
|
+
|
|
13
|
+
import { ScriptOperation } from '#types';
|
|
14
|
+
import { Notebook } from '#types';
|
|
15
|
+
|
|
16
|
+
export default Capability.makeModule(
|
|
17
|
+
Effect.fnUntraced(function* () {
|
|
18
|
+
return [
|
|
19
|
+
Capability.contributes(SpaceCapabilities.CreateObjectEntry, {
|
|
20
|
+
id: Type.getTypename(Script.Script),
|
|
21
|
+
inputSchema: ScriptOperation.ScriptProps,
|
|
22
|
+
createObject: (props, options) =>
|
|
23
|
+
Effect.gen(function* () {
|
|
24
|
+
const { object } = yield* Operation.invoke(ScriptOperation.CreateScript, props);
|
|
25
|
+
return yield* Operation.invoke(SpaceOperation.AddObject, {
|
|
26
|
+
object,
|
|
27
|
+
target: options.target,
|
|
28
|
+
hidden: true,
|
|
29
|
+
targetNodeId: options.targetNodeId,
|
|
30
|
+
});
|
|
31
|
+
}),
|
|
32
|
+
}),
|
|
33
|
+
Capability.contributes(SpaceCapabilities.CreateObjectEntry, {
|
|
34
|
+
id: Type.getTypename(Notebook.Notebook),
|
|
35
|
+
inputSchema: ScriptOperation.NotebookProps,
|
|
36
|
+
createObject: (props, options) =>
|
|
37
|
+
Effect.gen(function* () {
|
|
38
|
+
const object = Notebook.make(props);
|
|
39
|
+
return yield* Operation.invoke(SpaceOperation.AddObject, {
|
|
40
|
+
object,
|
|
41
|
+
target: options.target,
|
|
42
|
+
hidden: true,
|
|
43
|
+
targetNodeId: options.targetNodeId,
|
|
44
|
+
});
|
|
45
|
+
}),
|
|
46
|
+
}),
|
|
47
|
+
];
|
|
48
|
+
}),
|
|
49
|
+
);
|
|
@@ -2,13 +2,17 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
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';
|
|
6
8
|
|
|
7
|
-
export const AppGraphBuilder = lazy(() => import('./app-graph-builder'));
|
|
8
|
-
export const BlueprintDefinition = lazy(() => import('./blueprint-definition'));
|
|
9
|
-
export const
|
|
10
|
-
export const
|
|
11
|
-
export const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
+
);
|