@dxos/plugin-script 0.8.4-main.c1de068 → 0.8.4-main.c85a9c8dae
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -13
- package/dist/lib/browser/DeploymentDialog-IIOXAS47.mjs +138 -0
- package/dist/lib/browser/DeploymentDialog-IIOXAS47.mjs.map +7 -0
- package/dist/lib/browser/NotebookContainer-VVZOKGRC.mjs +850 -0
- package/dist/lib/browser/NotebookContainer-VVZOKGRC.mjs.map +7 -0
- package/dist/lib/browser/ScriptContainer-A5SSIUH6.mjs +93 -0
- package/dist/lib/browser/ScriptContainer-A5SSIUH6.mjs.map +7 -0
- package/dist/lib/browser/ScriptObjectSettings-HYYC7KXC.mjs +294 -0
- package/dist/lib/browser/ScriptObjectSettings-HYYC7KXC.mjs.map +7 -0
- package/dist/lib/browser/ScriptPluginSettings-UTWA7CBT.mjs +55 -0
- package/dist/lib/browser/ScriptPluginSettings-UTWA7CBT.mjs.map +7 -0
- package/dist/lib/browser/ScriptProperties-HREPUE65.mjs +28 -0
- package/dist/lib/browser/ScriptProperties-HREPUE65.mjs.map +7 -0
- package/dist/lib/browser/TestContainer-D4Y2K2TT.mjs +39 -0
- package/dist/lib/browser/TestContainer-D4Y2K2TT.mjs.map +7 -0
- package/dist/lib/browser/app-graph-builder-66ZDI72K.mjs +69 -0
- package/dist/lib/browser/app-graph-builder-66ZDI72K.mjs.map +7 -0
- package/dist/lib/browser/blueprint-definition-YMZEJBAZ.mjs +17 -0
- package/dist/lib/browser/blueprint-definition-YMZEJBAZ.mjs.map +7 -0
- package/dist/lib/browser/blueprints/index.mjs +8 -0
- package/dist/lib/browser/chunk-6IXFDTAI.mjs +113 -0
- package/dist/lib/browser/chunk-6IXFDTAI.mjs.map +7 -0
- package/dist/lib/browser/{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-J5LGTIGS.mjs +10 -0
- package/dist/lib/browser/chunk-J7PGML5B.mjs +105 -0
- package/dist/lib/browser/chunk-J7PGML5B.mjs.map +7 -0
- package/dist/lib/browser/chunk-MUEVLYXJ.mjs +397 -0
- package/dist/lib/browser/chunk-MUEVLYXJ.mjs.map +7 -0
- package/dist/lib/browser/chunk-PLDBKKYO.mjs +789 -0
- package/dist/lib/browser/chunk-PLDBKKYO.mjs.map +7 -0
- package/dist/lib/browser/chunk-Q66L5EUR.mjs +20 -0
- package/dist/lib/browser/chunk-Q66L5EUR.mjs.map +7 -0
- package/dist/lib/browser/chunk-TW27W3EL.mjs +29 -0
- package/dist/lib/browser/chunk-TW27W3EL.mjs.map +7 -0
- package/dist/lib/browser/{chunk-QYAREHGH.mjs → chunk-WYR4QHPE.mjs} +8 -5
- package/dist/lib/browser/chunk-WYR4QHPE.mjs.map +7 -0
- package/dist/lib/browser/chunk-ZYU2LP6U.mjs +11 -0
- package/dist/lib/browser/chunk-ZYU2LP6U.mjs.map +7 -0
- package/dist/lib/browser/compiler-53G6ZHQM.mjs +99 -0
- package/dist/lib/browser/compiler-53G6ZHQM.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +147 -106
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/operation-resolver-CYEISDDK.mjs +79 -0
- package/dist/lib/browser/operation-resolver-CYEISDDK.mjs.map +7 -0
- package/dist/lib/browser/react-surface-26P6HAFD.mjs +141 -0
- package/dist/lib/browser/react-surface-26P6HAFD.mjs.map +7 -0
- package/dist/lib/browser/settings-76UM7442.mjs +36 -0
- package/dist/lib/browser/settings-76UM7442.mjs.map +7 -0
- package/dist/lib/browser/templates/index.mjs +2 -1
- package/dist/lib/browser/types/index.mjs +14 -6
- package/dist/lib/node-esm/DeploymentDialog-ZHPHEV2H.mjs +139 -0
- package/dist/lib/node-esm/DeploymentDialog-ZHPHEV2H.mjs.map +7 -0
- package/dist/lib/node-esm/NotebookContainer-ZLWTNMQA.mjs +851 -0
- package/dist/lib/node-esm/NotebookContainer-ZLWTNMQA.mjs.map +7 -0
- package/dist/lib/node-esm/ScriptContainer-S4UKQAWP.mjs +94 -0
- package/dist/lib/node-esm/ScriptContainer-S4UKQAWP.mjs.map +7 -0
- package/dist/lib/node-esm/ScriptObjectSettings-C5QBRERY.mjs +295 -0
- package/dist/lib/node-esm/ScriptObjectSettings-C5QBRERY.mjs.map +7 -0
- package/dist/lib/node-esm/ScriptPluginSettings-MFACDW4R.mjs +56 -0
- package/dist/lib/node-esm/ScriptPluginSettings-MFACDW4R.mjs.map +7 -0
- package/dist/lib/node-esm/ScriptProperties-FMNIX3KU.mjs +29 -0
- package/dist/lib/node-esm/ScriptProperties-FMNIX3KU.mjs.map +7 -0
- package/dist/lib/node-esm/TestContainer-AO45YPGV.mjs +40 -0
- package/dist/lib/node-esm/TestContainer-AO45YPGV.mjs.map +7 -0
- package/dist/lib/node-esm/app-graph-builder-IGAZTJ45.mjs +70 -0
- package/dist/lib/node-esm/app-graph-builder-IGAZTJ45.mjs.map +7 -0
- package/dist/lib/node-esm/blueprint-definition-5MGY6BRQ.mjs +18 -0
- package/dist/lib/node-esm/blueprint-definition-5MGY6BRQ.mjs.map +7 -0
- package/dist/lib/node-esm/blueprints/index.mjs +9 -0
- package/dist/lib/node-esm/blueprints/index.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-5BG7OJGQ.mjs +176 -0
- package/dist/lib/node-esm/chunk-5BG7OJGQ.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-AHXJ6NQU.mjs → chunk-5HSJPAK7.mjs} +8 -5
- package/dist/lib/node-esm/chunk-5HSJPAK7.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-H46R2RS5.mjs +790 -0
- package/dist/lib/node-esm/chunk-H46R2RS5.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +7 -0
- package/dist/lib/node-esm/{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-QG6ANK4B.mjs +107 -0
- package/dist/lib/node-esm/chunk-QG6ANK4B.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-S7DSCLOW.mjs +31 -0
- package/dist/lib/node-esm/chunk-S7DSCLOW.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-TZ2EBTPQ.mjs +22 -0
- package/dist/lib/node-esm/chunk-TZ2EBTPQ.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-UFBVE33O.mjs +12 -0
- package/dist/lib/node-esm/chunk-UFBVE33O.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-WWD5LUU6.mjs +114 -0
- package/dist/lib/node-esm/chunk-WWD5LUU6.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-ZDJ2FI7E.mjs +398 -0
- package/dist/lib/node-esm/chunk-ZDJ2FI7E.mjs.map +7 -0
- package/dist/lib/node-esm/compiler-HHQW7EP3.mjs +100 -0
- package/dist/lib/node-esm/compiler-HHQW7EP3.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +147 -106
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/operation-resolver-HFFDXWND.mjs +80 -0
- package/dist/lib/node-esm/operation-resolver-HFFDXWND.mjs.map +7 -0
- package/dist/lib/node-esm/react-surface-THCIK266.mjs +142 -0
- package/dist/lib/node-esm/react-surface-THCIK266.mjs.map +7 -0
- package/dist/lib/node-esm/settings-CCHDPLFJ.mjs +37 -0
- package/dist/lib/node-esm/settings-CCHDPLFJ.mjs.map +7 -0
- package/dist/lib/node-esm/templates/index.mjs +2 -1
- package/dist/lib/node-esm/types/index.mjs +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/FrameContainer/FrameContainer.d.ts +1 -1
- package/dist/types/src/components/FrameContainer/FrameContainer.d.ts.map +1 -1
- package/dist/types/src/components/NotebookStack/NotebookCell.d.ts +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 +249 -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 +246 -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 +249 -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 +32 -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 -76
- 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 +121 -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 +8 -6
- package/src/components/FrameContainer/frame.html +21 -21
- 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 +102 -0
- package/src/components/QueryEditor/QueryEditor.tsx +47 -0
- package/src/components/QueryEditor/index.ts +5 -0
- package/src/components/ScriptToolbar/ScriptToolbar.stories.tsx +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 +268 -0
- package/src/containers/NotebookContainer/index.ts +7 -0
- package/src/containers/ScriptContainer/ScriptContainer.tsx +84 -0
- package/src/containers/ScriptContainer/index.ts +7 -0
- package/src/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 +9 -7
- 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/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 +12 -4
- package/src/templates/forex-effect.ts +24 -25
- package/src/templates/forex.ts +9 -6
- package/src/templates/gmail.ts +34 -64
- package/src/templates/index.ts +24 -11
- 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 +35 -7
- package/src/types/Notebook.ts +41 -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/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/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,33 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
// @ts-ignore
|
|
6
|
-
import wasmUrl from 'esbuild-wasm/esbuild.wasm?url';
|
|
7
|
-
|
|
8
|
-
import { contributes } from '@dxos/app-framework';
|
|
9
|
-
import { initializeBundler } from '@dxos/functions/bundler';
|
|
10
|
-
|
|
11
|
-
import { ScriptCapabilities } from './capabilities';
|
|
12
|
-
import { Compiler } from '../compiler';
|
|
13
|
-
|
|
14
|
-
export default async () => {
|
|
15
|
-
const compiler = new Compiler();
|
|
16
|
-
|
|
17
|
-
await compiler.initialize();
|
|
18
|
-
// TODO(wittjosiah): Fetch types for https modules.
|
|
19
|
-
compiler.setFile('/src/typings.d.ts', "declare module 'https://*';");
|
|
20
|
-
// TODO(wittjosiah): Proper function handler types.
|
|
21
|
-
// TODO(wittjosiah): Remove.
|
|
22
|
-
compiler.setFile(
|
|
23
|
-
'/src/runtime.ts',
|
|
24
|
-
`
|
|
25
|
-
export const Filter: any = {};
|
|
26
|
-
export type FunctionHandler = ({ event, context }: { event: any; context: any }) => Promise<Response>;
|
|
27
|
-
export const functionHandler = (handler: FunctionHandler) => handler;
|
|
28
|
-
`,
|
|
29
|
-
);
|
|
30
|
-
await initializeBundler({ wasmUrl });
|
|
31
|
-
|
|
32
|
-
return contributes(ScriptCapabilities.Compiler, compiler);
|
|
33
|
-
};
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { Octokit } from '@octokit/core';
|
|
6
|
-
import { Predicate } from 'effect';
|
|
7
|
-
|
|
8
|
-
import { contributes, Capabilities, createResolver, createIntent, LayoutAction } from '@dxos/app-framework';
|
|
9
|
-
import { Obj, Ref } from '@dxos/echo';
|
|
10
|
-
import { ScriptType } from '@dxos/functions';
|
|
11
|
-
import { TokenManagerAction } from '@dxos/plugin-token-manager/types';
|
|
12
|
-
import { DataType } from '@dxos/schema';
|
|
13
|
-
|
|
14
|
-
import { DEPLOYMENT_DIALOG } from '../components';
|
|
15
|
-
import { defaultScriptsForIntegration } from '../meta';
|
|
16
|
-
import { templates } from '../templates';
|
|
17
|
-
import { ScriptAction } from '../types';
|
|
18
|
-
|
|
19
|
-
export default () =>
|
|
20
|
-
contributes(Capabilities.IntentResolver, [
|
|
21
|
-
createResolver({
|
|
22
|
-
intent: ScriptAction.Create,
|
|
23
|
-
resolve: async ({ name, gistUrl, initialTemplateId }) => {
|
|
24
|
-
let content = templates[0].source;
|
|
25
|
-
|
|
26
|
-
const gistId = gistUrl?.split('/').at(-1);
|
|
27
|
-
if (gistId) {
|
|
28
|
-
// TODO(wittjosiah): Capability which contributes Octokit?
|
|
29
|
-
// NOTE: AccessToken not needed to read public gists.
|
|
30
|
-
const octokit = new Octokit();
|
|
31
|
-
const response = await octokit.request('GET /gists/{gist_id}', {
|
|
32
|
-
gist_id: gistId,
|
|
33
|
-
});
|
|
34
|
-
const gistContent = Object.values(response.data.files ?? {})[0]?.content;
|
|
35
|
-
if (gistContent) {
|
|
36
|
-
content = gistContent;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
if (initialTemplateId) {
|
|
41
|
-
const template = templates.find((template) => template.id === initialTemplateId);
|
|
42
|
-
if (template) {
|
|
43
|
-
content = template.source;
|
|
44
|
-
name = template.name;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
return {
|
|
49
|
-
data: {
|
|
50
|
-
object: Obj.make(ScriptType, {
|
|
51
|
-
name,
|
|
52
|
-
source: Ref.make(Obj.make(DataType.Text, { content })),
|
|
53
|
-
}),
|
|
54
|
-
},
|
|
55
|
-
};
|
|
56
|
-
},
|
|
57
|
-
}),
|
|
58
|
-
createResolver({
|
|
59
|
-
intent: TokenManagerAction.AccessTokenCreated,
|
|
60
|
-
resolve: async ({ accessToken }) => {
|
|
61
|
-
const scriptTemplates = (defaultScriptsForIntegration[accessToken.source] ?? [])
|
|
62
|
-
.map((id) => templates.find((t) => t.id === id))
|
|
63
|
-
.filter(Predicate.isNotNullable);
|
|
64
|
-
|
|
65
|
-
if (scriptTemplates.length > 0) {
|
|
66
|
-
return {
|
|
67
|
-
intents: [
|
|
68
|
-
createIntent(LayoutAction.UpdateDialog, {
|
|
69
|
-
part: 'dialog',
|
|
70
|
-
subject: DEPLOYMENT_DIALOG,
|
|
71
|
-
options: { blockAlign: 'start', state: true, props: { accessToken, scriptTemplates } },
|
|
72
|
-
}),
|
|
73
|
-
],
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
return { data: undefined };
|
|
78
|
-
},
|
|
79
|
-
}),
|
|
80
|
-
]);
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React from 'react';
|
|
6
|
-
|
|
7
|
-
import { Capabilities, contributes, createSurface, useCapability } from '@dxos/app-framework';
|
|
8
|
-
import { InvocationTraceContainer } from '@dxos/devtools';
|
|
9
|
-
import { Obj } from '@dxos/echo';
|
|
10
|
-
import { ScriptType } from '@dxos/functions';
|
|
11
|
-
import { SettingsStore } from '@dxos/local-storage';
|
|
12
|
-
import { getSpace } from '@dxos/react-client/echo';
|
|
13
|
-
import { StackItem } from '@dxos/react-ui-stack';
|
|
14
|
-
import { type DataType } from '@dxos/schema';
|
|
15
|
-
|
|
16
|
-
import { ScriptCapabilities } from './capabilities';
|
|
17
|
-
import {
|
|
18
|
-
DEPLOYMENT_DIALOG,
|
|
19
|
-
DeploymentDialog,
|
|
20
|
-
ScriptContainer,
|
|
21
|
-
ScriptPluginSettings,
|
|
22
|
-
ScriptObjectSettings,
|
|
23
|
-
ScriptProperties,
|
|
24
|
-
TestContainer,
|
|
25
|
-
} from '../components';
|
|
26
|
-
import { meta } from '../meta';
|
|
27
|
-
import { type ScriptSettingsProps } from '../types';
|
|
28
|
-
|
|
29
|
-
export default () =>
|
|
30
|
-
contributes(Capabilities.ReactSurface, [
|
|
31
|
-
createSurface({
|
|
32
|
-
id: `${meta.id}/plugin-settings`,
|
|
33
|
-
role: 'article',
|
|
34
|
-
filter: (data): data is { subject: SettingsStore<ScriptSettingsProps> } =>
|
|
35
|
-
data.subject instanceof SettingsStore && data.subject.prefix === meta.id,
|
|
36
|
-
component: ({ data: { subject } }) => <ScriptPluginSettings settings={subject.value} />,
|
|
37
|
-
}),
|
|
38
|
-
createSurface({
|
|
39
|
-
id: `${meta.id}/article`,
|
|
40
|
-
role: 'article',
|
|
41
|
-
filter: (data): data is { subject: ScriptType } => Obj.instanceOf(ScriptType, data.subject),
|
|
42
|
-
component: ({ data, role }) => {
|
|
43
|
-
const compiler = useCapability(ScriptCapabilities.Compiler);
|
|
44
|
-
// TODO(dmaretskyi): Since settings store is not reactive, this would break on the script plugin being enabled without a page reload.
|
|
45
|
-
const settings = useCapability(Capabilities.SettingsStore).getStore<ScriptSettingsProps>(meta.id)?.value;
|
|
46
|
-
return <ScriptContainer role={role} script={data.subject} settings={settings} env={compiler.environment} />;
|
|
47
|
-
},
|
|
48
|
-
}),
|
|
49
|
-
createSurface({
|
|
50
|
-
id: `${meta.id}/companion/base-settings`,
|
|
51
|
-
role: 'base-object-settings',
|
|
52
|
-
filter: (data): data is { subject: ScriptType } => Obj.instanceOf(ScriptType, data.subject),
|
|
53
|
-
component: ({ data }) => <ScriptProperties object={data.subject} />,
|
|
54
|
-
}),
|
|
55
|
-
createSurface({
|
|
56
|
-
id: `${meta.id}/companion/settings`,
|
|
57
|
-
role: 'object-settings',
|
|
58
|
-
filter: (data): data is { subject: ScriptType } => Obj.instanceOf(ScriptType, data.subject),
|
|
59
|
-
component: ({ data }) => <ScriptObjectSettings object={data.subject} />,
|
|
60
|
-
}),
|
|
61
|
-
createSurface({
|
|
62
|
-
id: `${meta.id}/companion/execute`,
|
|
63
|
-
role: 'article',
|
|
64
|
-
filter: (data): data is { companionTo: ScriptType } =>
|
|
65
|
-
Obj.instanceOf(ScriptType, data.companionTo) && data.subject === 'execute',
|
|
66
|
-
component: ({ data, role }) => <TestContainer script={data.companionTo} role={role} />,
|
|
67
|
-
}),
|
|
68
|
-
createSurface({
|
|
69
|
-
id: `${meta.id}/companion/logs`,
|
|
70
|
-
role: 'article',
|
|
71
|
-
filter: (data): data is { companionTo: ScriptType } =>
|
|
72
|
-
Obj.instanceOf(ScriptType, data.companionTo) && data.subject === 'logs',
|
|
73
|
-
component: ({ data, role }) => {
|
|
74
|
-
const space = getSpace(data.companionTo);
|
|
75
|
-
return (
|
|
76
|
-
<StackItem.Content>
|
|
77
|
-
<InvocationTraceContainer space={space} target={data.companionTo} detailAxis='block' />
|
|
78
|
-
</StackItem.Content>
|
|
79
|
-
);
|
|
80
|
-
},
|
|
81
|
-
}),
|
|
82
|
-
createSurface({
|
|
83
|
-
id: DEPLOYMENT_DIALOG,
|
|
84
|
-
role: 'dialog',
|
|
85
|
-
filter: (data): data is { props: { accessToken: DataType.AccessToken; scriptTemplates: any } } =>
|
|
86
|
-
data.component === DEPLOYMENT_DIALOG,
|
|
87
|
-
component: ({ data }) => <DeploymentDialog {...data.props} />,
|
|
88
|
-
}),
|
|
89
|
-
]);
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { Capabilities, contributes } from '@dxos/app-framework';
|
|
6
|
-
import { live } from '@dxos/live-object';
|
|
7
|
-
|
|
8
|
-
import { meta } from '../meta';
|
|
9
|
-
import { ScriptSettingsSchema } from '../types';
|
|
10
|
-
|
|
11
|
-
export default () => {
|
|
12
|
-
const settings = live(ScriptSettingsSchema, {
|
|
13
|
-
editorInputMode: 'vscode',
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
return contributes(Capabilities.Settings, {
|
|
17
|
-
prefix: meta.id,
|
|
18
|
-
schema: ScriptSettingsSchema,
|
|
19
|
-
value: settings,
|
|
20
|
-
});
|
|
21
|
-
};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2023 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import '@dxos-theme';
|
|
6
|
-
|
|
7
|
-
import { type Meta } from '@storybook/react-vite';
|
|
8
|
-
import React from 'react';
|
|
9
|
-
|
|
10
|
-
import { Dialog } from '@dxos/react-ui';
|
|
11
|
-
import { withLayout, withTheme } from '@dxos/storybook-utils';
|
|
12
|
-
|
|
13
|
-
import { translations } from '../../translations';
|
|
14
|
-
import { DeploymentDialog } from '../DeploymentDialog/DeploymentDialog';
|
|
15
|
-
|
|
16
|
-
export const Default = {
|
|
17
|
-
args: {
|
|
18
|
-
accessToken: { value: 'example-token' },
|
|
19
|
-
scripts: [
|
|
20
|
-
{ label: 'Script 1', templateId: 'template1' },
|
|
21
|
-
{ label: 'Script 2', templateId: 'template2' },
|
|
22
|
-
{ label: 'Script 3', templateId: 'template3' },
|
|
23
|
-
],
|
|
24
|
-
},
|
|
25
|
-
render: (args: any) => (
|
|
26
|
-
<Dialog.Root defaultOpen={true}>
|
|
27
|
-
<DeploymentDialog {...args} />
|
|
28
|
-
</Dialog.Root>
|
|
29
|
-
),
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
const meta: Meta = {
|
|
33
|
-
title: 'plugins/plugin-script/DeploymentDialog',
|
|
34
|
-
component: DeploymentDialog,
|
|
35
|
-
parameters: { translations },
|
|
36
|
-
decorators: [withTheme, withLayout()],
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
export default meta;
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React, { useEffect, useMemo } from 'react';
|
|
6
|
-
|
|
7
|
-
import { createIntent, LayoutAction, useIntentDispatcher } from '@dxos/app-framework';
|
|
8
|
-
import { getSpace } from '@dxos/react-client/echo';
|
|
9
|
-
import { Button, Dialog, Icon, useTranslation } from '@dxos/react-ui';
|
|
10
|
-
import { type DataType } from '@dxos/schema';
|
|
11
|
-
|
|
12
|
-
import { useCreateAndDeployScriptTemplates } from '../../hooks/useCreateAndDeployScriptTemplates';
|
|
13
|
-
import { SCRIPT_PLUGIN } from '../../meta';
|
|
14
|
-
import { type Template } from '../../templates';
|
|
15
|
-
|
|
16
|
-
export const DEPLOYMENT_DIALOG = `${SCRIPT_PLUGIN}/deployment/dialog`;
|
|
17
|
-
|
|
18
|
-
// TODO(ZaymonFC):
|
|
19
|
-
// - Show activity and feedback to the user.
|
|
20
|
-
// - Only take an array of templateIds and get the name from the data.
|
|
21
|
-
// - Pending / onError states.
|
|
22
|
-
|
|
23
|
-
type DeploymentDialogProps = {
|
|
24
|
-
accessToken: DataType.AccessToken;
|
|
25
|
-
scriptTemplates: Template[];
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
export const DeploymentDialog = ({ accessToken, scriptTemplates }: DeploymentDialogProps) => {
|
|
29
|
-
const { t } = useTranslation(SCRIPT_PLUGIN);
|
|
30
|
-
const space = useMemo(() => getSpace(accessToken), [accessToken]);
|
|
31
|
-
|
|
32
|
-
// TODO(ZaymonFC): Thinking further. All of this should get moved to intents to run async in the background.
|
|
33
|
-
// Deployment shouldn't be tied to the lifecycle of the dialogue component.
|
|
34
|
-
const { handleCreateAndDeployScripts, status } = useCreateAndDeployScriptTemplates(space, scriptTemplates);
|
|
35
|
-
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
36
|
-
|
|
37
|
-
useEffect(() => {
|
|
38
|
-
if (status === 'success') {
|
|
39
|
-
// TODO(ZaymonFC): We can probably re-use this toast for normal script deployment.
|
|
40
|
-
void dispatch(
|
|
41
|
-
createIntent(LayoutAction.AddToast, {
|
|
42
|
-
part: 'toast',
|
|
43
|
-
subject: {
|
|
44
|
-
id: `${SCRIPT_PLUGIN}/deployment-success`,
|
|
45
|
-
icon: 'ph--check--regular',
|
|
46
|
-
duration: Infinity,
|
|
47
|
-
title: ['script deployment toast label', { ns: SCRIPT_PLUGIN, count: scriptTemplates.length }],
|
|
48
|
-
description: ['script deployment toast description', { ns: SCRIPT_PLUGIN, count: scriptTemplates.length }],
|
|
49
|
-
closeLabel: ['script deployment toast close label', { ns: SCRIPT_PLUGIN, count: scriptTemplates.length }],
|
|
50
|
-
},
|
|
51
|
-
}),
|
|
52
|
-
);
|
|
53
|
-
void dispatch(createIntent(LayoutAction.UpdateDialog, { part: 'dialog', options: { state: false } }));
|
|
54
|
-
}
|
|
55
|
-
if (status === 'error') {
|
|
56
|
-
void dispatch(createIntent(LayoutAction.UpdateDialog, { part: 'dialog', options: { state: false } }));
|
|
57
|
-
void dispatch(
|
|
58
|
-
createIntent(LayoutAction.AddToast, {
|
|
59
|
-
part: 'toast',
|
|
60
|
-
subject: {
|
|
61
|
-
id: `${SCRIPT_PLUGIN}/deployment-error`,
|
|
62
|
-
icon: 'ph--warning--regular',
|
|
63
|
-
duration: Infinity,
|
|
64
|
-
title: ['script deployment error toast label', { ns: SCRIPT_PLUGIN, count: scriptTemplates.length }],
|
|
65
|
-
description: [
|
|
66
|
-
'script deployment error toast description',
|
|
67
|
-
{ ns: SCRIPT_PLUGIN, count: scriptTemplates.length },
|
|
68
|
-
],
|
|
69
|
-
closeLabel: [
|
|
70
|
-
'script deployment error toast close label',
|
|
71
|
-
{ ns: SCRIPT_PLUGIN, count: scriptTemplates.length },
|
|
72
|
-
],
|
|
73
|
-
},
|
|
74
|
-
}),
|
|
75
|
-
);
|
|
76
|
-
}
|
|
77
|
-
}, [status, dispatch]);
|
|
78
|
-
|
|
79
|
-
return (
|
|
80
|
-
<Dialog.Content>
|
|
81
|
-
<div className='flex justify-between items-center'>
|
|
82
|
-
<Dialog.Title>{t('deployment dialog title')}</Dialog.Title>
|
|
83
|
-
<Dialog.Close asChild>
|
|
84
|
-
<Button density='fine' variant='ghost'>
|
|
85
|
-
<Icon icon='ph--x--regular' size={4} />
|
|
86
|
-
</Button>
|
|
87
|
-
</Dialog.Close>
|
|
88
|
-
</div>
|
|
89
|
-
<div role='none' className='plb-4'>
|
|
90
|
-
{/* TODO: Implement deployment logic and UI. */}
|
|
91
|
-
<p>{t('deployment dialog scripts found message', { count: scriptTemplates.length })}</p>
|
|
92
|
-
<ul className='pbs-2'>
|
|
93
|
-
{scriptTemplates.map((template) => {
|
|
94
|
-
return <li key={template.id}>{template.name}</li>;
|
|
95
|
-
})}
|
|
96
|
-
</ul>
|
|
97
|
-
</div>
|
|
98
|
-
<div role='none' className='flex flex-row-reverse gap-1'>
|
|
99
|
-
<Button variant='primary' onClick={handleCreateAndDeployScripts} disabled={status === 'pending'}>
|
|
100
|
-
{status === 'pending'
|
|
101
|
-
? t('deployment dialog deploy functions pending button label', { count: scriptTemplates.length })
|
|
102
|
-
: t('deployment dialog deploy functions button label', { count: scriptTemplates.length })}
|
|
103
|
-
</Button>
|
|
104
|
-
<Dialog.Close asChild disabled={status === 'pending'}>
|
|
105
|
-
<Button disabled={status === 'pending'}>{t('deployment dialog skip button label')}</Button>
|
|
106
|
-
</Dialog.Close>
|
|
107
|
-
</div>
|
|
108
|
-
</Dialog.Content>
|
|
109
|
-
);
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
export default DeploymentDialog;
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2023 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React, { useMemo } from 'react';
|
|
6
|
-
|
|
7
|
-
import { type ScriptType } from '@dxos/functions';
|
|
8
|
-
import { createDocAccessor, getSpace } from '@dxos/react-client/echo';
|
|
9
|
-
import { useIdentity } from '@dxos/react-client/halo';
|
|
10
|
-
import { createDataExtensions, listener, stackItemContentEditorClassNames } from '@dxos/react-ui-editor';
|
|
11
|
-
import { StackItem } from '@dxos/react-ui-stack';
|
|
12
|
-
|
|
13
|
-
import { ScriptToolbar } from './ScriptToolbar';
|
|
14
|
-
import { TypescriptEditor, type TypescriptEditorProps } from './TypescriptEditor';
|
|
15
|
-
import { useDeployState, useToolbarState } from '../hooks';
|
|
16
|
-
import { type ScriptSettingsProps } from '../types';
|
|
17
|
-
|
|
18
|
-
export type ScriptEditorProps = {
|
|
19
|
-
role: string;
|
|
20
|
-
script: ScriptType;
|
|
21
|
-
settings?: ScriptSettingsProps;
|
|
22
|
-
} & Pick<TypescriptEditorProps, 'env'>;
|
|
23
|
-
|
|
24
|
-
export const ScriptContainer = ({ role, script, settings = { editorInputMode: 'vscode' }, env }: ScriptEditorProps) => {
|
|
25
|
-
const identity = useIdentity();
|
|
26
|
-
const space = getSpace(script);
|
|
27
|
-
const state = useToolbarState();
|
|
28
|
-
useDeployState({ state, script });
|
|
29
|
-
|
|
30
|
-
const extensions = useMemo(
|
|
31
|
-
() =>
|
|
32
|
-
script.source.target
|
|
33
|
-
? [
|
|
34
|
-
listener({
|
|
35
|
-
onChange: (text) => {
|
|
36
|
-
if (script.source.target?.content !== text) {
|
|
37
|
-
script.changed = true;
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
}),
|
|
41
|
-
createDataExtensions({
|
|
42
|
-
id: script.id,
|
|
43
|
-
text: createDocAccessor(script.source.target, ['content']),
|
|
44
|
-
space,
|
|
45
|
-
identity,
|
|
46
|
-
}),
|
|
47
|
-
]
|
|
48
|
-
: [],
|
|
49
|
-
[identity, space, script, script.source.target],
|
|
50
|
-
);
|
|
51
|
-
|
|
52
|
-
return (
|
|
53
|
-
<StackItem.Content toolbar>
|
|
54
|
-
<ScriptToolbar state={state} role={role} script={script} />
|
|
55
|
-
<TypescriptEditor
|
|
56
|
-
id={script.id}
|
|
57
|
-
env={env}
|
|
58
|
-
initialValue={script.source?.target?.content}
|
|
59
|
-
extensions={extensions}
|
|
60
|
-
classNames={stackItemContentEditorClassNames(role)}
|
|
61
|
-
inputMode={settings.editorInputMode}
|
|
62
|
-
toolbar
|
|
63
|
-
/>
|
|
64
|
-
</StackItem.Content>
|
|
65
|
-
);
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
export default ScriptContainer;
|
|
@@ -1,206 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2024 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { Octokit } from '@octokit/core';
|
|
6
|
-
import React, { type ChangeEvent, useCallback, useEffect, useState } from 'react';
|
|
7
|
-
|
|
8
|
-
import { createIntent, SettingsAction, useIntentDispatcher } from '@dxos/app-framework';
|
|
9
|
-
import { FunctionType, type ScriptType, getInvocationUrl, getUserFunctionUrlInMetadata } from '@dxos/functions';
|
|
10
|
-
import { log } from '@dxos/log';
|
|
11
|
-
import { useClient } from '@dxos/react-client';
|
|
12
|
-
import { Filter, getMeta, getSpace, Ref, useQuery } from '@dxos/react-client/echo';
|
|
13
|
-
import { Button, Clipboard, Input, useControlledState, useTranslation } from '@dxos/react-ui';
|
|
14
|
-
import { DataType } from '@dxos/schema';
|
|
15
|
-
|
|
16
|
-
import { SCRIPT_PLUGIN } from '../../meta';
|
|
17
|
-
|
|
18
|
-
export type ScriptObjectSettingsProps = {
|
|
19
|
-
object: ScriptType;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export const ScriptObjectSettings = ({ object }: ScriptObjectSettingsProps) => {
|
|
23
|
-
return (
|
|
24
|
-
<>
|
|
25
|
-
<Binding object={object} />
|
|
26
|
-
<Publishing object={object} />
|
|
27
|
-
</>
|
|
28
|
-
);
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export const ScriptProperties = ({ object }: ScriptObjectSettingsProps) => {
|
|
32
|
-
const { t } = useTranslation(SCRIPT_PLUGIN);
|
|
33
|
-
return (
|
|
34
|
-
<Input.Root>
|
|
35
|
-
<Input.Label>{t('description label')}</Input.Label>
|
|
36
|
-
<Input.TextInput
|
|
37
|
-
placeholder={t('description placeholder')}
|
|
38
|
-
value={object.description ?? ''}
|
|
39
|
-
onChange={(event) => {
|
|
40
|
-
object.description = event.target.value;
|
|
41
|
-
}}
|
|
42
|
-
/>
|
|
43
|
-
</Input.Root>
|
|
44
|
-
);
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
const Binding = ({ object }: ScriptObjectSettingsProps) => {
|
|
48
|
-
const { t } = useTranslation(SCRIPT_PLUGIN);
|
|
49
|
-
const client = useClient();
|
|
50
|
-
const space = getSpace(object);
|
|
51
|
-
const [fn] = useQuery(space, Filter.type(FunctionType, { source: Ref.make(object) }));
|
|
52
|
-
|
|
53
|
-
const functionPath = fn && getUserFunctionUrlInMetadata(getMeta(fn));
|
|
54
|
-
const functionUrl =
|
|
55
|
-
functionPath &&
|
|
56
|
-
getInvocationUrl(functionPath, client.config.values.runtime?.services?.edge?.url ?? '', {
|
|
57
|
-
spaceId: space?.id,
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
const [binding, setBinding] = useControlledState(fn?.binding ?? '');
|
|
61
|
-
const handleBindingChange = useCallback(
|
|
62
|
-
(event: ChangeEvent<HTMLInputElement>) => {
|
|
63
|
-
setBinding(event.target.value);
|
|
64
|
-
},
|
|
65
|
-
[setBinding],
|
|
66
|
-
);
|
|
67
|
-
|
|
68
|
-
const handleBindingBlur = useCallback(() => {
|
|
69
|
-
fn.binding = binding;
|
|
70
|
-
}, [fn, binding]);
|
|
71
|
-
|
|
72
|
-
if (!fn || !functionUrl) {
|
|
73
|
-
return null;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
// TODO(burdon): Use form.
|
|
77
|
-
return (
|
|
78
|
-
<div role='form' className='flex flex-col gap-2 mlb-cardSpacingBlock'>
|
|
79
|
-
<h2>{t('remote function settings heading')}</h2>
|
|
80
|
-
<Input.Root>
|
|
81
|
-
<div role='none' className='flex flex-col gap-1'>
|
|
82
|
-
<Input.Label>{t('function url label')}</Input.Label>
|
|
83
|
-
<div role='none' className='flex gap-1'>
|
|
84
|
-
<Input.TextInput
|
|
85
|
-
disabled
|
|
86
|
-
value={functionUrl}
|
|
87
|
-
onChange={(event) => {
|
|
88
|
-
fn.name = event.target.value;
|
|
89
|
-
}}
|
|
90
|
-
/>
|
|
91
|
-
<Clipboard.IconButton value={functionUrl} />
|
|
92
|
-
</div>
|
|
93
|
-
</div>
|
|
94
|
-
</Input.Root>
|
|
95
|
-
<Input.Root>
|
|
96
|
-
<div role='none' className='flex flex-col gap-1'>
|
|
97
|
-
<Input.Label>{t('function binding label')}</Input.Label>
|
|
98
|
-
<Input.TextInput
|
|
99
|
-
placeholder={t('function binding placeholder')}
|
|
100
|
-
value={binding}
|
|
101
|
-
onChange={handleBindingChange}
|
|
102
|
-
onBlur={handleBindingBlur}
|
|
103
|
-
/>
|
|
104
|
-
</div>
|
|
105
|
-
</Input.Root>
|
|
106
|
-
</div>
|
|
107
|
-
);
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
// TODO(burdon): Move to separate tab?
|
|
111
|
-
const Publishing = ({ object }: ScriptObjectSettingsProps) => {
|
|
112
|
-
const { t } = useTranslation(SCRIPT_PLUGIN);
|
|
113
|
-
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
114
|
-
const space = getSpace(object);
|
|
115
|
-
const [githubToken] = useQuery(space, Filter.type(DataType.AccessToken, { source: 'github.com' }));
|
|
116
|
-
const gistKey = getMeta(object).keys.find(({ source }) => source === 'github.com');
|
|
117
|
-
const [gistUrl, setGistUrl] = useState<string | undefined>();
|
|
118
|
-
|
|
119
|
-
useEffect(() => {
|
|
120
|
-
const token = githubToken?.token;
|
|
121
|
-
const gistId = gistKey?.id;
|
|
122
|
-
if (!token || !gistId) {
|
|
123
|
-
setGistUrl(undefined);
|
|
124
|
-
return;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
const timeout = setTimeout(async () => {
|
|
128
|
-
try {
|
|
129
|
-
const octokit = new Octokit({ auth: githubToken.token });
|
|
130
|
-
const response = await octokit.request('GET /gists/{gist_id}', {
|
|
131
|
-
gist_id: gistId,
|
|
132
|
-
});
|
|
133
|
-
setGistUrl(response.data.html_url);
|
|
134
|
-
} catch (err) {
|
|
135
|
-
log.catch(err);
|
|
136
|
-
setGistUrl(undefined);
|
|
137
|
-
}
|
|
138
|
-
});
|
|
139
|
-
|
|
140
|
-
return () => clearTimeout(timeout);
|
|
141
|
-
}, [githubToken, gistKey]);
|
|
142
|
-
|
|
143
|
-
const handleOpenTokenManager = useCallback(
|
|
144
|
-
() => dispatch(createIntent(SettingsAction.Open, { plugin: 'dxos.org/plugin/token-manager' })),
|
|
145
|
-
[],
|
|
146
|
-
);
|
|
147
|
-
|
|
148
|
-
const [publishing, setPublishing] = useState(false);
|
|
149
|
-
const handlePublish = useCallback(async () => {
|
|
150
|
-
setPublishing(true);
|
|
151
|
-
const octokit = new Octokit({ auth: githubToken.token });
|
|
152
|
-
const source = await object.source.load();
|
|
153
|
-
const filename = object.name ? kebabize(object.name) : 'composer-script';
|
|
154
|
-
const files = { [`${filename}.ts`]: { content: source.content } };
|
|
155
|
-
|
|
156
|
-
try {
|
|
157
|
-
// TODO(wittjosiah): Factor out to intent.
|
|
158
|
-
const meta = getMeta(object);
|
|
159
|
-
const githubKey = meta.keys.find(({ source }) => source === 'github.com');
|
|
160
|
-
const gistId = githubKey?.id;
|
|
161
|
-
if (gistId) {
|
|
162
|
-
await octokit.request('PATCH /gists/{gist_id}', {
|
|
163
|
-
gist_id: gistId,
|
|
164
|
-
files,
|
|
165
|
-
});
|
|
166
|
-
} else {
|
|
167
|
-
const response = await octokit.request('POST /gists', {
|
|
168
|
-
public: true,
|
|
169
|
-
files,
|
|
170
|
-
});
|
|
171
|
-
if (response.data.id) {
|
|
172
|
-
meta.keys.push({ source: 'github.com', id: response.data.id });
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
} finally {
|
|
176
|
-
setPublishing(false);
|
|
177
|
-
}
|
|
178
|
-
}, [object, githubToken]);
|
|
179
|
-
|
|
180
|
-
return (
|
|
181
|
-
<div className='flex flex-col gap-4 mlb-cardSpacingBlock'>
|
|
182
|
-
<div>
|
|
183
|
-
<h2>{t('script publish settings label')}</h2>
|
|
184
|
-
<p className='text-description text-sm'>{t('script publish settings description')}</p>
|
|
185
|
-
</div>
|
|
186
|
-
{!githubToken && (
|
|
187
|
-
<div className='flex flex-col gap-2'>
|
|
188
|
-
<span>{t('no github token label')}</span>
|
|
189
|
-
<Button onClick={handleOpenTokenManager}>{t('open token manager label')}</Button>
|
|
190
|
-
</div>
|
|
191
|
-
)}
|
|
192
|
-
{githubToken && (
|
|
193
|
-
<div className='flex justify-end gap-2'>
|
|
194
|
-
{gistUrl && <Clipboard.IconButton value={gistUrl} />}
|
|
195
|
-
<Button disabled={publishing} onClick={handlePublish}>
|
|
196
|
-
{t(publishing ? 'publishing label' : 'publish label')}
|
|
197
|
-
</Button>
|
|
198
|
-
</div>
|
|
199
|
-
)}
|
|
200
|
-
</div>
|
|
201
|
-
);
|
|
202
|
-
};
|
|
203
|
-
|
|
204
|
-
// TODO(wittjosiah): Factor out.
|
|
205
|
-
// From https://stackoverflow.com/a/67243723/2804332
|
|
206
|
-
const kebabize = (str: string) => str.replace(/[A-Z]+(?![a-z])|[A-Z]/g, ($, ofs) => (ofs ? '-' : '') + $.toLowerCase());
|