@dxos/plugin-script 0.8.4-main.abd8ff62ef → 0.8.4-main.bc2380dfbc
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/LICENSE +102 -5
- package/dist/lib/{browser/NotebookContainer-RO4NJRYH.mjs → neutral/NotebookArticle-3TE4WBZC.mjs} +13 -10
- package/dist/lib/neutral/NotebookArticle-3TE4WBZC.mjs.map +7 -0
- package/dist/lib/{browser/ScriptContainer-2OPBAXFB.mjs → neutral/ScriptArticle-UBT27SB6.mjs} +4 -4
- package/dist/lib/{browser/ScriptContainer-2OPBAXFB.mjs.map → neutral/ScriptArticle-UBT27SB6.mjs.map} +4 -4
- package/dist/lib/neutral/ScriptPlugin.mjs +39 -0
- package/dist/lib/neutral/ScriptPlugin.mjs.map +7 -0
- package/dist/lib/neutral/ScriptPlugin.node.mjs +27 -0
- package/dist/lib/neutral/ScriptPlugin.node.mjs.map +7 -0
- package/dist/lib/neutral/ScriptPlugin.workerd.mjs +21 -0
- package/dist/lib/neutral/ScriptPlugin.workerd.mjs.map +7 -0
- package/dist/lib/neutral/ScriptPluginSettings-T4JMUSHN.mjs +31 -0
- package/dist/lib/neutral/ScriptPluginSettings-T4JMUSHN.mjs.map +7 -0
- package/dist/lib/{browser/ScriptProperties-NRXG4PBX.mjs → neutral/ScriptProperties-RLXNAN3N.mjs} +9 -16
- package/dist/lib/neutral/ScriptProperties-RLXNAN3N.mjs.map +7 -0
- package/dist/lib/{browser/TestContainer-JNFPLAJX.mjs → neutral/TestContainer-AFVTBYSJ.mjs} +5 -5
- package/dist/lib/neutral/TestContainer-AFVTBYSJ.mjs.map +7 -0
- package/dist/lib/{browser/access-token-created-MSWZWZCT.mjs → neutral/access-token-created-XNDXOZ2U.mjs} +6 -9
- package/dist/lib/neutral/access-token-created-XNDXOZ2U.mjs.map +7 -0
- package/dist/lib/neutral/app-graph-builder-7AWFCEQF.mjs +52 -0
- package/dist/lib/neutral/app-graph-builder-7AWFCEQF.mjs.map +7 -0
- package/dist/lib/neutral/blueprint-definition-T33SBPP2.mjs +15 -0
- package/dist/lib/neutral/blueprint-definition-T33SBPP2.mjs.map +7 -0
- package/dist/lib/neutral/blueprints/index.mjs +10 -0
- package/dist/lib/neutral/capabilities/index.mjs +21 -0
- package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
- package/dist/lib/neutral/capabilities/node.mjs +17 -0
- package/dist/lib/neutral/capabilities/node.mjs.map +7 -0
- package/dist/lib/neutral/chunk-2REUEDUA.mjs +56 -0
- package/dist/lib/neutral/chunk-2REUEDUA.mjs.map +7 -0
- package/dist/lib/{browser/chunk-NSAF3763.mjs → neutral/chunk-A4LRH25S.mjs} +3 -3
- package/dist/lib/neutral/chunk-A4LRH25S.mjs.map +7 -0
- package/dist/lib/{browser/blueprints/index.mjs → neutral/chunk-BDRB6ZX2.mjs} +4 -10
- package/dist/lib/neutral/chunk-BDRB6ZX2.mjs.map +7 -0
- package/dist/lib/neutral/chunk-BMO5VOKL.mjs +125 -0
- package/dist/lib/neutral/chunk-BMO5VOKL.mjs.map +7 -0
- package/dist/lib/neutral/chunk-LYPVNW4K.mjs +8 -0
- package/dist/lib/neutral/chunk-LYPVNW4K.mjs.map +7 -0
- package/dist/lib/neutral/chunk-P2F3STZN.mjs +8 -0
- package/dist/lib/neutral/chunk-P2F3STZN.mjs.map +7 -0
- package/dist/lib/neutral/chunk-SNUWHNEW.mjs +8 -0
- package/dist/lib/neutral/chunk-SNUWHNEW.mjs.map +7 -0
- package/dist/lib/neutral/chunk-UYR3YH4Q.mjs +31 -0
- package/dist/lib/neutral/chunk-UYR3YH4Q.mjs.map +7 -0
- package/dist/lib/{browser/index.mjs → neutral/chunk-VXDJH6OL.mjs} +20 -63
- package/dist/lib/neutral/chunk-VXDJH6OL.mjs.map +7 -0
- package/dist/lib/neutral/compiler-ODK4UA2N.mjs +101 -0
- package/dist/lib/neutral/compiler-ODK4UA2N.mjs.map +7 -0
- package/dist/lib/neutral/components/index.mjs +721 -0
- package/dist/lib/neutral/components/index.mjs.map +7 -0
- package/dist/lib/neutral/containers/index.mjs +17 -0
- package/dist/lib/neutral/containers/index.mjs.map +7 -0
- package/dist/lib/{browser/create-JDXWBARB.mjs → neutral/create-ZUHIXCBS.mjs} +4 -2
- package/dist/lib/{browser/create-JDXWBARB.mjs.map → neutral/create-ZUHIXCBS.mjs.map} +3 -3
- package/dist/lib/neutral/create-object-F2NWICFV.mjs +44 -0
- package/dist/lib/neutral/create-object-F2NWICFV.mjs.map +7 -0
- package/dist/lib/{browser/create-script-Q7B3CFAP.mjs → neutral/create-script-H5S4AO47.mjs} +5 -5
- package/dist/lib/neutral/create-script-H5S4AO47.mjs.map +7 -0
- package/dist/lib/{browser/deploy-CXVW54JJ.mjs → neutral/deploy-M73G7HMP.mjs} +4 -3
- package/dist/lib/{browser/deploy-CXVW54JJ.mjs.map → neutral/deploy-M73G7HMP.mjs.map} +3 -3
- package/dist/lib/neutral/hooks/index.mjs +369 -0
- package/dist/lib/neutral/hooks/index.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +41 -0
- package/dist/lib/{browser/inspect-invocations-LEOEP5I2.mjs → neutral/inspect-invocations-UO27IPCL.mjs} +3 -3
- package/dist/lib/{browser/inspect-invocations-LEOEP5I2.mjs.map → neutral/inspect-invocations-UO27IPCL.mjs.map} +2 -2
- package/dist/lib/{browser/install-function-5N24Q45W.mjs → neutral/install-function-MSWSC244.mjs} +5 -7
- package/dist/lib/neutral/install-function-MSWSC244.mjs.map +7 -0
- package/dist/lib/{browser/invoke-5QVEZ3X5.mjs → neutral/invoke-V6XYXKLD.mjs} +6 -7
- package/dist/lib/neutral/invoke-V6XYXKLD.mjs.map +7 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/neutral/meta.mjs +10 -0
- package/dist/lib/neutral/operation-handler-KIZ7XZ5G.mjs +18 -0
- package/dist/lib/neutral/operation-handler-KIZ7XZ5G.mjs.map +7 -0
- package/dist/lib/neutral/operations/index.mjs +8 -0
- package/dist/lib/neutral/plugin.mjs +16 -0
- package/dist/lib/neutral/plugin.mjs.map +7 -0
- package/dist/lib/{browser/query-deployed-functions-FVD7NYPA.mjs → neutral/query-deployed-functions-4MMKQ6BR.mjs} +13 -9
- package/dist/lib/neutral/query-deployed-functions-4MMKQ6BR.mjs.map +7 -0
- package/dist/lib/neutral/react-surface-ZMU2CRJ7.mjs +117 -0
- package/dist/lib/neutral/react-surface-ZMU2CRJ7.mjs.map +7 -0
- package/dist/lib/neutral/settings-VJBW4OMK.mjs +30 -0
- package/dist/lib/neutral/settings-VJBW4OMK.mjs.map +7 -0
- package/dist/lib/{browser → neutral}/templates/index.mjs +1 -1
- package/dist/lib/neutral/types/index.mjs +17 -0
- package/dist/lib/neutral/types/index.mjs.map +7 -0
- package/dist/types/src/ScriptPlugin.d.ts.map +1 -1
- package/dist/types/src/ScriptPlugin.node.d.ts.map +1 -1
- package/dist/types/src/ScriptPlugin.workerd.d.ts +4 -0
- package/dist/types/src/ScriptPlugin.workerd.d.ts.map +1 -0
- package/dist/types/src/blueprints/functions/definitions.d.ts +0 -12
- package/dist/types/src/blueprints/functions/definitions.d.ts.map +1 -1
- package/dist/types/src/blueprints/functions/delete.d.ts +0 -2
- package/dist/types/src/blueprints/functions/deploy.d.ts +0 -2
- package/dist/types/src/blueprints/functions/inspect-invocations.d.ts +0 -2
- package/dist/types/src/blueprints/functions/invoke.d.ts +2 -4
- package/dist/types/src/blueprints/functions/invoke.d.ts.map +1 -1
- package/dist/types/src/blueprints/functions/read.d.ts +0 -2
- package/dist/types/src/blueprints/functions/update.d.ts +0 -2
- package/dist/types/src/capabilities/create-object.d.ts +16 -0
- package/dist/types/src/capabilities/create-object.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +11 -0
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/node.d.ts +18 -0
- package/dist/types/src/capabilities/node.d.ts.map +1 -0
- package/dist/types/src/compiler/compiler.d.ts.map +1 -1
- package/dist/types/src/components/QueryEditor/QueryEditor.d.ts.map +1 -1
- package/dist/types/src/containers/NotebookArticle/NotebookArticle.d.ts +7 -0
- package/dist/types/src/containers/NotebookArticle/NotebookArticle.d.ts.map +1 -0
- package/dist/types/src/containers/NotebookArticle/NotebookArticle.stories.d.ts +7 -0
- package/dist/types/src/containers/NotebookArticle/NotebookArticle.stories.d.ts.map +1 -0
- package/dist/types/src/containers/NotebookArticle/index.d.ts +2 -0
- package/dist/types/src/containers/{ScriptContainer → NotebookArticle}/index.d.ts.map +1 -1
- package/dist/types/src/containers/{ScriptContainer/ScriptContainer.d.ts → ScriptArticle/ScriptArticle.d.ts} +2 -2
- package/dist/types/src/containers/ScriptArticle/ScriptArticle.d.ts.map +1 -0
- package/dist/types/src/containers/{ScriptContainer/ScriptContainer.stories.d.ts → ScriptArticle/ScriptArticle.stories.d.ts} +1 -1
- package/dist/types/src/containers/ScriptArticle/ScriptArticle.stories.d.ts.map +1 -0
- package/dist/types/src/containers/ScriptArticle/index.d.ts +2 -0
- package/dist/types/src/containers/ScriptArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/ScriptProperties/BlueprintEditor.d.ts.map +1 -1
- package/dist/types/src/containers/ScriptProperties/ScriptProperties.stories.d.ts.map +1 -1
- package/dist/types/src/containers/index.d.ts +2 -2
- package/dist/types/src/containers/index.d.ts.map +1 -1
- package/dist/types/src/hooks/deploy.d.ts +0 -2
- package/dist/types/src/hooks/deploy.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +2 -3
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/operations/access-token-created.d.ts +1 -1
- package/dist/types/src/operations/access-token-created.d.ts.map +1 -1
- package/dist/types/src/operations/create-script.d.ts +2 -2
- package/dist/types/src/operations/create-script.d.ts.map +1 -1
- package/dist/types/src/operations/index.d.ts +0 -1
- package/dist/types/src/operations/index.d.ts.map +1 -1
- package/dist/types/src/plugin.d.ts +4 -0
- package/dist/types/src/plugin.d.ts.map +1 -0
- package/dist/types/src/templates/chess-bot.d.ts +3 -9
- package/dist/types/src/templates/chess-bot.d.ts.map +1 -1
- package/dist/types/src/templates/commentary.d.ts +3 -9
- package/dist/types/src/templates/commentary.d.ts.map +1 -1
- package/dist/types/src/testing/test-script.d.ts.map +1 -1
- package/dist/types/src/types/Notebook.d.ts +13 -11
- package/dist/types/src/types/Notebook.d.ts.map +1 -1
- package/dist/types/src/types/ScriptCapabilities.d.ts +6 -0
- package/dist/types/src/types/ScriptCapabilities.d.ts.map +1 -0
- package/dist/types/src/types/ScriptEvents.d.ts +3 -0
- package/dist/types/src/types/ScriptEvents.d.ts.map +1 -0
- package/dist/types/src/{operations/definitions.d.ts → types/ScriptOperation.d.ts} +1 -1
- package/dist/types/src/types/ScriptOperation.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +4 -3
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +141 -111
- package/src/ScriptPlugin.node.ts +3 -52
- package/src/ScriptPlugin.test.ts +3 -3
- package/src/ScriptPlugin.tsx +2 -51
- package/src/ScriptPlugin.workerd.ts +18 -0
- package/src/blueprints/functions/create.ts +1 -1
- package/src/blueprints/functions/deploy.ts +2 -1
- package/src/blueprints/functions/inspect-invocations.ts +2 -2
- package/src/blueprints/functions/install-function.ts +4 -4
- package/src/blueprints/functions/invoke.ts +4 -5
- package/src/blueprints/functions/query-deployed-functions.ts +11 -7
- package/src/capabilities/artifact-definition.ts +2 -2
- package/src/capabilities/create-object.ts +48 -0
- package/src/capabilities/index.ts +1 -0
- package/src/capabilities/node.ts +16 -0
- package/src/capabilities/react-surface.tsx +5 -5
- package/src/compiler/compiler.ts +4 -0
- package/src/components/NotebookStack/NotebookStack.stories.tsx +2 -2
- package/src/components/QueryEditor/QueryEditor.stories.tsx +1 -1
- package/src/components/QueryEditor/QueryEditor.tsx +3 -1
- package/src/components/ScriptToolbar/ScriptToolbar.stories.tsx +1 -1
- package/src/components/TypescriptEditor/TypescriptEditor.stories.tsx +1 -1
- package/src/containers/DeploymentDialog/DeploymentDialog.stories.tsx +1 -1
- package/src/containers/{NotebookContainer/NotebookContainer.stories.tsx → NotebookArticle/NotebookArticle.stories.tsx} +11 -11
- package/src/containers/{NotebookContainer/NotebookContainer.tsx → NotebookArticle/NotebookArticle.tsx} +7 -7
- package/src/containers/NotebookArticle/index.ts +5 -0
- package/src/containers/{ScriptContainer/ScriptContainer.stories.tsx → ScriptArticle/ScriptArticle.stories.tsx} +7 -6
- package/src/containers/{ScriptContainer/ScriptContainer.tsx → ScriptArticle/ScriptArticle.tsx} +1 -1
- package/src/containers/ScriptArticle/index.ts +5 -0
- package/src/containers/ScriptProperties/BlueprintEditor.tsx +10 -9
- package/src/containers/ScriptProperties/FunctionBinding.tsx +1 -1
- package/src/containers/ScriptProperties/FunctionPublishing.tsx +4 -4
- package/src/containers/ScriptProperties/ScriptProperties.stories.tsx +3 -2
- package/src/containers/ScriptProperties/ScriptProperties.tsx +1 -1
- package/src/containers/TestContainer/TestContainer.tsx +4 -4
- package/src/containers/index.ts +2 -2
- package/src/e2e/deploy.test.ts +3 -1
- package/src/hooks/useCreateAndDeployScriptTemplates.ts +2 -2
- package/src/index.ts +2 -7
- package/src/operations/access-token-created.ts +1 -1
- package/src/operations/create-script.ts +2 -2
- package/src/operations/index.ts +0 -2
- package/src/plugin.ts +11 -0
- package/src/templates/chess-bot.ts +10 -8
- package/src/templates/commentary.ts +14 -14
- package/src/testing/test-notebook.ts +7 -7
- package/src/testing/test-script.ts +1 -2
- package/src/types/Notebook.ts +1 -1
- package/src/types/ScriptCapabilities.ts +18 -0
- package/src/types/ScriptEvents.ts +11 -0
- package/src/{operations/definitions.ts → types/ScriptOperation.ts} +2 -0
- package/src/types/index.ts +5 -3
- package/src/util/deploy.ts +1 -1
- package/src/util/functions.ts +4 -4
- package/dist/lib/browser/NotebookContainer-RO4NJRYH.mjs.map +0 -7
- package/dist/lib/browser/ScriptProperties-NRXG4PBX.mjs.map +0 -7
- package/dist/lib/browser/TestContainer-JNFPLAJX.mjs.map +0 -7
- package/dist/lib/browser/access-token-created-MSWZWZCT.mjs.map +0 -7
- package/dist/lib/browser/blueprints/index.mjs.map +0 -7
- package/dist/lib/browser/chunk-KF6H7J5N.mjs +0 -81
- package/dist/lib/browser/chunk-KF6H7J5N.mjs.map +0 -7
- package/dist/lib/browser/chunk-NSAF3763.mjs.map +0 -7
- package/dist/lib/browser/chunk-RQ5LDVFK.mjs +0 -49
- package/dist/lib/browser/chunk-RQ5LDVFK.mjs.map +0 -7
- package/dist/lib/browser/containers/index.mjs +0 -17
- package/dist/lib/browser/containers/index.mjs.map +0 -7
- package/dist/lib/browser/create-script-Q7B3CFAP.mjs.map +0 -7
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/install-function-5N24Q45W.mjs.map +0 -7
- package/dist/lib/browser/invoke-5QVEZ3X5.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/operations/index.mjs +0 -14
- package/dist/lib/browser/operations/index.mjs.map +0 -7
- package/dist/lib/browser/query-deployed-functions-FVD7NYPA.mjs.map +0 -7
- package/dist/lib/browser/types/index.mjs +0 -14
- package/dist/lib/node-esm/DeploymentDialog-A5BZHUJB.mjs +0 -113
- package/dist/lib/node-esm/DeploymentDialog-A5BZHUJB.mjs.map +0 -7
- package/dist/lib/node-esm/NotebookContainer-DPT65MA7.mjs +0 -761
- package/dist/lib/node-esm/NotebookContainer-DPT65MA7.mjs.map +0 -7
- package/dist/lib/node-esm/ScriptContainer-UKD7QORM.mjs +0 -80
- package/dist/lib/node-esm/ScriptContainer-UKD7QORM.mjs.map +0 -7
- package/dist/lib/node-esm/ScriptProperties-FQXEOJKG.mjs +0 -305
- package/dist/lib/node-esm/ScriptProperties-FQXEOJKG.mjs.map +0 -7
- package/dist/lib/node-esm/TestContainer-Y4XVV7KQ.mjs +0 -45
- package/dist/lib/node-esm/TestContainer-Y4XVV7KQ.mjs.map +0 -7
- package/dist/lib/node-esm/access-token-created-DCD6LYQC.mjs +0 -38
- package/dist/lib/node-esm/access-token-created-DCD6LYQC.mjs.map +0 -7
- package/dist/lib/node-esm/blueprints/index.mjs +0 -59
- package/dist/lib/node-esm/blueprints/index.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-2DZNF5NG.mjs +0 -82
- package/dist/lib/node-esm/chunk-2DZNF5NG.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-C55UYWN4.mjs +0 -50
- package/dist/lib/node-esm/chunk-C55UYWN4.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-EW63XFRQ.mjs +0 -107
- package/dist/lib/node-esm/chunk-EW63XFRQ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +0 -11
- package/dist/lib/node-esm/chunk-XFM2BEHY.mjs +0 -338
- package/dist/lib/node-esm/chunk-XFM2BEHY.mjs.map +0 -7
- package/dist/lib/node-esm/containers/index.mjs +0 -18
- package/dist/lib/node-esm/containers/index.mjs.map +0 -7
- package/dist/lib/node-esm/create-D2JDNXY6.mjs +0 -45
- package/dist/lib/node-esm/create-D2JDNXY6.mjs.map +0 -7
- package/dist/lib/node-esm/create-script-4AB4G7GQ.mjs +0 -46
- package/dist/lib/node-esm/create-script-4AB4G7GQ.mjs.map +0 -7
- package/dist/lib/node-esm/delete-YXLT7J27.mjs +0 -22
- package/dist/lib/node-esm/delete-YXLT7J27.mjs.map +0 -7
- package/dist/lib/node-esm/deploy-MXVZXAUC.mjs +0 -63
- package/dist/lib/node-esm/deploy-MXVZXAUC.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -194
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/inspect-invocations-TVAKGYX5.mjs +0 -60
- package/dist/lib/node-esm/inspect-invocations-TVAKGYX5.mjs.map +0 -7
- package/dist/lib/node-esm/install-function-ST3VABJH.mjs +0 -52
- package/dist/lib/node-esm/install-function-ST3VABJH.mjs.map +0 -7
- package/dist/lib/node-esm/invoke-64WDU55Y.mjs +0 -34
- package/dist/lib/node-esm/invoke-64WDU55Y.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/operations/index.mjs +0 -15
- package/dist/lib/node-esm/operations/index.mjs.map +0 -7
- package/dist/lib/node-esm/query-deployed-functions-2VCNGQ7X.mjs +0 -31
- package/dist/lib/node-esm/query-deployed-functions-2VCNGQ7X.mjs.map +0 -7
- package/dist/lib/node-esm/read-PECQUAPS.mjs +0 -27
- package/dist/lib/node-esm/read-PECQUAPS.mjs.map +0 -7
- package/dist/lib/node-esm/templates/index.mjs +0 -11
- package/dist/lib/node-esm/translations.mjs +0 -105
- package/dist/lib/node-esm/translations.mjs.map +0 -7
- package/dist/lib/node-esm/types/index.mjs +0 -15
- package/dist/lib/node-esm/update-XDFTGSPP.mjs +0 -64
- package/dist/lib/node-esm/update-XDFTGSPP.mjs.map +0 -7
- package/dist/types/src/containers/NotebookContainer/NotebookContainer.d.ts +0 -7
- package/dist/types/src/containers/NotebookContainer/NotebookContainer.d.ts.map +0 -1
- package/dist/types/src/containers/NotebookContainer/NotebookContainer.stories.d.ts +0 -7
- package/dist/types/src/containers/NotebookContainer/NotebookContainer.stories.d.ts.map +0 -1
- package/dist/types/src/containers/NotebookContainer/index.d.ts +0 -2
- package/dist/types/src/containers/NotebookContainer/index.d.ts.map +0 -1
- package/dist/types/src/containers/ScriptContainer/ScriptContainer.d.ts.map +0 -1
- package/dist/types/src/containers/ScriptContainer/ScriptContainer.stories.d.ts.map +0 -1
- package/dist/types/src/containers/ScriptContainer/index.d.ts +0 -2
- package/dist/types/src/operations/definitions.d.ts.map +0 -1
- package/dist/types/src/types/capabilities.d.ts +0 -9
- package/dist/types/src/types/capabilities.d.ts.map +0 -1
- package/dist/types/src/types/events.d.ts +0 -5
- package/dist/types/src/types/events.d.ts.map +0 -1
- package/src/containers/NotebookContainer/index.ts +0 -5
- package/src/containers/ScriptContainer/index.ts +0 -5
- package/src/types/capabilities.ts +0 -17
- package/src/types/events.ts +0 -11
- /package/dist/lib/{browser → neutral}/DeploymentDialog-6DBF3V6C.mjs +0 -0
- /package/dist/lib/{browser → neutral}/DeploymentDialog-6DBF3V6C.mjs.map +0 -0
- /package/dist/lib/{browser/templates → neutral/blueprints}/index.mjs.map +0 -0
- /package/dist/lib/{browser → neutral}/chunk-J5LGTIGS.mjs +0 -0
- /package/dist/lib/{browser → neutral}/chunk-J5LGTIGS.mjs.map +0 -0
- /package/dist/lib/{browser → neutral}/chunk-MI6X5CTJ.mjs +0 -0
- /package/dist/lib/{browser → neutral}/chunk-MI6X5CTJ.mjs.map +0 -0
- /package/dist/lib/{browser → neutral}/delete-PAUWA2QM.mjs +0 -0
- /package/dist/lib/{browser → neutral}/delete-PAUWA2QM.mjs.map +0 -0
- /package/dist/lib/{browser/types → neutral}/index.mjs.map +0 -0
- /package/dist/lib/{node-esm/chunk-HSLMI22Q.mjs.map → neutral/meta.mjs.map} +0 -0
- /package/dist/lib/{node-esm/templates → neutral/operations}/index.mjs.map +0 -0
- /package/dist/lib/{browser → neutral}/read-FFOSK6A3.mjs +0 -0
- /package/dist/lib/{browser → neutral}/read-FFOSK6A3.mjs.map +0 -0
- /package/dist/lib/{node-esm/types → neutral/templates}/index.mjs.map +0 -0
- /package/dist/lib/{browser → neutral}/translations.mjs +0 -0
- /package/dist/lib/{browser → neutral}/translations.mjs.map +0 -0
- /package/dist/lib/{browser → neutral}/update-PJS5GG3Y.mjs +0 -0
- /package/dist/lib/{browser → neutral}/update-PJS5GG3Y.mjs.map +0 -0
|
@@ -7,6 +7,7 @@ import * as Effect from 'effect/Effect';
|
|
|
7
7
|
import { ClientService } from '@dxos/client';
|
|
8
8
|
import { Operation } from '@dxos/compute';
|
|
9
9
|
import { Context } from '@dxos/context';
|
|
10
|
+
import { Obj } from '@dxos/echo';
|
|
10
11
|
import { FunctionsServiceClient } from '@dxos/functions-runtime/edge';
|
|
11
12
|
|
|
12
13
|
import { QueryDeployedFunctions } from './definitions';
|
|
@@ -18,13 +19,16 @@ export default QueryDeployedFunctions.pipe(
|
|
|
18
19
|
const functionsService = FunctionsServiceClient.fromClient(client);
|
|
19
20
|
const deployed = yield* Effect.promise(() => functionsService.query(Context.default()));
|
|
20
21
|
return {
|
|
21
|
-
functions: deployed.map((fn) =>
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
functions: deployed.map((fn) => {
|
|
23
|
+
const meta = Obj.getMeta(fn);
|
|
24
|
+
return {
|
|
25
|
+
key: meta.key,
|
|
26
|
+
name: fn.name ?? 'Unnamed function',
|
|
27
|
+
version: meta.version ?? '0.0.0',
|
|
28
|
+
description: fn.description,
|
|
29
|
+
updated: fn.updated,
|
|
30
|
+
};
|
|
31
|
+
}),
|
|
28
32
|
};
|
|
29
33
|
}),
|
|
30
34
|
),
|
|
@@ -14,7 +14,7 @@ import { ArtifactId, createArtifactElement } from '@dxos/assistant';
|
|
|
14
14
|
import { defineArtifact, ScriptType } from '@dxos/compute';
|
|
15
15
|
import { Filter, Obj, Ref } from '@dxos/echo';
|
|
16
16
|
import { invariant } from '@dxos/invariant';
|
|
17
|
-
import { SpaceAction } from '@dxos/plugin-space
|
|
17
|
+
import { SpaceAction } from '@dxos/plugin-space';
|
|
18
18
|
import { type Space } from '@dxos/react-client/echo';
|
|
19
19
|
|
|
20
20
|
import { meta } from '#meta';
|
|
@@ -159,7 +159,7 @@ export default Capability.makeModule(() =>
|
|
|
159
159
|
execute: async ({ name, code }, { extensions }) => {
|
|
160
160
|
invariant(extensions?.space, 'No space');
|
|
161
161
|
invariant(extensions?.dispatch, 'No intent dispatcher');
|
|
162
|
-
const script = Obj.make(ScriptType, { name, source: Ref.make(Text.make(code)) });
|
|
162
|
+
const script = Obj.make(ScriptType, { name, source: Ref.make(Text.make({ content: code })) });
|
|
163
163
|
extensions.space.db.add(script);
|
|
164
164
|
await extensions.space.db.flush();
|
|
165
165
|
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capability } from '@dxos/app-framework';
|
|
8
|
+
import { Operation, Script } from '@dxos/compute';
|
|
9
|
+
import { SpaceOperation } from '@dxos/plugin-space';
|
|
10
|
+
import { SpaceCapabilities } from '@dxos/plugin-space';
|
|
11
|
+
|
|
12
|
+
import { ScriptOperation } from '#types';
|
|
13
|
+
import { Notebook } from '#types';
|
|
14
|
+
|
|
15
|
+
export default Capability.makeModule(
|
|
16
|
+
Effect.fnUntraced(function* () {
|
|
17
|
+
return [
|
|
18
|
+
Capability.contributes(SpaceCapabilities.CreateObjectEntry, {
|
|
19
|
+
id: Script.Script.typename,
|
|
20
|
+
inputSchema: ScriptOperation.ScriptProps,
|
|
21
|
+
createObject: (props, options) =>
|
|
22
|
+
Effect.gen(function* () {
|
|
23
|
+
const { object } = yield* Operation.invoke(ScriptOperation.CreateScript, props);
|
|
24
|
+
return yield* Operation.invoke(SpaceOperation.AddObject, {
|
|
25
|
+
object,
|
|
26
|
+
target: options.target,
|
|
27
|
+
hidden: true,
|
|
28
|
+
targetNodeId: options.targetNodeId,
|
|
29
|
+
});
|
|
30
|
+
}),
|
|
31
|
+
}),
|
|
32
|
+
Capability.contributes(SpaceCapabilities.CreateObjectEntry, {
|
|
33
|
+
id: Notebook.Notebook.typename,
|
|
34
|
+
inputSchema: ScriptOperation.NotebookProps,
|
|
35
|
+
createObject: (props, options) =>
|
|
36
|
+
Effect.gen(function* () {
|
|
37
|
+
const object = Notebook.make(props);
|
|
38
|
+
return yield* Operation.invoke(SpaceOperation.AddObject, {
|
|
39
|
+
object,
|
|
40
|
+
target: options.target,
|
|
41
|
+
hidden: true,
|
|
42
|
+
targetNodeId: options.targetNodeId,
|
|
43
|
+
});
|
|
44
|
+
}),
|
|
45
|
+
}),
|
|
46
|
+
];
|
|
47
|
+
}),
|
|
48
|
+
);
|
|
@@ -8,6 +8,7 @@ import type { Blueprint, OperationHandlerSet } from '@dxos/compute';
|
|
|
8
8
|
|
|
9
9
|
export const AppGraphBuilder = Capability.lazy('AppGraphBuilder', () => import('./app-graph-builder'));
|
|
10
10
|
export const BlueprintDefinition = Capability.lazy('BlueprintDefinition', () => import('./blueprint-definition'));
|
|
11
|
+
export const CreateObject = Capability.lazy('CreateObject', () => import('./create-object'));
|
|
11
12
|
export const Compiler = Capability.lazy('Compiler', () => import('./compiler'));
|
|
12
13
|
export const OperationHandler = Capability.lazy<OperationHandlerSet.OperationHandlerSet>(
|
|
13
14
|
'OperationHandler',
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Capability } from '@dxos/app-framework';
|
|
6
|
+
// eslint-disable-next-line unused-imports/no-unused-imports
|
|
7
|
+
import type { Blueprint, OperationHandlerSet } from '@dxos/compute';
|
|
8
|
+
|
|
9
|
+
export const AppGraphBuilder = Capability.lazy('AppGraphBuilder', () => import('./app-graph-builder'));
|
|
10
|
+
export const BlueprintDefinition = Capability.lazy('BlueprintDefinition', () => import('./blueprint-definition'));
|
|
11
|
+
export const CreateObject = Capability.lazy('CreateObject', () => import('./create-object'));
|
|
12
|
+
export const Compiler = Capability.lazy('Compiler', () => import('./compiler'));
|
|
13
|
+
export const OperationHandler = Capability.lazy<OperationHandlerSet.OperationHandlerSet>(
|
|
14
|
+
'OperationHandler',
|
|
15
|
+
() => import('./operation-handler'),
|
|
16
|
+
);
|
|
@@ -16,7 +16,7 @@ import { getSpace } from '@dxos/react-client/echo';
|
|
|
16
16
|
import { Panel } from '@dxos/react-ui';
|
|
17
17
|
|
|
18
18
|
import { ScriptPluginSettings } from '#components';
|
|
19
|
-
import { DeploymentDialog,
|
|
19
|
+
import { DeploymentDialog, NotebookArticle, ScriptArticle, ScriptProperties, TestContainer } from '#containers';
|
|
20
20
|
import { useCompiler } from '#hooks';
|
|
21
21
|
import { meta } from '#meta';
|
|
22
22
|
import { Notebook, ScriptCapabilities, type Settings } from '#types';
|
|
@@ -58,7 +58,7 @@ export default Capability.makeModule(() =>
|
|
|
58
58
|
const compiler = useCompiler();
|
|
59
59
|
const settings = useAtomCapability(ScriptCapabilities.Settings);
|
|
60
60
|
return (
|
|
61
|
-
<
|
|
61
|
+
<ScriptArticle
|
|
62
62
|
role={role}
|
|
63
63
|
subject={data.subject}
|
|
64
64
|
attendableId={data.attendableId}
|
|
@@ -74,7 +74,7 @@ export default Capability.makeModule(() =>
|
|
|
74
74
|
component: ({ data, role }) => {
|
|
75
75
|
const compiler = useCompiler();
|
|
76
76
|
return (
|
|
77
|
-
<
|
|
77
|
+
<NotebookArticle
|
|
78
78
|
role={role}
|
|
79
79
|
subject={data.subject}
|
|
80
80
|
attendableId={data.attendableId}
|
|
@@ -105,13 +105,13 @@ export default Capability.makeModule(() =>
|
|
|
105
105
|
component: ({ data, role }) => {
|
|
106
106
|
const space = getSpace(data.companionTo);
|
|
107
107
|
const feed = space?.properties.invocationTraceFeed?.target;
|
|
108
|
-
const
|
|
108
|
+
const feedDXN = feed ? Feed.getQueueDxn(feed) : undefined;
|
|
109
109
|
return (
|
|
110
110
|
<Panel.Root role={role}>
|
|
111
111
|
<Panel.Content>
|
|
112
112
|
<InvocationTraceContainer
|
|
113
113
|
db={space?.db}
|
|
114
|
-
|
|
114
|
+
feedDXN={feedDXN}
|
|
115
115
|
target={data.companionTo}
|
|
116
116
|
detailAxis='block'
|
|
117
117
|
/>
|
package/src/compiler/compiler.ts
CHANGED
|
@@ -24,6 +24,10 @@ const CDN_TS_VERSION = '5.6.3';
|
|
|
24
24
|
const defaultOptions: ts.CompilerOptions = {
|
|
25
25
|
lib: ['DOM', 'es2022'],
|
|
26
26
|
target: ts.ScriptTarget.ES2022,
|
|
27
|
+
// Override `@typescript/vfs`'s default of `NodeJs` (== deprecated `node10`).
|
|
28
|
+
// TypeScript 6 throws on that as a `getCompilerOptionsDiagnostics()` error,
|
|
29
|
+
// which surfaces as an unhandled rejection inside the storybook task.
|
|
30
|
+
moduleResolution: ts.ModuleResolutionKind.Bundler,
|
|
27
31
|
};
|
|
28
32
|
|
|
29
33
|
export class Compiler {
|
|
@@ -7,8 +7,8 @@ import * as Effect from 'effect/Effect';
|
|
|
7
7
|
import React, { useMemo } from 'react';
|
|
8
8
|
|
|
9
9
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
10
|
-
import { AutomationPlugin } from '@dxos/plugin-automation';
|
|
11
|
-
import { ClientPlugin } from '@dxos/plugin-client';
|
|
10
|
+
import { AutomationPlugin } from '@dxos/plugin-automation/testing';
|
|
11
|
+
import { ClientPlugin } from '@dxos/plugin-client/testing';
|
|
12
12
|
import { initializeIdentity } from '@dxos/plugin-client/testing';
|
|
13
13
|
import { corePlugins } from '@dxos/plugin-testing';
|
|
14
14
|
import { withLayout } from '@dxos/react-ui/testing';
|
|
@@ -69,7 +69,7 @@ const DefaultStory = (props: QueryEditorProps) => {
|
|
|
69
69
|
</Toolbar.Root>
|
|
70
70
|
</Panel.Toolbar>
|
|
71
71
|
<Panel.Content>
|
|
72
|
-
<div
|
|
72
|
+
<div className='grid grid-rows-[1fr_min-content] h-full overflow-hidden text-sm'>
|
|
73
73
|
<QueryEditor {...props} initialValue={object.content} extensions={extensions} />
|
|
74
74
|
<JsonHighlighter data={result} classNames='shrink-0 p-2 border-y border-subdued-separator' />
|
|
75
75
|
</div>
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import React, { useState } from 'react';
|
|
6
|
-
import { ScriptTarget } from 'typescript';
|
|
6
|
+
import { ModuleResolutionKind, ScriptTarget } from 'typescript';
|
|
7
7
|
|
|
8
8
|
import queryApi from '@dxos/echo-query/api.d.ts?raw';
|
|
9
9
|
import { useAsyncEffect } from '@dxos/react-ui';
|
|
@@ -34,6 +34,8 @@ export const QueryEditor = (props: QueryEditorProps) => {
|
|
|
34
34
|
const compiler = new Compiler({
|
|
35
35
|
lib: ['ES5'],
|
|
36
36
|
target: ScriptTarget.ES2022,
|
|
37
|
+
// Avoid `@typescript/vfs`'s deprecated `node10` default (rejected by TS 6).
|
|
38
|
+
moduleResolution: ModuleResolutionKind.Bundler,
|
|
37
39
|
});
|
|
38
40
|
await compiler.initialize(GLOBALS);
|
|
39
41
|
setCompiler(compiler);
|
|
@@ -9,7 +9,7 @@ import React, { useMemo } from 'react';
|
|
|
9
9
|
import { OperationPlugin, RuntimePlugin } from '@dxos/app-framework';
|
|
10
10
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
11
11
|
import { Script } from '@dxos/compute';
|
|
12
|
-
import { ClientPlugin } from '@dxos/plugin-client';
|
|
12
|
+
import { ClientPlugin } from '@dxos/plugin-client/testing';
|
|
13
13
|
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
14
14
|
|
|
15
15
|
import { type ScriptToolbarState, type ScriptToolbarStateStore } from '#hooks';
|
|
@@ -72,7 +72,7 @@ const DefaultStory = (props: TypescriptEditorProps) => {
|
|
|
72
72
|
</Toolbar.Root>
|
|
73
73
|
</Panel.Toolbar>
|
|
74
74
|
<Panel.Content>
|
|
75
|
-
<div
|
|
75
|
+
<div className='grid grid-rows-[1fr_min-content] h-full overflow-hidden text-sm'>
|
|
76
76
|
<TypescriptEditor {...props} initialValue={object.content} extensions={extensions} />
|
|
77
77
|
<JsonHighlighter data={result} classNames='shrink-0 p-2 border-y border-subdued-separator' />
|
|
78
78
|
</div>
|
|
@@ -8,7 +8,7 @@ import React, { useMemo } from 'react';
|
|
|
8
8
|
import { OperationPlugin, RuntimePlugin } from '@dxos/app-framework';
|
|
9
9
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
10
10
|
import { Obj } from '@dxos/echo';
|
|
11
|
-
import { ClientPlugin } from '@dxos/plugin-client';
|
|
11
|
+
import { ClientPlugin } from '@dxos/plugin-client/testing';
|
|
12
12
|
import { Dialog } from '@dxos/react-ui';
|
|
13
13
|
import { withTheme } from '@dxos/react-ui/testing';
|
|
14
14
|
import { AccessToken } from '@dxos/types';
|
|
@@ -11,13 +11,13 @@ import { withPluginManager } from '@dxos/app-framework/testing';
|
|
|
11
11
|
import { AgentPrompt } from '@dxos/assistant-toolkit';
|
|
12
12
|
import { Operation } from '@dxos/compute';
|
|
13
13
|
import { Filter } from '@dxos/echo';
|
|
14
|
-
import { AssistantPlugin } from '@dxos/plugin-assistant';
|
|
15
|
-
import { AutomationPlugin } from '@dxos/plugin-automation';
|
|
16
|
-
import { ClientPlugin } from '@dxos/plugin-client';
|
|
14
|
+
import { AssistantPlugin } from '@dxos/plugin-assistant/testing';
|
|
15
|
+
import { AutomationPlugin } from '@dxos/plugin-automation/testing';
|
|
16
|
+
import { ClientPlugin } from '@dxos/plugin-client/testing';
|
|
17
17
|
import { initializeIdentity } from '@dxos/plugin-client/testing';
|
|
18
|
-
import { ExplorerPlugin } from '@dxos/plugin-explorer';
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
18
|
+
import { ExplorerPlugin } from '@dxos/plugin-explorer/testing';
|
|
19
|
+
import { Markdown } from '@dxos/plugin-markdown';
|
|
20
|
+
import { MarkdownPlugin } from '@dxos/plugin-markdown/testing';
|
|
21
21
|
import { corePlugins } from '@dxos/plugin-testing';
|
|
22
22
|
import { Config, useClient } from '@dxos/react-client';
|
|
23
23
|
import { useQuery } from '@dxos/react-client/echo';
|
|
@@ -28,16 +28,16 @@ import { createNotebook } from '#testing';
|
|
|
28
28
|
import { translations } from '#translations';
|
|
29
29
|
import { Notebook } from '#types';
|
|
30
30
|
|
|
31
|
-
import {
|
|
31
|
+
import { NotebookArticle } from './NotebookArticle';
|
|
32
32
|
|
|
33
|
-
const meta: Meta<typeof
|
|
34
|
-
title: 'plugins/plugin-script/containers/
|
|
35
|
-
component:
|
|
33
|
+
const meta: Meta<typeof NotebookArticle> = {
|
|
34
|
+
title: 'plugins/plugin-script/containers/NotebookArticle',
|
|
35
|
+
component: NotebookArticle,
|
|
36
36
|
render: (args) => {
|
|
37
37
|
const client = useClient();
|
|
38
38
|
const space = client.spaces.get()[0];
|
|
39
39
|
const notebooks = useQuery(space?.db, Filter.type(Notebook.Notebook));
|
|
40
|
-
return <
|
|
40
|
+
return <NotebookArticle {...args} subject={notebooks[0]} attendableId='test' />;
|
|
41
41
|
},
|
|
42
42
|
decorators: [
|
|
43
43
|
withLayout({ layout: 'column', classNames: 'w-document-max-width' }),
|
|
@@ -18,7 +18,7 @@ import { QueryBuilder } from '@dxos/echo-query';
|
|
|
18
18
|
import { invariant } from '@dxos/invariant';
|
|
19
19
|
import { log } from '@dxos/log';
|
|
20
20
|
import { useComputeRuntimeCallback } from '@dxos/plugin-automation/hooks';
|
|
21
|
-
import { Graph } from '@dxos/plugin-explorer
|
|
21
|
+
import { Graph } from '@dxos/plugin-explorer';
|
|
22
22
|
import { DropdownMenu, IconButton, Panel, Toolbar, useTranslation } from '@dxos/react-ui';
|
|
23
23
|
import { useAttention } from '@dxos/react-ui-attention';
|
|
24
24
|
import { Text, ViewModel } from '@dxos/schema';
|
|
@@ -38,12 +38,9 @@ const INCLUDE_BLUEPRINTS = [
|
|
|
38
38
|
|
|
39
39
|
// TODO(burdon): Support calling named deployed functions (as with sheet).
|
|
40
40
|
|
|
41
|
-
export type
|
|
42
|
-
Notebook.Notebook,
|
|
43
|
-
Pick<TypescriptEditorProps, 'env'>
|
|
44
|
-
>;
|
|
41
|
+
export type NotebookArticleProps = AppSurface.ObjectArticleProps<Notebook.Notebook, Pick<TypescriptEditorProps, 'env'>>;
|
|
45
42
|
|
|
46
|
-
export const
|
|
43
|
+
export const NotebookArticle = ({ role, subject: notebook, attendableId, env }: NotebookArticleProps) => {
|
|
47
44
|
const { t } = useTranslation(meta.id);
|
|
48
45
|
const registry = useContext(RegistryContext);
|
|
49
46
|
const db = Obj.getDatabase(notebook);
|
|
@@ -163,7 +160,10 @@ export const NotebookContainer = ({ role, subject: notebook, attendableId, env }
|
|
|
163
160
|
if (db) {
|
|
164
161
|
const objects = await db.query(Query.select(Filter.type(Blueprint.Blueprint))).run();
|
|
165
162
|
const blueprints = objects
|
|
166
|
-
.filter((blueprint) =>
|
|
163
|
+
.filter((blueprint) => {
|
|
164
|
+
const key = Obj.getMeta(blueprint).key;
|
|
165
|
+
return key !== undefined && INCLUDE_BLUEPRINTS.includes(key);
|
|
166
|
+
})
|
|
167
167
|
.map((blueprint) => Ref.make(blueprint));
|
|
168
168
|
cell.prompt = Ref.make(Routine.make({ instructions: '', blueprints }));
|
|
169
169
|
}
|
|
@@ -11,18 +11,19 @@ import { withPluginManager } from '@dxos/app-framework/testing';
|
|
|
11
11
|
import { Blueprint } from '@dxos/compute';
|
|
12
12
|
import { Script } from '@dxos/compute';
|
|
13
13
|
import { Operation } from '@dxos/compute';
|
|
14
|
-
import {
|
|
14
|
+
import { Filter } from '@dxos/echo';
|
|
15
|
+
import { ClientPlugin } from '@dxos/plugin-client/testing';
|
|
15
16
|
import { initializeIdentity } from '@dxos/plugin-client/testing';
|
|
16
17
|
import { StorybookPlugin, corePlugins } from '@dxos/plugin-testing';
|
|
17
18
|
import { Config } from '@dxos/react-client';
|
|
18
|
-
import {
|
|
19
|
+
import { useQuery, useSpaces } from '@dxos/react-client/echo';
|
|
19
20
|
import { Loading, withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
20
21
|
import { Text } from '@dxos/schema';
|
|
21
22
|
|
|
22
23
|
import { createScript } from '#testing';
|
|
23
24
|
import { translations } from '#translations';
|
|
24
25
|
|
|
25
|
-
import {
|
|
26
|
+
import { ScriptArticle } from './ScriptArticle';
|
|
26
27
|
|
|
27
28
|
type DefaultStoryProps = {};
|
|
28
29
|
|
|
@@ -58,14 +59,14 @@ const DefaultStory = (_: DefaultStoryProps) => {
|
|
|
58
59
|
}
|
|
59
60
|
|
|
60
61
|
return (
|
|
61
|
-
<div
|
|
62
|
-
<
|
|
62
|
+
<div className='flex flex-col min-h-[80vh] w-document-max-width'>
|
|
63
|
+
<ScriptArticle role='article' subject={script} attendableId='story-script' />
|
|
63
64
|
</div>
|
|
64
65
|
);
|
|
65
66
|
};
|
|
66
67
|
|
|
67
68
|
const meta = {
|
|
68
|
-
title: 'plugins/plugin-script/containers/
|
|
69
|
+
title: 'plugins/plugin-script/containers/ScriptArticle',
|
|
69
70
|
render: DefaultStory,
|
|
70
71
|
decorators: [
|
|
71
72
|
withTheme(),
|
|
@@ -28,7 +28,8 @@ export const BlueprintEditor = ({ object }: BlueprintEditorProps) => {
|
|
|
28
28
|
// TODO(burdon): Remove?
|
|
29
29
|
const [instructions, setInstructions] = useState<string>(`You can run the script "${object.name ?? 'script'}".`);
|
|
30
30
|
const blueprintKey = `org.dxos.blueprint.${kebabize(object.name ?? 'script')}`;
|
|
31
|
-
const existingBlueprint = blueprints.find((bp) => bp.key === blueprintKey);
|
|
31
|
+
const existingBlueprint = blueprints.find((bp) => Obj.getMeta(bp).key === blueprintKey);
|
|
32
|
+
const fnKey = fn ? Obj.getMeta(fn).key : undefined;
|
|
32
33
|
|
|
33
34
|
useAsyncEffect(async () => {
|
|
34
35
|
if (!existingBlueprint) {
|
|
@@ -52,21 +53,21 @@ export const BlueprintEditor = ({ object }: BlueprintEditorProps) => {
|
|
|
52
53
|
text.content = instructions;
|
|
53
54
|
});
|
|
54
55
|
|
|
55
|
-
if (
|
|
56
|
-
const toolId = ToolId.make(
|
|
56
|
+
if (fnKey) {
|
|
57
|
+
const toolId = ToolId.make(fnKey);
|
|
57
58
|
if (!existingBlueprint.tools?.includes(toolId)) {
|
|
58
59
|
Obj.update(existingBlueprint, (existingBlueprint) => {
|
|
59
60
|
existingBlueprint.tools = [...(existingBlueprint.tools ?? []), toolId];
|
|
60
61
|
});
|
|
61
62
|
}
|
|
62
63
|
}
|
|
63
|
-
} else if (
|
|
64
|
+
} else if (fnKey) {
|
|
64
65
|
db.add(
|
|
65
66
|
Blueprint.make({
|
|
66
67
|
key: blueprintKey,
|
|
67
68
|
name: object.name ?? 'Script',
|
|
68
69
|
instructions: Template.make({ source: instructions }),
|
|
69
|
-
tools: [ToolId.make(
|
|
70
|
+
tools: [ToolId.make(fnKey)],
|
|
70
71
|
}),
|
|
71
72
|
);
|
|
72
73
|
}
|
|
@@ -74,10 +75,10 @@ export const BlueprintEditor = ({ object }: BlueprintEditorProps) => {
|
|
|
74
75
|
} finally {
|
|
75
76
|
setCreating(false);
|
|
76
77
|
}
|
|
77
|
-
}, [db, existingBlueprint,
|
|
78
|
+
}, [db, existingBlueprint, fnKey, blueprintKey, object.name, instructions]);
|
|
78
79
|
|
|
79
80
|
return (
|
|
80
|
-
<div
|
|
81
|
+
<div className='flex flex-col'>
|
|
81
82
|
<Form.Section label={t('blueprint-editor.label')} description={t('blueprint-editor.description')} />
|
|
82
83
|
|
|
83
84
|
<Input.Root>
|
|
@@ -91,8 +92,8 @@ export const BlueprintEditor = ({ object }: BlueprintEditorProps) => {
|
|
|
91
92
|
/>
|
|
92
93
|
</Input.Root>
|
|
93
94
|
|
|
94
|
-
<div
|
|
95
|
-
<Button disabled={(!existingBlueprint && !
|
|
95
|
+
<div className='pt-2'>
|
|
96
|
+
<Button disabled={(!existingBlueprint && !fnKey) || creating} onClick={handleSave}>
|
|
96
97
|
{t(existingBlueprint ? 'update-blueprint.label' : 'create-blueprint.label')}
|
|
97
98
|
</Button>
|
|
98
99
|
</div>
|
|
@@ -50,7 +50,7 @@ export const FunctionBinding = ({ object }: FunctionBindingProps) => {
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
return (
|
|
53
|
-
<div
|
|
53
|
+
<div className='flex flex-col'>
|
|
54
54
|
<Form.Section label={t('remote-function-settings.heading')} />
|
|
55
55
|
|
|
56
56
|
{functionUrl && (
|
|
@@ -94,22 +94,22 @@ export const FunctionPublishing = ({ object }: FunctionPublishingProps) => {
|
|
|
94
94
|
}, [object, githubToken]);
|
|
95
95
|
|
|
96
96
|
return (
|
|
97
|
-
<div
|
|
97
|
+
<div className='flex flex-col'>
|
|
98
98
|
<Form.Section label={t('script-publish-settings.label')} description={t('script-publish-settings.description')} />
|
|
99
99
|
|
|
100
100
|
{!githubToken && (
|
|
101
|
-
<div
|
|
101
|
+
<div className='flex flex-col py-form-gap'>
|
|
102
102
|
<Message.Root valence='info'>
|
|
103
103
|
<Message.Title>{t('no-github-token.label')}</Message.Title>
|
|
104
104
|
</Message.Root>
|
|
105
|
-
<div
|
|
105
|
+
<div className='flex pt-form-gap'>
|
|
106
106
|
<Button onClick={handleOpenTokenManager}>{t('open-token-manager.label')}</Button>
|
|
107
107
|
</div>
|
|
108
108
|
</div>
|
|
109
109
|
)}
|
|
110
110
|
|
|
111
111
|
{githubToken && (
|
|
112
|
-
<div
|
|
112
|
+
<div className='flex justify-end gap-2'>
|
|
113
113
|
{gistUrl && <Clipboard.IconButton value={gistUrl} />}
|
|
114
114
|
<Button disabled={publishing} onClick={handlePublish}>
|
|
115
115
|
{t('publish.label')}
|
|
@@ -10,10 +10,11 @@ import { withPluginManager } from '@dxos/app-framework/testing';
|
|
|
10
10
|
import { Blueprint } from '@dxos/compute';
|
|
11
11
|
import { Script } from '@dxos/compute';
|
|
12
12
|
import { Operation } from '@dxos/compute';
|
|
13
|
-
import {
|
|
13
|
+
import { Filter } from '@dxos/echo';
|
|
14
|
+
import { ClientPlugin } from '@dxos/plugin-client/testing';
|
|
14
15
|
import { initializeIdentity } from '@dxos/plugin-client/testing';
|
|
15
16
|
import { StorybookPlugin, corePlugins } from '@dxos/plugin-testing';
|
|
16
|
-
import {
|
|
17
|
+
import { useQuery, useSpaces } from '@dxos/react-client/echo';
|
|
17
18
|
import { ObjectProperties } from '@dxos/react-ui-form';
|
|
18
19
|
import { Loading, withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
19
20
|
import { Text } from '@dxos/schema';
|
|
@@ -15,7 +15,7 @@ export type ScriptPropertiesProps = AppSurface.ObjectPropertiesProps<Script.Scri
|
|
|
15
15
|
|
|
16
16
|
export const ScriptProperties = ({ subject: object }: ScriptPropertiesProps) => {
|
|
17
17
|
return (
|
|
18
|
-
<div
|
|
18
|
+
<div className='flex flex-col py-form-gap gap-form-section-gap'>
|
|
19
19
|
<FunctionBinding object={object} />
|
|
20
20
|
<BlueprintEditor object={object} />
|
|
21
21
|
<FunctionPublishing object={object} />
|
|
@@ -6,8 +6,8 @@ import React, { useCallback, useMemo } from 'react';
|
|
|
6
6
|
|
|
7
7
|
import { type Script } from '@dxos/compute';
|
|
8
8
|
import { Context } from '@dxos/context';
|
|
9
|
+
import { Obj } from '@dxos/echo';
|
|
9
10
|
import { FunctionsServiceClient } from '@dxos/functions-runtime/edge';
|
|
10
|
-
import { getSpace } from '@dxos/react-client/echo';
|
|
11
11
|
import { Panel } from '@dxos/react-ui';
|
|
12
12
|
|
|
13
13
|
import { TestPanel } from '#components';
|
|
@@ -20,7 +20,7 @@ export type TestContainerProps = {
|
|
|
20
20
|
|
|
21
21
|
export const TestContainer = ({ role, script }: TestContainerProps) => {
|
|
22
22
|
const { client, fn, existingFunctionId } = useDeployDeps({ script });
|
|
23
|
-
const
|
|
23
|
+
const spaceId = Obj.getDatabase(script)?.spaceId;
|
|
24
24
|
|
|
25
25
|
const functionsClient = useMemo(() => FunctionsServiceClient.fromClient(client), [client]);
|
|
26
26
|
|
|
@@ -29,9 +29,9 @@ export const TestContainer = ({ role, script }: TestContainerProps) => {
|
|
|
29
29
|
if (!fn) {
|
|
30
30
|
throw new Error('Function not deployed');
|
|
31
31
|
}
|
|
32
|
-
return functionsClient.invoke(Context.default(), fn, input, { spaceId
|
|
32
|
+
return functionsClient.invoke(Context.default(), fn, input, { spaceId });
|
|
33
33
|
},
|
|
34
|
-
[fn, functionsClient,
|
|
34
|
+
[fn, functionsClient, spaceId],
|
|
35
35
|
);
|
|
36
36
|
|
|
37
37
|
return (
|
package/src/containers/index.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { type ComponentType, lazy } from 'react';
|
|
6
6
|
|
|
7
7
|
export const DeploymentDialog: ComponentType<any> = lazy(() => import('./DeploymentDialog'));
|
|
8
|
-
export const
|
|
9
|
-
export const
|
|
8
|
+
export const NotebookArticle: ComponentType<any> = lazy(() => import('./NotebookArticle'));
|
|
9
|
+
export const ScriptArticle: ComponentType<any> = lazy(() => import('./ScriptArticle'));
|
|
10
10
|
export const ScriptProperties: ComponentType<any> = lazy(() => import('./ScriptProperties'));
|
|
11
11
|
export const TestContainer: ComponentType<any> = lazy(() => import('./TestContainer'));
|
package/src/e2e/deploy.test.ts
CHANGED
|
@@ -14,7 +14,9 @@ import { FunctionsServiceClient } from '@dxos/functions-runtime/edge';
|
|
|
14
14
|
import { invariant } from '@dxos/invariant';
|
|
15
15
|
import { log } from '@dxos/log';
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
// TODO(wittjosiah): Re-enable once @dxos/compute.js is available at the R2 dev bucket
|
|
18
|
+
// (https://pub-5745ae82e450484aa28f75fc6a175935.r2.dev/dev/@dxos/compute.js currently 404s).
|
|
19
|
+
describe.skip('Functions deployment', { tags: ['functions-e2e'] }, () => {
|
|
18
20
|
test('deploys FOREX (effect) function and invokes it via EDGE (main)', { timeout: 120_000 }, async () => {
|
|
19
21
|
const config = configPreset({ edge: 'main' });
|
|
20
22
|
await testDeploy(config);
|
|
@@ -8,11 +8,11 @@ import { useOperationInvoker } from '@dxos/app-framework/ui';
|
|
|
8
8
|
import { Script } from '@dxos/compute';
|
|
9
9
|
import { Obj } from '@dxos/echo';
|
|
10
10
|
import { invariant } from '@dxos/invariant';
|
|
11
|
-
import { SpaceOperation } from '@dxos/plugin-space
|
|
11
|
+
import { SpaceOperation } from '@dxos/plugin-space';
|
|
12
12
|
import { useClient } from '@dxos/react-client';
|
|
13
13
|
import { type Space } from '@dxos/react-client/echo';
|
|
14
14
|
|
|
15
|
-
import { ScriptOperation } from '#
|
|
15
|
+
import { ScriptOperation } from '#types';
|
|
16
16
|
|
|
17
17
|
import { type Template } from '../templates';
|
|
18
18
|
import { deployScript } from '../util';
|
package/src/index.ts
CHANGED
|
@@ -2,12 +2,7 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import { meta } from './meta';
|
|
8
|
-
|
|
9
|
-
export const ScriptPlugin = Plugin.lazy(meta, () => import('#plugin'));
|
|
10
|
-
|
|
11
|
-
export { ScriptCapabilities, ScriptEvents } from './types';
|
|
5
|
+
export * from './blueprints';
|
|
12
6
|
export * from './meta';
|
|
7
|
+
export * from './types';
|
|
13
8
|
export * from './util';
|
|
@@ -7,7 +7,7 @@ import * as Predicate from 'effect/Predicate';
|
|
|
7
7
|
|
|
8
8
|
import { LayoutOperation } from '@dxos/app-toolkit';
|
|
9
9
|
import { Operation } from '@dxos/compute';
|
|
10
|
-
import { IntegrationOperation } from '@dxos/plugin-integration
|
|
10
|
+
import { IntegrationOperation } from '@dxos/plugin-integration';
|
|
11
11
|
|
|
12
12
|
import { defaultScriptsForIntegration } from '#meta';
|
|
13
13
|
|
|
@@ -8,9 +8,9 @@ import * as Effect from 'effect/Effect';
|
|
|
8
8
|
import { Script, Operation } from '@dxos/compute';
|
|
9
9
|
|
|
10
10
|
import { templates } from '../templates';
|
|
11
|
-
import {
|
|
11
|
+
import { ScriptOperation } from '../types';
|
|
12
12
|
|
|
13
|
-
const handler: Operation.WithHandler<typeof CreateScript> = CreateScript.pipe(
|
|
13
|
+
const handler: Operation.WithHandler<typeof ScriptOperation.CreateScript> = ScriptOperation.CreateScript.pipe(
|
|
14
14
|
Operation.withHandler(
|
|
15
15
|
Effect.fnUntraced(function* ({ name, gistUrl, initialTemplateId }) {
|
|
16
16
|
let source = templates[0].source;
|