@dxos/plugin-script 0.8.4-main.f9ba587 → 0.8.4-staging.60fe92afc8
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-QW26LOKU.mjs +79 -0
- package/dist/lib/neutral/ScriptArticle-QW26LOKU.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-PJ7I3JIQ.mjs +15 -0
- package/dist/lib/neutral/blueprint-definition-PJ7I3JIQ.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-BKXYHCJ6.mjs +8 -0
- package/dist/lib/neutral/chunk-BKXYHCJ6.mjs.map +7 -0
- package/dist/lib/neutral/chunk-HABDH5SS.mjs +123 -0
- package/dist/lib/neutral/chunk-HABDH5SS.mjs.map +7 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/neutral/chunk-PHKPB5JN.mjs +96 -0
- package/dist/lib/neutral/chunk-PHKPB5JN.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/chunk-XFM63AKT.mjs +8 -0
- package/dist/lib/neutral/chunk-XFM63AKT.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-AAA53WDL.mjs +46 -0
- package/dist/lib/neutral/create-AAA53WDL.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-P46JOEHH.mjs +45 -0
- package/dist/lib/neutral/create-script-P46JOEHH.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-TAOYDT4H.mjs +59 -0
- package/dist/lib/neutral/inspect-invocations-TAOYDT4H.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-YMUADD7Y.mjs +18 -0
- package/dist/lib/neutral/operation-handler-YMUADD7Y.mjs.map +7 -0
- package/dist/lib/neutral/operations/index.mjs +8 -0
- package/dist/lib/neutral/operations/index.mjs.map +7 -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/neutral/templates/index.mjs +10 -0
- package/dist/lib/neutral/templates/index.mjs.map +7 -0
- 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-CO7B6UBS.mjs +63 -0
- package/dist/lib/neutral/update-CO7B6UBS.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 +6 -0
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -0
- 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 +20 -7
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/node.d.ts +19 -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 +16 -0
- package/dist/types/src/components/NotebookStack/NotebookStack.d.ts.map +1 -0
- package/dist/types/src/components/NotebookStack/NotebookStack.stories.d.ts +240 -0
- package/dist/types/src/components/NotebookStack/NotebookStack.stories.d.ts.map +1 -0
- package/dist/types/src/components/NotebookStack/index.d.ts +3 -0
- package/dist/types/src/components/NotebookStack/index.d.ts.map +1 -0
- 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 +237 -10
- 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 +8 -2
- package/dist/types/src/components/TypescriptEditor/TypescriptEditor.d.ts.map +1 -1
- package/dist/types/src/components/TypescriptEditor/TypescriptEditor.stories.d.ts +13 -4
- package/dist/types/src/components/TypescriptEditor/TypescriptEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +6 -7
- 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/containers/DeploymentDialog/DeploymentDialog.d.ts +9 -0
- 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 +31 -33
- 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 +3 -3
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -3
- 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 +2 -0
- package/dist/types/src/notebook/index.d.ts.map +1 -0
- package/dist/types/src/notebook/vfs-parser.d.ts +74 -0
- package/dist/types/src/notebook/vfs-parser.d.ts.map +1 -0
- package/dist/types/src/notebook/vfs-parser.test.d.ts +2 -0
- package/dist/types/src/notebook/vfs-parser.test.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 +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 +49 -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 +3 -0
- package/dist/types/src/testing/index.d.ts.map +1 -0
- 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 -63
- 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 +6 -0
- package/dist/types/src/types/index.d.ts.map +1 -0
- 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 +7 -7
- package/dist/types/src/util/deploy.d.ts.map +1 -1
- package/dist/types/src/util/functions.d.ts +6 -3
- package/dist/types/src/util/functions.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +191 -95
- package/src/ScriptPlugin.node.ts +21 -0
- package/src/ScriptPlugin.test.ts +31 -0
- package/src/ScriptPlugin.tsx +36 -81
- 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 -57
- package/src/capabilities/blueprint-definition.ts +19 -0
- package/src/capabilities/compiler.ts +100 -22
- package/src/capabilities/create-object.ts +49 -0
- package/src/capabilities/index.ts +18 -9
- package/src/capabilities/node.ts +21 -0
- package/src/capabilities/operation-handler.ts +21 -0
- package/src/capabilities/react-surface.tsx +121 -80
- package/src/capabilities/settings.ts +26 -14
- package/src/compiler/compiler.ts +22 -4
- package/src/components/NotebookStack/NotebookCell.tsx +226 -0
- package/src/components/NotebookStack/NotebookMenu.tsx +47 -0
- package/src/components/NotebookStack/NotebookStack.stories.tsx +53 -0
- package/src/components/NotebookStack/NotebookStack.tsx +97 -0
- package/src/components/NotebookStack/index.ts +6 -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 +56 -17
- package/src/components/ScriptToolbar/ScriptToolbar.tsx +43 -41
- package/src/components/TestPanel/TestPanel.tsx +125 -185
- package/src/components/TestPanel/index.ts +0 -1
- package/src/components/TypescriptEditor/TypescriptEditor.stories.tsx +89 -34
- package/src/components/TypescriptEditor/TypescriptEditor.tsx +88 -78
- package/src/components/index.ts +6 -5
- 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 +54 -45
- package/src/hooks/format.ts +10 -5
- package/src/hooks/index.ts +1 -0
- package/src/hooks/template.ts +23 -25
- package/src/hooks/useCompiler.ts +25 -0
- package/src/hooks/useCreateAndDeployScriptTemplates.ts +16 -16
- package/src/hooks/useToolbarState.ts +29 -4
- package/src/index.ts +3 -4
- package/src/meta.ts +17 -9
- package/src/notebook/compute-graph.test.ts +82 -0
- package/src/notebook/compute-graph.ts +230 -0
- package/src/notebook/eval.ts +105 -0
- package/src/notebook/index.ts +5 -0
- package/src/notebook/vfs-parser.test.ts +149 -0
- package/src/notebook/vfs-parser.ts +458 -0
- 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 +252 -0
- package/src/templates/data-generator.ts +11 -5
- package/src/templates/discord.ts +18 -10
- package/src/templates/forex-effect.ts +36 -25
- package/src/templates/forex.ts +28 -15
- package/src/templates/gmail.ts +42 -72
- package/src/templates/index.ts +36 -28
- package/src/templates/ping.ts +26 -0
- package/src/testing/index.ts +6 -0
- 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 +93 -63
- 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 +10 -0
- package/src/types/types.ts +5 -0
- package/src/util/deploy.ts +41 -62
- package/src/util/functions.ts +60 -26
- package/src/vite-env.d.ts +7 -0
- package/dist/lib/browser/DeploymentDialog-RIGSJM6A.mjs +0 -12
- package/dist/lib/browser/ScriptContainer-BAN4WZHG.mjs +0 -261
- package/dist/lib/browser/ScriptContainer-BAN4WZHG.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-HLQ7K3BT.mjs +0 -64
- package/dist/lib/browser/app-graph-builder-HLQ7K3BT.mjs.map +0 -7
- package/dist/lib/browser/artifact-definition-KMBAZFRR.mjs +0 -249
- package/dist/lib/browser/artifact-definition-KMBAZFRR.mjs.map +0 -7
- package/dist/lib/browser/chunk-5TVBECWH.mjs +0 -15
- package/dist/lib/browser/chunk-5TVBECWH.mjs.map +0 -7
- package/dist/lib/browser/chunk-7CIKV2MG.mjs +0 -364
- package/dist/lib/browser/chunk-7CIKV2MG.mjs.map +0 -7
- package/dist/lib/browser/chunk-EEL5O3IC.mjs +0 -40
- package/dist/lib/browser/chunk-EEL5O3IC.mjs.map +0 -7
- package/dist/lib/browser/chunk-OORJVKHC.mjs +0 -233
- package/dist/lib/browser/chunk-OORJVKHC.mjs.map +0 -7
- package/dist/lib/browser/chunk-QHVTSNHD.mjs +0 -153
- package/dist/lib/browser/chunk-QHVTSNHD.mjs.map +0 -7
- package/dist/lib/browser/chunk-QYAREHGH.mjs +0 -28
- package/dist/lib/browser/chunk-QYAREHGH.mjs.map +0 -7
- package/dist/lib/browser/chunk-QYLAH5AK.mjs +0 -557
- package/dist/lib/browser/chunk-QYLAH5AK.mjs.map +0 -7
- package/dist/lib/browser/compiler-CXCUA4UQ.mjs +0 -82
- package/dist/lib/browser/compiler-CXCUA4UQ.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -206
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-HQRUYTML.mjs +0 -90
- package/dist/lib/browser/intent-resolver-HQRUYTML.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/react-surface-FNLARN5M.mjs +0 -105
- package/dist/lib/browser/react-surface-FNLARN5M.mjs.map +0 -7
- package/dist/lib/browser/settings-XU54CGQD.mjs +0 -24
- package/dist/lib/browser/settings-XU54CGQD.mjs.map +0 -7
- package/dist/lib/browser/types.mjs +0 -13
- package/dist/lib/node-esm/DeploymentDialog-6Z7JH3VO.mjs +0 -13
- package/dist/lib/node-esm/ScriptContainer-RB5CSIZ7.mjs +0 -262
- package/dist/lib/node-esm/ScriptContainer-RB5CSIZ7.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-7EYIHWH4.mjs +0 -65
- package/dist/lib/node-esm/app-graph-builder-7EYIHWH4.mjs.map +0 -7
- package/dist/lib/node-esm/artifact-definition-EBLXG5AR.mjs +0 -250
- package/dist/lib/node-esm/artifact-definition-EBLXG5AR.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-35M3CHYE.mjs +0 -16
- package/dist/lib/node-esm/chunk-35M3CHYE.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ABAPR7VQ.mjs +0 -234
- package/dist/lib/node-esm/chunk-ABAPR7VQ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-AHXJ6NQU.mjs +0 -30
- package/dist/lib/node-esm/chunk-AHXJ6NQU.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HD6MDK3H.mjs +0 -558
- package/dist/lib/node-esm/chunk-HD6MDK3H.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ORZMINLO.mjs +0 -365
- package/dist/lib/node-esm/chunk-ORZMINLO.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-OVSJYR6O.mjs +0 -41
- package/dist/lib/node-esm/chunk-OVSJYR6O.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-YVJGDDNV.mjs +0 -154
- package/dist/lib/node-esm/chunk-YVJGDDNV.mjs.map +0 -7
- package/dist/lib/node-esm/compiler-EPFKQXPE.mjs +0 -83
- package/dist/lib/node-esm/compiler-EPFKQXPE.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -207
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-XLV6FPWH.mjs +0 -91
- package/dist/lib/node-esm/intent-resolver-XLV6FPWH.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/react-surface-BTYC7MGG.mjs +0 -106
- package/dist/lib/node-esm/react-surface-BTYC7MGG.mjs.map +0 -7
- package/dist/lib/node-esm/settings-QCMDG2MZ.mjs +0 -25
- package/dist/lib/node-esm/settings-QCMDG2MZ.mjs.map +0 -7
- package/dist/lib/node-esm/types.mjs +0 -14
- 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 +0 -11
- package/dist/types/src/components/DeploymentDialog/DeploymentDialog.d.ts.map +0 -1
- package/dist/types/src/components/DeploymentDialog/DeploymentDialog.stories.d.ts +0 -18
- 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/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/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/types.d.ts +0 -40
- package/dist/types/src/types.d.ts.map +0 -1
- package/src/capabilities/artifact-definition.ts +0 -228
- package/src/capabilities/capabilities.ts +0 -12
- package/src/capabilities/intent-resolver.ts +0 -80
- package/src/components/DeploymentDialog/DeploymentDialog.stories.tsx +0 -39
- package/src/components/DeploymentDialog/DeploymentDialog.tsx +0 -112
- package/src/components/DeploymentDialog/index.ts +0 -9
- package/src/components/FrameContainer/FrameContainer.tsx +0 -83
- 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/ScriptContainer.tsx +0 -67
- package/src/components/Settings/ScriptObjectSettings.tsx +0 -206
- package/src/components/Settings/ScriptPluginSettings.tsx +0 -71
- package/src/components/Settings/index.ts +0 -6
- package/src/components/TestPanel/TestContainer.tsx +0 -26
- package/src/events.ts +0 -11
- package/src/templates/chat.ts +0 -96
- package/src/templates/chess.ts +0 -47
- package/src/templates/echo.ts +0 -8
- package/src/types.ts +0 -42
- /package/dist/lib/{browser/DeploymentDialog-RIGSJM6A.mjs.map → neutral/blueprints/index.mjs.map} +0 -0
- /package/dist/lib/{browser/types.mjs.map → neutral/chunk-J5LGTIGS.mjs.map} +0 -0
- /package/dist/lib/{node-esm/DeploymentDialog-6Z7JH3VO.mjs.map → neutral/index.mjs.map} +0 -0
- /package/dist/lib/{node-esm/types.mjs.map → neutral/meta.mjs.map} +0 -0
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { describe, expect, test } from 'vitest';
|
|
6
|
+
|
|
7
|
+
import { NotebookVirtualParser, VirtualTypeScriptParser } from './vfs-parser';
|
|
8
|
+
|
|
9
|
+
describe('vfs-parser', () => {
|
|
10
|
+
test('parse simple assignments', () => {
|
|
11
|
+
const parser = new VirtualTypeScriptParser();
|
|
12
|
+
|
|
13
|
+
const tests = [
|
|
14
|
+
{
|
|
15
|
+
input: 'const a = 1',
|
|
16
|
+
expected: {
|
|
17
|
+
name: 'a',
|
|
18
|
+
type: 'variable',
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
input: 'a = 1',
|
|
23
|
+
expected: {
|
|
24
|
+
name: 'a',
|
|
25
|
+
type: 'variable',
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
];
|
|
29
|
+
|
|
30
|
+
tests.forEach(({ input, expected }) => {
|
|
31
|
+
const result = parser.parseExpression(input);
|
|
32
|
+
expect(result, input).toMatchObject(expected);
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
test('parse variable with references', () => {
|
|
37
|
+
const parser = new VirtualTypeScriptParser();
|
|
38
|
+
|
|
39
|
+
const tests = [
|
|
40
|
+
{
|
|
41
|
+
input: 'const y = x * 2',
|
|
42
|
+
expected: {
|
|
43
|
+
name: 'y',
|
|
44
|
+
type: 'variable',
|
|
45
|
+
references: ['x'],
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
input: 'y = x * 2',
|
|
50
|
+
expected: {
|
|
51
|
+
name: 'y',
|
|
52
|
+
type: 'variable',
|
|
53
|
+
references: ['x'],
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
];
|
|
57
|
+
|
|
58
|
+
tests.forEach(({ input, expected }) => {
|
|
59
|
+
const result = parser.parseExpression(input);
|
|
60
|
+
expect(result, input).toMatchObject(expected);
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
test('parse simple expression with references', () => {
|
|
65
|
+
const parser = new VirtualTypeScriptParser();
|
|
66
|
+
|
|
67
|
+
const result = parser.parseExpression('(a + b) * c');
|
|
68
|
+
expect(result).toMatchObject({
|
|
69
|
+
references: ['a', 'b', 'c'],
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
test('parse single expression', () => {
|
|
74
|
+
const parser = new VirtualTypeScriptParser();
|
|
75
|
+
|
|
76
|
+
const result = parser.parseExpression('const add = (a: number, b: number): number => a + b;');
|
|
77
|
+
expect(result).toMatchObject({
|
|
78
|
+
name: 'add',
|
|
79
|
+
type: 'function',
|
|
80
|
+
valueType: expect.stringContaining('(a: number, b: number) => number'),
|
|
81
|
+
returnType: 'number',
|
|
82
|
+
parameters: [
|
|
83
|
+
{ name: 'a', type: 'number' },
|
|
84
|
+
{ name: 'b', type: 'number' },
|
|
85
|
+
],
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
test('analyze multiple files', () => {
|
|
90
|
+
const parser = new VirtualTypeScriptParser();
|
|
91
|
+
|
|
92
|
+
const files = [
|
|
93
|
+
{
|
|
94
|
+
filename: '/test.ts',
|
|
95
|
+
content: 'export const PI = 3.14159;\nexport function square(x: number): number { return x * x; }',
|
|
96
|
+
},
|
|
97
|
+
];
|
|
98
|
+
|
|
99
|
+
const results = parser.analyzeFiles(files);
|
|
100
|
+
expect(results).toHaveLength(2);
|
|
101
|
+
expect(results[0]).toMatchObject({
|
|
102
|
+
name: 'PI',
|
|
103
|
+
type: 'variable',
|
|
104
|
+
valueType: '3.14159',
|
|
105
|
+
});
|
|
106
|
+
expect(results[1]).toMatchObject({
|
|
107
|
+
name: 'square',
|
|
108
|
+
type: 'function',
|
|
109
|
+
returnType: 'number',
|
|
110
|
+
parameters: [{ name: 'x', type: 'number' }],
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
test('notebook cell analysis', () => {
|
|
115
|
+
const parser = new NotebookVirtualParser();
|
|
116
|
+
|
|
117
|
+
const cells = [
|
|
118
|
+
{ id: 'cell1', code: 'const x: number = 10;' },
|
|
119
|
+
{ id: 'cell2', code: 'const y = x * 2;' },
|
|
120
|
+
{ id: 'cell3', code: 'console.log(y);' },
|
|
121
|
+
];
|
|
122
|
+
|
|
123
|
+
const analysis = parser.analyzeNotebook(cells);
|
|
124
|
+
|
|
125
|
+
// Cell 1 exports x.
|
|
126
|
+
const cell1 = analysis.get('cell1');
|
|
127
|
+
expect(cell1?.exports).toHaveLength(1);
|
|
128
|
+
expect(cell1?.exports[0]).toMatchObject({
|
|
129
|
+
name: 'x',
|
|
130
|
+
type: 'variable',
|
|
131
|
+
valueType: 'number',
|
|
132
|
+
});
|
|
133
|
+
expect(cell1?.imports).toHaveLength(0);
|
|
134
|
+
|
|
135
|
+
// Cell 2 imports x and exports y.
|
|
136
|
+
const cell2 = analysis.get('cell2');
|
|
137
|
+
expect(cell2?.exports).toHaveLength(1);
|
|
138
|
+
expect(cell2?.exports[0]).toMatchObject({
|
|
139
|
+
name: 'y',
|
|
140
|
+
type: 'variable',
|
|
141
|
+
});
|
|
142
|
+
expect(cell2?.imports).toContain('x');
|
|
143
|
+
|
|
144
|
+
// Cell 3 imports y.
|
|
145
|
+
const cell3 = analysis.get('cell3');
|
|
146
|
+
expect(cell3?.exports).toHaveLength(0);
|
|
147
|
+
expect(cell3?.imports).toContain('y');
|
|
148
|
+
});
|
|
149
|
+
});
|
|
@@ -0,0 +1,458 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { createSystem, createVirtualTypeScriptEnvironment } from '@typescript/vfs';
|
|
6
|
+
import ts from 'typescript';
|
|
7
|
+
|
|
8
|
+
import { invariant } from '@dxos/invariant';
|
|
9
|
+
|
|
10
|
+
import { builtIns, systemDefinitions } from './eval';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Default system definitions.
|
|
14
|
+
*/
|
|
15
|
+
const systemFiles: VirtualFile[] = [
|
|
16
|
+
{
|
|
17
|
+
filename: '/lib.d.ts',
|
|
18
|
+
content: systemDefinitions,
|
|
19
|
+
},
|
|
20
|
+
];
|
|
21
|
+
|
|
22
|
+
export type ParsedExpression = {
|
|
23
|
+
name?: string;
|
|
24
|
+
type?: 'function' | 'variable' | 'class' | 'interface';
|
|
25
|
+
value?: any;
|
|
26
|
+
valueType?: string;
|
|
27
|
+
parameters?: Array<{ name: string; type: string }>;
|
|
28
|
+
returnType?: string;
|
|
29
|
+
references?: string[];
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export type VirtualFile = {
|
|
33
|
+
filename: string;
|
|
34
|
+
content: string;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* TypeScript parser using Virtual File System for browser compatibility.
|
|
39
|
+
* This provides full TypeScript analysis including type information.
|
|
40
|
+
*/
|
|
41
|
+
export class VirtualTypeScriptParser {
|
|
42
|
+
protected compilerOptions: ts.CompilerOptions = {
|
|
43
|
+
target: ts.ScriptTarget.ES2020,
|
|
44
|
+
module: ts.ModuleKind.ESNext,
|
|
45
|
+
moduleResolution: ts.ModuleResolutionKind.Bundler,
|
|
46
|
+
strict: true,
|
|
47
|
+
esModuleInterop: true,
|
|
48
|
+
skipLibCheck: true,
|
|
49
|
+
forceConsistentCasingInfilenames: true,
|
|
50
|
+
jsx: ts.JsxEmit.React,
|
|
51
|
+
noLib: true, // Don't automatically include default lib files.
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Parse a single expression or statement.
|
|
56
|
+
*/
|
|
57
|
+
parseExpression(input: string): ParsedExpression {
|
|
58
|
+
invariant(input.trim() !== '', 'input must not be empty');
|
|
59
|
+
const files: VirtualFile[] = [{ filename: '/temp.ts', content: input }];
|
|
60
|
+
const analysis = this.analyzeFiles(files);
|
|
61
|
+
|
|
62
|
+
// If no declarations found, check for standalone expression references.
|
|
63
|
+
if (analysis.length === 0) {
|
|
64
|
+
const sourcefilename = '/temp.ts';
|
|
65
|
+
const env = this.createEnvironment([{ filename: sourcefilename, content: input }]);
|
|
66
|
+
const sourceFile = env.getSourceFile(sourcefilename);
|
|
67
|
+
const typeChecker = env.languageService.getProgram()?.getTypeChecker();
|
|
68
|
+
|
|
69
|
+
if (sourceFile && typeChecker) {
|
|
70
|
+
// Check for assignment expressions.
|
|
71
|
+
const assignmentInfo = this.findAssignmentExpression(sourceFile, typeChecker);
|
|
72
|
+
if (assignmentInfo) {
|
|
73
|
+
return assignmentInfo;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const references = this.findAllReferences(sourceFile, typeChecker);
|
|
77
|
+
return { references };
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return analysis[0];
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Analyze multiple files with full type information.
|
|
86
|
+
*/
|
|
87
|
+
analyzeFiles(files: VirtualFile[]): ParsedExpression[] {
|
|
88
|
+
const env = this.createEnvironment(files);
|
|
89
|
+
const results: ParsedExpression[] = [];
|
|
90
|
+
const typeChecker = env.languageService.getProgram()?.getTypeChecker();
|
|
91
|
+
|
|
92
|
+
// Analyze each file.
|
|
93
|
+
files.forEach((file) => {
|
|
94
|
+
const sourceFile = env.getSourceFile(file.filename);
|
|
95
|
+
if (!sourceFile || !typeChecker) {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
const fileResults = this.analyzeSourceFile(sourceFile, typeChecker);
|
|
100
|
+
results.push(...fileResults);
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
return results;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Analyze a source file with type information.
|
|
108
|
+
*/
|
|
109
|
+
protected analyzeSourceFile(sourceFile: ts.SourceFile, typeChecker: ts.TypeChecker): ParsedExpression[] {
|
|
110
|
+
const results: ParsedExpression[] = [];
|
|
111
|
+
|
|
112
|
+
const visit = (node: ts.Node) => {
|
|
113
|
+
// Function declarations.
|
|
114
|
+
if (ts.isFunctionDeclaration(node) && node.name) {
|
|
115
|
+
const symbol = typeChecker.getSymbolAtLocation(node.name);
|
|
116
|
+
const type = symbol && typeChecker.getTypeOfSymbolAtLocation(symbol, node);
|
|
117
|
+
const signature = type && typeChecker.getSignaturesOfType(type, ts.SignatureKind.Call)[0];
|
|
118
|
+
|
|
119
|
+
results.push({
|
|
120
|
+
name: node.name.text,
|
|
121
|
+
type: 'function',
|
|
122
|
+
parameters: this.extractParameters(signature, typeChecker),
|
|
123
|
+
returnType: signature ? typeChecker.typeToString(signature.getReturnType()) : 'any',
|
|
124
|
+
references: this.findReferences(node, sourceFile, typeChecker),
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// Variable declarations.
|
|
129
|
+
else if (ts.isVariableStatement(node)) {
|
|
130
|
+
node.declarationList.declarations.forEach((declaration) => {
|
|
131
|
+
if (ts.isIdentifier(declaration.name)) {
|
|
132
|
+
const symbol = typeChecker.getSymbolAtLocation(declaration.name);
|
|
133
|
+
const type = symbol && typeChecker.getTypeOfSymbolAtLocation(symbol, declaration);
|
|
134
|
+
|
|
135
|
+
let kind: 'function' | 'variable' = 'variable';
|
|
136
|
+
let parameters: Array<{ name: string; type: string }> | undefined;
|
|
137
|
+
let returnType: string | undefined;
|
|
138
|
+
let value: any;
|
|
139
|
+
|
|
140
|
+
// Get the type string.
|
|
141
|
+
const typeString = type ? typeChecker.typeToString(type) : 'any';
|
|
142
|
+
|
|
143
|
+
// Check if it's a function.
|
|
144
|
+
if (declaration.initializer) {
|
|
145
|
+
if (ts.isArrowFunction(declaration.initializer) || ts.isFunctionExpression(declaration.initializer)) {
|
|
146
|
+
kind = 'function';
|
|
147
|
+
const funcType = typeChecker.getTypeAtLocation(declaration.initializer);
|
|
148
|
+
const signature = typeChecker.getSignaturesOfType(funcType, ts.SignatureKind.Call)[0];
|
|
149
|
+
if (signature) {
|
|
150
|
+
parameters = this.extractParameters(signature, typeChecker);
|
|
151
|
+
returnType = typeChecker.typeToString(signature.getReturnType());
|
|
152
|
+
}
|
|
153
|
+
} else {
|
|
154
|
+
// Extract literal values
|
|
155
|
+
if (ts.isNumericLiteral(declaration.initializer)) {
|
|
156
|
+
value = Number(declaration.initializer.text);
|
|
157
|
+
} else if (ts.isStringLiteral(declaration.initializer)) {
|
|
158
|
+
value = declaration.initializer.text;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
// Find references in the initializer only.
|
|
164
|
+
const refs = declaration.initializer
|
|
165
|
+
? this.findReferences(declaration.initializer, sourceFile, typeChecker)
|
|
166
|
+
: [];
|
|
167
|
+
|
|
168
|
+
results.push({
|
|
169
|
+
name: declaration.name.text,
|
|
170
|
+
type: kind,
|
|
171
|
+
valueType: typeString,
|
|
172
|
+
value,
|
|
173
|
+
parameters,
|
|
174
|
+
returnType,
|
|
175
|
+
references: refs,
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
// Class declarations.
|
|
182
|
+
else if (ts.isClassDeclaration(node) && node.name) {
|
|
183
|
+
results.push({
|
|
184
|
+
name: node.name.text,
|
|
185
|
+
type: 'class',
|
|
186
|
+
references: this.findReferences(node, sourceFile, typeChecker),
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
// Interface declarations.
|
|
191
|
+
else if (ts.isInterfaceDeclaration(node)) {
|
|
192
|
+
results.push({
|
|
193
|
+
name: node.name.text,
|
|
194
|
+
type: 'interface',
|
|
195
|
+
references: this.findReferences(node, sourceFile, typeChecker),
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
ts.forEachChild(node, visit);
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
visit(sourceFile);
|
|
203
|
+
return results;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Extract parameter information from a signature.
|
|
208
|
+
*/
|
|
209
|
+
private extractParameters(
|
|
210
|
+
signature: ts.Signature | undefined,
|
|
211
|
+
typeChecker: ts.TypeChecker,
|
|
212
|
+
): Array<{ name: string; type: string }> {
|
|
213
|
+
if (!signature) {
|
|
214
|
+
return [];
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
return signature.parameters.map((param) => ({
|
|
218
|
+
name: param.getName(),
|
|
219
|
+
type: typeChecker.typeToString(typeChecker.getTypeOfSymbolAtLocation(param, param.valueDeclaration!)),
|
|
220
|
+
}));
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* Find all references to variables used in a node.
|
|
225
|
+
*/
|
|
226
|
+
private findReferences(node: ts.Node, _sourceFile: ts.SourceFile, _typeChecker: ts.TypeChecker): string[] {
|
|
227
|
+
const references = new Set<string>();
|
|
228
|
+
const localSymbols = new Set<string>();
|
|
229
|
+
|
|
230
|
+
// First, collect local symbols (parameters, local variables).
|
|
231
|
+
const collectLocalSymbols = (node: ts.Node) => {
|
|
232
|
+
if (ts.isFunctionDeclaration(node) || ts.isArrowFunction(node) || ts.isFunctionExpression(node)) {
|
|
233
|
+
node.parameters.forEach((param) => {
|
|
234
|
+
if (ts.isIdentifier(param.name)) {
|
|
235
|
+
localSymbols.add(param.name.text);
|
|
236
|
+
}
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
if (ts.isVariableDeclaration(node) && ts.isIdentifier(node.name)) {
|
|
241
|
+
localSymbols.add(node.name.text);
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
ts.forEachChild(node, collectLocalSymbols);
|
|
245
|
+
};
|
|
246
|
+
|
|
247
|
+
collectLocalSymbols(node);
|
|
248
|
+
|
|
249
|
+
// Then find all identifier references.
|
|
250
|
+
const findRefs = (node: ts.Node) => {
|
|
251
|
+
if (ts.isIdentifier(node)) {
|
|
252
|
+
// Skip if it's a local symbol.
|
|
253
|
+
if (!localSymbols.has(node.text)) {
|
|
254
|
+
// Check if it's a reference (not a declaration).
|
|
255
|
+
const parent = node.parent;
|
|
256
|
+
const isDeclaration =
|
|
257
|
+
(ts.isVariableDeclaration(parent) && parent.name === node) ||
|
|
258
|
+
(ts.isFunctionDeclaration(parent) && parent.name === node) ||
|
|
259
|
+
(ts.isParameter(parent) && parent.name === node);
|
|
260
|
+
|
|
261
|
+
if (!isDeclaration && !this.isBuiltIn(node.text)) {
|
|
262
|
+
references.add(node.text);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
ts.forEachChild(node, findRefs);
|
|
267
|
+
};
|
|
268
|
+
|
|
269
|
+
findRefs(node);
|
|
270
|
+
return Array.from(references);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* Check if a name is a built-in global.
|
|
275
|
+
*/
|
|
276
|
+
protected isBuiltIn(name: string): boolean {
|
|
277
|
+
return builtIns.has(name);
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
/**
|
|
281
|
+
* Find assignment expressions in a source file.
|
|
282
|
+
*/
|
|
283
|
+
private findAssignmentExpression(sourceFile: ts.SourceFile, typeChecker: ts.TypeChecker): ParsedExpression | null {
|
|
284
|
+
let result: ParsedExpression | null = null;
|
|
285
|
+
|
|
286
|
+
const visit = (node: ts.Node) => {
|
|
287
|
+
if (ts.isExpressionStatement(node) && ts.isBinaryExpression(node.expression)) {
|
|
288
|
+
const expr = node.expression;
|
|
289
|
+
if (expr.operatorToken.kind === ts.SyntaxKind.EqualsToken && ts.isIdentifier(expr.left)) {
|
|
290
|
+
const type = typeChecker.getTypeAtLocation(expr.right);
|
|
291
|
+
const typeString = typeChecker.typeToString(type);
|
|
292
|
+
|
|
293
|
+
// Get the literal value if it's a literal.
|
|
294
|
+
let value: any;
|
|
295
|
+
if (ts.isNumericLiteral(expr.right)) {
|
|
296
|
+
value = Number(expr.right.text);
|
|
297
|
+
} else if (ts.isStringLiteral(expr.right)) {
|
|
298
|
+
value = expr.right.text;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
// Find references in the right-hand side.
|
|
302
|
+
const references = this.findReferences(expr.right, sourceFile, typeChecker);
|
|
303
|
+
|
|
304
|
+
result = {
|
|
305
|
+
name: expr.left.text,
|
|
306
|
+
type: 'variable',
|
|
307
|
+
valueType: typeString,
|
|
308
|
+
value,
|
|
309
|
+
references,
|
|
310
|
+
};
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
if (!result) {
|
|
314
|
+
ts.forEachChild(node, visit);
|
|
315
|
+
}
|
|
316
|
+
};
|
|
317
|
+
|
|
318
|
+
visit(sourceFile);
|
|
319
|
+
return result;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
* Find all identifier references in a source file.
|
|
324
|
+
*/
|
|
325
|
+
protected findAllReferences(sourceFile: ts.SourceFile, _typeChecker: ts.TypeChecker): string[] {
|
|
326
|
+
const references = new Set<string>();
|
|
327
|
+
|
|
328
|
+
const visit = (node: ts.Node) => {
|
|
329
|
+
if (ts.isIdentifier(node)) {
|
|
330
|
+
// Skip if it's a declaration.
|
|
331
|
+
const parent = node.parent;
|
|
332
|
+
const isDeclaration =
|
|
333
|
+
(ts.isVariableDeclaration(parent) && parent.name === node) ||
|
|
334
|
+
(ts.isFunctionDeclaration(parent) && parent.name === node) ||
|
|
335
|
+
(ts.isParameter(parent) && parent.name === node);
|
|
336
|
+
|
|
337
|
+
// Skip if it's the left-hand side of an assignment.
|
|
338
|
+
const isAssignmentTarget =
|
|
339
|
+
ts.isBinaryExpression(parent) &&
|
|
340
|
+
parent.operatorToken.kind === ts.SyntaxKind.EqualsToken &&
|
|
341
|
+
parent.left === node;
|
|
342
|
+
|
|
343
|
+
if (!isDeclaration && !isAssignmentTarget && !this.isBuiltIn(node.text)) {
|
|
344
|
+
references.add(node.text);
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
ts.forEachChild(node, visit);
|
|
348
|
+
};
|
|
349
|
+
|
|
350
|
+
visit(sourceFile);
|
|
351
|
+
return Array.from(references);
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
protected createEnvironment(files: VirtualFile[]) {
|
|
355
|
+
const allFiles = [...systemFiles, ...files];
|
|
356
|
+
|
|
357
|
+
const fileMap = new Map<string, string>();
|
|
358
|
+
allFiles.forEach(({ filename, content }) => {
|
|
359
|
+
fileMap.set(filename, content);
|
|
360
|
+
});
|
|
361
|
+
|
|
362
|
+
const system = createSystem(fileMap);
|
|
363
|
+
return createVirtualTypeScriptEnvironment(
|
|
364
|
+
system,
|
|
365
|
+
allFiles.map(({ filename }) => filename),
|
|
366
|
+
ts,
|
|
367
|
+
this.compilerOptions,
|
|
368
|
+
);
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
/**
|
|
373
|
+
* Notebook-specific parser with dependency analysis.
|
|
374
|
+
*/
|
|
375
|
+
export class NotebookVirtualParser extends VirtualTypeScriptParser {
|
|
376
|
+
/**
|
|
377
|
+
* Analyze notebook cells with full type checking.
|
|
378
|
+
*/
|
|
379
|
+
analyzeNotebook(cells: Array<{ id: string; code: string }>) {
|
|
380
|
+
// Create cumulative environment where each cell can see previous cells.
|
|
381
|
+
const cumulativeCode: string[] = [];
|
|
382
|
+
const cellAnalysis: Map<
|
|
383
|
+
string,
|
|
384
|
+
{
|
|
385
|
+
exports: ParsedExpression[];
|
|
386
|
+
imports: string[];
|
|
387
|
+
errors: ts.Diagnostic[];
|
|
388
|
+
}
|
|
389
|
+
> = new Map();
|
|
390
|
+
|
|
391
|
+
cells.forEach((cell) => {
|
|
392
|
+
// Create files for all cells up to current.
|
|
393
|
+
const files: VirtualFile[] = [];
|
|
394
|
+
|
|
395
|
+
// Add previous cells as context.
|
|
396
|
+
if (cumulativeCode.length > 0) {
|
|
397
|
+
files.push({
|
|
398
|
+
filename: '/context.ts',
|
|
399
|
+
content: cumulativeCode.join('\n'),
|
|
400
|
+
});
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
// Add current cell.
|
|
404
|
+
const filename = `/cell/${cell.id}.ts`;
|
|
405
|
+
files.push({
|
|
406
|
+
filename,
|
|
407
|
+
content: cell.code,
|
|
408
|
+
});
|
|
409
|
+
|
|
410
|
+
// Create environment.
|
|
411
|
+
const env = this.createEnvironment(files);
|
|
412
|
+
|
|
413
|
+
// Get diagnostics (errors).
|
|
414
|
+
const diagnostics = env.languageService.getSemanticDiagnostics(filename);
|
|
415
|
+
|
|
416
|
+
// Analyze current cell.
|
|
417
|
+
const sourceFile = env.getSourceFile(filename);
|
|
418
|
+
const typeChecker = env.languageService.getProgram()?.getTypeChecker();
|
|
419
|
+
|
|
420
|
+
if (sourceFile && typeChecker) {
|
|
421
|
+
const exports = this.analyzeSourceFile(sourceFile, typeChecker);
|
|
422
|
+
|
|
423
|
+
// Find all references in the current cell.
|
|
424
|
+
const allRefs = new Set<string>();
|
|
425
|
+
exports.forEach((exp) => {
|
|
426
|
+
exp.references?.forEach((ref) => allRefs.add(ref));
|
|
427
|
+
});
|
|
428
|
+
|
|
429
|
+
// Also check for references not in exports (e.g., console.log(y)).
|
|
430
|
+
const additionalRefs = this.findAllReferences(sourceFile, typeChecker);
|
|
431
|
+
additionalRefs.forEach((ref) => allRefs.add(ref));
|
|
432
|
+
|
|
433
|
+
// Determine which references are imports from previous cells.
|
|
434
|
+
const previousExports = new Set<string>();
|
|
435
|
+
for (const [_prevCellId, prevAnalysis] of cellAnalysis) {
|
|
436
|
+
prevAnalysis.exports.forEach((exp) => {
|
|
437
|
+
if (exp.name) {
|
|
438
|
+
previousExports.add(exp.name);
|
|
439
|
+
}
|
|
440
|
+
});
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
const imports = Array.from(allRefs).filter((ref) => previousExports.has(ref));
|
|
444
|
+
|
|
445
|
+
cellAnalysis.set(cell.id, {
|
|
446
|
+
exports,
|
|
447
|
+
imports,
|
|
448
|
+
errors: diagnostics,
|
|
449
|
+
});
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
// Add current cell code to cumulative.
|
|
453
|
+
cumulativeCode.push(cell.code);
|
|
454
|
+
});
|
|
455
|
+
|
|
456
|
+
return cellAnalysis;
|
|
457
|
+
}
|
|
458
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Octokit } from '@octokit/core';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
7
|
+
|
|
8
|
+
import { Script, Operation } from '@dxos/compute';
|
|
9
|
+
|
|
10
|
+
import { templates } from '../templates';
|
|
11
|
+
import { ScriptOperation } from '../types';
|
|
12
|
+
|
|
13
|
+
const handler: Operation.WithHandler<typeof ScriptOperation.CreateScript> = ScriptOperation.CreateScript.pipe(
|
|
14
|
+
Operation.withHandler(
|
|
15
|
+
Effect.fnUntraced(function* ({ name, gistUrl, initialTemplateId }) {
|
|
16
|
+
let source = templates[0].source;
|
|
17
|
+
let scriptName = name;
|
|
18
|
+
|
|
19
|
+
const gistId = gistUrl?.split('/').at(-1);
|
|
20
|
+
if (gistId) {
|
|
21
|
+
const octokit = new Octokit();
|
|
22
|
+
const response = yield* Effect.promise(() =>
|
|
23
|
+
octokit.request('GET /gists/{gist_id}', {
|
|
24
|
+
gist_id: gistId,
|
|
25
|
+
}),
|
|
26
|
+
);
|
|
27
|
+
const gistContent = Object.values(response.data.files ?? {})[0]?.content;
|
|
28
|
+
if (gistContent) {
|
|
29
|
+
source = gistContent;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
if (initialTemplateId) {
|
|
34
|
+
const template = templates.find((template) => template.id === initialTemplateId);
|
|
35
|
+
if (template) {
|
|
36
|
+
source = template.source;
|
|
37
|
+
scriptName = scriptName || template.name;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return { object: Script.make({ name: scriptName, source }) };
|
|
42
|
+
}),
|
|
43
|
+
),
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
export default handler;
|
package/src/plugin.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Plugin } from '@dxos/app-framework';
|
|
6
|
+
|
|
7
|
+
import { meta } from './meta';
|
|
8
|
+
|
|
9
|
+
export const ScriptPlugin = Plugin.lazy(meta, () => import('#plugin'));
|
|
10
|
+
|
|
11
|
+
export { ScriptOperationHandlerSet } from './operations';
|