@dxos/plugin-script 0.8.4-main.28f8d3d → 0.8.4-main.406dc2a
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-65TWT6S5.mjs +13 -0
- package/dist/lib/browser/NotebookContainer-LVGRPFY3.mjs +683 -0
- package/dist/lib/browser/NotebookContainer-LVGRPFY3.mjs.map +7 -0
- package/dist/lib/browser/ScriptContainer-LRTRN7JW.mjs +149 -0
- package/dist/lib/browser/ScriptContainer-LRTRN7JW.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-builder-IABOSTBK.mjs → app-graph-builder-DPYULSME.mjs} +8 -7
- 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-5CYLWXRH.mjs +89 -0
- package/dist/lib/browser/chunk-5CYLWXRH.mjs.map +7 -0
- package/dist/lib/browser/chunk-75LH4EUR.mjs +326 -0
- package/dist/lib/browser/chunk-75LH4EUR.mjs.map +7 -0
- package/dist/lib/browser/{chunk-MWZDJNCQ.mjs → chunk-E7DXDICD.mjs} +27 -28
- package/dist/lib/browser/chunk-E7DXDICD.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-OULPWKXN.mjs → chunk-I3QSGUFJ.mjs} +157 -66
- package/dist/lib/browser/chunk-I3QSGUFJ.mjs.map +7 -0
- package/dist/lib/browser/{chunk-SUOLJH55.mjs → chunk-JO2O7W6J.mjs} +71 -50
- package/dist/lib/browser/chunk-JO2O7W6J.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-OAVS36Q3.mjs → chunk-NM4WQS4F.mjs} +14 -14
- package/dist/lib/browser/chunk-NM4WQS4F.mjs.map +7 -0
- package/dist/lib/browser/{chunk-5TVBECWH.mjs → chunk-OKXN2N7M.mjs} +2 -2
- package/dist/lib/browser/chunk-ST3ACVUC.mjs +88 -0
- package/dist/lib/browser/chunk-ST3ACVUC.mjs.map +7 -0
- package/dist/lib/browser/{compiler-RIWQVBPX.mjs → compiler-G2N2CG63.mjs} +24 -11
- package/dist/lib/browser/{compiler-RIWQVBPX.mjs.map → compiler-G2N2CG63.mjs.map} +2 -2
- package/dist/lib/browser/index.mjs +113 -37
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-SAL2TM7U.mjs → intent-resolver-JLU7DVLQ.mjs} +31 -15
- package/dist/lib/browser/intent-resolver-JLU7DVLQ.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-E3SXU6ON.mjs → react-surface-76SDTUYG.mjs} +38 -15
- package/dist/lib/browser/react-surface-76SDTUYG.mjs.map +7 -0
- package/dist/lib/browser/{settings-KCTBK5TY.mjs → settings-ERFKVNUK.mjs} +9 -8
- package/dist/lib/browser/settings-ERFKVNUK.mjs.map +7 -0
- package/dist/lib/browser/templates/index.mjs +1 -1
- package/dist/lib/browser/types/index.mjs +7 -4
- package/dist/lib/node-esm/{DeploymentDialog-O2XZVRLU.mjs → DeploymentDialog-I63ZC2HH.mjs} +6 -5
- package/dist/lib/node-esm/NotebookContainer-QY5NJGJI.mjs +684 -0
- package/dist/lib/node-esm/NotebookContainer-QY5NJGJI.mjs.map +7 -0
- package/dist/lib/node-esm/ScriptContainer-SVXCSLNH.mjs +150 -0
- package/dist/lib/node-esm/ScriptContainer-SVXCSLNH.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-builder-CQTTAYHP.mjs → app-graph-builder-UXJGHXSL.mjs} +8 -7
- 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-2GVTWESW.mjs +90 -0
- package/dist/lib/node-esm/chunk-2GVTWESW.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-4X375PGY.mjs +90 -0
- package/dist/lib/node-esm/chunk-4X375PGY.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-67OVZHI3.mjs +327 -0
- package/dist/lib/node-esm/chunk-67OVZHI3.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-IO6T72KY.mjs → chunk-C2ORIPKH.mjs} +14 -14
- package/dist/lib/node-esm/chunk-C2ORIPKH.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-6WMFL3JL.mjs → chunk-SMFPSKQT.mjs} +157 -66
- package/dist/lib/node-esm/chunk-SMFPSKQT.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-7L4JDSXJ.mjs → chunk-VZAFGLD7.mjs} +27 -28
- package/dist/lib/node-esm/chunk-VZAFGLD7.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-PACUN7RS.mjs → chunk-YW36TZ7K.mjs} +71 -50
- package/dist/lib/node-esm/chunk-YW36TZ7K.mjs.map +7 -0
- package/dist/lib/node-esm/{compiler-S52P5P3F.mjs → compiler-PLDAZ5GJ.mjs} +24 -11
- package/dist/lib/node-esm/{compiler-S52P5P3F.mjs.map → compiler-PLDAZ5GJ.mjs.map} +2 -2
- package/dist/lib/node-esm/index.mjs +113 -37
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-GO53JOPL.mjs → intent-resolver-SFGTIFOG.mjs} +31 -15
- package/dist/lib/node-esm/intent-resolver-SFGTIFOG.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-surface-W3NRCS5O.mjs → react-surface-SHEBNW4R.mjs} +38 -15
- package/dist/lib/node-esm/react-surface-SHEBNW4R.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-DXZ334A3.mjs → settings-5TYXQ42N.mjs} +9 -8
- package/dist/lib/node-esm/settings-5TYXQ42N.mjs.map +7 -0
- package/dist/lib/node-esm/templates/index.mjs +1 -1
- package/dist/lib/node-esm/types/index.mjs +7 -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/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/index.d.ts +6 -5
- 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/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 +246 -13
- package/dist/types/src/components/DeploymentDialog/DeploymentDialog.stories.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 +248 -0
- package/dist/types/src/components/NotebookContainer.stories.d.ts.map +1 -0
- package/dist/types/src/components/NotebookStack/NotebookCell.d.ts +14 -0
- package/dist/types/src/components/NotebookStack/NotebookCell.d.ts.map +1 -0
- package/dist/types/src/components/NotebookStack/NotebookMenu.d.ts +9 -0
- package/dist/types/src/components/NotebookStack/NotebookMenu.d.ts.map +1 -0
- package/dist/types/src/components/NotebookStack/NotebookStack.d.ts +14 -0
- package/dist/types/src/components/NotebookStack/NotebookStack.d.ts.map +1 -0
- package/dist/types/src/components/NotebookStack/NotebookStack.stories.d.ts +248 -0
- package/dist/types/src/components/NotebookStack/NotebookStack.stories.d.ts.map +1 -0
- package/dist/types/src/components/NotebookStack/index.d.ts +3 -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 +245 -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/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 +11 -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 +12 -11
- 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/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/eval.d.ts +13 -0
- package/dist/types/src/notebook/eval.d.ts.map +1 -0
- 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 +35 -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/templates/index.d.ts +43 -1
- package/dist/types/src/templates/index.d.ts.map +1 -1
- package/dist/types/src/templates/{echo.d.ts → ping.d.ts} +1 -1
- package/dist/types/src/templates/ping.d.ts.map +1 -0
- package/dist/types/src/testing/data.d.ts +19 -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 +28 -2
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/actions.d.ts +66 -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 +54 -31
- 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 +72 -68
- package/src/ScriptPlugin.tsx +99 -64
- package/src/capabilities/app-graph-builder.ts +4 -3
- package/src/capabilities/artifact-definition.ts +1 -1
- package/src/capabilities/blueprint-definition.ts +30 -0
- package/src/capabilities/index.ts +1 -0
- package/src/capabilities/intent-resolver.ts +14 -4
- package/src/capabilities/react-surface.tsx +17 -5
- package/src/capabilities/settings.ts +3 -3
- package/src/components/DeploymentDialog/DeploymentDialog.stories.tsx +34 -20
- package/src/components/DeploymentDialog/DeploymentDialog.tsx +12 -18
- package/src/components/FrameContainer/FrameContainer.tsx +3 -2
- package/src/components/NotebookContainer.stories.tsx +32 -0
- package/src/components/NotebookContainer.tsx +124 -0
- package/src/components/NotebookStack/NotebookCell.tsx +217 -0
- package/src/components/NotebookStack/NotebookMenu.tsx +47 -0
- package/src/components/NotebookStack/NotebookStack.stories.tsx +32 -0
- package/src/components/NotebookStack/NotebookStack.tsx +79 -0
- package/src/components/NotebookStack/index.ts +6 -0
- package/src/components/ScriptContainer.tsx +2 -2
- package/src/components/ScriptToolbar/ScriptToolbar.stories.tsx +34 -18
- package/src/components/ScriptToolbar/ScriptToolbar.tsx +29 -22
- package/src/components/Settings/ScriptObjectSettings.tsx +109 -29
- package/src/components/Settings/ScriptPluginSettings.tsx +37 -47
- package/src/components/TestPanel/TestPanel.tsx +6 -6
- package/src/components/TypescriptEditor/TypescriptEditor.stories.tsx +74 -27
- package/src/components/TypescriptEditor/TypescriptEditor.tsx +30 -24
- package/src/components/index.ts +3 -0
- package/src/events.ts +2 -2
- package/src/hooks/deploy.ts +17 -18
- package/src/hooks/format.ts +2 -2
- package/src/hooks/template.ts +4 -3
- package/src/hooks/useCreateAndDeployScriptTemplates.ts +3 -3
- package/src/index.ts +1 -0
- package/src/meta.ts +2 -4
- package/src/notebook/eval.ts +105 -0
- package/src/notebook/index.ts +5 -0
- package/src/notebook/notebook.test.ts +70 -0
- package/src/notebook/notebook.ts +183 -0
- package/src/notebook/vfs-parser.test.ts +149 -0
- package/src/notebook/vfs-parser.ts +451 -0
- package/src/templates/chess.ts +2 -0
- package/src/templates/data-generator.ts +2 -0
- package/src/templates/discord.ts +11 -3
- package/src/templates/forex-effect.ts +6 -2
- package/src/templates/forex.ts +2 -0
- package/src/templates/gmail.ts +31 -60
- package/src/templates/index.ts +6 -6
- package/src/testing/data.ts +47 -0
- package/src/testing/index.ts +5 -0
- package/src/translations.ts +31 -4
- package/src/types/actions.ts +53 -0
- package/src/types/index.ts +1 -0
- package/src/types/schema.ts +30 -19
- package/src/util/deploy.ts +20 -33
- package/src/util/functions.ts +35 -6
- package/dist/lib/browser/DeploymentDialog-C3XH2Z56.mjs +0 -12
- package/dist/lib/browser/ScriptContainer-FUBR4OZE.mjs +0 -263
- package/dist/lib/browser/ScriptContainer-FUBR4OZE.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-IABOSTBK.mjs.map +0 -7
- package/dist/lib/browser/chunk-G4A2MGAL.mjs +0 -88
- package/dist/lib/browser/chunk-G4A2MGAL.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-MWZDJNCQ.mjs.map +0 -7
- package/dist/lib/browser/chunk-OAVS36Q3.mjs.map +0 -7
- package/dist/lib/browser/chunk-OULPWKXN.mjs.map +0 -7
- package/dist/lib/browser/chunk-QYAREHGH.mjs.map +0 -7
- package/dist/lib/browser/chunk-SUOLJH55.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-SAL2TM7U.mjs.map +0 -7
- package/dist/lib/browser/react-surface-E3SXU6ON.mjs.map +0 -7
- package/dist/lib/browser/settings-KCTBK5TY.mjs.map +0 -7
- package/dist/lib/node-esm/ScriptContainer-VJ75TM24.mjs +0 -264
- package/dist/lib/node-esm/ScriptContainer-VJ75TM24.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-CQTTAYHP.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-3BBEM2U7.mjs +0 -90
- package/dist/lib/node-esm/chunk-3BBEM2U7.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-6WMFL3JL.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-7L4JDSXJ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-AHXJ6NQU.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-IO6T72KY.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-PACUN7RS.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-GO53JOPL.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-W3NRCS5O.mjs.map +0 -7
- package/dist/lib/node-esm/settings-DXZ334A3.mjs.map +0 -7
- package/dist/types/src/templates/echo.d.ts.map +0 -1
- /package/dist/lib/browser/{DeploymentDialog-C3XH2Z56.mjs.map → DeploymentDialog-65TWT6S5.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-5TVBECWH.mjs.map → chunk-OKXN2N7M.mjs.map} +0 -0
- /package/dist/lib/node-esm/{DeploymentDialog-O2XZVRLU.mjs.map → DeploymentDialog-I63ZC2HH.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-35M3CHYE.mjs.map → chunk-NUXZQQ6P.mjs.map} +0 -0
- /package/src/templates/{echo.ts → ping.ts} +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.406dc2a",
|
|
4
4
|
"description": "Braneframe notebook plugin",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -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",
|
|
@@ -64,72 +64,76 @@
|
|
|
64
64
|
"esbuild-wasm": "^0.16.14",
|
|
65
65
|
"prettier": "^3.6.2",
|
|
66
66
|
"react-syntax-highlighter": "^15.6.1",
|
|
67
|
-
"typescript": "^5.9.
|
|
68
|
-
"@dxos/ai": "0.8.4-main.
|
|
69
|
-
"@dxos/app-framework": "0.8.4-main.
|
|
70
|
-
"@dxos/
|
|
71
|
-
"@dxos/
|
|
72
|
-
"@dxos/
|
|
73
|
-
"@dxos/
|
|
74
|
-
"@dxos/
|
|
75
|
-
"@dxos/
|
|
76
|
-
"@dxos/debug": "0.8.4-main.
|
|
77
|
-
"@dxos/
|
|
78
|
-
"@dxos/
|
|
79
|
-
"@dxos/echo-protocol": "0.8.4-main.
|
|
80
|
-
"@dxos/functions": "0.8.4-main.
|
|
81
|
-
"@dxos/invariant": "0.8.4-main.
|
|
82
|
-
"@dxos/
|
|
83
|
-
"@dxos/
|
|
84
|
-
"@dxos/
|
|
85
|
-
"@dxos/
|
|
86
|
-
"@dxos/
|
|
87
|
-
"@dxos/plugin-client": "0.8.4-main.
|
|
88
|
-
"@dxos/plugin-deck": "0.8.4-main.
|
|
89
|
-
"@dxos/plugin-explorer": "0.8.4-main.
|
|
90
|
-
"@dxos/plugin-graph": "0.8.4-main.
|
|
91
|
-
"@dxos/
|
|
92
|
-
"@dxos/plugin-space": "0.8.4-main.
|
|
93
|
-
"@dxos/plugin-
|
|
94
|
-
"@dxos/
|
|
95
|
-
"@dxos/
|
|
96
|
-
"@dxos/plugin-
|
|
97
|
-
"@dxos/
|
|
98
|
-
"@dxos/react-client": "0.8.4-main.
|
|
99
|
-
"@dxos/react-
|
|
100
|
-
"@dxos/react-ui-
|
|
101
|
-
"@dxos/react-ui-form": "0.8.4-main.
|
|
102
|
-
"@dxos/react-ui-
|
|
103
|
-
"@dxos/react-ui-
|
|
104
|
-
"@dxos/react-ui-
|
|
105
|
-
"@dxos/react-ui-
|
|
106
|
-
"@dxos/
|
|
107
|
-
"@dxos/rpc
|
|
108
|
-
"@dxos/
|
|
109
|
-
"@dxos/
|
|
67
|
+
"typescript": "^5.9.3",
|
|
68
|
+
"@dxos/ai": "0.8.4-main.406dc2a",
|
|
69
|
+
"@dxos/app-framework": "0.8.4-main.406dc2a",
|
|
70
|
+
"@dxos/async": "0.8.4-main.406dc2a",
|
|
71
|
+
"@dxos/assistant": "0.8.4-main.406dc2a",
|
|
72
|
+
"@dxos/client-protocol": "0.8.4-main.406dc2a",
|
|
73
|
+
"@dxos/compute": "0.8.4-main.406dc2a",
|
|
74
|
+
"@dxos/devtools": "0.8.4-main.406dc2a",
|
|
75
|
+
"@dxos/client": "0.8.4-main.406dc2a",
|
|
76
|
+
"@dxos/debug": "0.8.4-main.406dc2a",
|
|
77
|
+
"@dxos/echo": "0.8.4-main.406dc2a",
|
|
78
|
+
"@dxos/blueprints": "0.8.4-main.406dc2a",
|
|
79
|
+
"@dxos/echo-protocol": "0.8.4-main.406dc2a",
|
|
80
|
+
"@dxos/functions": "0.8.4-main.406dc2a",
|
|
81
|
+
"@dxos/invariant": "0.8.4-main.406dc2a",
|
|
82
|
+
"@dxos/echo-query": "0.8.4-main.406dc2a",
|
|
83
|
+
"@dxos/keys": "0.8.4-main.406dc2a",
|
|
84
|
+
"@dxos/live-object": "0.8.4-main.406dc2a",
|
|
85
|
+
"@dxos/local-storage": "0.8.4-main.406dc2a",
|
|
86
|
+
"@dxos/plugin-assistant": "0.8.4-main.406dc2a",
|
|
87
|
+
"@dxos/plugin-client": "0.8.4-main.406dc2a",
|
|
88
|
+
"@dxos/plugin-deck": "0.8.4-main.406dc2a",
|
|
89
|
+
"@dxos/plugin-explorer": "0.8.4-main.406dc2a",
|
|
90
|
+
"@dxos/plugin-graph": "0.8.4-main.406dc2a",
|
|
91
|
+
"@dxos/log": "0.8.4-main.406dc2a",
|
|
92
|
+
"@dxos/plugin-space": "0.8.4-main.406dc2a",
|
|
93
|
+
"@dxos/plugin-markdown": "0.8.4-main.406dc2a",
|
|
94
|
+
"@dxos/plugin-token-manager": "0.8.4-main.406dc2a",
|
|
95
|
+
"@dxos/protocols": "0.8.4-main.406dc2a",
|
|
96
|
+
"@dxos/plugin-theme": "0.8.4-main.406dc2a",
|
|
97
|
+
"@dxos/plugin-stack": "0.8.4-main.406dc2a",
|
|
98
|
+
"@dxos/react-client": "0.8.4-main.406dc2a",
|
|
99
|
+
"@dxos/react-edge-client": "0.8.4-main.406dc2a",
|
|
100
|
+
"@dxos/react-ui-components": "0.8.4-main.406dc2a",
|
|
101
|
+
"@dxos/react-ui-form": "0.8.4-main.406dc2a",
|
|
102
|
+
"@dxos/react-ui-editor": "0.8.4-main.406dc2a",
|
|
103
|
+
"@dxos/react-ui-menu": "0.8.4-main.406dc2a",
|
|
104
|
+
"@dxos/react-ui-list": "0.8.4-main.406dc2a",
|
|
105
|
+
"@dxos/react-ui-stack": "0.8.4-main.406dc2a",
|
|
106
|
+
"@dxos/react-ui-attention": "0.8.4-main.406dc2a",
|
|
107
|
+
"@dxos/rpc": "0.8.4-main.406dc2a",
|
|
108
|
+
"@dxos/rpc-tunnel": "0.8.4-main.406dc2a",
|
|
109
|
+
"@dxos/schema": "0.8.4-main.406dc2a",
|
|
110
|
+
"@dxos/util": "0.8.4-main.406dc2a",
|
|
111
|
+
"@dxos/vendor-quickjs": "0.8.4-main.406dc2a",
|
|
112
|
+
"@dxos/react-ui-syntax-highlighter": "0.8.4-main.406dc2a"
|
|
110
113
|
},
|
|
111
114
|
"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-theme": "0.8.4-main.
|
|
123
|
-
"@dxos/
|
|
115
|
+
"@effect-rx/rx-react": "0.42.4",
|
|
116
|
+
"@effect/platform": "0.92.1",
|
|
117
|
+
"@types/react": "~19.2.2",
|
|
118
|
+
"@types/react-dom": "~19.2.1",
|
|
119
|
+
"effect": "3.18.3",
|
|
120
|
+
"react": "~19.2.0",
|
|
121
|
+
"react-dom": "~19.2.0",
|
|
122
|
+
"vite": "7.1.9",
|
|
123
|
+
"@dxos/echo-db": "0.8.4-main.406dc2a",
|
|
124
|
+
"@dxos/react-ui": "0.8.4-main.406dc2a",
|
|
125
|
+
"@dxos/react-ui-theme": "0.8.4-main.406dc2a",
|
|
126
|
+
"@dxos/random": "0.8.4-main.406dc2a",
|
|
127
|
+
"@dxos/storybook-utils": "0.8.4-main.406dc2a"
|
|
124
128
|
},
|
|
125
129
|
"peerDependencies": {
|
|
126
130
|
"@effect-rx/rx-react": "^0.34.1",
|
|
127
131
|
"@effect/platform": "^0.80.12",
|
|
128
132
|
"effect": "^3.13.3",
|
|
129
|
-
"react": "
|
|
130
|
-
"react-dom": "
|
|
131
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
132
|
-
"@dxos/react-ui
|
|
133
|
+
"react": "^19.0.0",
|
|
134
|
+
"react-dom": "^19.0.0",
|
|
135
|
+
"@dxos/react-ui-theme": "0.8.4-main.406dc2a",
|
|
136
|
+
"@dxos/react-ui": "0.8.4-main.406dc2a"
|
|
133
137
|
},
|
|
134
138
|
"publishConfig": {
|
|
135
139
|
"access": "public"
|
package/src/ScriptPlugin.tsx
CHANGED
|
@@ -2,79 +2,114 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { Schema } from 'effect';
|
|
6
|
-
|
|
7
5
|
import { Capabilities, Events, contributes, createIntent, defineModule, definePlugin } from '@dxos/app-framework';
|
|
8
6
|
import { Ref } from '@dxos/echo';
|
|
9
7
|
import { ScriptType } from '@dxos/functions';
|
|
10
8
|
import { ClientEvents } from '@dxos/plugin-client';
|
|
11
9
|
import { SpaceCapabilities } from '@dxos/plugin-space';
|
|
12
10
|
import { defineObjectForm } from '@dxos/plugin-space/types';
|
|
11
|
+
import { isNonNullable } from '@dxos/util';
|
|
13
12
|
|
|
14
|
-
import {
|
|
13
|
+
import {
|
|
14
|
+
AppGraphBuilder,
|
|
15
|
+
BlueprintDefinition,
|
|
16
|
+
Compiler,
|
|
17
|
+
IntentResolver,
|
|
18
|
+
ReactSurface,
|
|
19
|
+
ScriptSettings,
|
|
20
|
+
} from './capabilities';
|
|
15
21
|
import { ScriptEvents } from './events';
|
|
16
22
|
import { meta } from './meta';
|
|
17
23
|
import { translations } from './translations';
|
|
18
|
-
import { ScriptAction } from './types';
|
|
24
|
+
import { Notebook, ScriptAction } from './types';
|
|
19
25
|
|
|
20
|
-
export const ScriptPlugin = () =>
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
26
|
+
export const ScriptPlugin = definePlugin(meta, () => [
|
|
27
|
+
defineModule({
|
|
28
|
+
id: `${meta.id}/module/settings`,
|
|
29
|
+
activatesOn: Events.SetupSettings,
|
|
30
|
+
activate: ScriptSettings,
|
|
31
|
+
}),
|
|
32
|
+
defineModule({
|
|
33
|
+
id: `${meta.id}/module/compiler`,
|
|
34
|
+
activatesOn: ScriptEvents.SetupCompiler,
|
|
35
|
+
activate: Compiler,
|
|
36
|
+
}),
|
|
37
|
+
defineModule({
|
|
38
|
+
id: `${meta.id}/module/translations`,
|
|
39
|
+
activatesOn: Events.SetupTranslations,
|
|
40
|
+
activate: () => contributes(Capabilities.Translations, translations),
|
|
41
|
+
}),
|
|
42
|
+
defineModule({
|
|
43
|
+
id: `${meta.id}/module/metadata`,
|
|
44
|
+
activatesOn: Events.SetupMetadata,
|
|
45
|
+
activate: () => [
|
|
46
|
+
contributes(Capabilities.Metadata, {
|
|
47
|
+
id: ScriptType.typename,
|
|
48
|
+
metadata: {
|
|
49
|
+
icon: 'ph--code--regular',
|
|
50
|
+
// TODO(wittjosiah): Move out of metadata.
|
|
51
|
+
loadReferences: async (script: ScriptType) => await Ref.Array.loadAll([script.source]),
|
|
52
|
+
},
|
|
53
|
+
}),
|
|
54
|
+
contributes(Capabilities.Metadata, {
|
|
55
|
+
id: Notebook.Notebook.typename,
|
|
56
|
+
metadata: {
|
|
57
|
+
icon: 'ph--notebook--regular',
|
|
58
|
+
// TODO(wittjosiah): Move out of metadata.
|
|
59
|
+
loadReferences: async (notebook: Notebook.Notebook) =>
|
|
60
|
+
await Ref.Array.loadAll(
|
|
61
|
+
notebook.cells.flatMap((cell) => [cell.script, cell.view, cell.chat].filter(isNonNullable)) as any,
|
|
62
|
+
),
|
|
63
|
+
},
|
|
64
|
+
}),
|
|
65
|
+
],
|
|
66
|
+
}),
|
|
67
|
+
defineModule({
|
|
68
|
+
id: `${meta.id}/module/app-graph-builder`,
|
|
69
|
+
activatesOn: Events.SetupAppGraph,
|
|
70
|
+
activate: AppGraphBuilder,
|
|
71
|
+
}),
|
|
72
|
+
defineModule({
|
|
73
|
+
id: `${meta.id}/module/script/object-form`,
|
|
74
|
+
activatesOn: ClientEvents.SetupSchema,
|
|
75
|
+
activate: () =>
|
|
76
|
+
contributes(
|
|
77
|
+
SpaceCapabilities.ObjectForm,
|
|
78
|
+
defineObjectForm({
|
|
79
|
+
objectSchema: ScriptType,
|
|
80
|
+
formSchema: ScriptAction.ScriptProps,
|
|
81
|
+
getIntent: (props, options) => createIntent(ScriptAction.CreateScript, { ...props, space: options.space }),
|
|
82
|
+
}),
|
|
83
|
+
),
|
|
84
|
+
}),
|
|
85
|
+
defineModule({
|
|
86
|
+
id: `${meta.id}/module/notebook/object-form`,
|
|
87
|
+
activatesOn: ClientEvents.SetupSchema,
|
|
88
|
+
activate: () =>
|
|
89
|
+
contributes(
|
|
90
|
+
SpaceCapabilities.ObjectForm,
|
|
91
|
+
defineObjectForm({
|
|
92
|
+
objectSchema: Notebook.Notebook,
|
|
93
|
+
formSchema: ScriptAction.NotebookProps,
|
|
94
|
+
getIntent: (props, options) => createIntent(ScriptAction.CreateNotebook, { ...props, space: options.space }),
|
|
48
95
|
}),
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
id: `${meta.id}/module/react-surface`,
|
|
70
|
-
activatesOn: Events.SetupReactSurface,
|
|
71
|
-
// TODO(wittjosiah): Should occur before the script editor is loaded when surfaces activation is more granular.
|
|
72
|
-
activatesBefore: [ScriptEvents.SetupCompiler],
|
|
73
|
-
activate: ReactSurface,
|
|
74
|
-
}),
|
|
75
|
-
defineModule({
|
|
76
|
-
id: `${meta.id}/module/intent-resolver`,
|
|
77
|
-
activatesOn: Events.SetupIntentResolver,
|
|
78
|
-
activate: IntentResolver,
|
|
79
|
-
}),
|
|
80
|
-
]);
|
|
96
|
+
),
|
|
97
|
+
}),
|
|
98
|
+
defineModule({
|
|
99
|
+
id: `${meta.id}/module/react-surface`,
|
|
100
|
+
activatesOn: Events.SetupReactSurface,
|
|
101
|
+
// TODO(wittjosiah): Should occur before the script editor is loaded when surfaces activation is more granular.
|
|
102
|
+
activatesBefore: [ScriptEvents.SetupCompiler],
|
|
103
|
+
activate: ReactSurface,
|
|
104
|
+
}),
|
|
105
|
+
defineModule({
|
|
106
|
+
id: `${meta.id}/module/intent-resolver`,
|
|
107
|
+
activatesOn: Events.SetupIntentResolver,
|
|
108
|
+
activate: IntentResolver,
|
|
109
|
+
}),
|
|
110
|
+
defineModule({
|
|
111
|
+
id: `${meta.id}/module/blueprint`,
|
|
112
|
+
activatesOn: Events.SetupArtifactDefinition,
|
|
113
|
+
activate: BlueprintDefinition,
|
|
114
|
+
}),
|
|
115
|
+
]);
|
|
@@ -3,7 +3,8 @@
|
|
|
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
9
|
import { Capabilities, type PluginContext, contributes } from '@dxos/app-framework';
|
|
9
10
|
import { Obj } from '@dxos/echo';
|
|
@@ -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) => [
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// ISSUE(burdon): defineArtifact
|
|
6
6
|
// @ts-nocheck
|
|
7
7
|
|
|
8
|
-
import
|
|
8
|
+
import * as Schema from 'effect/Schema';
|
|
9
9
|
|
|
10
10
|
import { ToolResult, createTool } from '@dxos/ai';
|
|
11
11
|
import { Capabilities, type PromiseIntentDispatcher, contributes, createIntent } from '@dxos/app-framework';
|
|
@@ -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
|
+
};
|
|
@@ -5,6 +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 BlueprintDefinition = lazy(() => import('./blueprint-definition'));
|
|
8
9
|
export const Compiler = lazy(() => import('./compiler'));
|
|
9
10
|
export const IntentResolver = lazy(() => import('./intent-resolver'));
|
|
10
11
|
export const ReactSurface = lazy(() => import('./react-surface'));
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { Octokit } from '@octokit/core';
|
|
6
|
-
import
|
|
6
|
+
import * as Predicate from 'effect/Predicate';
|
|
7
7
|
|
|
8
8
|
import { Capabilities, LayoutAction, contributes, createIntent, createResolver } from '@dxos/app-framework';
|
|
9
9
|
import { Obj, Ref } from '@dxos/echo';
|
|
@@ -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
|
|
|
@@ -41,7 +41,7 @@ export default () =>
|
|
|
41
41
|
const template = templates.find((template) => template.id === initialTemplateId);
|
|
42
42
|
if (template) {
|
|
43
43
|
content = template.source;
|
|
44
|
-
name = template.name;
|
|
44
|
+
name = name || template.name;
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
|
|
@@ -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 }) => {
|
|
@@ -16,6 +16,7 @@ import { type DataType } from '@dxos/schema';
|
|
|
16
16
|
import {
|
|
17
17
|
DEPLOYMENT_DIALOG,
|
|
18
18
|
DeploymentDialog,
|
|
19
|
+
NotebookContainer,
|
|
19
20
|
ScriptContainer,
|
|
20
21
|
ScriptObjectSettings,
|
|
21
22
|
ScriptPluginSettings,
|
|
@@ -23,7 +24,7 @@ import {
|
|
|
23
24
|
TestContainer,
|
|
24
25
|
} from '../components';
|
|
25
26
|
import { meta } from '../meta';
|
|
26
|
-
import { type
|
|
27
|
+
import { Notebook, type ScriptSettings } from '../types';
|
|
27
28
|
|
|
28
29
|
import { ScriptCapabilities } from './capabilities';
|
|
29
30
|
|
|
@@ -32,21 +33,32 @@ export default () =>
|
|
|
32
33
|
createSurface({
|
|
33
34
|
id: `${meta.id}/plugin-settings`,
|
|
34
35
|
role: 'article',
|
|
35
|
-
filter: (data): data is { subject: SettingsStore<
|
|
36
|
+
filter: (data): data is { subject: SettingsStore<ScriptSettings> } =>
|
|
36
37
|
data.subject instanceof SettingsStore && data.subject.prefix === meta.id,
|
|
37
38
|
component: ({ data: { subject } }) => <ScriptPluginSettings settings={subject.value} />,
|
|
38
39
|
}),
|
|
39
40
|
createSurface({
|
|
40
|
-
id: `${meta.id}/article`,
|
|
41
|
-
role: 'article',
|
|
41
|
+
id: `${meta.id}/script/article`,
|
|
42
|
+
role: ['article', 'section'],
|
|
42
43
|
filter: (data): data is { subject: ScriptType } => Obj.instanceOf(ScriptType, data.subject),
|
|
43
44
|
component: ({ data, role }) => {
|
|
44
45
|
const compiler = useCapability(ScriptCapabilities.Compiler);
|
|
45
46
|
// TODO(dmaretskyi): Since settings store is not reactive, this would break on the script plugin being enabled without a page reload.
|
|
46
|
-
const settings = useCapability(Capabilities.SettingsStore).getStore<
|
|
47
|
+
const settings = useCapability(Capabilities.SettingsStore).getStore<ScriptSettings>(meta.id)?.value;
|
|
47
48
|
return <ScriptContainer role={role} script={data.subject} settings={settings} env={compiler.environment} />;
|
|
48
49
|
},
|
|
49
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?
|
|
50
62
|
createSurface({
|
|
51
63
|
id: `${meta.id}/companion/base-settings`,
|
|
52
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
|
};
|
|
@@ -2,38 +2,52 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@
|
|
6
|
-
|
|
7
|
-
import { type Meta } from '@storybook/react-vite';
|
|
5
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
6
|
import React from 'react';
|
|
9
7
|
|
|
8
|
+
import { IntentPlugin } from '@dxos/app-framework';
|
|
9
|
+
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
10
|
+
import { Obj } from '@dxos/echo';
|
|
11
|
+
import { ClientPlugin } from '@dxos/plugin-client';
|
|
10
12
|
import { Dialog } from '@dxos/react-ui';
|
|
11
|
-
import {
|
|
13
|
+
import { withTheme } from '@dxos/react-ui/testing';
|
|
14
|
+
import { DataType } from '@dxos/schema';
|
|
12
15
|
|
|
13
16
|
import { translations } from '../../translations';
|
|
14
|
-
import { DeploymentDialog } from '../DeploymentDialog/DeploymentDialog';
|
|
15
17
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
{ label: 'Script 1', templateId: 'template1' },
|
|
21
|
-
{ label: 'Script 2', templateId: 'template2' },
|
|
22
|
-
{ label: 'Script 3', templateId: 'template3' },
|
|
23
|
-
],
|
|
24
|
-
},
|
|
25
|
-
render: (args: any) => (
|
|
18
|
+
import { DeploymentDialog, type DeploymentDialogProps } from './DeploymentDialog';
|
|
19
|
+
|
|
20
|
+
const DefaultStory = (props: DeploymentDialogProps) => {
|
|
21
|
+
return (
|
|
26
22
|
<Dialog.Root defaultOpen={true}>
|
|
27
|
-
<DeploymentDialog {...
|
|
23
|
+
<DeploymentDialog {...props} />
|
|
28
24
|
</Dialog.Root>
|
|
29
|
-
)
|
|
25
|
+
);
|
|
30
26
|
};
|
|
31
27
|
|
|
32
|
-
const meta
|
|
28
|
+
const meta = {
|
|
33
29
|
title: 'plugins/plugin-script/DeploymentDialog',
|
|
34
30
|
component: DeploymentDialog,
|
|
31
|
+
render: DefaultStory,
|
|
35
32
|
parameters: { translations },
|
|
36
|
-
|
|
37
|
-
}
|
|
33
|
+
// TODO(wittjosiah): Try to write story which does not depend on plugin manager.
|
|
34
|
+
decorators: [withTheme, withPluginManager({ plugins: [IntentPlugin(), ClientPlugin({})] })],
|
|
35
|
+
} satisfies Meta<typeof DefaultStory>;
|
|
38
36
|
|
|
39
37
|
export default meta;
|
|
38
|
+
|
|
39
|
+
type Story = StoryObj<typeof meta>;
|
|
40
|
+
|
|
41
|
+
export const Default: Story = {
|
|
42
|
+
args: {
|
|
43
|
+
accessToken: Obj.make(DataType.AccessToken, {
|
|
44
|
+
source: 'example.com',
|
|
45
|
+
token: 'example-token',
|
|
46
|
+
}),
|
|
47
|
+
scriptTemplates: [
|
|
48
|
+
{ id: 't-1', name: 'Script 1', source: 'template1' },
|
|
49
|
+
{ id: 't-2', name: 'Script 2', source: 'template2' },
|
|
50
|
+
{ id: 't-3', name: 'Script 3', source: 'template3' },
|
|
51
|
+
],
|
|
52
|
+
},
|
|
53
|
+
};
|