@dxos/plugin-script 0.8.4-main.bc674ce → 0.8.4-main.bcb3aa67d6
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-WUND47NK.mjs +115 -0
- package/dist/lib/browser/DeploymentDialog-WUND47NK.mjs.map +7 -0
- package/dist/lib/browser/{NotebookContainer-NBAXYESH.mjs → NotebookContainer-TGHMYWWK.mjs} +47 -54
- package/dist/lib/browser/NotebookContainer-TGHMYWWK.mjs.map +7 -0
- package/dist/lib/browser/ScriptContainer-BOCXMLNN.mjs +82 -0
- package/dist/lib/browser/ScriptContainer-BOCXMLNN.mjs.map +7 -0
- package/dist/lib/browser/ScriptObjectSettings-QKJFTSLS.mjs +295 -0
- package/dist/lib/browser/ScriptObjectSettings-QKJFTSLS.mjs.map +7 -0
- package/dist/lib/browser/ScriptPluginSettings-AMWZF7LZ.mjs +47 -0
- package/dist/lib/browser/ScriptPluginSettings-AMWZF7LZ.mjs.map +7 -0
- package/dist/lib/browser/ScriptProperties-VBOIIRJJ.mjs +26 -0
- package/dist/lib/browser/ScriptProperties-VBOIIRJJ.mjs.map +7 -0
- package/dist/lib/browser/TestContainer-5VNOC6I3.mjs +50 -0
- package/dist/lib/browser/TestContainer-5VNOC6I3.mjs.map +7 -0
- package/dist/lib/browser/access-token-created-XR7LB2XV.mjs +37 -0
- package/dist/lib/browser/access-token-created-XR7LB2XV.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-AE5EX2VP.mjs +78 -0
- package/dist/lib/browser/chunk-AE5EX2VP.mjs.map +7 -0
- package/dist/lib/browser/{chunk-UX4GHJ5E.mjs → chunk-DL37UOJE.mjs} +29 -29
- package/dist/lib/browser/chunk-DL37UOJE.mjs.map +7 -0
- package/dist/lib/browser/chunk-TXVJW26E.mjs +50 -0
- package/dist/lib/browser/chunk-TXVJW26E.mjs.map +7 -0
- package/dist/lib/browser/chunk-ZLF66W2O.mjs +337 -0
- package/dist/lib/browser/chunk-ZLF66W2O.mjs.map +7 -0
- package/dist/lib/browser/create-V3MRNIUS.mjs +45 -0
- package/dist/lib/browser/create-V3MRNIUS.mjs.map +7 -0
- package/dist/lib/browser/create-script-IEY3HJ33.mjs +46 -0
- package/dist/lib/browser/create-script-IEY3HJ33.mjs.map +7 -0
- package/dist/lib/browser/delete-7QKDZ2QS.mjs +21 -0
- package/dist/lib/browser/delete-7QKDZ2QS.mjs.map +7 -0
- package/dist/lib/browser/deploy-SM2V6SNL.mjs +65 -0
- package/dist/lib/browser/deploy-SM2V6SNL.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +1153 -176
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/inspect-invocations-L4GAXXT3.mjs +55 -0
- package/dist/lib/browser/inspect-invocations-L4GAXXT3.mjs.map +7 -0
- package/dist/lib/browser/install-function-YDAA5EB6.mjs +54 -0
- package/dist/lib/browser/install-function-YDAA5EB6.mjs.map +7 -0
- package/dist/lib/browser/invoke-OKJMYOZB.mjs +36 -0
- package/dist/lib/browser/invoke-OKJMYOZB.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-L3SIQHB5.mjs +33 -0
- package/dist/lib/browser/query-deployed-functions-L3SIQHB5.mjs.map +7 -0
- package/dist/lib/browser/read-YL7TNJC7.mjs +26 -0
- package/dist/lib/browser/read-YL7TNJC7.mjs.map +7 -0
- package/dist/lib/browser/templates/index.mjs +1 -1
- package/dist/lib/browser/types/index.mjs +3 -7
- package/dist/lib/browser/update-4RC6QH62.mjs +63 -0
- package/dist/lib/browser/update-4RC6QH62.mjs.map +7 -0
- package/dist/lib/node-esm/DeploymentDialog-XMR2CKP6.mjs +116 -0
- package/dist/lib/node-esm/DeploymentDialog-XMR2CKP6.mjs.map +7 -0
- package/dist/lib/node-esm/{NotebookContainer-IUAYVJSD.mjs → NotebookContainer-YUVZF6IS.mjs} +47 -54
- package/dist/lib/node-esm/NotebookContainer-YUVZF6IS.mjs.map +7 -0
- package/dist/lib/node-esm/ScriptContainer-G4D2YSFE.mjs +83 -0
- package/dist/lib/node-esm/ScriptContainer-G4D2YSFE.mjs.map +7 -0
- package/dist/lib/node-esm/ScriptObjectSettings-XIOE66BL.mjs +296 -0
- package/dist/lib/node-esm/ScriptObjectSettings-XIOE66BL.mjs.map +7 -0
- package/dist/lib/node-esm/ScriptPluginSettings-SDWEDLUU.mjs +48 -0
- package/dist/lib/node-esm/ScriptPluginSettings-SDWEDLUU.mjs.map +7 -0
- package/dist/lib/node-esm/ScriptProperties-5H2Z4XRF.mjs +27 -0
- package/dist/lib/node-esm/ScriptProperties-5H2Z4XRF.mjs.map +7 -0
- package/dist/lib/node-esm/TestContainer-SEFC4F2O.mjs +51 -0
- package/dist/lib/node-esm/TestContainer-SEFC4F2O.mjs.map +7 -0
- package/dist/lib/node-esm/access-token-created-AZEUHFPA.mjs +38 -0
- package/dist/lib/node-esm/access-token-created-AZEUHFPA.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-ELIPYPNQ.mjs +79 -0
- package/dist/lib/node-esm/chunk-ELIPYPNQ.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-QZMVI6AH.mjs +339 -0
- package/dist/lib/node-esm/chunk-QZMVI6AH.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-U2LUPXPK.mjs +51 -0
- package/dist/lib/node-esm/chunk-U2LUPXPK.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-4F5FJZ36.mjs → chunk-ZLTGO4XB.mjs} +29 -29
- package/dist/lib/node-esm/chunk-ZLTGO4XB.mjs.map +7 -0
- package/dist/lib/node-esm/create-XQAER3WF.mjs +46 -0
- package/dist/lib/node-esm/create-XQAER3WF.mjs.map +7 -0
- package/dist/lib/node-esm/create-script-2CGVQ3AU.mjs +47 -0
- package/dist/lib/node-esm/create-script-2CGVQ3AU.mjs.map +7 -0
- package/dist/lib/node-esm/delete-JA2S3K6Z.mjs +22 -0
- package/dist/lib/node-esm/delete-JA2S3K6Z.mjs.map +7 -0
- package/dist/lib/node-esm/deploy-FILYYRWE.mjs +66 -0
- package/dist/lib/node-esm/deploy-FILYYRWE.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +1153 -176
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/inspect-invocations-PLSHQCFM.mjs +56 -0
- package/dist/lib/node-esm/inspect-invocations-PLSHQCFM.mjs.map +7 -0
- package/dist/lib/node-esm/install-function-4TVXEWYF.mjs +55 -0
- package/dist/lib/node-esm/install-function-4TVXEWYF.mjs.map +7 -0
- package/dist/lib/node-esm/invoke-J4Z7CS44.mjs +37 -0
- package/dist/lib/node-esm/invoke-J4Z7CS44.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-JBYIJGLW.mjs +34 -0
- package/dist/lib/node-esm/query-deployed-functions-JBYIJGLW.mjs.map +7 -0
- package/dist/lib/node-esm/read-HDE5XOGZ.mjs +27 -0
- package/dist/lib/node-esm/read-HDE5XOGZ.mjs.map +7 -0
- package/dist/lib/node-esm/templates/index.mjs +1 -1
- package/dist/lib/node-esm/types/index.mjs +3 -7
- package/dist/lib/node-esm/update-6O53SY6U.mjs +64 -0
- package/dist/lib/node-esm/update-6O53SY6U.mjs.map +7 -0
- package/dist/types/src/ScriptPlugin.d.ts.map +1 -1
- 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 +142 -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 +30 -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 +12 -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 +10 -0
- package/dist/types/src/capabilities/settings.d.ts.map +1 -0
- 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 +8 -2
- package/dist/types/src/components/NotebookStack/NotebookStack.d.ts.map +1 -1
- package/dist/types/src/components/NotebookStack/NotebookStack.stories.d.ts +240 -228
- package/dist/types/src/components/NotebookStack/NotebookStack.stories.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 +262 -0
- package/dist/types/src/components/ScriptPluginSettings/ScriptPluginSettings.stories.d.ts.map +1 -0
- package/dist/types/src/components/ScriptPluginSettings/index.d.ts +3 -0
- package/dist/types/src/components/ScriptPluginSettings/index.d.ts.map +1 -0
- package/dist/types/src/components/ScriptToolbar/ScriptToolbar.d.ts +10 -4
- package/dist/types/src/components/ScriptToolbar/ScriptToolbar.d.ts.map +1 -1
- package/dist/types/src/components/ScriptToolbar/ScriptToolbar.stories.d.ts +240 -228
- package/dist/types/src/components/ScriptToolbar/ScriptToolbar.stories.d.ts.map +1 -1
- package/dist/types/src/components/TestPanel/TestPanel.d.ts +8 -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 +7 -1
- package/dist/types/src/components/TypescriptEditor/TypescriptEditor.d.ts.map +1 -1
- package/dist/types/src/components/TypescriptEditor/TypescriptEditor.stories.d.ts +7 -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 +261 -0
- package/dist/types/src/{components → containers}/DeploymentDialog/DeploymentDialog.stories.d.ts.map +1 -1
- package/dist/types/src/containers/DeploymentDialog/index.d.ts +3 -0
- package/dist/types/src/containers/DeploymentDialog/index.d.ts.map +1 -0
- package/dist/types/src/containers/NotebookContainer/NotebookContainer.d.ts +7 -0
- package/dist/types/src/containers/NotebookContainer/NotebookContainer.d.ts.map +1 -0
- package/dist/types/src/containers/NotebookContainer/NotebookContainer.stories.d.ts.map +1 -0
- package/dist/types/src/containers/NotebookContainer/index.d.ts +3 -0
- package/dist/types/src/containers/NotebookContainer/index.d.ts.map +1 -0
- package/dist/types/src/containers/ScriptContainer/ScriptContainer.d.ts +10 -0
- package/dist/types/src/containers/ScriptContainer/ScriptContainer.d.ts.map +1 -0
- package/dist/types/src/containers/ScriptContainer/index.d.ts +3 -0
- package/dist/types/src/containers/ScriptContainer/index.d.ts.map +1 -0
- package/dist/types/src/{components/Settings → containers/ScriptObjectSettings}/ScriptObjectSettings.d.ts +0 -1
- package/dist/types/src/containers/ScriptObjectSettings/ScriptObjectSettings.d.ts.map +1 -0
- package/dist/types/src/containers/ScriptObjectSettings/index.d.ts +3 -0
- package/dist/types/src/containers/ScriptObjectSettings/index.d.ts.map +1 -0
- package/dist/types/src/containers/ScriptProperties/ScriptProperties.d.ts +7 -0
- package/dist/types/src/containers/ScriptProperties/ScriptProperties.d.ts.map +1 -0
- package/dist/types/src/containers/ScriptProperties/index.d.ts +3 -0
- package/dist/types/src/containers/ScriptProperties/index.d.ts.map +1 -0
- package/dist/types/src/containers/TestContainer/TestContainer.d.ts.map +1 -0
- package/dist/types/src/containers/TestContainer/index.d.ts +3 -0
- package/dist/types/src/containers/TestContainer/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +8 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/hooks/deploy.d.ts +19 -5
- package/dist/types/src/hooks/deploy.d.ts.map +1 -1
- package/dist/types/src/hooks/format.d.ts +1 -0
- package/dist/types/src/hooks/format.d.ts.map +1 -1
- package/dist/types/src/hooks/template.d.ts +1 -0
- package/dist/types/src/hooks/template.d.ts.map +1 -1
- package/dist/types/src/hooks/useToolbarState.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -0
- 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/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/chess-bot.d.ts +4 -2
- 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/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/index.d.ts +18 -18
- 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/data.d.ts +1 -1
- package/dist/types/src/testing/data.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +91 -86
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Notebook.d.ts +29 -13
- package/dist/types/src/types/Notebook.d.ts.map +1 -1
- package/dist/types/src/types/Settings.d.ts +6 -0
- package/dist/types/src/types/Settings.d.ts.map +1 -0
- package/dist/types/src/types/capabilities.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 +3 -2
- package/dist/types/src/util/deploy.d.ts.map +1 -1
- package/dist/types/src/util/functions.d.ts +3 -2
- package/dist/types/src/util/functions.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +107 -85
- package/src/ScriptPlugin.tsx +49 -32
- package/src/blueprints/functions/create.ts +48 -0
- package/src/blueprints/functions/definitions.ts +324 -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 +55 -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 +30 -0
- package/src/blueprints/functions/update.ts +69 -0
- package/src/blueprints/index.ts +1 -1
- package/src/blueprints/script-blueprint.ts +40 -8
- package/src/capabilities/app-graph-builder.ts +47 -0
- package/src/capabilities/{artifact-definition/artifact-definition.ts → artifact-definition.ts} +1 -1
- package/src/capabilities/blueprint-definition.ts +17 -0
- package/src/capabilities/{compiler/compiler.ts → compiler.ts} +2 -2
- package/src/capabilities/index.ts +12 -6
- package/src/capabilities/operation-handler.ts +20 -0
- package/src/capabilities/react-surface.tsx +152 -0
- package/src/capabilities/{settings/settings.ts → settings.ts} +7 -6
- 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 +15 -17
- package/src/components/NotebookStack/NotebookMenu.tsx +7 -7
- package/src/components/NotebookStack/NotebookStack.stories.tsx +6 -8
- package/src/components/NotebookStack/NotebookStack.tsx +26 -15
- package/src/components/QueryEditor/QueryEditor.stories.tsx +17 -21
- package/src/components/ScriptPluginSettings/ScriptPluginSettings.stories.tsx +32 -0
- package/src/components/ScriptPluginSettings/ScriptPluginSettings.tsx +64 -0
- package/src/components/ScriptPluginSettings/index.ts +7 -0
- package/src/components/ScriptToolbar/ScriptToolbar.stories.tsx +6 -7
- package/src/components/ScriptToolbar/ScriptToolbar.tsx +23 -25
- package/src/components/TestPanel/TestPanel.tsx +107 -187
- package/src/components/TestPanel/index.ts +0 -1
- package/src/components/TypescriptEditor/TypescriptEditor.stories.tsx +16 -14
- package/src/components/TypescriptEditor/TypescriptEditor.tsx +24 -17
- package/src/components/index.ts +7 -8
- package/src/constants.ts +7 -0
- package/src/{components → containers}/DeploymentDialog/DeploymentDialog.stories.tsx +7 -6
- package/src/{components → containers}/DeploymentDialog/DeploymentDialog.tsx +32 -37
- package/src/containers/DeploymentDialog/index.ts +7 -0
- package/src/{components → containers/NotebookContainer}/NotebookContainer.stories.tsx +16 -19
- package/src/{components → containers/NotebookContainer}/NotebookContainer.tsx +54 -57
- package/src/containers/NotebookContainer/index.ts +7 -0
- package/src/{components → containers/ScriptContainer}/ScriptContainer.tsx +27 -26
- package/src/containers/ScriptContainer/index.ts +7 -0
- package/src/{components/Settings → containers/ScriptObjectSettings}/ScriptObjectSettings.tsx +51 -65
- package/src/containers/ScriptObjectSettings/index.ts +7 -0
- package/src/containers/ScriptProperties/ScriptProperties.tsx +33 -0
- package/src/containers/ScriptProperties/index.ts +7 -0
- package/src/containers/TestContainer/TestContainer.tsx +45 -0
- package/src/containers/TestContainer/index.ts +7 -0
- package/src/containers/index.ts +12 -0
- package/src/e2e/ai.test.ts +6 -5
- package/src/e2e/deploy.test.ts +4 -3
- package/src/hooks/deploy.ts +14 -13
- package/src/hooks/format.ts +5 -4
- package/src/hooks/template.ts +7 -7
- package/src/hooks/useCompiler.ts +3 -3
- package/src/hooks/useCreateAndDeployScriptTemplates.ts +3 -3
- package/src/hooks/useToolbarState.ts +7 -6
- package/src/index.ts +1 -0
- 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/operations/access-token-created.ts +36 -0
- package/src/operations/create-script.ts +47 -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 +173 -161
- 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/data.ts +1 -1
- package/src/translations.ts +92 -86
- package/src/types/Notebook.ts +9 -5
- package/src/types/Settings.ts +17 -0
- package/src/types/capabilities.ts +4 -4
- 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.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/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/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/dist/types/src/{components/TestPanel → containers/TestContainer}/TestContainer.d.ts +0 -0
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { next as A, type Doc } from '@automerge/automerge';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
7
|
+
|
|
8
|
+
import { Database, Obj } from '@dxos/echo';
|
|
9
|
+
import { DocAccessor, createDocAccessor } from '@dxos/echo-db';
|
|
10
|
+
import { type Script } from '@dxos/functions';
|
|
11
|
+
import { Operation } from '@dxos/operation';
|
|
12
|
+
|
|
13
|
+
import { Update } from './definitions';
|
|
14
|
+
|
|
15
|
+
export default Update.pipe(
|
|
16
|
+
Operation.withHandler(
|
|
17
|
+
Effect.fn(function* ({ function: fn, name, description, edits }) {
|
|
18
|
+
const loaded = yield* Database.load(fn);
|
|
19
|
+
if (!loaded.source) {
|
|
20
|
+
return yield* Effect.fail(new Error('Function has no source script.'));
|
|
21
|
+
}
|
|
22
|
+
const script = (yield* Database.load(loaded.source)) as Script.Script;
|
|
23
|
+
|
|
24
|
+
if (name !== undefined || description !== undefined) {
|
|
25
|
+
Obj.change(script, (draft) => {
|
|
26
|
+
if (name !== undefined) {
|
|
27
|
+
draft.name = name;
|
|
28
|
+
}
|
|
29
|
+
if (description !== undefined) {
|
|
30
|
+
draft.description = description;
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
if (edits && edits.length > 0) {
|
|
36
|
+
const text = yield* Database.load(script.source);
|
|
37
|
+
const accessor = createDocAccessor(text, ['content']);
|
|
38
|
+
|
|
39
|
+
for (const edit of edits) {
|
|
40
|
+
accessor.handle.change((doc: Doc<typeof text>) => {
|
|
41
|
+
const source = DocAccessor.getValue<string>(accessor);
|
|
42
|
+
if (edit.replaceAll) {
|
|
43
|
+
let idx = source.indexOf(edit.oldString);
|
|
44
|
+
while (idx !== -1) {
|
|
45
|
+
A.splice(doc, accessor.path as A.Prop[], idx, edit.oldString.length, edit.newString);
|
|
46
|
+
const updated = DocAccessor.getValue<string>(accessor);
|
|
47
|
+
idx = updated.indexOf(edit.oldString, idx + edit.newString.length);
|
|
48
|
+
}
|
|
49
|
+
} else {
|
|
50
|
+
const idx = source.indexOf(edit.oldString);
|
|
51
|
+
if (idx === -1) {
|
|
52
|
+
throw new Error(`Edit not found: ${JSON.stringify(edit.oldString)}`);
|
|
53
|
+
}
|
|
54
|
+
A.splice(doc, accessor.path as A.Prop[], idx, edit.oldString.length, edit.newString);
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
Obj.change(script, (draft) => {
|
|
60
|
+
draft.changed = true;
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return {
|
|
65
|
+
function: Obj.getDXN(loaded).toString(),
|
|
66
|
+
};
|
|
67
|
+
}),
|
|
68
|
+
),
|
|
69
|
+
);
|
package/src/blueprints/index.ts
CHANGED
|
@@ -2,23 +2,55 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import { type AppCapabilities } from '@dxos/app-toolkit';
|
|
5
6
|
import { Blueprint, Template } from '@dxos/blueprints';
|
|
6
|
-
import { type FunctionDefinition } from '@dxos/functions';
|
|
7
7
|
import { trim } from '@dxos/util';
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
import {
|
|
10
|
+
Create,
|
|
11
|
+
Read,
|
|
12
|
+
Update,
|
|
13
|
+
Delete,
|
|
14
|
+
Deploy,
|
|
15
|
+
Invoke,
|
|
16
|
+
InspectInvocations,
|
|
17
|
+
QueryDeployedFunctions,
|
|
18
|
+
InstallFunction,
|
|
19
|
+
} from './functions';
|
|
11
20
|
|
|
12
|
-
|
|
21
|
+
const BLUEPRINT_KEY = 'org.dxos.blueprint.script';
|
|
13
22
|
|
|
14
|
-
|
|
23
|
+
const make = () =>
|
|
15
24
|
Blueprint.make({
|
|
16
|
-
key:
|
|
25
|
+
key: BLUEPRINT_KEY,
|
|
17
26
|
name: 'Script',
|
|
18
|
-
|
|
27
|
+
agentCanEnable: true,
|
|
28
|
+
tools: Blueprint.toolDefinitions({
|
|
29
|
+
operations: [
|
|
30
|
+
Create,
|
|
31
|
+
Read,
|
|
32
|
+
Update,
|
|
33
|
+
Delete,
|
|
34
|
+
Deploy,
|
|
35
|
+
Invoke,
|
|
36
|
+
InspectInvocations,
|
|
37
|
+
QueryDeployedFunctions,
|
|
38
|
+
InstallFunction,
|
|
39
|
+
],
|
|
40
|
+
}),
|
|
19
41
|
instructions: Template.make({
|
|
20
42
|
source: trim`
|
|
21
|
-
You can create
|
|
43
|
+
You can create, read, update, and delete scripts which contain TypeScript code.
|
|
44
|
+
You can deploy scripts to the Edge runtime and invoke deployed scripts.
|
|
45
|
+
You can inspect the invocation history of a deployed script.
|
|
46
|
+
You can query all functions deployed to the EDGE runtime and install them into the current space.
|
|
22
47
|
`,
|
|
23
48
|
}),
|
|
24
49
|
});
|
|
50
|
+
|
|
51
|
+
const blueprint: AppCapabilities.BlueprintDefinition = {
|
|
52
|
+
key: BLUEPRINT_KEY,
|
|
53
|
+
make,
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export default blueprint;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capability } from '@dxos/app-framework';
|
|
8
|
+
import { AppCapabilities, AppNode } from '@dxos/app-toolkit';
|
|
9
|
+
import { Script } from '@dxos/functions';
|
|
10
|
+
import { GraphBuilder } from '@dxos/plugin-graph';
|
|
11
|
+
|
|
12
|
+
import { meta } from '#meta';
|
|
13
|
+
|
|
14
|
+
export default Capability.makeModule(
|
|
15
|
+
Effect.fnUntraced(function* () {
|
|
16
|
+
const extensions = yield* Effect.all([
|
|
17
|
+
GraphBuilder.createTypeExtension({
|
|
18
|
+
id: `${meta.id}.execute`,
|
|
19
|
+
type: Script.Script,
|
|
20
|
+
connector: () =>
|
|
21
|
+
Effect.succeed([
|
|
22
|
+
AppNode.makeCompanion({
|
|
23
|
+
id: 'execute',
|
|
24
|
+
label: ['script-test.label', { ns: meta.id }],
|
|
25
|
+
icon: 'ph--terminal--regular',
|
|
26
|
+
data: 'execute',
|
|
27
|
+
}),
|
|
28
|
+
]),
|
|
29
|
+
}),
|
|
30
|
+
GraphBuilder.createTypeExtension({
|
|
31
|
+
id: `${meta.id}.logs`,
|
|
32
|
+
type: Script.Script,
|
|
33
|
+
connector: () =>
|
|
34
|
+
Effect.succeed([
|
|
35
|
+
AppNode.makeCompanion({
|
|
36
|
+
id: 'logs',
|
|
37
|
+
label: ['script-logs.label', { ns: meta.id }],
|
|
38
|
+
icon: 'ph--clock-countdown--regular',
|
|
39
|
+
data: 'logs',
|
|
40
|
+
}),
|
|
41
|
+
]),
|
|
42
|
+
}),
|
|
43
|
+
]);
|
|
44
|
+
|
|
45
|
+
return Capability.contributes(AppCapabilities.AppGraphBuilder, extensions);
|
|
46
|
+
}),
|
|
47
|
+
);
|
package/src/capabilities/{artifact-definition/artifact-definition.ts → artifact-definition.ts}
RENAMED
|
@@ -18,7 +18,7 @@ import { invariant } from '@dxos/invariant';
|
|
|
18
18
|
import { SpaceAction } from '@dxos/plugin-space/types';
|
|
19
19
|
import { type Space } from '@dxos/react-client/echo';
|
|
20
20
|
|
|
21
|
-
import { meta } from '
|
|
21
|
+
import { meta } from '#meta';
|
|
22
22
|
|
|
23
23
|
// TODO(burdon): Factor out.
|
|
24
24
|
declare global {
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capability } from '@dxos/app-framework';
|
|
8
|
+
import { AppCapabilities } from '@dxos/app-toolkit';
|
|
9
|
+
|
|
10
|
+
import { ScriptBlueprint } from '#blueprints';
|
|
11
|
+
|
|
12
|
+
const blueprintDefinition = Capability.makeModule<
|
|
13
|
+
[],
|
|
14
|
+
Capability.Capability<typeof AppCapabilities.BlueprintDefinition>[]
|
|
15
|
+
>(() => Effect.succeed([Capability.contributes(AppCapabilities.BlueprintDefinition, ScriptBlueprint)]));
|
|
16
|
+
|
|
17
|
+
export default blueprintDefinition;
|
|
@@ -15,8 +15,8 @@ import { initializeBundler } from '@dxos/functions-runtime/bundler';
|
|
|
15
15
|
import { log } from '@dxos/log';
|
|
16
16
|
import { trim } from '@dxos/util';
|
|
17
17
|
|
|
18
|
-
import { Compiler } from '
|
|
19
|
-
import { ScriptCapabilities } from '
|
|
18
|
+
import { Compiler } from '../compiler';
|
|
19
|
+
import { ScriptCapabilities } from '#types';
|
|
20
20
|
|
|
21
21
|
// TODO(burdon): Document.
|
|
22
22
|
const SCRIPT_PACKAGES_BUCKET = 'https://pub-5745ae82e450484aa28f75fc6a175935.r2.dev/dev/';
|
|
@@ -2,9 +2,15 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export
|
|
5
|
+
import { Capability } from '@dxos/app-framework';
|
|
6
|
+
import { OperationHandlerSet } from '@dxos/operation';
|
|
7
|
+
|
|
8
|
+
export const AppGraphBuilder = Capability.lazy('AppGraphBuilder', () => import('./app-graph-builder'));
|
|
9
|
+
export const BlueprintDefinition = Capability.lazy('BlueprintDefinition', () => import('./blueprint-definition'));
|
|
10
|
+
export const Compiler = Capability.lazy('Compiler', () => import('./compiler'));
|
|
11
|
+
export const OperationHandler = Capability.lazy<OperationHandlerSet.OperationHandlerSet>(
|
|
12
|
+
'OperationHandler',
|
|
13
|
+
() => import('./operation-handler'),
|
|
14
|
+
);
|
|
15
|
+
export const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));
|
|
16
|
+
export const ScriptSettings = Capability.lazy('ScriptSettings', () => import('./settings'));
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
8
|
+
import { OperationHandlerSet } from '@dxos/operation';
|
|
9
|
+
|
|
10
|
+
import { ScriptHandlers } from '../blueprints/functions';
|
|
11
|
+
import { ScriptOperationHandlerSet } from '#operations';
|
|
12
|
+
|
|
13
|
+
export default Capability.makeModule<OperationHandlerSet.OperationHandlerSet>(
|
|
14
|
+
Effect.fnUntraced(function* () {
|
|
15
|
+
return Capability.contributes(
|
|
16
|
+
Capabilities.OperationHandler,
|
|
17
|
+
OperationHandlerSet.merge(ScriptOperationHandlerSet, ScriptHandlers),
|
|
18
|
+
);
|
|
19
|
+
}),
|
|
20
|
+
);
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
import React from 'react';
|
|
7
|
+
|
|
8
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
9
|
+
import { Surface, useAtomCapability, useSettingsState } from '@dxos/app-framework/ui';
|
|
10
|
+
import { AppCapabilities } from '@dxos/app-toolkit';
|
|
11
|
+
import { InvocationTraceContainer } from '@dxos/devtools';
|
|
12
|
+
import { Obj } from '@dxos/echo';
|
|
13
|
+
import { Script } from '@dxos/functions';
|
|
14
|
+
import { useClient } from '@dxos/react-client';
|
|
15
|
+
import { getSpace } from '@dxos/react-client/echo';
|
|
16
|
+
import { Panel } from '@dxos/react-ui';
|
|
17
|
+
import { type AccessToken } from '@dxos/types';
|
|
18
|
+
|
|
19
|
+
import { ScriptPluginSettings } from '#components';
|
|
20
|
+
import { DEPLOYMENT_DIALOG } from '../constants';
|
|
21
|
+
import {
|
|
22
|
+
DeploymentDialog,
|
|
23
|
+
NotebookContainer,
|
|
24
|
+
ScriptContainer,
|
|
25
|
+
ScriptObjectSettings,
|
|
26
|
+
ScriptProperties,
|
|
27
|
+
TestContainer,
|
|
28
|
+
} from '#containers';
|
|
29
|
+
import { useCompiler } from '#hooks';
|
|
30
|
+
import { meta } from '#meta';
|
|
31
|
+
import { Notebook, ScriptCapabilities, type Settings } from '#types';
|
|
32
|
+
import { getAccessCredential } from '../util';
|
|
33
|
+
|
|
34
|
+
export default Capability.makeModule(() =>
|
|
35
|
+
Effect.succeed(
|
|
36
|
+
Capability.contributes(Capabilities.ReactSurface, [
|
|
37
|
+
Surface.create({
|
|
38
|
+
id: `${meta.id}.plugin-settings`,
|
|
39
|
+
role: 'article',
|
|
40
|
+
filter: (data): data is { subject: AppCapabilities.Settings } =>
|
|
41
|
+
AppCapabilities.isSettings(data.subject) && data.subject.prefix === meta.id,
|
|
42
|
+
component: ({ data: { subject } }) => {
|
|
43
|
+
const { settings, updateSettings } = useSettingsState<Settings.Settings>(subject.atom);
|
|
44
|
+
const client = useClient();
|
|
45
|
+
// TODO(burdon): Check token.
|
|
46
|
+
const handleAuthenticate = async () => {
|
|
47
|
+
const { identityKey } = client.halo.identity.get()!;
|
|
48
|
+
await client.halo.writeCredentials([getAccessCredential(identityKey)]);
|
|
49
|
+
};
|
|
50
|
+
return (
|
|
51
|
+
<ScriptPluginSettings
|
|
52
|
+
settings={settings}
|
|
53
|
+
onSettingsChange={updateSettings}
|
|
54
|
+
onAuthenticate={handleAuthenticate}
|
|
55
|
+
/>
|
|
56
|
+
);
|
|
57
|
+
},
|
|
58
|
+
}),
|
|
59
|
+
Surface.create({
|
|
60
|
+
id: `${meta.id}.script.article`,
|
|
61
|
+
role: ['article', 'section'],
|
|
62
|
+
filter: (data): data is { subject: Script.Script; attendableId: string } =>
|
|
63
|
+
Obj.instanceOf(Script.Script, data.subject),
|
|
64
|
+
component: ({ data, role }) => {
|
|
65
|
+
const compiler = useCompiler();
|
|
66
|
+
const settings = useAtomCapability(ScriptCapabilities.Settings);
|
|
67
|
+
// TODO(wittjosiah): Why? The editor should be allow to render even if the environment is not ready.
|
|
68
|
+
if (!compiler?.environment) {
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
return (
|
|
73
|
+
<ScriptContainer
|
|
74
|
+
role={role}
|
|
75
|
+
subject={data.subject}
|
|
76
|
+
attendableId={data.attendableId}
|
|
77
|
+
settings={settings}
|
|
78
|
+
env={compiler?.environment}
|
|
79
|
+
/>
|
|
80
|
+
);
|
|
81
|
+
},
|
|
82
|
+
}),
|
|
83
|
+
Surface.create({
|
|
84
|
+
id: `${meta.id}.notebook.article`,
|
|
85
|
+
role: 'article',
|
|
86
|
+
filter: (data): data is { subject: Notebook.Notebook; attendableId: string } =>
|
|
87
|
+
typeof data.attendableId === 'string' && Obj.instanceOf(Notebook.Notebook, data.subject),
|
|
88
|
+
component: ({ data, role }) => {
|
|
89
|
+
const compiler = useCompiler();
|
|
90
|
+
return (
|
|
91
|
+
<NotebookContainer
|
|
92
|
+
role={role}
|
|
93
|
+
subject={data.subject}
|
|
94
|
+
attendableId={data.attendableId}
|
|
95
|
+
env={compiler?.environment}
|
|
96
|
+
/>
|
|
97
|
+
);
|
|
98
|
+
},
|
|
99
|
+
}),
|
|
100
|
+
// TODO(burdon): Standardize PluginSettings vs ObjectSettings.
|
|
101
|
+
// TODO(burdon): Why is ScriptProperties different from ScriptObjectSettings?
|
|
102
|
+
Surface.create({
|
|
103
|
+
id: `${meta.id}.companion.base-settings`,
|
|
104
|
+
role: 'base-object-settings',
|
|
105
|
+
filter: (data): data is { subject: Script.Script } => Obj.instanceOf(Script.Script, data.subject),
|
|
106
|
+
component: ({ data }) => <ScriptProperties object={data.subject} />,
|
|
107
|
+
}),
|
|
108
|
+
Surface.create({
|
|
109
|
+
id: `${meta.id}.companion.settings`,
|
|
110
|
+
role: 'object-settings',
|
|
111
|
+
filter: (data): data is { subject: Script.Script } => Obj.instanceOf(Script.Script, data.subject),
|
|
112
|
+
component: ({ data }) => <ScriptObjectSettings object={data.subject} />,
|
|
113
|
+
}),
|
|
114
|
+
Surface.create({
|
|
115
|
+
id: `${meta.id}.companion.execute`,
|
|
116
|
+
role: 'article',
|
|
117
|
+
filter: (data): data is { companionTo: Script.Script } =>
|
|
118
|
+
Obj.instanceOf(Script.Script, data.companionTo) && data.subject === 'execute',
|
|
119
|
+
component: ({ data, role }) => <TestContainer script={data.companionTo} role={role} />,
|
|
120
|
+
}),
|
|
121
|
+
Surface.create({
|
|
122
|
+
id: `${meta.id}.companion.logs`,
|
|
123
|
+
role: 'article',
|
|
124
|
+
filter: (data): data is { companionTo: Script.Script } =>
|
|
125
|
+
Obj.instanceOf(Script.Script, data.companionTo) && data.subject === 'logs',
|
|
126
|
+
component: ({ data, role }) => {
|
|
127
|
+
const space = getSpace(data.companionTo);
|
|
128
|
+
const queueDxn = space?.properties.invocationTraceQueue?.dxn;
|
|
129
|
+
return (
|
|
130
|
+
<Panel.Root role={role}>
|
|
131
|
+
<Panel.Content asChild>
|
|
132
|
+
<InvocationTraceContainer
|
|
133
|
+
db={space?.db}
|
|
134
|
+
queueDxn={queueDxn}
|
|
135
|
+
target={data.companionTo}
|
|
136
|
+
detailAxis='block'
|
|
137
|
+
/>
|
|
138
|
+
</Panel.Content>
|
|
139
|
+
</Panel.Root>
|
|
140
|
+
);
|
|
141
|
+
},
|
|
142
|
+
}),
|
|
143
|
+
Surface.create({
|
|
144
|
+
id: DEPLOYMENT_DIALOG,
|
|
145
|
+
role: 'dialog',
|
|
146
|
+
filter: (data): data is { props: { accessToken: AccessToken.AccessToken; scriptTemplates: any } } =>
|
|
147
|
+
data.component === DEPLOYMENT_DIALOG,
|
|
148
|
+
component: ({ data }) => <DeploymentDialog {...data.props} />,
|
|
149
|
+
}),
|
|
150
|
+
]),
|
|
151
|
+
),
|
|
152
|
+
);
|
|
@@ -4,17 +4,18 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
|
|
7
|
-
import { Capability
|
|
7
|
+
import { Capability } from '@dxos/app-framework';
|
|
8
|
+
import { AppCapabilities } from '@dxos/app-toolkit';
|
|
8
9
|
import { createKvsStore } from '@dxos/effect';
|
|
9
10
|
|
|
10
|
-
import { meta } from '
|
|
11
|
-
import { ScriptCapabilities,
|
|
11
|
+
import { meta } from '#meta';
|
|
12
|
+
import { ScriptCapabilities, Settings } from '#types';
|
|
12
13
|
|
|
13
14
|
export default Capability.makeModule(() =>
|
|
14
15
|
Effect.sync(() => {
|
|
15
16
|
const settingsAtom = createKvsStore({
|
|
16
17
|
key: meta.id,
|
|
17
|
-
schema:
|
|
18
|
+
schema: Settings.Settings,
|
|
18
19
|
defaultValue: () => ({
|
|
19
20
|
editorInputMode: 'vscode' as const,
|
|
20
21
|
}),
|
|
@@ -22,9 +23,9 @@ export default Capability.makeModule(() =>
|
|
|
22
23
|
|
|
23
24
|
return [
|
|
24
25
|
Capability.contributes(ScriptCapabilities.Settings, settingsAtom),
|
|
25
|
-
Capability.contributes(
|
|
26
|
+
Capability.contributes(AppCapabilities.Settings, {
|
|
26
27
|
prefix: meta.id,
|
|
27
|
-
schema:
|
|
28
|
+
schema: Settings.Settings,
|
|
28
29
|
atom: settingsAtom,
|
|
29
30
|
}),
|
|
30
31
|
];
|
|
@@ -11,9 +11,9 @@ import { log } from '@dxos/log';
|
|
|
11
11
|
import { useClient } from '@dxos/react-client';
|
|
12
12
|
import { createProtoRpcPeer } from '@dxos/rpc';
|
|
13
13
|
import { createIFramePort } from '@dxos/rpc-tunnel';
|
|
14
|
-
import {
|
|
14
|
+
import { mx } from '@dxos/ui-theme';
|
|
15
15
|
|
|
16
|
-
export type
|
|
16
|
+
export type FramePanelProps = {
|
|
17
17
|
containerUrl: string;
|
|
18
18
|
result: BundleResult;
|
|
19
19
|
debug?: boolean;
|
|
@@ -22,7 +22,7 @@ export type FrameContainerProps = {
|
|
|
22
22
|
/**
|
|
23
23
|
* IFrame container for the compiled script.
|
|
24
24
|
*/
|
|
25
|
-
export const
|
|
25
|
+
export const FramePanel = ({ containerUrl, result, debug = true }: FramePanelProps) => {
|
|
26
26
|
const client = useClient();
|
|
27
27
|
const iframeRef = useRef<HTMLIFrameElement>(null);
|
|
28
28
|
useEffect(() => {
|
|
@@ -61,8 +61,7 @@ export const FrameContainer = ({ containerUrl, result, debug = true }: FrameCont
|
|
|
61
61
|
<div className='relative'>
|
|
62
62
|
<div
|
|
63
63
|
className={mx(
|
|
64
|
-
|
|
65
|
-
'flex absolute right-2 bottom-2 is-[30rem] bs-[200px] ring rounded',
|
|
64
|
+
'flex absolute right-2 bottom-2 w-[30rem] h-[200px] bg-base-surface ring rounded-sm',
|
|
66
65
|
'z-20 overflow-x-hidden overflow-y-auto',
|
|
67
66
|
)}
|
|
68
67
|
>
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useCallback, useMemo } from 'react';
|
|
6
6
|
|
|
7
|
-
import { Surface } from '@dxos/app-framework/
|
|
7
|
+
import { Surface } from '@dxos/app-framework/ui';
|
|
8
8
|
import { type Database, Obj } from '@dxos/echo';
|
|
9
9
|
import { createDocAccessor } from '@dxos/echo-db';
|
|
10
10
|
import { invariant } from '@dxos/invariant';
|
|
@@ -23,15 +23,15 @@ import {
|
|
|
23
23
|
import { mx } from '@dxos/ui-theme';
|
|
24
24
|
import { isNonNullable } from '@dxos/util';
|
|
25
25
|
|
|
26
|
-
import { meta } from '
|
|
26
|
+
import { meta } from '#meta';
|
|
27
27
|
import { type ComputeGraph } from '../../notebook';
|
|
28
|
-
import { type Notebook } from '
|
|
28
|
+
import { type Notebook } from '#types';
|
|
29
29
|
import { TypescriptEditor, type TypescriptEditorProps } from '../TypescriptEditor';
|
|
30
30
|
|
|
31
31
|
import { type NotebookMenuProps } from './NotebookMenu';
|
|
32
32
|
|
|
33
|
-
const editorStyles = 'p-2
|
|
34
|
-
const valueStyles = 'p-1
|
|
33
|
+
const editorStyles = 'p-2 ps-3';
|
|
34
|
+
const valueStyles = 'p-1 ps-3';
|
|
35
35
|
|
|
36
36
|
export type NotebookCellProps = {
|
|
37
37
|
db?: Database.Database;
|
|
@@ -61,8 +61,8 @@ export const NotebookCell = ({ db, graph, dragging, cell, promptResults, env }:
|
|
|
61
61
|
const handleQueryChange = useCallback<NonNullable<QueryEditorProps['onChange']>>(
|
|
62
62
|
(value: string) => {
|
|
63
63
|
invariant(cell.source?.target);
|
|
64
|
-
Obj.change(cell.source.target, (
|
|
65
|
-
|
|
64
|
+
Obj.change(cell.source.target, (obj) => {
|
|
65
|
+
obj.content = value;
|
|
66
66
|
});
|
|
67
67
|
},
|
|
68
68
|
[cell],
|
|
@@ -98,7 +98,7 @@ export const NotebookCell = ({ db, graph, dragging, cell, promptResults, env }:
|
|
|
98
98
|
extensions={extensions}
|
|
99
99
|
env={env}
|
|
100
100
|
options={{
|
|
101
|
-
placeholder: t('notebook
|
|
101
|
+
placeholder: t('notebook-cell.placeholder'),
|
|
102
102
|
highlightActiveLine: false,
|
|
103
103
|
lineNumbers: false,
|
|
104
104
|
}}
|
|
@@ -114,17 +114,15 @@ export const NotebookCell = ({ db, graph, dragging, cell, promptResults, env }:
|
|
|
114
114
|
|
|
115
115
|
// TODO(burdon): Remove app-framework deps (via render prop).
|
|
116
116
|
return (
|
|
117
|
-
<div
|
|
118
|
-
className={mx('bs-full overflow-hidden grid', explorerGraph && !dragging && 'grid-rows-[min-content_1fr]')}
|
|
119
|
-
>
|
|
117
|
+
<div className={mx('h-full overflow-hidden grid', explorerGraph && !dragging && 'grid-rows-[min-content_1fr]')}>
|
|
120
118
|
<QueryEditor
|
|
121
119
|
id={cell.id}
|
|
122
|
-
classNames={[editorStyles, 'border-
|
|
120
|
+
classNames={[editorStyles, 'border-b border-subdued-separator']}
|
|
123
121
|
db={db}
|
|
124
122
|
value={cell.source.target.content}
|
|
125
123
|
onChange={handleQueryChange}
|
|
126
124
|
/>
|
|
127
|
-
{explorerGraph && !dragging && <Surface role='section' limit={1} data={{ subject: explorerGraph }} />}
|
|
125
|
+
{explorerGraph && !dragging && <Surface.Surface role='section' limit={1} data={{ subject: explorerGraph }} />}
|
|
128
126
|
</div>
|
|
129
127
|
);
|
|
130
128
|
|
|
@@ -161,13 +159,13 @@ const NotebookCellValue = ({ cell, graph }: NotebookCellProps) => {
|
|
|
161
159
|
return (
|
|
162
160
|
<div
|
|
163
161
|
className={mx(
|
|
164
|
-
'flex
|
|
162
|
+
'flex w-full bg-group-surface border-y border-subdued-separator text-description font-mono',
|
|
165
163
|
valueStyles,
|
|
166
164
|
)}
|
|
167
165
|
>
|
|
168
166
|
{name && (
|
|
169
167
|
<>
|
|
170
|
-
<span className='text-
|
|
168
|
+
<span className='text-success-text'>{name}</span>
|
|
171
169
|
<span className='text-description'> = </span>
|
|
172
170
|
</>
|
|
173
171
|
)}
|
|
@@ -187,7 +185,7 @@ const NotebookPromptResult = ({ cell, promptResults }: NotebookCellProps) => {
|
|
|
187
185
|
}
|
|
188
186
|
|
|
189
187
|
return (
|
|
190
|
-
<div className={mx('flex
|
|
188
|
+
<div className={mx('flex w-full bg-group-surface text-description border-y border-subdued-separator', valueStyles)}>
|
|
191
189
|
<NotebookTextEditor readOnly value={value} />
|
|
192
190
|
</div>
|
|
193
191
|
);
|
|
@@ -203,7 +201,7 @@ const NotebookTextEditor = ({
|
|
|
203
201
|
const extensions = useMemo(() => {
|
|
204
202
|
return [
|
|
205
203
|
createBasicExtensions({
|
|
206
|
-
placeholder: t('notebook
|
|
204
|
+
placeholder: t('notebook-markdown.placeholder'),
|
|
207
205
|
readOnly,
|
|
208
206
|
}),
|
|
209
207
|
createThemeExtensions({ themeMode, syntaxHighlighting: true }),
|
|
@@ -6,8 +6,8 @@ import React from 'react';
|
|
|
6
6
|
|
|
7
7
|
import { DropdownMenu, useTranslation } from '@dxos/react-ui';
|
|
8
8
|
|
|
9
|
-
import { meta } from '
|
|
10
|
-
import { type Notebook } from '
|
|
9
|
+
import { meta } from '#meta';
|
|
10
|
+
import { type Notebook } from '#types';
|
|
11
11
|
|
|
12
12
|
export type NotebookMenuProps = {
|
|
13
13
|
cell?: Notebook.Cell;
|
|
@@ -23,20 +23,20 @@ export const NotebookMenu = ({ cell, onCellInsert, onCellDelete }: NotebookMenuP
|
|
|
23
23
|
<DropdownMenu.Content>
|
|
24
24
|
<DropdownMenu.Viewport>
|
|
25
25
|
<DropdownMenu.Item onClick={() => onCellInsert?.('script', cell?.id)}>
|
|
26
|
-
{t('notebook
|
|
26
|
+
{t('notebook-cell-insert-script.label')}
|
|
27
27
|
</DropdownMenu.Item>
|
|
28
28
|
<DropdownMenu.Item onClick={() => onCellInsert?.('prompt', cell?.id)}>
|
|
29
|
-
{t('notebook
|
|
29
|
+
{t('notebook-cell-insert-prompt.label')}
|
|
30
30
|
</DropdownMenu.Item>
|
|
31
31
|
<DropdownMenu.Item onClick={() => onCellInsert?.('query', cell?.id)}>
|
|
32
|
-
{t('notebook
|
|
32
|
+
{t('notebook-cell-insert-query.label')}
|
|
33
33
|
</DropdownMenu.Item>
|
|
34
34
|
<DropdownMenu.Item onClick={() => onCellInsert?.('markdown', cell?.id)}>
|
|
35
|
-
{t('notebook
|
|
35
|
+
{t('notebook-cell-insert-markdown.label')}
|
|
36
36
|
</DropdownMenu.Item>
|
|
37
37
|
{cell && onCellDelete && (
|
|
38
38
|
<DropdownMenu.Item onClick={() => onCellDelete?.(cell.id)}>
|
|
39
|
-
{t('notebook
|
|
39
|
+
{t('notebook-cell-delete.label')}
|
|
40
40
|
</DropdownMenu.Item>
|
|
41
41
|
)}
|
|
42
42
|
</DropdownMenu.Viewport>
|