@dxos/plugin-script 0.8.4-main.5ea62a8 → 0.8.4-main.ae835ea
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-E5NXT4UQ.mjs +14 -0
- package/dist/lib/browser/NotebookContainer-C36N7AFF.mjs +817 -0
- package/dist/lib/browser/NotebookContainer-C36N7AFF.mjs.map +7 -0
- package/dist/lib/browser/ScriptContainer-4YPRUM3C.mjs +148 -0
- package/dist/lib/browser/ScriptContainer-4YPRUM3C.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-builder-IABOSTBK.mjs → app-graph-builder-LEOPGBJD.mjs} +10 -8
- package/dist/lib/browser/app-graph-builder-LEOPGBJD.mjs.map +7 -0
- package/dist/lib/browser/{blueprint-definition-AR7ITBCD.mjs → blueprint-definition-6PZWZM2Y.mjs} +5 -3
- package/dist/lib/{node-esm/blueprint-definition-TJY4TX6S.mjs.map → browser/blueprint-definition-6PZWZM2Y.mjs.map} +1 -1
- package/dist/lib/browser/chunk-5S5YQNJZ.mjs +304 -0
- package/dist/lib/browser/chunk-5S5YQNJZ.mjs.map +7 -0
- package/dist/lib/browser/{chunk-6CAH7VIE.mjs → chunk-A5K3TXYA.mjs} +20 -34
- package/dist/lib/browser/chunk-A5K3TXYA.mjs.map +7 -0
- package/dist/lib/browser/{chunk-QYAREHGH.mjs → chunk-EB6AXFXO.mjs} +8 -5
- package/dist/lib/browser/chunk-EB6AXFXO.mjs.map +7 -0
- package/dist/lib/browser/chunk-HCURXADW.mjs +102 -0
- package/dist/lib/browser/chunk-HCURXADW.mjs.map +7 -0
- package/dist/lib/browser/{chunk-TH7GXPE3.mjs → chunk-HHTOAI2J.mjs} +126 -38
- package/dist/lib/browser/chunk-HHTOAI2J.mjs.map +7 -0
- package/dist/lib/browser/{chunk-YCZPTTFO.mjs → chunk-IQMYIWHG.mjs} +14 -14
- package/dist/lib/browser/chunk-IQMYIWHG.mjs.map +7 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/browser/chunk-LI4P25M5.mjs +111 -0
- package/dist/lib/browser/chunk-LI4P25M5.mjs.map +7 -0
- package/dist/lib/browser/{chunk-NXKU3BNX.mjs → chunk-Q2DGRQRN.mjs} +47 -14
- package/dist/lib/browser/chunk-Q2DGRQRN.mjs.map +7 -0
- package/dist/lib/browser/chunk-ST3ACVUC.mjs +88 -0
- package/dist/lib/browser/chunk-ST3ACVUC.mjs.map +7 -0
- package/dist/lib/browser/{chunk-5TVBECWH.mjs → chunk-UOQ6NCH3.mjs} +2 -2
- package/dist/lib/browser/{compiler-2HJH34GM.mjs → compiler-Q4UY2COU.mjs} +12 -24
- package/dist/lib/{node-esm/compiler-7SP27RA6.mjs.map → browser/compiler-Q4UY2COU.mjs.map} +2 -2
- package/dist/lib/browser/index.mjs +105 -41
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-YMK5SXVC.mjs → intent-resolver-AMMHATM7.mjs} +39 -23
- package/dist/lib/browser/intent-resolver-AMMHATM7.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-FEM5WWFH.mjs → react-surface-X4NATU6B.mjs} +43 -19
- package/dist/lib/browser/react-surface-X4NATU6B.mjs.map +7 -0
- package/dist/lib/browser/{settings-KCTBK5TY.mjs → settings-6UXY7F7D.mjs} +10 -8
- package/dist/lib/browser/settings-6UXY7F7D.mjs.map +7 -0
- package/dist/lib/browser/templates/index.mjs +2 -1
- package/dist/lib/browser/types/index.mjs +8 -4
- package/dist/lib/node-esm/DeploymentDialog-OSHHSEBH.mjs +15 -0
- package/dist/lib/node-esm/DeploymentDialog-OSHHSEBH.mjs.map +7 -0
- package/dist/lib/node-esm/NotebookContainer-FOVFGJQR.mjs +818 -0
- package/dist/lib/node-esm/NotebookContainer-FOVFGJQR.mjs.map +7 -0
- package/dist/lib/node-esm/ScriptContainer-EW24D5II.mjs +149 -0
- package/dist/lib/node-esm/ScriptContainer-EW24D5II.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-builder-CQTTAYHP.mjs → app-graph-builder-XJ3MY5BM.mjs} +10 -8
- package/dist/lib/node-esm/app-graph-builder-XJ3MY5BM.mjs.map +7 -0
- package/dist/lib/node-esm/{blueprint-definition-TJY4TX6S.mjs → blueprint-definition-5R6YCSZZ.mjs} +4 -3
- package/dist/lib/{browser/blueprint-definition-AR7ITBCD.mjs.map → node-esm/blueprint-definition-5R6YCSZZ.mjs.map} +1 -1
- 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-35M3CHYE.mjs → chunk-55JZVM6K.mjs} +2 -2
- package/dist/lib/node-esm/chunk-EJLYOSD7.mjs +113 -0
- package/dist/lib/node-esm/chunk-EJLYOSD7.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-2GBESIHU.mjs → chunk-GA27XSEY.mjs} +20 -34
- package/dist/lib/node-esm/chunk-GA27XSEY.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-AHXJ6NQU.mjs → chunk-IBV2DR36.mjs} +8 -5
- package/dist/lib/node-esm/chunk-IBV2DR36.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-N2XLVOFB.mjs +103 -0
- package/dist/lib/node-esm/chunk-N2XLVOFB.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-M642JUOZ.mjs → chunk-O7HXE72S.mjs} +47 -14
- package/dist/lib/node-esm/chunk-O7HXE72S.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-6M2R2FQF.mjs → chunk-OZ6LCME4.mjs} +126 -38
- package/dist/lib/node-esm/chunk-OZ6LCME4.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-TUGLYZDT.mjs +305 -0
- package/dist/lib/node-esm/chunk-TUGLYZDT.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-ZA36GO4T.mjs → chunk-UEGPBCSF.mjs} +14 -14
- package/dist/lib/node-esm/chunk-UEGPBCSF.mjs.map +7 -0
- package/dist/lib/node-esm/{compiler-7SP27RA6.mjs → compiler-I6A4KE6E.mjs} +12 -24
- package/dist/lib/{browser/compiler-2HJH34GM.mjs.map → node-esm/compiler-I6A4KE6E.mjs.map} +2 -2
- package/dist/lib/node-esm/index.mjs +105 -41
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-SKRDYQCZ.mjs → intent-resolver-YKLZQR7U.mjs} +39 -23
- package/dist/lib/node-esm/intent-resolver-YKLZQR7U.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-surface-AOKMDJR4.mjs → react-surface-LVGLBSTE.mjs} +43 -19
- package/dist/lib/node-esm/react-surface-LVGLBSTE.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-DXZ334A3.mjs → settings-O4EZPUE3.mjs} +10 -8
- package/dist/lib/node-esm/settings-O4EZPUE3.mjs.map +7 -0
- package/dist/lib/node-esm/templates/index.mjs +2 -1
- package/dist/lib/node-esm/types/index.mjs +8 -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.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/components/DeploymentDialog/DeploymentDialog.d.ts +1 -1
- package/dist/types/src/components/DeploymentDialog/DeploymentDialog.d.ts.map +1 -1
- package/dist/types/src/components/DeploymentDialog/DeploymentDialog.stories.d.ts +110 -7
- package/dist/types/src/components/DeploymentDialog/DeploymentDialog.stories.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 +251 -0
- package/dist/types/src/components/NotebookContainer.stories.d.ts.map +1 -0
- package/dist/types/src/components/NotebookStack/NotebookCell.d.ts +15 -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 +245 -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 +4 -4
- package/dist/types/src/components/ScriptContainer.d.ts.map +1 -1
- package/dist/types/src/components/ScriptToolbar/ScriptToolbar.d.ts +5 -6
- package/dist/types/src/components/ScriptToolbar/ScriptToolbar.d.ts.map +1 -1
- package/dist/types/src/components/ScriptToolbar/ScriptToolbar.stories.d.ts +237 -2
- package/dist/types/src/components/ScriptToolbar/ScriptToolbar.stories.d.ts.map +1 -1
- package/dist/types/src/components/Settings/ScriptObjectSettings.d.ts +2 -2
- 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 +2 -2
- 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 +3 -3
- package/dist/types/src/components/TypescriptEditor/TypescriptEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +2 -0
- 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 -11
- package/dist/types/src/hooks/deploy.d.ts.map +1 -1
- package/dist/types/src/hooks/format.d.ts +2 -2
- package/dist/types/src/hooks/format.d.ts.map +1 -1
- package/dist/types/src/hooks/template.d.ts +4 -14
- 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/compute-graph.d.ts +45 -0
- package/dist/types/src/notebook/compute-graph.d.ts.map +1 -0
- package/dist/types/src/notebook/compute-graph.test.d.ts +2 -0
- package/dist/types/src/notebook/compute-graph.test.d.ts.map +1 -0
- 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/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 +3 -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 +29 -5
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Notebook.d.ts +31 -0
- package/dist/types/src/types/Notebook.d.ts.map +1 -0
- package/dist/types/src/types/actions.d.ts +54 -0
- package/dist/types/src/types/actions.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +3 -1
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +6 -0
- package/dist/types/src/types/types.d.ts.map +1 -0
- package/dist/types/src/util/deploy.d.ts +4 -4
- package/dist/types/src/util/deploy.d.ts.map +1 -1
- package/dist/types/src/util/functions.d.ts +6 -3
- package/dist/types/src/util/functions.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +75 -68
- package/src/ScriptPlugin.tsx +88 -69
- package/src/capabilities/app-graph-builder.ts +7 -6
- package/src/capabilities/artifact-definition.ts +1 -1
- package/src/capabilities/intent-resolver.ts +20 -11
- package/src/capabilities/react-surface.tsx +25 -13
- package/src/capabilities/settings.ts +3 -3
- package/src/components/DeploymentDialog/DeploymentDialog.stories.tsx +11 -4
- package/src/components/DeploymentDialog/DeploymentDialog.tsx +11 -17
- package/src/components/NotebookContainer.stories.tsx +83 -0
- package/src/components/NotebookContainer.tsx +263 -0
- package/src/components/NotebookStack/NotebookCell.tsx +208 -0
- package/src/components/NotebookStack/NotebookMenu.tsx +47 -0
- package/src/components/NotebookStack/NotebookStack.stories.tsx +54 -0
- package/src/components/NotebookStack/NotebookStack.tsx +86 -0
- package/src/components/NotebookStack/index.ts +6 -0
- package/src/components/ScriptContainer.tsx +5 -5
- package/src/components/ScriptToolbar/ScriptToolbar.stories.tsx +22 -10
- package/src/components/ScriptToolbar/ScriptToolbar.tsx +24 -27
- package/src/components/Settings/ScriptObjectSettings.tsx +95 -11
- package/src/components/Settings/ScriptPluginSettings.tsx +4 -19
- package/src/components/TestPanel/TestContainer.tsx +2 -2
- package/src/components/TestPanel/TestPanel.tsx +7 -7
- package/src/components/TypescriptEditor/TypescriptEditor.stories.tsx +71 -16
- package/src/components/TypescriptEditor/TypescriptEditor.tsx +36 -34
- package/src/components/index.ts +3 -0
- package/src/events.ts +2 -2
- package/src/hooks/deploy.ts +14 -15
- package/src/hooks/format.ts +4 -4
- package/src/hooks/template.ts +6 -15
- package/src/hooks/useCreateAndDeployScriptTemplates.ts +5 -5
- package/src/index.ts +1 -0
- package/src/meta.ts +7 -5
- package/src/notebook/compute-graph.test.ts +70 -0
- package/src/notebook/compute-graph.ts +206 -0
- package/src/notebook/eval.ts +105 -0
- package/src/notebook/index.ts +5 -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 +9 -1
- package/src/templates/forex-effect.ts +5 -1
- package/src/templates/forex.ts +2 -0
- package/src/templates/gmail.ts +21 -9
- package/src/templates/index.ts +6 -6
- package/src/testing/data.ts +72 -0
- package/src/testing/index.ts +5 -0
- package/src/translations.ts +32 -7
- package/src/types/Notebook.ts +41 -0
- package/src/types/actions.ts +53 -0
- package/src/types/index.ts +3 -1
- package/src/types/types.ts +15 -0
- package/src/util/deploy.ts +11 -15
- package/src/util/functions.ts +33 -4
- package/dist/lib/browser/DeploymentDialog-QZSTVNIS.mjs +0 -12
- package/dist/lib/browser/ScriptContainer-JUPCBUCP.mjs +0 -263
- package/dist/lib/browser/ScriptContainer-JUPCBUCP.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-IABOSTBK.mjs.map +0 -7
- package/dist/lib/browser/chunk-6CAH7VIE.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-NXKU3BNX.mjs.map +0 -7
- package/dist/lib/browser/chunk-QYAREHGH.mjs.map +0 -7
- package/dist/lib/browser/chunk-RNGIQIEJ.mjs +0 -88
- package/dist/lib/browser/chunk-RNGIQIEJ.mjs.map +0 -7
- package/dist/lib/browser/chunk-TH7GXPE3.mjs.map +0 -7
- package/dist/lib/browser/chunk-YCZPTTFO.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-YMK5SXVC.mjs.map +0 -7
- package/dist/lib/browser/react-surface-FEM5WWFH.mjs.map +0 -7
- package/dist/lib/browser/settings-KCTBK5TY.mjs.map +0 -7
- package/dist/lib/node-esm/DeploymentDialog-G6EHEPXN.mjs +0 -13
- package/dist/lib/node-esm/ScriptContainer-UXZUDQF6.mjs +0 -264
- package/dist/lib/node-esm/ScriptContainer-UXZUDQF6.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-CQTTAYHP.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-2GBESIHU.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-6M2R2FQF.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-AHXJ6NQU.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-GWHLP5LM.mjs +0 -90
- package/dist/lib/node-esm/chunk-GWHLP5LM.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-M642JUOZ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ZA36GO4T.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-SKRDYQCZ.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-AOKMDJR4.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/types/src/types/schema.d.ts +0 -38
- package/dist/types/src/types/schema.d.ts.map +0 -1
- package/src/types/schema.ts +0 -37
- /package/dist/lib/browser/{DeploymentDialog-QZSTVNIS.mjs.map → DeploymentDialog-E5NXT4UQ.mjs.map} +0 -0
- /package/dist/lib/{node-esm/DeploymentDialog-G6EHEPXN.mjs.map → browser/chunk-J5LGTIGS.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-5TVBECWH.mjs.map → chunk-UOQ6NCH3.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-35M3CHYE.mjs.map → chunk-55JZVM6K.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.ae835ea",
|
|
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,79 @@
|
|
|
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/
|
|
69
|
-
"@dxos/assistant": "0.8.4-main.
|
|
70
|
-
"@dxos/async": "0.8.4-main.
|
|
71
|
-
"@dxos/
|
|
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/
|
|
77
|
-
"@dxos/
|
|
78
|
-
"@dxos/echo": "0.8.4-main.
|
|
79
|
-
"@dxos/echo-protocol": "0.8.4-main.
|
|
80
|
-
"@dxos/echo-
|
|
81
|
-
"@dxos/
|
|
82
|
-
"@dxos/
|
|
83
|
-
"@dxos/keys": "0.8.4-main.
|
|
84
|
-
"@dxos/local-storage": "0.8.4-main.
|
|
85
|
-
"@dxos/
|
|
86
|
-
"@dxos/
|
|
87
|
-
"@dxos/
|
|
88
|
-
"@dxos/plugin-
|
|
89
|
-
"@dxos/plugin-deck": "0.8.4-main.
|
|
90
|
-
"@dxos/plugin-
|
|
91
|
-
"@dxos/plugin-
|
|
92
|
-
"@dxos/plugin-
|
|
93
|
-
"@dxos/plugin-
|
|
94
|
-
"@dxos/plugin-
|
|
95
|
-
"@dxos/plugin-theme": "0.8.4-main.
|
|
96
|
-
"@dxos/
|
|
97
|
-
"@dxos/protocols": "0.8.4-main.
|
|
98
|
-
"@dxos/
|
|
99
|
-
"@dxos/
|
|
100
|
-
"@dxos/react-ui-
|
|
101
|
-
"@dxos/react-ui-
|
|
102
|
-
"@dxos/react-ui-
|
|
103
|
-
"@dxos/react-ui-
|
|
104
|
-
"@dxos/react-ui-
|
|
105
|
-
"@dxos/
|
|
106
|
-
"@dxos/
|
|
107
|
-
"@dxos/
|
|
108
|
-
"@dxos/react-ui-
|
|
109
|
-
"@dxos/
|
|
67
|
+
"typescript": "^5.9.3",
|
|
68
|
+
"@dxos/app-framework": "0.8.4-main.ae835ea",
|
|
69
|
+
"@dxos/assistant": "0.8.4-main.ae835ea",
|
|
70
|
+
"@dxos/async": "0.8.4-main.ae835ea",
|
|
71
|
+
"@dxos/assistant-toolkit": "0.8.4-main.ae835ea",
|
|
72
|
+
"@dxos/blueprints": "0.8.4-main.ae835ea",
|
|
73
|
+
"@dxos/client": "0.8.4-main.ae835ea",
|
|
74
|
+
"@dxos/client-protocol": "0.8.4-main.ae835ea",
|
|
75
|
+
"@dxos/compute": "0.8.4-main.ae835ea",
|
|
76
|
+
"@dxos/devtools": "0.8.4-main.ae835ea",
|
|
77
|
+
"@dxos/debug": "0.8.4-main.ae835ea",
|
|
78
|
+
"@dxos/echo": "0.8.4-main.ae835ea",
|
|
79
|
+
"@dxos/echo-protocol": "0.8.4-main.ae835ea",
|
|
80
|
+
"@dxos/echo-query": "0.8.4-main.ae835ea",
|
|
81
|
+
"@dxos/functions": "0.8.4-main.ae835ea",
|
|
82
|
+
"@dxos/invariant": "0.8.4-main.ae835ea",
|
|
83
|
+
"@dxos/keys": "0.8.4-main.ae835ea",
|
|
84
|
+
"@dxos/local-storage": "0.8.4-main.ae835ea",
|
|
85
|
+
"@dxos/live-object": "0.8.4-main.ae835ea",
|
|
86
|
+
"@dxos/plugin-automation": "0.8.4-main.ae835ea",
|
|
87
|
+
"@dxos/log": "0.8.4-main.ae835ea",
|
|
88
|
+
"@dxos/plugin-assistant": "0.8.4-main.ae835ea",
|
|
89
|
+
"@dxos/plugin-deck": "0.8.4-main.ae835ea",
|
|
90
|
+
"@dxos/plugin-client": "0.8.4-main.ae835ea",
|
|
91
|
+
"@dxos/plugin-explorer": "0.8.4-main.ae835ea",
|
|
92
|
+
"@dxos/plugin-graph": "0.8.4-main.ae835ea",
|
|
93
|
+
"@dxos/plugin-markdown": "0.8.4-main.ae835ea",
|
|
94
|
+
"@dxos/plugin-space": "0.8.4-main.ae835ea",
|
|
95
|
+
"@dxos/plugin-theme": "0.8.4-main.ae835ea",
|
|
96
|
+
"@dxos/plugin-token-manager": "0.8.4-main.ae835ea",
|
|
97
|
+
"@dxos/protocols": "0.8.4-main.ae835ea",
|
|
98
|
+
"@dxos/plugin-stack": "0.8.4-main.ae835ea",
|
|
99
|
+
"@dxos/ai": "0.8.4-main.ae835ea",
|
|
100
|
+
"@dxos/react-ui-attention": "0.8.4-main.ae835ea",
|
|
101
|
+
"@dxos/react-ui-components": "0.8.4-main.ae835ea",
|
|
102
|
+
"@dxos/react-ui-editor": "0.8.4-main.ae835ea",
|
|
103
|
+
"@dxos/react-ui-list": "0.8.4-main.ae835ea",
|
|
104
|
+
"@dxos/react-ui-form": "0.8.4-main.ae835ea",
|
|
105
|
+
"@dxos/react-ui-menu": "0.8.4-main.ae835ea",
|
|
106
|
+
"@dxos/react-ui-stack": "0.8.4-main.ae835ea",
|
|
107
|
+
"@dxos/react-client": "0.8.4-main.ae835ea",
|
|
108
|
+
"@dxos/react-ui-syntax-highlighter": "0.8.4-main.ae835ea",
|
|
109
|
+
"@dxos/react-edge-client": "0.8.4-main.ae835ea",
|
|
110
|
+
"@dxos/rpc-tunnel": "0.8.4-main.ae835ea",
|
|
111
|
+
"@dxos/rpc": "0.8.4-main.ae835ea",
|
|
112
|
+
"@dxos/schema": "0.8.4-main.ae835ea",
|
|
113
|
+
"@dxos/util": "0.8.4-main.ae835ea",
|
|
114
|
+
"@dxos/vendor-quickjs": "0.8.4-main.ae835ea"
|
|
110
115
|
},
|
|
111
116
|
"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": "7.1.
|
|
120
|
-
"@dxos/
|
|
121
|
-
"@dxos/
|
|
122
|
-
"@dxos/
|
|
123
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
117
|
+
"@effect-rx/rx-react": "0.42.4",
|
|
118
|
+
"@effect/platform": "0.92.1",
|
|
119
|
+
"@types/react": "~19.2.2",
|
|
120
|
+
"@types/react-dom": "~19.2.2",
|
|
121
|
+
"effect": "3.18.3",
|
|
122
|
+
"react": "~19.2.0",
|
|
123
|
+
"react-dom": "~19.2.0",
|
|
124
|
+
"vite": "7.1.9",
|
|
125
|
+
"@dxos/echo-db": "0.8.4-main.ae835ea",
|
|
126
|
+
"@dxos/plugin-automation": "0.8.4-main.ae835ea",
|
|
127
|
+
"@dxos/random": "0.8.4-main.ae835ea",
|
|
128
|
+
"@dxos/react-ui": "0.8.4-main.ae835ea",
|
|
129
|
+
"@dxos/react-ui-theme": "0.8.4-main.ae835ea",
|
|
130
|
+
"@dxos/storybook-utils": "0.8.4-main.ae835ea"
|
|
124
131
|
},
|
|
125
132
|
"peerDependencies": {
|
|
126
133
|
"@effect-rx/rx-react": "^0.34.1",
|
|
127
134
|
"@effect/platform": "^0.80.12",
|
|
128
135
|
"effect": "^3.13.3",
|
|
129
|
-
"react": "
|
|
130
|
-
"react-dom": "
|
|
131
|
-
"@dxos/react-ui
|
|
132
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
136
|
+
"react": "^19.0.0",
|
|
137
|
+
"react-dom": "^19.0.0",
|
|
138
|
+
"@dxos/react-ui": "0.8.4-main.ae835ea",
|
|
139
|
+
"@dxos/react-ui-theme": "0.8.4-main.ae835ea"
|
|
133
140
|
},
|
|
134
141
|
"publishConfig": {
|
|
135
142
|
"access": "public"
|
package/src/ScriptPlugin.tsx
CHANGED
|
@@ -2,11 +2,9 @@
|
|
|
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
|
-
import {
|
|
7
|
+
import { Script } 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';
|
|
@@ -22,71 +20,92 @@ import {
|
|
|
22
20
|
import { ScriptEvents } from './events';
|
|
23
21
|
import { meta } from './meta';
|
|
24
22
|
import { translations } from './translations';
|
|
25
|
-
import { ScriptAction } from './types';
|
|
23
|
+
import { Notebook, ScriptAction } from './types';
|
|
26
24
|
|
|
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
|
-
|
|
25
|
+
export const ScriptPlugin = definePlugin(meta, () => [
|
|
26
|
+
defineModule({
|
|
27
|
+
id: `${meta.id}/module/settings`,
|
|
28
|
+
activatesOn: Events.SetupSettings,
|
|
29
|
+
activate: ScriptSettings,
|
|
30
|
+
}),
|
|
31
|
+
defineModule({
|
|
32
|
+
id: `${meta.id}/module/compiler`,
|
|
33
|
+
activatesOn: ScriptEvents.SetupCompiler,
|
|
34
|
+
activate: Compiler,
|
|
35
|
+
}),
|
|
36
|
+
defineModule({
|
|
37
|
+
id: `${meta.id}/module/translations`,
|
|
38
|
+
activatesOn: Events.SetupTranslations,
|
|
39
|
+
activate: () => contributes(Capabilities.Translations, translations),
|
|
40
|
+
}),
|
|
41
|
+
defineModule({
|
|
42
|
+
id: `${meta.id}/module/metadata`,
|
|
43
|
+
activatesOn: Events.SetupMetadata,
|
|
44
|
+
activate: () => [
|
|
45
|
+
contributes(Capabilities.Metadata, {
|
|
46
|
+
id: Script.Script.typename,
|
|
47
|
+
metadata: {
|
|
48
|
+
icon: 'ph--code--regular',
|
|
49
|
+
iconHue: 'sky',
|
|
50
|
+
// TODO(wittjosiah): Move out of metadata.
|
|
51
|
+
loadReferences: async (script: Script.Script) => 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
|
+
iconHue: 'sky',
|
|
59
|
+
},
|
|
60
|
+
}),
|
|
61
|
+
],
|
|
62
|
+
}),
|
|
63
|
+
defineModule({
|
|
64
|
+
id: `${meta.id}/module/app-graph-builder`,
|
|
65
|
+
activatesOn: Events.SetupAppGraph,
|
|
66
|
+
activate: AppGraphBuilder,
|
|
67
|
+
}),
|
|
68
|
+
defineModule({
|
|
69
|
+
id: `${meta.id}/module/script/object-form`,
|
|
70
|
+
activatesOn: ClientEvents.SetupSchema,
|
|
71
|
+
activate: () =>
|
|
72
|
+
contributes(
|
|
73
|
+
SpaceCapabilities.ObjectForm,
|
|
74
|
+
defineObjectForm({
|
|
75
|
+
objectSchema: Script.Script,
|
|
76
|
+
formSchema: ScriptAction.ScriptProps,
|
|
77
|
+
getIntent: (props, options) => createIntent(ScriptAction.CreateScript, { ...props, space: options.space }),
|
|
78
|
+
}),
|
|
79
|
+
),
|
|
80
|
+
}),
|
|
81
|
+
defineModule({
|
|
82
|
+
id: `${meta.id}/module/notebook/object-form`,
|
|
83
|
+
activatesOn: ClientEvents.SetupSchema,
|
|
84
|
+
activate: () =>
|
|
85
|
+
contributes(
|
|
86
|
+
SpaceCapabilities.ObjectForm,
|
|
87
|
+
defineObjectForm({
|
|
88
|
+
objectSchema: Notebook.Notebook,
|
|
89
|
+
formSchema: ScriptAction.NotebookProps,
|
|
90
|
+
getIntent: (props, options) => createIntent(ScriptAction.CreateNotebook, { ...props, space: options.space }),
|
|
55
91
|
}),
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
id: `${meta.id}/module/react-surface`,
|
|
77
|
-
activatesOn: Events.SetupReactSurface,
|
|
78
|
-
// TODO(wittjosiah): Should occur before the script editor is loaded when surfaces activation is more granular.
|
|
79
|
-
activatesBefore: [ScriptEvents.SetupCompiler],
|
|
80
|
-
activate: ReactSurface,
|
|
81
|
-
}),
|
|
82
|
-
defineModule({
|
|
83
|
-
id: `${meta.id}/module/intent-resolver`,
|
|
84
|
-
activatesOn: Events.SetupIntentResolver,
|
|
85
|
-
activate: IntentResolver,
|
|
86
|
-
}),
|
|
87
|
-
defineModule({
|
|
88
|
-
id: `${meta.id}/module/blueprint`,
|
|
89
|
-
activatesOn: Events.SetupArtifactDefinition,
|
|
90
|
-
activate: BlueprintDefinition,
|
|
91
|
-
}),
|
|
92
|
-
]);
|
|
92
|
+
),
|
|
93
|
+
}),
|
|
94
|
+
defineModule({
|
|
95
|
+
id: `${meta.id}/module/react-surface`,
|
|
96
|
+
activatesOn: Events.SetupReactSurface,
|
|
97
|
+
// TODO(wittjosiah): Should occur before the script editor is loaded when surfaces activation is more granular.
|
|
98
|
+
activatesBefore: [ScriptEvents.SetupCompiler],
|
|
99
|
+
activate: ReactSurface,
|
|
100
|
+
}),
|
|
101
|
+
defineModule({
|
|
102
|
+
id: `${meta.id}/module/intent-resolver`,
|
|
103
|
+
activatesOn: Events.SetupIntentResolver,
|
|
104
|
+
activate: IntentResolver,
|
|
105
|
+
}),
|
|
106
|
+
defineModule({
|
|
107
|
+
id: `${meta.id}/module/blueprint`,
|
|
108
|
+
activatesOn: Events.SetupArtifactDefinition,
|
|
109
|
+
activate: BlueprintDefinition,
|
|
110
|
+
}),
|
|
111
|
+
]);
|
|
@@ -3,11 +3,12 @@
|
|
|
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';
|
|
10
|
-
import {
|
|
11
|
+
import { Script } from '@dxos/functions';
|
|
11
12
|
import { ATTENDABLE_PATH_SEPARATOR, PLANK_COMPANION_TYPE } from '@dxos/plugin-deck/types';
|
|
12
13
|
import { createExtension } from '@dxos/plugin-graph';
|
|
13
14
|
|
|
@@ -19,9 +20,9 @@ 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
|
-
Option.flatMap((node) => (Obj.instanceOf(
|
|
25
|
+
Option.flatMap((node) => (Obj.instanceOf(Script.Script, node.data) ? Option.some(node) : Option.none())),
|
|
25
26
|
Option.map((node) => [
|
|
26
27
|
{
|
|
27
28
|
id: [node.id, 'execute'].join(ATTENDABLE_PATH_SEPARATOR),
|
|
@@ -42,9 +43,9 @@ 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
|
-
Option.flatMap((node) => (Obj.instanceOf(
|
|
48
|
+
Option.flatMap((node) => (Obj.instanceOf(Script.Script, node.data) ? Option.some(node) : Option.none())),
|
|
48
49
|
Option.map((node) => [
|
|
49
50
|
{
|
|
50
51
|
id: [node.id, 'logs'].join(ATTENDABLE_PATH_SEPARATOR),
|
|
@@ -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';
|
|
@@ -3,25 +3,24 @@
|
|
|
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
|
-
import { Obj
|
|
10
|
-
import {
|
|
9
|
+
import { Obj } from '@dxos/echo';
|
|
10
|
+
import { Script } from '@dxos/functions';
|
|
11
11
|
import { TokenManagerAction } from '@dxos/plugin-token-manager/types';
|
|
12
|
-
import { DataType } from '@dxos/schema';
|
|
13
12
|
|
|
14
13
|
import { DEPLOYMENT_DIALOG } from '../components';
|
|
15
14
|
import { defaultScriptsForIntegration } from '../meta';
|
|
16
15
|
import { templates } from '../templates';
|
|
17
|
-
import { ScriptAction } from '../types';
|
|
16
|
+
import { Notebook, ScriptAction } from '../types';
|
|
18
17
|
|
|
19
18
|
export default () =>
|
|
20
19
|
contributes(Capabilities.IntentResolver, [
|
|
21
20
|
createResolver({
|
|
22
|
-
intent: ScriptAction.
|
|
21
|
+
intent: ScriptAction.CreateScript,
|
|
23
22
|
resolve: async ({ name, gistUrl, initialTemplateId }) => {
|
|
24
|
-
let
|
|
23
|
+
let source = templates[0].source;
|
|
25
24
|
|
|
26
25
|
const gistId = gistUrl?.split('/').at(-1);
|
|
27
26
|
if (gistId) {
|
|
@@ -33,21 +32,31 @@ export default () =>
|
|
|
33
32
|
});
|
|
34
33
|
const gistContent = Object.values(response.data.files ?? {})[0]?.content;
|
|
35
34
|
if (gistContent) {
|
|
36
|
-
|
|
35
|
+
source = gistContent;
|
|
37
36
|
}
|
|
38
37
|
}
|
|
39
38
|
|
|
40
39
|
if (initialTemplateId) {
|
|
41
40
|
const template = templates.find((template) => template.id === initialTemplateId);
|
|
42
41
|
if (template) {
|
|
43
|
-
|
|
44
|
-
name = template.name;
|
|
42
|
+
source = template.source;
|
|
43
|
+
name = name || template.name;
|
|
45
44
|
}
|
|
46
45
|
}
|
|
47
46
|
|
|
48
47
|
return {
|
|
49
48
|
data: {
|
|
50
|
-
object:
|
|
49
|
+
object: Script.make({ name, source }),
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
},
|
|
53
|
+
}),
|
|
54
|
+
createResolver({
|
|
55
|
+
intent: ScriptAction.CreateNotebook,
|
|
56
|
+
resolve: async ({ name }) => {
|
|
57
|
+
return {
|
|
58
|
+
data: {
|
|
59
|
+
object: Obj.make(Notebook.Notebook, { name, cells: [] }),
|
|
51
60
|
},
|
|
52
61
|
};
|
|
53
62
|
},
|
|
@@ -7,7 +7,7 @@ import React from 'react';
|
|
|
7
7
|
import { Capabilities, contributes, createSurface, useCapability } from '@dxos/app-framework';
|
|
8
8
|
import { InvocationTraceContainer } from '@dxos/devtools';
|
|
9
9
|
import { Obj } from '@dxos/echo';
|
|
10
|
-
import {
|
|
10
|
+
import { Script } from '@dxos/functions';
|
|
11
11
|
import { SettingsStore } from '@dxos/local-storage';
|
|
12
12
|
import { getSpace } from '@dxos/react-client/echo';
|
|
13
13
|
import { StackItem } from '@dxos/react-ui-stack';
|
|
@@ -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,45 +33,56 @@ 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',
|
|
42
|
-
filter: (data): data is { subject:
|
|
41
|
+
id: `${meta.id}/script/article`,
|
|
42
|
+
role: ['article', 'section'],
|
|
43
|
+
filter: (data): data is { subject: Script.Script } => Obj.instanceOf(Script.Script, 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',
|
|
53
|
-
filter: (data): data is { subject:
|
|
65
|
+
filter: (data): data is { subject: Script.Script } => Obj.instanceOf(Script.Script, data.subject),
|
|
54
66
|
component: ({ data }) => <ScriptProperties object={data.subject} />,
|
|
55
67
|
}),
|
|
56
68
|
createSurface({
|
|
57
69
|
id: `${meta.id}/companion/settings`,
|
|
58
70
|
role: 'object-settings',
|
|
59
|
-
filter: (data): data is { subject:
|
|
71
|
+
filter: (data): data is { subject: Script.Script } => Obj.instanceOf(Script.Script, data.subject),
|
|
60
72
|
component: ({ data }) => <ScriptObjectSettings object={data.subject} />,
|
|
61
73
|
}),
|
|
62
74
|
createSurface({
|
|
63
75
|
id: `${meta.id}/companion/execute`,
|
|
64
76
|
role: 'article',
|
|
65
|
-
filter: (data): data is { companionTo:
|
|
66
|
-
Obj.instanceOf(
|
|
77
|
+
filter: (data): data is { companionTo: Script.Script } =>
|
|
78
|
+
Obj.instanceOf(Script.Script, data.companionTo) && data.subject === 'execute',
|
|
67
79
|
component: ({ data, role }) => <TestContainer script={data.companionTo} role={role} />,
|
|
68
80
|
}),
|
|
69
81
|
createSurface({
|
|
70
82
|
id: `${meta.id}/companion/logs`,
|
|
71
83
|
role: 'article',
|
|
72
|
-
filter: (data): data is { companionTo:
|
|
73
|
-
Obj.instanceOf(
|
|
84
|
+
filter: (data): data is { companionTo: Script.Script } =>
|
|
85
|
+
Obj.instanceOf(Script.Script, data.companionTo) && data.subject === 'logs',
|
|
74
86
|
component: ({ data, role }) => {
|
|
75
87
|
const space = getSpace(data.companionTo);
|
|
76
88
|
return (
|
|
@@ -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,15 +2,16 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@dxos-theme';
|
|
6
|
-
|
|
7
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
10
|
import { Obj } from '@dxos/echo';
|
|
11
|
+
import { ClientPlugin } from '@dxos/plugin-client';
|
|
11
12
|
import { Dialog } from '@dxos/react-ui';
|
|
13
|
+
import { withTheme } from '@dxos/react-ui/testing';
|
|
12
14
|
import { DataType } from '@dxos/schema';
|
|
13
|
-
import { withLayout, withTheme } from '@dxos/storybook-utils';
|
|
14
15
|
|
|
15
16
|
import { translations } from '../../translations';
|
|
16
17
|
|
|
@@ -29,7 +30,13 @@ const meta = {
|
|
|
29
30
|
component: DeploymentDialog,
|
|
30
31
|
render: DefaultStory,
|
|
31
32
|
parameters: { translations },
|
|
32
|
-
|
|
33
|
+
// TODO(wittjosiah): Try to write story which does not depend on plugin manager.
|
|
34
|
+
decorators: [
|
|
35
|
+
withTheme,
|
|
36
|
+
withPluginManager({
|
|
37
|
+
plugins: [IntentPlugin(), ClientPlugin({})],
|
|
38
|
+
}),
|
|
39
|
+
],
|
|
33
40
|
} satisfies Meta<typeof DefaultStory>;
|
|
34
41
|
|
|
35
42
|
export default meta;
|