@dxos/plugin-script 0.8.4-main.67995b8 → 0.8.4-main.c4373fc
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/dist/lib/browser/DeploymentDialog-7FNPALCV.mjs +12 -0
- package/dist/lib/browser/NotebookContainer-ZSXYRRZB.mjs +578 -0
- package/dist/lib/browser/NotebookContainer-ZSXYRRZB.mjs.map +7 -0
- package/dist/lib/browser/ScriptContainer-24LLLTLB.mjs +149 -0
- package/dist/lib/browser/ScriptContainer-24LLLTLB.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-builder-HLQ7K3BT.mjs → app-graph-builder-DPYULSME.mjs} +9 -8
- package/dist/lib/browser/app-graph-builder-DPYULSME.mjs.map +7 -0
- package/dist/lib/browser/blueprint-definition-ET5KZ46I.mjs +28 -0
- package/dist/lib/browser/blueprint-definition-ET5KZ46I.mjs.map +7 -0
- package/dist/lib/browser/{chunk-3U6DTUH3.mjs → chunk-DXWTBOND.mjs} +26 -27
- package/dist/lib/browser/chunk-DXWTBOND.mjs.map +7 -0
- package/dist/lib/browser/{chunk-FMDXKOP7.mjs → chunk-ETFBQURU.mjs} +71 -50
- package/dist/lib/browser/chunk-ETFBQURU.mjs.map +7 -0
- package/dist/lib/browser/{chunk-QYAREHGH.mjs → chunk-EZVXV6DA.mjs} +3 -5
- package/dist/lib/browser/chunk-EZVXV6DA.mjs.map +7 -0
- package/dist/lib/browser/chunk-I3THDIT5.mjs +90 -0
- package/dist/lib/browser/chunk-I3THDIT5.mjs.map +7 -0
- package/dist/lib/browser/chunk-N6M34EUC.mjs +112 -0
- package/dist/lib/browser/chunk-N6M34EUC.mjs.map +7 -0
- package/dist/lib/browser/{chunk-P4HQKUCP.mjs → chunk-NNYSARXK.mjs} +15 -15
- package/dist/lib/browser/chunk-NNYSARXK.mjs.map +7 -0
- package/dist/lib/browser/{chunk-5TVBECWH.mjs → chunk-OKXN2N7M.mjs} +2 -2
- package/dist/lib/browser/{chunk-FIM2MVNJ.mjs → chunk-SRSEZWDY.mjs} +159 -68
- package/dist/lib/browser/chunk-SRSEZWDY.mjs.map +7 -0
- package/dist/lib/browser/chunk-SWBZUZDX.mjs +80 -0
- package/dist/lib/browser/chunk-SWBZUZDX.mjs.map +7 -0
- package/dist/lib/browser/chunk-VFJJA4WR.mjs +88 -0
- package/dist/lib/browser/chunk-VFJJA4WR.mjs.map +7 -0
- package/dist/lib/browser/{compiler-CXCUA4UQ.mjs → compiler-G2N2CG63.mjs} +24 -8
- package/dist/lib/browser/compiler-G2N2CG63.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +96 -39
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-S3H2SMUY.mjs → intent-resolver-FYZRLYNT.mjs} +29 -13
- package/dist/lib/browser/intent-resolver-FYZRLYNT.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-FYYXZA7C.mjs → react-surface-CFRYAL2P.mjs} +36 -13
- package/dist/lib/browser/react-surface-CFRYAL2P.mjs.map +7 -0
- package/dist/lib/browser/{settings-KCTBK5TY.mjs → settings-L3HCZRBP.mjs} +8 -8
- package/dist/lib/browser/settings-L3HCZRBP.mjs.map +7 -0
- package/dist/lib/browser/templates/index.mjs +1 -1
- package/dist/lib/browser/types/index.mjs +6 -4
- package/dist/lib/node-esm/{DeploymentDialog-3KPRWFE7.mjs → DeploymentDialog-AKAGR37W.mjs} +5 -5
- package/dist/lib/node-esm/NotebookContainer-2O3N3XPE.mjs +579 -0
- package/dist/lib/node-esm/NotebookContainer-2O3N3XPE.mjs.map +7 -0
- package/dist/lib/node-esm/ScriptContainer-IKOB6FHQ.mjs +150 -0
- package/dist/lib/node-esm/ScriptContainer-IKOB6FHQ.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-builder-7EYIHWH4.mjs → app-graph-builder-UXJGHXSL.mjs} +9 -8
- package/dist/lib/node-esm/app-graph-builder-UXJGHXSL.mjs.map +7 -0
- package/dist/lib/node-esm/blueprint-definition-AIYFOT7Q.mjs +30 -0
- package/dist/lib/node-esm/blueprint-definition-AIYFOT7Q.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-QKK3NDHW.mjs → chunk-5IKGUOMI.mjs} +15 -15
- package/dist/lib/node-esm/chunk-5IKGUOMI.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-RT43MACC.mjs → chunk-7MR2L4T3.mjs} +26 -27
- package/dist/lib/node-esm/chunk-7MR2L4T3.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-C33FKUSC.mjs +91 -0
- package/dist/lib/node-esm/chunk-C33FKUSC.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-35M3CHYE.mjs → chunk-NUXZQQ6P.mjs} +2 -2
- package/dist/lib/node-esm/{chunk-AHXJ6NQU.mjs → chunk-OG2SIKHE.mjs} +3 -5
- package/dist/lib/node-esm/chunk-OG2SIKHE.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-OQGBKNYU.mjs +90 -0
- package/dist/lib/node-esm/chunk-OQGBKNYU.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-7NMI4CEU.mjs → chunk-PMQ3D535.mjs} +159 -68
- package/dist/lib/node-esm/chunk-PMQ3D535.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-XJPK3IYI.mjs → chunk-U4CZGISN.mjs} +71 -50
- package/dist/lib/node-esm/chunk-U4CZGISN.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-VRSDE4CI.mjs +114 -0
- package/dist/lib/node-esm/chunk-VRSDE4CI.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-ZF5ULKED.mjs +81 -0
- package/dist/lib/node-esm/chunk-ZF5ULKED.mjs.map +7 -0
- package/dist/lib/node-esm/{compiler-EPFKQXPE.mjs → compiler-PLDAZ5GJ.mjs} +24 -8
- package/dist/lib/node-esm/compiler-PLDAZ5GJ.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +96 -39
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-OHKNJFCC.mjs → intent-resolver-6J3CFL5T.mjs} +29 -13
- package/dist/lib/node-esm/intent-resolver-6J3CFL5T.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-surface-V32NWHKN.mjs → react-surface-NPKEO7SA.mjs} +36 -13
- package/dist/lib/node-esm/react-surface-NPKEO7SA.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-DXZ334A3.mjs → settings-YWGZP4EW.mjs} +8 -8
- package/dist/lib/node-esm/settings-YWGZP4EW.mjs.map +7 -0
- package/dist/lib/node-esm/templates/index.mjs +1 -1
- package/dist/lib/node-esm/types/index.mjs +6 -4
- package/dist/types/src/ScriptPlugin.d.ts +1 -1
- package/dist/types/src/ScriptPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/artifact-definition.d.ts +1 -1
- package/dist/types/src/capabilities/artifact-definition.d.ts.map +1 -1
- package/dist/types/src/capabilities/blueprint-definition.d.ts +5 -0
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -0
- package/dist/types/src/capabilities/compiler.d.ts +1 -1
- package/dist/types/src/capabilities/compiler.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +6 -6
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings.d.ts +1 -1
- package/dist/types/src/compiler/compiler.d.ts.map +1 -1
- package/dist/types/src/components/DeploymentDialog/DeploymentDialog.d.ts +2 -2
- package/dist/types/src/components/DeploymentDialog/DeploymentDialog.d.ts.map +1 -1
- package/dist/types/src/components/DeploymentDialog/DeploymentDialog.stories.d.ts +225 -13
- package/dist/types/src/components/DeploymentDialog/DeploymentDialog.stories.d.ts.map +1 -1
- package/dist/types/src/components/DeploymentDialog/index.d.ts +1 -1
- package/dist/types/src/components/DeploymentDialog/index.d.ts.map +1 -1
- package/dist/types/src/components/FrameContainer/FrameContainer.d.ts.map +1 -1
- package/dist/types/src/components/NotebookContainer.d.ts +10 -0
- package/dist/types/src/components/NotebookContainer.d.ts.map +1 -0
- package/dist/types/src/components/NotebookContainer.stories.d.ts +231 -0
- package/dist/types/src/components/NotebookContainer.stories.d.ts.map +1 -0
- package/dist/types/src/components/NotebookStack/NotebookStack.d.ts +16 -0
- package/dist/types/src/components/NotebookStack/NotebookStack.d.ts.map +1 -0
- package/dist/types/src/components/NotebookStack/NotebookStack.stories.d.ts +231 -0
- package/dist/types/src/components/NotebookStack/NotebookStack.stories.d.ts.map +1 -0
- package/dist/types/src/components/NotebookStack/index.d.ts +2 -0
- package/dist/types/src/components/NotebookStack/index.d.ts.map +1 -0
- package/dist/types/src/components/ScriptContainer.d.ts +2 -2
- package/dist/types/src/components/ScriptContainer.d.ts.map +1 -1
- package/dist/types/src/components/ScriptToolbar/ScriptToolbar.d.ts.map +1 -1
- package/dist/types/src/components/ScriptToolbar/ScriptToolbar.stories.d.ts +227 -10
- package/dist/types/src/components/ScriptToolbar/ScriptToolbar.stories.d.ts.map +1 -1
- package/dist/types/src/components/Settings/ScriptObjectSettings.d.ts.map +1 -1
- package/dist/types/src/components/Settings/ScriptPluginSettings.d.ts +2 -2
- package/dist/types/src/components/Settings/ScriptPluginSettings.d.ts.map +1 -1
- package/dist/types/src/components/TestPanel/TestContainer.d.ts.map +1 -1
- package/dist/types/src/components/TypescriptEditor/TypescriptEditor.d.ts +4 -2
- package/dist/types/src/components/TypescriptEditor/TypescriptEditor.d.ts.map +1 -1
- package/dist/types/src/components/TypescriptEditor/TypescriptEditor.stories.d.ts +17 -4
- package/dist/types/src/components/TypescriptEditor/TypescriptEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +3 -4
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/events.d.ts.map +1 -1
- package/dist/types/src/hooks/deploy.d.ts +11 -10
- package/dist/types/src/hooks/deploy.d.ts.map +1 -1
- package/dist/types/src/hooks/template.d.ts.map +1 -1
- package/dist/types/src/hooks/useCreateAndDeployScriptTemplates.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/meta.d.ts +0 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/notebook/index.d.ts +2 -0
- package/dist/types/src/notebook/index.d.ts.map +1 -0
- package/dist/types/src/notebook/notebook.d.ts +39 -0
- package/dist/types/src/notebook/notebook.d.ts.map +1 -0
- package/dist/types/src/notebook/notebook.test.d.ts +2 -0
- package/dist/types/src/notebook/notebook.test.d.ts.map +1 -0
- package/dist/types/src/notebook/vfs-parser.d.ts +74 -0
- package/dist/types/src/notebook/vfs-parser.d.ts.map +1 -0
- package/dist/types/src/notebook/vfs-parser.test.d.ts +2 -0
- package/dist/types/src/notebook/vfs-parser.test.d.ts.map +1 -0
- package/dist/types/src/templates/chess.d.ts.map +1 -1
- package/dist/types/src/templates/data-generator.d.ts.map +1 -1
- package/dist/types/src/templates/discord.d.ts.map +1 -1
- package/dist/types/src/templates/forex-effect.d.ts.map +1 -1
- package/dist/types/src/templates/forex.d.ts.map +1 -1
- package/dist/types/src/templates/gmail.d.ts.map +1 -1
- package/dist/types/src/testing/data.d.ts +10 -0
- package/dist/types/src/testing/data.d.ts.map +1 -0
- package/dist/types/src/testing/index.d.ts +2 -0
- package/dist/types/src/testing/index.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +21 -2
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/actions.d.ts +58 -0
- package/dist/types/src/types/actions.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +1 -0
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts +29 -32
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/src/util/deploy.d.ts +3 -3
- package/dist/types/src/util/deploy.d.ts.map +1 -1
- package/dist/types/src/util/functions.d.ts +5 -2
- package/dist/types/src/util/functions.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +76 -75
- package/src/ScriptPlugin.tsx +91 -69
- package/src/capabilities/app-graph-builder.ts +6 -5
- package/src/capabilities/artifact-definition.ts +7 -4
- package/src/capabilities/blueprint-definition.ts +30 -0
- package/src/capabilities/compiler.ts +2 -1
- package/src/capabilities/index.ts +1 -1
- package/src/capabilities/intent-resolver.ts +14 -4
- package/src/capabilities/react-surface.tsx +20 -7
- package/src/capabilities/settings.ts +3 -3
- package/src/compiler/compiler.ts +1 -1
- package/src/components/DeploymentDialog/DeploymentDialog.stories.tsx +34 -20
- package/src/components/DeploymentDialog/DeploymentDialog.tsx +16 -22
- package/src/components/DeploymentDialog/index.ts +1 -1
- package/src/components/FrameContainer/FrameContainer.tsx +3 -2
- package/src/components/NotebookContainer.stories.tsx +36 -0
- package/src/components/NotebookContainer.tsx +82 -0
- package/src/components/NotebookStack/NotebookStack.stories.tsx +36 -0
- package/src/components/NotebookStack/NotebookStack.tsx +113 -0
- package/src/components/NotebookStack/index.ts +5 -0
- package/src/components/ScriptContainer.tsx +4 -3
- package/src/components/ScriptToolbar/ScriptToolbar.stories.tsx +33 -17
- package/src/components/ScriptToolbar/ScriptToolbar.tsx +30 -23
- package/src/components/Settings/ScriptObjectSettings.tsx +111 -31
- package/src/components/Settings/ScriptPluginSettings.tsx +37 -47
- package/src/components/TestPanel/TestContainer.tsx +2 -1
- package/src/components/TestPanel/TestPanel.tsx +6 -6
- package/src/components/TypescriptEditor/TypescriptEditor.stories.tsx +84 -30
- package/src/components/TypescriptEditor/TypescriptEditor.tsx +32 -25
- package/src/components/index.ts +3 -0
- package/src/events.ts +2 -2
- package/src/hooks/deploy.ts +18 -19
- package/src/hooks/format.ts +2 -2
- package/src/hooks/template.ts +4 -3
- package/src/hooks/useCreateAndDeployScriptTemplates.ts +4 -3
- package/src/index.ts +1 -0
- package/src/meta.ts +2 -4
- package/src/notebook/index.ts +5 -0
- package/src/notebook/notebook.test.ts +38 -0
- package/src/notebook/notebook.ts +188 -0
- package/src/notebook/vfs-parser.test.ts +149 -0
- package/src/notebook/vfs-parser.ts +490 -0
- package/src/templates/chess.ts +3 -1
- package/src/templates/data-generator.ts +9 -3
- package/src/templates/discord.ts +12 -4
- package/src/templates/forex-effect.ts +7 -3
- package/src/templates/forex.ts +3 -1
- package/src/templates/gmail.ts +33 -62
- package/src/testing/data.ts +37 -0
- package/src/testing/index.ts +5 -0
- package/src/translations.ts +24 -4
- package/src/types/actions.ts +49 -0
- package/src/types/index.ts +1 -0
- package/src/types/schema.ts +24 -19
- package/src/util/deploy.ts +20 -33
- package/src/util/functions.ts +35 -6
- package/dist/lib/browser/DeploymentDialog-M4QIHTDR.mjs +0 -12
- package/dist/lib/browser/ScriptContainer-Z6SIGRRC.mjs +0 -262
- package/dist/lib/browser/ScriptContainer-Z6SIGRRC.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-HLQ7K3BT.mjs.map +0 -7
- package/dist/lib/browser/artifact-definition-CK3BIBSI.mjs +0 -247
- package/dist/lib/browser/artifact-definition-CK3BIBSI.mjs.map +0 -7
- package/dist/lib/browser/chunk-3U6DTUH3.mjs.map +0 -7
- package/dist/lib/browser/chunk-FIM2MVNJ.mjs.map +0 -7
- package/dist/lib/browser/chunk-FMDXKOP7.mjs.map +0 -7
- package/dist/lib/browser/chunk-IS4OG2UW.mjs +0 -39
- package/dist/lib/browser/chunk-IS4OG2UW.mjs.map +0 -7
- package/dist/lib/browser/chunk-P4HQKUCP.mjs.map +0 -7
- package/dist/lib/browser/chunk-QYAREHGH.mjs.map +0 -7
- package/dist/lib/browser/chunk-R4R7VOFY.mjs +0 -88
- package/dist/lib/browser/chunk-R4R7VOFY.mjs.map +0 -7
- package/dist/lib/browser/compiler-CXCUA4UQ.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-S3H2SMUY.mjs.map +0 -7
- package/dist/lib/browser/react-surface-FYYXZA7C.mjs.map +0 -7
- package/dist/lib/browser/settings-KCTBK5TY.mjs.map +0 -7
- package/dist/lib/node-esm/ScriptContainer-KPU75HHI.mjs +0 -263
- package/dist/lib/node-esm/ScriptContainer-KPU75HHI.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-7EYIHWH4.mjs.map +0 -7
- package/dist/lib/node-esm/artifact-definition-YCBV4YX2.mjs +0 -248
- package/dist/lib/node-esm/artifact-definition-YCBV4YX2.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-7NMI4CEU.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-AHXJ6NQU.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-F5GFJ3PY.mjs +0 -90
- package/dist/lib/node-esm/chunk-F5GFJ3PY.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-JIPFLBYA.mjs +0 -40
- package/dist/lib/node-esm/chunk-JIPFLBYA.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-QKK3NDHW.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-RT43MACC.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-XJPK3IYI.mjs.map +0 -7
- package/dist/lib/node-esm/compiler-EPFKQXPE.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-OHKNJFCC.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-V32NWHKN.mjs.map +0 -7
- package/dist/lib/node-esm/settings-DXZ334A3.mjs.map +0 -7
- /package/dist/lib/browser/{DeploymentDialog-M4QIHTDR.mjs.map → DeploymentDialog-7FNPALCV.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-5TVBECWH.mjs.map → chunk-OKXN2N7M.mjs.map} +0 -0
- /package/dist/lib/node-esm/{DeploymentDialog-3KPRWFE7.mjs.map → DeploymentDialog-AKAGR37W.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-35M3CHYE.mjs.map → chunk-NUXZQQ6P.mjs.map} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-script",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.c4373fc",
|
|
4
4
|
"description": "Braneframe notebook plugin",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -10,22 +10,22 @@
|
|
|
10
10
|
"type": "module",
|
|
11
11
|
"exports": {
|
|
12
12
|
".": {
|
|
13
|
+
"source": "./src/index.ts",
|
|
13
14
|
"types": "./dist/types/src/index.d.ts",
|
|
14
15
|
"browser": "./dist/lib/browser/index.mjs",
|
|
15
|
-
"node": "./dist/lib/node-esm/index.mjs"
|
|
16
|
-
"source": "./src/index.ts"
|
|
16
|
+
"node": "./dist/lib/node-esm/index.mjs"
|
|
17
17
|
},
|
|
18
18
|
"./types": {
|
|
19
|
+
"source": "./src/types/index.ts",
|
|
19
20
|
"types": "./dist/types/src/types/index.d.ts",
|
|
20
21
|
"browser": "./dist/lib/browser/types/index.mjs",
|
|
21
|
-
"node": "./dist/lib/node-esm/types/index.mjs"
|
|
22
|
-
"source": "./src/types/index.ts"
|
|
22
|
+
"node": "./dist/lib/node-esm/types/index.mjs"
|
|
23
23
|
},
|
|
24
24
|
"./templates": {
|
|
25
|
+
"source": "./src/templates/index.ts",
|
|
25
26
|
"types": "./dist/types/src/templates/index.d.ts",
|
|
26
27
|
"browser": "./dist/lib/browser/templates/index.mjs",
|
|
27
|
-
"node": "./dist/lib/node-esm/templates/index.mjs"
|
|
28
|
-
"source": "./src/templates/index.ts"
|
|
28
|
+
"node": "./dist/lib/node-esm/templates/index.mjs"
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
"types": "dist/types/src/index.d.ts",
|
|
@@ -44,18 +44,18 @@
|
|
|
44
44
|
"src"
|
|
45
45
|
],
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@codemirror/autocomplete": "^6.
|
|
48
|
-
"@codemirror/lang-javascript": "^6.2.
|
|
49
|
-
"@codemirror/language": "^6.
|
|
50
|
-
"@codemirror/lint": "^6.8.
|
|
51
|
-
"@codemirror/state": "^6.
|
|
52
|
-
"@codemirror/theme-one-dark": "^6.1.
|
|
53
|
-
"@codemirror/view": "^6.
|
|
47
|
+
"@codemirror/autocomplete": "^6.19.0",
|
|
48
|
+
"@codemirror/lang-javascript": "^6.2.4",
|
|
49
|
+
"@codemirror/language": "^6.11.3",
|
|
50
|
+
"@codemirror/lint": "^6.8.5",
|
|
51
|
+
"@codemirror/state": "^6.5.2",
|
|
52
|
+
"@codemirror/theme-one-dark": "^6.1.3",
|
|
53
|
+
"@codemirror/view": "^6.38.4",
|
|
54
54
|
"@lezer/common": "^1.2.2",
|
|
55
55
|
"@lezer/highlight": "^1.2.1",
|
|
56
56
|
"@octokit/core": "^4.0.4",
|
|
57
57
|
"@preact-signals/safe-react": "^0.9.0",
|
|
58
|
-
"@preact/signals-core": "^1.
|
|
58
|
+
"@preact/signals-core": "^1.12.1",
|
|
59
59
|
"@typescript/vfs": "^1.6.0",
|
|
60
60
|
"@valtown/codemirror-continue": "^2.3.1",
|
|
61
61
|
"@valtown/codemirror-ts": "^2.2.0",
|
|
@@ -63,73 +63,74 @@
|
|
|
63
63
|
"date-fns": "^3.3.1",
|
|
64
64
|
"esbuild-wasm": "^0.16.14",
|
|
65
65
|
"prettier": "^3.6.2",
|
|
66
|
-
"react-syntax-highlighter": "^15.
|
|
67
|
-
"typescript": "^5.
|
|
68
|
-
"@dxos/ai": "0.8.4-main.
|
|
69
|
-
"@dxos/app-framework": "0.8.4-main.
|
|
70
|
-
"@dxos/assistant": "0.8.4-main.
|
|
71
|
-
"@dxos/async": "0.8.4-main.
|
|
72
|
-
"@dxos/blueprints": "0.8.4-main.
|
|
73
|
-
"@dxos/client": "0.8.4-main.
|
|
74
|
-
"@dxos/client-protocol": "0.8.4-main.
|
|
75
|
-
"@dxos/compute": "0.8.4-main.
|
|
76
|
-
"@dxos/debug": "0.8.4-main.
|
|
77
|
-
"@dxos/echo": "0.8.4-main.
|
|
78
|
-
"@dxos/devtools": "0.8.4-main.
|
|
79
|
-
"@dxos/echo-protocol": "0.8.4-main.
|
|
80
|
-
"@dxos/
|
|
81
|
-
"@dxos/
|
|
82
|
-
"@dxos/
|
|
83
|
-
"@dxos/
|
|
84
|
-
"@dxos/
|
|
85
|
-
"@dxos/
|
|
86
|
-
"@dxos/plugin-client": "0.8.4-main.
|
|
87
|
-
"@dxos/plugin-
|
|
88
|
-
"@dxos/
|
|
89
|
-
"@dxos/plugin-
|
|
90
|
-
"@dxos/plugin-
|
|
91
|
-
"@dxos/plugin-
|
|
92
|
-
"@dxos/plugin-
|
|
93
|
-
"@dxos/plugin-
|
|
94
|
-
"@dxos/plugin-token-manager": "0.8.4-main.
|
|
95
|
-
"@dxos/
|
|
96
|
-
"@dxos/react-client": "0.8.4-main.
|
|
97
|
-
"@dxos/protocols": "0.8.4-main.
|
|
98
|
-
"@dxos/react-
|
|
99
|
-
"@dxos/react-ui-
|
|
100
|
-
"@dxos/react-ui-
|
|
101
|
-
"@dxos/react-ui-
|
|
102
|
-
"@dxos/react-ui-
|
|
103
|
-
"@dxos/react-ui-
|
|
104
|
-
"@dxos/
|
|
105
|
-
"@dxos/
|
|
106
|
-
"@dxos/rpc": "0.8.4-main.
|
|
107
|
-
"@dxos/
|
|
108
|
-
"@dxos/
|
|
109
|
-
"@dxos/
|
|
66
|
+
"react-syntax-highlighter": "^15.6.1",
|
|
67
|
+
"typescript": "^5.9.3",
|
|
68
|
+
"@dxos/ai": "0.8.4-main.c4373fc",
|
|
69
|
+
"@dxos/app-framework": "0.8.4-main.c4373fc",
|
|
70
|
+
"@dxos/assistant": "0.8.4-main.c4373fc",
|
|
71
|
+
"@dxos/async": "0.8.4-main.c4373fc",
|
|
72
|
+
"@dxos/blueprints": "0.8.4-main.c4373fc",
|
|
73
|
+
"@dxos/client": "0.8.4-main.c4373fc",
|
|
74
|
+
"@dxos/client-protocol": "0.8.4-main.c4373fc",
|
|
75
|
+
"@dxos/compute": "0.8.4-main.c4373fc",
|
|
76
|
+
"@dxos/debug": "0.8.4-main.c4373fc",
|
|
77
|
+
"@dxos/echo": "0.8.4-main.c4373fc",
|
|
78
|
+
"@dxos/devtools": "0.8.4-main.c4373fc",
|
|
79
|
+
"@dxos/echo-protocol": "0.8.4-main.c4373fc",
|
|
80
|
+
"@dxos/invariant": "0.8.4-main.c4373fc",
|
|
81
|
+
"@dxos/keys": "0.8.4-main.c4373fc",
|
|
82
|
+
"@dxos/functions": "0.8.4-main.c4373fc",
|
|
83
|
+
"@dxos/live-object": "0.8.4-main.c4373fc",
|
|
84
|
+
"@dxos/local-storage": "0.8.4-main.c4373fc",
|
|
85
|
+
"@dxos/log": "0.8.4-main.c4373fc",
|
|
86
|
+
"@dxos/plugin-client": "0.8.4-main.c4373fc",
|
|
87
|
+
"@dxos/plugin-deck": "0.8.4-main.c4373fc",
|
|
88
|
+
"@dxos/plugin-explorer": "0.8.4-main.c4373fc",
|
|
89
|
+
"@dxos/plugin-space": "0.8.4-main.c4373fc",
|
|
90
|
+
"@dxos/plugin-markdown": "0.8.4-main.c4373fc",
|
|
91
|
+
"@dxos/plugin-graph": "0.8.4-main.c4373fc",
|
|
92
|
+
"@dxos/plugin-stack": "0.8.4-main.c4373fc",
|
|
93
|
+
"@dxos/plugin-theme": "0.8.4-main.c4373fc",
|
|
94
|
+
"@dxos/plugin-token-manager": "0.8.4-main.c4373fc",
|
|
95
|
+
"@dxos/react-edge-client": "0.8.4-main.c4373fc",
|
|
96
|
+
"@dxos/react-client": "0.8.4-main.c4373fc",
|
|
97
|
+
"@dxos/protocols": "0.8.4-main.c4373fc",
|
|
98
|
+
"@dxos/react-ui-attention": "0.8.4-main.c4373fc",
|
|
99
|
+
"@dxos/react-ui-editor": "0.8.4-main.c4373fc",
|
|
100
|
+
"@dxos/react-ui-form": "0.8.4-main.c4373fc",
|
|
101
|
+
"@dxos/react-ui-menu": "0.8.4-main.c4373fc",
|
|
102
|
+
"@dxos/react-ui-syntax-highlighter": "0.8.4-main.c4373fc",
|
|
103
|
+
"@dxos/react-ui-stack": "0.8.4-main.c4373fc",
|
|
104
|
+
"@dxos/rpc-tunnel": "0.8.4-main.c4373fc",
|
|
105
|
+
"@dxos/schema": "0.8.4-main.c4373fc",
|
|
106
|
+
"@dxos/rpc": "0.8.4-main.c4373fc",
|
|
107
|
+
"@dxos/vendor-quickjs": "0.8.4-main.c4373fc",
|
|
108
|
+
"@dxos/util": "0.8.4-main.c4373fc",
|
|
109
|
+
"@dxos/react-ui-list": "0.8.4-main.c4373fc"
|
|
110
110
|
},
|
|
111
111
|
"devDependencies": {
|
|
112
|
-
"@effect-rx/rx-react": "0.
|
|
113
|
-
"@effect/platform": "0.
|
|
114
|
-
"@types/react": "~
|
|
115
|
-
"@types/react-dom": "~
|
|
116
|
-
"effect": "3.
|
|
117
|
-
"react": "~
|
|
118
|
-
"react-dom": "~
|
|
119
|
-
"vite": "
|
|
120
|
-
"@dxos/
|
|
121
|
-
"@dxos/
|
|
122
|
-
"@dxos/react-ui
|
|
123
|
-
"@dxos/
|
|
112
|
+
"@effect-rx/rx-react": "0.42.4",
|
|
113
|
+
"@effect/platform": "0.92.1",
|
|
114
|
+
"@types/react": "~19.2.2",
|
|
115
|
+
"@types/react-dom": "~19.2.1",
|
|
116
|
+
"effect": "3.18.3",
|
|
117
|
+
"react": "~19.2.0",
|
|
118
|
+
"react-dom": "~19.2.0",
|
|
119
|
+
"vite": "7.1.9",
|
|
120
|
+
"@dxos/echo-db": "0.8.4-main.c4373fc",
|
|
121
|
+
"@dxos/random": "0.8.4-main.c4373fc",
|
|
122
|
+
"@dxos/react-ui": "0.8.4-main.c4373fc",
|
|
123
|
+
"@dxos/react-ui-theme": "0.8.4-main.c4373fc",
|
|
124
|
+
"@dxos/storybook-utils": "0.8.4-main.c4373fc"
|
|
124
125
|
},
|
|
125
126
|
"peerDependencies": {
|
|
126
127
|
"@effect-rx/rx-react": "^0.34.1",
|
|
127
128
|
"@effect/platform": "^0.80.12",
|
|
128
129
|
"effect": "^3.13.3",
|
|
129
|
-
"react": "
|
|
130
|
-
"react-dom": "
|
|
131
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
132
|
-
"@dxos/react-ui-theme": "0.8.4-main.
|
|
130
|
+
"react": "^19.0.0",
|
|
131
|
+
"react-dom": "^19.0.0",
|
|
132
|
+
"@dxos/react-ui": "0.8.4-main.c4373fc",
|
|
133
|
+
"@dxos/react-ui-theme": "0.8.4-main.c4373fc"
|
|
133
134
|
},
|
|
134
135
|
"publishConfig": {
|
|
135
136
|
"access": "public"
|
package/src/ScriptPlugin.tsx
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import * as Schema from 'effect/Schema';
|
|
6
6
|
|
|
7
|
-
import { Capabilities, contributes, createIntent, defineModule, definePlugin
|
|
7
|
+
import { Capabilities, Events, contributes, createIntent, defineModule, definePlugin } from '@dxos/app-framework';
|
|
8
8
|
import { Ref } from '@dxos/echo';
|
|
9
9
|
import { ScriptType } from '@dxos/functions';
|
|
10
10
|
import { ClientEvents } from '@dxos/plugin-client';
|
|
@@ -13,7 +13,7 @@ import { defineObjectForm } from '@dxos/plugin-space/types';
|
|
|
13
13
|
|
|
14
14
|
import {
|
|
15
15
|
AppGraphBuilder,
|
|
16
|
-
|
|
16
|
+
BlueprintDefinition,
|
|
17
17
|
Compiler,
|
|
18
18
|
IntentResolver,
|
|
19
19
|
ReactSurface,
|
|
@@ -22,71 +22,93 @@ import {
|
|
|
22
22
|
import { ScriptEvents } from './events';
|
|
23
23
|
import { meta } from './meta';
|
|
24
24
|
import { translations } from './translations';
|
|
25
|
-
import { ScriptAction } from './types';
|
|
25
|
+
import { Notebook, ScriptAction } from './types';
|
|
26
26
|
|
|
27
|
-
export const ScriptPlugin = () =>
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
27
|
+
export const ScriptPlugin = definePlugin(meta, () => [
|
|
28
|
+
defineModule({
|
|
29
|
+
id: `${meta.id}/module/settings`,
|
|
30
|
+
activatesOn: Events.SetupSettings,
|
|
31
|
+
activate: ScriptSettings,
|
|
32
|
+
}),
|
|
33
|
+
defineModule({
|
|
34
|
+
id: `${meta.id}/module/compiler`,
|
|
35
|
+
activatesOn: ScriptEvents.SetupCompiler,
|
|
36
|
+
activate: Compiler,
|
|
37
|
+
}),
|
|
38
|
+
defineModule({
|
|
39
|
+
id: `${meta.id}/module/translations`,
|
|
40
|
+
activatesOn: Events.SetupTranslations,
|
|
41
|
+
activate: () => contributes(Capabilities.Translations, translations),
|
|
42
|
+
}),
|
|
43
|
+
defineModule({
|
|
44
|
+
id: `${meta.id}/module/metadata`,
|
|
45
|
+
activatesOn: Events.SetupMetadata,
|
|
46
|
+
activate: () => [
|
|
47
|
+
contributes(Capabilities.Metadata, {
|
|
48
|
+
id: ScriptType.typename,
|
|
49
|
+
metadata: {
|
|
50
|
+
icon: 'ph--code--regular',
|
|
51
|
+
// TODO(wittjosiah): Move out of metadata.
|
|
52
|
+
loadReferences: async (script: ScriptType) => await Ref.Array.loadAll([script.source]),
|
|
53
|
+
},
|
|
54
|
+
}),
|
|
55
|
+
contributes(Capabilities.Metadata, {
|
|
56
|
+
id: Notebook.Notebook.typename,
|
|
57
|
+
metadata: {
|
|
58
|
+
icon: 'ph--notebook--regular',
|
|
59
|
+
// TODO(wittjosiah): Move out of metadata.
|
|
60
|
+
loadReferences: async (notebook: Notebook.Notebook) =>
|
|
61
|
+
await Ref.Array.loadAll(notebook.cells.map((cell) => cell.script)),
|
|
62
|
+
},
|
|
63
|
+
}),
|
|
64
|
+
],
|
|
65
|
+
}),
|
|
66
|
+
defineModule({
|
|
67
|
+
id: `${meta.id}/module/app-graph-builder`,
|
|
68
|
+
activatesOn: Events.SetupAppGraph,
|
|
69
|
+
activate: AppGraphBuilder,
|
|
70
|
+
}),
|
|
71
|
+
defineModule({
|
|
72
|
+
id: `${meta.id}/module/script/object-form`,
|
|
73
|
+
activatesOn: ClientEvents.SetupSchema,
|
|
74
|
+
activate: () =>
|
|
75
|
+
contributes(
|
|
76
|
+
SpaceCapabilities.ObjectForm,
|
|
77
|
+
defineObjectForm({
|
|
78
|
+
objectSchema: ScriptType,
|
|
79
|
+
formSchema: ScriptAction.ScriptProps.pipe(Schema.omit('initialTemplateId')),
|
|
80
|
+
getIntent: (props, options) => createIntent(ScriptAction.CreateScript, { ...props, space: options.space }),
|
|
55
81
|
}),
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
activatesOn: Events.SetupArtifactDefinition,
|
|
90
|
-
activate: ArtifactDefinition,
|
|
91
|
-
}),
|
|
92
|
-
]);
|
|
82
|
+
),
|
|
83
|
+
}),
|
|
84
|
+
defineModule({
|
|
85
|
+
id: `${meta.id}/module/notebook/object-form`,
|
|
86
|
+
activatesOn: ClientEvents.SetupSchema,
|
|
87
|
+
activate: () =>
|
|
88
|
+
contributes(
|
|
89
|
+
SpaceCapabilities.ObjectForm,
|
|
90
|
+
defineObjectForm({
|
|
91
|
+
objectSchema: Notebook.Notebook,
|
|
92
|
+
formSchema: ScriptAction.NotebookProps,
|
|
93
|
+
getIntent: (props, options) => createIntent(ScriptAction.CreateNotebook, { ...props, space: options.space }),
|
|
94
|
+
}),
|
|
95
|
+
),
|
|
96
|
+
}),
|
|
97
|
+
defineModule({
|
|
98
|
+
id: `${meta.id}/module/react-surface`,
|
|
99
|
+
activatesOn: Events.SetupReactSurface,
|
|
100
|
+
// TODO(wittjosiah): Should occur before the script editor is loaded when surfaces activation is more granular.
|
|
101
|
+
activatesBefore: [ScriptEvents.SetupCompiler],
|
|
102
|
+
activate: ReactSurface,
|
|
103
|
+
}),
|
|
104
|
+
defineModule({
|
|
105
|
+
id: `${meta.id}/module/intent-resolver`,
|
|
106
|
+
activatesOn: Events.SetupIntentResolver,
|
|
107
|
+
activate: IntentResolver,
|
|
108
|
+
}),
|
|
109
|
+
defineModule({
|
|
110
|
+
id: `${meta.id}/module/blueprint`,
|
|
111
|
+
activatesOn: Events.SetupArtifactDefinition,
|
|
112
|
+
activate: BlueprintDefinition,
|
|
113
|
+
}),
|
|
114
|
+
]);
|
|
@@ -3,12 +3,13 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { Rx } from '@effect-rx/rx-react';
|
|
6
|
-
import
|
|
6
|
+
import * as Function from 'effect/Function';
|
|
7
|
+
import * as Option from 'effect/Option';
|
|
7
8
|
|
|
8
|
-
import { Capabilities,
|
|
9
|
+
import { Capabilities, type PluginContext, contributes } from '@dxos/app-framework';
|
|
9
10
|
import { Obj } from '@dxos/echo';
|
|
10
11
|
import { ScriptType } from '@dxos/functions';
|
|
11
|
-
import {
|
|
12
|
+
import { ATTENDABLE_PATH_SEPARATOR, PLANK_COMPANION_TYPE } from '@dxos/plugin-deck/types';
|
|
12
13
|
import { createExtension } from '@dxos/plugin-graph';
|
|
13
14
|
|
|
14
15
|
import { meta } from '../meta';
|
|
@@ -19,7 +20,7 @@ export default (context: PluginContext) =>
|
|
|
19
20
|
id: `${meta.id}/execute`,
|
|
20
21
|
connector: (node) =>
|
|
21
22
|
Rx.make((get) =>
|
|
22
|
-
pipe(
|
|
23
|
+
Function.pipe(
|
|
23
24
|
get(node),
|
|
24
25
|
Option.flatMap((node) => (Obj.instanceOf(ScriptType, node.data) ? Option.some(node) : Option.none())),
|
|
25
26
|
Option.map((node) => [
|
|
@@ -42,7 +43,7 @@ export default (context: PluginContext) =>
|
|
|
42
43
|
id: `${meta.id}/logs`,
|
|
43
44
|
connector: (node) =>
|
|
44
45
|
Rx.make((get) =>
|
|
45
|
-
pipe(
|
|
46
|
+
Function.pipe(
|
|
46
47
|
get(node),
|
|
47
48
|
Option.flatMap((node) => (Obj.instanceOf(ScriptType, node.data) ? Option.some(node) : Option.none())),
|
|
48
49
|
Option.map((node) => [
|
|
@@ -2,11 +2,14 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// ISSUE(burdon): defineArtifact
|
|
6
|
+
// @ts-nocheck
|
|
6
7
|
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
import {
|
|
8
|
+
import * as Schema from 'effect/Schema';
|
|
9
|
+
|
|
10
|
+
import { ToolResult, createTool } from '@dxos/ai';
|
|
11
|
+
import { Capabilities, type PromiseIntentDispatcher, contributes, createIntent } from '@dxos/app-framework';
|
|
12
|
+
import { ArtifactId, createArtifactElement } from '@dxos/assistant';
|
|
10
13
|
import { defineArtifact } from '@dxos/blueprints';
|
|
11
14
|
import { Filter, Obj, Ref } from '@dxos/echo';
|
|
12
15
|
import { ScriptType } from '@dxos/functions';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Capabilities, contributes } from '@dxos/app-framework';
|
|
6
|
+
import { Blueprint, Template } from '@dxos/blueprints';
|
|
7
|
+
import { type FunctionDefinition } from '@dxos/functions';
|
|
8
|
+
import { trim } from '@dxos/util';
|
|
9
|
+
|
|
10
|
+
const functions: FunctionDefinition[] = [];
|
|
11
|
+
const tools: string[] = [];
|
|
12
|
+
|
|
13
|
+
export default () => {
|
|
14
|
+
return [
|
|
15
|
+
contributes(Capabilities.Functions, functions),
|
|
16
|
+
contributes(
|
|
17
|
+
Capabilities.BlueprintDefinition,
|
|
18
|
+
Blueprint.make({
|
|
19
|
+
key: 'dxos.org/blueprint/script',
|
|
20
|
+
name: 'Script',
|
|
21
|
+
tools: Blueprint.toolDefinitions({ functions, tools }),
|
|
22
|
+
instructions: Template.make({
|
|
23
|
+
source: trim`
|
|
24
|
+
You can create and update scripts which contain Typescript code.
|
|
25
|
+
`,
|
|
26
|
+
}),
|
|
27
|
+
}),
|
|
28
|
+
),
|
|
29
|
+
];
|
|
30
|
+
};
|
|
@@ -8,9 +8,10 @@ import wasmUrl from 'esbuild-wasm/esbuild.wasm?url';
|
|
|
8
8
|
import { contributes } from '@dxos/app-framework';
|
|
9
9
|
import { initializeBundler } from '@dxos/functions/bundler';
|
|
10
10
|
|
|
11
|
-
import { ScriptCapabilities } from './capabilities';
|
|
12
11
|
import { Compiler } from '../compiler';
|
|
13
12
|
|
|
13
|
+
import { ScriptCapabilities } from './capabilities';
|
|
14
|
+
|
|
14
15
|
export default async () => {
|
|
15
16
|
const compiler = new Compiler();
|
|
16
17
|
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { lazy } from '@dxos/app-framework';
|
|
6
6
|
|
|
7
7
|
export const AppGraphBuilder = lazy(() => import('./app-graph-builder'));
|
|
8
|
-
export const
|
|
8
|
+
export const BlueprintDefinition = lazy(() => import('./blueprint-definition'));
|
|
9
9
|
export const Compiler = lazy(() => import('./compiler'));
|
|
10
10
|
export const IntentResolver = lazy(() => import('./intent-resolver'));
|
|
11
11
|
export const ReactSurface = lazy(() => import('./react-surface'));
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { Octokit } from '@octokit/core';
|
|
6
|
-
import
|
|
6
|
+
import * as Predicate from 'effect/Predicate';
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { Capabilities, LayoutAction, contributes, createIntent, createResolver } from '@dxos/app-framework';
|
|
9
9
|
import { Obj, Ref } from '@dxos/echo';
|
|
10
10
|
import { ScriptType } from '@dxos/functions';
|
|
11
11
|
import { TokenManagerAction } from '@dxos/plugin-token-manager/types';
|
|
@@ -14,12 +14,12 @@ import { DataType } from '@dxos/schema';
|
|
|
14
14
|
import { DEPLOYMENT_DIALOG } from '../components';
|
|
15
15
|
import { defaultScriptsForIntegration } from '../meta';
|
|
16
16
|
import { templates } from '../templates';
|
|
17
|
-
import { ScriptAction } from '../types';
|
|
17
|
+
import { Notebook, ScriptAction } from '../types';
|
|
18
18
|
|
|
19
19
|
export default () =>
|
|
20
20
|
contributes(Capabilities.IntentResolver, [
|
|
21
21
|
createResolver({
|
|
22
|
-
intent: ScriptAction.
|
|
22
|
+
intent: ScriptAction.CreateScript,
|
|
23
23
|
resolve: async ({ name, gistUrl, initialTemplateId }) => {
|
|
24
24
|
let content = templates[0].source;
|
|
25
25
|
|
|
@@ -52,6 +52,16 @@ export default () =>
|
|
|
52
52
|
};
|
|
53
53
|
},
|
|
54
54
|
}),
|
|
55
|
+
createResolver({
|
|
56
|
+
intent: ScriptAction.CreateNotebook,
|
|
57
|
+
resolve: async ({ name }) => {
|
|
58
|
+
return {
|
|
59
|
+
data: {
|
|
60
|
+
object: Obj.make(Notebook.Notebook, { name, cells: [] }),
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
},
|
|
64
|
+
}),
|
|
55
65
|
createResolver({
|
|
56
66
|
intent: TokenManagerAction.AccessTokenCreated,
|
|
57
67
|
resolve: async ({ accessToken }) => {
|
|
@@ -13,39 +13,52 @@ import { getSpace } from '@dxos/react-client/echo';
|
|
|
13
13
|
import { StackItem } from '@dxos/react-ui-stack';
|
|
14
14
|
import { type DataType } from '@dxos/schema';
|
|
15
15
|
|
|
16
|
-
import { ScriptCapabilities } from './capabilities';
|
|
17
16
|
import {
|
|
18
17
|
DEPLOYMENT_DIALOG,
|
|
19
18
|
DeploymentDialog,
|
|
19
|
+
NotebookContainer,
|
|
20
20
|
ScriptContainer,
|
|
21
|
-
ScriptPluginSettings,
|
|
22
21
|
ScriptObjectSettings,
|
|
22
|
+
ScriptPluginSettings,
|
|
23
23
|
ScriptProperties,
|
|
24
24
|
TestContainer,
|
|
25
25
|
} from '../components';
|
|
26
26
|
import { meta } from '../meta';
|
|
27
|
-
import { type
|
|
27
|
+
import { Notebook, type ScriptSettings } from '../types';
|
|
28
|
+
|
|
29
|
+
import { ScriptCapabilities } from './capabilities';
|
|
28
30
|
|
|
29
31
|
export default () =>
|
|
30
32
|
contributes(Capabilities.ReactSurface, [
|
|
31
33
|
createSurface({
|
|
32
34
|
id: `${meta.id}/plugin-settings`,
|
|
33
35
|
role: 'article',
|
|
34
|
-
filter: (data): data is { subject: SettingsStore<
|
|
36
|
+
filter: (data): data is { subject: SettingsStore<ScriptSettings> } =>
|
|
35
37
|
data.subject instanceof SettingsStore && data.subject.prefix === meta.id,
|
|
36
38
|
component: ({ data: { subject } }) => <ScriptPluginSettings settings={subject.value} />,
|
|
37
39
|
}),
|
|
38
40
|
createSurface({
|
|
39
|
-
id: `${meta.id}/article`,
|
|
40
|
-
role: 'article',
|
|
41
|
+
id: `${meta.id}/script/article`,
|
|
42
|
+
role: ['article', 'section'],
|
|
41
43
|
filter: (data): data is { subject: ScriptType } => Obj.instanceOf(ScriptType, data.subject),
|
|
42
44
|
component: ({ data, role }) => {
|
|
43
45
|
const compiler = useCapability(ScriptCapabilities.Compiler);
|
|
44
46
|
// TODO(dmaretskyi): Since settings store is not reactive, this would break on the script plugin being enabled without a page reload.
|
|
45
|
-
const settings = useCapability(Capabilities.SettingsStore).getStore<
|
|
47
|
+
const settings = useCapability(Capabilities.SettingsStore).getStore<ScriptSettings>(meta.id)?.value;
|
|
46
48
|
return <ScriptContainer role={role} script={data.subject} settings={settings} env={compiler.environment} />;
|
|
47
49
|
},
|
|
48
50
|
}),
|
|
51
|
+
createSurface({
|
|
52
|
+
id: `${meta.id}/notebook/article`,
|
|
53
|
+
role: 'article',
|
|
54
|
+
filter: (data): data is { subject: Notebook.Notebook } => Obj.instanceOf(Notebook.Notebook, data.subject),
|
|
55
|
+
component: ({ data, role }) => {
|
|
56
|
+
const compiler = useCapability(ScriptCapabilities.Compiler);
|
|
57
|
+
return <NotebookContainer role={role} notebook={data.subject} env={compiler.environment} />;
|
|
58
|
+
},
|
|
59
|
+
}),
|
|
60
|
+
// TODO(burdon): Standardize PluginSettings vs ObjectSettings.
|
|
61
|
+
// TODO(burdon): Why is ScriptProperties different from ScriptObjectSettings?
|
|
49
62
|
createSurface({
|
|
50
63
|
id: `${meta.id}/companion/base-settings`,
|
|
51
64
|
role: 'base-object-settings',
|
|
@@ -6,16 +6,16 @@ import { Capabilities, contributes } from '@dxos/app-framework';
|
|
|
6
6
|
import { live } from '@dxos/live-object';
|
|
7
7
|
|
|
8
8
|
import { meta } from '../meta';
|
|
9
|
-
import {
|
|
9
|
+
import { ScriptSettings } from '../types';
|
|
10
10
|
|
|
11
11
|
export default () => {
|
|
12
|
-
const settings = live(
|
|
12
|
+
const settings = live<ScriptSettings>({
|
|
13
13
|
editorInputMode: 'vscode',
|
|
14
14
|
});
|
|
15
15
|
|
|
16
16
|
return contributes(Capabilities.Settings, {
|
|
17
17
|
prefix: meta.id,
|
|
18
|
-
schema:
|
|
18
|
+
schema: ScriptSettings,
|
|
19
19
|
value: settings,
|
|
20
20
|
});
|
|
21
21
|
};
|
package/src/compiler/compiler.ts
CHANGED