@dxos/plugin-script 0.8.4-main.c1de068 → 0.8.4-main.c351d160a8
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-SSJP2BBZ.mjs +138 -0
- package/dist/lib/browser/DeploymentDialog-SSJP2BBZ.mjs.map +7 -0
- package/dist/lib/browser/NotebookContainer-Q6Z2CPH6.mjs +848 -0
- package/dist/lib/browser/NotebookContainer-Q6Z2CPH6.mjs.map +7 -0
- package/dist/lib/browser/ScriptContainer-IKITE6OA.mjs +93 -0
- package/dist/lib/browser/ScriptContainer-IKITE6OA.mjs.map +7 -0
- package/dist/lib/browser/ScriptObjectSettings-X4WV5TBD.mjs +294 -0
- package/dist/lib/browser/ScriptObjectSettings-X4WV5TBD.mjs.map +7 -0
- package/dist/lib/browser/ScriptPluginSettings-5WUKIWCC.mjs +55 -0
- package/dist/lib/browser/ScriptPluginSettings-5WUKIWCC.mjs.map +7 -0
- package/dist/lib/browser/ScriptProperties-5YERQAL2.mjs +28 -0
- package/dist/lib/browser/ScriptProperties-5YERQAL2.mjs.map +7 -0
- package/dist/lib/browser/TestContainer-ZI2PQRXB.mjs +39 -0
- package/dist/lib/browser/TestContainer-ZI2PQRXB.mjs.map +7 -0
- package/dist/lib/browser/app-graph-builder-QPXX4YK5.mjs +63 -0
- package/dist/lib/browser/app-graph-builder-QPXX4YK5.mjs.map +7 -0
- package/dist/lib/browser/blueprint-definition-2UX353LT.mjs +17 -0
- package/dist/lib/browser/blueprint-definition-2UX353LT.mjs.map +7 -0
- package/dist/lib/browser/blueprints/index.mjs +8 -0
- package/dist/lib/browser/{chunk-QYAREHGH.mjs → chunk-37XPSUAH.mjs} +9 -6
- package/dist/lib/browser/chunk-37XPSUAH.mjs.map +7 -0
- package/dist/lib/browser/chunk-7JL6WNT6.mjs +397 -0
- package/dist/lib/browser/chunk-7JL6WNT6.mjs.map +7 -0
- package/dist/lib/browser/chunk-7SXHORK4.mjs +105 -0
- package/dist/lib/browser/chunk-7SXHORK4.mjs.map +7 -0
- package/dist/lib/browser/{compiler-CXCUA4UQ.mjs → chunk-ATTZUDT7.mjs} +17 -32
- 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-IHEZBW44.mjs +789 -0
- package/dist/lib/browser/chunk-IHEZBW44.mjs.map +7 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/browser/chunk-KIYJ6XPN.mjs +20 -0
- package/dist/lib/browser/chunk-KIYJ6XPN.mjs.map +7 -0
- package/dist/lib/browser/chunk-MYSQ4VH5.mjs +29 -0
- package/dist/lib/browser/chunk-MYSQ4VH5.mjs.map +7 -0
- package/dist/lib/browser/chunk-OWMMXCIP.mjs +116 -0
- package/dist/lib/browser/chunk-OWMMXCIP.mjs.map +7 -0
- package/dist/lib/browser/chunk-X44CJ7F5.mjs +11 -0
- package/dist/lib/browser/chunk-X44CJ7F5.mjs.map +7 -0
- package/dist/lib/browser/compiler-ZVLONXEG.mjs +99 -0
- package/dist/lib/browser/compiler-ZVLONXEG.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +150 -108
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/operation-resolver-YYHZGLYR.mjs +79 -0
- package/dist/lib/browser/operation-resolver-YYHZGLYR.mjs.map +7 -0
- package/dist/lib/browser/react-surface-SZ7BHELP.mjs +142 -0
- package/dist/lib/browser/react-surface-SZ7BHELP.mjs.map +7 -0
- package/dist/lib/browser/settings-XGV2T3PC.mjs +36 -0
- package/dist/lib/browser/settings-XGV2T3PC.mjs.map +7 -0
- package/dist/lib/browser/templates/index.mjs +2 -1
- package/dist/lib/browser/types/index.mjs +14 -6
- package/dist/lib/node-esm/DeploymentDialog-V3HYTNFB.mjs +139 -0
- package/dist/lib/node-esm/DeploymentDialog-V3HYTNFB.mjs.map +7 -0
- package/dist/lib/node-esm/NotebookContainer-MDHOETIH.mjs +849 -0
- package/dist/lib/node-esm/NotebookContainer-MDHOETIH.mjs.map +7 -0
- package/dist/lib/node-esm/ScriptContainer-4E4EK6ZF.mjs +94 -0
- package/dist/lib/node-esm/ScriptContainer-4E4EK6ZF.mjs.map +7 -0
- package/dist/lib/node-esm/ScriptObjectSettings-RPY2ZLDJ.mjs +295 -0
- package/dist/lib/node-esm/ScriptObjectSettings-RPY2ZLDJ.mjs.map +7 -0
- package/dist/lib/node-esm/ScriptPluginSettings-H4ESISSG.mjs +56 -0
- package/dist/lib/node-esm/ScriptPluginSettings-H4ESISSG.mjs.map +7 -0
- package/dist/lib/node-esm/ScriptProperties-NNDYQTOW.mjs +29 -0
- package/dist/lib/node-esm/ScriptProperties-NNDYQTOW.mjs.map +7 -0
- package/dist/lib/node-esm/TestContainer-G2TVP2KS.mjs +40 -0
- package/dist/lib/node-esm/TestContainer-G2TVP2KS.mjs.map +7 -0
- package/dist/lib/node-esm/app-graph-builder-GNGOYXIU.mjs +64 -0
- package/dist/lib/node-esm/app-graph-builder-GNGOYXIU.mjs.map +7 -0
- package/dist/lib/node-esm/blueprint-definition-4UDBPYRQ.mjs +18 -0
- package/dist/lib/node-esm/blueprint-definition-4UDBPYRQ.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-3EV4C6GW.mjs +107 -0
- package/dist/lib/node-esm/chunk-3EV4C6GW.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-4YAEFFW2.mjs +12 -0
- package/dist/lib/node-esm/chunk-4YAEFFW2.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-5BG7OJGQ.mjs +176 -0
- package/dist/lib/node-esm/chunk-5BG7OJGQ.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-BOPXK25O.mjs +790 -0
- package/dist/lib/node-esm/chunk-BOPXK25O.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-DMELV4YV.mjs +22 -0
- package/dist/lib/node-esm/chunk-DMELV4YV.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-DQMM7ZL5.mjs +31 -0
- package/dist/lib/node-esm/chunk-DQMM7ZL5.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-EV57E4Q4.mjs +117 -0
- package/dist/lib/node-esm/chunk-EV57E4Q4.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/{compiler-EPFKQXPE.mjs → chunk-JGN7TDJH.mjs} +17 -31
- package/dist/lib/node-esm/chunk-JGN7TDJH.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-KL6LGVVM.mjs +398 -0
- package/dist/lib/node-esm/chunk-KL6LGVVM.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-AHXJ6NQU.mjs → chunk-L3JLWXB5.mjs} +9 -6
- package/dist/lib/node-esm/chunk-L3JLWXB5.mjs.map +7 -0
- package/dist/lib/node-esm/compiler-INUOAXU7.mjs +100 -0
- package/dist/lib/node-esm/compiler-INUOAXU7.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +150 -108
- 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-OTHAYHTN.mjs +80 -0
- package/dist/lib/node-esm/operation-resolver-OTHAYHTN.mjs.map +7 -0
- package/dist/lib/node-esm/react-surface-DLEXFWGV.mjs +143 -0
- package/dist/lib/node-esm/react-surface-DLEXFWGV.mjs.map +7 -0
- package/dist/lib/node-esm/settings-JZUMGPNG.mjs +37 -0
- package/dist/lib/node-esm/settings-JZUMGPNG.mjs.map +7 -0
- package/dist/lib/node-esm/templates/index.mjs +2 -1
- package/dist/lib/node-esm/types/index.mjs +14 -6
- 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/FramePanel/FramePanel.d.ts +12 -0
- package/dist/types/src/components/FramePanel/FramePanel.d.ts.map +1 -0
- package/dist/types/src/components/FramePanel/index.d.ts +2 -0
- package/dist/types/src/components/FramePanel/index.d.ts.map +1 -0
- package/dist/types/src/components/NotebookStack/NotebookCell.d.ts +15 -0
- package/dist/types/src/components/NotebookStack/NotebookCell.d.ts.map +1 -0
- package/dist/types/src/components/NotebookStack/NotebookMenu.d.ts +9 -0
- package/dist/types/src/components/NotebookStack/NotebookMenu.d.ts.map +1 -0
- package/dist/types/src/components/NotebookStack/NotebookStack.d.ts +14 -0
- package/dist/types/src/components/NotebookStack/NotebookStack.d.ts.map +1 -0
- package/dist/types/src/components/NotebookStack/NotebookStack.stories.d.ts +252 -0
- package/dist/types/src/components/NotebookStack/NotebookStack.stories.d.ts.map +1 -0
- package/dist/types/src/components/NotebookStack/index.d.ts +3 -0
- package/dist/types/src/components/NotebookStack/index.d.ts.map +1 -0
- 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 +249 -10
- 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 +5 -2
- package/dist/types/src/components/TypescriptEditor/TypescriptEditor.d.ts.map +1 -1
- package/dist/types/src/components/TypescriptEditor/TypescriptEditor.stories.d.ts +11 -4
- package/dist/types/src/components/TypescriptEditor/TypescriptEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +5 -7
- 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/containers/DeploymentDialog/DeploymentDialog.d.ts +9 -0
- package/dist/types/src/containers/DeploymentDialog/DeploymentDialog.d.ts.map +1 -0
- package/dist/types/src/containers/DeploymentDialog/DeploymentDialog.stories.d.ts +252 -0
- 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 +20 -33
- 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 +3 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -3
- 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 +13 -0
- package/dist/types/src/notebook/eval.d.ts.map +1 -0
- package/dist/types/src/notebook/index.d.ts +2 -0
- package/dist/types/src/notebook/index.d.ts.map +1 -0
- package/dist/types/src/notebook/vfs-parser.d.ts +74 -0
- package/dist/types/src/notebook/vfs-parser.d.ts.map +1 -0
- package/dist/types/src/notebook/vfs-parser.test.d.ts +2 -0
- package/dist/types/src/notebook/vfs-parser.test.d.ts.map +1 -0
- 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/data-generator.d.ts.map +1 -1
- package/dist/types/src/templates/discord.d.ts.map +1 -1
- 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/gmail.d.ts.map +1 -1
- package/dist/types/src/templates/index.d.ts +52 -1
- package/dist/types/src/templates/index.d.ts.map +1 -1
- package/dist/types/src/templates/ping.d.ts +3 -0
- package/dist/types/src/templates/ping.d.ts.map +1 -0
- package/dist/types/src/testing/data.d.ts +3 -0
- package/dist/types/src/testing/data.d.ts.map +1 -0
- package/dist/types/src/testing/index.d.ts +2 -0
- package/dist/types/src/testing/index.d.ts.map +1 -0
- 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 +34 -5
- 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 +40 -0
- package/dist/types/src/types/actions.d.ts.map +1 -0
- 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 +5 -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 +7 -7
- package/dist/types/src/util/deploy.d.ts.map +1 -1
- package/dist/types/src/util/functions.d.ts +6 -3
- package/dist/types/src/util/functions.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +124 -85
- package/src/ScriptPlugin.tsx +57 -77
- 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} +103 -105
- 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 +129 -0
- package/src/capabilities/settings/index.ts +7 -0
- package/src/capabilities/settings/settings.ts +33 -0
- package/src/compiler/compiler.ts +11 -4
- package/src/components/{FrameContainer/FrameContainer.tsx → FramePanel/FramePanel.tsx} +10 -8
- package/src/components/{FrameContainer → FramePanel}/index.ts +1 -1
- package/src/components/NotebookStack/NotebookCell.tsx +215 -0
- package/src/components/NotebookStack/NotebookMenu.tsx +47 -0
- package/src/components/NotebookStack/NotebookStack.stories.tsx +54 -0
- package/src/components/NotebookStack/NotebookStack.tsx +86 -0
- package/src/components/NotebookStack/index.ts +6 -0
- package/src/components/QueryEditor/QueryEditor.stories.tsx +96 -0
- package/src/components/QueryEditor/QueryEditor.tsx +47 -0
- package/src/components/QueryEditor/index.ts +5 -0
- package/src/components/ScriptToolbar/ScriptToolbar.stories.tsx +56 -17
- package/src/components/ScriptToolbar/ScriptToolbar.tsx +38 -34
- package/src/components/TestPanel/TestPanel.tsx +67 -42
- package/src/components/TestPanel/index.ts +0 -1
- package/src/components/TypescriptEditor/TypescriptEditor.stories.tsx +89 -34
- package/src/components/TypescriptEditor/TypescriptEditor.tsx +84 -81
- package/src/components/index.ts +5 -7
- 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 +267 -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/containers/ScriptObjectSettings/ScriptObjectSettings.tsx +291 -0
- package/src/containers/ScriptObjectSettings/index.ts +7 -0
- package/src/containers/ScriptPluginSettings/ScriptPluginSettings.tsx +66 -0
- 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 +52 -45
- package/src/hooks/format.ts +10 -5
- package/src/hooks/index.ts +1 -0
- package/src/hooks/template.ts +22 -25
- package/src/hooks/useCompiler.ts +24 -0
- package/src/hooks/useCreateAndDeployScriptTemplates.ts +15 -16
- package/src/hooks/useToolbarState.ts +29 -4
- package/src/index.ts +3 -1
- package/src/meta.ts +10 -8
- package/src/notebook/compute-graph.test.ts +82 -0
- package/src/notebook/compute-graph.ts +230 -0
- package/src/notebook/eval.ts +105 -0
- package/src/notebook/index.ts +5 -0
- package/src/notebook/vfs-parser.test.ts +149 -0
- package/src/notebook/vfs-parser.ts +451 -0
- package/src/templates/anthropic.ts +42 -0
- package/src/templates/chat.ts +1 -1
- package/src/templates/chess-bot.ts +58 -0
- package/src/templates/commentary.ts +231 -0
- package/src/templates/data-generator.ts +10 -4
- package/src/templates/discord.ts +14 -6
- package/src/templates/forex-effect.ts +24 -25
- package/src/templates/forex.ts +9 -6
- package/src/templates/gmail.ts +37 -67
- package/src/templates/index.ts +36 -23
- package/src/templates/ping.ts +17 -0
- package/src/testing/data.ts +72 -0
- package/src/testing/index.ts +5 -0
- package/src/testing/simulator.test.ts +40 -0
- package/src/translations.ts +37 -7
- package/src/types/Notebook.ts +45 -0
- package/src/types/actions.ts +45 -0
- package/src/types/capabilities.ts +17 -0
- package/src/types/events.ts +11 -0
- package/src/types/index.ts +5 -1
- package/src/types/types.ts +15 -0
- package/src/util/deploy.ts +38 -61
- package/src/util/functions.ts +58 -25
- package/src/vite-env.d.ts +2 -0
- package/dist/lib/browser/DeploymentDialog-M4QIHTDR.mjs +0 -12
- package/dist/lib/browser/ScriptContainer-Z6SIGRRC.mjs +0 -262
- package/dist/lib/browser/ScriptContainer-Z6SIGRRC.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-HLQ7K3BT.mjs +0 -64
- package/dist/lib/browser/app-graph-builder-HLQ7K3BT.mjs.map +0 -7
- package/dist/lib/browser/artifact-definition-24Q3IHOU.mjs +0 -249
- package/dist/lib/browser/artifact-definition-24Q3IHOU.mjs.map +0 -7
- package/dist/lib/browser/chunk-3U6DTUH3.mjs +0 -283
- package/dist/lib/browser/chunk-3U6DTUH3.mjs.map +0 -7
- package/dist/lib/browser/chunk-5TVBECWH.mjs +0 -15
- package/dist/lib/browser/chunk-5TVBECWH.mjs.map +0 -7
- package/dist/lib/browser/chunk-FIM2MVNJ.mjs +0 -555
- package/dist/lib/browser/chunk-FIM2MVNJ.mjs.map +0 -7
- package/dist/lib/browser/chunk-FMDXKOP7.mjs +0 -233
- package/dist/lib/browser/chunk-FMDXKOP7.mjs.map +0 -7
- package/dist/lib/browser/chunk-IS4OG2UW.mjs +0 -39
- package/dist/lib/browser/chunk-IS4OG2UW.mjs.map +0 -7
- package/dist/lib/browser/chunk-P4HQKUCP.mjs +0 -153
- package/dist/lib/browser/chunk-P4HQKUCP.mjs.map +0 -7
- package/dist/lib/browser/chunk-QYAREHGH.mjs.map +0 -7
- package/dist/lib/browser/chunk-R4R7VOFY.mjs +0 -88
- package/dist/lib/browser/chunk-R4R7VOFY.mjs.map +0 -7
- package/dist/lib/browser/compiler-CXCUA4UQ.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-7B77IG3N.mjs +0 -91
- package/dist/lib/browser/intent-resolver-7B77IG3N.mjs.map +0 -7
- package/dist/lib/browser/react-surface-FYYXZA7C.mjs +0 -104
- package/dist/lib/browser/react-surface-FYYXZA7C.mjs.map +0 -7
- package/dist/lib/browser/settings-KCTBK5TY.mjs +0 -24
- package/dist/lib/browser/settings-KCTBK5TY.mjs.map +0 -7
- package/dist/lib/node-esm/DeploymentDialog-3KPRWFE7.mjs +0 -13
- package/dist/lib/node-esm/ScriptContainer-KPU75HHI.mjs +0 -263
- package/dist/lib/node-esm/ScriptContainer-KPU75HHI.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-7EYIHWH4.mjs +0 -65
- package/dist/lib/node-esm/app-graph-builder-7EYIHWH4.mjs.map +0 -7
- package/dist/lib/node-esm/artifact-definition-WAJFALUI.mjs +0 -250
- package/dist/lib/node-esm/artifact-definition-WAJFALUI.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-35M3CHYE.mjs +0 -16
- package/dist/lib/node-esm/chunk-35M3CHYE.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-7NMI4CEU.mjs +0 -556
- package/dist/lib/node-esm/chunk-7NMI4CEU.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-AHXJ6NQU.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-F5GFJ3PY.mjs +0 -90
- package/dist/lib/node-esm/chunk-F5GFJ3PY.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-JIPFLBYA.mjs +0 -40
- package/dist/lib/node-esm/chunk-JIPFLBYA.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-QKK3NDHW.mjs +0 -154
- package/dist/lib/node-esm/chunk-QKK3NDHW.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-RT43MACC.mjs +0 -284
- package/dist/lib/node-esm/chunk-RT43MACC.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-XJPK3IYI.mjs +0 -234
- package/dist/lib/node-esm/chunk-XJPK3IYI.mjs.map +0 -7
- package/dist/lib/node-esm/compiler-EPFKQXPE.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-FRZGS4TB.mjs +0 -92
- package/dist/lib/node-esm/intent-resolver-FRZGS4TB.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-V32NWHKN.mjs +0 -105
- package/dist/lib/node-esm/react-surface-V32NWHKN.mjs.map +0 -7
- package/dist/lib/node-esm/settings-DXZ334A3.mjs +0 -25
- package/dist/lib/node-esm/settings-DXZ334A3.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/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 +0 -11
- package/dist/types/src/components/DeploymentDialog/DeploymentDialog.d.ts.map +0 -1
- package/dist/types/src/components/DeploymentDialog/DeploymentDialog.stories.d.ts +0 -18
- package/dist/types/src/components/DeploymentDialog/DeploymentDialog.stories.d.ts.map +0 -1
- package/dist/types/src/components/DeploymentDialog/index.d.ts +0 -4
- package/dist/types/src/components/DeploymentDialog/index.d.ts.map +0 -1
- package/dist/types/src/components/FrameContainer/FrameContainer.d.ts +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/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/templates/chess.d.ts +0 -3
- package/dist/types/src/templates/chess.d.ts.map +0 -1
- package/dist/types/src/templates/echo.d.ts +0 -6
- package/dist/types/src/templates/echo.d.ts.map +0 -1
- package/dist/types/src/types/schema.d.ts +0 -38
- package/dist/types/src/types/schema.d.ts.map +0 -1
- package/src/capabilities/app-graph-builder.ts +0 -64
- package/src/capabilities/capabilities.ts +0 -12
- package/src/capabilities/compiler.ts +0 -33
- package/src/capabilities/intent-resolver.ts +0 -80
- package/src/capabilities/react-surface.tsx +0 -89
- package/src/capabilities/settings.ts +0 -21
- package/src/components/DeploymentDialog/DeploymentDialog.stories.tsx +0 -39
- package/src/components/DeploymentDialog/DeploymentDialog.tsx +0 -112
- package/src/components/DeploymentDialog/index.ts +0 -9
- package/src/components/FrameContainer/frame.html +0 -25
- package/src/components/FrameContainer/frame.tsx +0 -51
- package/src/components/ScriptContainer.tsx +0 -68
- package/src/components/Settings/ScriptObjectSettings.tsx +0 -206
- package/src/components/Settings/ScriptPluginSettings.tsx +0 -71
- package/src/components/Settings/index.ts +0 -6
- package/src/components/TestPanel/TestContainer.tsx +0 -26
- package/src/events.ts +0 -11
- package/src/templates/chess.ts +0 -47
- package/src/templates/echo.ts +0 -8
- package/src/types/schema.ts +0 -37
- /package/dist/lib/browser/{DeploymentDialog-M4QIHTDR.mjs.map → blueprints/index.mjs.map} +0 -0
- /package/dist/lib/{node-esm/DeploymentDialog-3KPRWFE7.mjs.map → browser/chunk-J5LGTIGS.mjs.map} +0 -0
|
@@ -1,249 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
meta
|
|
3
|
-
} from "./chunk-QYAREHGH.mjs";
|
|
4
|
-
|
|
5
|
-
// src/capabilities/artifact-definition.ts
|
|
6
|
-
import { Schema } from "effect";
|
|
7
|
-
import { createTool, ToolResult } from "@dxos/ai";
|
|
8
|
-
import { Capabilities, contributes, createIntent } from "@dxos/app-framework";
|
|
9
|
-
import { createArtifactElement, ArtifactId } from "@dxos/assistant";
|
|
10
|
-
import { defineArtifact } from "@dxos/blueprints";
|
|
11
|
-
import { Filter, Obj, Ref } from "@dxos/echo";
|
|
12
|
-
import { ScriptType } from "@dxos/functions";
|
|
13
|
-
import { invariant } from "@dxos/invariant";
|
|
14
|
-
import { SpaceAction } from "@dxos/plugin-space/types";
|
|
15
|
-
import { DataType } from "@dxos/schema";
|
|
16
|
-
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-script/src/capabilities/artifact-definition.ts";
|
|
17
|
-
var artifact_definition_default = () => {
|
|
18
|
-
const definition = defineArtifact({
|
|
19
|
-
id: `artifact:${meta.id}`,
|
|
20
|
-
name: meta.name,
|
|
21
|
-
// TODO(dmaretskyi): Since writing scripts requires a lot of domain knowledge,
|
|
22
|
-
// we should offload the work of synthesizing the code to a separate model.
|
|
23
|
-
// The main reasoning model will give it a concrete task and the script model will synthesize the code, knowing all the docs.
|
|
24
|
-
instructions: `
|
|
25
|
-
If the user explicitly requests you to write a script, you can create one.
|
|
26
|
-
If the user requests you to change one of the existing script, you can update it.
|
|
27
|
-
You must not create a script unless the user explicitly requests it.
|
|
28
|
-
Scripts are short code pieces of executable code that can be used to perform computations, integrate with external systems, and perform automated tasks.
|
|
29
|
-
Each script must follow as strict shape for the definition but the body can contain any valid executable code.
|
|
30
|
-
Scripts are written in JavaScript or TypeScript.
|
|
31
|
-
Each script must define an input schema and output schema.
|
|
32
|
-
Each script must have its own detailed description.
|
|
33
|
-
|
|
34
|
-
Important: You cannot execute scripts. Scripts are only available as tools after the user deploys them. You must only call the available tools.
|
|
35
|
-
|
|
36
|
-
Description:
|
|
37
|
-
The description is a detailed description of the script.
|
|
38
|
-
It is used to describe the script's purpose, input, and output.
|
|
39
|
-
The description is used to generate the script's documentation.
|
|
40
|
-
The description is also goes into the script metadata.
|
|
41
|
-
The description is used by AI to understand the script and its purpose.
|
|
42
|
-
The description must provide cases on when the script should be used.
|
|
43
|
-
|
|
44
|
-
Schema:
|
|
45
|
-
The schema is defined using a schema-DSL library called Effect Schema.
|
|
46
|
-
The input schema describes the arguments that the script accepts.
|
|
47
|
-
The output schema describes the result that the script produces.
|
|
48
|
-
The schema is used to validate the script's input and output.
|
|
49
|
-
The schema is also goes into the script metadata.
|
|
50
|
-
The properties in the schema must have valid descriptions.
|
|
51
|
-
The input and output schemas must both be a struct of fields.
|
|
52
|
-
|
|
53
|
-
Restricts:
|
|
54
|
-
The scripts can only import code from "dxos:functions" module. No other modules are allowed.
|
|
55
|
-
Some web APIs are available - like fetch.
|
|
56
|
-
|
|
57
|
-
Reasoning:
|
|
58
|
-
Before writing a script, synthesize the following information:
|
|
59
|
-
- Description
|
|
60
|
-
- What APIs will be used.
|
|
61
|
-
- Detailed input schema
|
|
62
|
-
- Detailed output schema
|
|
63
|
-
|
|
64
|
-
<apis>
|
|
65
|
-
export function defineFunction(params: {
|
|
66
|
-
description: string,
|
|
67
|
-
inputSchema: Schema.Schema,
|
|
68
|
-
outputSchema: Schema.Schema,
|
|
69
|
-
handler: (params: { event: { data: TInput } }) => Promise<TOutput>
|
|
70
|
-
}): FunctionDefinition
|
|
71
|
-
/**
|
|
72
|
-
* Effect Schema
|
|
73
|
-
*/
|
|
74
|
-
export const Schema;
|
|
75
|
-
|
|
76
|
-
// Examples:
|
|
77
|
-
|
|
78
|
-
Schema.String
|
|
79
|
-
Schema.Number
|
|
80
|
-
Schema.Boolean
|
|
81
|
-
Schema.Struct({
|
|
82
|
-
from: Schema.String.annotations({ description: 'The source currency' }),
|
|
83
|
-
to: Schema.String.annotations({ description: 'The target currency' }),
|
|
84
|
-
})
|
|
85
|
-
Schema.Array(Schema.String)
|
|
86
|
-
Schema.Union(Schema.String, Schema.Number)
|
|
87
|
-
Schema.optional(Schema.String)
|
|
88
|
-
Schema.String.annotations({ description: 'The source currency' })
|
|
89
|
-
</apis>
|
|
90
|
-
|
|
91
|
-
<handler_function>
|
|
92
|
-
Async function that takes the argument in the form of:
|
|
93
|
-
|
|
94
|
-
type HandlerFunctionParam = {
|
|
95
|
-
event: {
|
|
96
|
-
data: T // The input schema
|
|
97
|
-
},
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
The function must return the result that matches the output schema.
|
|
101
|
-
</handler_function>
|
|
102
|
-
|
|
103
|
-
<example>
|
|
104
|
-
import { defineFunction, S } from 'dxos:functions';
|
|
105
|
-
|
|
106
|
-
export default defineFunction({
|
|
107
|
-
description: 'Returns the exchange rate between two currencies.',
|
|
108
|
-
|
|
109
|
-
inputSchema: Schema.Struct({
|
|
110
|
-
from: Schema.String.annotations({ description: 'The source currency' }),
|
|
111
|
-
to: Schema.String.annotations({ description: 'The target currency' }),
|
|
112
|
-
}),
|
|
113
|
-
|
|
114
|
-
outputSchema: Schema.Struct({
|
|
115
|
-
rate: Schema.String.annotations({ description: 'The exchange rate' }),
|
|
116
|
-
}),
|
|
117
|
-
|
|
118
|
-
handler: async ({
|
|
119
|
-
event: {
|
|
120
|
-
data: { from, to },
|
|
121
|
-
},
|
|
122
|
-
}: any) => {
|
|
123
|
-
const res = await fetch(\`https://free.ratesdb.com/v1/rates?from=\${from}&to=\${to}\`);
|
|
124
|
-
const {
|
|
125
|
-
data: { rates },
|
|
126
|
-
} = await res.json();
|
|
127
|
-
|
|
128
|
-
return { rate: rates[to].toString() };
|
|
129
|
-
},
|
|
130
|
-
});
|
|
131
|
-
</example>
|
|
132
|
-
`,
|
|
133
|
-
schema: ScriptType,
|
|
134
|
-
tools: [
|
|
135
|
-
createTool(meta.id, {
|
|
136
|
-
name: "create",
|
|
137
|
-
description: "Create a new script. Returns the artifact definition for the script",
|
|
138
|
-
caption: "Creating script...",
|
|
139
|
-
schema: Schema.Struct({
|
|
140
|
-
name: Schema.String.annotations({
|
|
141
|
-
description: "The name of the script"
|
|
142
|
-
}),
|
|
143
|
-
code: Schema.String.annotations({
|
|
144
|
-
description: "The full code of the script in JavaScript or TypeScript. Must be valid executable code."
|
|
145
|
-
})
|
|
146
|
-
}),
|
|
147
|
-
execute: async ({ name, code }, { extensions }) => {
|
|
148
|
-
invariant(extensions?.space, "No space", {
|
|
149
|
-
F: __dxlog_file,
|
|
150
|
-
L: 157,
|
|
151
|
-
S: void 0,
|
|
152
|
-
A: [
|
|
153
|
-
"extensions?.space",
|
|
154
|
-
"'No space'"
|
|
155
|
-
]
|
|
156
|
-
});
|
|
157
|
-
invariant(extensions?.dispatch, "No intent dispatcher", {
|
|
158
|
-
F: __dxlog_file,
|
|
159
|
-
L: 158,
|
|
160
|
-
S: void 0,
|
|
161
|
-
A: [
|
|
162
|
-
"extensions?.dispatch",
|
|
163
|
-
"'No intent dispatcher'"
|
|
164
|
-
]
|
|
165
|
-
});
|
|
166
|
-
const script = Obj.make(ScriptType, {
|
|
167
|
-
name,
|
|
168
|
-
source: Ref.make(Obj.make(DataType.Text, {
|
|
169
|
-
content: code
|
|
170
|
-
}))
|
|
171
|
-
});
|
|
172
|
-
extensions.space.db.add(script);
|
|
173
|
-
await extensions.space.db.flush();
|
|
174
|
-
const intent = createIntent(SpaceAction.AddObject, {
|
|
175
|
-
target: extensions.space,
|
|
176
|
-
object: script
|
|
177
|
-
});
|
|
178
|
-
const { data, error } = await extensions.dispatch(intent);
|
|
179
|
-
if (!data || error) {
|
|
180
|
-
return ToolResult.Error(error?.message ?? "Failed to create chess game");
|
|
181
|
-
}
|
|
182
|
-
return ToolResult.Success(createArtifactElement(script.id));
|
|
183
|
-
}
|
|
184
|
-
}),
|
|
185
|
-
createTool(meta.id, {
|
|
186
|
-
name: "inspect",
|
|
187
|
-
description: "Inspect a script. Returns the artifact definition for the script",
|
|
188
|
-
caption: "Inspecting script...",
|
|
189
|
-
schema: Schema.Struct({
|
|
190
|
-
id: ArtifactId
|
|
191
|
-
}),
|
|
192
|
-
execute: async ({ id }, { extensions }) => {
|
|
193
|
-
invariant(extensions?.space, "No space", {
|
|
194
|
-
F: __dxlog_file,
|
|
195
|
-
L: 187,
|
|
196
|
-
S: void 0,
|
|
197
|
-
A: [
|
|
198
|
-
"extensions?.space",
|
|
199
|
-
"'No space'"
|
|
200
|
-
]
|
|
201
|
-
});
|
|
202
|
-
const script = await extensions.space.db.query(Filter.ids(id)).first();
|
|
203
|
-
const { content } = await script.source.load();
|
|
204
|
-
return ToolResult.Success({
|
|
205
|
-
name: script.name,
|
|
206
|
-
code: content
|
|
207
|
-
});
|
|
208
|
-
}
|
|
209
|
-
}),
|
|
210
|
-
createTool(meta.id, {
|
|
211
|
-
name: "update",
|
|
212
|
-
description: "Update a script. Returns the artifact definition for the script",
|
|
213
|
-
caption: "Updating script...",
|
|
214
|
-
schema: Schema.Struct({
|
|
215
|
-
id: ArtifactId,
|
|
216
|
-
code: Schema.String.annotations({
|
|
217
|
-
description: "The full code of the script in JavaScript or TypeScript. Must be valid executable code."
|
|
218
|
-
})
|
|
219
|
-
}),
|
|
220
|
-
execute: async ({ id, code }, { extensions }) => {
|
|
221
|
-
invariant(extensions?.space, "No space", {
|
|
222
|
-
F: __dxlog_file,
|
|
223
|
-
L: 209,
|
|
224
|
-
S: void 0,
|
|
225
|
-
A: [
|
|
226
|
-
"extensions?.space",
|
|
227
|
-
"'No space'"
|
|
228
|
-
]
|
|
229
|
-
});
|
|
230
|
-
const script = await extensions.space.db.query(Filter.ids(id)).first();
|
|
231
|
-
const source = await script.source.load();
|
|
232
|
-
if (!source) {
|
|
233
|
-
return ToolResult.Error("Script not found");
|
|
234
|
-
}
|
|
235
|
-
source.content = code;
|
|
236
|
-
await extensions.space?.db.flush();
|
|
237
|
-
return ToolResult.Success({
|
|
238
|
-
name: script.name
|
|
239
|
-
});
|
|
240
|
-
}
|
|
241
|
-
})
|
|
242
|
-
]
|
|
243
|
-
});
|
|
244
|
-
return contributes(Capabilities.ArtifactDefinition, definition);
|
|
245
|
-
};
|
|
246
|
-
export {
|
|
247
|
-
artifact_definition_default as default
|
|
248
|
-
};
|
|
249
|
-
//# sourceMappingURL=artifact-definition-24Q3IHOU.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/artifact-definition.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Schema } from 'effect';\n\nimport { createTool, ToolResult } from '@dxos/ai';\nimport { Capabilities, contributes, createIntent, type PromiseIntentDispatcher } from '@dxos/app-framework';\nimport { createArtifactElement, ArtifactId } from '@dxos/assistant';\nimport { defineArtifact } from '@dxos/blueprints';\nimport { Filter, Obj, Ref } from '@dxos/echo';\nimport { ScriptType } from '@dxos/functions';\nimport { invariant } from '@dxos/invariant';\nimport { SpaceAction } from '@dxos/plugin-space/types';\nimport { type Space } from '@dxos/react-client/echo';\nimport { DataType } from '@dxos/schema';\n\nimport { meta } from '../meta';\n\n// TODO(burdon): Factor out.\ndeclare global {\n interface ToolContextExtensions {\n space?: Space;\n dispatch?: PromiseIntentDispatcher;\n }\n}\n\nexport default () => {\n const definition = defineArtifact({\n id: `artifact:${meta.id}`,\n name: meta.name,\n // TODO(dmaretskyi): Since writing scripts requires a lot of domain knowledge,\n // we should offload the work of synthesizing the code to a separate model.\n // The main reasoning model will give it a concrete task and the script model will synthesize the code, knowing all the docs.\n instructions: `\n If the user explicitly requests you to write a script, you can create one.\n If the user requests you to change one of the existing script, you can update it.\n You must not create a script unless the user explicitly requests it.\n Scripts are short code pieces of executable code that can be used to perform computations, integrate with external systems, and perform automated tasks.\n Each script must follow as strict shape for the definition but the body can contain any valid executable code.\n Scripts are written in JavaScript or TypeScript.\n Each script must define an input schema and output schema.\n Each script must have its own detailed description.\n\n Important: You cannot execute scripts. Scripts are only available as tools after the user deploys them. You must only call the available tools.\n\n Description:\n The description is a detailed description of the script.\n It is used to describe the script's purpose, input, and output.\n The description is used to generate the script's documentation.\n The description is also goes into the script metadata.\n The description is used by AI to understand the script and its purpose.\n The description must provide cases on when the script should be used.\n\n Schema: \n The schema is defined using a schema-DSL library called Effect Schema.\n The input schema describes the arguments that the script accepts.\n The output schema describes the result that the script produces.\n The schema is used to validate the script's input and output.\n The schema is also goes into the script metadata.\n The properties in the schema must have valid descriptions.\n The input and output schemas must both be a struct of fields.\n\n Restricts:\n The scripts can only import code from \"dxos:functions\" module. No other modules are allowed.\n Some web APIs are available - like fetch.\n\n Reasoning:\n Before writing a script, synthesize the following information:\n - Description\n - What APIs will be used.\n - Detailed input schema\n - Detailed output schema\n\n <apis>\n export function defineFunction(params: { \n description: string, \n inputSchema: Schema.Schema, \n outputSchema: Schema.Schema, \n handler: (params: { event: { data: TInput } }) => Promise<TOutput> \n }): FunctionDefinition\n /**\n * Effect Schema\n */\n export const Schema; \n\n // Examples: \n\n Schema.String\n Schema.Number\n Schema.Boolean\n Schema.Struct({\n from: Schema.String.annotations({ description: 'The source currency' }),\n to: Schema.String.annotations({ description: 'The target currency' }),\n })\n Schema.Array(Schema.String)\n Schema.Union(Schema.String, Schema.Number)\n Schema.optional(Schema.String)\n Schema.String.annotations({ description: 'The source currency' })\n </apis>\n\n <handler_function>\n Async function that takes the argument in the form of:\n\n type HandlerFunctionParam = {\n event: {\n data: T // The input schema\n },\n }\n\n The function must return the result that matches the output schema.\n </handler_function>\n \n <example>\n import { defineFunction, S } from 'dxos:functions';\n\n export default defineFunction({\n description: 'Returns the exchange rate between two currencies.',\n\n inputSchema: Schema.Struct({\n from: Schema.String.annotations({ description: 'The source currency' }),\n to: Schema.String.annotations({ description: 'The target currency' }),\n }),\n\n outputSchema: Schema.Struct({\n rate: Schema.String.annotations({ description: 'The exchange rate' }),\n }),\n\n handler: async ({\n event: {\n data: { from, to },\n },\n }: any) => {\n const res = await fetch(\\`https://free.ratesdb.com/v1/rates?from=\\${from}&to=\\${to}\\`);\n const {\n data: { rates },\n } = await res.json();\n\n return { rate: rates[to].toString() };\n },\n });\n </example>\n `,\n schema: ScriptType,\n tools: [\n createTool(meta.id, {\n name: 'create',\n description: 'Create a new script. Returns the artifact definition for the script',\n caption: 'Creating script...',\n schema: Schema.Struct({\n name: Schema.String.annotations({ description: 'The name of the script' }),\n code: Schema.String.annotations({\n description: 'The full code of the script in JavaScript or TypeScript. Must be valid executable code.',\n }),\n }),\n execute: async ({ name, code }, { extensions }) => {\n invariant(extensions?.space, 'No space');\n invariant(extensions?.dispatch, 'No intent dispatcher');\n const script = Obj.make(ScriptType, {\n name,\n source: Ref.make(\n Obj.make(DataType.Text, {\n content: code,\n }),\n ),\n });\n extensions.space.db.add(script);\n await extensions.space.db.flush();\n\n const intent = createIntent(SpaceAction.AddObject, { target: extensions.space, object: script });\n const { data, error } = await extensions.dispatch(intent);\n if (!data || error) {\n return ToolResult.Error(error?.message ?? 'Failed to create chess game');\n }\n\n return ToolResult.Success(createArtifactElement(script.id));\n },\n }),\n createTool(meta.id, {\n name: 'inspect',\n description: 'Inspect a script. Returns the artifact definition for the script',\n caption: 'Inspecting script...',\n schema: Schema.Struct({\n id: ArtifactId,\n }),\n execute: async ({ id }, { extensions }) => {\n invariant(extensions?.space, 'No space');\n\n const script = (await extensions.space.db.query(Filter.ids(id)).first()) as ScriptType;\n const { content } = await script.source.load();\n\n return ToolResult.Success({\n name: script.name,\n code: content,\n });\n },\n }),\n createTool(meta.id, {\n name: 'update',\n description: 'Update a script. Returns the artifact definition for the script',\n caption: 'Updating script...',\n schema: Schema.Struct({\n id: ArtifactId,\n code: Schema.String.annotations({\n description: 'The full code of the script in JavaScript or TypeScript. Must be valid executable code.',\n }),\n }),\n execute: async ({ id, code }, { extensions }) => {\n invariant(extensions?.space, 'No space');\n\n const script = (await extensions.space.db.query(Filter.ids(id)).first()) as ScriptType;\n const source = await script.source.load();\n if (!source) {\n return ToolResult.Error('Script not found');\n }\n\n source.content = code;\n await extensions.space?.db.flush();\n\n return ToolResult.Success({\n name: script.name,\n });\n },\n }),\n ],\n });\n\n return contributes(Capabilities.ArtifactDefinition, definition);\n};\n"],
|
|
5
|
-
"mappings": "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",
|
|
6
|
-
"names": ["Schema", "createTool", "ToolResult", "Capabilities", "contributes", "createIntent", "createArtifactElement", "ArtifactId", "defineArtifact", "Filter", "Obj", "Ref", "ScriptType", "invariant", "SpaceAction", "DataType", "definition", "defineArtifact", "id", "meta", "name", "instructions", "schema", "ScriptType", "tools", "createTool", "description", "caption", "Schema", "Struct", "String", "annotations", "code", "execute", "extensions", "invariant", "space", "dispatch", "script", "Obj", "make", "source", "Ref", "DataType", "Text", "content", "db", "add", "flush", "intent", "createIntent", "SpaceAction", "AddObject", "target", "object", "data", "error", "ToolResult", "Error", "message", "Success", "createArtifactElement", "ArtifactId", "query", "Filter", "ids", "first", "load", "contributes", "Capabilities", "ArtifactDefinition"]
|
|
7
|
-
}
|
|
@@ -1,283 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
templates
|
|
3
|
-
} from "./chunk-R4R7VOFY.mjs";
|
|
4
|
-
import {
|
|
5
|
-
deployScript,
|
|
6
|
-
getFunctionUrl,
|
|
7
|
-
isScriptDeployed
|
|
8
|
-
} from "./chunk-FMDXKOP7.mjs";
|
|
9
|
-
import {
|
|
10
|
-
SCRIPT_PLUGIN
|
|
11
|
-
} from "./chunk-QYAREHGH.mjs";
|
|
12
|
-
|
|
13
|
-
// src/hooks/deploy.ts
|
|
14
|
-
import { useEffect, useMemo } from "react";
|
|
15
|
-
import { FunctionType, getUserFunctionUrlInMetadata } from "@dxos/functions";
|
|
16
|
-
import { log } from "@dxos/log";
|
|
17
|
-
import { useClient } from "@dxos/react-client";
|
|
18
|
-
import { getMeta, getSpace, Query, Ref, useQuery } from "@dxos/react-client/echo";
|
|
19
|
-
import { createMenuAction } from "@dxos/react-ui-menu";
|
|
20
|
-
import { errorMessageColors } from "@dxos/react-ui-theme";
|
|
21
|
-
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-script/src/hooks/deploy.ts";
|
|
22
|
-
var createDeploy = ({ state, script, space, fn, client, existingFunctionUrl, t }) => {
|
|
23
|
-
const errorItem = createMenuAction("error", () => {
|
|
24
|
-
}, {
|
|
25
|
-
label: state.error ?? [
|
|
26
|
-
"no error label",
|
|
27
|
-
{
|
|
28
|
-
ns: SCRIPT_PLUGIN
|
|
29
|
-
}
|
|
30
|
-
],
|
|
31
|
-
icon: "ph--warning-circle--regular",
|
|
32
|
-
hidden: !state.error,
|
|
33
|
-
classNames: state.error && errorMessageColors
|
|
34
|
-
});
|
|
35
|
-
const deployAction = createMenuAction("deploy", async () => {
|
|
36
|
-
if (!script.source || !space) {
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
state.error = void 0;
|
|
40
|
-
state.deploying = true;
|
|
41
|
-
const result = await deployScript({
|
|
42
|
-
script,
|
|
43
|
-
client,
|
|
44
|
-
space,
|
|
45
|
-
fn,
|
|
46
|
-
existingFunctionUrl
|
|
47
|
-
});
|
|
48
|
-
if (!result.success) {
|
|
49
|
-
log.catch(result.error, void 0, {
|
|
50
|
-
F: __dxlog_file,
|
|
51
|
-
L: 59,
|
|
52
|
-
S: void 0,
|
|
53
|
-
C: (f, a) => f(...a)
|
|
54
|
-
});
|
|
55
|
-
state.error = t("upload failed label");
|
|
56
|
-
}
|
|
57
|
-
state.deploying = false;
|
|
58
|
-
}, {
|
|
59
|
-
type: "deploy",
|
|
60
|
-
label: [
|
|
61
|
-
state.deploying ? "pending label" : "deploy label",
|
|
62
|
-
{
|
|
63
|
-
ns: SCRIPT_PLUGIN
|
|
64
|
-
}
|
|
65
|
-
],
|
|
66
|
-
icon: state.deploying ? "ph--spinner-gap--regular" : "ph--cloud-arrow-up--regular",
|
|
67
|
-
disabled: state.deploying,
|
|
68
|
-
classNames: state.deploying ? "[&_svg]:animate-spin" : ""
|
|
69
|
-
});
|
|
70
|
-
const copyAction = createMenuAction("copy", async () => {
|
|
71
|
-
if (!state.functionUrl) {
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
|
-
await navigator.clipboard.writeText(state.functionUrl);
|
|
75
|
-
}, {
|
|
76
|
-
type: "copy",
|
|
77
|
-
label: [
|
|
78
|
-
"copy link label",
|
|
79
|
-
{
|
|
80
|
-
ns: SCRIPT_PLUGIN
|
|
81
|
-
}
|
|
82
|
-
],
|
|
83
|
-
icon: "ph--link--regular",
|
|
84
|
-
disabled: !state.functionUrl
|
|
85
|
-
});
|
|
86
|
-
return {
|
|
87
|
-
nodes: [
|
|
88
|
-
errorItem,
|
|
89
|
-
deployAction,
|
|
90
|
-
copyAction
|
|
91
|
-
],
|
|
92
|
-
edges: [
|
|
93
|
-
{
|
|
94
|
-
source: "root",
|
|
95
|
-
target: "error"
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
source: "root",
|
|
99
|
-
target: "deploy"
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
source: "root",
|
|
103
|
-
target: "copy"
|
|
104
|
-
}
|
|
105
|
-
]
|
|
106
|
-
};
|
|
107
|
-
};
|
|
108
|
-
var useDeployState = ({ state, script }) => {
|
|
109
|
-
const { space, client, fn, existingFunctionUrl } = useDeployDeps({
|
|
110
|
-
script
|
|
111
|
-
});
|
|
112
|
-
useEffect(() => {
|
|
113
|
-
if (!existingFunctionUrl) {
|
|
114
|
-
return;
|
|
115
|
-
}
|
|
116
|
-
state.functionUrl = getFunctionUrl({
|
|
117
|
-
script,
|
|
118
|
-
fn,
|
|
119
|
-
edgeUrl: client.config.values.runtime?.services?.edge?.url ?? ""
|
|
120
|
-
});
|
|
121
|
-
}, [
|
|
122
|
-
existingFunctionUrl,
|
|
123
|
-
space,
|
|
124
|
-
fn,
|
|
125
|
-
script,
|
|
126
|
-
client.config.values.runtime?.services?.edge?.url
|
|
127
|
-
]);
|
|
128
|
-
useEffect(() => {
|
|
129
|
-
state.deployed = isScriptDeployed({
|
|
130
|
-
script,
|
|
131
|
-
fn
|
|
132
|
-
});
|
|
133
|
-
}, [
|
|
134
|
-
script.changed,
|
|
135
|
-
existingFunctionUrl,
|
|
136
|
-
fn,
|
|
137
|
-
script
|
|
138
|
-
]);
|
|
139
|
-
};
|
|
140
|
-
var useDeployDeps = ({ script }) => {
|
|
141
|
-
const space = getSpace(script);
|
|
142
|
-
const [fn] = useQuery(space, Query.type(FunctionType, {
|
|
143
|
-
source: Ref.make(script)
|
|
144
|
-
}));
|
|
145
|
-
const client = useClient();
|
|
146
|
-
const existingFunctionUrl = useMemo(() => fn && getUserFunctionUrlInMetadata(getMeta(fn)), [
|
|
147
|
-
fn
|
|
148
|
-
]);
|
|
149
|
-
return {
|
|
150
|
-
space,
|
|
151
|
-
fn,
|
|
152
|
-
client,
|
|
153
|
-
existingFunctionUrl
|
|
154
|
-
};
|
|
155
|
-
};
|
|
156
|
-
|
|
157
|
-
// src/hooks/useToolbarState.ts
|
|
158
|
-
import { useMemo as useMemo2 } from "react";
|
|
159
|
-
import { live } from "@dxos/live-object";
|
|
160
|
-
var useToolbarState = (initialState = {}) => {
|
|
161
|
-
return useMemo2(() => live(initialState), []);
|
|
162
|
-
};
|
|
163
|
-
|
|
164
|
-
// src/hooks/format.ts
|
|
165
|
-
import { format } from "prettier";
|
|
166
|
-
import prettierPluginEstree from "prettier/plugins/estree";
|
|
167
|
-
import prettierPluginTypescript from "prettier/plugins/typescript";
|
|
168
|
-
import { log as log2 } from "@dxos/log";
|
|
169
|
-
import { createMenuAction as createMenuAction2 } from "@dxos/react-ui-menu";
|
|
170
|
-
var __dxlog_file2 = "/__w/dxos/dxos/packages/plugins/plugin-script/src/hooks/format.ts";
|
|
171
|
-
var createFormat = (script) => {
|
|
172
|
-
const formatAction = createMenuAction2("format", async () => {
|
|
173
|
-
if (!script.source) {
|
|
174
|
-
return;
|
|
175
|
-
}
|
|
176
|
-
try {
|
|
177
|
-
script.source.target.content = await format(script.source.target.content, {
|
|
178
|
-
parser: "typescript",
|
|
179
|
-
plugins: [
|
|
180
|
-
prettierPluginEstree,
|
|
181
|
-
prettierPluginTypescript
|
|
182
|
-
],
|
|
183
|
-
semi: true,
|
|
184
|
-
singleQuote: true
|
|
185
|
-
});
|
|
186
|
-
} catch (err) {
|
|
187
|
-
log2.catch(err, void 0, {
|
|
188
|
-
F: __dxlog_file2,
|
|
189
|
-
L: 34,
|
|
190
|
-
S: void 0,
|
|
191
|
-
C: (f, a) => f(...a)
|
|
192
|
-
});
|
|
193
|
-
}
|
|
194
|
-
}, {
|
|
195
|
-
label: [
|
|
196
|
-
"format label",
|
|
197
|
-
{
|
|
198
|
-
ns: SCRIPT_PLUGIN
|
|
199
|
-
}
|
|
200
|
-
],
|
|
201
|
-
icon: "ph--magic-wand--regular"
|
|
202
|
-
});
|
|
203
|
-
return {
|
|
204
|
-
nodes: [
|
|
205
|
-
formatAction
|
|
206
|
-
],
|
|
207
|
-
edges: [
|
|
208
|
-
{
|
|
209
|
-
source: "root",
|
|
210
|
-
target: "format"
|
|
211
|
-
}
|
|
212
|
-
]
|
|
213
|
-
};
|
|
214
|
-
};
|
|
215
|
-
|
|
216
|
-
// src/hooks/template.ts
|
|
217
|
-
import { Obj } from "@dxos/echo";
|
|
218
|
-
import { FUNCTIONS_PRESET_META_KEY } from "@dxos/functions";
|
|
219
|
-
import { createMenuItemGroup, createMenuAction as createMenuAction3 } from "@dxos/react-ui-menu";
|
|
220
|
-
var createTemplateSelectGroup = () => {
|
|
221
|
-
return createMenuItemGroup("template-select", {
|
|
222
|
-
label: [
|
|
223
|
-
"template select group label",
|
|
224
|
-
{
|
|
225
|
-
ns: SCRIPT_PLUGIN
|
|
226
|
-
}
|
|
227
|
-
],
|
|
228
|
-
variant: "dropdownMenu"
|
|
229
|
-
});
|
|
230
|
-
};
|
|
231
|
-
var createTemplateSelectActions = (script) => {
|
|
232
|
-
return templates.map((template) => {
|
|
233
|
-
return createMenuAction3(`template--${template.id}`, () => {
|
|
234
|
-
script.name = template.name;
|
|
235
|
-
script.source.target.content = template.source;
|
|
236
|
-
const metaKeys = Obj.getMeta(script).keys;
|
|
237
|
-
const oldPresetIndex = metaKeys.findIndex((key) => key.source === FUNCTIONS_PRESET_META_KEY);
|
|
238
|
-
if (oldPresetIndex >= 0) {
|
|
239
|
-
metaKeys.splice(oldPresetIndex, 1);
|
|
240
|
-
}
|
|
241
|
-
if (template.presetId) {
|
|
242
|
-
metaKeys.push({
|
|
243
|
-
source: FUNCTIONS_PRESET_META_KEY,
|
|
244
|
-
id: template.presetId
|
|
245
|
-
});
|
|
246
|
-
}
|
|
247
|
-
}, {
|
|
248
|
-
label: template.name,
|
|
249
|
-
value: template.id,
|
|
250
|
-
type: "template"
|
|
251
|
-
});
|
|
252
|
-
});
|
|
253
|
-
};
|
|
254
|
-
var createTemplateSelect = (script) => {
|
|
255
|
-
const templateSelectGroup = createTemplateSelectGroup();
|
|
256
|
-
const templateSelectActions = createTemplateSelectActions(script);
|
|
257
|
-
return {
|
|
258
|
-
nodes: [
|
|
259
|
-
templateSelectGroup,
|
|
260
|
-
...templateSelectActions
|
|
261
|
-
],
|
|
262
|
-
edges: [
|
|
263
|
-
{
|
|
264
|
-
source: "root",
|
|
265
|
-
target: "template-select"
|
|
266
|
-
},
|
|
267
|
-
...templateSelectActions.map((action) => ({
|
|
268
|
-
source: "template-select",
|
|
269
|
-
target: action.id
|
|
270
|
-
}))
|
|
271
|
-
]
|
|
272
|
-
};
|
|
273
|
-
};
|
|
274
|
-
|
|
275
|
-
export {
|
|
276
|
-
createDeploy,
|
|
277
|
-
useDeployState,
|
|
278
|
-
useDeployDeps,
|
|
279
|
-
createFormat,
|
|
280
|
-
createTemplateSelect,
|
|
281
|
-
useToolbarState
|
|
282
|
-
};
|
|
283
|
-
//# sourceMappingURL=chunk-3U6DTUH3.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/hooks/deploy.ts", "../../../src/hooks/useToolbarState.ts", "../../../src/hooks/format.ts", "../../../src/hooks/template.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { useEffect, useMemo } from 'react';\n\nimport { FunctionType, type ScriptType, getUserFunctionUrlInMetadata } from '@dxos/functions';\nimport { log } from '@dxos/log';\nimport { type Client, useClient } from '@dxos/react-client';\nimport { getMeta, getSpace, Query, Ref, type Space, useQuery } from '@dxos/react-client/echo';\nimport { type TFunction } from '@dxos/react-ui';\nimport { createMenuAction } from '@dxos/react-ui-menu';\nimport { errorMessageColors } from '@dxos/react-ui-theme';\n\nimport { SCRIPT_PLUGIN } from '../meta';\nimport { deployScript, getFunctionUrl, isScriptDeployed } from '../util';\n\nexport type DeployActionProperties = { type: 'deploy' } | { type: 'copy' };\n\nexport type DeployState = {\n deploying: boolean;\n deployed: boolean;\n functionUrl: string;\n error: string;\n};\n\nexport type CreateDeployOptions = {\n state: Partial<DeployState>;\n script: ScriptType;\n fn: FunctionType;\n space?: Space;\n existingFunctionUrl?: string;\n client: Client;\n t: TFunction;\n};\n\nexport const createDeploy = ({ state, script, space, fn, client, existingFunctionUrl, t }: CreateDeployOptions) => {\n // TODO(wittjosiah): Should this be an action?\n const errorItem = createMenuAction('error', () => {}, {\n label: state.error ?? ['no error label', { ns: SCRIPT_PLUGIN }],\n icon: 'ph--warning-circle--regular',\n hidden: !state.error,\n classNames: state.error && errorMessageColors,\n });\n\n const deployAction = createMenuAction<DeployActionProperties>(\n 'deploy',\n async () => {\n if (!script.source || !space) {\n return;\n }\n\n state.error = undefined;\n state.deploying = true;\n\n const result = await deployScript({ script, client, space, fn, existingFunctionUrl });\n\n if (!result.success) {\n log.catch(result.error);\n state.error = t('upload failed label');\n }\n\n state.deploying = false;\n },\n {\n type: 'deploy',\n label: [state.deploying ? 'pending label' : 'deploy label', { ns: SCRIPT_PLUGIN }],\n icon: state.deploying ? 'ph--spinner-gap--regular' : 'ph--cloud-arrow-up--regular',\n disabled: state.deploying,\n classNames: state.deploying ? '[&_svg]:animate-spin' : '',\n },\n );\n\n const copyAction = createMenuAction<DeployActionProperties>(\n 'copy',\n async () => {\n if (!state.functionUrl) {\n return;\n }\n await navigator.clipboard.writeText(state.functionUrl);\n },\n {\n type: 'copy',\n label: ['copy link label', { ns: SCRIPT_PLUGIN }],\n icon: 'ph--link--regular',\n disabled: !state.functionUrl,\n },\n );\n\n return {\n nodes: [errorItem, deployAction, copyAction],\n edges: [\n { source: 'root', target: 'error' },\n { source: 'root', target: 'deploy' },\n { source: 'root', target: 'copy' },\n ],\n };\n};\n\nexport const useDeployState = ({ state, script }: { state: Partial<DeployState>; script: ScriptType }) => {\n const { space, client, fn, existingFunctionUrl } = useDeployDeps({ script });\n useEffect(() => {\n if (!existingFunctionUrl) {\n return;\n }\n\n state.functionUrl = getFunctionUrl({\n script,\n fn,\n edgeUrl: client.config.values.runtime?.services?.edge?.url ?? '',\n });\n }, [existingFunctionUrl, space, fn, script, client.config.values.runtime?.services?.edge?.url]);\n\n useEffect(() => {\n state.deployed = isScriptDeployed({ script, fn });\n }, [script.changed, existingFunctionUrl, fn, script]);\n};\n\nexport const useDeployDeps = ({ script }: { script: ScriptType }) => {\n const space = getSpace(script);\n const [fn] = useQuery(space, Query.type(FunctionType, { source: Ref.make(script) }));\n const client = useClient();\n const existingFunctionUrl = useMemo(() => fn && getUserFunctionUrlInMetadata(getMeta(fn)), [fn]);\n return { space, fn, client, existingFunctionUrl };\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useMemo } from 'react';\n\nimport { live } from '@dxos/live-object';\n\nimport { type DeployState } from './deploy';\n\nexport type ScriptToolbarState = Partial<DeployState>;\n\n// TODO(burdon): Replace with context provider?\nexport const useToolbarState = (initialState: ScriptToolbarState = {}) => {\n return useMemo(() => live<ScriptToolbarState>(initialState), []);\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { format } from 'prettier';\nimport prettierPluginEstree from 'prettier/plugins/estree';\nimport prettierPluginTypescript from 'prettier/plugins/typescript';\n\nimport { type ScriptType } from '@dxos/functions';\nimport { log } from '@dxos/log';\nimport { createMenuAction } from '@dxos/react-ui-menu';\n\nimport { SCRIPT_PLUGIN } from '../meta';\n\nexport type FormatActionProperties = { type: 'format' };\n\nexport const createFormat = (script: ScriptType) => {\n const formatAction = createMenuAction(\n 'format',\n async () => {\n if (!script.source) {\n return;\n }\n\n try {\n script.source.target!.content = await format(script.source.target!.content, {\n parser: 'typescript',\n plugins: [prettierPluginEstree, prettierPluginTypescript],\n semi: true,\n singleQuote: true,\n });\n } catch (err: any) {\n // TODO(wittjosiah): Show error in UI.\n log.catch(err);\n }\n },\n {\n label: ['format label', { ns: SCRIPT_PLUGIN }],\n icon: 'ph--magic-wand--regular',\n },\n );\n\n return {\n nodes: [formatAction],\n edges: [\n {\n source: 'root',\n target: 'format',\n },\n ],\n };\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Obj } from '@dxos/echo';\nimport { FUNCTIONS_PRESET_META_KEY, type ScriptType } from '@dxos/functions';\nimport { createMenuItemGroup, createMenuAction } from '@dxos/react-ui-menu';\n\nimport { SCRIPT_PLUGIN } from '../meta';\nimport { templates } from '../templates';\n\nexport type TemplateActionProperties = { type: 'template'; value: string };\n\nconst createTemplateSelectGroup = () => {\n return createMenuItemGroup('template-select', {\n label: ['template select group label', { ns: SCRIPT_PLUGIN }],\n variant: 'dropdownMenu',\n });\n};\n\nconst createTemplateSelectActions = (script: ScriptType) => {\n return templates.map((template) => {\n return createMenuAction<TemplateActionProperties>(\n `template--${template.id}`,\n () => {\n script.name = template.name;\n script.source!.target!.content = template.source;\n const metaKeys = Obj.getMeta(script).keys;\n const oldPresetIndex = metaKeys.findIndex((key) => key.source === FUNCTIONS_PRESET_META_KEY);\n if (oldPresetIndex >= 0) {\n metaKeys.splice(oldPresetIndex, 1);\n }\n if (template.presetId) {\n metaKeys.push({ source: FUNCTIONS_PRESET_META_KEY, id: template.presetId });\n }\n },\n {\n label: template.name,\n value: template.id,\n type: 'template',\n },\n );\n });\n};\n\nexport const createTemplateSelect = (script: ScriptType) => {\n const templateSelectGroup = createTemplateSelectGroup();\n const templateSelectActions = createTemplateSelectActions(script);\n return {\n nodes: [templateSelectGroup, ...templateSelectActions],\n edges: [\n { source: 'root', target: 'template-select' },\n ...templateSelectActions.map((action) => ({ source: 'template-select', target: action.id })),\n ],\n };\n};\n"],
|
|
5
|
-
"mappings": "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",
|
|
6
|
-
"names": ["useEffect", "useMemo", "FunctionType", "getUserFunctionUrlInMetadata", "log", "useClient", "getMeta", "getSpace", "Query", "Ref", "useQuery", "createMenuAction", "errorMessageColors", "createDeploy", "state", "script", "space", "fn", "client", "existingFunctionUrl", "t", "errorItem", "createMenuAction", "label", "error", "ns", "SCRIPT_PLUGIN", "icon", "hidden", "classNames", "errorMessageColors", "deployAction", "source", "undefined", "deploying", "result", "deployScript", "success", "log", "catch", "type", "disabled", "copyAction", "functionUrl", "navigator", "clipboard", "writeText", "nodes", "edges", "target", "useDeployState", "useDeployDeps", "useEffect", "getFunctionUrl", "edgeUrl", "config", "values", "runtime", "services", "edge", "url", "deployed", "isScriptDeployed", "changed", "getSpace", "useQuery", "Query", "FunctionType", "Ref", "make", "useClient", "useMemo", "getUserFunctionUrlInMetadata", "getMeta", "useMemo", "live", "useToolbarState", "initialState", "useMemo", "live", "format", "prettierPluginEstree", "prettierPluginTypescript", "log", "createMenuAction", "createFormat", "script", "formatAction", "createMenuAction", "source", "target", "content", "format", "parser", "plugins", "prettierPluginEstree", "prettierPluginTypescript", "semi", "singleQuote", "err", "log", "catch", "label", "ns", "SCRIPT_PLUGIN", "icon", "nodes", "edges", "Obj", "FUNCTIONS_PRESET_META_KEY", "createMenuItemGroup", "createMenuAction", "createTemplateSelectGroup", "createMenuItemGroup", "label", "ns", "SCRIPT_PLUGIN", "variant", "createTemplateSelectActions", "script", "templates", "map", "template", "createMenuAction", "id", "name", "source", "target", "content", "metaKeys", "Obj", "getMeta", "keys", "oldPresetIndex", "findIndex", "key", "FUNCTIONS_PRESET_META_KEY", "splice", "presetId", "push", "value", "type", "createTemplateSelect", "templateSelectGroup", "templateSelectActions", "nodes", "edges", "action"]
|
|
7
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
meta
|
|
3
|
-
} from "./chunk-QYAREHGH.mjs";
|
|
4
|
-
|
|
5
|
-
// src/capabilities/capabilities.ts
|
|
6
|
-
import { defineCapability } from "@dxos/app-framework";
|
|
7
|
-
(function(ScriptCapabilities2) {
|
|
8
|
-
ScriptCapabilities2.Compiler = defineCapability(`${meta.id}/capability/compiler`);
|
|
9
|
-
})(ScriptCapabilities || (ScriptCapabilities = {}));
|
|
10
|
-
var ScriptCapabilities;
|
|
11
|
-
|
|
12
|
-
export {
|
|
13
|
-
ScriptCapabilities
|
|
14
|
-
};
|
|
15
|
-
//# sourceMappingURL=chunk-5TVBECWH.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/capabilities.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { defineCapability } from '@dxos/app-framework';\n\nimport { type Compiler } from '../compiler';\nimport { meta } from '../meta';\n\nexport namespace ScriptCapabilities {\n export const Compiler = defineCapability<Compiler>(`${meta.id}/capability/compiler`);\n}\n"],
|
|
5
|
-
"mappings": ";;;;;AAIA,SAASA,wBAAwB;UAKhBC,qBAAAA;sBACFC,WAAWC,iBAA2B,GAAGC,KAAKC,EAAE,sBAAsB;AACrF,GAFiBJ,uBAAAA,qBAAAA,CAAAA,EAAAA;;",
|
|
6
|
-
"names": ["defineCapability", "ScriptCapabilities", "Compiler", "defineCapability", "meta", "id"]
|
|
7
|
-
}
|