@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
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { RegistryContext } from '@effect-atom/atom-react';
|
|
6
|
+
import * as Cause from 'effect/Cause';
|
|
7
|
+
import * as Effect from 'effect/Effect';
|
|
8
|
+
import * as Exit from 'effect/Exit';
|
|
9
|
+
import type * as Types from 'effect/Types';
|
|
10
|
+
import React, { useCallback, useContext, useMemo, useState } from 'react';
|
|
11
|
+
|
|
12
|
+
import { type SurfaceComponentProps } from '@dxos/app-toolkit/ui';
|
|
13
|
+
import { AgentFunctions } from '@dxos/assistant-toolkit';
|
|
14
|
+
import { Blueprint, Prompt } from '@dxos/blueprints';
|
|
15
|
+
import { Filter, Obj, Query, Ref } from '@dxos/echo';
|
|
16
|
+
import { QueryBuilder } from '@dxos/echo-query';
|
|
17
|
+
import { type FunctionDefinition, FunctionInvocationService, TracingService } from '@dxos/functions';
|
|
18
|
+
import { invariant } from '@dxos/invariant';
|
|
19
|
+
import { log } from '@dxos/log';
|
|
20
|
+
import { useComputeRuntimeCallback } from '@dxos/plugin-automation';
|
|
21
|
+
import { Graph } from '@dxos/plugin-explorer/types';
|
|
22
|
+
import { DropdownMenu, IconButton, Panel, Toolbar, useTranslation } from '@dxos/react-ui';
|
|
23
|
+
import { useAttention } from '@dxos/react-ui-attention';
|
|
24
|
+
import { Text, ViewModel } from '@dxos/schema';
|
|
25
|
+
import { isNonNullable } from '@dxos/util';
|
|
26
|
+
|
|
27
|
+
import { NotebookMenu, NotebookStack, type NotebookStackProps, type TypescriptEditorProps } from '../../components';
|
|
28
|
+
import { meta } from '../../meta';
|
|
29
|
+
import { ComputeGraph } from '../../notebook';
|
|
30
|
+
import { type Notebook } from '../../types';
|
|
31
|
+
|
|
32
|
+
const INCLUDE_BLUEPRINTS = [
|
|
33
|
+
'org.dxos.blueprint.assistant',
|
|
34
|
+
'org.dxos.blueprint.database',
|
|
35
|
+
'org.dxos.blueprint.markdown',
|
|
36
|
+
];
|
|
37
|
+
|
|
38
|
+
// TODO(burdon): Support calling named deployed functions (as with sheet).
|
|
39
|
+
|
|
40
|
+
export type NotebookContainerProps = SurfaceComponentProps<Notebook.Notebook, Pick<TypescriptEditorProps, 'env'>>;
|
|
41
|
+
|
|
42
|
+
export const NotebookContainer = ({ role, subject: notebook, attendableId, env }: NotebookContainerProps) => {
|
|
43
|
+
const { t } = useTranslation(meta.id);
|
|
44
|
+
const registry = useContext(RegistryContext);
|
|
45
|
+
const db = Obj.getDatabase(notebook);
|
|
46
|
+
const { hasAttention } = useAttention(attendableId);
|
|
47
|
+
|
|
48
|
+
// TODO(burdon): Consolidate execution and state (with graph).
|
|
49
|
+
// Generalize ComputeGraph evaluation function (using effects).
|
|
50
|
+
const graph = useMemo(() => notebook && new ComputeGraph(notebook, registry), [notebook, registry]);
|
|
51
|
+
|
|
52
|
+
const [queryValues, setQueryValues] = useState<Record<string, any>>({});
|
|
53
|
+
const handleExecQueries = useCallback(async () => {
|
|
54
|
+
invariant(db);
|
|
55
|
+
|
|
56
|
+
const builder = new QueryBuilder();
|
|
57
|
+
for (const cell of notebook?.cells ?? []) {
|
|
58
|
+
if (cell.type === 'query') {
|
|
59
|
+
if (cell.source?.target) {
|
|
60
|
+
const source = cell.source.target.content;
|
|
61
|
+
const { name, filter } = builder.build(source);
|
|
62
|
+
if (filter) {
|
|
63
|
+
const ast = Query.select(filter).ast;
|
|
64
|
+
const graph = cell.graph?.target;
|
|
65
|
+
if (!graph) {
|
|
66
|
+
const { view } = await ViewModel.makeFromDatabase({ db });
|
|
67
|
+
const newGraph = Graph.make({ query: { ast }, view });
|
|
68
|
+
Obj.change(notebook!, (n) => {
|
|
69
|
+
const c = n.cells.find((c) => c.id === cell.id);
|
|
70
|
+
if (c) {
|
|
71
|
+
c.graph = Ref.make(newGraph);
|
|
72
|
+
c.name = name;
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
} else {
|
|
76
|
+
Obj.change(graph, (g) => {
|
|
77
|
+
g.query.ast = ast as Obj.Mutable<typeof ast>;
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
if (cell.name && cell.graph?.target) {
|
|
84
|
+
const graph = Obj.getSnapshot(cell.graph?.target);
|
|
85
|
+
const query = Query.fromAst(graph.query.ast);
|
|
86
|
+
const objects = await db.query(query).run();
|
|
87
|
+
const objectIds = objects?.map((obj) => obj.id);
|
|
88
|
+
setQueryValues((prev) => ({ ...prev, [cell.name!]: objectIds }));
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}, [db, notebook, graph]);
|
|
93
|
+
|
|
94
|
+
const [promptResults, setPromptResults] = useState<Record<string, string>>({});
|
|
95
|
+
const handleExecPrompts = useComputeRuntimeCallback(
|
|
96
|
+
db?.spaceId,
|
|
97
|
+
Effect.fnUntraced(function* () {
|
|
98
|
+
invariant(graph);
|
|
99
|
+
|
|
100
|
+
const prompts =
|
|
101
|
+
notebook?.cells
|
|
102
|
+
.filter((cell) => cell.type === 'prompt')
|
|
103
|
+
.map((cell) => cell.prompt)
|
|
104
|
+
.filter(isNonNullable) ?? [];
|
|
105
|
+
|
|
106
|
+
for (const prompt of prompts) {
|
|
107
|
+
yield* runPrompt({
|
|
108
|
+
prompt,
|
|
109
|
+
input: { ...queryValues, ...graph.getValuesByName() },
|
|
110
|
+
onResult: (result) =>
|
|
111
|
+
setPromptResults((prev) => ({
|
|
112
|
+
...prev,
|
|
113
|
+
[prompt.dxn.toString()]: result,
|
|
114
|
+
})),
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
}),
|
|
118
|
+
[notebook, graph, queryValues],
|
|
119
|
+
);
|
|
120
|
+
|
|
121
|
+
// TODO(burdon): Cache values in context (preserve when switched).
|
|
122
|
+
const handleCompute = useCallback(async () => {
|
|
123
|
+
// TODO(burdon): Generalize executors (dependencies).
|
|
124
|
+
await graph?.evaluate();
|
|
125
|
+
await handleExecQueries();
|
|
126
|
+
await handleExecPrompts();
|
|
127
|
+
}, [graph, handleExecQueries, handleExecPrompts]);
|
|
128
|
+
|
|
129
|
+
const handleRearrange = useCallback<NonNullable<NotebookStackProps['onRearrange']>>(
|
|
130
|
+
(source, target) => {
|
|
131
|
+
invariant(notebook);
|
|
132
|
+
const from = notebook.cells.findIndex((cell) => cell.id === source.id);
|
|
133
|
+
const to = notebook.cells.findIndex((cell) => cell.id === target.id);
|
|
134
|
+
if (from != null && to != null) {
|
|
135
|
+
Obj.change(notebook, (n) => {
|
|
136
|
+
const cell = n.cells.splice(from, 1)[0];
|
|
137
|
+
if (cell) {
|
|
138
|
+
n.cells.splice(to, 0, cell);
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
[notebook],
|
|
144
|
+
);
|
|
145
|
+
|
|
146
|
+
const handleCellInsert = useCallback<NonNullable<NotebookStackProps['onCellInsert']>>(
|
|
147
|
+
async (type, after) => {
|
|
148
|
+
invariant(notebook);
|
|
149
|
+
const cell: Types.Mutable<Notebook.Cell> = { id: crypto.randomUUID(), type };
|
|
150
|
+
switch (type) {
|
|
151
|
+
case 'markdown':
|
|
152
|
+
case 'script':
|
|
153
|
+
case 'query': {
|
|
154
|
+
cell.source = Ref.make(Text.make());
|
|
155
|
+
break;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
case 'prompt': {
|
|
159
|
+
if (db) {
|
|
160
|
+
const objects = await db.query(Query.select(Filter.type(Blueprint.Blueprint))).run();
|
|
161
|
+
const blueprints = objects
|
|
162
|
+
.filter((blueprint) => INCLUDE_BLUEPRINTS.includes(blueprint.key))
|
|
163
|
+
.map((blueprint) => Ref.make(blueprint));
|
|
164
|
+
cell.prompt = Ref.make(Prompt.make({ instructions: '', blueprints }));
|
|
165
|
+
}
|
|
166
|
+
break;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
const idx = after ? notebook.cells.findIndex((cell) => cell.id === after) : notebook.cells.length;
|
|
171
|
+
Obj.change(notebook, (n) => {
|
|
172
|
+
n.cells.splice(idx, 0, cell);
|
|
173
|
+
});
|
|
174
|
+
},
|
|
175
|
+
[db, notebook],
|
|
176
|
+
);
|
|
177
|
+
|
|
178
|
+
const handleCellDelete = useCallback<NonNullable<NotebookStackProps['onCellDelete']>>(
|
|
179
|
+
(id) => {
|
|
180
|
+
invariant(notebook);
|
|
181
|
+
const idx = notebook.cells.findIndex((cell) => cell.id === id);
|
|
182
|
+
if (idx !== -1) {
|
|
183
|
+
Obj.change(notebook, (n) => {
|
|
184
|
+
n.cells.splice(idx, 1);
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
[notebook],
|
|
189
|
+
);
|
|
190
|
+
|
|
191
|
+
return (
|
|
192
|
+
<Panel.Root role={role} className='dx-document'>
|
|
193
|
+
<Panel.Toolbar asChild>
|
|
194
|
+
<Toolbar.Root disabled={!hasAttention}>
|
|
195
|
+
<DropdownMenu.Root>
|
|
196
|
+
<DropdownMenu.Trigger asChild>
|
|
197
|
+
<IconButton icon='ph--plus--regular' iconOnly label={t('notebook cell insert label')} />
|
|
198
|
+
</DropdownMenu.Trigger>
|
|
199
|
+
<NotebookMenu onCellInsert={handleCellInsert} />
|
|
200
|
+
</DropdownMenu.Root>
|
|
201
|
+
<Toolbar.IconButton
|
|
202
|
+
icon='ph--play--fill'
|
|
203
|
+
iconOnly
|
|
204
|
+
label={t('compute label')}
|
|
205
|
+
classNames='text-success-text'
|
|
206
|
+
onClick={handleCompute}
|
|
207
|
+
/>
|
|
208
|
+
</Toolbar.Root>
|
|
209
|
+
</Panel.Toolbar>
|
|
210
|
+
<Panel.Content asChild>
|
|
211
|
+
<NotebookStack
|
|
212
|
+
db={db}
|
|
213
|
+
notebook={notebook}
|
|
214
|
+
graph={graph}
|
|
215
|
+
env={env}
|
|
216
|
+
promptResults={promptResults}
|
|
217
|
+
onRearrange={handleRearrange}
|
|
218
|
+
onCellInsert={handleCellInsert}
|
|
219
|
+
onCellDelete={handleCellDelete}
|
|
220
|
+
/>
|
|
221
|
+
</Panel.Content>
|
|
222
|
+
</Panel.Root>
|
|
223
|
+
);
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
// TODO(wittjosiah): Factor out. Copied from PromptArticle in plugin-assistant.
|
|
227
|
+
const runPrompt = Effect.fn(function* ({
|
|
228
|
+
prompt,
|
|
229
|
+
input,
|
|
230
|
+
onResult,
|
|
231
|
+
}: {
|
|
232
|
+
prompt: Ref.Ref<Prompt.Prompt>;
|
|
233
|
+
input: Record<string, any>;
|
|
234
|
+
onResult: (result: string) => void;
|
|
235
|
+
}) {
|
|
236
|
+
const inputData: FunctionDefinition.Input<typeof AgentFunctions.Prompt> = { prompt, input };
|
|
237
|
+
const tracer = yield* TracingService;
|
|
238
|
+
const trace = yield* tracer.traceInvocationStart({
|
|
239
|
+
target: undefined,
|
|
240
|
+
payload: {
|
|
241
|
+
data: {},
|
|
242
|
+
},
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
// Invoke the function.
|
|
246
|
+
const result = yield* FunctionInvocationService.invokeFunction(AgentFunctions.Prompt, inputData).pipe(
|
|
247
|
+
Effect.provide(trace.invocationTraceQueue ? TracingService.layerInvocation(trace) : TracingService.layerNoop),
|
|
248
|
+
Effect.exit,
|
|
249
|
+
);
|
|
250
|
+
|
|
251
|
+
Exit.match(result, {
|
|
252
|
+
onFailure: (cause) => {
|
|
253
|
+
const error = Cause.prettyErrors(cause)[0];
|
|
254
|
+
log.error(error.message, error.cause ?? error.stack);
|
|
255
|
+
onResult(error.message);
|
|
256
|
+
},
|
|
257
|
+
onSuccess: (result: any) => {
|
|
258
|
+
onResult(result.note);
|
|
259
|
+
},
|
|
260
|
+
});
|
|
261
|
+
|
|
262
|
+
yield* tracer.traceInvocationEnd({
|
|
263
|
+
trace,
|
|
264
|
+
// TODO(dmaretskyi): Might miss errors.
|
|
265
|
+
exception: Exit.isFailure(result) ? Cause.prettyErrors(result.cause)[0] : undefined,
|
|
266
|
+
});
|
|
267
|
+
});
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { useMemo } from 'react';
|
|
6
|
+
|
|
7
|
+
import { type SurfaceComponentProps } from '@dxos/app-toolkit/ui';
|
|
8
|
+
import { Obj } from '@dxos/echo';
|
|
9
|
+
import { createDocAccessor } from '@dxos/echo-db';
|
|
10
|
+
import { type Script } from '@dxos/functions';
|
|
11
|
+
import { getSpace } from '@dxos/react-client/echo';
|
|
12
|
+
import { useIdentity } from '@dxos/react-client/halo';
|
|
13
|
+
import { Panel } from '@dxos/react-ui';
|
|
14
|
+
import { createDataExtensions, listener, stackItemContentEditorClassNames } from '@dxos/ui-editor';
|
|
15
|
+
|
|
16
|
+
import { ScriptToolbar, TypescriptEditor, type TypescriptEditorProps } from '../../components';
|
|
17
|
+
import { useDeployState, useToolbarState } from '../../hooks';
|
|
18
|
+
import { type ScriptSettings } from '../../types';
|
|
19
|
+
|
|
20
|
+
export type ScriptEditorProps = SurfaceComponentProps<
|
|
21
|
+
Script.Script,
|
|
22
|
+
{
|
|
23
|
+
settings?: ScriptSettings;
|
|
24
|
+
} & Pick<TypescriptEditorProps, 'env'>
|
|
25
|
+
>;
|
|
26
|
+
|
|
27
|
+
export const ScriptContainer = ({
|
|
28
|
+
role,
|
|
29
|
+
subject: script,
|
|
30
|
+
settings = { editorInputMode: 'vscode' },
|
|
31
|
+
env,
|
|
32
|
+
}: ScriptEditorProps) => {
|
|
33
|
+
const identity = useIdentity();
|
|
34
|
+
const space = getSpace(script);
|
|
35
|
+
const state = useToolbarState();
|
|
36
|
+
useDeployState({ script, state });
|
|
37
|
+
|
|
38
|
+
const extensions = useMemo(() => {
|
|
39
|
+
if (!script.source.target) {
|
|
40
|
+
return [];
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return [
|
|
44
|
+
createDataExtensions({
|
|
45
|
+
id: script.id,
|
|
46
|
+
text: createDocAccessor(script.source.target, ['content']),
|
|
47
|
+
messenger: space,
|
|
48
|
+
identity,
|
|
49
|
+
}),
|
|
50
|
+
listener({
|
|
51
|
+
onChange: ({ text }) => {
|
|
52
|
+
if (script.source.target?.content !== text) {
|
|
53
|
+
Obj.change(script, (s) => {
|
|
54
|
+
s.changed = true;
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
}),
|
|
59
|
+
];
|
|
60
|
+
}, [identity, space, script, script.source.target]);
|
|
61
|
+
|
|
62
|
+
if (!extensions.length) {
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return (
|
|
67
|
+
<Panel.Root role={role} className='dx-document'>
|
|
68
|
+
<Panel.Toolbar asChild>
|
|
69
|
+
<ScriptToolbar state={state} role={role} script={script} />
|
|
70
|
+
</Panel.Toolbar>
|
|
71
|
+
<Panel.Content asChild>
|
|
72
|
+
<TypescriptEditor
|
|
73
|
+
id={script.id}
|
|
74
|
+
env={env}
|
|
75
|
+
initialValue={script.source?.target?.content}
|
|
76
|
+
extensions={extensions}
|
|
77
|
+
classNames={stackItemContentEditorClassNames(role)}
|
|
78
|
+
inputMode={settings.editorInputMode}
|
|
79
|
+
toolbar
|
|
80
|
+
/>
|
|
81
|
+
</Panel.Content>
|
|
82
|
+
</Panel.Root>
|
|
83
|
+
);
|
|
84
|
+
};
|
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2024 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Octokit } from '@octokit/core';
|
|
6
|
+
import React, { type ChangeEvent, useCallback, useState } from 'react';
|
|
7
|
+
|
|
8
|
+
import { ToolId } from '@dxos/ai';
|
|
9
|
+
import { useOperationInvoker } from '@dxos/app-framework/ui';
|
|
10
|
+
import { SettingsOperation } from '@dxos/app-toolkit';
|
|
11
|
+
import { Blueprint, Template } from '@dxos/blueprints';
|
|
12
|
+
import { Filter, Obj, Ref } from '@dxos/echo';
|
|
13
|
+
import { Function, type Script, getUserFunctionIdInMetadata } from '@dxos/functions';
|
|
14
|
+
import { getInvocationUrl } from '@dxos/functions-runtime';
|
|
15
|
+
import { log } from '@dxos/log';
|
|
16
|
+
import { useClient } from '@dxos/react-client';
|
|
17
|
+
import { useQuery } from '@dxos/react-client/echo';
|
|
18
|
+
import { Button, Clipboard, Input, useAsyncEffect, useControlledState, useTranslation } from '@dxos/react-ui';
|
|
19
|
+
import { AccessToken } from '@dxos/types';
|
|
20
|
+
import { kebabize } from '@dxos/util';
|
|
21
|
+
|
|
22
|
+
import { meta } from '../../meta';
|
|
23
|
+
|
|
24
|
+
export type ScriptObjectSettingsProps = {
|
|
25
|
+
object: Script.Script;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export const ScriptObjectSettings = ({ object }: ScriptObjectSettingsProps) => {
|
|
29
|
+
return (
|
|
30
|
+
<>
|
|
31
|
+
<Binding object={object} />
|
|
32
|
+
<BlueprintEditor object={object} />
|
|
33
|
+
<Publishing object={object} />
|
|
34
|
+
</>
|
|
35
|
+
);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const BlueprintEditor = ({ object }: ScriptObjectSettingsProps) => {
|
|
39
|
+
const { t } = useTranslation(meta.id);
|
|
40
|
+
const db = Obj.getDatabase(object);
|
|
41
|
+
const [fn] = useQuery(db, Filter.type(Function.Function, { source: Ref.make(object) }));
|
|
42
|
+
const blueprints = useQuery(db, Filter.type(Blueprint.Blueprint));
|
|
43
|
+
|
|
44
|
+
const [creating, setCreating] = useState(false);
|
|
45
|
+
const [instructions, setInstructions] = useState<string>(`You can run the script "${object.name ?? 'script'}".`);
|
|
46
|
+
const blueprintKey = `org.dxos.blueprint.${kebabize(object.name ?? 'script')}`;
|
|
47
|
+
const existingBlueprint = blueprints.find((bp) => bp.key === blueprintKey);
|
|
48
|
+
|
|
49
|
+
useAsyncEffect(async () => {
|
|
50
|
+
if (!existingBlueprint) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
const source = await existingBlueprint.instructions.source.load();
|
|
54
|
+
setInstructions(source.content ?? '');
|
|
55
|
+
}, [existingBlueprint]);
|
|
56
|
+
|
|
57
|
+
const handleSave = useCallback(async () => {
|
|
58
|
+
if (!db) {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
setCreating(true);
|
|
63
|
+
try {
|
|
64
|
+
if (existingBlueprint) {
|
|
65
|
+
const text = await existingBlueprint.instructions.source.load();
|
|
66
|
+
Obj.change(text, (t) => {
|
|
67
|
+
t.content = instructions;
|
|
68
|
+
});
|
|
69
|
+
if (fn?.key) {
|
|
70
|
+
const toolId = ToolId.make(fn.key);
|
|
71
|
+
if (!existingBlueprint.tools?.includes(toolId)) {
|
|
72
|
+
Obj.change(existingBlueprint, (b) => {
|
|
73
|
+
b.tools = [...(b.tools ?? []), toolId];
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
} else if (fn?.key) {
|
|
78
|
+
db.add(
|
|
79
|
+
Blueprint.make({
|
|
80
|
+
key: blueprintKey,
|
|
81
|
+
name: object.name ?? 'Script',
|
|
82
|
+
instructions: Template.make({
|
|
83
|
+
source: instructions,
|
|
84
|
+
}),
|
|
85
|
+
tools: [ToolId.make(fn.key)],
|
|
86
|
+
}),
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
await db.flush();
|
|
90
|
+
} finally {
|
|
91
|
+
setCreating(false);
|
|
92
|
+
}
|
|
93
|
+
}, [db, existingBlueprint, fn, blueprintKey, object.name, instructions]);
|
|
94
|
+
|
|
95
|
+
return (
|
|
96
|
+
<div className='flex flex-col gap-4 my-form-padding'>
|
|
97
|
+
<div>
|
|
98
|
+
<h2>{t('blueprint editor label', { default: 'Blueprint' })}</h2>
|
|
99
|
+
<p className='text-description text-sm'>
|
|
100
|
+
{t('blueprint editor description', {
|
|
101
|
+
default: 'Create a blueprint that exposes this script as a tool.',
|
|
102
|
+
})}
|
|
103
|
+
</p>
|
|
104
|
+
</div>
|
|
105
|
+
<Input.Root>
|
|
106
|
+
<div role='none' className='flex flex-col gap-1'>
|
|
107
|
+
<Input.Label>{t('blueprint instructions label', { default: 'Instructions' })}</Input.Label>
|
|
108
|
+
<Input.TextArea
|
|
109
|
+
placeholder={t('blueprint instructions placeholder', {
|
|
110
|
+
default: 'Describe how this tool should be used.',
|
|
111
|
+
})}
|
|
112
|
+
rows={6}
|
|
113
|
+
value={instructions}
|
|
114
|
+
onChange={(event) => setInstructions(event.target.value)}
|
|
115
|
+
classNames='resize-y'
|
|
116
|
+
/>
|
|
117
|
+
</div>
|
|
118
|
+
</Input.Root>
|
|
119
|
+
<div className='flex justify-end gap-2'>
|
|
120
|
+
<Button disabled={(!existingBlueprint && !fn?.key) || creating} onClick={handleSave}>
|
|
121
|
+
{t(creating ? 'creating label' : 'create blueprint label', {
|
|
122
|
+
default: creating ? 'Creating…' : 'Create blueprint',
|
|
123
|
+
})}
|
|
124
|
+
</Button>
|
|
125
|
+
</div>
|
|
126
|
+
</div>
|
|
127
|
+
);
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
const Binding = ({ object }: ScriptObjectSettingsProps) => {
|
|
131
|
+
const { t } = useTranslation(meta.id);
|
|
132
|
+
const client = useClient();
|
|
133
|
+
const db = Obj.getDatabase(object);
|
|
134
|
+
const [fn] = useQuery(db, Filter.type(Function.Function, { source: Ref.make(object) }));
|
|
135
|
+
|
|
136
|
+
const functionId = fn && getUserFunctionIdInMetadata(Obj.getMeta(fn));
|
|
137
|
+
const functionUrl =
|
|
138
|
+
functionId &&
|
|
139
|
+
getInvocationUrl(functionId, client.config.values.runtime?.services?.edge?.url ?? '', {
|
|
140
|
+
spaceId: db?.spaceId,
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
const [binding, setBinding] = useControlledState(fn?.binding ?? '');
|
|
144
|
+
const handleBindingChange = useCallback(
|
|
145
|
+
(event: ChangeEvent<HTMLInputElement>) => {
|
|
146
|
+
setBinding(event.target.value);
|
|
147
|
+
},
|
|
148
|
+
[setBinding],
|
|
149
|
+
);
|
|
150
|
+
|
|
151
|
+
const handleBindingBlur = useCallback(() => {
|
|
152
|
+
Obj.change(fn, (f) => {
|
|
153
|
+
f.binding = binding;
|
|
154
|
+
});
|
|
155
|
+
}, [fn, binding]);
|
|
156
|
+
|
|
157
|
+
if (!fn || !functionUrl) {
|
|
158
|
+
return null;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
// TODO(burdon): Use form.
|
|
162
|
+
return (
|
|
163
|
+
<div role='form' className='flex flex-col gap-2 my-form-padding'>
|
|
164
|
+
<h2>{t('remote function settings heading')}</h2>
|
|
165
|
+
<Input.Root>
|
|
166
|
+
<div role='none' className='flex flex-col gap-1'>
|
|
167
|
+
<Input.Label>{t('function url label')}</Input.Label>
|
|
168
|
+
<div role='none' className='flex gap-1'>
|
|
169
|
+
<Input.TextInput
|
|
170
|
+
disabled
|
|
171
|
+
value={functionUrl}
|
|
172
|
+
onChange={(event) => {
|
|
173
|
+
Obj.change(fn, (f) => {
|
|
174
|
+
f.name = event.target.value;
|
|
175
|
+
});
|
|
176
|
+
}}
|
|
177
|
+
/>
|
|
178
|
+
<Clipboard.IconButton value={functionUrl} />
|
|
179
|
+
</div>
|
|
180
|
+
</div>
|
|
181
|
+
</Input.Root>
|
|
182
|
+
<Input.Root>
|
|
183
|
+
<div role='none' className='flex flex-col gap-1'>
|
|
184
|
+
<Input.Label>{t('function binding label')}</Input.Label>
|
|
185
|
+
<Input.TextInput
|
|
186
|
+
placeholder={t('function binding placeholder')}
|
|
187
|
+
value={binding}
|
|
188
|
+
onChange={handleBindingChange}
|
|
189
|
+
onBlur={handleBindingBlur}
|
|
190
|
+
/>
|
|
191
|
+
</div>
|
|
192
|
+
</Input.Root>
|
|
193
|
+
</div>
|
|
194
|
+
);
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
// TODO(burdon): Move to separate tab?
|
|
198
|
+
const Publishing = ({ object }: ScriptObjectSettingsProps) => {
|
|
199
|
+
const { t } = useTranslation(meta.id);
|
|
200
|
+
const { invokePromise } = useOperationInvoker();
|
|
201
|
+
const db = Obj.getDatabase(object);
|
|
202
|
+
const [githubToken] = useQuery(db, Filter.type(AccessToken.AccessToken, { source: 'github.com' }));
|
|
203
|
+
const gistKey = Obj.getMeta(object).keys.find(({ source }) => source === 'github.com');
|
|
204
|
+
const [gistUrl, setGistUrl] = useState<string | undefined>();
|
|
205
|
+
|
|
206
|
+
useAsyncEffect(async () => {
|
|
207
|
+
const token = githubToken?.token;
|
|
208
|
+
const gistId = gistKey?.id;
|
|
209
|
+
if (!token || !gistId) {
|
|
210
|
+
setGistUrl(undefined);
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
try {
|
|
215
|
+
const octokit = new Octokit({ auth: githubToken.token });
|
|
216
|
+
const response = await octokit.request('GET /gists/{gist_id}', {
|
|
217
|
+
gist_id: gistId,
|
|
218
|
+
});
|
|
219
|
+
setGistUrl(response.data.html_url);
|
|
220
|
+
} catch (err) {
|
|
221
|
+
log.catch(err);
|
|
222
|
+
setGistUrl(undefined);
|
|
223
|
+
}
|
|
224
|
+
}, [githubToken, gistKey]);
|
|
225
|
+
|
|
226
|
+
const handleOpenTokenManager = useCallback(
|
|
227
|
+
() =>
|
|
228
|
+
invokePromise(SettingsOperation.Open, {
|
|
229
|
+
plugin: 'org.dxos.plugin.token-manager',
|
|
230
|
+
}),
|
|
231
|
+
[invokePromise],
|
|
232
|
+
);
|
|
233
|
+
|
|
234
|
+
const [publishing, setPublishing] = useState(false);
|
|
235
|
+
const handlePublish = useCallback(async () => {
|
|
236
|
+
setPublishing(true);
|
|
237
|
+
const octokit = new Octokit({ auth: githubToken.token });
|
|
238
|
+
const source = await object.source.load();
|
|
239
|
+
const filename = object.name ? kebabize(object.name) : 'composer-script';
|
|
240
|
+
const files = { [`${filename}.ts`]: { content: source.content } };
|
|
241
|
+
|
|
242
|
+
try {
|
|
243
|
+
// TODO(wittjosiah): Factor out to intent.
|
|
244
|
+
const meta = Obj.getMeta(object);
|
|
245
|
+
const githubKey = meta.keys.find(({ source }) => source === 'github.com');
|
|
246
|
+
const gistId = githubKey?.id;
|
|
247
|
+
if (gistId) {
|
|
248
|
+
await octokit.request('PATCH /gists/{gist_id}', {
|
|
249
|
+
gist_id: gistId,
|
|
250
|
+
files,
|
|
251
|
+
});
|
|
252
|
+
} else {
|
|
253
|
+
const response = await octokit.request('POST /gists', {
|
|
254
|
+
public: true,
|
|
255
|
+
files,
|
|
256
|
+
});
|
|
257
|
+
const gistId = response.data.id;
|
|
258
|
+
if (gistId) {
|
|
259
|
+
Obj.change(object, (obj) => {
|
|
260
|
+
Obj.getMeta(obj).keys.push({ source: 'github.com', id: gistId });
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
} finally {
|
|
265
|
+
setPublishing(false);
|
|
266
|
+
}
|
|
267
|
+
}, [object, githubToken]);
|
|
268
|
+
|
|
269
|
+
return (
|
|
270
|
+
<div className='flex flex-col gap-4 my-form-padding'>
|
|
271
|
+
<div>
|
|
272
|
+
<h2>{t('script publish settings label')}</h2>
|
|
273
|
+
<p className='text-description text-sm'>{t('script publish settings description')}</p>
|
|
274
|
+
</div>
|
|
275
|
+
{!githubToken && (
|
|
276
|
+
<div className='flex flex-col gap-2'>
|
|
277
|
+
<span>{t('no github token label')}</span>
|
|
278
|
+
<Button onClick={handleOpenTokenManager}>{t('open token manager label')}</Button>
|
|
279
|
+
</div>
|
|
280
|
+
)}
|
|
281
|
+
{githubToken && (
|
|
282
|
+
<div className='flex justify-end gap-2'>
|
|
283
|
+
{gistUrl && <Clipboard.IconButton value={gistUrl} />}
|
|
284
|
+
<Button disabled={publishing} onClick={handlePublish}>
|
|
285
|
+
{t(publishing ? 'publishing label' : 'publish label')}
|
|
286
|
+
</Button>
|
|
287
|
+
</div>
|
|
288
|
+
)}
|
|
289
|
+
</div>
|
|
290
|
+
);
|
|
291
|
+
};
|