@dxos/plugin-script 0.8.4-main.937b3ca → 0.8.4-main.abd8ff62ef
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/README.md +15 -13
- package/dist/lib/browser/DeploymentDialog-6DBF3V6C.mjs +112 -0
- package/dist/lib/browser/DeploymentDialog-6DBF3V6C.mjs.map +7 -0
- package/dist/lib/browser/{NotebookContainer-4MM2VAQF.mjs → NotebookContainer-RO4NJRYH.mjs} +59 -144
- package/dist/lib/browser/NotebookContainer-RO4NJRYH.mjs.map +7 -0
- package/dist/lib/browser/ScriptContainer-2OPBAXFB.mjs +79 -0
- package/dist/lib/browser/ScriptContainer-2OPBAXFB.mjs.map +7 -0
- package/dist/lib/browser/ScriptProperties-NRXG4PBX.mjs +304 -0
- package/dist/lib/browser/ScriptProperties-NRXG4PBX.mjs.map +7 -0
- package/dist/lib/browser/TestContainer-JNFPLAJX.mjs +44 -0
- package/dist/lib/browser/TestContainer-JNFPLAJX.mjs.map +7 -0
- package/dist/lib/browser/access-token-created-MSWZWZCT.mjs +37 -0
- package/dist/lib/browser/access-token-created-MSWZWZCT.mjs.map +7 -0
- package/dist/lib/browser/blueprints/index.mjs +53 -3
- package/dist/lib/browser/blueprints/index.mjs.map +4 -4
- package/dist/lib/browser/chunk-KF6H7J5N.mjs +81 -0
- package/dist/lib/browser/chunk-KF6H7J5N.mjs.map +7 -0
- package/dist/lib/browser/chunk-MI6X5CTJ.mjs +336 -0
- package/dist/lib/browser/chunk-MI6X5CTJ.mjs.map +7 -0
- package/dist/lib/browser/{chunk-UX4GHJ5E.mjs → chunk-NSAF3763.mjs} +29 -29
- package/dist/lib/browser/chunk-NSAF3763.mjs.map +7 -0
- package/dist/lib/browser/chunk-RQ5LDVFK.mjs +49 -0
- package/dist/lib/browser/chunk-RQ5LDVFK.mjs.map +7 -0
- package/dist/lib/browser/containers/index.mjs +17 -0
- package/dist/lib/browser/containers/index.mjs.map +7 -0
- package/dist/lib/browser/create-JDXWBARB.mjs +44 -0
- package/dist/lib/browser/create-JDXWBARB.mjs.map +7 -0
- package/dist/lib/browser/create-script-Q7B3CFAP.mjs +45 -0
- package/dist/lib/browser/create-script-Q7B3CFAP.mjs.map +7 -0
- package/dist/lib/browser/delete-PAUWA2QM.mjs +21 -0
- package/dist/lib/browser/delete-PAUWA2QM.mjs.map +7 -0
- package/dist/lib/browser/deploy-CXVW54JJ.mjs +62 -0
- package/dist/lib/browser/deploy-CXVW54JJ.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +169 -220
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/inspect-invocations-LEOEP5I2.mjs +59 -0
- package/dist/lib/browser/inspect-invocations-LEOEP5I2.mjs.map +7 -0
- package/dist/lib/browser/install-function-5N24Q45W.mjs +51 -0
- package/dist/lib/browser/install-function-5N24Q45W.mjs.map +7 -0
- package/dist/lib/browser/invoke-5QVEZ3X5.mjs +33 -0
- package/dist/lib/browser/invoke-5QVEZ3X5.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/operations/index.mjs +14 -0
- package/dist/lib/browser/operations/index.mjs.map +7 -0
- package/dist/lib/browser/query-deployed-functions-FVD7NYPA.mjs +30 -0
- package/dist/lib/browser/query-deployed-functions-FVD7NYPA.mjs.map +7 -0
- package/dist/lib/browser/read-FFOSK6A3.mjs +26 -0
- package/dist/lib/browser/read-FFOSK6A3.mjs.map +7 -0
- package/dist/lib/browser/templates/index.mjs +1 -1
- package/dist/lib/browser/translations.mjs +104 -0
- package/dist/lib/browser/translations.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +3 -7
- package/dist/lib/browser/update-PJS5GG3Y.mjs +63 -0
- package/dist/lib/browser/update-PJS5GG3Y.mjs.map +7 -0
- package/dist/lib/node-esm/DeploymentDialog-A5BZHUJB.mjs +113 -0
- package/dist/lib/node-esm/DeploymentDialog-A5BZHUJB.mjs.map +7 -0
- package/dist/lib/node-esm/{NotebookContainer-QLW5ZYGS.mjs → NotebookContainer-DPT65MA7.mjs} +59 -144
- package/dist/lib/node-esm/NotebookContainer-DPT65MA7.mjs.map +7 -0
- package/dist/lib/node-esm/ScriptContainer-UKD7QORM.mjs +80 -0
- package/dist/lib/node-esm/ScriptContainer-UKD7QORM.mjs.map +7 -0
- package/dist/lib/node-esm/ScriptProperties-FQXEOJKG.mjs +305 -0
- package/dist/lib/node-esm/ScriptProperties-FQXEOJKG.mjs.map +7 -0
- package/dist/lib/node-esm/TestContainer-Y4XVV7KQ.mjs +45 -0
- package/dist/lib/node-esm/TestContainer-Y4XVV7KQ.mjs.map +7 -0
- package/dist/lib/node-esm/access-token-created-DCD6LYQC.mjs +38 -0
- package/dist/lib/node-esm/access-token-created-DCD6LYQC.mjs.map +7 -0
- package/dist/lib/node-esm/blueprints/index.mjs +53 -3
- package/dist/lib/node-esm/blueprints/index.mjs.map +4 -4
- package/dist/lib/node-esm/chunk-2DZNF5NG.mjs +82 -0
- package/dist/lib/node-esm/chunk-2DZNF5NG.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-C55UYWN4.mjs +50 -0
- package/dist/lib/node-esm/chunk-C55UYWN4.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-4F5FJZ36.mjs → chunk-EW63XFRQ.mjs} +29 -29
- package/dist/lib/node-esm/chunk-EW63XFRQ.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-XFM2BEHY.mjs +338 -0
- package/dist/lib/node-esm/chunk-XFM2BEHY.mjs.map +7 -0
- package/dist/lib/node-esm/containers/index.mjs +18 -0
- package/dist/lib/node-esm/containers/index.mjs.map +7 -0
- package/dist/lib/node-esm/create-D2JDNXY6.mjs +45 -0
- package/dist/lib/node-esm/create-D2JDNXY6.mjs.map +7 -0
- package/dist/lib/node-esm/create-script-4AB4G7GQ.mjs +46 -0
- package/dist/lib/node-esm/create-script-4AB4G7GQ.mjs.map +7 -0
- package/dist/lib/node-esm/delete-YXLT7J27.mjs +22 -0
- package/dist/lib/node-esm/delete-YXLT7J27.mjs.map +7 -0
- package/dist/lib/node-esm/deploy-MXVZXAUC.mjs +63 -0
- package/dist/lib/node-esm/deploy-MXVZXAUC.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +169 -220
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/inspect-invocations-TVAKGYX5.mjs +60 -0
- package/dist/lib/node-esm/inspect-invocations-TVAKGYX5.mjs.map +7 -0
- package/dist/lib/node-esm/install-function-ST3VABJH.mjs +52 -0
- package/dist/lib/node-esm/install-function-ST3VABJH.mjs.map +7 -0
- package/dist/lib/node-esm/invoke-64WDU55Y.mjs +34 -0
- package/dist/lib/node-esm/invoke-64WDU55Y.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/operations/index.mjs +15 -0
- package/dist/lib/node-esm/operations/index.mjs.map +7 -0
- package/dist/lib/node-esm/query-deployed-functions-2VCNGQ7X.mjs +31 -0
- package/dist/lib/node-esm/query-deployed-functions-2VCNGQ7X.mjs.map +7 -0
- package/dist/lib/node-esm/read-PECQUAPS.mjs +27 -0
- package/dist/lib/node-esm/read-PECQUAPS.mjs.map +7 -0
- package/dist/lib/node-esm/templates/index.mjs +1 -1
- package/dist/lib/node-esm/translations.mjs +105 -0
- package/dist/lib/node-esm/translations.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +3 -7
- package/dist/lib/node-esm/update-XDFTGSPP.mjs +64 -0
- package/dist/lib/node-esm/update-XDFTGSPP.mjs.map +7 -0
- package/dist/types/src/ScriptPlugin.d.ts +1 -0
- package/dist/types/src/ScriptPlugin.d.ts.map +1 -1
- package/dist/types/src/ScriptPlugin.node.d.ts +4 -0
- package/dist/types/src/ScriptPlugin.node.d.ts.map +1 -0
- package/dist/types/src/ScriptPlugin.test.d.ts +2 -0
- package/dist/types/src/ScriptPlugin.test.d.ts.map +1 -0
- package/dist/types/src/blueprints/functions/create.d.ts +11 -0
- package/dist/types/src/blueprints/functions/create.d.ts.map +1 -0
- package/dist/types/src/blueprints/functions/definitions.d.ts +141 -0
- package/dist/types/src/blueprints/functions/definitions.d.ts.map +1 -0
- package/dist/types/src/blueprints/functions/delete.d.ts +18 -0
- package/dist/types/src/blueprints/functions/delete.d.ts.map +1 -0
- package/dist/types/src/blueprints/functions/deploy.d.ts +22 -0
- package/dist/types/src/blueprints/functions/deploy.d.ts.map +1 -0
- package/dist/types/src/blueprints/functions/index.d.ts +4 -0
- package/dist/types/src/blueprints/functions/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/functions/inspect-invocations.d.ts +29 -0
- package/dist/types/src/blueprints/functions/inspect-invocations.d.ts.map +1 -0
- package/dist/types/src/blueprints/functions/install-function.d.ts +11 -0
- package/dist/types/src/blueprints/functions/install-function.d.ts.map +1 -0
- package/dist/types/src/blueprints/functions/invoke.d.ts +22 -0
- package/dist/types/src/blueprints/functions/invoke.d.ts.map +1 -0
- package/dist/types/src/blueprints/functions/query-deployed-functions.d.ts +13 -0
- package/dist/types/src/blueprints/functions/query-deployed-functions.d.ts.map +1 -0
- package/dist/types/src/blueprints/functions/read.d.ts +22 -0
- package/dist/types/src/blueprints/functions/read.d.ts.map +1 -0
- package/dist/types/src/blueprints/functions/update.d.ts +27 -0
- package/dist/types/src/blueprints/functions/update.d.ts.map +1 -0
- package/dist/types/src/blueprints/index.d.ts +1 -1
- package/dist/types/src/blueprints/index.d.ts.map +1 -1
- package/dist/types/src/blueprints/script-blueprint.d.ts +3 -21
- package/dist/types/src/blueprints/script-blueprint.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +6 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/{artifact-definition/artifact-definition.d.ts → artifact-definition.d.ts} +1 -1
- package/dist/types/src/capabilities/artifact-definition.d.ts.map +1 -0
- package/dist/types/src/capabilities/blueprint-definition.d.ts +6 -0
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -0
- package/dist/types/src/capabilities/compiler.d.ts +6 -0
- package/dist/types/src/capabilities/compiler.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +8 -6
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- 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 +5 -0
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/settings.d.ts +7 -0
- package/dist/types/src/capabilities/settings.d.ts.map +1 -0
- package/dist/types/src/compiler/compiler.d.ts.map +1 -1
- package/dist/types/src/components/{FrameContainer/FrameContainer.d.ts → FramePanel/FramePanel.d.ts} +3 -3
- package/dist/types/src/components/FramePanel/FramePanel.d.ts.map +1 -0
- package/dist/types/src/components/FramePanel/index.d.ts +2 -0
- package/dist/types/src/components/FramePanel/index.d.ts.map +1 -0
- package/dist/types/src/components/NotebookStack/NotebookCell.d.ts +1 -1
- package/dist/types/src/components/NotebookStack/NotebookCell.d.ts.map +1 -1
- package/dist/types/src/components/NotebookStack/NotebookMenu.d.ts +1 -1
- package/dist/types/src/components/NotebookStack/NotebookMenu.d.ts.map +1 -1
- package/dist/types/src/components/NotebookStack/NotebookStack.d.ts +4 -2
- package/dist/types/src/components/NotebookStack/NotebookStack.d.ts.map +1 -1
- package/dist/types/src/components/NotebookStack/NotebookStack.stories.d.ts +219 -228
- package/dist/types/src/components/NotebookStack/NotebookStack.stories.d.ts.map +1 -1
- package/dist/types/src/components/QueryEditor/QueryEditor.d.ts.map +1 -1
- package/dist/types/src/components/QueryEditor/QueryEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/ScriptPluginSettings/ScriptPluginSettings.d.ts +8 -0
- package/dist/types/src/components/ScriptPluginSettings/ScriptPluginSettings.d.ts.map +1 -0
- package/dist/types/src/components/ScriptPluginSettings/ScriptPluginSettings.stories.d.ts +241 -0
- package/dist/types/src/components/ScriptPluginSettings/ScriptPluginSettings.stories.d.ts.map +1 -0
- package/dist/types/src/components/ScriptPluginSettings/index.d.ts +2 -0
- package/dist/types/src/components/ScriptPluginSettings/index.d.ts.map +1 -0
- package/dist/types/src/components/ScriptToolbar/ScriptToolbar.d.ts +7 -5
- package/dist/types/src/components/ScriptToolbar/ScriptToolbar.d.ts.map +1 -1
- package/dist/types/src/components/ScriptToolbar/ScriptToolbar.stories.d.ts +219 -228
- package/dist/types/src/components/ScriptToolbar/ScriptToolbar.stories.d.ts.map +1 -1
- package/dist/types/src/components/TestPanel/TestPanel.d.ts +4 -2
- package/dist/types/src/components/TestPanel/TestPanel.d.ts.map +1 -1
- package/dist/types/src/components/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 +5 -2
- package/dist/types/src/components/TypescriptEditor/TypescriptEditor.d.ts.map +1 -1
- package/dist/types/src/components/TypescriptEditor/TypescriptEditor.stories.d.ts +3 -1
- package/dist/types/src/components/TypescriptEditor/TypescriptEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +6 -5
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/constants.d.ts +2 -0
- package/dist/types/src/constants.d.ts.map +1 -0
- package/dist/types/src/{components → containers}/DeploymentDialog/DeploymentDialog.d.ts +0 -2
- 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/{components → containers}/DeploymentDialog/DeploymentDialog.stories.d.ts.map +1 -1
- 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/NotebookContainer/NotebookContainer.d.ts +7 -0
- package/dist/types/src/containers/NotebookContainer/NotebookContainer.d.ts.map +1 -0
- package/dist/types/src/containers/NotebookContainer/NotebookContainer.stories.d.ts.map +1 -0
- package/dist/types/src/containers/NotebookContainer/index.d.ts +2 -0
- package/dist/types/src/containers/NotebookContainer/index.d.ts.map +1 -0
- package/dist/types/src/containers/ScriptContainer/ScriptContainer.d.ts +10 -0
- package/dist/types/src/containers/ScriptContainer/ScriptContainer.d.ts.map +1 -0
- package/dist/types/src/containers/ScriptContainer/ScriptContainer.stories.d.ts +242 -0
- package/dist/types/src/containers/ScriptContainer/ScriptContainer.stories.d.ts.map +1 -0
- package/dist/types/src/containers/ScriptContainer/index.d.ts +2 -0
- package/dist/types/src/containers/ScriptContainer/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/{components/TestPanel → containers/TestContainer}/TestContainer.d.ts +1 -1
- 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/hooks/deploy.d.ts +18 -5
- package/dist/types/src/hooks/deploy.d.ts.map +1 -1
- package/dist/types/src/hooks/format.d.ts +2 -1
- package/dist/types/src/hooks/format.d.ts.map +1 -1
- package/dist/types/src/hooks/template.d.ts +2 -1
- package/dist/types/src/hooks/template.d.ts.map +1 -1
- package/dist/types/src/hooks/useCompiler.d.ts.map +1 -1
- package/dist/types/src/hooks/useCreateAndDeployScriptTemplates.d.ts.map +1 -1
- package/dist/types/src/hooks/useToolbarState.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +2 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/notebook/compute-graph.d.ts +1 -1
- package/dist/types/src/notebook/compute-graph.d.ts.map +1 -1
- package/dist/types/src/notebook/eval.d.ts.map +1 -1
- package/dist/types/src/notebook/vfs-parser.d.ts.map +1 -1
- package/dist/types/src/operations/access-token-created.d.ts +5 -0
- package/dist/types/src/operations/access-token-created.d.ts.map +1 -0
- package/dist/types/src/operations/create-script.d.ts +5 -0
- package/dist/types/src/operations/create-script.d.ts.map +1 -0
- package/dist/types/src/operations/definitions.d.ts +29 -0
- package/dist/types/src/operations/definitions.d.ts.map +1 -0
- package/dist/types/src/operations/index.d.ts +4 -0
- package/dist/types/src/operations/index.d.ts.map +1 -0
- package/dist/types/src/templates/anthropic.d.ts +4 -5
- package/dist/types/src/templates/anthropic.d.ts.map +1 -1
- package/dist/types/src/templates/chat.d.ts.map +1 -1
- package/dist/types/src/templates/chess-bot.d.ts +7 -5
- package/dist/types/src/templates/chess-bot.d.ts.map +1 -1
- package/dist/types/src/templates/commentary.d.ts +7 -4
- package/dist/types/src/templates/commentary.d.ts.map +1 -1
- package/dist/types/src/templates/data-generator.d.ts.map +1 -1
- package/dist/types/src/templates/discord.d.ts.map +1 -1
- package/dist/types/src/templates/email.d.ts.map +1 -1
- package/dist/types/src/templates/forex-effect.d.ts +3 -2
- package/dist/types/src/templates/forex-effect.d.ts.map +1 -1
- package/dist/types/src/templates/forex.d.ts +3 -2
- package/dist/types/src/templates/forex.d.ts.map +1 -1
- package/dist/types/src/templates/gmail.d.ts.map +1 -1
- package/dist/types/src/templates/index.d.ts +29 -29
- package/dist/types/src/templates/index.d.ts.map +1 -1
- package/dist/types/src/templates/ping.d.ts +2 -1
- package/dist/types/src/templates/ping.d.ts.map +1 -1
- package/dist/types/src/testing/index.d.ts +2 -1
- package/dist/types/src/testing/index.d.ts.map +1 -1
- package/dist/types/src/testing/test-notebook.d.ts +3 -0
- package/dist/types/src/testing/test-notebook.d.ts.map +1 -0
- package/dist/types/src/testing/test-script.d.ts +7 -0
- package/dist/types/src/testing/test-script.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +222 -92
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Notebook.d.ts +65 -49
- package/dist/types/src/types/Notebook.d.ts.map +1 -1
- 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/capabilities.d.ts +2 -5
- package/dist/types/src/types/capabilities.d.ts.map +1 -1
- package/dist/types/src/types/events.d.ts.map +1 -1
- package/dist/types/src/types/index.d.ts +0 -1
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +1 -5
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/src/util/deploy.d.ts +2 -2
- package/dist/types/src/util/deploy.d.ts.map +1 -1
- package/dist/types/src/util/functions.d.ts +2 -2
- package/dist/types/src/util/functions.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +121 -99
- package/src/ScriptPlugin.node.ts +70 -0
- package/src/ScriptPlugin.test.ts +31 -0
- package/src/ScriptPlugin.tsx +52 -34
- package/src/blueprints/functions/create.ts +47 -0
- package/src/blueprints/functions/definitions.ts +323 -0
- package/src/blueprints/functions/delete.ts +23 -0
- package/src/blueprints/functions/deploy.ts +70 -0
- package/src/blueprints/functions/index.ts +19 -0
- package/src/blueprints/functions/inspect-invocations.ts +56 -0
- package/src/blueprints/functions/install-function.ts +56 -0
- package/src/blueprints/functions/invoke.ts +35 -0
- package/src/blueprints/functions/query-deployed-functions.ts +31 -0
- package/src/blueprints/functions/read.ts +29 -0
- package/src/blueprints/functions/update.ts +68 -0
- package/src/blueprints/index.ts +1 -1
- package/src/blueprints/script-blueprint.ts +40 -9
- package/src/capabilities/app-graph-builder.ts +47 -0
- package/src/capabilities/{artifact-definition/artifact-definition.ts → artifact-definition.ts} +2 -3
- package/src/capabilities/blueprint-definition.ts +19 -0
- package/src/capabilities/{compiler/compiler.ts → compiler.ts} +17 -9
- package/src/capabilities/index.ts +13 -6
- package/src/capabilities/operation-handler.ts +21 -0
- package/src/capabilities/react-surface.tsx +130 -0
- package/src/capabilities/{settings/settings.ts → settings.ts} +7 -6
- package/src/compiler/compiler.ts +8 -1
- package/src/components/{FrameContainer/FrameContainer.tsx → FramePanel/FramePanel.tsx} +4 -5
- package/src/components/{FrameContainer → FramePanel}/index.ts +1 -1
- package/src/components/NotebookStack/NotebookCell.tsx +31 -22
- package/src/components/NotebookStack/NotebookMenu.tsx +7 -7
- package/src/components/NotebookStack/NotebookStack.stories.tsx +7 -9
- package/src/components/NotebookStack/NotebookStack.tsx +27 -16
- package/src/components/QueryEditor/QueryEditor.stories.tsx +18 -22
- 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 +8 -9
- package/src/components/ScriptToolbar/ScriptToolbar.tsx +24 -26
- package/src/components/TestPanel/TestPanel.tsx +110 -194
- package/src/components/TestPanel/index.ts +0 -1
- package/src/components/TypescriptEditor/TypescriptEditor.stories.tsx +17 -15
- package/src/components/TypescriptEditor/TypescriptEditor.tsx +26 -19
- package/src/components/index.ts +6 -7
- package/src/constants.ts +7 -0
- package/src/{components → containers}/DeploymentDialog/DeploymentDialog.stories.tsx +8 -7
- package/src/{components → containers}/DeploymentDialog/DeploymentDialog.tsx +33 -37
- package/src/containers/DeploymentDialog/index.ts +5 -0
- package/src/{components → containers/NotebookContainer}/NotebookContainer.stories.tsx +18 -20
- package/src/{components → containers/NotebookContainer}/NotebookContainer.tsx +61 -77
- package/src/containers/NotebookContainer/index.ts +5 -0
- package/src/containers/ScriptContainer/ScriptContainer.stories.tsx +106 -0
- package/src/{components → containers/ScriptContainer}/ScriptContainer.tsx +28 -27
- package/src/containers/ScriptContainer/index.ts +5 -0
- package/src/containers/ScriptProperties/BlueprintEditor.tsx +101 -0
- package/src/containers/ScriptProperties/FunctionBinding.tsx +83 -0
- package/src/containers/ScriptProperties/FunctionPublishing.tsx +121 -0
- package/src/containers/ScriptProperties/ScriptProperties.stories.tsx +75 -0
- package/src/containers/ScriptProperties/ScriptProperties.tsx +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 +7 -6
- package/src/e2e/deploy.test.ts +5 -5
- package/src/hooks/deploy.ts +15 -13
- package/src/hooks/format.ts +6 -5
- package/src/hooks/template.ts +9 -8
- package/src/hooks/useCompiler.ts +4 -3
- package/src/hooks/useCreateAndDeployScriptTemplates.ts +5 -4
- package/src/hooks/useToolbarState.ts +7 -6
- package/src/index.ts +6 -3
- package/src/meta.ts +2 -2
- package/src/notebook/compute-graph.test.ts +7 -7
- package/src/notebook/compute-graph.ts +1 -1
- package/src/notebook/vfs-parser.ts +10 -3
- package/src/operations/access-token-created.ts +37 -0
- package/src/operations/create-script.ts +46 -0
- package/src/operations/definitions.ts +40 -0
- package/src/operations/index.ts +12 -0
- package/src/templates/anthropic.ts +19 -12
- package/src/templates/chat.ts +1 -1
- package/src/templates/chess-bot.ts +37 -34
- package/src/templates/commentary.ts +178 -162
- package/src/templates/data-generator.ts +1 -1
- package/src/templates/discord.ts +3 -3
- package/src/templates/forex-effect.ts +30 -19
- package/src/templates/forex.ts +24 -15
- package/src/templates/gmail.ts +4 -4
- package/src/templates/index.ts +18 -18
- package/src/templates/ping.ts +16 -8
- package/src/testing/index.ts +2 -1
- package/src/testing/simulator.test.ts +3 -4
- package/src/testing/{data.ts → test-notebook.ts} +4 -5
- package/src/testing/test-script.ts +29 -0
- package/src/translations.ts +86 -87
- package/src/types/Notebook.ts +12 -8
- package/src/types/Settings.ts +20 -0
- package/src/types/capabilities.ts +5 -5
- package/src/types/events.ts +2 -2
- package/src/types/index.ts +0 -1
- package/src/types/types.ts +1 -11
- package/src/util/deploy.ts +13 -11
- package/src/util/functions.ts +9 -8
- package/dist/lib/browser/DeploymentDialog-GXNRUXF6.mjs +0 -14
- package/dist/lib/browser/DeploymentDialog-GXNRUXF6.mjs.map +0 -7
- package/dist/lib/browser/NotebookContainer-4MM2VAQF.mjs.map +0 -7
- package/dist/lib/browser/ScriptContainer-X6GCYZZW.mjs +0 -149
- package/dist/lib/browser/ScriptContainer-X6GCYZZW.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-7VO7AUI6.mjs +0 -68
- package/dist/lib/browser/app-graph-builder-7VO7AUI6.mjs.map +0 -7
- package/dist/lib/browser/blueprint-definition-OSOUYI7A.mjs +0 -17
- package/dist/lib/browser/blueprint-definition-OSOUYI7A.mjs.map +0 -7
- package/dist/lib/browser/chunk-3O2DQGCP.mjs +0 -113
- package/dist/lib/browser/chunk-3O2DQGCP.mjs.map +0 -7
- package/dist/lib/browser/chunk-BTWHM6FH.mjs +0 -270
- package/dist/lib/browser/chunk-BTWHM6FH.mjs.map +0 -7
- package/dist/lib/browser/chunk-F3QKSKSF.mjs +0 -35
- package/dist/lib/browser/chunk-F3QKSKSF.mjs.map +0 -7
- package/dist/lib/browser/chunk-I7CSE6T3.mjs +0 -110
- package/dist/lib/browser/chunk-I7CSE6T3.mjs.map +0 -7
- package/dist/lib/browser/chunk-IQRLM6JK.mjs +0 -137
- package/dist/lib/browser/chunk-IQRLM6JK.mjs.map +0 -7
- package/dist/lib/browser/chunk-NWSK27QB.mjs +0 -606
- package/dist/lib/browser/chunk-NWSK27QB.mjs.map +0 -7
- package/dist/lib/browser/chunk-UX4GHJ5E.mjs.map +0 -7
- package/dist/lib/browser/chunk-WX2NVNFQ.mjs +0 -557
- package/dist/lib/browser/chunk-WX2NVNFQ.mjs.map +0 -7
- package/dist/lib/browser/chunk-WYR4QHPE.mjs +0 -31
- package/dist/lib/browser/chunk-WYR4QHPE.mjs.map +0 -7
- package/dist/lib/browser/compiler-XRBFQFXO.mjs +0 -161
- package/dist/lib/browser/compiler-XRBFQFXO.mjs.map +0 -7
- package/dist/lib/browser/operation-resolver-MUNR376F.mjs +0 -82
- package/dist/lib/browser/operation-resolver-MUNR376F.mjs.map +0 -7
- package/dist/lib/browser/react-surface-5TEC66UY.mjs +0 -139
- package/dist/lib/browser/react-surface-5TEC66UY.mjs.map +0 -7
- package/dist/lib/browser/settings-R4WKREUJ.mjs +0 -35
- package/dist/lib/browser/settings-R4WKREUJ.mjs.map +0 -7
- package/dist/lib/node-esm/DeploymentDialog-EVFV2VJT.mjs +0 -15
- package/dist/lib/node-esm/DeploymentDialog-EVFV2VJT.mjs.map +0 -7
- package/dist/lib/node-esm/NotebookContainer-QLW5ZYGS.mjs.map +0 -7
- package/dist/lib/node-esm/ScriptContainer-3DZ3BMHW.mjs +0 -150
- package/dist/lib/node-esm/ScriptContainer-3DZ3BMHW.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-NVE3EVBG.mjs +0 -69
- package/dist/lib/node-esm/app-graph-builder-NVE3EVBG.mjs.map +0 -7
- package/dist/lib/node-esm/blueprint-definition-NC7NNJGI.mjs +0 -18
- package/dist/lib/node-esm/blueprint-definition-NC7NNJGI.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-4F5FJZ36.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-5HSJPAK7.mjs +0 -33
- package/dist/lib/node-esm/chunk-5HSJPAK7.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-KN6SQYUF.mjs +0 -114
- package/dist/lib/node-esm/chunk-KN6SQYUF.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-MGWKULCD.mjs +0 -558
- package/dist/lib/node-esm/chunk-MGWKULCD.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-SLU3KRV3.mjs +0 -112
- package/dist/lib/node-esm/chunk-SLU3KRV3.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-VWOLKNMO.mjs +0 -271
- package/dist/lib/node-esm/chunk-VWOLKNMO.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-Y3G5NCTP.mjs +0 -36
- package/dist/lib/node-esm/chunk-Y3G5NCTP.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-YEWLTVBT.mjs +0 -138
- package/dist/lib/node-esm/chunk-YEWLTVBT.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ZQGHFNO3.mjs +0 -607
- package/dist/lib/node-esm/chunk-ZQGHFNO3.mjs.map +0 -7
- package/dist/lib/node-esm/compiler-ORJAXDN7.mjs +0 -162
- package/dist/lib/node-esm/compiler-ORJAXDN7.mjs.map +0 -7
- package/dist/lib/node-esm/operation-resolver-CLE4ZCC5.mjs +0 -83
- package/dist/lib/node-esm/operation-resolver-CLE4ZCC5.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-O3UDMKOQ.mjs +0 -140
- package/dist/lib/node-esm/react-surface-O3UDMKOQ.mjs.map +0 -7
- package/dist/lib/node-esm/settings-OFIMHU7K.mjs +0 -36
- package/dist/lib/node-esm/settings-OFIMHU7K.mjs.map +0 -7
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +0 -6
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +0 -1
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts +0 -3
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/artifact-definition/artifact-definition.d.ts.map +0 -1
- package/dist/types/src/capabilities/artifact-definition/index.d.ts +0 -3
- package/dist/types/src/capabilities/artifact-definition/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts +0 -9
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts.map +0 -1
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts +0 -3
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/compiler/compiler.d.ts +0 -6
- package/dist/types/src/capabilities/compiler/compiler.d.ts.map +0 -1
- package/dist/types/src/capabilities/compiler/index.d.ts +0 -3
- package/dist/types/src/capabilities/compiler/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-resolver/index.d.ts +0 -3
- package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +0 -5
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +0 -5
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
- package/dist/types/src/capabilities/settings/index.d.ts +0 -7
- package/dist/types/src/capabilities/settings/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/settings/settings.d.ts +0 -9
- package/dist/types/src/capabilities/settings/settings.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 -249
- 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.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 -8
- package/dist/types/src/components/NotebookContainer.d.ts.map +0 -1
- package/dist/types/src/components/NotebookContainer.stories.d.ts.map +0 -1
- package/dist/types/src/components/ScriptContainer.d.ts +0 -11
- 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 -8
- 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.map +0 -1
- package/dist/types/src/testing/data.d.ts +0 -3
- package/dist/types/src/testing/data.d.ts.map +0 -1
- package/dist/types/src/types/actions.d.ts +0 -40
- package/dist/types/src/types/actions.d.ts.map +0 -1
- package/src/capabilities/app-graph-builder/app-graph-builder.ts +0 -55
- package/src/capabilities/app-graph-builder/index.ts +0 -7
- package/src/capabilities/artifact-definition/index.ts +0 -7
- package/src/capabilities/blueprint-definition/blueprint-definition.ts +0 -23
- package/src/capabilities/blueprint-definition/index.ts +0 -7
- package/src/capabilities/compiler/index.ts +0 -7
- package/src/capabilities/operation-resolver/index.ts +0 -7
- package/src/capabilities/operation-resolver/operation-resolver.ts +0 -74
- package/src/capabilities/react-surface/index.ts +0 -7
- package/src/capabilities/react-surface/react-surface.tsx +0 -118
- package/src/capabilities/settings/index.ts +0 -7
- package/src/components/DeploymentDialog/index.ts +0 -9
- package/src/components/FrameContainer/frame.html +0 -25
- package/src/components/FrameContainer/frame.tsx +0 -51
- package/src/components/Settings/ScriptObjectSettings.tsx +0 -309
- package/src/components/Settings/ScriptPluginSettings.tsx +0 -66
- package/src/components/Settings/index.ts +0 -6
- package/src/components/TestPanel/TestContainer.tsx +0 -27
- package/src/types/actions.ts +0 -45
- /package/dist/types/src/{components → containers/NotebookContainer}/NotebookContainer.stories.d.ts +0 -0
|
@@ -4,17 +4,16 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useEffect, useMemo } from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { useOperationInvoker } from '@dxos/app-framework/ui';
|
|
8
|
+
import { LayoutOperation } from '@dxos/app-toolkit';
|
|
9
9
|
import { getSpace } from '@dxos/react-client/echo';
|
|
10
|
-
import { Button, Dialog,
|
|
10
|
+
import { Button, Dialog, useTranslation } from '@dxos/react-ui';
|
|
11
11
|
import { type AccessToken } from '@dxos/types';
|
|
12
12
|
|
|
13
|
-
import { useCreateAndDeployScriptTemplates } from '
|
|
14
|
-
import { meta } from '
|
|
15
|
-
import { type Template } from '../../templates';
|
|
13
|
+
import { useCreateAndDeployScriptTemplates } from '#hooks';
|
|
14
|
+
import { meta } from '#meta';
|
|
16
15
|
|
|
17
|
-
|
|
16
|
+
import { type Template } from '../../templates';
|
|
18
17
|
|
|
19
18
|
// TODO(ZaymonFC):
|
|
20
19
|
// - Show activity and feedback to the user.
|
|
@@ -38,66 +37,63 @@ export const DeploymentDialog = ({ accessToken, scriptTemplates }: DeploymentDia
|
|
|
38
37
|
useEffect(() => {
|
|
39
38
|
if (status === 'success') {
|
|
40
39
|
// TODO(ZaymonFC): We can probably re-use this toast for normal script deployment.
|
|
41
|
-
void invokePromise(
|
|
42
|
-
id: `${meta.id}
|
|
40
|
+
void invokePromise(LayoutOperation.AddToast, {
|
|
41
|
+
id: `${meta.id}.deployment-success`,
|
|
43
42
|
icon: 'ph--check--regular',
|
|
44
43
|
duration: Infinity,
|
|
45
|
-
title: ['script
|
|
46
|
-
description: ['script
|
|
47
|
-
closeLabel: ['script
|
|
44
|
+
title: ['script-deployment-toast.label', { ns: meta.id, count: scriptTemplates.length }],
|
|
45
|
+
description: ['script-deployment-toast.description', { ns: meta.id, count: scriptTemplates.length }],
|
|
46
|
+
closeLabel: ['script-deployment-toast-close.label', { ns: meta.id, count: scriptTemplates.length }],
|
|
48
47
|
});
|
|
49
|
-
void invokePromise(
|
|
48
|
+
void invokePromise(LayoutOperation.UpdateDialog, { state: false });
|
|
50
49
|
}
|
|
51
50
|
if (status === 'error') {
|
|
52
|
-
void invokePromise(
|
|
53
|
-
void invokePromise(
|
|
54
|
-
id: `${meta.id}
|
|
51
|
+
void invokePromise(LayoutOperation.UpdateDialog, { state: false });
|
|
52
|
+
void invokePromise(LayoutOperation.AddToast, {
|
|
53
|
+
id: `${meta.id}.deployment-error`,
|
|
55
54
|
icon: 'ph--warning--regular',
|
|
56
55
|
duration: Infinity,
|
|
57
|
-
title: ['script
|
|
58
|
-
description: ['script
|
|
59
|
-
closeLabel: ['script
|
|
56
|
+
title: ['script-deployment-error-toast.label', { ns: meta.id, count: scriptTemplates.length }],
|
|
57
|
+
description: ['script-deployment-error-toast.description', { ns: meta.id, count: scriptTemplates.length }],
|
|
58
|
+
closeLabel: ['script-deployment-error-toast-close.label', { ns: meta.id, count: scriptTemplates.length }],
|
|
60
59
|
});
|
|
61
60
|
}
|
|
62
61
|
}, [status, invokePromise]);
|
|
63
62
|
|
|
64
63
|
return (
|
|
65
64
|
<Dialog.Content>
|
|
66
|
-
<
|
|
67
|
-
<Dialog.Title>{t('deployment
|
|
65
|
+
<Dialog.Header>
|
|
66
|
+
<Dialog.Title>{t('deployment-dialog.title')}</Dialog.Title>
|
|
68
67
|
<Dialog.Close asChild>
|
|
69
|
-
<
|
|
68
|
+
<Dialog.CloseIconButton />
|
|
70
69
|
</Dialog.Close>
|
|
71
|
-
</
|
|
72
|
-
<
|
|
73
|
-
{/* TODO: Implement deployment logic and UI. */}
|
|
70
|
+
</Dialog.Header>
|
|
71
|
+
<Dialog.Body>
|
|
74
72
|
<p>
|
|
75
|
-
{t('deployment
|
|
73
|
+
{t('deployment-dialog-scripts-found.message', {
|
|
76
74
|
count: scriptTemplates.length,
|
|
77
75
|
})}
|
|
78
76
|
</p>
|
|
79
|
-
<ul className='
|
|
77
|
+
<ul className='pt-2'>
|
|
80
78
|
{scriptTemplates.map((template) => {
|
|
81
79
|
return <li key={template.id}>{template.name}</li>;
|
|
82
80
|
})}
|
|
83
81
|
</ul>
|
|
84
|
-
</
|
|
85
|
-
<
|
|
82
|
+
</Dialog.Body>
|
|
83
|
+
<Dialog.ActionBar>
|
|
84
|
+
<Dialog.Close asChild>
|
|
85
|
+
<Button disabled={status === 'pending'}>{t('deployment-dialog-skip-button.label')}</Button>
|
|
86
|
+
</Dialog.Close>
|
|
86
87
|
<Button variant='primary' onClick={handleCreateAndDeployScripts} disabled={status === 'pending'}>
|
|
87
88
|
{status === 'pending'
|
|
88
|
-
? t('deployment
|
|
89
|
+
? t('deployment-dialog-deploy-functions-pending-button.label', {
|
|
89
90
|
count: scriptTemplates.length,
|
|
90
91
|
})
|
|
91
|
-
: t('deployment
|
|
92
|
+
: t('deployment-dialog-deploy-functions-button.label', {
|
|
92
93
|
count: scriptTemplates.length,
|
|
93
94
|
})}
|
|
94
95
|
</Button>
|
|
95
|
-
|
|
96
|
-
<Button disabled={status === 'pending'}>{t('deployment dialog skip button label')}</Button>
|
|
97
|
-
</Dialog.Close>
|
|
98
|
-
</div>
|
|
96
|
+
</Dialog.ActionBar>
|
|
99
97
|
</Dialog.Content>
|
|
100
98
|
);
|
|
101
99
|
};
|
|
102
|
-
|
|
103
|
-
export default DeploymentDialog;
|
|
@@ -8,38 +8,39 @@ import React from 'react';
|
|
|
8
8
|
|
|
9
9
|
import { SERVICES_CONFIG } from '@dxos/ai/testing';
|
|
10
10
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
11
|
-
import {
|
|
11
|
+
import { AgentPrompt } from '@dxos/assistant-toolkit';
|
|
12
|
+
import { Operation } from '@dxos/compute';
|
|
12
13
|
import { Filter } from '@dxos/echo';
|
|
13
|
-
import { Function, serializeFunction } from '@dxos/functions';
|
|
14
14
|
import { AssistantPlugin } from '@dxos/plugin-assistant';
|
|
15
15
|
import { AutomationPlugin } from '@dxos/plugin-automation';
|
|
16
16
|
import { ClientPlugin } from '@dxos/plugin-client';
|
|
17
|
+
import { initializeIdentity } from '@dxos/plugin-client/testing';
|
|
17
18
|
import { ExplorerPlugin } from '@dxos/plugin-explorer';
|
|
18
|
-
import {
|
|
19
|
+
import { MarkdownPlugin } from '@dxos/plugin-markdown';
|
|
20
|
+
import { Markdown } from '@dxos/plugin-markdown/types';
|
|
19
21
|
import { corePlugins } from '@dxos/plugin-testing';
|
|
20
22
|
import { Config, useClient } from '@dxos/react-client';
|
|
21
23
|
import { useQuery } from '@dxos/react-client/echo';
|
|
22
|
-
import { withLayout
|
|
24
|
+
import { withLayout } from '@dxos/react-ui/testing';
|
|
23
25
|
import { DataTypes } from '@dxos/schema';
|
|
24
26
|
|
|
25
|
-
import { createNotebook } from '
|
|
26
|
-
import { translations } from '
|
|
27
|
-
import { Notebook } from '
|
|
27
|
+
import { createNotebook } from '#testing';
|
|
28
|
+
import { translations } from '#translations';
|
|
29
|
+
import { Notebook } from '#types';
|
|
28
30
|
|
|
29
31
|
import { NotebookContainer } from './NotebookContainer';
|
|
30
32
|
|
|
31
33
|
const meta: Meta<typeof NotebookContainer> = {
|
|
32
|
-
title: 'plugins/plugin-script/NotebookContainer',
|
|
34
|
+
title: 'plugins/plugin-script/containers/NotebookContainer',
|
|
33
35
|
component: NotebookContainer,
|
|
34
36
|
render: (args) => {
|
|
35
37
|
const client = useClient();
|
|
36
|
-
const space = client.spaces.
|
|
38
|
+
const space = client.spaces.get()[0];
|
|
37
39
|
const notebooks = useQuery(space?.db, Filter.type(Notebook.Notebook));
|
|
38
|
-
return <NotebookContainer {...args} subject={notebooks[0]} />;
|
|
40
|
+
return <NotebookContainer {...args} subject={notebooks[0]} attendableId='test' />;
|
|
39
41
|
},
|
|
40
42
|
decorators: [
|
|
41
|
-
|
|
42
|
-
withLayout({ layout: 'column', classNames: 'is-proseMaxWidth' }),
|
|
43
|
+
withLayout({ layout: 'column', classNames: 'w-document-max-width' }),
|
|
43
44
|
withPluginManager({
|
|
44
45
|
plugins: [
|
|
45
46
|
...corePlugins(),
|
|
@@ -50,17 +51,14 @@ const meta: Meta<typeof NotebookContainer> = {
|
|
|
50
51
|
services: SERVICES_CONFIG.REMOTE,
|
|
51
52
|
},
|
|
52
53
|
}),
|
|
53
|
-
types: [...DataTypes, Notebook.Notebook,
|
|
54
|
+
types: [...DataTypes, Notebook.Notebook, Operation.PersistentOperation, Markdown.Document],
|
|
54
55
|
onClientInitialized: ({ client }) =>
|
|
55
56
|
Effect.gen(function* () {
|
|
56
|
-
yield*
|
|
57
|
-
yield* Effect.promise(() => client.spaces.waitUntilReady());
|
|
58
|
-
const space = client.spaces.default;
|
|
59
|
-
yield* Effect.promise(() => space.waitUntilReady());
|
|
57
|
+
const { personalSpace } = yield* initializeIdentity(client);
|
|
60
58
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
59
|
+
personalSpace.db.add(createNotebook());
|
|
60
|
+
personalSpace.db.add(Markdown.make({ content: '# Hello World' }));
|
|
61
|
+
personalSpace.db.add(Operation.serialize(AgentPrompt));
|
|
64
62
|
}),
|
|
65
63
|
}),
|
|
66
64
|
AssistantPlugin(),
|
|
@@ -6,42 +6,47 @@ import { RegistryContext } from '@effect-atom/atom-react';
|
|
|
6
6
|
import * as Cause from 'effect/Cause';
|
|
7
7
|
import * as Effect from 'effect/Effect';
|
|
8
8
|
import * as Exit from 'effect/Exit';
|
|
9
|
+
import type * as Types from 'effect/Types';
|
|
9
10
|
import React, { useCallback, useContext, useMemo, useState } from 'react';
|
|
10
11
|
|
|
11
|
-
import { type
|
|
12
|
-
import {
|
|
13
|
-
import { Blueprint,
|
|
12
|
+
import { type AppSurface } from '@dxos/app-toolkit/ui';
|
|
13
|
+
import { AgentPrompt } from '@dxos/assistant-toolkit';
|
|
14
|
+
import { Blueprint, Routine } from '@dxos/compute';
|
|
15
|
+
import { Operation } from '@dxos/compute';
|
|
14
16
|
import { Filter, Obj, Query, Ref } from '@dxos/echo';
|
|
15
17
|
import { QueryBuilder } from '@dxos/echo-query';
|
|
16
|
-
import { type FunctionDefinition, FunctionInvocationService, TracingService } from '@dxos/functions';
|
|
17
18
|
import { invariant } from '@dxos/invariant';
|
|
18
19
|
import { log } from '@dxos/log';
|
|
19
|
-
import { useComputeRuntimeCallback } from '@dxos/plugin-automation';
|
|
20
|
+
import { useComputeRuntimeCallback } from '@dxos/plugin-automation/hooks';
|
|
20
21
|
import { Graph } from '@dxos/plugin-explorer/types';
|
|
21
|
-
import { DropdownMenu, IconButton, Toolbar, useTranslation } from '@dxos/react-ui';
|
|
22
|
+
import { DropdownMenu, IconButton, Panel, Toolbar, useTranslation } from '@dxos/react-ui';
|
|
22
23
|
import { useAttention } from '@dxos/react-ui-attention';
|
|
23
|
-
import {
|
|
24
|
-
import { Text, View } from '@dxos/schema';
|
|
24
|
+
import { Text, ViewModel } from '@dxos/schema';
|
|
25
25
|
import { isNonNullable } from '@dxos/util';
|
|
26
26
|
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import { type Notebook } from '
|
|
27
|
+
import { NotebookMenu, NotebookStack, type NotebookStackProps, type TypescriptEditorProps } from '#components';
|
|
28
|
+
import { meta } from '#meta';
|
|
29
|
+
import { type Notebook } from '#types';
|
|
30
30
|
|
|
31
|
-
import {
|
|
32
|
-
import { type TypescriptEditorProps } from './TypescriptEditor';
|
|
31
|
+
import { ComputeGraph } from '../../notebook';
|
|
33
32
|
|
|
34
|
-
const INCLUDE_BLUEPRINTS = [
|
|
33
|
+
const INCLUDE_BLUEPRINTS = [
|
|
34
|
+
'org.dxos.blueprint.assistant',
|
|
35
|
+
'org.dxos.blueprint.database',
|
|
36
|
+
'org.dxos.blueprint.markdown',
|
|
37
|
+
];
|
|
35
38
|
|
|
36
39
|
// TODO(burdon): Support calling named deployed functions (as with sheet).
|
|
37
40
|
|
|
38
|
-
export type NotebookContainerProps =
|
|
41
|
+
export type NotebookContainerProps = AppSurface.ObjectArticleProps<
|
|
42
|
+
Notebook.Notebook,
|
|
43
|
+
Pick<TypescriptEditorProps, 'env'>
|
|
44
|
+
>;
|
|
39
45
|
|
|
40
|
-
export const NotebookContainer = ({ role, subject: notebook, env }: NotebookContainerProps) => {
|
|
46
|
+
export const NotebookContainer = ({ role, subject: notebook, attendableId, env }: NotebookContainerProps) => {
|
|
41
47
|
const { t } = useTranslation(meta.id);
|
|
42
48
|
const registry = useContext(RegistryContext);
|
|
43
|
-
const db =
|
|
44
|
-
const attendableId = notebook ? Obj.getDXN(notebook).toString() : '';
|
|
49
|
+
const db = Obj.getDatabase(notebook);
|
|
45
50
|
const { hasAttention } = useAttention(attendableId);
|
|
46
51
|
|
|
47
52
|
// TODO(burdon): Consolidate execution and state (with graph).
|
|
@@ -62,18 +67,18 @@ export const NotebookContainer = ({ role, subject: notebook, env }: NotebookCont
|
|
|
62
67
|
const ast = Query.select(filter).ast;
|
|
63
68
|
const graph = cell.graph?.target;
|
|
64
69
|
if (!graph) {
|
|
65
|
-
const { view } = await
|
|
70
|
+
const { view } = await ViewModel.makeFromDatabase({ db });
|
|
66
71
|
const newGraph = Graph.make({ query: { ast }, view });
|
|
67
|
-
Obj.
|
|
68
|
-
const c =
|
|
72
|
+
Obj.update(notebook!, (obj) => {
|
|
73
|
+
const c = obj.cells.find((c) => c.id === cell.id);
|
|
69
74
|
if (c) {
|
|
70
75
|
c.graph = Ref.make(newGraph);
|
|
71
76
|
c.name = name;
|
|
72
77
|
}
|
|
73
78
|
});
|
|
74
79
|
} else {
|
|
75
|
-
Obj.
|
|
76
|
-
graph.query.ast = ast
|
|
80
|
+
Obj.update(graph, (graph) => {
|
|
81
|
+
graph.query.ast = ast as Obj.Mutable<typeof ast>;
|
|
77
82
|
});
|
|
78
83
|
}
|
|
79
84
|
}
|
|
@@ -131,10 +136,10 @@ export const NotebookContainer = ({ role, subject: notebook, env }: NotebookCont
|
|
|
131
136
|
const from = notebook.cells.findIndex((cell) => cell.id === source.id);
|
|
132
137
|
const to = notebook.cells.findIndex((cell) => cell.id === target.id);
|
|
133
138
|
if (from != null && to != null) {
|
|
134
|
-
Obj.
|
|
135
|
-
const cell =
|
|
139
|
+
Obj.update(notebook, (notebook) => {
|
|
140
|
+
const cell = notebook.cells.splice(from, 1)[0];
|
|
136
141
|
if (cell) {
|
|
137
|
-
|
|
142
|
+
notebook.cells.splice(to, 0, cell);
|
|
138
143
|
}
|
|
139
144
|
});
|
|
140
145
|
}
|
|
@@ -145,7 +150,7 @@ export const NotebookContainer = ({ role, subject: notebook, env }: NotebookCont
|
|
|
145
150
|
const handleCellInsert = useCallback<NonNullable<NotebookStackProps['onCellInsert']>>(
|
|
146
151
|
async (type, after) => {
|
|
147
152
|
invariant(notebook);
|
|
148
|
-
const cell: Notebook.Cell = { id: crypto.randomUUID(), type };
|
|
153
|
+
const cell: Types.Mutable<Notebook.Cell> = { id: crypto.randomUUID(), type };
|
|
149
154
|
switch (type) {
|
|
150
155
|
case 'markdown':
|
|
151
156
|
case 'script':
|
|
@@ -160,15 +165,15 @@ export const NotebookContainer = ({ role, subject: notebook, env }: NotebookCont
|
|
|
160
165
|
const blueprints = objects
|
|
161
166
|
.filter((blueprint) => INCLUDE_BLUEPRINTS.includes(blueprint.key))
|
|
162
167
|
.map((blueprint) => Ref.make(blueprint));
|
|
163
|
-
cell.prompt = Ref.make(
|
|
168
|
+
cell.prompt = Ref.make(Routine.make({ instructions: '', blueprints }));
|
|
164
169
|
}
|
|
165
170
|
break;
|
|
166
171
|
}
|
|
167
172
|
}
|
|
168
173
|
|
|
169
174
|
const idx = after ? notebook.cells.findIndex((cell) => cell.id === after) : notebook.cells.length;
|
|
170
|
-
Obj.
|
|
171
|
-
|
|
175
|
+
Obj.update(notebook, (notebook) => {
|
|
176
|
+
notebook.cells.splice(idx, 0, cell);
|
|
172
177
|
});
|
|
173
178
|
},
|
|
174
179
|
[db, notebook],
|
|
@@ -179,8 +184,8 @@ export const NotebookContainer = ({ role, subject: notebook, env }: NotebookCont
|
|
|
179
184
|
invariant(notebook);
|
|
180
185
|
const idx = notebook.cells.findIndex((cell) => cell.id === id);
|
|
181
186
|
if (idx !== -1) {
|
|
182
|
-
Obj.
|
|
183
|
-
|
|
187
|
+
Obj.update(notebook, (notebook) => {
|
|
188
|
+
notebook.cells.splice(idx, 1);
|
|
184
189
|
});
|
|
185
190
|
}
|
|
186
191
|
},
|
|
@@ -188,25 +193,26 @@ export const NotebookContainer = ({ role, subject: notebook, env }: NotebookCont
|
|
|
188
193
|
);
|
|
189
194
|
|
|
190
195
|
return (
|
|
191
|
-
<
|
|
192
|
-
<Toolbar
|
|
193
|
-
<
|
|
194
|
-
<DropdownMenu.
|
|
195
|
-
<
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
196
|
+
<Panel.Root role={role} className='dx-document'>
|
|
197
|
+
<Panel.Toolbar asChild>
|
|
198
|
+
<Toolbar.Root disabled={!hasAttention}>
|
|
199
|
+
<DropdownMenu.Root>
|
|
200
|
+
<DropdownMenu.Trigger asChild>
|
|
201
|
+
<IconButton icon='ph--plus--regular' iconOnly label={t('notebook-cell-insert.label')} />
|
|
202
|
+
</DropdownMenu.Trigger>
|
|
203
|
+
<NotebookMenu onCellInsert={handleCellInsert} />
|
|
204
|
+
</DropdownMenu.Root>
|
|
205
|
+
<Toolbar.IconButton
|
|
206
|
+
icon='ph--play--fill'
|
|
207
|
+
iconOnly
|
|
208
|
+
label={t('compute.label')}
|
|
209
|
+
classNames='text-success-text'
|
|
210
|
+
onClick={handleCompute}
|
|
211
|
+
/>
|
|
212
|
+
</Toolbar.Root>
|
|
213
|
+
</Panel.Toolbar>
|
|
214
|
+
<Panel.Content asChild>
|
|
208
215
|
<NotebookStack
|
|
209
|
-
classNames='container-max-width border-l border-r border-subduedSeparator'
|
|
210
216
|
db={db}
|
|
211
217
|
notebook={notebook}
|
|
212
218
|
graph={graph}
|
|
@@ -216,40 +222,24 @@ export const NotebookContainer = ({ role, subject: notebook, env }: NotebookCont
|
|
|
216
222
|
onCellInsert={handleCellInsert}
|
|
217
223
|
onCellDelete={handleCellDelete}
|
|
218
224
|
/>
|
|
219
|
-
</
|
|
220
|
-
</
|
|
225
|
+
</Panel.Content>
|
|
226
|
+
</Panel.Root>
|
|
221
227
|
);
|
|
222
228
|
};
|
|
223
229
|
|
|
224
|
-
export default NotebookContainer;
|
|
225
|
-
|
|
226
230
|
// TODO(wittjosiah): Factor out. Copied from PromptArticle in plugin-assistant.
|
|
227
231
|
const runPrompt = Effect.fn(function* ({
|
|
228
232
|
prompt,
|
|
229
233
|
input,
|
|
230
234
|
onResult,
|
|
231
235
|
}: {
|
|
232
|
-
prompt: Ref.Ref<
|
|
236
|
+
prompt: Ref.Ref<Routine.Routine>;
|
|
233
237
|
input: Record<string, any>;
|
|
234
238
|
onResult: (result: string) => void;
|
|
235
239
|
}) {
|
|
236
|
-
const inputData:
|
|
237
|
-
prompt,
|
|
238
|
-
input,
|
|
239
|
-
};
|
|
240
|
-
const tracer = yield* TracingService;
|
|
241
|
-
const trace = yield* tracer.traceInvocationStart({
|
|
242
|
-
target: undefined,
|
|
243
|
-
payload: {
|
|
244
|
-
data: {},
|
|
245
|
-
},
|
|
246
|
-
});
|
|
247
|
-
|
|
240
|
+
const inputData: Operation.Definition.Input<typeof AgentPrompt> = { prompt, input };
|
|
248
241
|
// Invoke the function.
|
|
249
|
-
const result = yield*
|
|
250
|
-
Effect.provide(trace.invocationTraceQueue ? TracingService.layerInvocation(trace) : TracingService.layerNoop),
|
|
251
|
-
Effect.exit,
|
|
252
|
-
);
|
|
242
|
+
const result = yield* Operation.invoke(AgentPrompt, inputData).pipe(Effect.orDie, Effect.exit);
|
|
253
243
|
|
|
254
244
|
Exit.match(result, {
|
|
255
245
|
onFailure: (cause) => {
|
|
@@ -261,10 +251,4 @@ const runPrompt = Effect.fn(function* ({
|
|
|
261
251
|
onResult(result.note);
|
|
262
252
|
},
|
|
263
253
|
});
|
|
264
|
-
|
|
265
|
-
yield* tracer.traceInvocationEnd({
|
|
266
|
-
trace,
|
|
267
|
-
// TODO(dmaretskyi): Might miss errors.
|
|
268
|
-
exception: Exit.isFailure(result) ? Cause.prettyErrors(result.cause)[0] : undefined,
|
|
269
|
-
});
|
|
270
254
|
});
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
7
|
+
import React, { useEffect, useState } from 'react';
|
|
8
|
+
|
|
9
|
+
import { SERVICES_CONFIG } from '@dxos/ai/testing';
|
|
10
|
+
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
11
|
+
import { Blueprint } from '@dxos/compute';
|
|
12
|
+
import { Script } from '@dxos/compute';
|
|
13
|
+
import { Operation } from '@dxos/compute';
|
|
14
|
+
import { ClientPlugin } from '@dxos/plugin-client';
|
|
15
|
+
import { initializeIdentity } from '@dxos/plugin-client/testing';
|
|
16
|
+
import { StorybookPlugin, corePlugins } from '@dxos/plugin-testing';
|
|
17
|
+
import { Config } from '@dxos/react-client';
|
|
18
|
+
import { Filter, useQuery, useSpaces } from '@dxos/react-client/echo';
|
|
19
|
+
import { Loading, withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
20
|
+
import { Text } from '@dxos/schema';
|
|
21
|
+
|
|
22
|
+
import { createScript } from '#testing';
|
|
23
|
+
import { translations } from '#translations';
|
|
24
|
+
|
|
25
|
+
import { ScriptContainer } from './ScriptContainer';
|
|
26
|
+
|
|
27
|
+
type DefaultStoryProps = {};
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Loads the script source ref so `script.source.target` is available for the editor.
|
|
31
|
+
*/
|
|
32
|
+
const DefaultStory = (_: DefaultStoryProps) => {
|
|
33
|
+
const [space] = useSpaces();
|
|
34
|
+
const [script] = useQuery(space?.db, Filter.type(Script.Script));
|
|
35
|
+
const [sourceReady, setSourceReady] = useState(false);
|
|
36
|
+
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
if (!script) {
|
|
39
|
+
setSourceReady(false);
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
let canceled = false;
|
|
44
|
+
void (async () => {
|
|
45
|
+
await script.source.load();
|
|
46
|
+
if (!canceled) {
|
|
47
|
+
setSourceReady(true);
|
|
48
|
+
}
|
|
49
|
+
})();
|
|
50
|
+
|
|
51
|
+
return () => {
|
|
52
|
+
canceled = true;
|
|
53
|
+
};
|
|
54
|
+
}, [script]);
|
|
55
|
+
|
|
56
|
+
if (!script || !sourceReady) {
|
|
57
|
+
return <Loading />;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return (
|
|
61
|
+
<div role='none' className='flex flex-col min-h-[80vh] w-document-max-width'>
|
|
62
|
+
<ScriptContainer role='article' subject={script} attendableId='story-script' />
|
|
63
|
+
</div>
|
|
64
|
+
);
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
const meta = {
|
|
68
|
+
title: 'plugins/plugin-script/containers/ScriptContainer',
|
|
69
|
+
render: DefaultStory,
|
|
70
|
+
decorators: [
|
|
71
|
+
withTheme(),
|
|
72
|
+
withLayout({ layout: 'column', classNames: 'w-document-max-width' }),
|
|
73
|
+
withPluginManager({
|
|
74
|
+
plugins: [
|
|
75
|
+
...corePlugins(),
|
|
76
|
+
ClientPlugin({
|
|
77
|
+
config: new Config({
|
|
78
|
+
runtime: {
|
|
79
|
+
services: SERVICES_CONFIG.REMOTE,
|
|
80
|
+
},
|
|
81
|
+
}),
|
|
82
|
+
types: [Script.Script, Operation.PersistentOperation, Blueprint.Blueprint, Text.Text],
|
|
83
|
+
onClientInitialized: ({ client }) =>
|
|
84
|
+
Effect.gen(function* () {
|
|
85
|
+
yield* initializeIdentity(client);
|
|
86
|
+
const [space] = client.spaces.get();
|
|
87
|
+
yield* Effect.promise(() => space.waitUntilReady());
|
|
88
|
+
|
|
89
|
+
createScript(space);
|
|
90
|
+
}),
|
|
91
|
+
}),
|
|
92
|
+
StorybookPlugin({}),
|
|
93
|
+
],
|
|
94
|
+
}),
|
|
95
|
+
],
|
|
96
|
+
parameters: {
|
|
97
|
+
layout: 'fullscreen',
|
|
98
|
+
translations,
|
|
99
|
+
},
|
|
100
|
+
} satisfies Meta<DefaultStoryProps>;
|
|
101
|
+
|
|
102
|
+
export default meta;
|
|
103
|
+
|
|
104
|
+
type Story = StoryObj<typeof meta>;
|
|
105
|
+
|
|
106
|
+
export const Default: Story = {};
|
|
@@ -4,30 +4,29 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useMemo } from 'react';
|
|
6
6
|
|
|
7
|
-
import { type
|
|
7
|
+
import { type AppSurface } from '@dxos/app-toolkit/ui';
|
|
8
|
+
import { type Script } from '@dxos/compute';
|
|
8
9
|
import { Obj } from '@dxos/echo';
|
|
9
10
|
import { createDocAccessor } from '@dxos/echo-db';
|
|
10
|
-
import { type Script } from '@dxos/functions';
|
|
11
11
|
import { getSpace } from '@dxos/react-client/echo';
|
|
12
12
|
import { useIdentity } from '@dxos/react-client/halo';
|
|
13
|
-
import {
|
|
14
|
-
import { createDataExtensions, listener,
|
|
13
|
+
import { Panel } from '@dxos/react-ui';
|
|
14
|
+
import { createDataExtensions, listener, editorClassNames } from '@dxos/ui-editor';
|
|
15
15
|
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
16
|
+
import { ScriptToolbar, TypescriptEditor, type TypescriptEditorProps } from '#components';
|
|
17
|
+
import { useDeployState, useToolbarState } from '#hooks';
|
|
18
|
+
import { type Settings } from '#types';
|
|
18
19
|
|
|
19
|
-
|
|
20
|
-
import { TypescriptEditor, type TypescriptEditorProps } from './TypescriptEditor';
|
|
21
|
-
|
|
22
|
-
export type ScriptEditorProps = SurfaceComponentProps<
|
|
20
|
+
export type ScriptEditorProps = AppSurface.ObjectArticleProps<
|
|
23
21
|
Script.Script,
|
|
24
22
|
{
|
|
25
|
-
settings?:
|
|
23
|
+
settings?: Settings.Settings;
|
|
26
24
|
} & Pick<TypescriptEditorProps, 'env'>
|
|
27
25
|
>;
|
|
28
26
|
|
|
29
27
|
export const ScriptContainer = ({
|
|
30
28
|
role,
|
|
29
|
+
attendableId,
|
|
31
30
|
subject: script,
|
|
32
31
|
settings = { editorInputMode: 'vscode' },
|
|
33
32
|
env,
|
|
@@ -52,8 +51,8 @@ export const ScriptContainer = ({
|
|
|
52
51
|
listener({
|
|
53
52
|
onChange: ({ text }) => {
|
|
54
53
|
if (script.source.target?.content !== text) {
|
|
55
|
-
Obj.
|
|
56
|
-
|
|
54
|
+
Obj.update(script, (script) => {
|
|
55
|
+
script.changed = true;
|
|
57
56
|
});
|
|
58
57
|
}
|
|
59
58
|
},
|
|
@@ -66,19 +65,21 @@ export const ScriptContainer = ({
|
|
|
66
65
|
}
|
|
67
66
|
|
|
68
67
|
return (
|
|
69
|
-
<
|
|
70
|
-
<
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
68
|
+
<Panel.Root role={role}>
|
|
69
|
+
<Panel.Toolbar asChild>
|
|
70
|
+
<ScriptToolbar script={script} attendableId={attendableId} state={state} role={role} />
|
|
71
|
+
</Panel.Toolbar>
|
|
72
|
+
<Panel.Content asChild>
|
|
73
|
+
<TypescriptEditor
|
|
74
|
+
classNames={editorClassNames(role)}
|
|
75
|
+
id={script.id}
|
|
76
|
+
env={env}
|
|
77
|
+
initialValue={script.source?.target?.content}
|
|
78
|
+
extensions={extensions}
|
|
79
|
+
inputMode={settings.editorInputMode}
|
|
80
|
+
toolbar
|
|
81
|
+
/>
|
|
82
|
+
</Panel.Content>
|
|
83
|
+
</Panel.Root>
|
|
81
84
|
);
|
|
82
85
|
};
|
|
83
|
-
|
|
84
|
-
export default ScriptContainer;
|