@dxos/plugin-script 0.8.4-main.9735255 → 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-NBAXYESH.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-IUAYVJSD.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 +5 -3
- package/dist/types/src/templates/chess-bot.d.ts.map +1 -1
- package/dist/types/src/templates/commentary.d.ts +5 -2
- 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 +42 -26
- 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 +59 -76
- 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 +10 -6
- 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-OSL6RMPA.mjs +0 -14
- package/dist/lib/browser/DeploymentDialog-OSL6RMPA.mjs.map +0 -7
- package/dist/lib/browser/NotebookContainer-NBAXYESH.mjs.map +0 -7
- package/dist/lib/browser/ScriptContainer-WD33CJMI.mjs +0 -149
- package/dist/lib/browser/ScriptContainer-WD33CJMI.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-BTWHM6FH.mjs +0 -270
- package/dist/lib/browser/chunk-BTWHM6FH.mjs.map +0 -7
- package/dist/lib/browser/chunk-C53UJGSU.mjs +0 -557
- package/dist/lib/browser/chunk-C53UJGSU.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-TWX2NMZN.mjs +0 -137
- package/dist/lib/browser/chunk-TWX2NMZN.mjs.map +0 -7
- package/dist/lib/browser/chunk-UUR4JNNB.mjs +0 -113
- package/dist/lib/browser/chunk-UUR4JNNB.mjs.map +0 -7
- package/dist/lib/browser/chunk-UX4GHJ5E.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/chunk-XCN4D3Z5.mjs +0 -606
- package/dist/lib/browser/chunk-XCN4D3Z5.mjs.map +0 -7
- package/dist/lib/browser/compiler-76F3QAXC.mjs +0 -161
- package/dist/lib/browser/compiler-76F3QAXC.mjs.map +0 -7
- package/dist/lib/browser/operation-resolver-HUILPPKT.mjs +0 -82
- package/dist/lib/browser/operation-resolver-HUILPPKT.mjs.map +0 -7
- package/dist/lib/browser/react-surface-O6GKHB2J.mjs +0 -139
- package/dist/lib/browser/react-surface-O6GKHB2J.mjs.map +0 -7
- package/dist/lib/browser/settings-3ENI25PI.mjs +0 -35
- package/dist/lib/browser/settings-3ENI25PI.mjs.map +0 -7
- package/dist/lib/node-esm/DeploymentDialog-OGBJPVIX.mjs +0 -15
- package/dist/lib/node-esm/DeploymentDialog-OGBJPVIX.mjs.map +0 -7
- package/dist/lib/node-esm/NotebookContainer-IUAYVJSD.mjs.map +0 -7
- package/dist/lib/node-esm/ScriptContainer-K7JCEU5Z.mjs +0 -150
- package/dist/lib/node-esm/ScriptContainer-K7JCEU5Z.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-4QNZMXW6.mjs +0 -607
- package/dist/lib/node-esm/chunk-4QNZMXW6.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-BX5PP6AW.mjs +0 -558
- package/dist/lib/node-esm/chunk-BX5PP6AW.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-G3J76DWP.mjs +0 -114
- package/dist/lib/node-esm/chunk-G3J76DWP.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-VQPIA4VF.mjs +0 -138
- package/dist/lib/node-esm/chunk-VQPIA4VF.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/compiler-FNZH6TFN.mjs +0 -162
- package/dist/lib/node-esm/compiler-FNZH6TFN.mjs.map +0 -7
- package/dist/lib/node-esm/operation-resolver-JTCIY6HU.mjs +0 -83
- package/dist/lib/node-esm/operation-resolver-JTCIY6HU.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-RLANMVMB.mjs +0 -140
- package/dist/lib/node-esm/react-surface-RLANMVMB.mjs.map +0 -7
- package/dist/lib/node-esm/settings-7AYC5VXN.mjs +0 -36
- package/dist/lib/node-esm/settings-7AYC5VXN.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
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { next as A, type Doc } from '@automerge/automerge';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
7
|
+
|
|
8
|
+
import { type Script, Operation } from '@dxos/compute';
|
|
9
|
+
import { Database, Obj } from '@dxos/echo';
|
|
10
|
+
import { DocAccessor, createDocAccessor } from '@dxos/echo-db';
|
|
11
|
+
|
|
12
|
+
import { Update } from './definitions';
|
|
13
|
+
|
|
14
|
+
export default Update.pipe(
|
|
15
|
+
Operation.withHandler(
|
|
16
|
+
Effect.fn(function* ({ function: fn, name, description, edits }) {
|
|
17
|
+
const loaded = yield* Database.load(fn);
|
|
18
|
+
if (!loaded.source) {
|
|
19
|
+
return yield* Effect.fail(new Error('Function has no source script.'));
|
|
20
|
+
}
|
|
21
|
+
const script = (yield* Database.load(loaded.source)) as Script.Script;
|
|
22
|
+
|
|
23
|
+
if (name !== undefined || description !== undefined) {
|
|
24
|
+
Obj.update(script, (script) => {
|
|
25
|
+
if (name !== undefined) {
|
|
26
|
+
script.name = name;
|
|
27
|
+
}
|
|
28
|
+
if (description !== undefined) {
|
|
29
|
+
script.description = description;
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (edits && edits.length > 0) {
|
|
35
|
+
const text = yield* Database.load(script.source);
|
|
36
|
+
const accessor = createDocAccessor(text, ['content']);
|
|
37
|
+
|
|
38
|
+
for (const edit of edits) {
|
|
39
|
+
accessor.handle.change((doc: Doc<typeof text>) => {
|
|
40
|
+
const source = DocAccessor.getValue<string>(accessor);
|
|
41
|
+
if (edit.replaceAll) {
|
|
42
|
+
let idx = source.indexOf(edit.oldString);
|
|
43
|
+
while (idx !== -1) {
|
|
44
|
+
A.splice(doc, accessor.path as A.Prop[], idx, edit.oldString.length, edit.newString);
|
|
45
|
+
const updated = DocAccessor.getValue<string>(accessor);
|
|
46
|
+
idx = updated.indexOf(edit.oldString, idx + edit.newString.length);
|
|
47
|
+
}
|
|
48
|
+
} else {
|
|
49
|
+
const idx = source.indexOf(edit.oldString);
|
|
50
|
+
if (idx === -1) {
|
|
51
|
+
throw new Error(`Edit not found: ${JSON.stringify(edit.oldString)}`);
|
|
52
|
+
}
|
|
53
|
+
A.splice(doc, accessor.path as A.Prop[], idx, edit.oldString.length, edit.newString);
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
Obj.update(script, (script) => {
|
|
59
|
+
script.changed = true;
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return {
|
|
64
|
+
function: Obj.getDXN(loaded).toString(),
|
|
65
|
+
};
|
|
66
|
+
}),
|
|
67
|
+
),
|
|
68
|
+
);
|
package/src/blueprints/index.ts
CHANGED
|
@@ -2,23 +2,54 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { Blueprint, Template } from '@dxos/
|
|
6
|
-
import { type FunctionDefinition } from '@dxos/functions';
|
|
5
|
+
import { Blueprint, Template } from '@dxos/compute';
|
|
7
6
|
import { trim } from '@dxos/util';
|
|
8
7
|
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
import {
|
|
9
|
+
Create,
|
|
10
|
+
Read,
|
|
11
|
+
Update,
|
|
12
|
+
Delete,
|
|
13
|
+
Deploy,
|
|
14
|
+
Invoke,
|
|
15
|
+
InspectInvocations,
|
|
16
|
+
QueryDeployedFunctions,
|
|
17
|
+
InstallFunction,
|
|
18
|
+
} from './functions';
|
|
11
19
|
|
|
12
|
-
|
|
20
|
+
const BLUEPRINT_KEY = 'org.dxos.blueprint.script';
|
|
13
21
|
|
|
14
|
-
|
|
22
|
+
const make = () =>
|
|
15
23
|
Blueprint.make({
|
|
16
|
-
key:
|
|
24
|
+
key: BLUEPRINT_KEY,
|
|
17
25
|
name: 'Script',
|
|
18
|
-
|
|
26
|
+
agentCanEnable: true,
|
|
27
|
+
tools: Blueprint.toolDefinitions({
|
|
28
|
+
operations: [
|
|
29
|
+
Create,
|
|
30
|
+
Read,
|
|
31
|
+
Update,
|
|
32
|
+
Delete,
|
|
33
|
+
Deploy,
|
|
34
|
+
Invoke,
|
|
35
|
+
InspectInvocations,
|
|
36
|
+
QueryDeployedFunctions,
|
|
37
|
+
InstallFunction,
|
|
38
|
+
],
|
|
39
|
+
}),
|
|
19
40
|
instructions: Template.make({
|
|
20
41
|
source: trim`
|
|
21
|
-
You can create
|
|
42
|
+
You can create, read, update, and delete scripts which contain TypeScript code.
|
|
43
|
+
You can deploy scripts to the Edge runtime and invoke deployed scripts.
|
|
44
|
+
You can inspect the invocation history of a deployed script.
|
|
45
|
+
You can query all functions deployed to the EDGE runtime and install them into the current space.
|
|
22
46
|
`,
|
|
23
47
|
}),
|
|
24
48
|
});
|
|
49
|
+
|
|
50
|
+
const blueprint: Blueprint.Definition = {
|
|
51
|
+
key: BLUEPRINT_KEY,
|
|
52
|
+
make,
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export default blueprint;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capability } from '@dxos/app-framework';
|
|
8
|
+
import { AppCapabilities, AppNode } from '@dxos/app-toolkit';
|
|
9
|
+
import { Script } from '@dxos/compute';
|
|
10
|
+
import { GraphBuilder } from '@dxos/plugin-graph';
|
|
11
|
+
|
|
12
|
+
import { meta } from '#meta';
|
|
13
|
+
|
|
14
|
+
export default Capability.makeModule(
|
|
15
|
+
Effect.fnUntraced(function* () {
|
|
16
|
+
const extensions = yield* Effect.all([
|
|
17
|
+
GraphBuilder.createTypeExtension({
|
|
18
|
+
id: 'execute',
|
|
19
|
+
type: Script.Script,
|
|
20
|
+
connector: () =>
|
|
21
|
+
Effect.succeed([
|
|
22
|
+
AppNode.makeCompanion({
|
|
23
|
+
id: 'execute',
|
|
24
|
+
label: ['script-test.label', { ns: meta.id }],
|
|
25
|
+
icon: 'ph--terminal--regular',
|
|
26
|
+
data: 'execute',
|
|
27
|
+
}),
|
|
28
|
+
]),
|
|
29
|
+
}),
|
|
30
|
+
GraphBuilder.createTypeExtension({
|
|
31
|
+
id: 'logs',
|
|
32
|
+
type: Script.Script,
|
|
33
|
+
connector: () =>
|
|
34
|
+
Effect.succeed([
|
|
35
|
+
AppNode.makeCompanion({
|
|
36
|
+
id: 'logs',
|
|
37
|
+
label: ['script-logs.label', { ns: meta.id }],
|
|
38
|
+
icon: 'ph--clock-countdown--regular',
|
|
39
|
+
data: 'logs',
|
|
40
|
+
}),
|
|
41
|
+
]),
|
|
42
|
+
}),
|
|
43
|
+
]);
|
|
44
|
+
|
|
45
|
+
return Capability.contributes(AppCapabilities.AppGraphBuilder, extensions);
|
|
46
|
+
}),
|
|
47
|
+
);
|
package/src/capabilities/{artifact-definition/artifact-definition.ts → artifact-definition.ts}
RENAMED
|
@@ -11,14 +11,13 @@ import * as Schema from 'effect/Schema';
|
|
|
11
11
|
import { ToolResult, createTool } from '@dxos/ai';
|
|
12
12
|
import { Capabilities, Capability, type PromiseIntentDispatcher, createIntent } from '@dxos/app-framework';
|
|
13
13
|
import { ArtifactId, createArtifactElement } from '@dxos/assistant';
|
|
14
|
-
import { defineArtifact } from '@dxos/
|
|
14
|
+
import { defineArtifact, ScriptType } from '@dxos/compute';
|
|
15
15
|
import { Filter, Obj, Ref } from '@dxos/echo';
|
|
16
|
-
import { ScriptType } from '@dxos/functions';
|
|
17
16
|
import { invariant } from '@dxos/invariant';
|
|
18
17
|
import { SpaceAction } from '@dxos/plugin-space/types';
|
|
19
18
|
import { type Space } from '@dxos/react-client/echo';
|
|
20
19
|
|
|
21
|
-
import { meta } from '
|
|
20
|
+
import { meta } from '#meta';
|
|
22
21
|
|
|
23
22
|
// TODO(burdon): Factor out.
|
|
24
23
|
declare global {
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capability } from '@dxos/app-framework';
|
|
8
|
+
import { AppCapabilities } from '@dxos/app-toolkit';
|
|
9
|
+
// eslint-disable-next-line unused-imports/no-unused-imports
|
|
10
|
+
import type { Blueprint } from '@dxos/compute';
|
|
11
|
+
|
|
12
|
+
import { ScriptBlueprint } from '#blueprints';
|
|
13
|
+
|
|
14
|
+
const blueprintDefinition = Capability.makeModule<
|
|
15
|
+
[],
|
|
16
|
+
Capability.Capability<typeof AppCapabilities.BlueprintDefinition>[]
|
|
17
|
+
>(() => Effect.succeed([Capability.contributes(AppCapabilities.BlueprintDefinition, ScriptBlueprint)]));
|
|
18
|
+
|
|
19
|
+
export default blueprintDefinition;
|
|
@@ -15,8 +15,9 @@ import { initializeBundler } from '@dxos/functions-runtime/bundler';
|
|
|
15
15
|
import { log } from '@dxos/log';
|
|
16
16
|
import { trim } from '@dxos/util';
|
|
17
17
|
|
|
18
|
-
import {
|
|
19
|
-
|
|
18
|
+
import { ScriptCapabilities } from '#types';
|
|
19
|
+
|
|
20
|
+
import { Compiler } from '../compiler';
|
|
20
21
|
|
|
21
22
|
// TODO(burdon): Document.
|
|
22
23
|
const SCRIPT_PACKAGES_BUCKET = 'https://pub-5745ae82e450484aa28f75fc6a175935.r2.dev/dev/';
|
|
@@ -25,11 +26,16 @@ const NO_TYPES = true; // Types temopararly disabled due to compiler erorrs.
|
|
|
25
26
|
|
|
26
27
|
export default Capability.makeModule(() =>
|
|
27
28
|
Effect.gen(function* () {
|
|
28
|
-
yield* Effect.tryPromise(
|
|
29
|
+
yield* Effect.tryPromise({
|
|
30
|
+
try: () => initializeBundler({ wasmUrl }),
|
|
31
|
+
catch: (error) => new Error(`Failed to initialize bundler: ${error}`),
|
|
32
|
+
});
|
|
29
33
|
|
|
30
34
|
const runtimeModules = yield* fetchRuntimeModules().pipe(Effect.provide(FetchHttpClient.layer));
|
|
31
35
|
|
|
32
36
|
const compiler = new Compiler({
|
|
37
|
+
target: ts.ScriptTarget.ES2022,
|
|
38
|
+
lib: ['lib.es2022.d.ts', 'lib.dom.d.ts'],
|
|
33
39
|
skipLibCheck: true,
|
|
34
40
|
moduleResolution: ts.ModuleResolutionKind.Bundler,
|
|
35
41
|
allowImportingTsExtensions: true,
|
|
@@ -39,12 +45,14 @@ export default Capability.makeModule(() =>
|
|
|
39
45
|
paths: Object.fromEntries(runtimeModules.map((mod: any) => [mod.moduleName, [`./src/${mod.filename}`]])),
|
|
40
46
|
});
|
|
41
47
|
|
|
42
|
-
yield* Effect.tryPromise(
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
+
yield* Effect.tryPromise({
|
|
49
|
+
try: () =>
|
|
50
|
+
compiler.initialize(trim`
|
|
51
|
+
declare module 'https://*';
|
|
52
|
+
${NO_TYPES ? '' : 'declare module "*";'}
|
|
53
|
+
`),
|
|
54
|
+
catch: (error) => new Error(`Failed to initialize compiler: ${error}`),
|
|
55
|
+
});
|
|
48
56
|
if (!NO_TYPES) {
|
|
49
57
|
for (const mod of runtimeModules) {
|
|
50
58
|
compiler.setFile(`/src/${mod.filename}`, mod.content);
|
|
@@ -2,9 +2,16 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export
|
|
10
|
-
export
|
|
5
|
+
import { Capability } from '@dxos/app-framework';
|
|
6
|
+
// eslint-disable-next-line unused-imports/no-unused-imports
|
|
7
|
+
import type { Blueprint, OperationHandlerSet } from '@dxos/compute';
|
|
8
|
+
|
|
9
|
+
export const AppGraphBuilder = Capability.lazy('AppGraphBuilder', () => import('./app-graph-builder'));
|
|
10
|
+
export const BlueprintDefinition = Capability.lazy('BlueprintDefinition', () => import('./blueprint-definition'));
|
|
11
|
+
export const Compiler = Capability.lazy('Compiler', () => import('./compiler'));
|
|
12
|
+
export const OperationHandler = Capability.lazy<OperationHandlerSet.OperationHandlerSet>(
|
|
13
|
+
'OperationHandler',
|
|
14
|
+
() => import('./operation-handler'),
|
|
15
|
+
);
|
|
16
|
+
export const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));
|
|
17
|
+
export const ScriptSettings = Capability.lazy('ScriptSettings', () => import('./settings'));
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
8
|
+
import { OperationHandlerSet } from '@dxos/compute';
|
|
9
|
+
|
|
10
|
+
import { ScriptOperationHandlerSet } from '#operations';
|
|
11
|
+
|
|
12
|
+
import { ScriptHandlers } from '../blueprints/functions';
|
|
13
|
+
|
|
14
|
+
export default Capability.makeModule<OperationHandlerSet.OperationHandlerSet>(
|
|
15
|
+
Effect.fnUntraced(function* () {
|
|
16
|
+
return Capability.contributes(
|
|
17
|
+
Capabilities.OperationHandler,
|
|
18
|
+
OperationHandlerSet.merge(ScriptOperationHandlerSet, ScriptHandlers),
|
|
19
|
+
);
|
|
20
|
+
}),
|
|
21
|
+
);
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
import React, { type ComponentProps } from 'react';
|
|
7
|
+
|
|
8
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
9
|
+
import { Surface, useAtomCapability, useSettingsState } from '@dxos/app-framework/ui';
|
|
10
|
+
import { AppSurface } from '@dxos/app-toolkit/ui';
|
|
11
|
+
import { Script } from '@dxos/compute';
|
|
12
|
+
import { InvocationTraceContainer } from '@dxos/devtools';
|
|
13
|
+
import { Feed } from '@dxos/echo';
|
|
14
|
+
import { useClient } from '@dxos/react-client';
|
|
15
|
+
import { getSpace } from '@dxos/react-client/echo';
|
|
16
|
+
import { Panel } from '@dxos/react-ui';
|
|
17
|
+
|
|
18
|
+
import { ScriptPluginSettings } from '#components';
|
|
19
|
+
import { DeploymentDialog, NotebookContainer, ScriptContainer, ScriptProperties, TestContainer } from '#containers';
|
|
20
|
+
import { useCompiler } from '#hooks';
|
|
21
|
+
import { meta } from '#meta';
|
|
22
|
+
import { Notebook, ScriptCapabilities, type Settings } from '#types';
|
|
23
|
+
|
|
24
|
+
import { DEPLOYMENT_DIALOG } from '../constants';
|
|
25
|
+
import { getAccessCredential } from '../util';
|
|
26
|
+
|
|
27
|
+
export default Capability.makeModule(() =>
|
|
28
|
+
Effect.succeed(
|
|
29
|
+
Capability.contributes(Capabilities.ReactSurface, [
|
|
30
|
+
Surface.create({
|
|
31
|
+
id: 'plugin-settings',
|
|
32
|
+
filter: AppSurface.settings(AppSurface.Article, meta.id),
|
|
33
|
+
component: ({ data: { subject } }) => {
|
|
34
|
+
const { settings, updateSettings } = useSettingsState<Settings.Settings>(subject.atom);
|
|
35
|
+
const client = useClient();
|
|
36
|
+
// TODO(burdon): Check token.
|
|
37
|
+
const handleAuthenticate = async () => {
|
|
38
|
+
const { identityKey } = client.halo.identity.get()!;
|
|
39
|
+
await client.halo.writeCredentials([getAccessCredential(identityKey)]);
|
|
40
|
+
};
|
|
41
|
+
return (
|
|
42
|
+
<ScriptPluginSettings
|
|
43
|
+
settings={settings}
|
|
44
|
+
onSettingsChange={updateSettings}
|
|
45
|
+
onAuthenticate={handleAuthenticate}
|
|
46
|
+
/>
|
|
47
|
+
);
|
|
48
|
+
},
|
|
49
|
+
}),
|
|
50
|
+
Surface.create({
|
|
51
|
+
id: 'script.article',
|
|
52
|
+
// TODO(wittjosiah): Split into multiple surfaces if this filter proves too strict for non-article roles.
|
|
53
|
+
filter: AppSurface.oneOf(
|
|
54
|
+
AppSurface.object(AppSurface.Article, Script.Script),
|
|
55
|
+
AppSurface.object(AppSurface.Section, Script.Script),
|
|
56
|
+
),
|
|
57
|
+
component: ({ data, role }) => {
|
|
58
|
+
const compiler = useCompiler();
|
|
59
|
+
const settings = useAtomCapability(ScriptCapabilities.Settings);
|
|
60
|
+
return (
|
|
61
|
+
<ScriptContainer
|
|
62
|
+
role={role}
|
|
63
|
+
subject={data.subject}
|
|
64
|
+
attendableId={data.attendableId}
|
|
65
|
+
settings={settings}
|
|
66
|
+
env={compiler?.environment}
|
|
67
|
+
/>
|
|
68
|
+
);
|
|
69
|
+
},
|
|
70
|
+
}),
|
|
71
|
+
Surface.create({
|
|
72
|
+
id: 'notebook.article',
|
|
73
|
+
filter: AppSurface.object(AppSurface.Article, Notebook.Notebook),
|
|
74
|
+
component: ({ data, role }) => {
|
|
75
|
+
const compiler = useCompiler();
|
|
76
|
+
return (
|
|
77
|
+
<NotebookContainer
|
|
78
|
+
role={role}
|
|
79
|
+
subject={data.subject}
|
|
80
|
+
attendableId={data.attendableId}
|
|
81
|
+
env={compiler?.environment}
|
|
82
|
+
/>
|
|
83
|
+
);
|
|
84
|
+
},
|
|
85
|
+
}),
|
|
86
|
+
Surface.create({
|
|
87
|
+
id: 'properties',
|
|
88
|
+
filter: AppSurface.object(AppSurface.ObjectProperties, Script.Script),
|
|
89
|
+
component: ({ data, role }) => <ScriptProperties role={role} subject={data.subject} />,
|
|
90
|
+
}),
|
|
91
|
+
Surface.create({
|
|
92
|
+
id: 'companion.execute',
|
|
93
|
+
filter: AppSurface.allOf(
|
|
94
|
+
AppSurface.literal(AppSurface.Article, 'execute'),
|
|
95
|
+
AppSurface.companion(AppSurface.Article, Script.Script),
|
|
96
|
+
),
|
|
97
|
+
component: ({ data, role }) => <TestContainer script={data.companionTo} role={role} />,
|
|
98
|
+
}),
|
|
99
|
+
Surface.create({
|
|
100
|
+
id: 'companion.logs',
|
|
101
|
+
filter: AppSurface.allOf(
|
|
102
|
+
AppSurface.literal(AppSurface.Article, 'logs'),
|
|
103
|
+
AppSurface.companion(AppSurface.Article, Script.Script),
|
|
104
|
+
),
|
|
105
|
+
component: ({ data, role }) => {
|
|
106
|
+
const space = getSpace(data.companionTo);
|
|
107
|
+
const feed = space?.properties.invocationTraceFeed?.target;
|
|
108
|
+
const queueDxn = feed ? Feed.getQueueDxn(feed) : undefined;
|
|
109
|
+
return (
|
|
110
|
+
<Panel.Root role={role}>
|
|
111
|
+
<Panel.Content>
|
|
112
|
+
<InvocationTraceContainer
|
|
113
|
+
db={space?.db}
|
|
114
|
+
queueDxn={queueDxn}
|
|
115
|
+
target={data.companionTo}
|
|
116
|
+
detailAxis='block'
|
|
117
|
+
/>
|
|
118
|
+
</Panel.Content>
|
|
119
|
+
</Panel.Root>
|
|
120
|
+
);
|
|
121
|
+
},
|
|
122
|
+
}),
|
|
123
|
+
Surface.create({
|
|
124
|
+
id: DEPLOYMENT_DIALOG,
|
|
125
|
+
filter: AppSurface.component<ComponentProps<typeof DeploymentDialog>>(AppSurface.Dialog, DEPLOYMENT_DIALOG),
|
|
126
|
+
component: ({ data }) => <DeploymentDialog {...data.props} />,
|
|
127
|
+
}),
|
|
128
|
+
]),
|
|
129
|
+
),
|
|
130
|
+
);
|
|
@@ -4,17 +4,18 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
|
|
7
|
-
import { Capability
|
|
7
|
+
import { Capability } from '@dxos/app-framework';
|
|
8
|
+
import { AppCapabilities } from '@dxos/app-toolkit';
|
|
8
9
|
import { createKvsStore } from '@dxos/effect';
|
|
9
10
|
|
|
10
|
-
import { meta } from '
|
|
11
|
-
import { ScriptCapabilities,
|
|
11
|
+
import { meta } from '#meta';
|
|
12
|
+
import { ScriptCapabilities, Settings } from '#types';
|
|
12
13
|
|
|
13
14
|
export default Capability.makeModule(() =>
|
|
14
15
|
Effect.sync(() => {
|
|
15
16
|
const settingsAtom = createKvsStore({
|
|
16
17
|
key: meta.id,
|
|
17
|
-
schema:
|
|
18
|
+
schema: Settings.Settings,
|
|
18
19
|
defaultValue: () => ({
|
|
19
20
|
editorInputMode: 'vscode' as const,
|
|
20
21
|
}),
|
|
@@ -22,9 +23,9 @@ export default Capability.makeModule(() =>
|
|
|
22
23
|
|
|
23
24
|
return [
|
|
24
25
|
Capability.contributes(ScriptCapabilities.Settings, settingsAtom),
|
|
25
|
-
Capability.contributes(
|
|
26
|
+
Capability.contributes(AppCapabilities.Settings, {
|
|
26
27
|
prefix: meta.id,
|
|
27
|
-
schema:
|
|
28
|
+
schema: Settings.Settings,
|
|
28
29
|
atom: settingsAtom,
|
|
29
30
|
}),
|
|
30
31
|
];
|
package/src/compiler/compiler.ts
CHANGED
|
@@ -14,6 +14,13 @@ import { invariant } from '@dxos/invariant';
|
|
|
14
14
|
|
|
15
15
|
const GLOBALS = 'globals.d.ts';
|
|
16
16
|
|
|
17
|
+
/** TS version hosted on playgroundcdn.typescriptlang.org used to fetch lib .d.ts files.
|
|
18
|
+
* Pinned to 5.6.3 because 5.7+ removed lib.es2022.sharedmemory.d.ts from the CDN.
|
|
19
|
+
* The remaining 404s (lib.core.d.ts, lib.core.es6/7.d.ts, lib.es7.d.ts) are phantom
|
|
20
|
+
* entries in @typescript/vfs's hardcoded file list and are harmlessly caught.
|
|
21
|
+
*/
|
|
22
|
+
const CDN_TS_VERSION = '5.6.3';
|
|
23
|
+
|
|
17
24
|
const defaultOptions: ts.CompilerOptions = {
|
|
18
25
|
lib: ['DOM', 'es2022'],
|
|
19
26
|
target: ts.ScriptTarget.ES2022,
|
|
@@ -32,7 +39,7 @@ export class Compiler {
|
|
|
32
39
|
|
|
33
40
|
// TODO(wittjosiah): Figure out how to get workers working in plugin packages.
|
|
34
41
|
// https://github.com/val-town/codemirror-ts?tab=readme-ov-file#setup-worker
|
|
35
|
-
this._fsMap = await createDefaultMapFromCDN(this._options,
|
|
42
|
+
this._fsMap = await createDefaultMapFromCDN(this._options, CDN_TS_VERSION, true, ts);
|
|
36
43
|
if (globals) {
|
|
37
44
|
this._fsMap.set(GLOBALS, globals);
|
|
38
45
|
}
|
|
@@ -11,9 +11,9 @@ import { log } from '@dxos/log';
|
|
|
11
11
|
import { useClient } from '@dxos/react-client';
|
|
12
12
|
import { createProtoRpcPeer } from '@dxos/rpc';
|
|
13
13
|
import { createIFramePort } from '@dxos/rpc-tunnel';
|
|
14
|
-
import {
|
|
14
|
+
import { mx } from '@dxos/ui-theme';
|
|
15
15
|
|
|
16
|
-
export type
|
|
16
|
+
export type FramePanelProps = {
|
|
17
17
|
containerUrl: string;
|
|
18
18
|
result: BundleResult;
|
|
19
19
|
debug?: boolean;
|
|
@@ -22,7 +22,7 @@ export type FrameContainerProps = {
|
|
|
22
22
|
/**
|
|
23
23
|
* IFrame container for the compiled script.
|
|
24
24
|
*/
|
|
25
|
-
export const
|
|
25
|
+
export const FramePanel = ({ containerUrl, result, debug = true }: FramePanelProps) => {
|
|
26
26
|
const client = useClient();
|
|
27
27
|
const iframeRef = useRef<HTMLIFrameElement>(null);
|
|
28
28
|
useEffect(() => {
|
|
@@ -61,8 +61,7 @@ export const FrameContainer = ({ containerUrl, result, debug = true }: FrameCont
|
|
|
61
61
|
<div className='relative'>
|
|
62
62
|
<div
|
|
63
63
|
className={mx(
|
|
64
|
-
|
|
65
|
-
'flex absolute right-2 bottom-2 is-[30rem] bs-[200px] ring rounded',
|
|
64
|
+
'flex absolute right-2 bottom-2 w-[30rem] h-[200px] bg-base-surface ring rounded-sm',
|
|
66
65
|
'z-20 overflow-x-hidden overflow-y-auto',
|
|
67
66
|
)}
|
|
68
67
|
>
|