@dxos/plugin-script 0.8.4-main.937b3ca → 0.8.4-main.abd8ff62ef
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-6DBF3V6C.mjs +112 -0
- package/dist/lib/browser/DeploymentDialog-6DBF3V6C.mjs.map +7 -0
- package/dist/lib/browser/{NotebookContainer-4MM2VAQF.mjs → NotebookContainer-RO4NJRYH.mjs} +59 -144
- package/dist/lib/browser/NotebookContainer-RO4NJRYH.mjs.map +7 -0
- package/dist/lib/browser/ScriptContainer-2OPBAXFB.mjs +79 -0
- package/dist/lib/browser/ScriptContainer-2OPBAXFB.mjs.map +7 -0
- package/dist/lib/browser/ScriptProperties-NRXG4PBX.mjs +304 -0
- package/dist/lib/browser/ScriptProperties-NRXG4PBX.mjs.map +7 -0
- package/dist/lib/browser/TestContainer-JNFPLAJX.mjs +44 -0
- package/dist/lib/browser/TestContainer-JNFPLAJX.mjs.map +7 -0
- package/dist/lib/browser/access-token-created-MSWZWZCT.mjs +37 -0
- package/dist/lib/browser/access-token-created-MSWZWZCT.mjs.map +7 -0
- package/dist/lib/browser/blueprints/index.mjs +53 -3
- package/dist/lib/browser/blueprints/index.mjs.map +4 -4
- package/dist/lib/browser/chunk-KF6H7J5N.mjs +81 -0
- package/dist/lib/browser/chunk-KF6H7J5N.mjs.map +7 -0
- package/dist/lib/browser/chunk-MI6X5CTJ.mjs +336 -0
- package/dist/lib/browser/chunk-MI6X5CTJ.mjs.map +7 -0
- package/dist/lib/browser/{chunk-UX4GHJ5E.mjs → chunk-NSAF3763.mjs} +29 -29
- package/dist/lib/browser/chunk-NSAF3763.mjs.map +7 -0
- package/dist/lib/browser/chunk-RQ5LDVFK.mjs +49 -0
- package/dist/lib/browser/chunk-RQ5LDVFK.mjs.map +7 -0
- package/dist/lib/browser/containers/index.mjs +17 -0
- package/dist/lib/browser/containers/index.mjs.map +7 -0
- package/dist/lib/browser/create-JDXWBARB.mjs +44 -0
- package/dist/lib/browser/create-JDXWBARB.mjs.map +7 -0
- package/dist/lib/browser/create-script-Q7B3CFAP.mjs +45 -0
- package/dist/lib/browser/create-script-Q7B3CFAP.mjs.map +7 -0
- package/dist/lib/browser/delete-PAUWA2QM.mjs +21 -0
- package/dist/lib/browser/delete-PAUWA2QM.mjs.map +7 -0
- package/dist/lib/browser/deploy-CXVW54JJ.mjs +62 -0
- package/dist/lib/browser/deploy-CXVW54JJ.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +169 -220
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/inspect-invocations-LEOEP5I2.mjs +59 -0
- package/dist/lib/browser/inspect-invocations-LEOEP5I2.mjs.map +7 -0
- package/dist/lib/browser/install-function-5N24Q45W.mjs +51 -0
- package/dist/lib/browser/install-function-5N24Q45W.mjs.map +7 -0
- package/dist/lib/browser/invoke-5QVEZ3X5.mjs +33 -0
- package/dist/lib/browser/invoke-5QVEZ3X5.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/operations/index.mjs +14 -0
- package/dist/lib/browser/operations/index.mjs.map +7 -0
- package/dist/lib/browser/query-deployed-functions-FVD7NYPA.mjs +30 -0
- package/dist/lib/browser/query-deployed-functions-FVD7NYPA.mjs.map +7 -0
- package/dist/lib/browser/read-FFOSK6A3.mjs +26 -0
- package/dist/lib/browser/read-FFOSK6A3.mjs.map +7 -0
- package/dist/lib/browser/templates/index.mjs +1 -1
- package/dist/lib/browser/translations.mjs +104 -0
- package/dist/lib/browser/translations.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +3 -7
- package/dist/lib/browser/update-PJS5GG3Y.mjs +63 -0
- package/dist/lib/browser/update-PJS5GG3Y.mjs.map +7 -0
- package/dist/lib/node-esm/DeploymentDialog-A5BZHUJB.mjs +113 -0
- package/dist/lib/node-esm/DeploymentDialog-A5BZHUJB.mjs.map +7 -0
- package/dist/lib/node-esm/{NotebookContainer-QLW5ZYGS.mjs → NotebookContainer-DPT65MA7.mjs} +59 -144
- package/dist/lib/node-esm/NotebookContainer-DPT65MA7.mjs.map +7 -0
- package/dist/lib/node-esm/ScriptContainer-UKD7QORM.mjs +80 -0
- package/dist/lib/node-esm/ScriptContainer-UKD7QORM.mjs.map +7 -0
- package/dist/lib/node-esm/ScriptProperties-FQXEOJKG.mjs +305 -0
- package/dist/lib/node-esm/ScriptProperties-FQXEOJKG.mjs.map +7 -0
- package/dist/lib/node-esm/TestContainer-Y4XVV7KQ.mjs +45 -0
- package/dist/lib/node-esm/TestContainer-Y4XVV7KQ.mjs.map +7 -0
- package/dist/lib/node-esm/access-token-created-DCD6LYQC.mjs +38 -0
- package/dist/lib/node-esm/access-token-created-DCD6LYQC.mjs.map +7 -0
- package/dist/lib/node-esm/blueprints/index.mjs +53 -3
- package/dist/lib/node-esm/blueprints/index.mjs.map +4 -4
- package/dist/lib/node-esm/chunk-2DZNF5NG.mjs +82 -0
- package/dist/lib/node-esm/chunk-2DZNF5NG.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-C55UYWN4.mjs +50 -0
- package/dist/lib/node-esm/chunk-C55UYWN4.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-4F5FJZ36.mjs → chunk-EW63XFRQ.mjs} +29 -29
- package/dist/lib/node-esm/chunk-EW63XFRQ.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-XFM2BEHY.mjs +338 -0
- package/dist/lib/node-esm/chunk-XFM2BEHY.mjs.map +7 -0
- package/dist/lib/node-esm/containers/index.mjs +18 -0
- package/dist/lib/node-esm/containers/index.mjs.map +7 -0
- package/dist/lib/node-esm/create-D2JDNXY6.mjs +45 -0
- package/dist/lib/node-esm/create-D2JDNXY6.mjs.map +7 -0
- package/dist/lib/node-esm/create-script-4AB4G7GQ.mjs +46 -0
- package/dist/lib/node-esm/create-script-4AB4G7GQ.mjs.map +7 -0
- package/dist/lib/node-esm/delete-YXLT7J27.mjs +22 -0
- package/dist/lib/node-esm/delete-YXLT7J27.mjs.map +7 -0
- package/dist/lib/node-esm/deploy-MXVZXAUC.mjs +63 -0
- package/dist/lib/node-esm/deploy-MXVZXAUC.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +169 -220
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/inspect-invocations-TVAKGYX5.mjs +60 -0
- package/dist/lib/node-esm/inspect-invocations-TVAKGYX5.mjs.map +7 -0
- package/dist/lib/node-esm/install-function-ST3VABJH.mjs +52 -0
- package/dist/lib/node-esm/install-function-ST3VABJH.mjs.map +7 -0
- package/dist/lib/node-esm/invoke-64WDU55Y.mjs +34 -0
- package/dist/lib/node-esm/invoke-64WDU55Y.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/operations/index.mjs +15 -0
- package/dist/lib/node-esm/operations/index.mjs.map +7 -0
- package/dist/lib/node-esm/query-deployed-functions-2VCNGQ7X.mjs +31 -0
- package/dist/lib/node-esm/query-deployed-functions-2VCNGQ7X.mjs.map +7 -0
- package/dist/lib/node-esm/read-PECQUAPS.mjs +27 -0
- package/dist/lib/node-esm/read-PECQUAPS.mjs.map +7 -0
- package/dist/lib/node-esm/templates/index.mjs +1 -1
- package/dist/lib/node-esm/translations.mjs +105 -0
- package/dist/lib/node-esm/translations.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +3 -7
- package/dist/lib/node-esm/update-XDFTGSPP.mjs +64 -0
- package/dist/lib/node-esm/update-XDFTGSPP.mjs.map +7 -0
- package/dist/types/src/ScriptPlugin.d.ts +1 -0
- package/dist/types/src/ScriptPlugin.d.ts.map +1 -1
- package/dist/types/src/ScriptPlugin.node.d.ts +4 -0
- package/dist/types/src/ScriptPlugin.node.d.ts.map +1 -0
- package/dist/types/src/ScriptPlugin.test.d.ts +2 -0
- package/dist/types/src/ScriptPlugin.test.d.ts.map +1 -0
- package/dist/types/src/blueprints/functions/create.d.ts +11 -0
- package/dist/types/src/blueprints/functions/create.d.ts.map +1 -0
- package/dist/types/src/blueprints/functions/definitions.d.ts +141 -0
- package/dist/types/src/blueprints/functions/definitions.d.ts.map +1 -0
- package/dist/types/src/blueprints/functions/delete.d.ts +18 -0
- package/dist/types/src/blueprints/functions/delete.d.ts.map +1 -0
- package/dist/types/src/blueprints/functions/deploy.d.ts +22 -0
- package/dist/types/src/blueprints/functions/deploy.d.ts.map +1 -0
- package/dist/types/src/blueprints/functions/index.d.ts +4 -0
- package/dist/types/src/blueprints/functions/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/functions/inspect-invocations.d.ts +29 -0
- package/dist/types/src/blueprints/functions/inspect-invocations.d.ts.map +1 -0
- package/dist/types/src/blueprints/functions/install-function.d.ts +11 -0
- package/dist/types/src/blueprints/functions/install-function.d.ts.map +1 -0
- package/dist/types/src/blueprints/functions/invoke.d.ts +22 -0
- package/dist/types/src/blueprints/functions/invoke.d.ts.map +1 -0
- package/dist/types/src/blueprints/functions/query-deployed-functions.d.ts +13 -0
- package/dist/types/src/blueprints/functions/query-deployed-functions.d.ts.map +1 -0
- package/dist/types/src/blueprints/functions/read.d.ts +22 -0
- package/dist/types/src/blueprints/functions/read.d.ts.map +1 -0
- package/dist/types/src/blueprints/functions/update.d.ts +27 -0
- package/dist/types/src/blueprints/functions/update.d.ts.map +1 -0
- package/dist/types/src/blueprints/index.d.ts +1 -1
- package/dist/types/src/blueprints/index.d.ts.map +1 -1
- package/dist/types/src/blueprints/script-blueprint.d.ts +3 -21
- package/dist/types/src/blueprints/script-blueprint.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +6 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/{artifact-definition/artifact-definition.d.ts → artifact-definition.d.ts} +1 -1
- package/dist/types/src/capabilities/artifact-definition.d.ts.map +1 -0
- package/dist/types/src/capabilities/blueprint-definition.d.ts +6 -0
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -0
- package/dist/types/src/capabilities/compiler.d.ts +6 -0
- package/dist/types/src/capabilities/compiler.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +8 -6
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts +5 -0
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/settings.d.ts +7 -0
- package/dist/types/src/capabilities/settings.d.ts.map +1 -0
- package/dist/types/src/compiler/compiler.d.ts.map +1 -1
- package/dist/types/src/components/{FrameContainer/FrameContainer.d.ts → FramePanel/FramePanel.d.ts} +3 -3
- 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 +1 -1
- package/dist/types/src/components/NotebookStack/NotebookCell.d.ts.map +1 -1
- package/dist/types/src/components/NotebookStack/NotebookMenu.d.ts +1 -1
- package/dist/types/src/components/NotebookStack/NotebookMenu.d.ts.map +1 -1
- package/dist/types/src/components/NotebookStack/NotebookStack.d.ts +4 -2
- package/dist/types/src/components/NotebookStack/NotebookStack.d.ts.map +1 -1
- package/dist/types/src/components/NotebookStack/NotebookStack.stories.d.ts +219 -228
- package/dist/types/src/components/NotebookStack/NotebookStack.stories.d.ts.map +1 -1
- package/dist/types/src/components/QueryEditor/QueryEditor.d.ts.map +1 -1
- package/dist/types/src/components/QueryEditor/QueryEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/ScriptPluginSettings/ScriptPluginSettings.d.ts +8 -0
- package/dist/types/src/components/ScriptPluginSettings/ScriptPluginSettings.d.ts.map +1 -0
- package/dist/types/src/components/ScriptPluginSettings/ScriptPluginSettings.stories.d.ts +241 -0
- package/dist/types/src/components/ScriptPluginSettings/ScriptPluginSettings.stories.d.ts.map +1 -0
- package/dist/types/src/components/ScriptPluginSettings/index.d.ts +2 -0
- package/dist/types/src/components/ScriptPluginSettings/index.d.ts.map +1 -0
- package/dist/types/src/components/ScriptToolbar/ScriptToolbar.d.ts +7 -5
- package/dist/types/src/components/ScriptToolbar/ScriptToolbar.d.ts.map +1 -1
- package/dist/types/src/components/ScriptToolbar/ScriptToolbar.stories.d.ts +219 -228
- package/dist/types/src/components/ScriptToolbar/ScriptToolbar.stories.d.ts.map +1 -1
- package/dist/types/src/components/TestPanel/TestPanel.d.ts +4 -2
- package/dist/types/src/components/TestPanel/TestPanel.d.ts.map +1 -1
- package/dist/types/src/components/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 +3 -1
- package/dist/types/src/components/TypescriptEditor/TypescriptEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +6 -5
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/constants.d.ts +2 -0
- package/dist/types/src/constants.d.ts.map +1 -0
- package/dist/types/src/{components → containers}/DeploymentDialog/DeploymentDialog.d.ts +0 -2
- package/dist/types/src/containers/DeploymentDialog/DeploymentDialog.d.ts.map +1 -0
- package/dist/types/src/containers/DeploymentDialog/DeploymentDialog.stories.d.ts +240 -0
- package/dist/types/src/{components → containers}/DeploymentDialog/DeploymentDialog.stories.d.ts.map +1 -1
- package/dist/types/src/containers/DeploymentDialog/index.d.ts +2 -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.map +1 -0
- package/dist/types/src/containers/NotebookContainer/index.d.ts +2 -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/ScriptContainer.stories.d.ts +242 -0
- package/dist/types/src/containers/ScriptContainer/ScriptContainer.stories.d.ts.map +1 -0
- package/dist/types/src/containers/ScriptContainer/index.d.ts +2 -0
- package/dist/types/src/containers/ScriptContainer/index.d.ts.map +1 -0
- package/dist/types/src/containers/ScriptProperties/BlueprintEditor.d.ts +7 -0
- package/dist/types/src/containers/ScriptProperties/BlueprintEditor.d.ts.map +1 -0
- package/dist/types/src/containers/ScriptProperties/FunctionBinding.d.ts +7 -0
- package/dist/types/src/containers/ScriptProperties/FunctionBinding.d.ts.map +1 -0
- package/dist/types/src/containers/ScriptProperties/FunctionPublishing.d.ts +7 -0
- package/dist/types/src/containers/ScriptProperties/FunctionPublishing.d.ts.map +1 -0
- package/dist/types/src/containers/ScriptProperties/ScriptProperties.d.ts +6 -0
- package/dist/types/src/containers/ScriptProperties/ScriptProperties.d.ts.map +1 -0
- package/dist/types/src/containers/ScriptProperties/ScriptProperties.stories.d.ts +242 -0
- package/dist/types/src/containers/ScriptProperties/ScriptProperties.stories.d.ts.map +1 -0
- package/dist/types/src/containers/ScriptProperties/index.d.ts +2 -0
- package/dist/types/src/containers/ScriptProperties/index.d.ts.map +1 -0
- package/dist/types/src/{components/TestPanel → containers/TestContainer}/TestContainer.d.ts +1 -1
- package/dist/types/src/containers/TestContainer/TestContainer.d.ts.map +1 -0
- package/dist/types/src/containers/TestContainer/index.d.ts +2 -0
- package/dist/types/src/containers/TestContainer/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +7 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/hooks/deploy.d.ts +18 -5
- package/dist/types/src/hooks/deploy.d.ts.map +1 -1
- package/dist/types/src/hooks/format.d.ts +2 -1
- package/dist/types/src/hooks/format.d.ts.map +1 -1
- package/dist/types/src/hooks/template.d.ts +2 -1
- package/dist/types/src/hooks/template.d.ts.map +1 -1
- package/dist/types/src/hooks/useCompiler.d.ts.map +1 -1
- package/dist/types/src/hooks/useCreateAndDeployScriptTemplates.d.ts.map +1 -1
- package/dist/types/src/hooks/useToolbarState.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +2 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/notebook/compute-graph.d.ts +1 -1
- package/dist/types/src/notebook/compute-graph.d.ts.map +1 -1
- package/dist/types/src/notebook/eval.d.ts.map +1 -1
- package/dist/types/src/notebook/vfs-parser.d.ts.map +1 -1
- package/dist/types/src/operations/access-token-created.d.ts +5 -0
- package/dist/types/src/operations/access-token-created.d.ts.map +1 -0
- package/dist/types/src/operations/create-script.d.ts +5 -0
- package/dist/types/src/operations/create-script.d.ts.map +1 -0
- package/dist/types/src/operations/definitions.d.ts +29 -0
- package/dist/types/src/operations/definitions.d.ts.map +1 -0
- package/dist/types/src/operations/index.d.ts +4 -0
- package/dist/types/src/operations/index.d.ts.map +1 -0
- package/dist/types/src/templates/anthropic.d.ts +4 -5
- package/dist/types/src/templates/anthropic.d.ts.map +1 -1
- package/dist/types/src/templates/chat.d.ts.map +1 -1
- package/dist/types/src/templates/chess-bot.d.ts +7 -5
- package/dist/types/src/templates/chess-bot.d.ts.map +1 -1
- package/dist/types/src/templates/commentary.d.ts +7 -4
- package/dist/types/src/templates/commentary.d.ts.map +1 -1
- package/dist/types/src/templates/data-generator.d.ts.map +1 -1
- package/dist/types/src/templates/discord.d.ts.map +1 -1
- package/dist/types/src/templates/email.d.ts.map +1 -1
- package/dist/types/src/templates/forex-effect.d.ts +3 -2
- package/dist/types/src/templates/forex-effect.d.ts.map +1 -1
- package/dist/types/src/templates/forex.d.ts +3 -2
- package/dist/types/src/templates/forex.d.ts.map +1 -1
- package/dist/types/src/templates/gmail.d.ts.map +1 -1
- package/dist/types/src/templates/index.d.ts +29 -29
- package/dist/types/src/templates/index.d.ts.map +1 -1
- package/dist/types/src/templates/ping.d.ts +2 -1
- package/dist/types/src/templates/ping.d.ts.map +1 -1
- package/dist/types/src/testing/index.d.ts +2 -1
- package/dist/types/src/testing/index.d.ts.map +1 -1
- package/dist/types/src/testing/test-notebook.d.ts +3 -0
- package/dist/types/src/testing/test-notebook.d.ts.map +1 -0
- package/dist/types/src/testing/test-script.d.ts +7 -0
- package/dist/types/src/testing/test-script.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +222 -92
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Notebook.d.ts +65 -49
- package/dist/types/src/types/Notebook.d.ts.map +1 -1
- package/dist/types/src/types/Settings.d.ts +7 -0
- package/dist/types/src/types/Settings.d.ts.map +1 -0
- package/dist/types/src/types/capabilities.d.ts +2 -5
- package/dist/types/src/types/capabilities.d.ts.map +1 -1
- package/dist/types/src/types/events.d.ts.map +1 -1
- package/dist/types/src/types/index.d.ts +0 -1
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +1 -5
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/src/util/deploy.d.ts +2 -2
- package/dist/types/src/util/deploy.d.ts.map +1 -1
- package/dist/types/src/util/functions.d.ts +2 -2
- package/dist/types/src/util/functions.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +121 -99
- package/src/ScriptPlugin.node.ts +70 -0
- package/src/ScriptPlugin.test.ts +31 -0
- package/src/ScriptPlugin.tsx +52 -34
- package/src/blueprints/functions/create.ts +47 -0
- package/src/blueprints/functions/definitions.ts +323 -0
- package/src/blueprints/functions/delete.ts +23 -0
- package/src/blueprints/functions/deploy.ts +70 -0
- package/src/blueprints/functions/index.ts +19 -0
- package/src/blueprints/functions/inspect-invocations.ts +56 -0
- package/src/blueprints/functions/install-function.ts +56 -0
- package/src/blueprints/functions/invoke.ts +35 -0
- package/src/blueprints/functions/query-deployed-functions.ts +31 -0
- package/src/blueprints/functions/read.ts +29 -0
- package/src/blueprints/functions/update.ts +68 -0
- package/src/blueprints/index.ts +1 -1
- package/src/blueprints/script-blueprint.ts +40 -9
- package/src/capabilities/app-graph-builder.ts +47 -0
- package/src/capabilities/{artifact-definition/artifact-definition.ts → artifact-definition.ts} +2 -3
- package/src/capabilities/blueprint-definition.ts +19 -0
- package/src/capabilities/{compiler/compiler.ts → compiler.ts} +17 -9
- package/src/capabilities/index.ts +13 -6
- package/src/capabilities/operation-handler.ts +21 -0
- package/src/capabilities/react-surface.tsx +130 -0
- package/src/capabilities/{settings/settings.ts → settings.ts} +7 -6
- package/src/compiler/compiler.ts +8 -1
- package/src/components/{FrameContainer/FrameContainer.tsx → FramePanel/FramePanel.tsx} +4 -5
- package/src/components/{FrameContainer → FramePanel}/index.ts +1 -1
- package/src/components/NotebookStack/NotebookCell.tsx +31 -22
- package/src/components/NotebookStack/NotebookMenu.tsx +7 -7
- package/src/components/NotebookStack/NotebookStack.stories.tsx +7 -9
- package/src/components/NotebookStack/NotebookStack.tsx +27 -16
- package/src/components/QueryEditor/QueryEditor.stories.tsx +18 -22
- package/src/components/ScriptPluginSettings/ScriptPluginSettings.stories.tsx +32 -0
- package/src/components/ScriptPluginSettings/ScriptPluginSettings.tsx +42 -0
- package/src/components/ScriptPluginSettings/index.ts +5 -0
- package/src/components/ScriptToolbar/ScriptToolbar.stories.tsx +8 -9
- package/src/components/ScriptToolbar/ScriptToolbar.tsx +24 -26
- package/src/components/TestPanel/TestPanel.tsx +110 -194
- package/src/components/TestPanel/index.ts +0 -1
- package/src/components/TypescriptEditor/TypescriptEditor.stories.tsx +17 -15
- package/src/components/TypescriptEditor/TypescriptEditor.tsx +26 -19
- package/src/components/index.ts +6 -7
- package/src/constants.ts +7 -0
- package/src/{components → containers}/DeploymentDialog/DeploymentDialog.stories.tsx +8 -7
- package/src/{components → containers}/DeploymentDialog/DeploymentDialog.tsx +33 -37
- package/src/containers/DeploymentDialog/index.ts +5 -0
- package/src/{components → containers/NotebookContainer}/NotebookContainer.stories.tsx +18 -20
- package/src/{components → containers/NotebookContainer}/NotebookContainer.tsx +61 -77
- package/src/containers/NotebookContainer/index.ts +5 -0
- package/src/containers/ScriptContainer/ScriptContainer.stories.tsx +106 -0
- package/src/{components → containers/ScriptContainer}/ScriptContainer.tsx +28 -27
- package/src/containers/ScriptContainer/index.ts +5 -0
- package/src/containers/ScriptProperties/BlueprintEditor.tsx +101 -0
- package/src/containers/ScriptProperties/FunctionBinding.tsx +83 -0
- package/src/containers/ScriptProperties/FunctionPublishing.tsx +121 -0
- package/src/containers/ScriptProperties/ScriptProperties.stories.tsx +75 -0
- package/src/containers/ScriptProperties/ScriptProperties.tsx +24 -0
- package/src/containers/ScriptProperties/index.ts +5 -0
- package/src/containers/TestContainer/TestContainer.tsx +44 -0
- package/src/containers/TestContainer/index.ts +5 -0
- package/src/containers/index.ts +11 -0
- package/src/e2e/ai.test.ts +7 -6
- package/src/e2e/deploy.test.ts +5 -5
- package/src/hooks/deploy.ts +15 -13
- package/src/hooks/format.ts +6 -5
- package/src/hooks/template.ts +9 -8
- package/src/hooks/useCompiler.ts +4 -3
- package/src/hooks/useCreateAndDeployScriptTemplates.ts +5 -4
- package/src/hooks/useToolbarState.ts +7 -6
- package/src/index.ts +6 -3
- package/src/meta.ts +2 -2
- package/src/notebook/compute-graph.test.ts +7 -7
- package/src/notebook/compute-graph.ts +1 -1
- package/src/notebook/vfs-parser.ts +10 -3
- package/src/operations/access-token-created.ts +37 -0
- package/src/operations/create-script.ts +46 -0
- package/src/operations/definitions.ts +40 -0
- package/src/operations/index.ts +12 -0
- package/src/templates/anthropic.ts +19 -12
- package/src/templates/chat.ts +1 -1
- package/src/templates/chess-bot.ts +37 -34
- package/src/templates/commentary.ts +178 -162
- package/src/templates/data-generator.ts +1 -1
- package/src/templates/discord.ts +3 -3
- package/src/templates/forex-effect.ts +30 -19
- package/src/templates/forex.ts +24 -15
- package/src/templates/gmail.ts +4 -4
- package/src/templates/index.ts +18 -18
- package/src/templates/ping.ts +16 -8
- package/src/testing/index.ts +2 -1
- package/src/testing/simulator.test.ts +3 -4
- package/src/testing/{data.ts → test-notebook.ts} +4 -5
- package/src/testing/test-script.ts +29 -0
- package/src/translations.ts +86 -87
- package/src/types/Notebook.ts +12 -8
- package/src/types/Settings.ts +20 -0
- package/src/types/capabilities.ts +5 -5
- package/src/types/events.ts +2 -2
- package/src/types/index.ts +0 -1
- package/src/types/types.ts +1 -11
- package/src/util/deploy.ts +13 -11
- package/src/util/functions.ts +9 -8
- package/dist/lib/browser/DeploymentDialog-GXNRUXF6.mjs +0 -14
- package/dist/lib/browser/DeploymentDialog-GXNRUXF6.mjs.map +0 -7
- package/dist/lib/browser/NotebookContainer-4MM2VAQF.mjs.map +0 -7
- package/dist/lib/browser/ScriptContainer-X6GCYZZW.mjs +0 -149
- package/dist/lib/browser/ScriptContainer-X6GCYZZW.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-7VO7AUI6.mjs +0 -68
- package/dist/lib/browser/app-graph-builder-7VO7AUI6.mjs.map +0 -7
- package/dist/lib/browser/blueprint-definition-OSOUYI7A.mjs +0 -17
- package/dist/lib/browser/blueprint-definition-OSOUYI7A.mjs.map +0 -7
- package/dist/lib/browser/chunk-3O2DQGCP.mjs +0 -113
- package/dist/lib/browser/chunk-3O2DQGCP.mjs.map +0 -7
- package/dist/lib/browser/chunk-BTWHM6FH.mjs +0 -270
- package/dist/lib/browser/chunk-BTWHM6FH.mjs.map +0 -7
- package/dist/lib/browser/chunk-F3QKSKSF.mjs +0 -35
- package/dist/lib/browser/chunk-F3QKSKSF.mjs.map +0 -7
- package/dist/lib/browser/chunk-I7CSE6T3.mjs +0 -110
- package/dist/lib/browser/chunk-I7CSE6T3.mjs.map +0 -7
- package/dist/lib/browser/chunk-IQRLM6JK.mjs +0 -137
- package/dist/lib/browser/chunk-IQRLM6JK.mjs.map +0 -7
- package/dist/lib/browser/chunk-NWSK27QB.mjs +0 -606
- package/dist/lib/browser/chunk-NWSK27QB.mjs.map +0 -7
- package/dist/lib/browser/chunk-UX4GHJ5E.mjs.map +0 -7
- package/dist/lib/browser/chunk-WX2NVNFQ.mjs +0 -557
- package/dist/lib/browser/chunk-WX2NVNFQ.mjs.map +0 -7
- package/dist/lib/browser/chunk-WYR4QHPE.mjs +0 -31
- package/dist/lib/browser/chunk-WYR4QHPE.mjs.map +0 -7
- package/dist/lib/browser/compiler-XRBFQFXO.mjs +0 -161
- package/dist/lib/browser/compiler-XRBFQFXO.mjs.map +0 -7
- package/dist/lib/browser/operation-resolver-MUNR376F.mjs +0 -82
- package/dist/lib/browser/operation-resolver-MUNR376F.mjs.map +0 -7
- package/dist/lib/browser/react-surface-5TEC66UY.mjs +0 -139
- package/dist/lib/browser/react-surface-5TEC66UY.mjs.map +0 -7
- package/dist/lib/browser/settings-R4WKREUJ.mjs +0 -35
- package/dist/lib/browser/settings-R4WKREUJ.mjs.map +0 -7
- package/dist/lib/node-esm/DeploymentDialog-EVFV2VJT.mjs +0 -15
- package/dist/lib/node-esm/DeploymentDialog-EVFV2VJT.mjs.map +0 -7
- package/dist/lib/node-esm/NotebookContainer-QLW5ZYGS.mjs.map +0 -7
- package/dist/lib/node-esm/ScriptContainer-3DZ3BMHW.mjs +0 -150
- package/dist/lib/node-esm/ScriptContainer-3DZ3BMHW.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-NVE3EVBG.mjs +0 -69
- package/dist/lib/node-esm/app-graph-builder-NVE3EVBG.mjs.map +0 -7
- package/dist/lib/node-esm/blueprint-definition-NC7NNJGI.mjs +0 -18
- package/dist/lib/node-esm/blueprint-definition-NC7NNJGI.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-4F5FJZ36.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-5HSJPAK7.mjs +0 -33
- package/dist/lib/node-esm/chunk-5HSJPAK7.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-KN6SQYUF.mjs +0 -114
- package/dist/lib/node-esm/chunk-KN6SQYUF.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-MGWKULCD.mjs +0 -558
- package/dist/lib/node-esm/chunk-MGWKULCD.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-SLU3KRV3.mjs +0 -112
- package/dist/lib/node-esm/chunk-SLU3KRV3.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-VWOLKNMO.mjs +0 -271
- package/dist/lib/node-esm/chunk-VWOLKNMO.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-Y3G5NCTP.mjs +0 -36
- package/dist/lib/node-esm/chunk-Y3G5NCTP.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-YEWLTVBT.mjs +0 -138
- package/dist/lib/node-esm/chunk-YEWLTVBT.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ZQGHFNO3.mjs +0 -607
- package/dist/lib/node-esm/chunk-ZQGHFNO3.mjs.map +0 -7
- package/dist/lib/node-esm/compiler-ORJAXDN7.mjs +0 -162
- package/dist/lib/node-esm/compiler-ORJAXDN7.mjs.map +0 -7
- package/dist/lib/node-esm/operation-resolver-CLE4ZCC5.mjs +0 -83
- package/dist/lib/node-esm/operation-resolver-CLE4ZCC5.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-O3UDMKOQ.mjs +0 -140
- package/dist/lib/node-esm/react-surface-O3UDMKOQ.mjs.map +0 -7
- package/dist/lib/node-esm/settings-OFIMHU7K.mjs +0 -36
- package/dist/lib/node-esm/settings-OFIMHU7K.mjs.map +0 -7
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +0 -6
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +0 -1
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts +0 -3
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/artifact-definition/artifact-definition.d.ts.map +0 -1
- package/dist/types/src/capabilities/artifact-definition/index.d.ts +0 -3
- package/dist/types/src/capabilities/artifact-definition/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts +0 -9
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts.map +0 -1
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts +0 -3
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/compiler/compiler.d.ts +0 -6
- package/dist/types/src/capabilities/compiler/compiler.d.ts.map +0 -1
- package/dist/types/src/capabilities/compiler/index.d.ts +0 -3
- package/dist/types/src/capabilities/compiler/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-resolver/index.d.ts +0 -3
- package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +0 -5
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +0 -5
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
- package/dist/types/src/capabilities/settings/index.d.ts +0 -7
- package/dist/types/src/capabilities/settings/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/settings/settings.d.ts +0 -9
- package/dist/types/src/capabilities/settings/settings.d.ts.map +0 -1
- package/dist/types/src/components/DeploymentDialog/DeploymentDialog.d.ts.map +0 -1
- package/dist/types/src/components/DeploymentDialog/DeploymentDialog.stories.d.ts +0 -249
- 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.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/NotebookContainer.d.ts +0 -8
- package/dist/types/src/components/NotebookContainer.d.ts.map +0 -1
- package/dist/types/src/components/NotebookContainer.stories.d.ts.map +0 -1
- package/dist/types/src/components/ScriptContainer.d.ts +0 -11
- 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 -8
- 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.map +0 -1
- package/dist/types/src/testing/data.d.ts +0 -3
- package/dist/types/src/testing/data.d.ts.map +0 -1
- package/dist/types/src/types/actions.d.ts +0 -40
- package/dist/types/src/types/actions.d.ts.map +0 -1
- package/src/capabilities/app-graph-builder/app-graph-builder.ts +0 -55
- package/src/capabilities/app-graph-builder/index.ts +0 -7
- package/src/capabilities/artifact-definition/index.ts +0 -7
- package/src/capabilities/blueprint-definition/blueprint-definition.ts +0 -23
- package/src/capabilities/blueprint-definition/index.ts +0 -7
- package/src/capabilities/compiler/index.ts +0 -7
- package/src/capabilities/operation-resolver/index.ts +0 -7
- package/src/capabilities/operation-resolver/operation-resolver.ts +0 -74
- package/src/capabilities/react-surface/index.ts +0 -7
- package/src/capabilities/react-surface/react-surface.tsx +0 -118
- package/src/capabilities/settings/index.ts +0 -7
- 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/Settings/ScriptObjectSettings.tsx +0 -309
- package/src/components/Settings/ScriptPluginSettings.tsx +0 -66
- package/src/components/Settings/index.ts +0 -6
- package/src/components/TestPanel/TestContainer.tsx +0 -27
- package/src/types/actions.ts +0 -45
- /package/dist/types/src/{components → containers/NotebookContainer}/NotebookContainer.stories.d.ts +0 -0
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import * as Effect from 'effect/Effect';
|
|
6
|
-
|
|
7
|
-
import { Capability, Common } from '@dxos/app-framework';
|
|
8
|
-
|
|
9
|
-
import { ScriptBlueprint } from '../../blueprints';
|
|
10
|
-
|
|
11
|
-
export type BlueprintCapabilities = [
|
|
12
|
-
Capability.Capability<typeof Common.Capability.Functions>,
|
|
13
|
-
Capability.Capability<typeof Common.Capability.BlueprintDefinition>,
|
|
14
|
-
];
|
|
15
|
-
|
|
16
|
-
const blueprintDefinition = Capability.makeModule<[], BlueprintCapabilities>(() =>
|
|
17
|
-
Effect.succeed([
|
|
18
|
-
Capability.contributes(Common.Capability.Functions, ScriptBlueprint.functions),
|
|
19
|
-
Capability.contributes(Common.Capability.BlueprintDefinition, ScriptBlueprint.make()),
|
|
20
|
-
]),
|
|
21
|
-
);
|
|
22
|
-
|
|
23
|
-
export default blueprintDefinition;
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { Octokit } from '@octokit/core';
|
|
6
|
-
import * as Effect from 'effect/Effect';
|
|
7
|
-
import * as Predicate from 'effect/Predicate';
|
|
8
|
-
|
|
9
|
-
import { Capability, Common } from '@dxos/app-framework';
|
|
10
|
-
import { Script } from '@dxos/functions';
|
|
11
|
-
import { Operation, OperationResolver } from '@dxos/operation';
|
|
12
|
-
import { TokenManagerOperation } from '@dxos/plugin-token-manager/types';
|
|
13
|
-
|
|
14
|
-
import { DEPLOYMENT_DIALOG } from '../../components';
|
|
15
|
-
import { defaultScriptsForIntegration } from '../../meta';
|
|
16
|
-
import { templates } from '../../templates';
|
|
17
|
-
import { ScriptOperation } from '../../types';
|
|
18
|
-
|
|
19
|
-
export default Capability.makeModule(
|
|
20
|
-
Effect.fnUntraced(function* () {
|
|
21
|
-
return Capability.contributes(Common.Capability.OperationResolver, [
|
|
22
|
-
OperationResolver.make({
|
|
23
|
-
operation: ScriptOperation.CreateScript,
|
|
24
|
-
handler: Effect.fnUntraced(function* ({ name, gistUrl, initialTemplateId }) {
|
|
25
|
-
let source = templates[0].source;
|
|
26
|
-
let scriptName = name;
|
|
27
|
-
|
|
28
|
-
const gistId = gistUrl?.split('/').at(-1);
|
|
29
|
-
if (gistId) {
|
|
30
|
-
// TODO(wittjosiah): Capability which contributes Octokit?
|
|
31
|
-
// NOTE: AccessToken not needed to read public gists.
|
|
32
|
-
const octokit = new Octokit();
|
|
33
|
-
const response = yield* Effect.promise(() =>
|
|
34
|
-
octokit.request('GET /gists/{gist_id}', {
|
|
35
|
-
gist_id: gistId,
|
|
36
|
-
}),
|
|
37
|
-
);
|
|
38
|
-
const gistContent = Object.values(response.data.files ?? {})[0]?.content;
|
|
39
|
-
if (gistContent) {
|
|
40
|
-
source = gistContent;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
if (initialTemplateId) {
|
|
45
|
-
const template = templates.find((template) => template.id === initialTemplateId);
|
|
46
|
-
if (template) {
|
|
47
|
-
source = template.source;
|
|
48
|
-
scriptName = scriptName || template.name;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
return { object: Script.make({ name: scriptName, source }) };
|
|
53
|
-
}),
|
|
54
|
-
}),
|
|
55
|
-
OperationResolver.make({
|
|
56
|
-
operation: TokenManagerOperation.AccessTokenCreated,
|
|
57
|
-
handler: Effect.fnUntraced(function* ({ accessToken }) {
|
|
58
|
-
const scriptTemplates = (defaultScriptsForIntegration[accessToken.source] ?? [])
|
|
59
|
-
.map((id) => templates.find((t) => t.id === id))
|
|
60
|
-
.filter(Predicate.isNotNullable);
|
|
61
|
-
|
|
62
|
-
if (scriptTemplates.length > 0) {
|
|
63
|
-
yield* Operation.invoke(Common.LayoutOperation.UpdateDialog, {
|
|
64
|
-
subject: DEPLOYMENT_DIALOG,
|
|
65
|
-
blockAlign: 'start',
|
|
66
|
-
state: true,
|
|
67
|
-
props: { accessToken, scriptTemplates },
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
}),
|
|
71
|
-
}),
|
|
72
|
-
]);
|
|
73
|
-
}),
|
|
74
|
-
);
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import * as Effect from 'effect/Effect';
|
|
6
|
-
import React from 'react';
|
|
7
|
-
|
|
8
|
-
import { Capability, Common } from '@dxos/app-framework';
|
|
9
|
-
import { useAtomCapability, useSettingsState } from '@dxos/app-framework/react';
|
|
10
|
-
import { InvocationTraceContainer } from '@dxos/devtools';
|
|
11
|
-
import { Obj } from '@dxos/echo';
|
|
12
|
-
import { Script } from '@dxos/functions';
|
|
13
|
-
import { getSpace } from '@dxos/react-client/echo';
|
|
14
|
-
import { Layout } from '@dxos/react-ui-mosaic';
|
|
15
|
-
import { type AccessToken } from '@dxos/types';
|
|
16
|
-
|
|
17
|
-
import {
|
|
18
|
-
DEPLOYMENT_DIALOG,
|
|
19
|
-
DeploymentDialog,
|
|
20
|
-
NotebookContainer,
|
|
21
|
-
ScriptContainer,
|
|
22
|
-
ScriptObjectSettings,
|
|
23
|
-
ScriptPluginSettings,
|
|
24
|
-
ScriptProperties,
|
|
25
|
-
TestContainer,
|
|
26
|
-
} from '../../components';
|
|
27
|
-
import { useCompiler } from '../../hooks';
|
|
28
|
-
import { meta } from '../../meta';
|
|
29
|
-
import { Notebook, ScriptCapabilities, type ScriptSettings } from '../../types';
|
|
30
|
-
|
|
31
|
-
export default Capability.makeModule(() =>
|
|
32
|
-
Effect.succeed(
|
|
33
|
-
Capability.contributes(Common.Capability.ReactSurface, [
|
|
34
|
-
Common.createSurface({
|
|
35
|
-
id: `${meta.id}/plugin-settings`,
|
|
36
|
-
role: 'article',
|
|
37
|
-
filter: (data): data is { subject: Common.Capability.Settings } =>
|
|
38
|
-
Common.Capability.isSettings(data.subject) && data.subject.prefix === meta.id,
|
|
39
|
-
component: ({ data: { subject } }) => {
|
|
40
|
-
const { settings, updateSettings } = useSettingsState<ScriptSettings>(subject.atom);
|
|
41
|
-
return <ScriptPluginSettings settings={settings} onSettingsChange={updateSettings} />;
|
|
42
|
-
},
|
|
43
|
-
}),
|
|
44
|
-
Common.createSurface({
|
|
45
|
-
id: `${meta.id}/script/article`,
|
|
46
|
-
role: ['article', 'section'],
|
|
47
|
-
filter: (data): data is { subject: Script.Script } => Obj.instanceOf(Script.Script, data.subject),
|
|
48
|
-
component: ({ data, role }) => {
|
|
49
|
-
const compiler = useCompiler();
|
|
50
|
-
const settings = useAtomCapability(ScriptCapabilities.Settings);
|
|
51
|
-
// TODO(wittjosiah): Why? The editor should be allow to render even if the environment is not ready.
|
|
52
|
-
if (!compiler?.environment) {
|
|
53
|
-
return null;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
return <ScriptContainer role={role} subject={data.subject} settings={settings} env={compiler?.environment} />;
|
|
57
|
-
},
|
|
58
|
-
}),
|
|
59
|
-
Common.createSurface({
|
|
60
|
-
id: `${meta.id}/notebook/article`,
|
|
61
|
-
role: 'article',
|
|
62
|
-
filter: (data): data is { subject: Notebook.Notebook } => Obj.instanceOf(Notebook.Notebook, data.subject),
|
|
63
|
-
component: ({ data, role }) => {
|
|
64
|
-
const compiler = useCompiler();
|
|
65
|
-
return <NotebookContainer role={role} subject={data.subject} env={compiler?.environment} />;
|
|
66
|
-
},
|
|
67
|
-
}),
|
|
68
|
-
// TODO(burdon): Standardize PluginSettings vs ObjectSettings.
|
|
69
|
-
// TODO(burdon): Why is ScriptProperties different from ScriptObjectSettings?
|
|
70
|
-
Common.createSurface({
|
|
71
|
-
id: `${meta.id}/companion/base-settings`,
|
|
72
|
-
role: 'base-object-settings',
|
|
73
|
-
filter: (data): data is { subject: Script.Script } => Obj.instanceOf(Script.Script, data.subject),
|
|
74
|
-
component: ({ data }) => <ScriptProperties object={data.subject} />,
|
|
75
|
-
}),
|
|
76
|
-
Common.createSurface({
|
|
77
|
-
id: `${meta.id}/companion/settings`,
|
|
78
|
-
role: 'object-settings',
|
|
79
|
-
filter: (data): data is { subject: Script.Script } => Obj.instanceOf(Script.Script, data.subject),
|
|
80
|
-
component: ({ data }) => <ScriptObjectSettings object={data.subject} />,
|
|
81
|
-
}),
|
|
82
|
-
Common.createSurface({
|
|
83
|
-
id: `${meta.id}/companion/execute`,
|
|
84
|
-
role: 'article',
|
|
85
|
-
filter: (data): data is { companionTo: Script.Script } =>
|
|
86
|
-
Obj.instanceOf(Script.Script, data.companionTo) && data.subject === 'execute',
|
|
87
|
-
component: ({ data, role }) => <TestContainer script={data.companionTo} role={role} />,
|
|
88
|
-
}),
|
|
89
|
-
Common.createSurface({
|
|
90
|
-
id: `${meta.id}/companion/logs`,
|
|
91
|
-
role: 'article',
|
|
92
|
-
filter: (data): data is { companionTo: Script.Script } =>
|
|
93
|
-
Obj.instanceOf(Script.Script, data.companionTo) && data.subject === 'logs',
|
|
94
|
-
component: ({ data, role }) => {
|
|
95
|
-
const space = getSpace(data.companionTo);
|
|
96
|
-
const queueDxn = space?.properties.invocationTraceQueue?.dxn;
|
|
97
|
-
return (
|
|
98
|
-
<Layout.Main role={role}>
|
|
99
|
-
<InvocationTraceContainer
|
|
100
|
-
db={space?.db}
|
|
101
|
-
queueDxn={queueDxn}
|
|
102
|
-
target={data.companionTo}
|
|
103
|
-
detailAxis='block'
|
|
104
|
-
/>
|
|
105
|
-
</Layout.Main>
|
|
106
|
-
);
|
|
107
|
-
},
|
|
108
|
-
}),
|
|
109
|
-
Common.createSurface({
|
|
110
|
-
id: DEPLOYMENT_DIALOG,
|
|
111
|
-
role: 'dialog',
|
|
112
|
-
filter: (data): data is { props: { accessToken: AccessToken.AccessToken; scriptTemplates: any } } =>
|
|
113
|
-
data.component === DEPLOYMENT_DIALOG,
|
|
114
|
-
component: ({ data }) => <DeploymentDialog {...data.props} />,
|
|
115
|
-
}),
|
|
116
|
-
]),
|
|
117
|
-
),
|
|
118
|
-
);
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
<html>
|
|
2
|
-
<head>
|
|
3
|
-
<script src="https://cdn.tailwindcss.com"></script>
|
|
4
|
-
<script type="importmap">
|
|
5
|
-
__IMPORT_MAP__
|
|
6
|
-
</script>
|
|
7
|
-
|
|
8
|
-
<script type="module">
|
|
9
|
-
import RefreshRuntime from '/@react-refresh';
|
|
10
|
-
RefreshRuntime.injectIntoGlobalHook(window);
|
|
11
|
-
window.$RefreshReg$ = () => {};
|
|
12
|
-
window.$RefreshSig$ = () => (type) => type;
|
|
13
|
-
window.__vite_plugin_react_preamble_installed__ = true;
|
|
14
|
-
</script>
|
|
15
|
-
<script type="module" src="/@vite/client"></script>
|
|
16
|
-
</head>
|
|
17
|
-
<body>
|
|
18
|
-
<div id="root"></div>
|
|
19
|
-
|
|
20
|
-
<!-- Prevent vite from compiling this. -->
|
|
21
|
-
<script type="module">
|
|
22
|
-
eval('import("@frame/main")');
|
|
23
|
-
</script>
|
|
24
|
-
</body>
|
|
25
|
-
</html>
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2023 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React from 'react';
|
|
6
|
-
import { createRoot } from 'react-dom/client';
|
|
7
|
-
|
|
8
|
-
import { ClientProvider } from '@dxos/react-client';
|
|
9
|
-
|
|
10
|
-
const init = async (f: () => Promise<Record<string, any>>) =>
|
|
11
|
-
Object.entries(await f()).reduce<Record<string, any>>((map, [key, module]) => {
|
|
12
|
-
map[key] = module;
|
|
13
|
-
return map;
|
|
14
|
-
}, {});
|
|
15
|
-
|
|
16
|
-
const main = async () => {
|
|
17
|
-
const { ClientServicesProxy } = await import('@dxos/react-client');
|
|
18
|
-
const { createIFramePort } = await import('@dxos/rpc-tunnel');
|
|
19
|
-
|
|
20
|
-
// @ts-ignore
|
|
21
|
-
window.__DXOS_SANDBOX_MODULES__ = await init(async () => ({
|
|
22
|
-
// prettier-ignore
|
|
23
|
-
'react': await import('react'),
|
|
24
|
-
'react-dom/client': await import('react-dom/client'),
|
|
25
|
-
'@dxos/client': await import('@dxos/client'),
|
|
26
|
-
'@dxos/react-client': await import('@dxos/react-client'),
|
|
27
|
-
'@dxos/react-client/echo': await import('@dxos/react-client/echo'),
|
|
28
|
-
'@dxos/plugin-explorer': await import('@dxos/plugin-explorer'),
|
|
29
|
-
}));
|
|
30
|
-
|
|
31
|
-
// eslint-disable-next-line @typescript-eslint/no-implied-eval
|
|
32
|
-
const Component = Function('React', "return React.lazy(() => import('@frame/bundle'))")(React);
|
|
33
|
-
|
|
34
|
-
const services = new ClientServicesProxy(
|
|
35
|
-
createIFramePort({
|
|
36
|
-
channel: 'frame',
|
|
37
|
-
origin: '*',
|
|
38
|
-
}),
|
|
39
|
-
);
|
|
40
|
-
|
|
41
|
-
// TODO(burdon): Error handling.
|
|
42
|
-
createRoot(document.getElementById('root')!).render(
|
|
43
|
-
<div className='flex fixed inset-0'>
|
|
44
|
-
<ClientProvider services={() => services}>
|
|
45
|
-
<Component />
|
|
46
|
-
</ClientProvider>
|
|
47
|
-
</div>,
|
|
48
|
-
);
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
void main();
|
|
@@ -1,309 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2024 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { Octokit } from '@octokit/core';
|
|
6
|
-
import React, { type ChangeEvent, useCallback, useState } from 'react';
|
|
7
|
-
|
|
8
|
-
import { ToolId } from '@dxos/ai';
|
|
9
|
-
import { SettingsOperation } from '@dxos/app-framework';
|
|
10
|
-
import { useOperationInvoker } from '@dxos/app-framework/react';
|
|
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
|
-
export const ScriptProperties = ({ object }: ScriptObjectSettingsProps) => {
|
|
39
|
-
const { t } = useTranslation(meta.id);
|
|
40
|
-
return (
|
|
41
|
-
<Input.Root>
|
|
42
|
-
<Input.Label>{t('description label')}</Input.Label>
|
|
43
|
-
<Input.TextInput
|
|
44
|
-
placeholder={t('description placeholder')}
|
|
45
|
-
value={object.description ?? ''}
|
|
46
|
-
onChange={(event) => {
|
|
47
|
-
Obj.change(object, (o) => {
|
|
48
|
-
o.description = event.target.value;
|
|
49
|
-
});
|
|
50
|
-
}}
|
|
51
|
-
/>
|
|
52
|
-
</Input.Root>
|
|
53
|
-
);
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
const BlueprintEditor = ({ object }: ScriptObjectSettingsProps) => {
|
|
57
|
-
const { t } = useTranslation(meta.id);
|
|
58
|
-
const db = Obj.getDatabase(object);
|
|
59
|
-
const [fn] = useQuery(db, Filter.type(Function.Function, { source: Ref.make(object) }));
|
|
60
|
-
const blueprints = useQuery(db, Filter.type(Blueprint.Blueprint));
|
|
61
|
-
|
|
62
|
-
const [creating, setCreating] = useState(false);
|
|
63
|
-
const [instructions, setInstructions] = useState<string>(`You can run the script "${object.name ?? 'script'}".`);
|
|
64
|
-
const blueprintKey = `dxos.org/blueprint/${kebabize(object.name ?? 'script')}`;
|
|
65
|
-
const existingBlueprint = blueprints.find((bp) => bp.key === blueprintKey);
|
|
66
|
-
|
|
67
|
-
useAsyncEffect(async () => {
|
|
68
|
-
if (!existingBlueprint) {
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
|
-
const source = await existingBlueprint.instructions.source.load();
|
|
72
|
-
setInstructions(source.content ?? '');
|
|
73
|
-
}, [existingBlueprint]);
|
|
74
|
-
|
|
75
|
-
const handleSave = useCallback(async () => {
|
|
76
|
-
if (!db) {
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
setCreating(true);
|
|
81
|
-
try {
|
|
82
|
-
if (existingBlueprint) {
|
|
83
|
-
const text = await existingBlueprint.instructions.source.load();
|
|
84
|
-
Obj.change(text, (t) => {
|
|
85
|
-
t.content = instructions;
|
|
86
|
-
});
|
|
87
|
-
if (fn?.key) {
|
|
88
|
-
const toolId = ToolId.make(fn.key);
|
|
89
|
-
if (!existingBlueprint.tools?.includes(toolId)) {
|
|
90
|
-
Obj.change(existingBlueprint, (b) => {
|
|
91
|
-
b.tools = [...(b.tools ?? []), toolId];
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
} else if (fn?.key) {
|
|
96
|
-
db.add(
|
|
97
|
-
Blueprint.make({
|
|
98
|
-
key: blueprintKey,
|
|
99
|
-
name: object.name ?? 'Script',
|
|
100
|
-
instructions: Template.make({
|
|
101
|
-
source: instructions,
|
|
102
|
-
}),
|
|
103
|
-
tools: [ToolId.make(fn.key)],
|
|
104
|
-
}),
|
|
105
|
-
);
|
|
106
|
-
}
|
|
107
|
-
await db.flush();
|
|
108
|
-
} finally {
|
|
109
|
-
setCreating(false);
|
|
110
|
-
}
|
|
111
|
-
}, [db, existingBlueprint, fn, blueprintKey, object.name, instructions]);
|
|
112
|
-
|
|
113
|
-
return (
|
|
114
|
-
<div className='flex flex-col gap-4 mlb-cardSpacingBlock'>
|
|
115
|
-
<div>
|
|
116
|
-
<h2>{t('blueprint editor label', { default: 'Blueprint' })}</h2>
|
|
117
|
-
<p className='text-description text-sm'>
|
|
118
|
-
{t('blueprint editor description', {
|
|
119
|
-
default: 'Create a blueprint that exposes this script as a tool.',
|
|
120
|
-
})}
|
|
121
|
-
</p>
|
|
122
|
-
</div>
|
|
123
|
-
<Input.Root>
|
|
124
|
-
<div role='none' className='flex flex-col gap-1'>
|
|
125
|
-
<Input.Label>{t('blueprint instructions label', { default: 'Instructions' })}</Input.Label>
|
|
126
|
-
<Input.TextArea
|
|
127
|
-
placeholder={t('blueprint instructions placeholder', {
|
|
128
|
-
default: 'Describe how this tool should be used.',
|
|
129
|
-
})}
|
|
130
|
-
rows={6}
|
|
131
|
-
value={instructions}
|
|
132
|
-
onChange={(event) => setInstructions(event.target.value)}
|
|
133
|
-
classNames='resize-y'
|
|
134
|
-
/>
|
|
135
|
-
</div>
|
|
136
|
-
</Input.Root>
|
|
137
|
-
<div className='flex justify-end gap-2'>
|
|
138
|
-
<Button disabled={(!existingBlueprint && !fn?.key) || creating} onClick={handleSave}>
|
|
139
|
-
{t(creating ? 'creating label' : 'create blueprint label', {
|
|
140
|
-
default: creating ? 'Creating…' : 'Create blueprint',
|
|
141
|
-
})}
|
|
142
|
-
</Button>
|
|
143
|
-
</div>
|
|
144
|
-
</div>
|
|
145
|
-
);
|
|
146
|
-
};
|
|
147
|
-
|
|
148
|
-
const Binding = ({ object }: ScriptObjectSettingsProps) => {
|
|
149
|
-
const { t } = useTranslation(meta.id);
|
|
150
|
-
const client = useClient();
|
|
151
|
-
const db = Obj.getDatabase(object);
|
|
152
|
-
const [fn] = useQuery(db, Filter.type(Function.Function, { source: Ref.make(object) }));
|
|
153
|
-
|
|
154
|
-
const functionId = fn && getUserFunctionIdInMetadata(Obj.getMeta(fn));
|
|
155
|
-
const functionUrl =
|
|
156
|
-
functionId &&
|
|
157
|
-
getInvocationUrl(functionId, client.config.values.runtime?.services?.edge?.url ?? '', {
|
|
158
|
-
spaceId: db?.spaceId,
|
|
159
|
-
});
|
|
160
|
-
|
|
161
|
-
const [binding, setBinding] = useControlledState(fn?.binding ?? '');
|
|
162
|
-
const handleBindingChange = useCallback(
|
|
163
|
-
(event: ChangeEvent<HTMLInputElement>) => {
|
|
164
|
-
setBinding(event.target.value);
|
|
165
|
-
},
|
|
166
|
-
[setBinding],
|
|
167
|
-
);
|
|
168
|
-
|
|
169
|
-
const handleBindingBlur = useCallback(() => {
|
|
170
|
-
Obj.change(fn, (f) => {
|
|
171
|
-
f.binding = binding;
|
|
172
|
-
});
|
|
173
|
-
}, [fn, binding]);
|
|
174
|
-
|
|
175
|
-
if (!fn || !functionUrl) {
|
|
176
|
-
return null;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
// TODO(burdon): Use form.
|
|
180
|
-
return (
|
|
181
|
-
<div role='form' className='flex flex-col gap-2 mlb-cardSpacingBlock'>
|
|
182
|
-
<h2>{t('remote function settings heading')}</h2>
|
|
183
|
-
<Input.Root>
|
|
184
|
-
<div role='none' className='flex flex-col gap-1'>
|
|
185
|
-
<Input.Label>{t('function url label')}</Input.Label>
|
|
186
|
-
<div role='none' className='flex gap-1'>
|
|
187
|
-
<Input.TextInput
|
|
188
|
-
disabled
|
|
189
|
-
value={functionUrl}
|
|
190
|
-
onChange={(event) => {
|
|
191
|
-
Obj.change(fn, (f) => {
|
|
192
|
-
f.name = event.target.value;
|
|
193
|
-
});
|
|
194
|
-
}}
|
|
195
|
-
/>
|
|
196
|
-
<Clipboard.IconButton value={functionUrl} />
|
|
197
|
-
</div>
|
|
198
|
-
</div>
|
|
199
|
-
</Input.Root>
|
|
200
|
-
<Input.Root>
|
|
201
|
-
<div role='none' className='flex flex-col gap-1'>
|
|
202
|
-
<Input.Label>{t('function binding label')}</Input.Label>
|
|
203
|
-
<Input.TextInput
|
|
204
|
-
placeholder={t('function binding placeholder')}
|
|
205
|
-
value={binding}
|
|
206
|
-
onChange={handleBindingChange}
|
|
207
|
-
onBlur={handleBindingBlur}
|
|
208
|
-
/>
|
|
209
|
-
</div>
|
|
210
|
-
</Input.Root>
|
|
211
|
-
</div>
|
|
212
|
-
);
|
|
213
|
-
};
|
|
214
|
-
|
|
215
|
-
// TODO(burdon): Move to separate tab?
|
|
216
|
-
const Publishing = ({ object }: ScriptObjectSettingsProps) => {
|
|
217
|
-
const { t } = useTranslation(meta.id);
|
|
218
|
-
const { invokePromise } = useOperationInvoker();
|
|
219
|
-
const db = Obj.getDatabase(object);
|
|
220
|
-
const [githubToken] = useQuery(db, Filter.type(AccessToken.AccessToken, { source: 'github.com' }));
|
|
221
|
-
const gistKey = Obj.getMeta(object).keys.find(({ source }) => source === 'github.com');
|
|
222
|
-
const [gistUrl, setGistUrl] = useState<string | undefined>();
|
|
223
|
-
|
|
224
|
-
useAsyncEffect(async () => {
|
|
225
|
-
const token = githubToken?.token;
|
|
226
|
-
const gistId = gistKey?.id;
|
|
227
|
-
if (!token || !gistId) {
|
|
228
|
-
setGistUrl(undefined);
|
|
229
|
-
return;
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
try {
|
|
233
|
-
const octokit = new Octokit({ auth: githubToken.token });
|
|
234
|
-
const response = await octokit.request('GET /gists/{gist_id}', {
|
|
235
|
-
gist_id: gistId,
|
|
236
|
-
});
|
|
237
|
-
setGistUrl(response.data.html_url);
|
|
238
|
-
} catch (err) {
|
|
239
|
-
log.catch(err);
|
|
240
|
-
setGistUrl(undefined);
|
|
241
|
-
}
|
|
242
|
-
}, [githubToken, gistKey]);
|
|
243
|
-
|
|
244
|
-
const handleOpenTokenManager = useCallback(
|
|
245
|
-
() =>
|
|
246
|
-
invokePromise(SettingsOperation.Open, {
|
|
247
|
-
plugin: 'dxos.org/plugin/token-manager',
|
|
248
|
-
}),
|
|
249
|
-
[invokePromise],
|
|
250
|
-
);
|
|
251
|
-
|
|
252
|
-
const [publishing, setPublishing] = useState(false);
|
|
253
|
-
const handlePublish = useCallback(async () => {
|
|
254
|
-
setPublishing(true);
|
|
255
|
-
const octokit = new Octokit({ auth: githubToken.token });
|
|
256
|
-
const source = await object.source.load();
|
|
257
|
-
const filename = object.name ? kebabize(object.name) : 'composer-script';
|
|
258
|
-
const files = { [`${filename}.ts`]: { content: source.content } };
|
|
259
|
-
|
|
260
|
-
try {
|
|
261
|
-
// TODO(wittjosiah): Factor out to intent.
|
|
262
|
-
const meta = Obj.getMeta(object);
|
|
263
|
-
const githubKey = meta.keys.find(({ source }) => source === 'github.com');
|
|
264
|
-
const gistId = githubKey?.id;
|
|
265
|
-
if (gistId) {
|
|
266
|
-
await octokit.request('PATCH /gists/{gist_id}', {
|
|
267
|
-
gist_id: gistId,
|
|
268
|
-
files,
|
|
269
|
-
});
|
|
270
|
-
} else {
|
|
271
|
-
const response = await octokit.request('POST /gists', {
|
|
272
|
-
public: true,
|
|
273
|
-
files,
|
|
274
|
-
});
|
|
275
|
-
const gistId = response.data.id;
|
|
276
|
-
if (gistId) {
|
|
277
|
-
Obj.change(object, (obj) => {
|
|
278
|
-
Obj.getMeta(obj).keys.push({ source: 'github.com', id: gistId });
|
|
279
|
-
});
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
} finally {
|
|
283
|
-
setPublishing(false);
|
|
284
|
-
}
|
|
285
|
-
}, [object, githubToken]);
|
|
286
|
-
|
|
287
|
-
return (
|
|
288
|
-
<div className='flex flex-col gap-4 mlb-cardSpacingBlock'>
|
|
289
|
-
<div>
|
|
290
|
-
<h2>{t('script publish settings label')}</h2>
|
|
291
|
-
<p className='text-description text-sm'>{t('script publish settings description')}</p>
|
|
292
|
-
</div>
|
|
293
|
-
{!githubToken && (
|
|
294
|
-
<div className='flex flex-col gap-2'>
|
|
295
|
-
<span>{t('no github token label')}</span>
|
|
296
|
-
<Button onClick={handleOpenTokenManager}>{t('open token manager label')}</Button>
|
|
297
|
-
</div>
|
|
298
|
-
)}
|
|
299
|
-
{githubToken && (
|
|
300
|
-
<div className='flex justify-end gap-2'>
|
|
301
|
-
{gistUrl && <Clipboard.IconButton value={gistUrl} />}
|
|
302
|
-
<Button disabled={publishing} onClick={handlePublish}>
|
|
303
|
-
{t(publishing ? 'publishing label' : 'publish label')}
|
|
304
|
-
</Button>
|
|
305
|
-
</div>
|
|
306
|
-
)}
|
|
307
|
-
</div>
|
|
308
|
-
);
|
|
309
|
-
};
|