@dxos/plugin-script 0.8.4-main.70d3990 → 0.8.4-main.7996785055
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-LGEGIX64.mjs +124 -0
- package/dist/lib/browser/DeploymentDialog-LGEGIX64.mjs.map +7 -0
- package/dist/lib/browser/{NotebookContainer-MHY3DXDE.mjs → NotebookContainer-CC3G32Q5.mjs} +281 -248
- package/dist/lib/browser/NotebookContainer-CC3G32Q5.mjs.map +7 -0
- package/dist/lib/browser/ScriptContainer-Z3MCPN2D.mjs +95 -0
- package/dist/lib/browser/ScriptContainer-Z3MCPN2D.mjs.map +7 -0
- package/dist/lib/browser/ScriptObjectSettings-LST7DUAN.mjs +297 -0
- package/dist/lib/browser/ScriptObjectSettings-LST7DUAN.mjs.map +7 -0
- package/dist/lib/browser/ScriptPluginSettings-IKWRISC3.mjs +55 -0
- package/dist/lib/browser/ScriptPluginSettings-IKWRISC3.mjs.map +7 -0
- package/dist/lib/browser/ScriptProperties-ZCRTZTAK.mjs +28 -0
- package/dist/lib/browser/ScriptProperties-ZCRTZTAK.mjs.map +7 -0
- package/dist/lib/browser/TestContainer-ACNQMKVU.mjs +61 -0
- package/dist/lib/browser/TestContainer-ACNQMKVU.mjs.map +7 -0
- package/dist/lib/browser/access-token-created-ZHVVOEL7.mjs +36 -0
- package/dist/lib/browser/access-token-created-ZHVVOEL7.mjs.map +7 -0
- package/dist/lib/browser/app-graph-builder-QPXX4YK5.mjs +63 -0
- package/dist/lib/browser/app-graph-builder-QPXX4YK5.mjs.map +7 -0
- package/dist/lib/browser/blueprint-definition-MC264VR5.mjs +17 -0
- package/dist/lib/browser/blueprint-definition-MC264VR5.mjs.map +7 -0
- package/dist/lib/browser/blueprints/index.mjs +8 -0
- package/dist/lib/browser/{chunk-EB6AXFXO.mjs → chunk-37XPSUAH.mjs} +3 -3
- package/dist/lib/browser/chunk-37XPSUAH.mjs.map +7 -0
- package/dist/lib/browser/chunk-4XJSGCAS.mjs +742 -0
- package/dist/lib/browser/chunk-4XJSGCAS.mjs.map +7 -0
- package/dist/lib/browser/chunk-7JI376EM.mjs +20 -0
- package/dist/lib/browser/chunk-7JI376EM.mjs.map +7 -0
- package/dist/lib/browser/{compiler-4KHRSX7J.mjs → chunk-ATTZUDT7.mjs} +14 -33
- package/dist/lib/browser/chunk-ATTZUDT7.mjs.map +7 -0
- package/dist/lib/browser/chunk-BHRCZLLU.mjs +105 -0
- package/dist/lib/browser/chunk-BHRCZLLU.mjs.map +7 -0
- package/dist/lib/browser/chunk-CMHREENI.mjs +8 -0
- package/dist/lib/browser/chunk-CMHREENI.mjs.map +7 -0
- package/dist/lib/browser/chunk-DBEYGFVF.mjs +400 -0
- package/dist/lib/browser/chunk-DBEYGFVF.mjs.map +7 -0
- package/dist/lib/browser/chunk-E6BQ4P6L.mjs +179 -0
- package/dist/lib/browser/chunk-E6BQ4P6L.mjs.map +7 -0
- package/dist/lib/browser/chunk-GB2HL4ZE.mjs +26 -0
- package/dist/lib/browser/chunk-GB2HL4ZE.mjs.map +7 -0
- package/dist/lib/browser/chunk-NQJRENSK.mjs +75 -0
- package/dist/lib/browser/chunk-NQJRENSK.mjs.map +7 -0
- package/dist/lib/browser/chunk-QLFFA4Y4.mjs +52 -0
- package/dist/lib/browser/chunk-QLFFA4Y4.mjs.map +7 -0
- package/dist/lib/browser/chunk-X44CJ7F5.mjs +11 -0
- package/dist/lib/browser/chunk-X44CJ7F5.mjs.map +7 -0
- package/dist/lib/browser/compiler-MZKFKYCG.mjs +98 -0
- package/dist/lib/browser/compiler-MZKFKYCG.mjs.map +7 -0
- package/dist/lib/browser/create-script-Z7J4HDV2.mjs +47 -0
- package/dist/lib/browser/create-script-Z7J4HDV2.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +120 -120
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/operation-handler-76AHUB5G.mjs +18 -0
- package/dist/lib/browser/operation-handler-76AHUB5G.mjs.map +7 -0
- package/dist/lib/browser/operations/index.mjs +14 -0
- package/dist/lib/browser/react-surface-2VVUIV66.mjs +145 -0
- package/dist/lib/browser/react-surface-2VVUIV66.mjs.map +7 -0
- package/dist/lib/browser/settings-BV3KXROF.mjs +35 -0
- package/dist/lib/browser/settings-BV3KXROF.mjs.map +7 -0
- package/dist/lib/browser/templates/index.mjs +1 -1
- package/dist/lib/browser/types/index.mjs +6 -5
- package/dist/lib/node-esm/DeploymentDialog-XSP2EDU2.mjs +125 -0
- package/dist/lib/node-esm/DeploymentDialog-XSP2EDU2.mjs.map +7 -0
- package/dist/lib/node-esm/{NotebookContainer-U4C2HQ4T.mjs → NotebookContainer-LNWMJD2D.mjs} +281 -248
- package/dist/lib/node-esm/NotebookContainer-LNWMJD2D.mjs.map +7 -0
- package/dist/lib/node-esm/ScriptContainer-TSU4DBGA.mjs +96 -0
- package/dist/lib/node-esm/ScriptContainer-TSU4DBGA.mjs.map +7 -0
- package/dist/lib/node-esm/ScriptObjectSettings-OGY7X3UE.mjs +298 -0
- package/dist/lib/node-esm/ScriptObjectSettings-OGY7X3UE.mjs.map +7 -0
- package/dist/lib/node-esm/ScriptPluginSettings-HIUSAHCP.mjs +56 -0
- package/dist/lib/node-esm/ScriptPluginSettings-HIUSAHCP.mjs.map +7 -0
- package/dist/lib/node-esm/ScriptProperties-I6SC4P3R.mjs +29 -0
- package/dist/lib/node-esm/ScriptProperties-I6SC4P3R.mjs.map +7 -0
- package/dist/lib/node-esm/TestContainer-WKISNRNU.mjs +62 -0
- package/dist/lib/node-esm/TestContainer-WKISNRNU.mjs.map +7 -0
- package/dist/lib/node-esm/access-token-created-7CGU7FXD.mjs +37 -0
- package/dist/lib/node-esm/access-token-created-7CGU7FXD.mjs.map +7 -0
- package/dist/lib/node-esm/app-graph-builder-GNGOYXIU.mjs +64 -0
- package/dist/lib/node-esm/app-graph-builder-GNGOYXIU.mjs.map +7 -0
- package/dist/lib/node-esm/blueprint-definition-DTRGTRZA.mjs +18 -0
- package/dist/lib/node-esm/blueprint-definition-DTRGTRZA.mjs.map +7 -0
- package/dist/lib/node-esm/blueprints/index.mjs +9 -0
- package/dist/lib/node-esm/blueprints/index.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-2NGQCFVE.mjs +28 -0
- package/dist/lib/node-esm/chunk-2NGQCFVE.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-4YAEFFW2.mjs +12 -0
- package/dist/lib/node-esm/chunk-4YAEFFW2.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-C3GH2SDF.mjs +76 -0
- package/dist/lib/node-esm/chunk-C3GH2SDF.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-CKYUNEE5.mjs +10 -0
- package/dist/lib/node-esm/chunk-CKYUNEE5.mjs.map +7 -0
- package/dist/lib/node-esm/{compiler-DU5NQISX.mjs → chunk-JGN7TDJH.mjs} +14 -32
- package/dist/lib/node-esm/chunk-JGN7TDJH.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-IBV2DR36.mjs → chunk-L3JLWXB5.mjs} +3 -3
- package/dist/lib/node-esm/chunk-L3JLWXB5.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-L55OBVT5.mjs +53 -0
- package/dist/lib/node-esm/chunk-L55OBVT5.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-P4Q2BPBB.mjs +22 -0
- package/dist/lib/node-esm/chunk-P4Q2BPBB.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-RN2SMYCL.mjs +401 -0
- package/dist/lib/node-esm/chunk-RN2SMYCL.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-RTM3D4T5.mjs +181 -0
- package/dist/lib/node-esm/chunk-RTM3D4T5.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-SV742UH7.mjs +743 -0
- package/dist/lib/node-esm/chunk-SV742UH7.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-Y5VWHRVU.mjs +107 -0
- package/dist/lib/node-esm/chunk-Y5VWHRVU.mjs.map +7 -0
- package/dist/lib/node-esm/compiler-QBWP7ERK.mjs +99 -0
- package/dist/lib/node-esm/compiler-QBWP7ERK.mjs.map +7 -0
- package/dist/lib/node-esm/create-script-TAJHVROB.mjs +48 -0
- package/dist/lib/node-esm/create-script-TAJHVROB.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +120 -120
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/operation-handler-OUROH3T7.mjs +19 -0
- package/dist/lib/node-esm/operation-handler-OUROH3T7.mjs.map +7 -0
- 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/react-surface-OJ55GFCP.mjs +146 -0
- package/dist/lib/node-esm/react-surface-OJ55GFCP.mjs.map +7 -0
- package/dist/lib/node-esm/settings-2TK3XPLD.mjs +36 -0
- package/dist/lib/node-esm/settings-2TK3XPLD.mjs.map +7 -0
- package/dist/lib/node-esm/templates/index.mjs +1 -1
- package/dist/lib/node-esm/types/index.mjs +6 -5
- package/dist/types/src/ScriptPlugin.d.ts +2 -1
- package/dist/types/src/ScriptPlugin.d.ts.map +1 -1
- package/dist/types/src/blueprints/index.d.ts +2 -0
- package/dist/types/src/blueprints/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/script-blueprint.d.ts +4 -0
- package/dist/types/src/blueprints/script-blueprint.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +6 -0
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts +3 -0
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/artifact-definition/artifact-definition.d.ts +12 -0
- package/dist/types/src/capabilities/artifact-definition/artifact-definition.d.ts.map +1 -0
- package/dist/types/src/capabilities/artifact-definition/index.d.ts +3 -0
- package/dist/types/src/capabilities/artifact-definition/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts +6 -0
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts.map +1 -0
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts +3 -0
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/compiler/compiler.d.ts +6 -0
- package/dist/types/src/capabilities/compiler/compiler.d.ts.map +1 -0
- package/dist/types/src/capabilities/compiler/index.d.ts +3 -0
- package/dist/types/src/capabilities/compiler/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +6 -7
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-handler/index.d.ts +4 -0
- package/dist/types/src/capabilities/operation-handler/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-handler/operation-handler.d.ts +6 -0
- package/dist/types/src/capabilities/operation-handler/operation-handler.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts +3 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +5 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/settings/index.d.ts +7 -0
- package/dist/types/src/capabilities/settings/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/settings/settings.d.ts +10 -0
- package/dist/types/src/capabilities/settings/settings.d.ts.map +1 -0
- package/dist/types/src/compiler/compiler.d.ts +1 -1
- package/dist/types/src/compiler/compiler.d.ts.map +1 -1
- package/dist/types/src/components/{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 +3 -3
- package/dist/types/src/components/NotebookStack/NotebookCell.d.ts.map +1 -1
- package/dist/types/src/components/NotebookStack/NotebookStack.d.ts +8 -2
- package/dist/types/src/components/NotebookStack/NotebookStack.d.ts.map +1 -1
- package/dist/types/src/components/NotebookStack/NotebookStack.stories.d.ts +5 -1
- package/dist/types/src/components/NotebookStack/NotebookStack.stories.d.ts.map +1 -1
- package/dist/types/src/components/QueryEditor/QueryEditor.d.ts +5 -0
- package/dist/types/src/components/QueryEditor/QueryEditor.d.ts.map +1 -0
- package/dist/types/src/components/QueryEditor/QueryEditor.stories.d.ts +13 -0
- package/dist/types/src/components/QueryEditor/QueryEditor.stories.d.ts.map +1 -0
- package/dist/types/src/components/QueryEditor/index.d.ts +2 -0
- package/dist/types/src/components/QueryEditor/index.d.ts.map +1 -0
- package/dist/types/src/components/ScriptToolbar/ScriptToolbar.d.ts +11 -5
- package/dist/types/src/components/ScriptToolbar/ScriptToolbar.d.ts.map +1 -1
- package/dist/types/src/components/ScriptToolbar/ScriptToolbar.stories.d.ts +5 -1
- package/dist/types/src/components/ScriptToolbar/ScriptToolbar.stories.d.ts.map +1 -1
- package/dist/types/src/components/TestPanel/TestPanel.d.ts +8 -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 +9 -2
- package/dist/types/src/components/TypescriptEditor/TypescriptEditor.d.ts.map +1 -1
- package/dist/types/src/components/TypescriptEditor/TypescriptEditor.stories.d.ts +7 -1
- package/dist/types/src/components/TypescriptEditor/TypescriptEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +4 -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/{components → containers}/DeploymentDialog/DeploymentDialog.stories.d.ts +4 -3
- package/dist/types/src/containers/DeploymentDialog/DeploymentDialog.stories.d.ts.map +1 -0
- package/dist/types/src/containers/DeploymentDialog/index.d.ts +3 -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 +7 -0
- package/dist/types/src/containers/NotebookContainer/NotebookContainer.stories.d.ts.map +1 -0
- package/dist/types/src/containers/NotebookContainer/index.d.ts +3 -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/index.d.ts +3 -0
- package/dist/types/src/containers/ScriptContainer/index.d.ts.map +1 -0
- package/dist/types/src/{components/Settings → containers/ScriptObjectSettings}/ScriptObjectSettings.d.ts +0 -1
- package/dist/types/src/containers/ScriptObjectSettings/ScriptObjectSettings.d.ts.map +1 -0
- package/dist/types/src/containers/ScriptObjectSettings/index.d.ts +3 -0
- package/dist/types/src/containers/ScriptObjectSettings/index.d.ts.map +1 -0
- package/dist/types/src/containers/ScriptPluginSettings/ScriptPluginSettings.d.ts +8 -0
- package/dist/types/src/containers/ScriptPluginSettings/ScriptPluginSettings.d.ts.map +1 -0
- package/dist/types/src/containers/ScriptPluginSettings/index.d.ts +3 -0
- package/dist/types/src/containers/ScriptPluginSettings/index.d.ts.map +1 -0
- package/dist/types/src/containers/ScriptProperties/ScriptProperties.d.ts +7 -0
- package/dist/types/src/containers/ScriptProperties/ScriptProperties.d.ts.map +1 -0
- package/dist/types/src/containers/ScriptProperties/index.d.ts +3 -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 +3 -0
- package/dist/types/src/containers/TestContainer/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +9 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/e2e/ai.test.d.ts +2 -0
- package/dist/types/src/e2e/ai.test.d.ts.map +1 -0
- package/dist/types/src/e2e/deploy.test.d.ts +2 -0
- package/dist/types/src/e2e/deploy.test.d.ts.map +1 -0
- package/dist/types/src/hooks/deploy.d.ts +14 -29
- package/dist/types/src/hooks/deploy.d.ts.map +1 -1
- package/dist/types/src/hooks/format.d.ts +3 -2
- package/dist/types/src/hooks/format.d.ts.map +1 -1
- package/dist/types/src/hooks/index.d.ts +1 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/template.d.ts +3 -2
- package/dist/types/src/hooks/template.d.ts.map +1 -1
- package/dist/types/src/hooks/useCompiler.d.ts +7 -0
- package/dist/types/src/hooks/useCompiler.d.ts.map +1 -0
- package/dist/types/src/hooks/useCreateAndDeployScriptTemplates.d.ts.map +1 -1
- package/dist/types/src/hooks/useToolbarState.d.ts +8 -1
- package/dist/types/src/hooks/useToolbarState.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +2 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/notebook/compute-graph.d.ts +24 -11
- package/dist/types/src/notebook/compute-graph.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 +28 -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 +7 -0
- package/dist/types/src/templates/anthropic.d.ts.map +1 -0
- package/dist/types/src/templates/chess-bot.d.ts +18 -0
- package/dist/types/src/templates/chess-bot.d.ts.map +1 -0
- package/dist/types/src/templates/commentary.d.ts +19 -0
- package/dist/types/src/templates/commentary.d.ts.map +1 -0
- package/dist/types/src/templates/forex-effect.d.ts +5 -1
- package/dist/types/src/templates/forex-effect.d.ts.map +1 -1
- package/dist/types/src/templates/forex.d.ts +5 -1
- package/dist/types/src/templates/forex.d.ts.map +1 -1
- package/dist/types/src/templates/index.d.ts +25 -16
- package/dist/types/src/templates/index.d.ts.map +1 -1
- package/dist/types/src/templates/ping.d.ts +2 -4
- package/dist/types/src/templates/ping.d.ts.map +1 -1
- package/dist/types/src/testing/simulator.test.d.ts +2 -0
- package/dist/types/src/testing/simulator.test.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +2 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Notebook.d.ts +100 -21
- package/dist/types/src/types/Notebook.d.ts.map +1 -1
- package/dist/types/src/types/capabilities.d.ts +12 -0
- package/dist/types/src/types/capabilities.d.ts.map +1 -0
- package/dist/types/src/types/events.d.ts +5 -0
- package/dist/types/src/types/events.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +2 -1
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/util/deploy.d.ts +3 -2
- package/dist/types/src/util/deploy.d.ts.map +1 -1
- package/dist/types/src/util/functions.d.ts +3 -2
- package/dist/types/src/util/functions.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +125 -88
- package/src/ScriptPlugin.tsx +60 -70
- package/src/blueprints/index.ts +5 -0
- package/src/blueprints/script-blueprint.ts +28 -0
- package/src/capabilities/app-graph-builder/app-graph-builder.ts +56 -0
- package/src/capabilities/app-graph-builder/index.ts +7 -0
- package/src/capabilities/{artifact-definition.ts → artifact-definition/artifact-definition.ts} +97 -94
- package/src/capabilities/artifact-definition/index.ts +7 -0
- package/src/capabilities/blueprint-definition/blueprint-definition.ts +17 -0
- package/src/capabilities/blueprint-definition/index.ts +7 -0
- package/src/capabilities/compiler/compiler.ts +103 -0
- package/src/capabilities/compiler/index.ts +7 -0
- package/src/capabilities/index.ts +6 -10
- package/src/capabilities/operation-handler/index.ts +11 -0
- package/src/capabilities/operation-handler/operation-handler.ts +16 -0
- package/src/capabilities/react-surface/index.ts +7 -0
- package/src/capabilities/react-surface/react-surface.tsx +138 -0
- package/src/capabilities/settings/index.ts +7 -0
- package/src/capabilities/settings/settings.ts +33 -0
- package/src/compiler/compiler.ts +10 -3
- package/src/components/{FrameContainer/FrameContainer.tsx → FramePanel/FramePanel.tsx} +7 -6
- package/src/components/{FrameContainer → FramePanel}/index.ts +1 -1
- package/src/components/NotebookStack/NotebookCell.tsx +23 -24
- package/src/components/NotebookStack/NotebookStack.stories.tsx +20 -21
- package/src/components/NotebookStack/NotebookStack.tsx +27 -16
- package/src/components/QueryEditor/QueryEditor.stories.tsx +96 -0
- package/src/components/QueryEditor/QueryEditor.tsx +47 -0
- package/src/components/QueryEditor/index.ts +5 -0
- package/src/components/ScriptToolbar/ScriptToolbar.stories.tsx +39 -17
- package/src/components/ScriptToolbar/ScriptToolbar.tsx +35 -40
- package/src/components/TestPanel/TestPanel.tsx +106 -186
- package/src/components/TestPanel/index.ts +0 -1
- package/src/components/TypescriptEditor/TypescriptEditor.stories.tsx +23 -16
- package/src/components/TypescriptEditor/TypescriptEditor.tsx +73 -65
- package/src/components/index.ts +4 -9
- package/src/constants.ts +7 -0
- package/src/{components → containers}/DeploymentDialog/DeploymentDialog.stories.tsx +29 -24
- package/src/containers/DeploymentDialog/DeploymentDialog.tsx +98 -0
- package/src/containers/DeploymentDialog/index.ts +7 -0
- package/src/{components → containers/NotebookContainer}/NotebookContainer.stories.tsx +30 -29
- package/src/{components → containers/NotebookContainer}/NotebookContainer.tsx +84 -76
- package/src/containers/NotebookContainer/index.ts +7 -0
- package/src/containers/ScriptContainer/ScriptContainer.tsx +85 -0
- package/src/containers/ScriptContainer/index.ts +7 -0
- package/src/{components/Settings → containers/ScriptObjectSettings}/ScriptObjectSettings.tsx +61 -64
- package/src/containers/ScriptObjectSettings/index.ts +7 -0
- package/src/{components/Settings → containers/ScriptPluginSettings}/ScriptPluginSettings.tsx +19 -14
- package/src/containers/ScriptPluginSettings/index.ts +7 -0
- package/src/containers/ScriptProperties/ScriptProperties.tsx +33 -0
- package/src/containers/ScriptProperties/index.ts +7 -0
- package/src/containers/TestContainer/TestContainer.tsx +45 -0
- package/src/containers/TestContainer/index.ts +7 -0
- package/src/containers/index.ts +13 -0
- package/src/e2e/ai.test.ts +93 -0
- package/src/e2e/deploy.test.ts +65 -0
- package/src/hooks/deploy.ts +39 -31
- package/src/hooks/format.ts +6 -1
- package/src/hooks/index.ts +1 -0
- package/src/hooks/template.ts +17 -11
- package/src/hooks/useCompiler.ts +24 -0
- package/src/hooks/useCreateAndDeployScriptTemplates.ts +13 -19
- package/src/hooks/useToolbarState.ts +29 -4
- package/src/index.ts +2 -1
- package/src/meta.ts +4 -4
- package/src/notebook/compute-graph.test.ts +20 -8
- package/src/notebook/compute-graph.ts +45 -21
- package/src/operations/access-token-created.ts +36 -0
- package/src/operations/create-script.ts +47 -0
- package/src/operations/definitions.ts +40 -0
- package/src/operations/index.ts +12 -0
- package/src/templates/anthropic.ts +49 -0
- package/src/templates/chat.ts +1 -1
- package/src/templates/chess-bot.ts +61 -0
- package/src/templates/commentary.ts +243 -0
- package/src/templates/data-generator.ts +2 -2
- package/src/templates/discord.ts +3 -3
- package/src/templates/forex-effect.ts +35 -29
- package/src/templates/forex.ts +27 -17
- package/src/templates/gmail.ts +4 -4
- package/src/templates/index.ts +31 -18
- package/src/templates/ping.ts +22 -5
- package/src/testing/simulator.test.ts +40 -0
- package/src/translations.ts +2 -0
- package/src/types/Notebook.ts +16 -13
- package/src/types/capabilities.ts +17 -0
- package/src/types/events.ts +11 -0
- package/src/types/index.ts +2 -1
- package/src/types/types.ts +1 -1
- package/src/util/deploy.ts +24 -28
- package/src/util/functions.ts +27 -24
- package/src/vite-env.d.ts +2 -0
- package/dist/lib/browser/DeploymentDialog-5TKNGPVR.mjs +0 -14
- package/dist/lib/browser/NotebookContainer-MHY3DXDE.mjs.map +0 -7
- package/dist/lib/browser/ScriptContainer-CW6YN3DQ.mjs +0 -148
- package/dist/lib/browser/ScriptContainer-CW6YN3DQ.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-2WR2ATTJ.mjs +0 -66
- package/dist/lib/browser/app-graph-builder-2WR2ATTJ.mjs.map +0 -7
- package/dist/lib/browser/blueprint-definition-6PZWZM2Y.mjs +0 -30
- package/dist/lib/browser/blueprint-definition-6PZWZM2Y.mjs.map +0 -7
- package/dist/lib/browser/chunk-2G2NA6DQ.mjs +0 -88
- package/dist/lib/browser/chunk-2G2NA6DQ.mjs.map +0 -7
- package/dist/lib/browser/chunk-ALS6X4HU.mjs +0 -304
- package/dist/lib/browser/chunk-ALS6X4HU.mjs.map +0 -7
- package/dist/lib/browser/chunk-EB6AXFXO.mjs.map +0 -7
- package/dist/lib/browser/chunk-M6KJPUJK.mjs +0 -111
- package/dist/lib/browser/chunk-M6KJPUJK.mjs.map +0 -7
- package/dist/lib/browser/chunk-N5EYLQOT.mjs +0 -647
- package/dist/lib/browser/chunk-N5EYLQOT.mjs.map +0 -7
- package/dist/lib/browser/chunk-QIZ3BPRK.mjs +0 -103
- package/dist/lib/browser/chunk-QIZ3BPRK.mjs.map +0 -7
- package/dist/lib/browser/chunk-SAN5Y7FI.mjs +0 -155
- package/dist/lib/browser/chunk-SAN5Y7FI.mjs.map +0 -7
- package/dist/lib/browser/chunk-ULJFT73Q.mjs +0 -513
- package/dist/lib/browser/chunk-ULJFT73Q.mjs.map +0 -7
- package/dist/lib/browser/chunk-UOQ6NCH3.mjs +0 -15
- package/dist/lib/browser/chunk-UOQ6NCH3.mjs.map +0 -7
- package/dist/lib/browser/compiler-4KHRSX7J.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-TXTBWOVD.mjs +0 -104
- package/dist/lib/browser/intent-resolver-TXTBWOVD.mjs.map +0 -7
- package/dist/lib/browser/react-surface-R245YN52.mjs +0 -128
- package/dist/lib/browser/react-surface-R245YN52.mjs.map +0 -7
- package/dist/lib/browser/settings-MHJXRGDF.mjs +0 -26
- package/dist/lib/browser/settings-MHJXRGDF.mjs.map +0 -7
- package/dist/lib/node-esm/DeploymentDialog-2ULNOZQH.mjs +0 -15
- package/dist/lib/node-esm/NotebookContainer-U4C2HQ4T.mjs.map +0 -7
- package/dist/lib/node-esm/ScriptContainer-VRPEKB4T.mjs +0 -149
- package/dist/lib/node-esm/ScriptContainer-VRPEKB4T.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-NCVLUL5R.mjs +0 -67
- package/dist/lib/node-esm/app-graph-builder-NCVLUL5R.mjs.map +0 -7
- package/dist/lib/node-esm/blueprint-definition-5R6YCSZZ.mjs +0 -31
- package/dist/lib/node-esm/blueprint-definition-5R6YCSZZ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-55JZVM6K.mjs +0 -16
- package/dist/lib/node-esm/chunk-55JZVM6K.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-57JA6XL5.mjs +0 -90
- package/dist/lib/node-esm/chunk-57JA6XL5.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HDKR5WCD.mjs +0 -113
- package/dist/lib/node-esm/chunk-HDKR5WCD.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-IBV2DR36.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ND4BPYPR.mjs +0 -156
- package/dist/lib/node-esm/chunk-ND4BPYPR.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-UEVZP5DN.mjs +0 -648
- package/dist/lib/node-esm/chunk-UEVZP5DN.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-VJSRZRLI.mjs +0 -514
- package/dist/lib/node-esm/chunk-VJSRZRLI.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-VTRMJSQL.mjs +0 -305
- package/dist/lib/node-esm/chunk-VTRMJSQL.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-XYKKDWUR.mjs +0 -104
- package/dist/lib/node-esm/chunk-XYKKDWUR.mjs.map +0 -7
- package/dist/lib/node-esm/compiler-DU5NQISX.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-D6AVAQRA.mjs +0 -105
- package/dist/lib/node-esm/intent-resolver-D6AVAQRA.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-MHT3PJ6C.mjs +0 -129
- package/dist/lib/node-esm/react-surface-MHT3PJ6C.mjs.map +0 -7
- package/dist/lib/node-esm/settings-BVJORMMJ.mjs +0 -27
- package/dist/lib/node-esm/settings-BVJORMMJ.mjs.map +0 -7
- package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -4
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
- package/dist/types/src/capabilities/artifact-definition.d.ts +0 -11
- package/dist/types/src/capabilities/artifact-definition.d.ts.map +0 -1
- package/dist/types/src/capabilities/blueprint-definition.d.ts +0 -5
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +0 -1
- package/dist/types/src/capabilities/capabilities.d.ts +0 -5
- package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
- package/dist/types/src/capabilities/compiler.d.ts +0 -4
- package/dist/types/src/capabilities/compiler.d.ts.map +0 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface.d.ts +0 -4
- package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
- package/dist/types/src/capabilities/settings.d.ts +0 -4
- package/dist/types/src/capabilities/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.map +0 -1
- package/dist/types/src/components/DeploymentDialog/index.d.ts +0 -4
- package/dist/types/src/components/DeploymentDialog/index.d.ts.map +0 -1
- package/dist/types/src/components/FrameContainer/FrameContainer.d.ts.map +0 -1
- package/dist/types/src/components/FrameContainer/frame.d.ts +0 -2
- package/dist/types/src/components/FrameContainer/frame.d.ts.map +0 -1
- package/dist/types/src/components/FrameContainer/index.d.ts +0 -2
- package/dist/types/src/components/FrameContainer/index.d.ts.map +0 -1
- package/dist/types/src/components/NotebookContainer.d.ts +0 -10
- package/dist/types/src/components/NotebookContainer.d.ts.map +0 -1
- package/dist/types/src/components/NotebookContainer.stories.d.ts +0 -254
- package/dist/types/src/components/NotebookContainer.stories.d.ts.map +0 -1
- package/dist/types/src/components/ScriptContainer.d.ts +0 -12
- package/dist/types/src/components/ScriptContainer.d.ts.map +0 -1
- package/dist/types/src/components/Settings/ScriptObjectSettings.d.ts.map +0 -1
- package/dist/types/src/components/Settings/ScriptPluginSettings.d.ts +0 -6
- package/dist/types/src/components/Settings/ScriptPluginSettings.d.ts.map +0 -1
- package/dist/types/src/components/Settings/index.d.ts +0 -3
- package/dist/types/src/components/Settings/index.d.ts.map +0 -1
- package/dist/types/src/components/TestPanel/TestContainer.d.ts.map +0 -1
- package/dist/types/src/events.d.ts +0 -4
- package/dist/types/src/events.d.ts.map +0 -1
- package/dist/types/src/templates/chess.d.ts +0 -3
- package/dist/types/src/templates/chess.d.ts.map +0 -1
- package/dist/types/src/types/actions.d.ts +0 -54
- package/dist/types/src/types/actions.d.ts.map +0 -1
- package/src/capabilities/app-graph-builder.ts +0 -65
- package/src/capabilities/blueprint-definition.ts +0 -30
- package/src/capabilities/capabilities.ts +0 -12
- package/src/capabilities/compiler.ts +0 -34
- package/src/capabilities/intent-resolver.ts +0 -86
- package/src/capabilities/react-surface.tsx +0 -103
- package/src/capabilities/settings.ts +0 -21
- package/src/components/DeploymentDialog/DeploymentDialog.tsx +0 -123
- 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/ScriptContainer.tsx +0 -70
- package/src/components/Settings/index.ts +0 -6
- package/src/components/TestPanel/TestContainer.tsx +0 -27
- package/src/events.ts +0 -11
- package/src/templates/chess.ts +0 -49
- package/src/types/actions.ts +0 -53
- /package/dist/lib/browser/{DeploymentDialog-5TKNGPVR.mjs.map → blueprints/index.mjs.map} +0 -0
- /package/dist/lib/{node-esm/DeploymentDialog-2ULNOZQH.mjs.map → browser/operations/index.mjs.map} +0 -0
package/src/capabilities/{artifact-definition.ts → artifact-definition/artifact-definition.ts}
RENAMED
|
@@ -5,10 +5,11 @@
|
|
|
5
5
|
// ISSUE(burdon): defineArtifact
|
|
6
6
|
// @ts-nocheck
|
|
7
7
|
|
|
8
|
+
import * as Effect from 'effect/Effect';
|
|
8
9
|
import * as Schema from 'effect/Schema';
|
|
9
10
|
|
|
10
11
|
import { ToolResult, createTool } from '@dxos/ai';
|
|
11
|
-
import { Capabilities, type PromiseIntentDispatcher,
|
|
12
|
+
import { Capabilities, Capability, type PromiseIntentDispatcher, createIntent } from '@dxos/app-framework';
|
|
12
13
|
import { ArtifactId, createArtifactElement } from '@dxos/assistant';
|
|
13
14
|
import { defineArtifact } from '@dxos/blueprints';
|
|
14
15
|
import { Filter, Obj, Ref } from '@dxos/echo';
|
|
@@ -17,7 +18,7 @@ import { invariant } from '@dxos/invariant';
|
|
|
17
18
|
import { SpaceAction } from '@dxos/plugin-space/types';
|
|
18
19
|
import { type Space } from '@dxos/react-client/echo';
|
|
19
20
|
|
|
20
|
-
import { meta } from '
|
|
21
|
+
import { meta } from '../../meta';
|
|
21
22
|
|
|
22
23
|
// TODO(burdon): Factor out.
|
|
23
24
|
declare global {
|
|
@@ -27,14 +28,15 @@ declare global {
|
|
|
27
28
|
}
|
|
28
29
|
}
|
|
29
30
|
|
|
30
|
-
export default () =>
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
31
|
+
export default Capability.makeModule(() =>
|
|
32
|
+
Effect.sync(() => {
|
|
33
|
+
const definition = defineArtifact({
|
|
34
|
+
id: `artifact:${meta.id}`,
|
|
35
|
+
name: meta.name,
|
|
36
|
+
// TODO(dmaretskyi): Since writing scripts requires a lot of domain knowledge,
|
|
37
|
+
// we should offload the work of synthesizing the code to a separate model.
|
|
38
|
+
// The main reasoning model will give it a concrete task and the script model will synthesize the code, knowing all the docs.
|
|
39
|
+
instructions: `
|
|
38
40
|
If the user explicitly requests you to write a script, you can create one.
|
|
39
41
|
If the user requests you to change one of the existing script, you can update it.
|
|
40
42
|
You must not create a script unless the user explicitly requests it.
|
|
@@ -54,7 +56,7 @@ export default () => {
|
|
|
54
56
|
The description is used by AI to understand the script and its purpose.
|
|
55
57
|
The description must provide cases on when the script should be used.
|
|
56
58
|
|
|
57
|
-
Schema:
|
|
59
|
+
Schema:
|
|
58
60
|
The schema is defined using a schema-DSL library called Effect Schema.
|
|
59
61
|
The input schema describes the arguments that the script accepts.
|
|
60
62
|
The output schema describes the result that the script produces.
|
|
@@ -75,18 +77,18 @@ export default () => {
|
|
|
75
77
|
- Detailed output schema
|
|
76
78
|
|
|
77
79
|
<apis>
|
|
78
|
-
export function defineFunction(params: {
|
|
79
|
-
description: string,
|
|
80
|
-
inputSchema: Schema.Schema,
|
|
81
|
-
outputSchema: Schema.Schema,
|
|
82
|
-
handler: (params: { event: { data: TInput } }) => Promise<TOutput>
|
|
80
|
+
export function defineFunction(params: {
|
|
81
|
+
description: string,
|
|
82
|
+
inputSchema: Schema.Schema,
|
|
83
|
+
outputSchema: Schema.Schema,
|
|
84
|
+
handler: (params: { event: { data: TInput } }) => Promise<TOutput>
|
|
83
85
|
}): FunctionDefinition
|
|
84
86
|
/**
|
|
85
87
|
* Effect Schema
|
|
86
88
|
*/
|
|
87
|
-
export const Schema;
|
|
89
|
+
export const Schema;
|
|
88
90
|
|
|
89
|
-
// Examples:
|
|
91
|
+
// Examples:
|
|
90
92
|
|
|
91
93
|
Schema.String
|
|
92
94
|
Schema.Number
|
|
@@ -104,7 +106,7 @@ export default () => {
|
|
|
104
106
|
<handler_function>
|
|
105
107
|
Async function that takes the argument in the form of:
|
|
106
108
|
|
|
107
|
-
type
|
|
109
|
+
type HandlerFunctionProp = {
|
|
108
110
|
event: {
|
|
109
111
|
data: T // The input schema
|
|
110
112
|
},
|
|
@@ -112,7 +114,7 @@ export default () => {
|
|
|
112
114
|
|
|
113
115
|
The function must return the result that matches the output schema.
|
|
114
116
|
</handler_function>
|
|
115
|
-
|
|
117
|
+
|
|
116
118
|
<example>
|
|
117
119
|
import { defineFunction, S } from 'dxos:functions';
|
|
118
120
|
|
|
@@ -143,82 +145,83 @@ export default () => {
|
|
|
143
145
|
});
|
|
144
146
|
</example>
|
|
145
147
|
`,
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
148
|
+
schema: ScriptType,
|
|
149
|
+
tools: [
|
|
150
|
+
createTool(meta.id, {
|
|
151
|
+
name: 'create',
|
|
152
|
+
description: 'Create a new script. Returns the artifact definition for the script',
|
|
153
|
+
caption: 'Creating script...',
|
|
154
|
+
schema: Schema.Struct({
|
|
155
|
+
name: Schema.String.annotations({ description: 'The name of the script' }),
|
|
156
|
+
code: Schema.String.annotations({
|
|
157
|
+
description: 'The full code of the script in JavaScript or TypeScript. Must be valid executable code.',
|
|
158
|
+
}),
|
|
156
159
|
}),
|
|
160
|
+
execute: async ({ name, code }, { extensions }) => {
|
|
161
|
+
invariant(extensions?.space, 'No space');
|
|
162
|
+
invariant(extensions?.dispatch, 'No intent dispatcher');
|
|
163
|
+
const script = Obj.make(ScriptType, { name, source: Ref.make(Text.make(code)) });
|
|
164
|
+
extensions.space.db.add(script);
|
|
165
|
+
await extensions.space.db.flush();
|
|
166
|
+
|
|
167
|
+
const intent = createIntent(SpaceAction.AddObject, { target: extensions.space, object: script });
|
|
168
|
+
const { data, error } = await extensions.dispatch(intent);
|
|
169
|
+
if (!data || error) {
|
|
170
|
+
return ToolResult.Error(error?.message ?? 'Failed to create chess game');
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
return ToolResult.Success(createArtifactElement(script.id));
|
|
174
|
+
},
|
|
157
175
|
}),
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
description: 'Inspect a script. Returns the artifact definition for the script',
|
|
177
|
-
caption: 'Inspecting script...',
|
|
178
|
-
schema: Schema.Struct({
|
|
179
|
-
id: ArtifactId,
|
|
176
|
+
createTool(meta.id, {
|
|
177
|
+
name: 'inspect',
|
|
178
|
+
description: 'Inspect a script. Returns the artifact definition for the script',
|
|
179
|
+
caption: 'Inspecting script...',
|
|
180
|
+
schema: Schema.Struct({
|
|
181
|
+
id: ArtifactId,
|
|
182
|
+
}),
|
|
183
|
+
execute: async ({ id }, { extensions }) => {
|
|
184
|
+
invariant(extensions?.space, 'No space');
|
|
185
|
+
|
|
186
|
+
const script = (await extensions.space.db.query(Filter.id(id)).first()) as ScriptType;
|
|
187
|
+
const { content } = await script.source.load();
|
|
188
|
+
|
|
189
|
+
return ToolResult.Success({
|
|
190
|
+
name: script.name,
|
|
191
|
+
code: content,
|
|
192
|
+
});
|
|
193
|
+
},
|
|
180
194
|
}),
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
});
|
|
191
|
-
},
|
|
192
|
-
}),
|
|
193
|
-
createTool(meta.id, {
|
|
194
|
-
name: 'update',
|
|
195
|
-
description: 'Update a script. Returns the artifact definition for the script',
|
|
196
|
-
caption: 'Updating script...',
|
|
197
|
-
schema: Schema.Struct({
|
|
198
|
-
id: ArtifactId,
|
|
199
|
-
code: Schema.String.annotations({
|
|
200
|
-
description: 'The full code of the script in JavaScript or TypeScript. Must be valid executable code.',
|
|
195
|
+
createTool(meta.id, {
|
|
196
|
+
name: 'update',
|
|
197
|
+
description: 'Update a script. Returns the artifact definition for the script',
|
|
198
|
+
caption: 'Updating script...',
|
|
199
|
+
schema: Schema.Struct({
|
|
200
|
+
id: ArtifactId,
|
|
201
|
+
code: Schema.String.annotations({
|
|
202
|
+
description: 'The full code of the script in JavaScript or TypeScript. Must be valid executable code.',
|
|
203
|
+
}),
|
|
201
204
|
}),
|
|
205
|
+
execute: async ({ id, code }, { extensions }) => {
|
|
206
|
+
invariant(extensions?.space, 'No space');
|
|
207
|
+
|
|
208
|
+
const script = (await extensions.space.db.query(Filter.id(id)).first()) as ScriptType;
|
|
209
|
+
const source = await script.source.load();
|
|
210
|
+
if (!source) {
|
|
211
|
+
return ToolResult.Error('Script not found');
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
source.content = code;
|
|
215
|
+
await extensions.space?.db.flush();
|
|
216
|
+
|
|
217
|
+
return ToolResult.Success({
|
|
218
|
+
name: script.name,
|
|
219
|
+
});
|
|
220
|
+
},
|
|
202
221
|
}),
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
return ToolResult.Error('Script not found');
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
source.content = code;
|
|
213
|
-
await extensions.space?.db.flush();
|
|
214
|
-
|
|
215
|
-
return ToolResult.Success({
|
|
216
|
-
name: script.name,
|
|
217
|
-
});
|
|
218
|
-
},
|
|
219
|
-
}),
|
|
220
|
-
],
|
|
221
|
-
});
|
|
222
|
-
|
|
223
|
-
return contributes(Capabilities.ArtifactDefinition, definition);
|
|
224
|
-
};
|
|
222
|
+
],
|
|
223
|
+
});
|
|
224
|
+
|
|
225
|
+
return Capability.contributes(Capabilities.ArtifactDefinition, definition);
|
|
226
|
+
}),
|
|
227
|
+
);
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
|
|
10
|
+
import { ScriptBlueprint } from '../../blueprints';
|
|
11
|
+
|
|
12
|
+
const blueprintDefinition = Capability.makeModule<
|
|
13
|
+
[],
|
|
14
|
+
Capability.Capability<typeof AppCapabilities.BlueprintDefinition>[]
|
|
15
|
+
>(() => Effect.succeed([Capability.contributes(AppCapabilities.BlueprintDefinition, ScriptBlueprint)]));
|
|
16
|
+
|
|
17
|
+
export default blueprintDefinition;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as FetchHttpClient from '@effect/platform/FetchHttpClient';
|
|
6
|
+
import * as HttpClient from '@effect/platform/HttpClient';
|
|
7
|
+
import * as Effect from 'effect/Effect';
|
|
8
|
+
import * as Schedule from 'effect/Schedule';
|
|
9
|
+
import * as Schema from 'effect/Schema';
|
|
10
|
+
import wasmUrl from 'esbuild-wasm/esbuild.wasm?url';
|
|
11
|
+
import * as ts from 'typescript';
|
|
12
|
+
|
|
13
|
+
import { Capability } from '@dxos/app-framework';
|
|
14
|
+
import { initializeBundler } from '@dxos/functions-runtime/bundler';
|
|
15
|
+
import { log } from '@dxos/log';
|
|
16
|
+
import { trim } from '@dxos/util';
|
|
17
|
+
|
|
18
|
+
import { Compiler } from '../../compiler';
|
|
19
|
+
import { ScriptCapabilities } from '../../types';
|
|
20
|
+
|
|
21
|
+
// TODO(burdon): Document.
|
|
22
|
+
const SCRIPT_PACKAGES_BUCKET = 'https://pub-5745ae82e450484aa28f75fc6a175935.r2.dev/dev/';
|
|
23
|
+
const DECLARATION_EXTS = ['.d.ts', '.d.mts'];
|
|
24
|
+
const NO_TYPES = true; // Types temopararly disabled due to compiler erorrs.
|
|
25
|
+
|
|
26
|
+
export default Capability.makeModule(() =>
|
|
27
|
+
Effect.gen(function* () {
|
|
28
|
+
yield* Effect.tryPromise(() => initializeBundler({ wasmUrl }));
|
|
29
|
+
|
|
30
|
+
const runtimeModules = yield* fetchRuntimeModules().pipe(Effect.provide(FetchHttpClient.layer));
|
|
31
|
+
|
|
32
|
+
const compiler = new Compiler({
|
|
33
|
+
skipLibCheck: true,
|
|
34
|
+
moduleResolution: ts.ModuleResolutionKind.Bundler,
|
|
35
|
+
allowImportingTsExtensions: true,
|
|
36
|
+
noEmit: true,
|
|
37
|
+
strict: true,
|
|
38
|
+
esModuleInterop: true,
|
|
39
|
+
paths: Object.fromEntries(runtimeModules.map((mod: any) => [mod.moduleName, [`./src/${mod.filename}`]])),
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
yield* Effect.tryPromise(() =>
|
|
43
|
+
compiler.initialize(trim`
|
|
44
|
+
declare module 'https://*';
|
|
45
|
+
${NO_TYPES ? '' : 'declare module "*";'}
|
|
46
|
+
`),
|
|
47
|
+
);
|
|
48
|
+
if (!NO_TYPES) {
|
|
49
|
+
for (const mod of runtimeModules) {
|
|
50
|
+
compiler.setFile(`/src/${mod.filename}`, mod.content);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return Capability.contributes(ScriptCapabilities.Compiler, compiler);
|
|
55
|
+
}),
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
const fetchRuntimeModules = Effect.fnUntraced(function* () {
|
|
59
|
+
// { key, size, contentType }
|
|
60
|
+
const manifest = yield* HttpClient.get(new URL('manifest.json', SCRIPT_PACKAGES_BUCKET)).pipe(
|
|
61
|
+
Effect.flatMap((_) => _.json),
|
|
62
|
+
Effect.flatMap(
|
|
63
|
+
Schema.decodeUnknown(
|
|
64
|
+
Schema.Struct({
|
|
65
|
+
files: Schema.Array(
|
|
66
|
+
Schema.Struct({
|
|
67
|
+
key: Schema.String,
|
|
68
|
+
}),
|
|
69
|
+
),
|
|
70
|
+
}),
|
|
71
|
+
),
|
|
72
|
+
),
|
|
73
|
+
Effect.map((manifest) => ({ ...manifest, files: manifest.files.map((f) => f.key) })),
|
|
74
|
+
);
|
|
75
|
+
|
|
76
|
+
const declarationFiles = manifest.files.filter((file) => DECLARATION_EXTS.some((ext) => file.endsWith(ext)));
|
|
77
|
+
|
|
78
|
+
let fetched = 0;
|
|
79
|
+
const modules = yield* Effect.forEach(
|
|
80
|
+
declarationFiles,
|
|
81
|
+
Effect.fnUntraced(
|
|
82
|
+
function* (filename) {
|
|
83
|
+
const response = yield* HttpClient.get(new URL(filename, SCRIPT_PACKAGES_BUCKET)).pipe(
|
|
84
|
+
Effect.retry(Schedule.exponential(1_000).pipe(Schedule.compose(Schedule.recurs(3)))),
|
|
85
|
+
);
|
|
86
|
+
const content = yield* response.text;
|
|
87
|
+
const moduleName = filename.replace(/\.d\.(ts|mts)$/, '');
|
|
88
|
+
fetched++;
|
|
89
|
+
|
|
90
|
+
return {
|
|
91
|
+
moduleName,
|
|
92
|
+
filename,
|
|
93
|
+
content,
|
|
94
|
+
};
|
|
95
|
+
},
|
|
96
|
+
Effect.retry(Schedule.exponential(1_000).pipe(Schedule.compose(Schedule.recurs(3)))),
|
|
97
|
+
),
|
|
98
|
+
{ concurrency: 20 },
|
|
99
|
+
);
|
|
100
|
+
|
|
101
|
+
log.info('runtime modules', { manifest: manifest.files.length, files: declarationFiles.length, fetched });
|
|
102
|
+
return modules;
|
|
103
|
+
});
|
|
@@ -2,13 +2,9 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
export const ReactSurface = lazy(() => import('./react-surface'));
|
|
12
|
-
export const ScriptSettings = lazy(() => import('./settings'));
|
|
13
|
-
|
|
14
|
-
export * from './capabilities';
|
|
5
|
+
export * from './app-graph-builder';
|
|
6
|
+
export * from './blueprint-definition';
|
|
7
|
+
export * from './compiler';
|
|
8
|
+
export * from './operation-handler';
|
|
9
|
+
export * from './react-surface';
|
|
10
|
+
export * from './settings';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Capability } from '@dxos/app-framework';
|
|
6
|
+
import { OperationHandlerSet } from '@dxos/operation';
|
|
7
|
+
|
|
8
|
+
export const OperationHandler = Capability.lazy<OperationHandlerSet.OperationHandlerSet>(
|
|
9
|
+
'OperationHandler',
|
|
10
|
+
() => import('./operation-handler'),
|
|
11
|
+
);
|
|
@@ -0,0 +1,16 @@
|
|
|
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 type { OperationHandlerSet } from '@dxos/operation';
|
|
9
|
+
|
|
10
|
+
import { ScriptOperationHandlerSet } from '../../operations';
|
|
11
|
+
|
|
12
|
+
export default Capability.makeModule<OperationHandlerSet.OperationHandlerSet>(
|
|
13
|
+
Effect.fnUntraced(function* () {
|
|
14
|
+
return Capability.contributes(Capabilities.OperationHandler, ScriptOperationHandlerSet);
|
|
15
|
+
}),
|
|
16
|
+
);
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
import React from 'react';
|
|
7
|
+
|
|
8
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
9
|
+
import { Surface, useAtomCapability, useSettingsState } from '@dxos/app-framework/ui';
|
|
10
|
+
import { AppCapabilities } from '@dxos/app-toolkit';
|
|
11
|
+
import { InvocationTraceContainer } from '@dxos/devtools';
|
|
12
|
+
import { Obj } from '@dxos/echo';
|
|
13
|
+
import { Script } from '@dxos/functions';
|
|
14
|
+
import { getSpace } from '@dxos/react-client/echo';
|
|
15
|
+
import { Panel } from '@dxos/react-ui';
|
|
16
|
+
import { type AccessToken } from '@dxos/types';
|
|
17
|
+
|
|
18
|
+
import { DEPLOYMENT_DIALOG } from '../../constants';
|
|
19
|
+
import {
|
|
20
|
+
DeploymentDialog,
|
|
21
|
+
NotebookContainer,
|
|
22
|
+
ScriptContainer,
|
|
23
|
+
ScriptObjectSettings,
|
|
24
|
+
ScriptPluginSettings,
|
|
25
|
+
ScriptProperties,
|
|
26
|
+
TestContainer,
|
|
27
|
+
} from '../../containers';
|
|
28
|
+
import { useCompiler } from '../../hooks';
|
|
29
|
+
import { meta } from '../../meta';
|
|
30
|
+
import { Notebook, ScriptCapabilities, type ScriptSettings } from '../../types';
|
|
31
|
+
|
|
32
|
+
export default Capability.makeModule(() =>
|
|
33
|
+
Effect.succeed(
|
|
34
|
+
Capability.contributes(Capabilities.ReactSurface, [
|
|
35
|
+
Surface.create({
|
|
36
|
+
id: `${meta.id}.plugin-settings`,
|
|
37
|
+
role: 'article',
|
|
38
|
+
filter: (data): data is { subject: AppCapabilities.Settings } =>
|
|
39
|
+
AppCapabilities.isSettings(data.subject) && data.subject.prefix === meta.id,
|
|
40
|
+
component: ({ data: { subject } }) => {
|
|
41
|
+
const { settings, updateSettings } = useSettingsState<ScriptSettings>(subject.atom);
|
|
42
|
+
return <ScriptPluginSettings settings={settings} onSettingsChange={updateSettings} />;
|
|
43
|
+
},
|
|
44
|
+
}),
|
|
45
|
+
Surface.create({
|
|
46
|
+
id: `${meta.id}.script.article`,
|
|
47
|
+
role: ['article', 'section'],
|
|
48
|
+
filter: (data): data is { subject: Script.Script; attendableId: string } =>
|
|
49
|
+
Obj.instanceOf(Script.Script, data.subject),
|
|
50
|
+
component: ({ data, role }) => {
|
|
51
|
+
const compiler = useCompiler();
|
|
52
|
+
const settings = useAtomCapability(ScriptCapabilities.Settings);
|
|
53
|
+
// TODO(wittjosiah): Why? The editor should be allow to render even if the environment is not ready.
|
|
54
|
+
if (!compiler?.environment) {
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return (
|
|
59
|
+
<ScriptContainer
|
|
60
|
+
role={role}
|
|
61
|
+
subject={data.subject}
|
|
62
|
+
attendableId={data.attendableId}
|
|
63
|
+
settings={settings}
|
|
64
|
+
env={compiler?.environment}
|
|
65
|
+
/>
|
|
66
|
+
);
|
|
67
|
+
},
|
|
68
|
+
}),
|
|
69
|
+
Surface.create({
|
|
70
|
+
id: `${meta.id}.notebook.article`,
|
|
71
|
+
role: 'article',
|
|
72
|
+
filter: (data): data is { subject: Notebook.Notebook; attendableId: string } =>
|
|
73
|
+
typeof data.attendableId === 'string' && Obj.instanceOf(Notebook.Notebook, data.subject),
|
|
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
|
+
// TODO(burdon): Standardize PluginSettings vs ObjectSettings.
|
|
87
|
+
// TODO(burdon): Why is ScriptProperties different from ScriptObjectSettings?
|
|
88
|
+
Surface.create({
|
|
89
|
+
id: `${meta.id}.companion.base-settings`,
|
|
90
|
+
role: 'base-object-settings',
|
|
91
|
+
filter: (data): data is { subject: Script.Script } => Obj.instanceOf(Script.Script, data.subject),
|
|
92
|
+
component: ({ data }) => <ScriptProperties object={data.subject} />,
|
|
93
|
+
}),
|
|
94
|
+
Surface.create({
|
|
95
|
+
id: `${meta.id}.companion.settings`,
|
|
96
|
+
role: 'object-settings',
|
|
97
|
+
filter: (data): data is { subject: Script.Script } => Obj.instanceOf(Script.Script, data.subject),
|
|
98
|
+
component: ({ data }) => <ScriptObjectSettings object={data.subject} />,
|
|
99
|
+
}),
|
|
100
|
+
Surface.create({
|
|
101
|
+
id: `${meta.id}.companion.execute`,
|
|
102
|
+
role: 'article',
|
|
103
|
+
filter: (data): data is { companionTo: Script.Script } =>
|
|
104
|
+
Obj.instanceOf(Script.Script, data.companionTo) && data.subject === 'execute',
|
|
105
|
+
component: ({ data, role }) => <TestContainer script={data.companionTo} role={role} />,
|
|
106
|
+
}),
|
|
107
|
+
Surface.create({
|
|
108
|
+
id: `${meta.id}.companion.logs`,
|
|
109
|
+
role: 'article',
|
|
110
|
+
filter: (data): data is { companionTo: Script.Script } =>
|
|
111
|
+
Obj.instanceOf(Script.Script, data.companionTo) && data.subject === 'logs',
|
|
112
|
+
component: ({ data, role }) => {
|
|
113
|
+
const space = getSpace(data.companionTo);
|
|
114
|
+
const queueDxn = space?.properties.invocationTraceQueue?.dxn;
|
|
115
|
+
return (
|
|
116
|
+
<Panel.Root role={role}>
|
|
117
|
+
<Panel.Content asChild>
|
|
118
|
+
<InvocationTraceContainer
|
|
119
|
+
db={space?.db}
|
|
120
|
+
queueDxn={queueDxn}
|
|
121
|
+
target={data.companionTo}
|
|
122
|
+
detailAxis='block'
|
|
123
|
+
/>
|
|
124
|
+
</Panel.Content>
|
|
125
|
+
</Panel.Root>
|
|
126
|
+
);
|
|
127
|
+
},
|
|
128
|
+
}),
|
|
129
|
+
Surface.create({
|
|
130
|
+
id: DEPLOYMENT_DIALOG,
|
|
131
|
+
role: 'dialog',
|
|
132
|
+
filter: (data): data is { props: { accessToken: AccessToken.AccessToken; scriptTemplates: any } } =>
|
|
133
|
+
data.component === DEPLOYMENT_DIALOG,
|
|
134
|
+
component: ({ data }) => <DeploymentDialog {...data.props} />,
|
|
135
|
+
}),
|
|
136
|
+
]),
|
|
137
|
+
),
|
|
138
|
+
);
|
|
@@ -0,0 +1,33 @@
|
|
|
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
|
+
import { createKvsStore } from '@dxos/effect';
|
|
10
|
+
|
|
11
|
+
import { meta } from '../../meta';
|
|
12
|
+
import { ScriptCapabilities, ScriptSettings } from '../../types';
|
|
13
|
+
|
|
14
|
+
export default Capability.makeModule(() =>
|
|
15
|
+
Effect.sync(() => {
|
|
16
|
+
const settingsAtom = createKvsStore({
|
|
17
|
+
key: meta.id,
|
|
18
|
+
schema: ScriptSettings,
|
|
19
|
+
defaultValue: () => ({
|
|
20
|
+
editorInputMode: 'vscode' as const,
|
|
21
|
+
}),
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
return [
|
|
25
|
+
Capability.contributes(ScriptCapabilities.Settings, settingsAtom),
|
|
26
|
+
Capability.contributes(AppCapabilities.Settings, {
|
|
27
|
+
prefix: meta.id,
|
|
28
|
+
schema: ScriptSettings,
|
|
29
|
+
atom: settingsAtom,
|
|
30
|
+
}),
|
|
31
|
+
];
|
|
32
|
+
}),
|
|
33
|
+
);
|