@dxos/plugin-script 0.8.4-main.c85a9c8dae → 0.8.4-main.d9fc60f731
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +102 -5
- package/PLUGIN.mdl +515 -0
- package/dist/lib/{browser/DeploymentDialog-IIOXAS47.mjs → neutral/DeploymentDialog-M3AFYQHC.mjs} +24 -48
- package/dist/lib/neutral/DeploymentDialog-M3AFYQHC.mjs.map +7 -0
- package/dist/lib/{browser/NotebookContainer-VVZOKGRC.mjs → neutral/NotebookArticle-NV4AHOOS.mjs} +58 -145
- package/dist/lib/neutral/NotebookArticle-NV4AHOOS.mjs.map +7 -0
- package/dist/lib/{browser/ScriptContainer-A5SSIUH6.mjs → neutral/ScriptArticle-UBT27SB6.mjs} +14 -28
- package/dist/lib/neutral/ScriptArticle-UBT27SB6.mjs.map +7 -0
- package/dist/lib/neutral/ScriptPlugin.mjs +51 -0
- package/dist/lib/neutral/ScriptPlugin.mjs.map +7 -0
- package/dist/lib/neutral/ScriptPlugin.node.mjs +27 -0
- package/dist/lib/neutral/ScriptPlugin.node.mjs.map +7 -0
- package/dist/lib/neutral/ScriptPlugin.workerd.mjs +21 -0
- package/dist/lib/neutral/ScriptPlugin.workerd.mjs.map +7 -0
- package/dist/lib/neutral/ScriptPluginSettings-T4JMUSHN.mjs +31 -0
- package/dist/lib/neutral/ScriptPluginSettings-T4JMUSHN.mjs.map +7 -0
- package/dist/lib/neutral/ScriptProperties-RLXNAN3N.mjs +297 -0
- package/dist/lib/neutral/ScriptProperties-RLXNAN3N.mjs.map +7 -0
- package/dist/lib/neutral/TestContainer-AFVTBYSJ.mjs +44 -0
- package/dist/lib/neutral/TestContainer-AFVTBYSJ.mjs.map +7 -0
- package/dist/lib/neutral/app-graph-builder-7AWFCEQF.mjs +52 -0
- package/dist/lib/neutral/app-graph-builder-7AWFCEQF.mjs.map +7 -0
- package/dist/lib/{browser/blueprint-definition-YMZEJBAZ.mjs → neutral/blueprint-definition-T33SBPP2.mjs} +4 -6
- package/dist/lib/neutral/blueprint-definition-T33SBPP2.mjs.map +7 -0
- package/dist/lib/{browser → neutral}/blueprints/index.mjs +3 -1
- package/dist/lib/neutral/capabilities/index.mjs +21 -0
- package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
- package/dist/lib/neutral/capabilities/node.mjs +17 -0
- package/dist/lib/neutral/capabilities/node.mjs.map +7 -0
- package/dist/lib/{node-esm/chunk-JGN7TDJH.mjs → neutral/chunk-2REUEDUA.mjs} +10 -23
- package/dist/lib/neutral/chunk-2REUEDUA.mjs.map +7 -0
- package/dist/lib/neutral/chunk-BDHDBPVM.mjs +52 -0
- package/dist/lib/neutral/chunk-BDHDBPVM.mjs.map +7 -0
- package/dist/lib/neutral/chunk-C4O7EV6M.mjs +123 -0
- package/dist/lib/neutral/chunk-C4O7EV6M.mjs.map +7 -0
- package/dist/lib/neutral/chunk-H2BRWQMY.mjs +96 -0
- package/dist/lib/neutral/chunk-H2BRWQMY.mjs.map +7 -0
- package/dist/lib/neutral/chunk-LHEJXJEL.mjs +8 -0
- package/dist/lib/neutral/chunk-LHEJXJEL.mjs.map +7 -0
- package/dist/lib/neutral/chunk-NQOIENTU.mjs +8 -0
- package/dist/lib/neutral/chunk-NQOIENTU.mjs.map +7 -0
- package/dist/lib/neutral/chunk-TRKXIP2Q.mjs +345 -0
- package/dist/lib/neutral/chunk-TRKXIP2Q.mjs.map +7 -0
- package/dist/lib/neutral/chunk-UA3BWOCZ.mjs +38 -0
- package/dist/lib/neutral/chunk-UA3BWOCZ.mjs.map +7 -0
- package/dist/lib/{browser/chunk-G3XIOLLI.mjs → neutral/chunk-VXDJH6OL.mjs} +24 -48
- package/dist/lib/neutral/chunk-VXDJH6OL.mjs.map +7 -0
- package/dist/lib/{browser/compiler-53G6ZHQM.mjs → neutral/compiler-ODK4UA2N.mjs} +24 -22
- package/dist/lib/neutral/compiler-ODK4UA2N.mjs.map +7 -0
- package/dist/lib/neutral/components/index.mjs +664 -0
- package/dist/lib/neutral/components/index.mjs.map +7 -0
- package/dist/lib/neutral/containers/index.mjs +17 -0
- package/dist/lib/neutral/containers/index.mjs.map +7 -0
- package/dist/lib/neutral/create-WQJXMOUE.mjs +46 -0
- package/dist/lib/neutral/create-WQJXMOUE.mjs.map +7 -0
- package/dist/lib/neutral/create-object-FZM5ASWM.mjs +45 -0
- package/dist/lib/neutral/create-object-FZM5ASWM.mjs.map +7 -0
- package/dist/lib/neutral/create-script-66DO3UJO.mjs +45 -0
- package/dist/lib/neutral/create-script-66DO3UJO.mjs.map +7 -0
- package/dist/lib/neutral/delete-HCQIQFVP.mjs +21 -0
- package/dist/lib/neutral/delete-HCQIQFVP.mjs.map +7 -0
- package/dist/lib/neutral/deploy-7JVMMHSH.mjs +63 -0
- package/dist/lib/neutral/deploy-7JVMMHSH.mjs.map +7 -0
- package/dist/lib/{browser/chunk-MUEVLYXJ.mjs → neutral/hooks/index.mjs} +52 -80
- package/dist/lib/neutral/hooks/index.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +41 -0
- package/dist/lib/neutral/inspect-invocations-6MW73SDV.mjs +59 -0
- package/dist/lib/neutral/inspect-invocations-6MW73SDV.mjs.map +7 -0
- package/dist/lib/neutral/install-function-FJIE2JAI.mjs +49 -0
- package/dist/lib/neutral/install-function-FJIE2JAI.mjs.map +7 -0
- package/dist/lib/neutral/invoke-3HVWY2KF.mjs +32 -0
- package/dist/lib/neutral/invoke-3HVWY2KF.mjs.map +7 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/neutral/meta.mjs +10 -0
- package/dist/lib/neutral/operation-handler-X44IGZXS.mjs +18 -0
- package/dist/lib/neutral/operation-handler-X44IGZXS.mjs.map +7 -0
- package/dist/lib/neutral/operations/index.mjs +8 -0
- package/dist/lib/neutral/plugin.mjs +16 -0
- package/dist/lib/neutral/plugin.mjs.map +7 -0
- package/dist/lib/neutral/query-deployed-functions-F4FHJNWO.mjs +34 -0
- package/dist/lib/neutral/query-deployed-functions-F4FHJNWO.mjs.map +7 -0
- package/dist/lib/neutral/react-surface-ACNZ35FV.mjs +121 -0
- package/dist/lib/neutral/react-surface-ACNZ35FV.mjs.map +7 -0
- package/dist/lib/neutral/read-RQESBAQI.mjs +26 -0
- package/dist/lib/neutral/read-RQESBAQI.mjs.map +7 -0
- package/dist/lib/{browser/settings-76UM7442.mjs → neutral/settings-VJBW4OMK.mjs} +6 -12
- package/dist/lib/neutral/settings-VJBW4OMK.mjs.map +7 -0
- package/dist/lib/{browser → neutral}/templates/index.mjs +1 -1
- package/dist/lib/neutral/translations.mjs +105 -0
- package/dist/lib/neutral/translations.mjs.map +7 -0
- package/dist/lib/neutral/types/index.mjs +17 -0
- package/dist/lib/neutral/update-JZUNJYZM.mjs +63 -0
- package/dist/lib/neutral/update-JZUNJYZM.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/ScriptPlugin.workerd.d.ts +4 -0
- package/dist/types/src/ScriptPlugin.workerd.d.ts.map +1 -0
- package/dist/types/src/blueprints/functions/create.d.ts +11 -0
- package/dist/types/src/blueprints/functions/create.d.ts.map +1 -0
- package/dist/types/src/blueprints/functions/definitions.d.ts +135 -0
- package/dist/types/src/blueprints/functions/definitions.d.ts.map +1 -0
- package/dist/types/src/blueprints/functions/delete.d.ts +17 -0
- package/dist/types/src/blueprints/functions/delete.d.ts.map +1 -0
- package/dist/types/src/blueprints/functions/deploy.d.ts +21 -0
- package/dist/types/src/blueprints/functions/deploy.d.ts.map +1 -0
- package/dist/types/src/blueprints/functions/index.d.ts +4 -0
- package/dist/types/src/blueprints/functions/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/functions/inspect-invocations.d.ts +28 -0
- package/dist/types/src/blueprints/functions/inspect-invocations.d.ts.map +1 -0
- package/dist/types/src/blueprints/functions/install-function.d.ts +11 -0
- package/dist/types/src/blueprints/functions/install-function.d.ts.map +1 -0
- package/dist/types/src/blueprints/functions/invoke.d.ts +21 -0
- package/dist/types/src/blueprints/functions/invoke.d.ts.map +1 -0
- package/dist/types/src/blueprints/functions/query-deployed-functions.d.ts +13 -0
- package/dist/types/src/blueprints/functions/query-deployed-functions.d.ts.map +1 -0
- package/dist/types/src/blueprints/functions/read.d.ts +21 -0
- package/dist/types/src/blueprints/functions/read.d.ts.map +1 -0
- package/dist/types/src/blueprints/functions/update.d.ts +26 -0
- package/dist/types/src/blueprints/functions/update.d.ts.map +1 -0
- package/dist/types/src/blueprints/script-blueprint.d.ts +2 -2
- package/dist/types/src/blueprints/script-blueprint.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.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/create-object.d.ts +16 -0
- package/dist/types/src/capabilities/create-object.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +19 -6
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/node.d.ts +18 -0
- package/dist/types/src/capabilities/node.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/{settings/settings.d.ts → settings.d.ts} +2 -5
- 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/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 -6
- 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/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 +2 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/constants.d.ts +2 -1
- package/dist/types/src/constants.d.ts.map +1 -1
- package/dist/types/src/containers/DeploymentDialog/DeploymentDialog.d.ts.map +1 -1
- package/dist/types/src/containers/DeploymentDialog/DeploymentDialog.stories.d.ts +219 -228
- package/dist/types/src/containers/DeploymentDialog/DeploymentDialog.stories.d.ts.map +1 -1
- package/dist/types/src/containers/DeploymentDialog/index.d.ts +1 -2
- package/dist/types/src/containers/DeploymentDialog/index.d.ts.map +1 -1
- package/dist/types/src/containers/NotebookArticle/NotebookArticle.d.ts +7 -0
- package/dist/types/src/containers/NotebookArticle/NotebookArticle.d.ts.map +1 -0
- package/dist/types/src/containers/NotebookArticle/NotebookArticle.stories.d.ts +7 -0
- package/dist/types/src/containers/NotebookArticle/NotebookArticle.stories.d.ts.map +1 -0
- package/dist/types/src/containers/NotebookArticle/index.d.ts +2 -0
- package/dist/types/src/containers/NotebookArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/ScriptArticle/ScriptArticle.d.ts +10 -0
- package/dist/types/src/containers/ScriptArticle/ScriptArticle.d.ts.map +1 -0
- package/dist/types/src/containers/ScriptArticle/ScriptArticle.stories.d.ts +242 -0
- package/dist/types/src/containers/ScriptArticle/ScriptArticle.stories.d.ts.map +1 -0
- package/dist/types/src/containers/ScriptArticle/index.d.ts +2 -0
- package/dist/types/src/containers/ScriptArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/ScriptProperties/BlueprintEditor.d.ts +7 -0
- package/dist/types/src/containers/ScriptProperties/BlueprintEditor.d.ts.map +1 -0
- package/dist/types/src/containers/ScriptProperties/FunctionBinding.d.ts +7 -0
- package/dist/types/src/containers/ScriptProperties/FunctionBinding.d.ts.map +1 -0
- package/dist/types/src/containers/ScriptProperties/FunctionPublishing.d.ts +7 -0
- package/dist/types/src/containers/ScriptProperties/FunctionPublishing.d.ts.map +1 -0
- package/dist/types/src/containers/ScriptProperties/ScriptProperties.d.ts +4 -5
- package/dist/types/src/containers/ScriptProperties/ScriptProperties.d.ts.map +1 -1
- 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 +1 -2
- package/dist/types/src/containers/ScriptProperties/index.d.ts.map +1 -1
- package/dist/types/src/containers/TestContainer/TestContainer.d.ts +1 -1
- package/dist/types/src/containers/TestContainer/TestContainer.d.ts.map +1 -1
- package/dist/types/src/containers/TestContainer/index.d.ts +1 -2
- package/dist/types/src/containers/TestContainer/index.d.ts.map +1 -1
- package/dist/types/src/containers/index.d.ts +2 -4
- package/dist/types/src/containers/index.d.ts.map +1 -1
- package/dist/types/src/hooks/deploy.d.ts +16 -5
- package/dist/types/src/hooks/deploy.d.ts.map +1 -1
- package/dist/types/src/hooks/format.d.ts +1 -1
- package/dist/types/src/hooks/format.d.ts.map +1 -1
- package/dist/types/src/hooks/template.d.ts +1 -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 -4
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +1 -1
- package/dist/types/src/meta.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/create-script.d.ts +5 -0
- package/dist/types/src/operations/create-script.d.ts.map +1 -0
- package/dist/types/src/operations/index.d.ts +3 -0
- package/dist/types/src/operations/index.d.ts.map +1 -0
- package/dist/types/src/plugin.d.ts +4 -0
- package/dist/types/src/plugin.d.ts.map +1 -0
- package/dist/types/src/templates/anthropic.d.ts +4 -5
- package/dist/types/src/templates/anthropic.d.ts.map +1 -1
- package/dist/types/src/templates/chess-bot.d.ts +8 -10
- package/dist/types/src/templates/chess-bot.d.ts.map +1 -1
- package/dist/types/src/templates/commentary.d.ts +9 -10
- 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 +26 -31
- 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 +53 -60
- package/dist/types/src/types/Notebook.d.ts.map +1 -1
- package/dist/types/src/types/ScriptCapabilities.d.ts +6 -0
- package/dist/types/src/types/ScriptCapabilities.d.ts.map +1 -0
- package/dist/types/src/types/ScriptEvents.d.ts +3 -0
- package/dist/types/src/types/ScriptEvents.d.ts.map +1 -0
- package/dist/types/src/types/ScriptOperation.d.ts +29 -0
- package/dist/types/src/types/ScriptOperation.d.ts.map +1 -0
- package/dist/types/src/types/Settings.d.ts +7 -0
- package/dist/types/src/types/Settings.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +4 -4
- 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 +167 -118
- package/src/ScriptPlugin.node.ts +21 -0
- package/src/ScriptPlugin.test.ts +31 -0
- package/src/ScriptPlugin.tsx +17 -43
- package/src/ScriptPlugin.workerd.ts +18 -0
- package/src/blueprints/functions/create.ts +47 -0
- package/src/blueprints/functions/definitions.ts +332 -0
- package/src/blueprints/functions/delete.ts +23 -0
- package/src/blueprints/functions/deploy.ts +71 -0
- package/src/blueprints/functions/index.ts +19 -0
- package/src/blueprints/functions/inspect-invocations.ts +56 -0
- package/src/blueprints/functions/install-function.ts +56 -0
- package/src/blueprints/functions/invoke.ts +34 -0
- package/src/blueprints/functions/query-deployed-functions.ts +35 -0
- package/src/blueprints/functions/read.ts +29 -0
- package/src/blueprints/functions/update.ts +68 -0
- package/src/blueprints/script-blueprint.ts +32 -8
- package/src/capabilities/app-graph-builder.ts +47 -0
- package/src/capabilities/{blueprint-definition/blueprint-definition.ts → blueprint-definition.ts} +3 -1
- package/src/capabilities/{compiler/compiler.ts → compiler.ts} +17 -9
- package/src/capabilities/create-object.ts +49 -0
- package/src/capabilities/index.ts +14 -6
- package/src/capabilities/node.ts +16 -0
- package/src/capabilities/operation-handler.ts +21 -0
- package/src/capabilities/react-surface.tsx +130 -0
- package/src/capabilities/{settings/settings.ts → settings.ts} +4 -4
- package/src/compiler/compiler.ts +12 -1
- package/src/components/NotebookStack/NotebookCell.tsx +25 -14
- package/src/components/NotebookStack/NotebookMenu.tsx +7 -7
- package/src/components/NotebookStack/NotebookStack.stories.tsx +8 -9
- package/src/components/NotebookStack/NotebookStack.tsx +24 -13
- package/src/components/QueryEditor/QueryEditor.stories.tsx +5 -11
- package/src/components/QueryEditor/QueryEditor.tsx +3 -1
- 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 +7 -7
- package/src/components/ScriptToolbar/ScriptToolbar.tsx +24 -26
- package/src/components/TestPanel/TestPanel.tsx +91 -176
- package/src/components/TypescriptEditor/TypescriptEditor.stories.tsx +4 -4
- package/src/components/TypescriptEditor/TypescriptEditor.tsx +25 -18
- package/src/components/index.ts +4 -1
- package/src/constants.ts +4 -2
- package/src/containers/DeploymentDialog/DeploymentDialog.stories.tsx +7 -5
- package/src/containers/DeploymentDialog/DeploymentDialog.tsx +26 -26
- package/src/containers/DeploymentDialog/index.ts +1 -3
- package/src/containers/NotebookArticle/NotebookArticle.stories.tsx +85 -0
- package/src/containers/{NotebookContainer/NotebookContainer.tsx → NotebookArticle/NotebookArticle.tsx} +43 -56
- package/src/containers/NotebookArticle/index.ts +5 -0
- package/src/containers/ScriptArticle/ScriptArticle.stories.tsx +107 -0
- package/src/containers/{ScriptContainer/ScriptContainer.tsx → ScriptArticle/ScriptArticle.tsx} +15 -14
- package/src/containers/ScriptArticle/index.ts +5 -0
- package/src/containers/ScriptProperties/BlueprintEditor.tsx +102 -0
- package/src/containers/ScriptProperties/FunctionBinding.tsx +83 -0
- package/src/containers/ScriptProperties/FunctionPublishing.tsx +121 -0
- package/src/containers/ScriptProperties/ScriptProperties.stories.tsx +76 -0
- package/src/containers/ScriptProperties/ScriptProperties.tsx +12 -21
- package/src/containers/ScriptProperties/index.ts +1 -3
- package/src/containers/TestContainer/TestContainer.tsx +24 -8
- package/src/containers/TestContainer/index.ts +1 -3
- package/src/containers/index.ts +2 -4
- package/src/e2e/ai.test.ts +7 -6
- package/src/e2e/deploy.test.ts +6 -4
- package/src/hooks/deploy.ts +10 -8
- package/src/hooks/format.ts +5 -5
- package/src/hooks/template.ts +7 -6
- package/src/hooks/useCompiler.ts +3 -2
- package/src/hooks/useCreateAndDeployScriptTemplates.ts +4 -3
- package/src/index.ts +2 -5
- package/src/meta.ts +13 -7
- 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/create-script.ts +46 -0
- package/src/operations/index.ts +7 -0
- package/src/plugin.ts +11 -0
- package/src/templates/anthropic.ts +20 -12
- package/src/templates/chess-bot.ts +42 -37
- package/src/templates/commentary.ts +185 -165
- package/src/templates/data-generator.ts +2 -2
- package/src/templates/discord.ts +8 -8
- package/src/templates/forex-effect.ts +31 -19
- package/src/templates/forex.ts +25 -15
- package/src/templates/gmail.ts +9 -9
- package/src/templates/index.ts +16 -23
- package/src/templates/ping.ts +17 -8
- package/src/testing/index.ts +2 -1
- package/src/testing/simulator.test.ts +3 -4
- package/src/testing/{data.ts → test-notebook.ts} +12 -13
- package/src/testing/test-script.ts +28 -0
- package/src/translations.ts +89 -89
- package/src/types/Notebook.ts +8 -10
- package/src/types/ScriptCapabilities.ts +18 -0
- package/src/types/ScriptEvents.ts +11 -0
- package/src/types/ScriptOperation.ts +42 -0
- package/src/types/Settings.ts +20 -0
- package/src/types/index.ts +5 -4
- package/src/types/types.ts +1 -11
- package/src/util/deploy.ts +14 -12
- package/src/util/functions.ts +12 -11
- package/src/vite-env.d.ts +5 -0
- package/dist/lib/browser/DeploymentDialog-IIOXAS47.mjs.map +0 -7
- package/dist/lib/browser/NotebookContainer-VVZOKGRC.mjs.map +0 -7
- package/dist/lib/browser/ScriptContainer-A5SSIUH6.mjs.map +0 -7
- package/dist/lib/browser/ScriptObjectSettings-HYYC7KXC.mjs +0 -294
- package/dist/lib/browser/ScriptObjectSettings-HYYC7KXC.mjs.map +0 -7
- package/dist/lib/browser/ScriptPluginSettings-UTWA7CBT.mjs +0 -55
- package/dist/lib/browser/ScriptPluginSettings-UTWA7CBT.mjs.map +0 -7
- package/dist/lib/browser/ScriptProperties-HREPUE65.mjs +0 -28
- package/dist/lib/browser/ScriptProperties-HREPUE65.mjs.map +0 -7
- package/dist/lib/browser/TestContainer-D4Y2K2TT.mjs +0 -39
- package/dist/lib/browser/TestContainer-D4Y2K2TT.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-66ZDI72K.mjs +0 -69
- package/dist/lib/browser/app-graph-builder-66ZDI72K.mjs.map +0 -7
- package/dist/lib/browser/blueprint-definition-YMZEJBAZ.mjs.map +0 -7
- package/dist/lib/browser/chunk-6IXFDTAI.mjs +0 -113
- package/dist/lib/browser/chunk-6IXFDTAI.mjs.map +0 -7
- package/dist/lib/browser/chunk-ATTZUDT7.mjs +0 -67
- package/dist/lib/browser/chunk-ATTZUDT7.mjs.map +0 -7
- package/dist/lib/browser/chunk-G3XIOLLI.mjs.map +0 -7
- package/dist/lib/browser/chunk-J7PGML5B.mjs +0 -105
- package/dist/lib/browser/chunk-J7PGML5B.mjs.map +0 -7
- package/dist/lib/browser/chunk-MUEVLYXJ.mjs.map +0 -7
- package/dist/lib/browser/chunk-PLDBKKYO.mjs +0 -789
- package/dist/lib/browser/chunk-PLDBKKYO.mjs.map +0 -7
- package/dist/lib/browser/chunk-Q66L5EUR.mjs +0 -20
- package/dist/lib/browser/chunk-Q66L5EUR.mjs.map +0 -7
- package/dist/lib/browser/chunk-TW27W3EL.mjs +0 -29
- package/dist/lib/browser/chunk-TW27W3EL.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-ZYU2LP6U.mjs +0 -11
- package/dist/lib/browser/chunk-ZYU2LP6U.mjs.map +0 -7
- package/dist/lib/browser/compiler-53G6ZHQM.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -250
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/operation-resolver-CYEISDDK.mjs +0 -79
- package/dist/lib/browser/operation-resolver-CYEISDDK.mjs.map +0 -7
- package/dist/lib/browser/react-surface-26P6HAFD.mjs +0 -141
- package/dist/lib/browser/react-surface-26P6HAFD.mjs.map +0 -7
- package/dist/lib/browser/settings-76UM7442.mjs.map +0 -7
- package/dist/lib/browser/types/index.mjs +0 -18
- package/dist/lib/node-esm/DeploymentDialog-ZHPHEV2H.mjs +0 -139
- package/dist/lib/node-esm/DeploymentDialog-ZHPHEV2H.mjs.map +0 -7
- package/dist/lib/node-esm/NotebookContainer-ZLWTNMQA.mjs +0 -851
- package/dist/lib/node-esm/NotebookContainer-ZLWTNMQA.mjs.map +0 -7
- package/dist/lib/node-esm/ScriptContainer-S4UKQAWP.mjs +0 -94
- package/dist/lib/node-esm/ScriptContainer-S4UKQAWP.mjs.map +0 -7
- package/dist/lib/node-esm/ScriptObjectSettings-C5QBRERY.mjs +0 -295
- package/dist/lib/node-esm/ScriptObjectSettings-C5QBRERY.mjs.map +0 -7
- package/dist/lib/node-esm/ScriptPluginSettings-MFACDW4R.mjs +0 -56
- package/dist/lib/node-esm/ScriptPluginSettings-MFACDW4R.mjs.map +0 -7
- package/dist/lib/node-esm/ScriptProperties-FMNIX3KU.mjs +0 -29
- package/dist/lib/node-esm/ScriptProperties-FMNIX3KU.mjs.map +0 -7
- package/dist/lib/node-esm/TestContainer-AO45YPGV.mjs +0 -40
- package/dist/lib/node-esm/TestContainer-AO45YPGV.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-IGAZTJ45.mjs +0 -70
- package/dist/lib/node-esm/app-graph-builder-IGAZTJ45.mjs.map +0 -7
- package/dist/lib/node-esm/blueprint-definition-5MGY6BRQ.mjs +0 -18
- package/dist/lib/node-esm/blueprint-definition-5MGY6BRQ.mjs.map +0 -7
- package/dist/lib/node-esm/blueprints/index.mjs +0 -9
- package/dist/lib/node-esm/chunk-5BG7OJGQ.mjs +0 -176
- package/dist/lib/node-esm/chunk-5BG7OJGQ.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-H46R2RS5.mjs +0 -790
- package/dist/lib/node-esm/chunk-H46R2RS5.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +0 -11
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-JGN7TDJH.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-QG6ANK4B.mjs +0 -107
- package/dist/lib/node-esm/chunk-QG6ANK4B.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-S7DSCLOW.mjs +0 -31
- package/dist/lib/node-esm/chunk-S7DSCLOW.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-TZ2EBTPQ.mjs +0 -22
- package/dist/lib/node-esm/chunk-TZ2EBTPQ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-UFBVE33O.mjs +0 -12
- package/dist/lib/node-esm/chunk-UFBVE33O.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-WWD5LUU6.mjs +0 -114
- package/dist/lib/node-esm/chunk-WWD5LUU6.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ZDJ2FI7E.mjs +0 -398
- package/dist/lib/node-esm/chunk-ZDJ2FI7E.mjs.map +0 -7
- package/dist/lib/node-esm/compiler-HHQW7EP3.mjs +0 -100
- package/dist/lib/node-esm/compiler-HHQW7EP3.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -251
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/operation-resolver-HFFDXWND.mjs +0 -80
- package/dist/lib/node-esm/operation-resolver-HFFDXWND.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-THCIK266.mjs +0 -142
- package/dist/lib/node-esm/react-surface-THCIK266.mjs.map +0 -7
- package/dist/lib/node-esm/settings-CCHDPLFJ.mjs +0 -37
- package/dist/lib/node-esm/settings-CCHDPLFJ.mjs.map +0 -7
- package/dist/lib/node-esm/templates/index.mjs +0 -11
- package/dist/lib/node-esm/types/index.mjs +0 -19
- 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 +0 -12
- 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 -6
- 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.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.map +0 -1
- package/dist/types/src/components/FrameContainer/FrameContainer.d.ts +0 -12
- package/dist/types/src/components/FrameContainer/FrameContainer.d.ts.map +0 -1
- package/dist/types/src/components/FrameContainer/frame.d.ts +0 -2
- package/dist/types/src/components/FrameContainer/frame.d.ts.map +0 -1
- package/dist/types/src/components/FrameContainer/index.d.ts +0 -2
- package/dist/types/src/components/FrameContainer/index.d.ts.map +0 -1
- package/dist/types/src/containers/NotebookContainer/NotebookContainer.d.ts +0 -7
- package/dist/types/src/containers/NotebookContainer/NotebookContainer.d.ts.map +0 -1
- package/dist/types/src/containers/NotebookContainer/NotebookContainer.stories.d.ts +0 -7
- package/dist/types/src/containers/NotebookContainer/NotebookContainer.stories.d.ts.map +0 -1
- package/dist/types/src/containers/NotebookContainer/index.d.ts +0 -3
- package/dist/types/src/containers/NotebookContainer/index.d.ts.map +0 -1
- package/dist/types/src/containers/ScriptContainer/ScriptContainer.d.ts +0 -10
- package/dist/types/src/containers/ScriptContainer/ScriptContainer.d.ts.map +0 -1
- package/dist/types/src/containers/ScriptContainer/index.d.ts +0 -3
- package/dist/types/src/containers/ScriptContainer/index.d.ts.map +0 -1
- package/dist/types/src/containers/ScriptObjectSettings/ScriptObjectSettings.d.ts +0 -7
- package/dist/types/src/containers/ScriptObjectSettings/ScriptObjectSettings.d.ts.map +0 -1
- package/dist/types/src/containers/ScriptObjectSettings/index.d.ts +0 -3
- package/dist/types/src/containers/ScriptObjectSettings/index.d.ts.map +0 -1
- package/dist/types/src/containers/ScriptPluginSettings/ScriptPluginSettings.d.ts +0 -8
- package/dist/types/src/containers/ScriptPluginSettings/ScriptPluginSettings.d.ts.map +0 -1
- package/dist/types/src/containers/ScriptPluginSettings/index.d.ts +0 -3
- package/dist/types/src/containers/ScriptPluginSettings/index.d.ts.map +0 -1
- package/dist/types/src/templates/chat.d.ts +0 -6
- package/dist/types/src/templates/chat.d.ts.map +0 -1
- package/dist/types/src/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/dist/types/src/types/capabilities.d.ts +0 -12
- package/dist/types/src/types/capabilities.d.ts.map +0 -1
- package/dist/types/src/types/events.d.ts +0 -5
- package/dist/types/src/types/events.d.ts.map +0 -1
- package/src/capabilities/app-graph-builder/app-graph-builder.ts +0 -56
- package/src/capabilities/app-graph-builder/index.ts +0 -7
- package/src/capabilities/artifact-definition/artifact-definition.ts +0 -227
- package/src/capabilities/artifact-definition/index.ts +0 -7
- 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 -75
- package/src/capabilities/react-surface/index.ts +0 -7
- package/src/capabilities/react-surface/react-surface.tsx +0 -121
- package/src/capabilities/settings/index.ts +0 -7
- package/src/components/FrameContainer/FrameContainer.tsx +0 -85
- package/src/components/FrameContainer/frame.html +0 -25
- package/src/components/FrameContainer/frame.tsx +0 -51
- package/src/components/FrameContainer/index.ts +0 -5
- package/src/containers/NotebookContainer/NotebookContainer.stories.tsx +0 -87
- package/src/containers/NotebookContainer/index.ts +0 -7
- package/src/containers/ScriptContainer/index.ts +0 -7
- package/src/containers/ScriptObjectSettings/ScriptObjectSettings.tsx +0 -291
- package/src/containers/ScriptObjectSettings/index.ts +0 -7
- package/src/containers/ScriptPluginSettings/ScriptPluginSettings.tsx +0 -66
- package/src/containers/ScriptPluginSettings/index.ts +0 -7
- package/src/templates/chat.ts +0 -96
- package/src/types/actions.ts +0 -45
- package/src/types/capabilities.ts +0 -17
- package/src/types/events.ts +0 -11
- /package/dist/lib/{browser → neutral}/blueprints/index.mjs.map +0 -0
- /package/dist/lib/{browser → neutral}/chunk-J5LGTIGS.mjs +0 -0
- /package/dist/lib/{browser → neutral}/chunk-J5LGTIGS.mjs.map +0 -0
- /package/dist/lib/{browser/templates → neutral}/index.mjs.map +0 -0
- /package/dist/lib/{browser/types/index.mjs.map → neutral/meta.mjs.map} +0 -0
- /package/dist/lib/{node-esm/blueprints → neutral/operations}/index.mjs.map +0 -0
- /package/dist/lib/{node-esm → neutral}/templates/index.mjs.map +0 -0
- /package/dist/lib/{node-esm → neutral}/types/index.mjs.map +0 -0
- /package/dist/types/src/capabilities/{app-graph-builder/app-graph-builder.d.ts → app-graph-builder.d.ts} +0 -0
- /package/dist/types/src/capabilities/{react-surface/react-surface.d.ts → react-surface.d.ts} +0 -0
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2023 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
|
-
import * as Effect from 'effect/Effect';
|
|
7
|
-
import React from 'react';
|
|
8
|
-
|
|
9
|
-
import { SERVICES_CONFIG } from '@dxos/ai/testing';
|
|
10
|
-
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
11
|
-
import { AgentFunctions } from '@dxos/assistant-toolkit';
|
|
12
|
-
import { Filter } from '@dxos/echo';
|
|
13
|
-
import { Function, serializeFunction } from '@dxos/functions';
|
|
14
|
-
import { AssistantPlugin } from '@dxos/plugin-assistant';
|
|
15
|
-
import { AutomationPlugin } from '@dxos/plugin-automation';
|
|
16
|
-
import { ClientPlugin } from '@dxos/plugin-client';
|
|
17
|
-
import { ExplorerPlugin } from '@dxos/plugin-explorer';
|
|
18
|
-
import { Markdown, MarkdownPlugin } from '@dxos/plugin-markdown';
|
|
19
|
-
import { corePlugins } from '@dxos/plugin-testing';
|
|
20
|
-
import { Config, useClient } from '@dxos/react-client';
|
|
21
|
-
import { useQuery } from '@dxos/react-client/echo';
|
|
22
|
-
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
23
|
-
import { DataTypes } from '@dxos/schema';
|
|
24
|
-
|
|
25
|
-
import { createNotebook } from '../../testing';
|
|
26
|
-
import { translations } from '../../translations';
|
|
27
|
-
import { Notebook } from '../../types';
|
|
28
|
-
|
|
29
|
-
import { NotebookContainer } from './NotebookContainer';
|
|
30
|
-
|
|
31
|
-
const meta: Meta<typeof NotebookContainer> = {
|
|
32
|
-
title: 'plugins/plugin-script/containers/NotebookContainer',
|
|
33
|
-
component: NotebookContainer,
|
|
34
|
-
render: (args) => {
|
|
35
|
-
const client = useClient();
|
|
36
|
-
const space = client.spaces.default;
|
|
37
|
-
const notebooks = useQuery(space?.db, Filter.type(Notebook.Notebook));
|
|
38
|
-
return <NotebookContainer {...args} subject={notebooks[0]} />;
|
|
39
|
-
},
|
|
40
|
-
decorators: [
|
|
41
|
-
withTheme(),
|
|
42
|
-
withLayout({ layout: 'column', classNames: 'w-prose-max-width' }),
|
|
43
|
-
withPluginManager({
|
|
44
|
-
plugins: [
|
|
45
|
-
...corePlugins(),
|
|
46
|
-
ClientPlugin({
|
|
47
|
-
// TODO(wittjosiah): ComputeRuntime requires edge to be configured or it will throw.
|
|
48
|
-
config: new Config({
|
|
49
|
-
runtime: {
|
|
50
|
-
services: SERVICES_CONFIG.REMOTE,
|
|
51
|
-
},
|
|
52
|
-
}),
|
|
53
|
-
types: [...DataTypes, Notebook.Notebook, Function.Function, Markdown.Document],
|
|
54
|
-
onClientInitialized: ({ client }) =>
|
|
55
|
-
Effect.gen(function* () {
|
|
56
|
-
yield* Effect.promise(() => client.halo.createIdentity());
|
|
57
|
-
yield* Effect.promise(() => client.spaces.waitUntilReady());
|
|
58
|
-
const space = client.spaces.default;
|
|
59
|
-
yield* Effect.promise(() => space.waitUntilReady());
|
|
60
|
-
|
|
61
|
-
space.db.add(createNotebook());
|
|
62
|
-
space.db.add(Markdown.make({ content: '# Hello World' }));
|
|
63
|
-
space.db.add(serializeFunction(AgentFunctions.Prompt));
|
|
64
|
-
}),
|
|
65
|
-
}),
|
|
66
|
-
AssistantPlugin(),
|
|
67
|
-
AutomationPlugin(),
|
|
68
|
-
ExplorerPlugin(),
|
|
69
|
-
MarkdownPlugin(),
|
|
70
|
-
],
|
|
71
|
-
}),
|
|
72
|
-
],
|
|
73
|
-
parameters: {
|
|
74
|
-
translations,
|
|
75
|
-
},
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
export default meta;
|
|
79
|
-
|
|
80
|
-
type Story = StoryObj<typeof meta>;
|
|
81
|
-
|
|
82
|
-
export const Default: Story = {
|
|
83
|
-
args: {
|
|
84
|
-
role: 'article',
|
|
85
|
-
subject: undefined as any,
|
|
86
|
-
},
|
|
87
|
-
};
|
|
@@ -1,291 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2024 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { Octokit } from '@octokit/core';
|
|
6
|
-
import React, { type ChangeEvent, useCallback, useState } from 'react';
|
|
7
|
-
|
|
8
|
-
import { ToolId } from '@dxos/ai';
|
|
9
|
-
import { useOperationInvoker } from '@dxos/app-framework/ui';
|
|
10
|
-
import { SettingsOperation } from '@dxos/app-toolkit';
|
|
11
|
-
import { Blueprint, Template } from '@dxos/blueprints';
|
|
12
|
-
import { Filter, Obj, Ref } from '@dxos/echo';
|
|
13
|
-
import { Function, type Script, getUserFunctionIdInMetadata } from '@dxos/functions';
|
|
14
|
-
import { getInvocationUrl } from '@dxos/functions-runtime';
|
|
15
|
-
import { log } from '@dxos/log';
|
|
16
|
-
import { useClient } from '@dxos/react-client';
|
|
17
|
-
import { useQuery } from '@dxos/react-client/echo';
|
|
18
|
-
import { Button, Clipboard, Input, useAsyncEffect, useControlledState, useTranslation } from '@dxos/react-ui';
|
|
19
|
-
import { AccessToken } from '@dxos/types';
|
|
20
|
-
import { kebabize } from '@dxos/util';
|
|
21
|
-
|
|
22
|
-
import { meta } from '../../meta';
|
|
23
|
-
|
|
24
|
-
export type ScriptObjectSettingsProps = {
|
|
25
|
-
object: Script.Script;
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
export const ScriptObjectSettings = ({ object }: ScriptObjectSettingsProps) => {
|
|
29
|
-
return (
|
|
30
|
-
<>
|
|
31
|
-
<Binding object={object} />
|
|
32
|
-
<BlueprintEditor object={object} />
|
|
33
|
-
<Publishing object={object} />
|
|
34
|
-
</>
|
|
35
|
-
);
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
const BlueprintEditor = ({ object }: ScriptObjectSettingsProps) => {
|
|
39
|
-
const { t } = useTranslation(meta.id);
|
|
40
|
-
const db = Obj.getDatabase(object);
|
|
41
|
-
const [fn] = useQuery(db, Filter.type(Function.Function, { source: Ref.make(object) }));
|
|
42
|
-
const blueprints = useQuery(db, Filter.type(Blueprint.Blueprint));
|
|
43
|
-
|
|
44
|
-
const [creating, setCreating] = useState(false);
|
|
45
|
-
const [instructions, setInstructions] = useState<string>(`You can run the script "${object.name ?? 'script'}".`);
|
|
46
|
-
const blueprintKey = `dxos.org/blueprint/${kebabize(object.name ?? 'script')}`;
|
|
47
|
-
const existingBlueprint = blueprints.find((bp) => bp.key === blueprintKey);
|
|
48
|
-
|
|
49
|
-
useAsyncEffect(async () => {
|
|
50
|
-
if (!existingBlueprint) {
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
const source = await existingBlueprint.instructions.source.load();
|
|
54
|
-
setInstructions(source.content ?? '');
|
|
55
|
-
}, [existingBlueprint]);
|
|
56
|
-
|
|
57
|
-
const handleSave = useCallback(async () => {
|
|
58
|
-
if (!db) {
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
setCreating(true);
|
|
63
|
-
try {
|
|
64
|
-
if (existingBlueprint) {
|
|
65
|
-
const text = await existingBlueprint.instructions.source.load();
|
|
66
|
-
Obj.change(text, (t) => {
|
|
67
|
-
t.content = instructions;
|
|
68
|
-
});
|
|
69
|
-
if (fn?.key) {
|
|
70
|
-
const toolId = ToolId.make(fn.key);
|
|
71
|
-
if (!existingBlueprint.tools?.includes(toolId)) {
|
|
72
|
-
Obj.change(existingBlueprint, (b) => {
|
|
73
|
-
b.tools = [...(b.tools ?? []), toolId];
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
} else if (fn?.key) {
|
|
78
|
-
db.add(
|
|
79
|
-
Blueprint.make({
|
|
80
|
-
key: blueprintKey,
|
|
81
|
-
name: object.name ?? 'Script',
|
|
82
|
-
instructions: Template.make({
|
|
83
|
-
source: instructions,
|
|
84
|
-
}),
|
|
85
|
-
tools: [ToolId.make(fn.key)],
|
|
86
|
-
}),
|
|
87
|
-
);
|
|
88
|
-
}
|
|
89
|
-
await db.flush();
|
|
90
|
-
} finally {
|
|
91
|
-
setCreating(false);
|
|
92
|
-
}
|
|
93
|
-
}, [db, existingBlueprint, fn, blueprintKey, object.name, instructions]);
|
|
94
|
-
|
|
95
|
-
return (
|
|
96
|
-
<div className='flex flex-col gap-4 my-form-padding'>
|
|
97
|
-
<div>
|
|
98
|
-
<h2>{t('blueprint editor label', { default: 'Blueprint' })}</h2>
|
|
99
|
-
<p className='text-description text-sm'>
|
|
100
|
-
{t('blueprint editor description', {
|
|
101
|
-
default: 'Create a blueprint that exposes this script as a tool.',
|
|
102
|
-
})}
|
|
103
|
-
</p>
|
|
104
|
-
</div>
|
|
105
|
-
<Input.Root>
|
|
106
|
-
<div role='none' className='flex flex-col gap-1'>
|
|
107
|
-
<Input.Label>{t('blueprint instructions label', { default: 'Instructions' })}</Input.Label>
|
|
108
|
-
<Input.TextArea
|
|
109
|
-
placeholder={t('blueprint instructions placeholder', {
|
|
110
|
-
default: 'Describe how this tool should be used.',
|
|
111
|
-
})}
|
|
112
|
-
rows={6}
|
|
113
|
-
value={instructions}
|
|
114
|
-
onChange={(event) => setInstructions(event.target.value)}
|
|
115
|
-
classNames='resize-y'
|
|
116
|
-
/>
|
|
117
|
-
</div>
|
|
118
|
-
</Input.Root>
|
|
119
|
-
<div className='flex justify-end gap-2'>
|
|
120
|
-
<Button disabled={(!existingBlueprint && !fn?.key) || creating} onClick={handleSave}>
|
|
121
|
-
{t(creating ? 'creating label' : 'create blueprint label', {
|
|
122
|
-
default: creating ? 'Creating…' : 'Create blueprint',
|
|
123
|
-
})}
|
|
124
|
-
</Button>
|
|
125
|
-
</div>
|
|
126
|
-
</div>
|
|
127
|
-
);
|
|
128
|
-
};
|
|
129
|
-
|
|
130
|
-
const Binding = ({ object }: ScriptObjectSettingsProps) => {
|
|
131
|
-
const { t } = useTranslation(meta.id);
|
|
132
|
-
const client = useClient();
|
|
133
|
-
const db = Obj.getDatabase(object);
|
|
134
|
-
const [fn] = useQuery(db, Filter.type(Function.Function, { source: Ref.make(object) }));
|
|
135
|
-
|
|
136
|
-
const functionId = fn && getUserFunctionIdInMetadata(Obj.getMeta(fn));
|
|
137
|
-
const functionUrl =
|
|
138
|
-
functionId &&
|
|
139
|
-
getInvocationUrl(functionId, client.config.values.runtime?.services?.edge?.url ?? '', {
|
|
140
|
-
spaceId: db?.spaceId,
|
|
141
|
-
});
|
|
142
|
-
|
|
143
|
-
const [binding, setBinding] = useControlledState(fn?.binding ?? '');
|
|
144
|
-
const handleBindingChange = useCallback(
|
|
145
|
-
(event: ChangeEvent<HTMLInputElement>) => {
|
|
146
|
-
setBinding(event.target.value);
|
|
147
|
-
},
|
|
148
|
-
[setBinding],
|
|
149
|
-
);
|
|
150
|
-
|
|
151
|
-
const handleBindingBlur = useCallback(() => {
|
|
152
|
-
Obj.change(fn, (f) => {
|
|
153
|
-
f.binding = binding;
|
|
154
|
-
});
|
|
155
|
-
}, [fn, binding]);
|
|
156
|
-
|
|
157
|
-
if (!fn || !functionUrl) {
|
|
158
|
-
return null;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
// TODO(burdon): Use form.
|
|
162
|
-
return (
|
|
163
|
-
<div role='form' className='flex flex-col gap-2 my-form-padding'>
|
|
164
|
-
<h2>{t('remote function settings heading')}</h2>
|
|
165
|
-
<Input.Root>
|
|
166
|
-
<div role='none' className='flex flex-col gap-1'>
|
|
167
|
-
<Input.Label>{t('function url label')}</Input.Label>
|
|
168
|
-
<div role='none' className='flex gap-1'>
|
|
169
|
-
<Input.TextInput
|
|
170
|
-
disabled
|
|
171
|
-
value={functionUrl}
|
|
172
|
-
onChange={(event) => {
|
|
173
|
-
Obj.change(fn, (f) => {
|
|
174
|
-
f.name = event.target.value;
|
|
175
|
-
});
|
|
176
|
-
}}
|
|
177
|
-
/>
|
|
178
|
-
<Clipboard.IconButton value={functionUrl} />
|
|
179
|
-
</div>
|
|
180
|
-
</div>
|
|
181
|
-
</Input.Root>
|
|
182
|
-
<Input.Root>
|
|
183
|
-
<div role='none' className='flex flex-col gap-1'>
|
|
184
|
-
<Input.Label>{t('function binding label')}</Input.Label>
|
|
185
|
-
<Input.TextInput
|
|
186
|
-
placeholder={t('function binding placeholder')}
|
|
187
|
-
value={binding}
|
|
188
|
-
onChange={handleBindingChange}
|
|
189
|
-
onBlur={handleBindingBlur}
|
|
190
|
-
/>
|
|
191
|
-
</div>
|
|
192
|
-
</Input.Root>
|
|
193
|
-
</div>
|
|
194
|
-
);
|
|
195
|
-
};
|
|
196
|
-
|
|
197
|
-
// TODO(burdon): Move to separate tab?
|
|
198
|
-
const Publishing = ({ object }: ScriptObjectSettingsProps) => {
|
|
199
|
-
const { t } = useTranslation(meta.id);
|
|
200
|
-
const { invokePromise } = useOperationInvoker();
|
|
201
|
-
const db = Obj.getDatabase(object);
|
|
202
|
-
const [githubToken] = useQuery(db, Filter.type(AccessToken.AccessToken, { source: 'github.com' }));
|
|
203
|
-
const gistKey = Obj.getMeta(object).keys.find(({ source }) => source === 'github.com');
|
|
204
|
-
const [gistUrl, setGistUrl] = useState<string | undefined>();
|
|
205
|
-
|
|
206
|
-
useAsyncEffect(async () => {
|
|
207
|
-
const token = githubToken?.token;
|
|
208
|
-
const gistId = gistKey?.id;
|
|
209
|
-
if (!token || !gistId) {
|
|
210
|
-
setGistUrl(undefined);
|
|
211
|
-
return;
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
try {
|
|
215
|
-
const octokit = new Octokit({ auth: githubToken.token });
|
|
216
|
-
const response = await octokit.request('GET /gists/{gist_id}', {
|
|
217
|
-
gist_id: gistId,
|
|
218
|
-
});
|
|
219
|
-
setGistUrl(response.data.html_url);
|
|
220
|
-
} catch (err) {
|
|
221
|
-
log.catch(err);
|
|
222
|
-
setGistUrl(undefined);
|
|
223
|
-
}
|
|
224
|
-
}, [githubToken, gistKey]);
|
|
225
|
-
|
|
226
|
-
const handleOpenTokenManager = useCallback(
|
|
227
|
-
() =>
|
|
228
|
-
invokePromise(SettingsOperation.Open, {
|
|
229
|
-
plugin: 'dxos.org/plugin/token-manager',
|
|
230
|
-
}),
|
|
231
|
-
[invokePromise],
|
|
232
|
-
);
|
|
233
|
-
|
|
234
|
-
const [publishing, setPublishing] = useState(false);
|
|
235
|
-
const handlePublish = useCallback(async () => {
|
|
236
|
-
setPublishing(true);
|
|
237
|
-
const octokit = new Octokit({ auth: githubToken.token });
|
|
238
|
-
const source = await object.source.load();
|
|
239
|
-
const filename = object.name ? kebabize(object.name) : 'composer-script';
|
|
240
|
-
const files = { [`${filename}.ts`]: { content: source.content } };
|
|
241
|
-
|
|
242
|
-
try {
|
|
243
|
-
// TODO(wittjosiah): Factor out to intent.
|
|
244
|
-
const meta = Obj.getMeta(object);
|
|
245
|
-
const githubKey = meta.keys.find(({ source }) => source === 'github.com');
|
|
246
|
-
const gistId = githubKey?.id;
|
|
247
|
-
if (gistId) {
|
|
248
|
-
await octokit.request('PATCH /gists/{gist_id}', {
|
|
249
|
-
gist_id: gistId,
|
|
250
|
-
files,
|
|
251
|
-
});
|
|
252
|
-
} else {
|
|
253
|
-
const response = await octokit.request('POST /gists', {
|
|
254
|
-
public: true,
|
|
255
|
-
files,
|
|
256
|
-
});
|
|
257
|
-
const gistId = response.data.id;
|
|
258
|
-
if (gistId) {
|
|
259
|
-
Obj.change(object, (obj) => {
|
|
260
|
-
Obj.getMeta(obj).keys.push({ source: 'github.com', id: gistId });
|
|
261
|
-
});
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
} finally {
|
|
265
|
-
setPublishing(false);
|
|
266
|
-
}
|
|
267
|
-
}, [object, githubToken]);
|
|
268
|
-
|
|
269
|
-
return (
|
|
270
|
-
<div className='flex flex-col gap-4 my-form-padding'>
|
|
271
|
-
<div>
|
|
272
|
-
<h2>{t('script publish settings label')}</h2>
|
|
273
|
-
<p className='text-description text-sm'>{t('script publish settings description')}</p>
|
|
274
|
-
</div>
|
|
275
|
-
{!githubToken && (
|
|
276
|
-
<div className='flex flex-col gap-2'>
|
|
277
|
-
<span>{t('no github token label')}</span>
|
|
278
|
-
<Button onClick={handleOpenTokenManager}>{t('open token manager label')}</Button>
|
|
279
|
-
</div>
|
|
280
|
-
)}
|
|
281
|
-
{githubToken && (
|
|
282
|
-
<div className='flex justify-end gap-2'>
|
|
283
|
-
{gistUrl && <Clipboard.IconButton value={gistUrl} />}
|
|
284
|
-
<Button disabled={publishing} onClick={handlePublish}>
|
|
285
|
-
{t(publishing ? 'publishing label' : 'publish label')}
|
|
286
|
-
</Button>
|
|
287
|
-
</div>
|
|
288
|
-
)}
|
|
289
|
-
</div>
|
|
290
|
-
);
|
|
291
|
-
};
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2023 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React from 'react';
|
|
6
|
-
|
|
7
|
-
import { useClient } from '@dxos/react-client';
|
|
8
|
-
import { Button, Select, useTranslation } from '@dxos/react-ui';
|
|
9
|
-
import { Settings } from '@dxos/react-ui-form';
|
|
10
|
-
import { type EditorInputMode, EditorInputModes } from '@dxos/ui-editor';
|
|
11
|
-
|
|
12
|
-
import { meta } from '../../meta';
|
|
13
|
-
import { type ScriptSettings } from '../../types';
|
|
14
|
-
import { getAccessCredential } from '../../util';
|
|
15
|
-
|
|
16
|
-
export type ScriptPluginSettingsComponentProps = {
|
|
17
|
-
settings: ScriptSettings;
|
|
18
|
-
onSettingsChange: (fn: (current: ScriptSettings) => ScriptSettings) => void;
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export const ScriptPluginSettings = ({ settings, onSettingsChange }: ScriptPluginSettingsComponentProps) => {
|
|
22
|
-
const { t } = useTranslation(meta.id);
|
|
23
|
-
const client = useClient();
|
|
24
|
-
|
|
25
|
-
// TODO(burdon): Check token.
|
|
26
|
-
const handleAuthenticate = async () => {
|
|
27
|
-
const { identityKey } = client.halo.identity.get()!;
|
|
28
|
-
await client.halo.writeCredentials([getAccessCredential(identityKey)]);
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
return (
|
|
32
|
-
<Settings.Root>
|
|
33
|
-
<Settings.Section title={t('settings title', { ns: meta.id })}>
|
|
34
|
-
<Settings.Group>
|
|
35
|
-
{/* TODO(wittjosiah): Hide outside of dev environments. */}
|
|
36
|
-
<Settings.ItemInput title={t('authenticate action label')}>
|
|
37
|
-
<Button onClick={handleAuthenticate}>{t('authenticate button label')}</Button>
|
|
38
|
-
</Settings.ItemInput>
|
|
39
|
-
|
|
40
|
-
<Settings.ItemInput title={t('editor input mode label')}>
|
|
41
|
-
<Select.Root
|
|
42
|
-
value={settings.editorInputMode ?? 'default'}
|
|
43
|
-
onValueChange={(value) => {
|
|
44
|
-
onSettingsChange((s) => ({ ...s, editorInputMode: value as EditorInputMode }));
|
|
45
|
-
}}
|
|
46
|
-
>
|
|
47
|
-
<Select.TriggerButton placeholder={t('select editor input mode placeholder')} />
|
|
48
|
-
<Select.Portal>
|
|
49
|
-
<Select.Content>
|
|
50
|
-
<Select.Viewport>
|
|
51
|
-
{EditorInputModes.map((mode) => (
|
|
52
|
-
<Select.Option key={mode} value={mode}>
|
|
53
|
-
{t(`settings editor input mode ${mode} label`)}
|
|
54
|
-
</Select.Option>
|
|
55
|
-
))}
|
|
56
|
-
</Select.Viewport>
|
|
57
|
-
<Select.Arrow />
|
|
58
|
-
</Select.Content>
|
|
59
|
-
</Select.Portal>
|
|
60
|
-
</Select.Root>
|
|
61
|
-
</Settings.ItemInput>
|
|
62
|
-
</Settings.Group>
|
|
63
|
-
</Settings.Section>
|
|
64
|
-
</Settings.Root>
|
|
65
|
-
);
|
|
66
|
-
};
|
package/src/templates/chat.ts
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2024 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
// @ts-ignore
|
|
6
|
-
import { transformServerSentEvents } from 'https://esm.sh/@dxos/script-toolbox?bundle=false';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Chatbot that answers questions based on the context data.
|
|
10
|
-
*/
|
|
11
|
-
export default async ({ data: { bodyText }, context: { space, ai } }: any) => {
|
|
12
|
-
let parsedRequest: any;
|
|
13
|
-
try {
|
|
14
|
-
parsedRequest = JSON.parse(bodyText);
|
|
15
|
-
} catch (err) {
|
|
16
|
-
const answer = await ai.run('@cf/meta/llama-3.1-8b-instruct', {
|
|
17
|
-
stream: true,
|
|
18
|
-
prompt: `
|
|
19
|
-
Using only the context data below to answer the user's question.
|
|
20
|
-
If you cannot answer the question from the provided content, then reply with "I don't know."
|
|
21
|
-
|
|
22
|
-
CONTEXT:
|
|
23
|
-
${await getContext({ space })}
|
|
24
|
-
|
|
25
|
-
QUESTION:
|
|
26
|
-
${bodyText}
|
|
27
|
-
`,
|
|
28
|
-
});
|
|
29
|
-
return new Response(transformServerSentEvents(answer));
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
const promptId = parsedRequest.trigger.promptId;
|
|
33
|
-
const promptObject = await space.crud.query({ id: promptId }).first();
|
|
34
|
-
|
|
35
|
-
if (parsedRequest.data.objects.length !== 1) {
|
|
36
|
-
return new Response('Message batches not supported.');
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
const messageId = parsedRequest.data.objects[0];
|
|
40
|
-
let message;
|
|
41
|
-
try {
|
|
42
|
-
message = await space.crud.query({ id: messageId }).first();
|
|
43
|
-
} catch (err) {
|
|
44
|
-
return new Response('Message not replicated yet.', { status: 409 });
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
if (message.text.includes('--------')) {
|
|
48
|
-
return new Response('Message was already processed.');
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
let prompt = promptObject.template;
|
|
52
|
-
for (const input of promptObject.inputs) {
|
|
53
|
-
let value: string | null = null;
|
|
54
|
-
if (input.type === TemplateInputType.VALUE) {
|
|
55
|
-
value = String(input.value);
|
|
56
|
-
} else if (input.type === TemplateInputType.RETRIEVER) {
|
|
57
|
-
value = await getContext({ space });
|
|
58
|
-
} else if (input.type === TemplateInputType.PASS_THROUGH) {
|
|
59
|
-
value = message.text;
|
|
60
|
-
}
|
|
61
|
-
if (value) {
|
|
62
|
-
prompt = prompt.replaceAll(`{${input.name}}`, value);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
const answer = await ai.run('@cf/meta/llama-3.1-8b-instruct', {
|
|
67
|
-
stream: false,
|
|
68
|
-
prompt,
|
|
69
|
-
});
|
|
70
|
-
const response = { response: answer.response, prompt, message };
|
|
71
|
-
const textWithAnswer = message.text + '\n--------\n\n' + answer.response;
|
|
72
|
-
await space.crud.update({ id: messageId }, { text: textWithAnswer });
|
|
73
|
-
|
|
74
|
-
return new Response(JSON.stringify(response));
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
const getContext = async ({ space }: any) => {
|
|
78
|
-
let context = '';
|
|
79
|
-
const { objects: docs } = await space.crud.query({ __typename: 'dxos.org/type/Document' }).run();
|
|
80
|
-
for (const doc of docs) {
|
|
81
|
-
const { content } = await space.crud.query({ id: doc.content }).first();
|
|
82
|
-
context += content + '\n\n';
|
|
83
|
-
}
|
|
84
|
-
return context;
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
enum TemplateInputType {
|
|
88
|
-
VALUE = 0,
|
|
89
|
-
PASS_THROUGH = 1,
|
|
90
|
-
RETRIEVER = 2,
|
|
91
|
-
FUNCTION = 3,
|
|
92
|
-
QUERY = 4,
|
|
93
|
-
RESOLVER = 5,
|
|
94
|
-
CONTEXT = 6,
|
|
95
|
-
SCHEMA = 7,
|
|
96
|
-
}
|
package/src/types/actions.ts
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2023 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import * as Schema from 'effect/Schema';
|
|
6
|
-
|
|
7
|
-
import { Database } from '@dxos/echo';
|
|
8
|
-
import { Script } from '@dxos/functions';
|
|
9
|
-
import { Operation } from '@dxos/operation';
|
|
10
|
-
|
|
11
|
-
import { meta } from '../meta';
|
|
12
|
-
import { templates } from '../templates';
|
|
13
|
-
|
|
14
|
-
const SCRIPT_OPERATION = `${meta.id}/operation`;
|
|
15
|
-
|
|
16
|
-
export namespace ScriptOperation {
|
|
17
|
-
export const ScriptProps = Schema.Struct({
|
|
18
|
-
name: Schema.optional(Schema.String),
|
|
19
|
-
// TODO(wittjosiah): Placeholder annotation?
|
|
20
|
-
gistUrl: Schema.optional(Schema.String.annotations({ title: 'Import from Gist (url)' })),
|
|
21
|
-
initialTemplateId: Schema.Literal(...templates.map(({ id }) => id)).pipe(
|
|
22
|
-
Schema.annotations({ title: 'Template' }),
|
|
23
|
-
Schema.optional,
|
|
24
|
-
),
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
export const NotebookProps = Schema.Struct({
|
|
28
|
-
name: Schema.optional(Schema.String),
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
export const CreateScript = Operation.make({
|
|
32
|
-
meta: { key: `${SCRIPT_OPERATION}/create-script`, name: 'Create Script' },
|
|
33
|
-
schema: {
|
|
34
|
-
input: Schema.extend(
|
|
35
|
-
ScriptProps,
|
|
36
|
-
Schema.Struct({
|
|
37
|
-
db: Database.Database,
|
|
38
|
-
}),
|
|
39
|
-
),
|
|
40
|
-
output: Schema.Struct({
|
|
41
|
-
object: Script.Script,
|
|
42
|
-
}),
|
|
43
|
-
},
|
|
44
|
-
});
|
|
45
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { type Atom } from '@effect-atom/atom-react';
|
|
6
|
-
|
|
7
|
-
import { Capability } from '@dxos/app-framework';
|
|
8
|
-
|
|
9
|
-
import { type Compiler } from '../compiler';
|
|
10
|
-
import { meta } from '../meta';
|
|
11
|
-
|
|
12
|
-
import { type ScriptSettings } from './types';
|
|
13
|
-
|
|
14
|
-
export namespace ScriptCapabilities {
|
|
15
|
-
export const Settings = Capability.make<Atom.Writable<ScriptSettings>>(`${meta.id}/capability/settings`);
|
|
16
|
-
export const Compiler = Capability.make<Compiler>(`${meta.id}/capability/compiler`);
|
|
17
|
-
}
|
package/src/types/events.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { ActivationEvent } from '@dxos/app-framework';
|
|
6
|
-
|
|
7
|
-
import { meta } from '../meta';
|
|
8
|
-
|
|
9
|
-
export namespace ScriptEvents {
|
|
10
|
-
export const SetupCompiler = ActivationEvent.make(`${meta.id}/event/setup-compiler`);
|
|
11
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/types/src/capabilities/{react-surface/react-surface.d.ts → react-surface.d.ts}
RENAMED
|
File without changes
|