@dxos/plugin-script 0.8.4-main.9735255 → 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-NBAXYESH.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-IUAYVJSD.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 +5 -3
- package/dist/types/src/templates/chess-bot.d.ts.map +1 -1
- package/dist/types/src/templates/commentary.d.ts +5 -2
- 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 +42 -26
- 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 +59 -76
- 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 +10 -6
- 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-OSL6RMPA.mjs +0 -14
- package/dist/lib/browser/DeploymentDialog-OSL6RMPA.mjs.map +0 -7
- package/dist/lib/browser/NotebookContainer-NBAXYESH.mjs.map +0 -7
- package/dist/lib/browser/ScriptContainer-WD33CJMI.mjs +0 -149
- package/dist/lib/browser/ScriptContainer-WD33CJMI.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-BTWHM6FH.mjs +0 -270
- package/dist/lib/browser/chunk-BTWHM6FH.mjs.map +0 -7
- package/dist/lib/browser/chunk-C53UJGSU.mjs +0 -557
- package/dist/lib/browser/chunk-C53UJGSU.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-TWX2NMZN.mjs +0 -137
- package/dist/lib/browser/chunk-TWX2NMZN.mjs.map +0 -7
- package/dist/lib/browser/chunk-UUR4JNNB.mjs +0 -113
- package/dist/lib/browser/chunk-UUR4JNNB.mjs.map +0 -7
- package/dist/lib/browser/chunk-UX4GHJ5E.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/chunk-XCN4D3Z5.mjs +0 -606
- package/dist/lib/browser/chunk-XCN4D3Z5.mjs.map +0 -7
- package/dist/lib/browser/compiler-76F3QAXC.mjs +0 -161
- package/dist/lib/browser/compiler-76F3QAXC.mjs.map +0 -7
- package/dist/lib/browser/operation-resolver-HUILPPKT.mjs +0 -82
- package/dist/lib/browser/operation-resolver-HUILPPKT.mjs.map +0 -7
- package/dist/lib/browser/react-surface-O6GKHB2J.mjs +0 -139
- package/dist/lib/browser/react-surface-O6GKHB2J.mjs.map +0 -7
- package/dist/lib/browser/settings-3ENI25PI.mjs +0 -35
- package/dist/lib/browser/settings-3ENI25PI.mjs.map +0 -7
- package/dist/lib/node-esm/DeploymentDialog-OGBJPVIX.mjs +0 -15
- package/dist/lib/node-esm/DeploymentDialog-OGBJPVIX.mjs.map +0 -7
- package/dist/lib/node-esm/NotebookContainer-IUAYVJSD.mjs.map +0 -7
- package/dist/lib/node-esm/ScriptContainer-K7JCEU5Z.mjs +0 -150
- package/dist/lib/node-esm/ScriptContainer-K7JCEU5Z.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-4QNZMXW6.mjs +0 -607
- package/dist/lib/node-esm/chunk-4QNZMXW6.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-BX5PP6AW.mjs +0 -558
- package/dist/lib/node-esm/chunk-BX5PP6AW.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-G3J76DWP.mjs +0 -114
- package/dist/lib/node-esm/chunk-G3J76DWP.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-VQPIA4VF.mjs +0 -138
- package/dist/lib/node-esm/chunk-VQPIA4VF.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/compiler-FNZH6TFN.mjs +0 -162
- package/dist/lib/node-esm/compiler-FNZH6TFN.mjs.map +0 -7
- package/dist/lib/node-esm/operation-resolver-JTCIY6HU.mjs +0 -83
- package/dist/lib/node-esm/operation-resolver-JTCIY6HU.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-RLANMVMB.mjs +0 -140
- package/dist/lib/node-esm/react-surface-RLANMVMB.mjs.map +0 -7
- package/dist/lib/node-esm/settings-7AYC5VXN.mjs +0 -36
- package/dist/lib/node-esm/settings-7AYC5VXN.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
package/README.md
CHANGED
|
@@ -21,19 +21,21 @@ runtime:
|
|
|
21
21
|
Test credentials:
|
|
22
22
|
|
|
23
23
|
```js
|
|
24
|
-
await dxos.client.halo.writeCredentials([
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
24
|
+
await dxos.client.halo.writeCredentials([
|
|
25
|
+
{
|
|
26
|
+
issuer: dxos.client.halo.identity.get().identityKey,
|
|
27
|
+
subject: {
|
|
28
|
+
id: dxos.client.halo.identity.get().identityKey,
|
|
29
|
+
assertion: {
|
|
30
|
+
'@type': 'dxos.halo.credentials.ServiceAccess',
|
|
31
|
+
'serverName': 'hub.dxos.network',
|
|
32
|
+
'serverKey': dxos.client.halo.identity.get().identityKey,
|
|
33
|
+
'identityKey': dxos.client.halo.identity.get().identityKey,
|
|
34
|
+
'capabilities': ['composer:beta'],
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
]);
|
|
37
39
|
```
|
|
38
40
|
|
|
39
41
|
Start composer:
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import "./chunk-J5LGTIGS.mjs";
|
|
2
|
+
|
|
3
|
+
// src/containers/DeploymentDialog/DeploymentDialog.tsx
|
|
4
|
+
import React, { useEffect, useMemo } from "react";
|
|
5
|
+
import { useOperationInvoker } from "@dxos/app-framework/ui";
|
|
6
|
+
import { LayoutOperation } from "@dxos/app-toolkit";
|
|
7
|
+
import { getSpace } from "@dxos/react-client/echo";
|
|
8
|
+
import { Button, Dialog, useTranslation } from "@dxos/react-ui";
|
|
9
|
+
import { useCreateAndDeployScriptTemplates } from "#hooks";
|
|
10
|
+
import { meta } from "#meta";
|
|
11
|
+
var DeploymentDialog = ({ accessToken, scriptTemplates }) => {
|
|
12
|
+
const { t } = useTranslation(meta.id);
|
|
13
|
+
const space = useMemo(() => getSpace(accessToken), [
|
|
14
|
+
accessToken
|
|
15
|
+
]);
|
|
16
|
+
const { handleCreateAndDeployScripts, status } = useCreateAndDeployScriptTemplates(space, scriptTemplates);
|
|
17
|
+
const { invokePromise } = useOperationInvoker();
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
if (status === "success") {
|
|
20
|
+
void invokePromise(LayoutOperation.AddToast, {
|
|
21
|
+
id: `${meta.id}.deployment-success`,
|
|
22
|
+
icon: "ph--check--regular",
|
|
23
|
+
duration: Infinity,
|
|
24
|
+
title: [
|
|
25
|
+
"script-deployment-toast.label",
|
|
26
|
+
{
|
|
27
|
+
ns: meta.id,
|
|
28
|
+
count: scriptTemplates.length
|
|
29
|
+
}
|
|
30
|
+
],
|
|
31
|
+
description: [
|
|
32
|
+
"script-deployment-toast.description",
|
|
33
|
+
{
|
|
34
|
+
ns: meta.id,
|
|
35
|
+
count: scriptTemplates.length
|
|
36
|
+
}
|
|
37
|
+
],
|
|
38
|
+
closeLabel: [
|
|
39
|
+
"script-deployment-toast-close.label",
|
|
40
|
+
{
|
|
41
|
+
ns: meta.id,
|
|
42
|
+
count: scriptTemplates.length
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
});
|
|
46
|
+
void invokePromise(LayoutOperation.UpdateDialog, {
|
|
47
|
+
state: false
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
if (status === "error") {
|
|
51
|
+
void invokePromise(LayoutOperation.UpdateDialog, {
|
|
52
|
+
state: false
|
|
53
|
+
});
|
|
54
|
+
void invokePromise(LayoutOperation.AddToast, {
|
|
55
|
+
id: `${meta.id}.deployment-error`,
|
|
56
|
+
icon: "ph--warning--regular",
|
|
57
|
+
duration: Infinity,
|
|
58
|
+
title: [
|
|
59
|
+
"script-deployment-error-toast.label",
|
|
60
|
+
{
|
|
61
|
+
ns: meta.id,
|
|
62
|
+
count: scriptTemplates.length
|
|
63
|
+
}
|
|
64
|
+
],
|
|
65
|
+
description: [
|
|
66
|
+
"script-deployment-error-toast.description",
|
|
67
|
+
{
|
|
68
|
+
ns: meta.id,
|
|
69
|
+
count: scriptTemplates.length
|
|
70
|
+
}
|
|
71
|
+
],
|
|
72
|
+
closeLabel: [
|
|
73
|
+
"script-deployment-error-toast-close.label",
|
|
74
|
+
{
|
|
75
|
+
ns: meta.id,
|
|
76
|
+
count: scriptTemplates.length
|
|
77
|
+
}
|
|
78
|
+
]
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
}, [
|
|
82
|
+
status,
|
|
83
|
+
invokePromise
|
|
84
|
+
]);
|
|
85
|
+
return /* @__PURE__ */ React.createElement(Dialog.Content, null, /* @__PURE__ */ React.createElement(Dialog.Header, null, /* @__PURE__ */ React.createElement(Dialog.Title, null, t("deployment-dialog.title")), /* @__PURE__ */ React.createElement(Dialog.Close, {
|
|
86
|
+
asChild: true
|
|
87
|
+
}, /* @__PURE__ */ React.createElement(Dialog.CloseIconButton, null))), /* @__PURE__ */ React.createElement(Dialog.Body, null, /* @__PURE__ */ React.createElement("p", null, t("deployment-dialog-scripts-found.message", {
|
|
88
|
+
count: scriptTemplates.length
|
|
89
|
+
})), /* @__PURE__ */ React.createElement("ul", {
|
|
90
|
+
className: "pt-2"
|
|
91
|
+
}, scriptTemplates.map((template) => {
|
|
92
|
+
return /* @__PURE__ */ React.createElement("li", {
|
|
93
|
+
key: template.id
|
|
94
|
+
}, template.name);
|
|
95
|
+
}))), /* @__PURE__ */ React.createElement(Dialog.ActionBar, null, /* @__PURE__ */ React.createElement(Dialog.Close, {
|
|
96
|
+
asChild: true
|
|
97
|
+
}, /* @__PURE__ */ React.createElement(Button, {
|
|
98
|
+
disabled: status === "pending"
|
|
99
|
+
}, t("deployment-dialog-skip-button.label"))), /* @__PURE__ */ React.createElement(Button, {
|
|
100
|
+
variant: "primary",
|
|
101
|
+
onClick: handleCreateAndDeployScripts,
|
|
102
|
+
disabled: status === "pending"
|
|
103
|
+
}, status === "pending" ? t("deployment-dialog-deploy-functions-pending-button.label", {
|
|
104
|
+
count: scriptTemplates.length
|
|
105
|
+
}) : t("deployment-dialog-deploy-functions-button.label", {
|
|
106
|
+
count: scriptTemplates.length
|
|
107
|
+
}))));
|
|
108
|
+
};
|
|
109
|
+
export {
|
|
110
|
+
DeploymentDialog as default
|
|
111
|
+
};
|
|
112
|
+
//# sourceMappingURL=DeploymentDialog-6DBF3V6C.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/containers/DeploymentDialog/DeploymentDialog.tsx"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { useEffect, useMemo } from 'react';\n\nimport { useOperationInvoker } from '@dxos/app-framework/ui';\nimport { LayoutOperation } from '@dxos/app-toolkit';\nimport { getSpace } from '@dxos/react-client/echo';\nimport { Button, Dialog, useTranslation } from '@dxos/react-ui';\nimport { type AccessToken } from '@dxos/types';\n\nimport { useCreateAndDeployScriptTemplates } from '#hooks';\nimport { meta } from '#meta';\n\nimport { type Template } from '../../templates';\n\n// TODO(ZaymonFC):\n// - Show activity and feedback to the user.\n// - Only take an array of templateIds and get the name from the data.\n// - Pending / onError states.\n\nexport type DeploymentDialogProps = {\n accessToken: AccessToken.AccessToken;\n scriptTemplates: Template[];\n};\n\nexport const DeploymentDialog = ({ accessToken, scriptTemplates }: DeploymentDialogProps) => {\n const { t } = useTranslation(meta.id);\n const space = useMemo(() => getSpace(accessToken), [accessToken]);\n\n // TODO(ZaymonFC): Thinking further. All of this should get moved to intents to run async in the background.\n // Deployment shouldn't be tied to the lifecycle of the dialogue component.\n const { handleCreateAndDeployScripts, status } = useCreateAndDeployScriptTemplates(space, scriptTemplates);\n const { invokePromise } = useOperationInvoker();\n\n useEffect(() => {\n if (status === 'success') {\n // TODO(ZaymonFC): We can probably re-use this toast for normal script deployment.\n void invokePromise(LayoutOperation.AddToast, {\n id: `${meta.id}.deployment-success`,\n icon: 'ph--check--regular',\n duration: Infinity,\n title: ['script-deployment-toast.label', { ns: meta.id, count: scriptTemplates.length }],\n description: ['script-deployment-toast.description', { ns: meta.id, count: scriptTemplates.length }],\n closeLabel: ['script-deployment-toast-close.label', { ns: meta.id, count: scriptTemplates.length }],\n });\n void invokePromise(LayoutOperation.UpdateDialog, { state: false });\n }\n if (status === 'error') {\n void invokePromise(LayoutOperation.UpdateDialog, { state: false });\n void invokePromise(LayoutOperation.AddToast, {\n id: `${meta.id}.deployment-error`,\n icon: 'ph--warning--regular',\n duration: Infinity,\n title: ['script-deployment-error-toast.label', { ns: meta.id, count: scriptTemplates.length }],\n description: ['script-deployment-error-toast.description', { ns: meta.id, count: scriptTemplates.length }],\n closeLabel: ['script-deployment-error-toast-close.label', { ns: meta.id, count: scriptTemplates.length }],\n });\n }\n }, [status, invokePromise]);\n\n return (\n <Dialog.Content>\n <Dialog.Header>\n <Dialog.Title>{t('deployment-dialog.title')}</Dialog.Title>\n <Dialog.Close asChild>\n <Dialog.CloseIconButton />\n </Dialog.Close>\n </Dialog.Header>\n <Dialog.Body>\n <p>\n {t('deployment-dialog-scripts-found.message', {\n count: scriptTemplates.length,\n })}\n </p>\n <ul className='pt-2'>\n {scriptTemplates.map((template) => {\n return <li key={template.id}>{template.name}</li>;\n })}\n </ul>\n </Dialog.Body>\n <Dialog.ActionBar>\n <Dialog.Close asChild>\n <Button disabled={status === 'pending'}>{t('deployment-dialog-skip-button.label')}</Button>\n </Dialog.Close>\n <Button variant='primary' onClick={handleCreateAndDeployScripts} disabled={status === 'pending'}>\n {status === 'pending'\n ? t('deployment-dialog-deploy-functions-pending-button.label', {\n count: scriptTemplates.length,\n })\n : t('deployment-dialog-deploy-functions-button.label', {\n count: scriptTemplates.length,\n })}\n </Button>\n </Dialog.ActionBar>\n </Dialog.Content>\n );\n};\n"],
|
|
5
|
+
"mappings": ";;;AAIA,OAAOA,SAASC,WAAWC,eAAe;AAE1C,SAASC,2BAA2B;AACpC,SAASC,uBAAuB;AAChC,SAASC,gBAAgB;AACzB,SAASC,QAAQC,QAAQC,sBAAsB;AAG/C,SAASC,yCAAyC;AAClD,SAASC,YAAY;AAcd,IAAMC,mBAAmB,CAAC,EAAEC,aAAaC,gBAAe,MAAyB;AACtF,QAAM,EAAEC,EAAC,IAAKN,eAAeE,KAAKK,EAAE;AACpC,QAAMC,QAAQd,QAAQ,MAAMG,SAASO,WAAAA,GAAc;IAACA;GAAY;AAIhE,QAAM,EAAEK,8BAA8BC,OAAM,IAAKT,kCAAkCO,OAAOH,eAAAA;AAC1F,QAAM,EAAEM,cAAa,IAAKhB,oBAAAA;AAE1BF,YAAU,MAAA;AACR,QAAIiB,WAAW,WAAW;AAExB,WAAKC,cAAcf,gBAAgBgB,UAAU;QAC3CL,IAAI,GAAGL,KAAKK,EAAE;QACdM,MAAM;QACNC,UAAUC;QACVC,OAAO;UAAC;UAAiC;YAAEC,IAAIf,KAAKK;YAAIW,OAAOb,gBAAgBc;UAAO;;QACtFC,aAAa;UAAC;UAAuC;YAAEH,IAAIf,KAAKK;YAAIW,OAAOb,gBAAgBc;UAAO;;QAClGE,YAAY;UAAC;UAAuC;YAAEJ,IAAIf,KAAKK;YAAIW,OAAOb,gBAAgBc;UAAO;;MACnG,CAAA;AACA,WAAKR,cAAcf,gBAAgB0B,cAAc;QAAEC,OAAO;MAAM,CAAA;IAClE;AACA,QAAIb,WAAW,SAAS;AACtB,WAAKC,cAAcf,gBAAgB0B,cAAc;QAAEC,OAAO;MAAM,CAAA;AAChE,WAAKZ,cAAcf,gBAAgBgB,UAAU;QAC3CL,IAAI,GAAGL,KAAKK,EAAE;QACdM,MAAM;QACNC,UAAUC;QACVC,OAAO;UAAC;UAAuC;YAAEC,IAAIf,KAAKK;YAAIW,OAAOb,gBAAgBc;UAAO;;QAC5FC,aAAa;UAAC;UAA6C;YAAEH,IAAIf,KAAKK;YAAIW,OAAOb,gBAAgBc;UAAO;;QACxGE,YAAY;UAAC;UAA6C;YAAEJ,IAAIf,KAAKK;YAAIW,OAAOb,gBAAgBc;UAAO;;MACzG,CAAA;IACF;EACF,GAAG;IAACT;IAAQC;GAAc;AAE1B,SACE,sBAAA,cAACZ,OAAOyB,SAAO,MACb,sBAAA,cAACzB,OAAO0B,QAAM,MACZ,sBAAA,cAAC1B,OAAO2B,OAAK,MAAEpB,EAAE,yBAAA,CAAA,GACjB,sBAAA,cAACP,OAAO4B,OAAK;IAACC,SAAAA;KACZ,sBAAA,cAAC7B,OAAO8B,iBAAe,IAAA,CAAA,CAAA,GAG3B,sBAAA,cAAC9B,OAAO+B,MAAI,MACV,sBAAA,cAACC,KAAAA,MACEzB,EAAE,2CAA2C;IAC5CY,OAAOb,gBAAgBc;EACzB,CAAA,CAAA,GAEF,sBAAA,cAACa,MAAAA;IAAGC,WAAU;KACX5B,gBAAgB6B,IAAI,CAACC,aAAAA;AACpB,WAAO,sBAAA,cAACC,MAAAA;MAAGC,KAAKF,SAAS5B;OAAK4B,SAASG,IAAI;EAC7C,CAAA,CAAA,CAAA,GAGJ,sBAAA,cAACvC,OAAOwC,WAAS,MACf,sBAAA,cAACxC,OAAO4B,OAAK;IAACC,SAAAA;KACZ,sBAAA,cAAC9B,QAAAA;IAAO0C,UAAU9B,WAAW;KAAYJ,EAAE,qCAAA,CAAA,CAAA,GAE7C,sBAAA,cAACR,QAAAA;IAAO2C,SAAQ;IAAUC,SAASjC;IAA8B+B,UAAU9B,WAAW;KACnFA,WAAW,YACRJ,EAAE,2DAA2D;IAC3DY,OAAOb,gBAAgBc;EACzB,CAAA,IACAb,EAAE,mDAAmD;IACnDY,OAAOb,gBAAgBc;EACzB,CAAA,CAAA,CAAA,CAAA;AAKd;",
|
|
6
|
+
"names": ["React", "useEffect", "useMemo", "useOperationInvoker", "LayoutOperation", "getSpace", "Button", "Dialog", "useTranslation", "useCreateAndDeployScriptTemplates", "meta", "DeploymentDialog", "accessToken", "scriptTemplates", "t", "id", "space", "handleCreateAndDeployScripts", "status", "invokePromise", "AddToast", "icon", "duration", "Infinity", "title", "ns", "count", "length", "description", "closeLabel", "UpdateDialog", "state", "Content", "Header", "Title", "Close", "asChild", "CloseIconButton", "Body", "p", "ul", "className", "map", "template", "li", "key", "name", "ActionBar", "disabled", "variant", "onClick"]
|
|
7
|
+
}
|
|
@@ -1,33 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
NotebookMenu,
|
|
3
|
-
NotebookStack
|
|
4
|
-
} from "./chunk-BTWHM6FH.mjs";
|
|
5
|
-
import "./chunk-I7CSE6T3.mjs";
|
|
6
|
-
import {
|
|
7
|
-
meta
|
|
8
|
-
} from "./chunk-WYR4QHPE.mjs";
|
|
9
1
|
import "./chunk-J5LGTIGS.mjs";
|
|
10
2
|
|
|
11
|
-
// src/
|
|
3
|
+
// src/containers/NotebookContainer/NotebookContainer.tsx
|
|
12
4
|
import { RegistryContext } from "@effect-atom/atom-react";
|
|
13
5
|
import * as Cause from "effect/Cause";
|
|
14
6
|
import * as Effect from "effect/Effect";
|
|
15
7
|
import * as Exit from "effect/Exit";
|
|
16
8
|
import React, { useCallback, useContext, useMemo, useState } from "react";
|
|
17
|
-
import {
|
|
18
|
-
import { Blueprint,
|
|
9
|
+
import { AgentPrompt } from "@dxos/assistant-toolkit";
|
|
10
|
+
import { Blueprint, Routine } from "@dxos/compute";
|
|
11
|
+
import { Operation } from "@dxos/compute";
|
|
19
12
|
import { Filter, Obj, Query, Ref } from "@dxos/echo";
|
|
20
13
|
import { QueryBuilder } from "@dxos/echo-query";
|
|
21
|
-
import { FunctionInvocationService, TracingService } from "@dxos/functions";
|
|
22
14
|
import { invariant as invariant2 } from "@dxos/invariant";
|
|
23
15
|
import { log as log2 } from "@dxos/log";
|
|
24
|
-
import { useComputeRuntimeCallback } from "@dxos/plugin-automation";
|
|
16
|
+
import { useComputeRuntimeCallback } from "@dxos/plugin-automation/hooks";
|
|
25
17
|
import { Graph } from "@dxos/plugin-explorer/types";
|
|
26
|
-
import { DropdownMenu, IconButton, Toolbar, useTranslation } from "@dxos/react-ui";
|
|
18
|
+
import { DropdownMenu, IconButton, Panel, Toolbar, useTranslation } from "@dxos/react-ui";
|
|
27
19
|
import { useAttention } from "@dxos/react-ui-attention";
|
|
28
|
-
import {
|
|
29
|
-
import { Text, View } from "@dxos/schema";
|
|
20
|
+
import { Text, ViewModel } from "@dxos/schema";
|
|
30
21
|
import { isNonNullable } from "@dxos/util";
|
|
22
|
+
import { NotebookMenu, NotebookStack } from "#components";
|
|
23
|
+
import { meta } from "#meta";
|
|
31
24
|
|
|
32
25
|
// src/notebook/compute-graph.ts
|
|
33
26
|
import { Atom } from "@effect-atom/atom-react";
|
|
@@ -124,6 +117,7 @@ var VirtualTypeScriptParser = class {
|
|
|
124
117
|
compilerOptions = {
|
|
125
118
|
target: ts.ScriptTarget.ES2020,
|
|
126
119
|
module: ts.ModuleKind.ESNext,
|
|
120
|
+
moduleResolution: ts.ModuleResolutionKind.Bundler,
|
|
127
121
|
strict: true,
|
|
128
122
|
esModuleInterop: true,
|
|
129
123
|
skipLibCheck: true,
|
|
@@ -135,15 +129,7 @@ var VirtualTypeScriptParser = class {
|
|
|
135
129
|
* Parse a single expression or statement.
|
|
136
130
|
*/
|
|
137
131
|
parseExpression(input) {
|
|
138
|
-
invariant(input.trim() !== "", "input must not be empty", {
|
|
139
|
-
F: __dxlog_file,
|
|
140
|
-
L: 57,
|
|
141
|
-
S: this,
|
|
142
|
-
A: [
|
|
143
|
-
"input.trim() !== ''",
|
|
144
|
-
"'input must not be empty'"
|
|
145
|
-
]
|
|
146
|
-
});
|
|
132
|
+
invariant(input.trim() !== "", "input must not be empty", { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 34, S: this, A: ["input.trim() !== ''", "'input must not be empty'"] });
|
|
147
133
|
const files = [
|
|
148
134
|
{
|
|
149
135
|
filename: "/temp.ts",
|
|
@@ -183,7 +169,9 @@ var VirtualTypeScriptParser = class {
|
|
|
183
169
|
const typeChecker = env.languageService.getProgram()?.getTypeChecker();
|
|
184
170
|
files.forEach((file) => {
|
|
185
171
|
const sourceFile = env.getSourceFile(file.filename);
|
|
186
|
-
if (!sourceFile || !typeChecker)
|
|
172
|
+
if (!sourceFile || !typeChecker) {
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
187
175
|
const fileResults = this.analyzeSourceFile(sourceFile, typeChecker);
|
|
188
176
|
results.push(...fileResults);
|
|
189
177
|
});
|
|
@@ -267,7 +255,9 @@ var VirtualTypeScriptParser = class {
|
|
|
267
255
|
* Extract parameter information from a signature.
|
|
268
256
|
*/
|
|
269
257
|
extractParameters(signature, typeChecker) {
|
|
270
|
-
if (!signature)
|
|
258
|
+
if (!signature) {
|
|
259
|
+
return [];
|
|
260
|
+
}
|
|
271
261
|
return signature.parameters.map((param) => ({
|
|
272
262
|
name: param.getName(),
|
|
273
263
|
type: typeChecker.typeToString(typeChecker.getTypeOfSymbolAtLocation(param, param.valueDeclaration))
|
|
@@ -455,24 +445,14 @@ var ComputeGraph = class {
|
|
|
455
445
|
if (!expr) {
|
|
456
446
|
log.error("no expression for cell", {
|
|
457
447
|
cellId
|
|
458
|
-
}, {
|
|
459
|
-
F: __dxlog_file2,
|
|
460
|
-
L: 105,
|
|
461
|
-
S: this,
|
|
462
|
-
C: (f, a) => f(...a)
|
|
463
|
-
});
|
|
448
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file2, L: 78, S: this });
|
|
464
449
|
continue;
|
|
465
450
|
}
|
|
466
451
|
const cellSource = this._notebook.cells.find((cell) => cell.id === cellId)?.source?.target?.content;
|
|
467
452
|
if (!cellSource) {
|
|
468
453
|
log.error("no source for cell", {
|
|
469
454
|
cellId
|
|
470
|
-
}, {
|
|
471
|
-
F: __dxlog_file2,
|
|
472
|
-
L: 111,
|
|
473
|
-
S: this,
|
|
474
|
-
C: (f, a) => f(...a)
|
|
475
|
-
});
|
|
455
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file2, L: 85, S: this });
|
|
476
456
|
continue;
|
|
477
457
|
}
|
|
478
458
|
try {
|
|
@@ -500,12 +480,7 @@ var ComputeGraph = class {
|
|
|
500
480
|
log.error("error evaluating cell", {
|
|
501
481
|
cellId,
|
|
502
482
|
error
|
|
503
|
-
}, {
|
|
504
|
-
F: __dxlog_file2,
|
|
505
|
-
L: 147,
|
|
506
|
-
S: this,
|
|
507
|
-
C: (f, a) => f(...a)
|
|
508
|
-
});
|
|
483
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file2, L: 120, S: this });
|
|
509
484
|
}
|
|
510
485
|
}
|
|
511
486
|
this._registry.set(this._valuesByCellIdAtom, valuesByCellId);
|
|
@@ -569,17 +544,17 @@ var ComputeGraph = class {
|
|
|
569
544
|
}
|
|
570
545
|
};
|
|
571
546
|
|
|
572
|
-
// src/
|
|
573
|
-
var __dxlog_file3 = "/__w/dxos/dxos/packages/plugins/plugin-script/src/
|
|
547
|
+
// src/containers/NotebookContainer/NotebookContainer.tsx
|
|
548
|
+
var __dxlog_file3 = "/__w/dxos/dxos/packages/plugins/plugin-script/src/containers/NotebookContainer/NotebookContainer.tsx";
|
|
574
549
|
var INCLUDE_BLUEPRINTS = [
|
|
575
|
-
"dxos.
|
|
576
|
-
"dxos.
|
|
550
|
+
"org.dxos.blueprint.assistant",
|
|
551
|
+
"org.dxos.blueprint.database",
|
|
552
|
+
"org.dxos.blueprint.markdown"
|
|
577
553
|
];
|
|
578
|
-
var NotebookContainer = ({ role, subject: notebook, env }) => {
|
|
554
|
+
var NotebookContainer = ({ role, subject: notebook, attendableId, env }) => {
|
|
579
555
|
const { t } = useTranslation(meta.id);
|
|
580
556
|
const registry = useContext(RegistryContext);
|
|
581
|
-
const db =
|
|
582
|
-
const attendableId = notebook ? Obj.getDXN(notebook).toString() : "";
|
|
557
|
+
const db = Obj.getDatabase(notebook);
|
|
583
558
|
const { hasAttention } = useAttention(attendableId);
|
|
584
559
|
const graph = useMemo(() => notebook && new ComputeGraph(notebook, registry), [
|
|
585
560
|
notebook,
|
|
@@ -587,15 +562,7 @@ var NotebookContainer = ({ role, subject: notebook, env }) => {
|
|
|
587
562
|
]);
|
|
588
563
|
const [queryValues, setQueryValues] = useState({});
|
|
589
564
|
const handleExecQueries = useCallback(async () => {
|
|
590
|
-
invariant2(db, void 0, {
|
|
591
|
-
F: __dxlog_file3,
|
|
592
|
-
L: 54,
|
|
593
|
-
S: void 0,
|
|
594
|
-
A: [
|
|
595
|
-
"db",
|
|
596
|
-
""
|
|
597
|
-
]
|
|
598
|
-
});
|
|
565
|
+
invariant2(db, void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file3, L: 43, S: void 0, A: ["db", ""] });
|
|
599
566
|
const builder = new QueryBuilder();
|
|
600
567
|
for (const cell of notebook?.cells ?? []) {
|
|
601
568
|
if (cell.type === "query") {
|
|
@@ -606,7 +573,7 @@ var NotebookContainer = ({ role, subject: notebook, env }) => {
|
|
|
606
573
|
const ast = Query.select(filter).ast;
|
|
607
574
|
const graph2 = cell.graph?.target;
|
|
608
575
|
if (!graph2) {
|
|
609
|
-
const { view } = await
|
|
576
|
+
const { view } = await ViewModel.makeFromDatabase({
|
|
610
577
|
db
|
|
611
578
|
});
|
|
612
579
|
const newGraph = Graph.make({
|
|
@@ -615,16 +582,16 @@ var NotebookContainer = ({ role, subject: notebook, env }) => {
|
|
|
615
582
|
},
|
|
616
583
|
view
|
|
617
584
|
});
|
|
618
|
-
Obj.
|
|
619
|
-
const c =
|
|
585
|
+
Obj.update(notebook, (obj) => {
|
|
586
|
+
const c = obj.cells.find((c2) => c2.id === cell.id);
|
|
620
587
|
if (c) {
|
|
621
588
|
c.graph = Ref.make(newGraph);
|
|
622
589
|
c.name = name;
|
|
623
590
|
}
|
|
624
591
|
});
|
|
625
592
|
} else {
|
|
626
|
-
Obj.
|
|
627
|
-
|
|
593
|
+
Obj.update(graph2, (graph3) => {
|
|
594
|
+
graph3.query.ast = ast;
|
|
628
595
|
});
|
|
629
596
|
}
|
|
630
597
|
}
|
|
@@ -648,15 +615,7 @@ var NotebookContainer = ({ role, subject: notebook, env }) => {
|
|
|
648
615
|
]);
|
|
649
616
|
const [promptResults, setPromptResults] = useState({});
|
|
650
617
|
const handleExecPrompts = useComputeRuntimeCallback(db?.spaceId, Effect.fnUntraced(function* () {
|
|
651
|
-
invariant2(graph, void 0, {
|
|
652
|
-
F: __dxlog_file3,
|
|
653
|
-
L: 98,
|
|
654
|
-
S: this,
|
|
655
|
-
A: [
|
|
656
|
-
"graph",
|
|
657
|
-
""
|
|
658
|
-
]
|
|
659
|
-
});
|
|
618
|
+
invariant2(graph, void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file3, L: 96, S: this, A: ["graph", ""] });
|
|
660
619
|
const prompts = notebook?.cells.filter((cell) => cell.type === "prompt").map((cell) => cell.prompt).filter(isNonNullable) ?? [];
|
|
661
620
|
for (const prompt of prompts) {
|
|
662
621
|
yield* runPrompt({
|
|
@@ -686,22 +645,14 @@ var NotebookContainer = ({ role, subject: notebook, env }) => {
|
|
|
686
645
|
handleExecPrompts
|
|
687
646
|
]);
|
|
688
647
|
const handleRearrange = useCallback((source, target) => {
|
|
689
|
-
invariant2(notebook, void 0, {
|
|
690
|
-
F: __dxlog_file3,
|
|
691
|
-
L: 131,
|
|
692
|
-
S: void 0,
|
|
693
|
-
A: [
|
|
694
|
-
"notebook",
|
|
695
|
-
""
|
|
696
|
-
]
|
|
697
|
-
});
|
|
648
|
+
invariant2(notebook, void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file3, L: 128, S: void 0, A: ["notebook", ""] });
|
|
698
649
|
const from = notebook.cells.findIndex((cell) => cell.id === source.id);
|
|
699
650
|
const to = notebook.cells.findIndex((cell) => cell.id === target.id);
|
|
700
651
|
if (from != null && to != null) {
|
|
701
|
-
Obj.
|
|
702
|
-
const cell =
|
|
652
|
+
Obj.update(notebook, (notebook2) => {
|
|
653
|
+
const cell = notebook2.cells.splice(from, 1)[0];
|
|
703
654
|
if (cell) {
|
|
704
|
-
|
|
655
|
+
notebook2.cells.splice(to, 0, cell);
|
|
705
656
|
}
|
|
706
657
|
});
|
|
707
658
|
}
|
|
@@ -709,15 +660,7 @@ var NotebookContainer = ({ role, subject: notebook, env }) => {
|
|
|
709
660
|
notebook
|
|
710
661
|
]);
|
|
711
662
|
const handleCellInsert = useCallback(async (type, after) => {
|
|
712
|
-
invariant2(notebook, void 0, {
|
|
713
|
-
F: __dxlog_file3,
|
|
714
|
-
L: 148,
|
|
715
|
-
S: void 0,
|
|
716
|
-
A: [
|
|
717
|
-
"notebook",
|
|
718
|
-
""
|
|
719
|
-
]
|
|
720
|
-
});
|
|
663
|
+
invariant2(notebook, void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file3, L: 143, S: void 0, A: ["notebook", ""] });
|
|
721
664
|
const cell = {
|
|
722
665
|
id: crypto.randomUUID(),
|
|
723
666
|
type
|
|
@@ -733,7 +676,7 @@ var NotebookContainer = ({ role, subject: notebook, env }) => {
|
|
|
733
676
|
if (db) {
|
|
734
677
|
const objects = await db.query(Query.select(Filter.type(Blueprint.Blueprint))).run();
|
|
735
678
|
const blueprints = objects.filter((blueprint) => INCLUDE_BLUEPRINTS.includes(blueprint.key)).map((blueprint) => Ref.make(blueprint));
|
|
736
|
-
cell.prompt = Ref.make(
|
|
679
|
+
cell.prompt = Ref.make(Routine.make({
|
|
737
680
|
instructions: "",
|
|
738
681
|
blueprints
|
|
739
682
|
}));
|
|
@@ -742,57 +685,48 @@ var NotebookContainer = ({ role, subject: notebook, env }) => {
|
|
|
742
685
|
}
|
|
743
686
|
}
|
|
744
687
|
const idx = after ? notebook.cells.findIndex((cell2) => cell2.id === after) : notebook.cells.length;
|
|
745
|
-
Obj.
|
|
746
|
-
|
|
688
|
+
Obj.update(notebook, (notebook2) => {
|
|
689
|
+
notebook2.cells.splice(idx, 0, cell);
|
|
747
690
|
});
|
|
748
691
|
}, [
|
|
749
692
|
db,
|
|
750
693
|
notebook
|
|
751
694
|
]);
|
|
752
695
|
const handleCellDelete = useCallback((id) => {
|
|
753
|
-
invariant2(notebook, void 0, {
|
|
754
|
-
F: __dxlog_file3,
|
|
755
|
-
L: 180,
|
|
756
|
-
S: void 0,
|
|
757
|
-
A: [
|
|
758
|
-
"notebook",
|
|
759
|
-
""
|
|
760
|
-
]
|
|
761
|
-
});
|
|
696
|
+
invariant2(notebook, void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file3, L: 178, S: void 0, A: ["notebook", ""] });
|
|
762
697
|
const idx = notebook.cells.findIndex((cell) => cell.id === id);
|
|
763
698
|
if (idx !== -1) {
|
|
764
|
-
Obj.
|
|
765
|
-
|
|
699
|
+
Obj.update(notebook, (notebook2) => {
|
|
700
|
+
notebook2.cells.splice(idx, 1);
|
|
766
701
|
});
|
|
767
702
|
}
|
|
768
703
|
}, [
|
|
769
704
|
notebook
|
|
770
705
|
]);
|
|
771
|
-
return /* @__PURE__ */ React.createElement(
|
|
706
|
+
return /* @__PURE__ */ React.createElement(Panel.Root, {
|
|
772
707
|
role,
|
|
773
|
-
|
|
708
|
+
className: "dx-document"
|
|
709
|
+
}, /* @__PURE__ */ React.createElement(Panel.Toolbar, {
|
|
710
|
+
asChild: true
|
|
774
711
|
}, /* @__PURE__ */ React.createElement(Toolbar.Root, {
|
|
775
|
-
disabled: !hasAttention
|
|
776
|
-
textBlockWidth: true
|
|
712
|
+
disabled: !hasAttention
|
|
777
713
|
}, /* @__PURE__ */ React.createElement(DropdownMenu.Root, null, /* @__PURE__ */ React.createElement(DropdownMenu.Trigger, {
|
|
778
714
|
asChild: true
|
|
779
715
|
}, /* @__PURE__ */ React.createElement(IconButton, {
|
|
780
716
|
icon: "ph--plus--regular",
|
|
781
717
|
iconOnly: true,
|
|
782
|
-
label: t("notebook
|
|
718
|
+
label: t("notebook-cell-insert.label")
|
|
783
719
|
})), /* @__PURE__ */ React.createElement(NotebookMenu, {
|
|
784
720
|
onCellInsert: handleCellInsert
|
|
785
721
|
})), /* @__PURE__ */ React.createElement(Toolbar.IconButton, {
|
|
786
722
|
icon: "ph--play--fill",
|
|
787
723
|
iconOnly: true,
|
|
788
|
-
label: t("compute
|
|
789
|
-
classNames: "text-
|
|
724
|
+
label: t("compute.label"),
|
|
725
|
+
classNames: "text-success-text",
|
|
790
726
|
onClick: handleCompute
|
|
791
|
-
})), /* @__PURE__ */ React.createElement(
|
|
792
|
-
|
|
793
|
-
className: "flex bs-full overflow-hidden -mis-[1px] -mie-[1px]"
|
|
727
|
+
}))), /* @__PURE__ */ React.createElement(Panel.Content, {
|
|
728
|
+
asChild: true
|
|
794
729
|
}, /* @__PURE__ */ React.createElement(NotebookStack, {
|
|
795
|
-
classNames: "container-max-width border-l border-r border-subduedSeparator",
|
|
796
730
|
db,
|
|
797
731
|
notebook,
|
|
798
732
|
graph,
|
|
@@ -803,43 +737,24 @@ var NotebookContainer = ({ role, subject: notebook, env }) => {
|
|
|
803
737
|
onCellDelete: handleCellDelete
|
|
804
738
|
})));
|
|
805
739
|
};
|
|
806
|
-
var NotebookContainer_default = NotebookContainer;
|
|
807
740
|
var runPrompt = Effect.fn(function* ({ prompt, input, onResult }) {
|
|
808
741
|
const inputData = {
|
|
809
742
|
prompt,
|
|
810
743
|
input
|
|
811
744
|
};
|
|
812
|
-
const
|
|
813
|
-
const trace = yield* tracer.traceInvocationStart({
|
|
814
|
-
target: void 0,
|
|
815
|
-
payload: {
|
|
816
|
-
data: {}
|
|
817
|
-
}
|
|
818
|
-
});
|
|
819
|
-
const result = yield* FunctionInvocationService.invokeFunction(Agent.prompt, inputData).pipe(Effect.provide(trace.invocationTraceQueue ? TracingService.layerInvocation(trace) : TracingService.layerNoop), Effect.exit);
|
|
745
|
+
const result = yield* Operation.invoke(AgentPrompt, inputData).pipe(Effect.orDie, Effect.exit);
|
|
820
746
|
Exit.match(result, {
|
|
821
747
|
onFailure: (cause) => {
|
|
822
748
|
const error = Cause.prettyErrors(cause)[0];
|
|
823
|
-
log2.error(error.message, error.cause ?? error.stack, {
|
|
824
|
-
F: __dxlog_file3,
|
|
825
|
-
L: 258,
|
|
826
|
-
S: this,
|
|
827
|
-
C: (f, a) => f(...a)
|
|
828
|
-
});
|
|
749
|
+
log2.error(error.message, error.cause ?? error.stack, { "~LogMeta": "~LogMeta", F: __dxlog_file3, L: 233, S: this });
|
|
829
750
|
onResult(error.message);
|
|
830
751
|
},
|
|
831
752
|
onSuccess: (result2) => {
|
|
832
753
|
onResult(result2.note);
|
|
833
754
|
}
|
|
834
755
|
});
|
|
835
|
-
yield* tracer.traceInvocationEnd({
|
|
836
|
-
trace,
|
|
837
|
-
// TODO(dmaretskyi): Might miss errors.
|
|
838
|
-
exception: Exit.isFailure(result) ? Cause.prettyErrors(result.cause)[0] : void 0
|
|
839
|
-
});
|
|
840
756
|
});
|
|
841
757
|
export {
|
|
842
|
-
NotebookContainer
|
|
843
|
-
NotebookContainer_default as default
|
|
758
|
+
NotebookContainer as default
|
|
844
759
|
};
|
|
845
|
-
//# sourceMappingURL=NotebookContainer-
|
|
760
|
+
//# sourceMappingURL=NotebookContainer-RO4NJRYH.mjs.map
|