@dxos/plugin-script 0.8.4-main.406dc2a → 0.8.4-main.4a85c3132b
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-IIOXAS47.mjs +138 -0
- package/dist/lib/browser/DeploymentDialog-IIOXAS47.mjs.map +7 -0
- package/dist/lib/browser/{NotebookContainer-LVGRPFY3.mjs → NotebookContainer-VVZOKGRC.mjs} +367 -200
- package/dist/lib/browser/NotebookContainer-VVZOKGRC.mjs.map +7 -0
- package/dist/lib/browser/ScriptContainer-A5SSIUH6.mjs +93 -0
- package/dist/lib/browser/ScriptContainer-A5SSIUH6.mjs.map +7 -0
- package/dist/lib/browser/ScriptObjectSettings-HYYC7KXC.mjs +294 -0
- package/dist/lib/browser/ScriptObjectSettings-HYYC7KXC.mjs.map +7 -0
- package/dist/lib/browser/ScriptPluginSettings-UTWA7CBT.mjs +55 -0
- package/dist/lib/browser/ScriptPluginSettings-UTWA7CBT.mjs.map +7 -0
- package/dist/lib/browser/ScriptProperties-HREPUE65.mjs +28 -0
- package/dist/lib/browser/ScriptProperties-HREPUE65.mjs.map +7 -0
- package/dist/lib/browser/TestContainer-D4Y2K2TT.mjs +39 -0
- package/dist/lib/browser/TestContainer-D4Y2K2TT.mjs.map +7 -0
- package/dist/lib/browser/app-graph-builder-66ZDI72K.mjs +69 -0
- package/dist/lib/browser/app-graph-builder-66ZDI72K.mjs.map +7 -0
- package/dist/lib/browser/blueprint-definition-YMZEJBAZ.mjs +17 -0
- package/dist/lib/browser/blueprint-definition-YMZEJBAZ.mjs.map +7 -0
- package/dist/lib/browser/blueprints/index.mjs +8 -0
- package/dist/lib/browser/chunk-6IXFDTAI.mjs +113 -0
- package/dist/lib/browser/chunk-6IXFDTAI.mjs.map +7 -0
- package/dist/lib/browser/chunk-ATTZUDT7.mjs +67 -0
- package/dist/lib/browser/chunk-ATTZUDT7.mjs.map +7 -0
- package/dist/lib/browser/chunk-G3XIOLLI.mjs +174 -0
- package/dist/lib/browser/chunk-G3XIOLLI.mjs.map +7 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/browser/{chunk-ST3ACVUC.mjs → chunk-J7PGML5B.mjs} +29 -12
- package/dist/lib/browser/chunk-J7PGML5B.mjs.map +7 -0
- package/dist/lib/browser/chunk-MUEVLYXJ.mjs +397 -0
- package/dist/lib/browser/chunk-MUEVLYXJ.mjs.map +7 -0
- package/dist/lib/browser/chunk-PLDBKKYO.mjs +789 -0
- package/dist/lib/browser/chunk-PLDBKKYO.mjs.map +7 -0
- package/dist/lib/browser/chunk-Q66L5EUR.mjs +20 -0
- package/dist/lib/browser/chunk-Q66L5EUR.mjs.map +7 -0
- package/dist/lib/browser/chunk-TW27W3EL.mjs +29 -0
- package/dist/lib/browser/chunk-TW27W3EL.mjs.map +7 -0
- package/dist/lib/browser/{chunk-EZVXV6DA.mjs → chunk-WYR4QHPE.mjs} +7 -2
- package/dist/lib/browser/chunk-WYR4QHPE.mjs.map +7 -0
- package/dist/lib/browser/chunk-ZYU2LP6U.mjs +11 -0
- package/dist/lib/browser/chunk-ZYU2LP6U.mjs.map +7 -0
- package/dist/lib/browser/compiler-53G6ZHQM.mjs +99 -0
- package/dist/lib/browser/compiler-53G6ZHQM.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +111 -140
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/operation-resolver-CYEISDDK.mjs +79 -0
- package/dist/lib/browser/operation-resolver-CYEISDDK.mjs.map +7 -0
- package/dist/lib/browser/react-surface-26P6HAFD.mjs +141 -0
- package/dist/lib/browser/react-surface-26P6HAFD.mjs.map +7 -0
- package/dist/lib/browser/settings-76UM7442.mjs +36 -0
- package/dist/lib/browser/settings-76UM7442.mjs.map +7 -0
- package/dist/lib/browser/templates/index.mjs +2 -1
- package/dist/lib/browser/types/index.mjs +12 -7
- package/dist/lib/node-esm/DeploymentDialog-ZHPHEV2H.mjs +139 -0
- package/dist/lib/node-esm/DeploymentDialog-ZHPHEV2H.mjs.map +7 -0
- package/dist/lib/node-esm/{NotebookContainer-QY5NJGJI.mjs → NotebookContainer-ZLWTNMQA.mjs} +367 -200
- package/dist/lib/node-esm/NotebookContainer-ZLWTNMQA.mjs.map +7 -0
- package/dist/lib/node-esm/ScriptContainer-S4UKQAWP.mjs +94 -0
- package/dist/lib/node-esm/ScriptContainer-S4UKQAWP.mjs.map +7 -0
- package/dist/lib/node-esm/ScriptObjectSettings-C5QBRERY.mjs +295 -0
- package/dist/lib/node-esm/ScriptObjectSettings-C5QBRERY.mjs.map +7 -0
- package/dist/lib/node-esm/ScriptPluginSettings-MFACDW4R.mjs +56 -0
- package/dist/lib/node-esm/ScriptPluginSettings-MFACDW4R.mjs.map +7 -0
- package/dist/lib/node-esm/ScriptProperties-FMNIX3KU.mjs +29 -0
- package/dist/lib/node-esm/ScriptProperties-FMNIX3KU.mjs.map +7 -0
- package/dist/lib/node-esm/TestContainer-AO45YPGV.mjs +40 -0
- package/dist/lib/node-esm/TestContainer-AO45YPGV.mjs.map +7 -0
- package/dist/lib/node-esm/app-graph-builder-IGAZTJ45.mjs +70 -0
- package/dist/lib/node-esm/app-graph-builder-IGAZTJ45.mjs.map +7 -0
- package/dist/lib/node-esm/blueprint-definition-5MGY6BRQ.mjs +18 -0
- package/dist/lib/node-esm/blueprint-definition-5MGY6BRQ.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-5BG7OJGQ.mjs +176 -0
- package/dist/lib/node-esm/chunk-5BG7OJGQ.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-OG2SIKHE.mjs → chunk-5HSJPAK7.mjs} +7 -2
- package/dist/lib/node-esm/chunk-5HSJPAK7.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-H46R2RS5.mjs +790 -0
- package/dist/lib/node-esm/chunk-H46R2RS5.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-JGN7TDJH.mjs +69 -0
- package/dist/lib/node-esm/chunk-JGN7TDJH.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-2GVTWESW.mjs → chunk-QG6ANK4B.mjs} +29 -12
- package/dist/lib/node-esm/chunk-QG6ANK4B.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-S7DSCLOW.mjs +31 -0
- package/dist/lib/node-esm/chunk-S7DSCLOW.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-TZ2EBTPQ.mjs +22 -0
- package/dist/lib/node-esm/chunk-TZ2EBTPQ.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-UFBVE33O.mjs +12 -0
- package/dist/lib/node-esm/chunk-UFBVE33O.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-WWD5LUU6.mjs +114 -0
- package/dist/lib/node-esm/chunk-WWD5LUU6.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-ZDJ2FI7E.mjs +398 -0
- package/dist/lib/node-esm/chunk-ZDJ2FI7E.mjs.map +7 -0
- package/dist/lib/node-esm/compiler-HHQW7EP3.mjs +100 -0
- package/dist/lib/node-esm/compiler-HHQW7EP3.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +111 -140
- 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-resolver-HFFDXWND.mjs +80 -0
- package/dist/lib/node-esm/operation-resolver-HFFDXWND.mjs.map +7 -0
- package/dist/lib/node-esm/react-surface-THCIK266.mjs +142 -0
- package/dist/lib/node-esm/react-surface-THCIK266.mjs.map +7 -0
- package/dist/lib/node-esm/settings-CCHDPLFJ.mjs +37 -0
- package/dist/lib/node-esm/settings-CCHDPLFJ.mjs.map +7 -0
- package/dist/lib/node-esm/templates/index.mjs +2 -1
- package/dist/lib/node-esm/types/index.mjs +12 -7
- 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-resolver/index.d.ts +3 -0
- package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +5 -0
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.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 +1 -1
- package/dist/types/src/components/FrameContainer/FrameContainer.d.ts.map +1 -1
- package/dist/types/src/components/NotebookStack/NotebookCell.d.ts +4 -3
- package/dist/types/src/components/NotebookStack/NotebookCell.d.ts.map +1 -1
- package/dist/types/src/components/NotebookStack/NotebookStack.d.ts +1 -1
- package/dist/types/src/components/NotebookStack/NotebookStack.d.ts.map +1 -1
- package/dist/types/src/components/NotebookStack/NotebookStack.stories.d.ts +5 -4
- 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 +8 -8
- package/dist/types/src/components/ScriptToolbar/ScriptToolbar.d.ts.map +1 -1
- package/dist/types/src/components/ScriptToolbar/ScriptToolbar.stories.d.ts +5 -4
- package/dist/types/src/components/ScriptToolbar/ScriptToolbar.stories.d.ts.map +1 -1
- 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 +3 -2
- package/dist/types/src/components/TypescriptEditor/TypescriptEditor.d.ts.map +1 -1
- package/dist/types/src/components/TypescriptEditor/TypescriptEditor.stories.d.ts +1 -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 +2 -4
- package/dist/types/src/containers/DeploymentDialog/DeploymentDialog.d.ts.map +1 -0
- package/dist/types/src/{components/NotebookContainer.stories.d.ts → containers/DeploymentDialog/DeploymentDialog.stories.d.ts} +7 -6
- 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/containers/ScriptObjectSettings/ScriptObjectSettings.d.ts +7 -0
- 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/containers/TestContainer/TestContainer.d.ts +8 -0
- package/dist/types/src/containers/TestContainer/TestContainer.d.ts.map +1 -0
- package/dist/types/src/containers/TestContainer/index.d.ts +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 +17 -31
- package/dist/types/src/hooks/deploy.d.ts.map +1 -1
- package/dist/types/src/hooks/format.d.ts +5 -4
- package/dist/types/src/hooks/format.d.ts.map +1 -1
- package/dist/types/src/hooks/index.d.ts +1 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/template.d.ts +7 -16
- package/dist/types/src/hooks/template.d.ts.map +1 -1
- package/dist/types/src/hooks/useCompiler.d.ts +7 -0
- package/dist/types/src/hooks/useCompiler.d.ts.map +1 -0
- package/dist/types/src/hooks/useCreateAndDeployScriptTemplates.d.ts.map +1 -1
- package/dist/types/src/hooks/useToolbarState.d.ts +8 -1
- package/dist/types/src/hooks/useToolbarState.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +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 +58 -0
- package/dist/types/src/notebook/compute-graph.d.ts.map +1 -0
- package/dist/types/src/notebook/compute-graph.test.d.ts +2 -0
- package/dist/types/src/notebook/compute-graph.test.d.ts.map +1 -0
- package/dist/types/src/notebook/eval.d.ts +1 -1
- package/dist/types/src/notebook/eval.d.ts.map +1 -1
- package/dist/types/src/notebook/index.d.ts +1 -1
- package/dist/types/src/notebook/index.d.ts.map +1 -1
- package/dist/types/src/templates/anthropic.d.ts +8 -0
- package/dist/types/src/templates/anthropic.d.ts.map +1 -0
- package/dist/types/src/templates/chess-bot.d.ts +16 -0
- package/dist/types/src/templates/chess-bot.d.ts.map +1 -0
- package/dist/types/src/templates/commentary.d.ts +16 -0
- package/dist/types/src/templates/commentary.d.ts.map +1 -0
- package/dist/types/src/templates/forex-effect.d.ts +4 -1
- package/dist/types/src/templates/forex-effect.d.ts.map +1 -1
- package/dist/types/src/templates/forex.d.ts +4 -1
- package/dist/types/src/templates/forex.d.ts.map +1 -1
- package/dist/types/src/templates/index.d.ts +12 -3
- package/dist/types/src/templates/index.d.ts.map +1 -1
- package/dist/types/src/templates/ping.d.ts +1 -4
- package/dist/types/src/templates/ping.d.ts.map +1 -1
- package/dist/types/src/testing/data.d.ts +2 -18
- package/dist/types/src/testing/data.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 +4 -3
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Notebook.d.ts +108 -0
- package/dist/types/src/types/Notebook.d.ts.map +1 -0
- package/dist/types/src/types/actions.d.ts +30 -56
- package/dist/types/src/types/actions.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 +4 -1
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +6 -0
- package/dist/types/src/types/types.d.ts.map +1 -0
- package/dist/types/src/util/deploy.d.ts +4 -4
- package/dist/types/src/util/deploy.d.ts.map +1 -1
- package/dist/types/src/util/functions.d.ts +3 -3
- package/dist/types/src/util/functions.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +114 -82
- package/src/ScriptPlugin.tsx +45 -87
- package/src/blueprints/index.ts +5 -0
- package/src/blueprints/script-blueprint.ts +31 -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 -95
- 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-resolver/index.ts +7 -0
- package/src/capabilities/operation-resolver/operation-resolver.ts +75 -0
- package/src/capabilities/react-surface/index.ts +7 -0
- package/src/capabilities/react-surface/react-surface.tsx +121 -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 +6 -5
- package/src/components/FrameContainer/frame.html +21 -21
- package/src/components/NotebookStack/NotebookCell.tsx +85 -87
- package/src/components/NotebookStack/NotebookStack.stories.tsx +32 -10
- package/src/components/NotebookStack/NotebookStack.tsx +16 -9
- package/src/components/QueryEditor/QueryEditor.stories.tsx +102 -0
- package/src/components/QueryEditor/QueryEditor.tsx +47 -0
- package/src/components/QueryEditor/index.ts +5 -0
- package/src/components/ScriptToolbar/ScriptToolbar.stories.tsx +42 -20
- package/src/components/ScriptToolbar/ScriptToolbar.tsx +28 -31
- package/src/components/TestPanel/TestPanel.tsx +61 -36
- package/src/components/TestPanel/index.ts +0 -1
- package/src/components/TypescriptEditor/TypescriptEditor.stories.tsx +25 -18
- package/src/components/TypescriptEditor/TypescriptEditor.tsx +70 -74
- package/src/components/index.ts +4 -9
- package/src/constants.ts +7 -0
- package/src/containers/DeploymentDialog/DeploymentDialog.stories.tsx +61 -0
- package/src/containers/DeploymentDialog/DeploymentDialog.tsx +99 -0
- package/src/containers/DeploymentDialog/index.ts +7 -0
- package/src/containers/NotebookContainer/NotebookContainer.stories.tsx +87 -0
- package/src/containers/NotebookContainer/NotebookContainer.tsx +268 -0
- package/src/containers/NotebookContainer/index.ts +7 -0
- package/src/containers/ScriptContainer/ScriptContainer.tsx +84 -0
- package/src/containers/ScriptContainer/index.ts +7 -0
- package/src/{components/Settings → containers/ScriptObjectSettings}/ScriptObjectSettings.tsx +55 -50
- 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 +28 -0
- package/src/containers/TestContainer/index.ts +7 -0
- package/src/containers/index.ts +13 -0
- package/src/e2e/ai.test.ts +92 -0
- package/src/e2e/deploy.test.ts +64 -0
- package/src/hooks/deploy.ts +43 -35
- package/src/hooks/format.ts +8 -3
- package/src/hooks/index.ts +1 -0
- package/src/hooks/template.ts +22 -26
- package/src/hooks/useCompiler.ts +24 -0
- package/src/hooks/useCreateAndDeployScriptTemplates.ts +14 -16
- package/src/hooks/useToolbarState.ts +29 -4
- package/src/index.ts +2 -1
- package/src/meta.ts +8 -4
- package/src/notebook/{notebook.test.ts → compute-graph.test.ts} +31 -19
- package/src/notebook/{notebook.ts → compute-graph.ts} +65 -18
- package/src/notebook/eval.ts +1 -1
- package/src/notebook/index.ts +1 -1
- package/src/templates/anthropic.ts +42 -0
- package/src/templates/chess-bot.ts +58 -0
- package/src/templates/commentary.ts +231 -0
- package/src/templates/data-generator.ts +1 -1
- package/src/templates/forex-effect.ts +22 -27
- package/src/templates/forex.ts +7 -6
- package/src/templates/gmail.ts +1 -2
- package/src/templates/index.ts +18 -5
- package/src/templates/ping.ts +14 -5
- package/src/testing/data.ts +34 -9
- package/src/testing/simulator.test.ts +40 -0
- package/src/translations.ts +4 -3
- package/src/types/Notebook.ts +41 -0
- package/src/types/actions.ts +18 -26
- package/src/types/capabilities.ts +17 -0
- package/src/types/events.ts +11 -0
- package/src/types/index.ts +4 -1
- package/src/types/types.ts +15 -0
- package/src/util/deploy.ts +30 -40
- package/src/util/functions.ts +32 -28
- package/src/vite-env.d.ts +2 -0
- package/dist/lib/browser/DeploymentDialog-65TWT6S5.mjs +0 -13
- package/dist/lib/browser/NotebookContainer-LVGRPFY3.mjs.map +0 -7
- package/dist/lib/browser/ScriptContainer-LRTRN7JW.mjs +0 -149
- package/dist/lib/browser/ScriptContainer-LRTRN7JW.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-DPYULSME.mjs +0 -65
- package/dist/lib/browser/app-graph-builder-DPYULSME.mjs.map +0 -7
- package/dist/lib/browser/blueprint-definition-ET5KZ46I.mjs +0 -28
- package/dist/lib/browser/blueprint-definition-ET5KZ46I.mjs.map +0 -7
- package/dist/lib/browser/chunk-5CYLWXRH.mjs +0 -89
- package/dist/lib/browser/chunk-5CYLWXRH.mjs.map +0 -7
- package/dist/lib/browser/chunk-75LH4EUR.mjs +0 -326
- package/dist/lib/browser/chunk-75LH4EUR.mjs.map +0 -7
- package/dist/lib/browser/chunk-E7DXDICD.mjs +0 -282
- package/dist/lib/browser/chunk-E7DXDICD.mjs.map +0 -7
- package/dist/lib/browser/chunk-EZVXV6DA.mjs.map +0 -7
- package/dist/lib/browser/chunk-I3QSGUFJ.mjs +0 -646
- package/dist/lib/browser/chunk-I3QSGUFJ.mjs.map +0 -7
- package/dist/lib/browser/chunk-JO2O7W6J.mjs +0 -254
- package/dist/lib/browser/chunk-JO2O7W6J.mjs.map +0 -7
- package/dist/lib/browser/chunk-N6M34EUC.mjs +0 -112
- package/dist/lib/browser/chunk-N6M34EUC.mjs.map +0 -7
- package/dist/lib/browser/chunk-NM4WQS4F.mjs +0 -153
- package/dist/lib/browser/chunk-NM4WQS4F.mjs.map +0 -7
- package/dist/lib/browser/chunk-OKXN2N7M.mjs +0 -15
- package/dist/lib/browser/chunk-OKXN2N7M.mjs.map +0 -7
- package/dist/lib/browser/chunk-ST3ACVUC.mjs.map +0 -7
- package/dist/lib/browser/compiler-G2N2CG63.mjs +0 -98
- package/dist/lib/browser/compiler-G2N2CG63.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-JLU7DVLQ.mjs +0 -105
- package/dist/lib/browser/intent-resolver-JLU7DVLQ.mjs.map +0 -7
- package/dist/lib/browser/react-surface-76SDTUYG.mjs +0 -127
- package/dist/lib/browser/react-surface-76SDTUYG.mjs.map +0 -7
- package/dist/lib/browser/settings-ERFKVNUK.mjs +0 -25
- package/dist/lib/browser/settings-ERFKVNUK.mjs.map +0 -7
- package/dist/lib/node-esm/DeploymentDialog-I63ZC2HH.mjs +0 -14
- package/dist/lib/node-esm/NotebookContainer-QY5NJGJI.mjs.map +0 -7
- package/dist/lib/node-esm/ScriptContainer-SVXCSLNH.mjs +0 -150
- package/dist/lib/node-esm/ScriptContainer-SVXCSLNH.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-UXJGHXSL.mjs +0 -66
- package/dist/lib/node-esm/app-graph-builder-UXJGHXSL.mjs.map +0 -7
- package/dist/lib/node-esm/blueprint-definition-AIYFOT7Q.mjs +0 -30
- package/dist/lib/node-esm/blueprint-definition-AIYFOT7Q.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-2GVTWESW.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-4X375PGY.mjs +0 -90
- package/dist/lib/node-esm/chunk-4X375PGY.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-67OVZHI3.mjs +0 -327
- package/dist/lib/node-esm/chunk-67OVZHI3.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-C2ORIPKH.mjs +0 -154
- package/dist/lib/node-esm/chunk-C2ORIPKH.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-NUXZQQ6P.mjs +0 -16
- package/dist/lib/node-esm/chunk-NUXZQQ6P.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-OG2SIKHE.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-SMFPSKQT.mjs +0 -647
- package/dist/lib/node-esm/chunk-SMFPSKQT.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-VRSDE4CI.mjs +0 -114
- package/dist/lib/node-esm/chunk-VRSDE4CI.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-VZAFGLD7.mjs +0 -283
- package/dist/lib/node-esm/chunk-VZAFGLD7.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-YW36TZ7K.mjs +0 -255
- package/dist/lib/node-esm/chunk-YW36TZ7K.mjs.map +0 -7
- package/dist/lib/node-esm/compiler-PLDAZ5GJ.mjs +0 -99
- package/dist/lib/node-esm/compiler-PLDAZ5GJ.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-SFGTIFOG.mjs +0 -106
- package/dist/lib/node-esm/intent-resolver-SFGTIFOG.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-SHEBNW4R.mjs +0 -128
- package/dist/lib/node-esm/react-surface-SHEBNW4R.mjs.map +0 -7
- package/dist/lib/node-esm/settings-5TYXQ42N.mjs +0 -26
- package/dist/lib/node-esm/settings-5TYXQ42N.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 +0 -251
- 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/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.map +0 -1
- package/dist/types/src/components/ScriptContainer.d.ts +0 -12
- package/dist/types/src/components/ScriptContainer.d.ts.map +0 -1
- package/dist/types/src/components/Settings/ScriptObjectSettings.d.ts +0 -8
- package/dist/types/src/components/Settings/ScriptObjectSettings.d.ts.map +0 -1
- package/dist/types/src/components/Settings/ScriptPluginSettings.d.ts +0 -6
- package/dist/types/src/components/Settings/ScriptPluginSettings.d.ts.map +0 -1
- package/dist/types/src/components/Settings/index.d.ts +0 -3
- package/dist/types/src/components/Settings/index.d.ts.map +0 -1
- package/dist/types/src/components/TestPanel/TestContainer.d.ts +0 -8
- package/dist/types/src/components/TestPanel/TestContainer.d.ts.map +0 -1
- package/dist/types/src/events.d.ts +0 -4
- package/dist/types/src/events.d.ts.map +0 -1
- package/dist/types/src/notebook/notebook.d.ts +0 -35
- package/dist/types/src/notebook/notebook.d.ts.map +0 -1
- package/dist/types/src/notebook/notebook.test.d.ts +0 -2
- package/dist/types/src/notebook/notebook.test.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/schema.d.ts +0 -61
- package/dist/types/src/types/schema.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 -87
- package/src/capabilities/react-surface.tsx +0 -102
- package/src/capabilities/settings.ts +0 -21
- package/src/components/DeploymentDialog/DeploymentDialog.stories.tsx +0 -53
- package/src/components/DeploymentDialog/DeploymentDialog.tsx +0 -106
- package/src/components/DeploymentDialog/index.ts +0 -9
- package/src/components/NotebookContainer.stories.tsx +0 -32
- package/src/components/NotebookContainer.tsx +0 -124
- package/src/components/ScriptContainer.tsx +0 -69
- 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/schema.ts +0 -48
- /package/dist/lib/browser/{DeploymentDialog-65TWT6S5.mjs.map → blueprints/index.mjs.map} +0 -0
- /package/dist/lib/{node-esm/DeploymentDialog-I63ZC2HH.mjs.map → browser/chunk-J5LGTIGS.mjs.map} +0 -0
package/src/templates/ping.ts
CHANGED
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
//
|
|
2
|
-
// Copyright
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
import * as Schema from 'effect/Schema';
|
|
6
|
+
|
|
7
|
+
import { defineFunction } from '@dxos/functions';
|
|
8
|
+
|
|
9
|
+
export default defineFunction({
|
|
10
|
+
key: 'dxos.org/script/ping',
|
|
11
|
+
name: 'Ping',
|
|
12
|
+
inputSchema: Schema.Any,
|
|
13
|
+
|
|
14
|
+
handler: async ({ data }) => {
|
|
15
|
+
return data;
|
|
16
|
+
},
|
|
17
|
+
});
|
package/src/testing/data.ts
CHANGED
|
@@ -2,46 +2,71 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import { Prompt } from '@dxos/blueprints';
|
|
5
6
|
import { Ref } from '@dxos/echo';
|
|
6
7
|
import { createObject } from '@dxos/echo-db';
|
|
7
8
|
import { PublicKey } from '@dxos/keys';
|
|
8
|
-
import {
|
|
9
|
+
import { Markdown } from '@dxos/plugin-markdown/types';
|
|
10
|
+
import { Text } from '@dxos/schema';
|
|
9
11
|
|
|
10
12
|
import { Notebook } from '../types';
|
|
11
13
|
|
|
12
|
-
// NOTE: createObject
|
|
13
|
-
|
|
14
|
+
// TODO(burdon): NOTE: createObject is required for tests.
|
|
15
|
+
|
|
16
|
+
export const createNotebook = (): Notebook.Notebook =>
|
|
14
17
|
Notebook.make({
|
|
15
18
|
cells: [
|
|
16
19
|
{
|
|
17
20
|
id: PublicKey.random().toString(),
|
|
18
21
|
type: 'script',
|
|
19
|
-
|
|
22
|
+
source: Ref.make(createObject(Text.make('c = a() + b'))),
|
|
20
23
|
},
|
|
21
24
|
{
|
|
22
25
|
id: PublicKey.random().toString(),
|
|
23
26
|
type: 'script',
|
|
24
|
-
|
|
27
|
+
source: Ref.make(createObject(Text.make('a = () => 100'))),
|
|
25
28
|
},
|
|
26
29
|
{
|
|
27
30
|
id: PublicKey.random().toString(),
|
|
28
31
|
type: 'script',
|
|
29
|
-
|
|
32
|
+
source: Ref.make(createObject(Text.make('b = 200'))),
|
|
30
33
|
},
|
|
31
34
|
{
|
|
32
35
|
id: PublicKey.random().toString(),
|
|
33
36
|
type: 'script',
|
|
34
|
-
|
|
37
|
+
source: Ref.make(createObject(Text.make('d = a() * 2'))),
|
|
35
38
|
},
|
|
36
39
|
{
|
|
37
40
|
id: PublicKey.random().toString(),
|
|
38
41
|
type: 'script',
|
|
39
|
-
|
|
42
|
+
source: Ref.make(createObject(Text.make('c + d'))),
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
id: PublicKey.random().toString(),
|
|
46
|
+
type: 'prompt',
|
|
47
|
+
prompt: Ref.make(
|
|
48
|
+
createObject(
|
|
49
|
+
Prompt.make({
|
|
50
|
+
instructions: 'Very briefly, what colors are associated with the numbers {{a}} and {{b}}.',
|
|
51
|
+
}),
|
|
52
|
+
),
|
|
53
|
+
),
|
|
40
54
|
},
|
|
41
55
|
{
|
|
42
56
|
id: PublicKey.random().toString(),
|
|
43
57
|
type: 'query',
|
|
44
|
-
|
|
58
|
+
source: Ref.make(createObject(Text.make(`docs = (type: ${Markdown.Document.typename})`))),
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
id: PublicKey.random().toString(),
|
|
62
|
+
type: 'prompt',
|
|
63
|
+
prompt: Ref.make(
|
|
64
|
+
createObject(
|
|
65
|
+
Prompt.make({
|
|
66
|
+
instructions: 'Very briefly, summarize the documents: {{docs}}',
|
|
67
|
+
}),
|
|
68
|
+
),
|
|
69
|
+
),
|
|
45
70
|
},
|
|
46
71
|
],
|
|
47
72
|
});
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { readFile } from 'node:fs/promises';
|
|
6
|
+
|
|
7
|
+
import * as Record from 'effect/Record';
|
|
8
|
+
import { describe, expect, test } from 'vitest';
|
|
9
|
+
|
|
10
|
+
import { bundleFunction } from '@dxos/functions-runtime/bundler';
|
|
11
|
+
import { FunctionWorker } from '@dxos/functions-simulator-cloudflare';
|
|
12
|
+
import { ErrorCodec } from '@dxos/protocols';
|
|
13
|
+
|
|
14
|
+
// Requires downloading assets from R2
|
|
15
|
+
describe.runIf(process.env.DX_TEST_TAGS?.includes('functions-e2e'))('Run script in sumulator', () => {
|
|
16
|
+
test('forex-effect', { timeout: 120_000 }, async () => {
|
|
17
|
+
const source = await readFile(new URL('../templates/forex-effect.ts', import.meta.url), 'utf-8');
|
|
18
|
+
|
|
19
|
+
// Bundle and upload.
|
|
20
|
+
const buildResult = await bundleFunction({ source });
|
|
21
|
+
if ('error' in buildResult) {
|
|
22
|
+
throw buildResult.error ?? new Error('Bundle creation failed');
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const worker = new FunctionWorker({
|
|
26
|
+
mainModule: buildResult.entryPoint,
|
|
27
|
+
modules: Record.map(buildResult.assets, (contents, filename) => ({
|
|
28
|
+
contents: contents as Uint8Array<ArrayBuffer>,
|
|
29
|
+
contentType: filename.endsWith('.wasm') ? 'application/wasm' : 'application/javascript',
|
|
30
|
+
})),
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
const result = await worker.invoke({ from: 'USD', to: 'EUR' });
|
|
34
|
+
console.log(result);
|
|
35
|
+
if (result._kind === 'error') {
|
|
36
|
+
throw ErrorCodec.decode(result.error);
|
|
37
|
+
}
|
|
38
|
+
expect(Number(result.result)).toBeGreaterThan(0);
|
|
39
|
+
});
|
|
40
|
+
});
|
package/src/translations.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Script } from '@dxos/functions';
|
|
6
6
|
import { type Resource } from '@dxos/react-ui';
|
|
7
7
|
|
|
8
8
|
import { meta } from './meta';
|
|
@@ -11,7 +11,7 @@ import { Notebook } from './types';
|
|
|
11
11
|
export const translations = [
|
|
12
12
|
{
|
|
13
13
|
'en-US': {
|
|
14
|
-
[
|
|
14
|
+
[Script.Script.typename]: {
|
|
15
15
|
'typename label': 'Script',
|
|
16
16
|
'typename label_zero': 'Scripts',
|
|
17
17
|
'typename label_one': 'Script',
|
|
@@ -19,6 +19,7 @@ export const translations = [
|
|
|
19
19
|
'object name placeholder': 'New script',
|
|
20
20
|
'rename object label': 'Rename script',
|
|
21
21
|
'delete object label': 'Delete script',
|
|
22
|
+
'object deleted label': 'Script deleted',
|
|
22
23
|
},
|
|
23
24
|
[Notebook.Notebook.typename]: {
|
|
24
25
|
'typename label': 'Notebook',
|
|
@@ -28,6 +29,7 @@ export const translations = [
|
|
|
28
29
|
'object name placeholder': 'New notebook',
|
|
29
30
|
'rename object label': 'Rename notebook',
|
|
30
31
|
'delete object label': 'Delete notebook',
|
|
32
|
+
'object deleted label': 'Notebook deleted',
|
|
31
33
|
},
|
|
32
34
|
[meta.id]: {
|
|
33
35
|
'plugin name': 'Scripts',
|
|
@@ -66,7 +68,6 @@ export const translations = [
|
|
|
66
68
|
'settings editor input mode default label': 'Default',
|
|
67
69
|
'settings editor input mode vim label': 'Vim',
|
|
68
70
|
'settings editor input mode vscode label': 'VS Code',
|
|
69
|
-
'template select group label': 'Select template',
|
|
70
71
|
'function panel label': 'Debug Function',
|
|
71
72
|
'script test label': 'Test',
|
|
72
73
|
'script logs label': 'Logs',
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Schema from 'effect/Schema';
|
|
6
|
+
|
|
7
|
+
import { Prompt } from '@dxos/blueprints';
|
|
8
|
+
import { Obj, Ref, Type } from '@dxos/echo';
|
|
9
|
+
import { FormInputAnnotation } from '@dxos/echo/internal';
|
|
10
|
+
import { LabelAnnotation } from '@dxos/echo/internal';
|
|
11
|
+
import { Graph } from '@dxos/plugin-explorer/types';
|
|
12
|
+
import { Text } from '@dxos/schema';
|
|
13
|
+
|
|
14
|
+
export type CellType = 'markdown' | 'script' | 'query' | 'prompt' | 'view';
|
|
15
|
+
|
|
16
|
+
export const Cell = Schema.Struct({
|
|
17
|
+
id: Schema.String,
|
|
18
|
+
type: Schema.String,
|
|
19
|
+
name: Schema.optional(Schema.String),
|
|
20
|
+
// TODO(burdon): Union type.
|
|
21
|
+
source: Schema.optional(Ref.Ref(Text.Text)),
|
|
22
|
+
prompt: Schema.optional(Ref.Ref(Prompt.Prompt)),
|
|
23
|
+
graph: Schema.optional(Ref.Ref(Graph.Graph)),
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
export interface Cell extends Schema.Schema.Type<typeof Cell> {}
|
|
27
|
+
|
|
28
|
+
export const Notebook = Schema.Struct({
|
|
29
|
+
name: Schema.String.pipe(Schema.optional),
|
|
30
|
+
cells: Cell.pipe(Schema.Array, FormInputAnnotation.set(false)),
|
|
31
|
+
}).pipe(
|
|
32
|
+
Type.object({
|
|
33
|
+
typename: 'dxos.org/type/Notebook',
|
|
34
|
+
version: '0.1.0',
|
|
35
|
+
}),
|
|
36
|
+
LabelAnnotation.set(['name']),
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
export type Notebook = Schema.Schema.Type<typeof Notebook>;
|
|
40
|
+
|
|
41
|
+
export const make = (props: Obj.MakeProps<typeof Notebook> = { cells: [] }): Notebook => Obj.make(Notebook, props);
|
package/src/types/actions.ts
CHANGED
|
@@ -4,15 +4,16 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Schema from 'effect/Schema';
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { Database } from '@dxos/echo';
|
|
8
|
+
import { Script } from '@dxos/functions';
|
|
9
|
+
import { Operation } from '@dxos/operation';
|
|
9
10
|
|
|
10
11
|
import { meta } from '../meta';
|
|
11
12
|
import { templates } from '../templates';
|
|
12
13
|
|
|
13
|
-
|
|
14
|
+
const SCRIPT_OPERATION = `${meta.id}/operation`;
|
|
14
15
|
|
|
15
|
-
export namespace
|
|
16
|
+
export namespace ScriptOperation {
|
|
16
17
|
export const ScriptProps = Schema.Struct({
|
|
17
18
|
name: Schema.optional(Schema.String),
|
|
18
19
|
// TODO(wittjosiah): Placeholder annotation?
|
|
@@ -23,31 +24,22 @@ export namespace ScriptAction {
|
|
|
23
24
|
),
|
|
24
25
|
});
|
|
25
26
|
|
|
26
|
-
export class CreateScript extends Schema.TaggedClass<CreateScript>()(`${meta.id}/action/create-script`, {
|
|
27
|
-
input: Schema.extend(
|
|
28
|
-
ScriptProps,
|
|
29
|
-
Schema.Struct({
|
|
30
|
-
space: SpaceSchema,
|
|
31
|
-
}),
|
|
32
|
-
),
|
|
33
|
-
output: Schema.Struct({
|
|
34
|
-
object: ScriptType,
|
|
35
|
-
}),
|
|
36
|
-
}) {}
|
|
37
|
-
|
|
38
27
|
export const NotebookProps = Schema.Struct({
|
|
39
28
|
name: Schema.optional(Schema.String),
|
|
40
29
|
});
|
|
41
30
|
|
|
42
|
-
export
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
Schema.
|
|
46
|
-
|
|
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,
|
|
47
42
|
}),
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
object: Notebook.Notebook,
|
|
51
|
-
}),
|
|
52
|
-
}) {}
|
|
43
|
+
},
|
|
44
|
+
});
|
|
53
45
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
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
|
+
}
|
package/src/types/index.ts
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Schema from 'effect/Schema';
|
|
6
|
+
|
|
7
|
+
import { EditorInputMode } from '@dxos/ui-editor';
|
|
8
|
+
|
|
9
|
+
export const ScriptSettings = Schema.mutable(
|
|
10
|
+
Schema.Struct({
|
|
11
|
+
editorInputMode: EditorInputMode,
|
|
12
|
+
}),
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
export type ScriptSettings = Schema.Schema.Type<typeof ScriptSettings>;
|
package/src/util/deploy.ts
CHANGED
|
@@ -4,29 +4,23 @@
|
|
|
4
4
|
|
|
5
5
|
import { type Client } from '@dxos/client';
|
|
6
6
|
import { Obj, Ref } from '@dxos/echo';
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
getUserFunctionIdInMetadata,
|
|
11
|
-
setUserFunctionIdInMetadata,
|
|
12
|
-
} from '@dxos/functions';
|
|
13
|
-
import { Bundler } from '@dxos/functions/bundler';
|
|
14
|
-
import { incrementSemverPatch, uploadWorkerFunction } from '@dxos/functions/edge';
|
|
7
|
+
import { Function, type Script, getUserFunctionIdInMetadata } from '@dxos/functions';
|
|
8
|
+
import { bundleFunction } from '@dxos/functions-runtime/bundler';
|
|
9
|
+
import { FunctionsServiceClient, incrementSemverPatch } from '@dxos/functions-runtime/edge';
|
|
15
10
|
import { log } from '@dxos/log';
|
|
11
|
+
import { FunctionRuntimeKind } from '@dxos/protocols';
|
|
16
12
|
import { type Space } from '@dxos/react-client/echo';
|
|
17
13
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
export const isScriptDeployed = ({ script, fn }: { script: ScriptType; fn: any }): boolean => {
|
|
14
|
+
export const isScriptDeployed = ({ script, fn }: { script: Script.Script; fn: any }): boolean => {
|
|
21
15
|
const existingFunctionId = fn && getUserFunctionIdInMetadata(Obj.getMeta(fn));
|
|
22
16
|
return Boolean(existingFunctionId) && !script.changed;
|
|
23
17
|
};
|
|
24
18
|
|
|
25
19
|
type DeployScriptProps = {
|
|
26
|
-
script:
|
|
20
|
+
script: Script.Script;
|
|
27
21
|
client: Client;
|
|
28
22
|
space: Space;
|
|
29
|
-
fn?:
|
|
23
|
+
fn?: Function.Function;
|
|
30
24
|
existingFunctionId?: string;
|
|
31
25
|
};
|
|
32
26
|
|
|
@@ -48,32 +42,30 @@ export const deployScript = async ({
|
|
|
48
42
|
}
|
|
49
43
|
|
|
50
44
|
try {
|
|
51
|
-
const
|
|
52
|
-
|
|
45
|
+
const buildResult = await bundleFunction({
|
|
46
|
+
source: script.source!.target!.content,
|
|
47
|
+
});
|
|
53
48
|
if ('error' in buildResult) {
|
|
54
49
|
throw buildResult.error || new Error('Bundle creation failed');
|
|
55
50
|
}
|
|
56
51
|
|
|
57
|
-
const
|
|
58
|
-
|
|
52
|
+
const functionsServiceClient = FunctionsServiceClient.fromClient(client);
|
|
53
|
+
const newFunction = await functionsServiceClient.deploy({
|
|
54
|
+
// TODO(dmaretskyi): Space key or identity key.
|
|
59
55
|
ownerPublicKey: space.key,
|
|
60
56
|
version: fn ? incrementSemverPatch(fn.version) : '0.0.1',
|
|
61
57
|
functionId: existingFunctionId,
|
|
62
58
|
entryPoint: buildResult.entryPoint,
|
|
63
|
-
assets:
|
|
59
|
+
assets: buildResult.assets,
|
|
60
|
+
runtime: FunctionRuntimeKind.enums.WORKER_LOADER,
|
|
64
61
|
});
|
|
65
62
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
const storedFunction = createOrUpdateFunctionInSpace(space, fn, script, functionId, version);
|
|
71
|
-
script.changed = false;
|
|
72
|
-
updateFunctionMetadata(script, storedFunction, meta, functionId);
|
|
73
|
-
|
|
74
|
-
setUserFunctionIdInMetadata(Obj.getMeta(storedFunction), functionId);
|
|
63
|
+
const storedFunction = createOrUpdateFunctionInSpace(space, fn, script, newFunction);
|
|
64
|
+
Obj.change(script, (s) => {
|
|
65
|
+
s.changed = false;
|
|
66
|
+
});
|
|
75
67
|
|
|
76
|
-
return { success: true, functionId };
|
|
68
|
+
return { success: true, functionId: getUserFunctionIdInMetadata(Obj.getMeta(storedFunction)) };
|
|
77
69
|
} catch (err: any) {
|
|
78
70
|
log.catch(err);
|
|
79
71
|
return { success: false, error: err };
|
|
@@ -83,7 +75,7 @@ export const deployScript = async ({
|
|
|
83
75
|
/**
|
|
84
76
|
* Validate inputs for script deployment.
|
|
85
77
|
*/
|
|
86
|
-
const validateDeployInputs = (script:
|
|
78
|
+
const validateDeployInputs = (script: Script.Script, space: Space): Error | null => {
|
|
87
79
|
if (!script.source || !space) {
|
|
88
80
|
return new Error('Script source or space not available');
|
|
89
81
|
}
|
|
@@ -92,19 +84,17 @@ const validateDeployInputs = (script: ScriptType, space: Space): Error | null =>
|
|
|
92
84
|
|
|
93
85
|
const createOrUpdateFunctionInSpace = (
|
|
94
86
|
space: Space,
|
|
95
|
-
fn:
|
|
96
|
-
script:
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
): FunctionType => {
|
|
87
|
+
fn: Function.Function | undefined,
|
|
88
|
+
script: Script.Script,
|
|
89
|
+
newFunction: Function.Function,
|
|
90
|
+
): Function.Function => {
|
|
100
91
|
if (fn) {
|
|
101
|
-
fn
|
|
102
|
-
fn.version = version;
|
|
92
|
+
Function.setFrom(fn, newFunction);
|
|
103
93
|
return fn;
|
|
104
94
|
} else {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
return
|
|
95
|
+
Obj.change(newFunction, (f) => {
|
|
96
|
+
f.source = Ref.make(script);
|
|
97
|
+
});
|
|
98
|
+
return space.db.add(newFunction);
|
|
109
99
|
}
|
|
110
100
|
};
|
package/src/util/functions.ts
CHANGED
|
@@ -2,11 +2,13 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Obj } from '@dxos/echo';
|
|
6
|
+
import { type Function, type Script, getUserFunctionIdInMetadata } from '@dxos/functions';
|
|
7
|
+
import { getInvocationUrl } from '@dxos/functions-runtime';
|
|
6
8
|
import { type PublicKey } from '@dxos/keys';
|
|
7
9
|
import { log } from '@dxos/log';
|
|
8
10
|
import { type Credential } from '@dxos/protocols/proto/dxos/halo/credentials';
|
|
9
|
-
import {
|
|
11
|
+
import { getSpace } from '@dxos/react-client/echo';
|
|
10
12
|
/**
|
|
11
13
|
* Get the function URL for a given script and client configuration
|
|
12
14
|
*/
|
|
@@ -15,12 +17,12 @@ export const getFunctionUrl = ({
|
|
|
15
17
|
fn,
|
|
16
18
|
edgeUrl,
|
|
17
19
|
}: {
|
|
18
|
-
script:
|
|
20
|
+
script: Script.Script;
|
|
19
21
|
fn: any;
|
|
20
22
|
edgeUrl: string;
|
|
21
23
|
}): string | undefined => {
|
|
22
24
|
const space = getSpace(script);
|
|
23
|
-
const existingFunctionId = fn && getUserFunctionIdInMetadata(getMeta(fn));
|
|
25
|
+
const existingFunctionId = fn && getUserFunctionIdInMetadata(Obj.getMeta(fn));
|
|
24
26
|
|
|
25
27
|
if (!existingFunctionId) {
|
|
26
28
|
return undefined;
|
|
@@ -32,36 +34,38 @@ export const getFunctionUrl = ({
|
|
|
32
34
|
};
|
|
33
35
|
|
|
34
36
|
export const updateFunctionMetadata = (
|
|
35
|
-
script:
|
|
36
|
-
storedFunction:
|
|
37
|
+
script: Script.Script,
|
|
38
|
+
storedFunction: Function.Function,
|
|
37
39
|
meta: any,
|
|
38
40
|
functionId: string,
|
|
39
41
|
) => {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
42
|
+
Obj.change(storedFunction, (f) => {
|
|
43
|
+
if (script.description !== undefined && script.description.trim() !== '') {
|
|
44
|
+
f.description = script.description;
|
|
45
|
+
} else if (meta.description) {
|
|
46
|
+
f.description = meta.description;
|
|
47
|
+
} else {
|
|
48
|
+
log.verbose('no description in function metadata', { functionId });
|
|
49
|
+
}
|
|
47
50
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
if (meta.inputSchema) {
|
|
52
|
+
f.inputSchema = meta.inputSchema;
|
|
53
|
+
} else {
|
|
54
|
+
log.verbose('no input schema in function metadata', { functionId });
|
|
55
|
+
}
|
|
53
56
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
if (meta.outputSchema) {
|
|
58
|
+
f.outputSchema = meta.outputSchema;
|
|
59
|
+
} else {
|
|
60
|
+
log.verbose('no output schema in function metadata', { functionId });
|
|
61
|
+
}
|
|
59
62
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
if (meta.key) {
|
|
64
|
+
f.key = meta.key;
|
|
65
|
+
} else {
|
|
66
|
+
log.verbose('no key in function metadata', { functionId });
|
|
67
|
+
}
|
|
68
|
+
});
|
|
65
69
|
};
|
|
66
70
|
|
|
67
71
|
export const getAccessCredential = (identityKey: PublicKey): Credential => {
|
package/src/vite-env.d.ts
CHANGED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
DEPLOYMENT_DIALOG,
|
|
3
|
-
DeploymentDialog_default
|
|
4
|
-
} from "./chunk-NM4WQS4F.mjs";
|
|
5
|
-
import "./chunk-JO2O7W6J.mjs";
|
|
6
|
-
import "./chunk-5CYLWXRH.mjs";
|
|
7
|
-
import "./chunk-ST3ACVUC.mjs";
|
|
8
|
-
import "./chunk-EZVXV6DA.mjs";
|
|
9
|
-
export {
|
|
10
|
-
DEPLOYMENT_DIALOG,
|
|
11
|
-
DeploymentDialog_default as default
|
|
12
|
-
};
|
|
13
|
-
//# sourceMappingURL=DeploymentDialog-65TWT6S5.mjs.map
|