@dxos/plugin-script 0.8.4-main.c4373fc → 0.8.4-main.c85a9c8dae
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -13
- package/dist/lib/browser/DeploymentDialog-IIOXAS47.mjs +138 -0
- package/dist/lib/browser/DeploymentDialog-IIOXAS47.mjs.map +7 -0
- package/dist/lib/browser/NotebookContainer-VVZOKGRC.mjs +850 -0
- package/dist/lib/browser/NotebookContainer-VVZOKGRC.mjs.map +7 -0
- package/dist/lib/browser/ScriptContainer-A5SSIUH6.mjs +93 -0
- package/dist/lib/browser/ScriptContainer-A5SSIUH6.mjs.map +7 -0
- package/dist/lib/browser/ScriptObjectSettings-HYYC7KXC.mjs +294 -0
- package/dist/lib/browser/ScriptObjectSettings-HYYC7KXC.mjs.map +7 -0
- package/dist/lib/browser/ScriptPluginSettings-UTWA7CBT.mjs +55 -0
- package/dist/lib/browser/ScriptPluginSettings-UTWA7CBT.mjs.map +7 -0
- package/dist/lib/browser/ScriptProperties-HREPUE65.mjs +28 -0
- package/dist/lib/browser/ScriptProperties-HREPUE65.mjs.map +7 -0
- package/dist/lib/browser/TestContainer-D4Y2K2TT.mjs +39 -0
- package/dist/lib/browser/TestContainer-D4Y2K2TT.mjs.map +7 -0
- package/dist/lib/browser/app-graph-builder-66ZDI72K.mjs +69 -0
- package/dist/lib/browser/app-graph-builder-66ZDI72K.mjs.map +7 -0
- package/dist/lib/browser/blueprint-definition-YMZEJBAZ.mjs +17 -0
- package/dist/lib/browser/blueprint-definition-YMZEJBAZ.mjs.map +7 -0
- package/dist/lib/browser/blueprints/index.mjs +8 -0
- package/dist/lib/browser/chunk-6IXFDTAI.mjs +113 -0
- package/dist/lib/browser/chunk-6IXFDTAI.mjs.map +7 -0
- package/dist/lib/browser/chunk-ATTZUDT7.mjs +67 -0
- package/dist/lib/browser/chunk-ATTZUDT7.mjs.map +7 -0
- package/dist/lib/browser/chunk-G3XIOLLI.mjs +174 -0
- package/dist/lib/browser/chunk-G3XIOLLI.mjs.map +7 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/browser/chunk-J7PGML5B.mjs +105 -0
- package/dist/lib/browser/chunk-J7PGML5B.mjs.map +7 -0
- package/dist/lib/browser/chunk-MUEVLYXJ.mjs +397 -0
- package/dist/lib/browser/chunk-MUEVLYXJ.mjs.map +7 -0
- package/dist/lib/browser/chunk-PLDBKKYO.mjs +789 -0
- package/dist/lib/browser/chunk-PLDBKKYO.mjs.map +7 -0
- package/dist/lib/browser/chunk-Q66L5EUR.mjs +20 -0
- package/dist/lib/browser/chunk-Q66L5EUR.mjs.map +7 -0
- package/dist/lib/browser/chunk-TW27W3EL.mjs +29 -0
- package/dist/lib/browser/chunk-TW27W3EL.mjs.map +7 -0
- package/dist/lib/browser/{chunk-EZVXV6DA.mjs → chunk-WYR4QHPE.mjs} +7 -2
- package/dist/lib/browser/chunk-WYR4QHPE.mjs.map +7 -0
- package/dist/lib/browser/chunk-ZYU2LP6U.mjs +11 -0
- package/dist/lib/browser/chunk-ZYU2LP6U.mjs.map +7 -0
- package/dist/lib/browser/compiler-53G6ZHQM.mjs +99 -0
- package/dist/lib/browser/compiler-53G6ZHQM.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +120 -136
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/operation-resolver-CYEISDDK.mjs +79 -0
- package/dist/lib/browser/operation-resolver-CYEISDDK.mjs.map +7 -0
- package/dist/lib/browser/react-surface-26P6HAFD.mjs +141 -0
- package/dist/lib/browser/react-surface-26P6HAFD.mjs.map +7 -0
- package/dist/lib/browser/settings-76UM7442.mjs +36 -0
- package/dist/lib/browser/settings-76UM7442.mjs.map +7 -0
- package/dist/lib/browser/templates/index.mjs +2 -1
- package/dist/lib/browser/types/index.mjs +12 -6
- package/dist/lib/node-esm/DeploymentDialog-ZHPHEV2H.mjs +139 -0
- package/dist/lib/node-esm/DeploymentDialog-ZHPHEV2H.mjs.map +7 -0
- package/dist/lib/node-esm/NotebookContainer-ZLWTNMQA.mjs +851 -0
- package/dist/lib/node-esm/NotebookContainer-ZLWTNMQA.mjs.map +7 -0
- package/dist/lib/node-esm/ScriptContainer-S4UKQAWP.mjs +94 -0
- package/dist/lib/node-esm/ScriptContainer-S4UKQAWP.mjs.map +7 -0
- package/dist/lib/node-esm/ScriptObjectSettings-C5QBRERY.mjs +295 -0
- package/dist/lib/node-esm/ScriptObjectSettings-C5QBRERY.mjs.map +7 -0
- package/dist/lib/node-esm/ScriptPluginSettings-MFACDW4R.mjs +56 -0
- package/dist/lib/node-esm/ScriptPluginSettings-MFACDW4R.mjs.map +7 -0
- package/dist/lib/node-esm/ScriptProperties-FMNIX3KU.mjs +29 -0
- package/dist/lib/node-esm/ScriptProperties-FMNIX3KU.mjs.map +7 -0
- package/dist/lib/node-esm/TestContainer-AO45YPGV.mjs +40 -0
- package/dist/lib/node-esm/TestContainer-AO45YPGV.mjs.map +7 -0
- package/dist/lib/node-esm/app-graph-builder-IGAZTJ45.mjs +70 -0
- package/dist/lib/node-esm/app-graph-builder-IGAZTJ45.mjs.map +7 -0
- package/dist/lib/node-esm/blueprint-definition-5MGY6BRQ.mjs +18 -0
- package/dist/lib/node-esm/blueprint-definition-5MGY6BRQ.mjs.map +7 -0
- package/dist/lib/node-esm/blueprints/index.mjs +9 -0
- package/dist/lib/node-esm/blueprints/index.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-5BG7OJGQ.mjs +176 -0
- package/dist/lib/node-esm/chunk-5BG7OJGQ.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-OG2SIKHE.mjs → chunk-5HSJPAK7.mjs} +7 -2
- package/dist/lib/node-esm/chunk-5HSJPAK7.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-H46R2RS5.mjs +790 -0
- package/dist/lib/node-esm/chunk-H46R2RS5.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-JGN7TDJH.mjs +69 -0
- package/dist/lib/node-esm/chunk-JGN7TDJH.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-OQGBKNYU.mjs → chunk-QG6ANK4B.mjs} +34 -17
- package/dist/lib/node-esm/chunk-QG6ANK4B.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-S7DSCLOW.mjs +31 -0
- package/dist/lib/node-esm/chunk-S7DSCLOW.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-TZ2EBTPQ.mjs +22 -0
- package/dist/lib/node-esm/chunk-TZ2EBTPQ.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-UFBVE33O.mjs +12 -0
- package/dist/lib/node-esm/chunk-UFBVE33O.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-WWD5LUU6.mjs +114 -0
- package/dist/lib/node-esm/chunk-WWD5LUU6.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-ZDJ2FI7E.mjs +398 -0
- package/dist/lib/node-esm/chunk-ZDJ2FI7E.mjs.map +7 -0
- package/dist/lib/node-esm/compiler-HHQW7EP3.mjs +100 -0
- package/dist/lib/node-esm/compiler-HHQW7EP3.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +120 -136
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/operation-resolver-HFFDXWND.mjs +80 -0
- package/dist/lib/node-esm/operation-resolver-HFFDXWND.mjs.map +7 -0
- package/dist/lib/node-esm/react-surface-THCIK266.mjs +142 -0
- package/dist/lib/node-esm/react-surface-THCIK266.mjs.map +7 -0
- package/dist/lib/node-esm/settings-CCHDPLFJ.mjs +37 -0
- package/dist/lib/node-esm/settings-CCHDPLFJ.mjs.map +7 -0
- package/dist/lib/node-esm/templates/index.mjs +2 -1
- package/dist/lib/node-esm/types/index.mjs +12 -6
- package/dist/types/src/ScriptPlugin.d.ts +2 -1
- package/dist/types/src/ScriptPlugin.d.ts.map +1 -1
- package/dist/types/src/blueprints/index.d.ts +2 -0
- package/dist/types/src/blueprints/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/script-blueprint.d.ts +4 -0
- package/dist/types/src/blueprints/script-blueprint.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +6 -0
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts +3 -0
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/artifact-definition/artifact-definition.d.ts +12 -0
- package/dist/types/src/capabilities/artifact-definition/artifact-definition.d.ts.map +1 -0
- package/dist/types/src/capabilities/artifact-definition/index.d.ts +3 -0
- package/dist/types/src/capabilities/artifact-definition/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts +6 -0
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts.map +1 -0
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts +3 -0
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/compiler/compiler.d.ts +6 -0
- package/dist/types/src/capabilities/compiler/compiler.d.ts.map +1 -0
- package/dist/types/src/capabilities/compiler/index.d.ts +3 -0
- package/dist/types/src/capabilities/compiler/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +6 -7
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-resolver/index.d.ts +3 -0
- package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +5 -0
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts +3 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +5 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/settings/index.d.ts +7 -0
- package/dist/types/src/capabilities/settings/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/settings/settings.d.ts +10 -0
- package/dist/types/src/capabilities/settings/settings.d.ts.map +1 -0
- package/dist/types/src/compiler/compiler.d.ts +1 -1
- package/dist/types/src/compiler/compiler.d.ts.map +1 -1
- package/dist/types/src/components/FrameContainer/FrameContainer.d.ts +1 -1
- package/dist/types/src/components/FrameContainer/FrameContainer.d.ts.map +1 -1
- 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 +8 -10
- package/dist/types/src/components/NotebookStack/NotebookStack.d.ts.map +1 -1
- package/dist/types/src/components/NotebookStack/NotebookStack.stories.d.ts +26 -8
- package/dist/types/src/components/NotebookStack/NotebookStack.stories.d.ts.map +1 -1
- package/dist/types/src/components/NotebookStack/index.d.ts +1 -0
- package/dist/types/src/components/NotebookStack/index.d.ts.map +1 -1
- package/dist/types/src/components/QueryEditor/QueryEditor.d.ts +5 -0
- package/dist/types/src/components/QueryEditor/QueryEditor.d.ts.map +1 -0
- package/dist/types/src/components/QueryEditor/QueryEditor.stories.d.ts +13 -0
- package/dist/types/src/components/QueryEditor/QueryEditor.stories.d.ts.map +1 -0
- package/dist/types/src/components/QueryEditor/index.d.ts +2 -0
- package/dist/types/src/components/QueryEditor/index.d.ts.map +1 -0
- package/dist/types/src/components/ScriptToolbar/ScriptToolbar.d.ts +8 -8
- package/dist/types/src/components/ScriptToolbar/ScriptToolbar.d.ts.map +1 -1
- package/dist/types/src/components/ScriptToolbar/ScriptToolbar.stories.d.ts +27 -8
- package/dist/types/src/components/ScriptToolbar/ScriptToolbar.stories.d.ts.map +1 -1
- package/dist/types/src/components/TestPanel/TestPanel.d.ts.map +1 -1
- package/dist/types/src/components/TestPanel/index.d.ts +0 -1
- package/dist/types/src/components/TestPanel/index.d.ts.map +1 -1
- package/dist/types/src/components/TypescriptEditor/TypescriptEditor.d.ts +3 -2
- package/dist/types/src/components/TypescriptEditor/TypescriptEditor.d.ts.map +1 -1
- package/dist/types/src/components/TypescriptEditor/TypescriptEditor.stories.d.ts +1 -7
- package/dist/types/src/components/TypescriptEditor/TypescriptEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +4 -5
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/constants.d.ts +2 -0
- package/dist/types/src/constants.d.ts.map +1 -0
- package/dist/types/src/{components → containers}/DeploymentDialog/DeploymentDialog.d.ts +2 -4
- package/dist/types/src/containers/DeploymentDialog/DeploymentDialog.d.ts.map +1 -0
- package/dist/types/src/{components → containers}/DeploymentDialog/DeploymentDialog.stories.d.ts +25 -6
- package/dist/types/src/containers/DeploymentDialog/DeploymentDialog.stories.d.ts.map +1 -0
- package/dist/types/src/containers/DeploymentDialog/index.d.ts +3 -0
- package/dist/types/src/containers/DeploymentDialog/index.d.ts.map +1 -0
- package/dist/types/src/containers/NotebookContainer/NotebookContainer.d.ts +7 -0
- package/dist/types/src/containers/NotebookContainer/NotebookContainer.d.ts.map +1 -0
- package/dist/types/src/containers/NotebookContainer/NotebookContainer.stories.d.ts +7 -0
- package/dist/types/src/containers/NotebookContainer/NotebookContainer.stories.d.ts.map +1 -0
- package/dist/types/src/containers/NotebookContainer/index.d.ts +3 -0
- package/dist/types/src/containers/NotebookContainer/index.d.ts.map +1 -0
- package/dist/types/src/containers/ScriptContainer/ScriptContainer.d.ts +10 -0
- package/dist/types/src/containers/ScriptContainer/ScriptContainer.d.ts.map +1 -0
- package/dist/types/src/containers/ScriptContainer/index.d.ts +3 -0
- package/dist/types/src/containers/ScriptContainer/index.d.ts.map +1 -0
- package/dist/types/src/containers/ScriptObjectSettings/ScriptObjectSettings.d.ts +7 -0
- package/dist/types/src/containers/ScriptObjectSettings/ScriptObjectSettings.d.ts.map +1 -0
- package/dist/types/src/containers/ScriptObjectSettings/index.d.ts +3 -0
- package/dist/types/src/containers/ScriptObjectSettings/index.d.ts.map +1 -0
- package/dist/types/src/containers/ScriptPluginSettings/ScriptPluginSettings.d.ts +8 -0
- package/dist/types/src/containers/ScriptPluginSettings/ScriptPluginSettings.d.ts.map +1 -0
- package/dist/types/src/containers/ScriptPluginSettings/index.d.ts +3 -0
- package/dist/types/src/containers/ScriptPluginSettings/index.d.ts.map +1 -0
- package/dist/types/src/containers/ScriptProperties/ScriptProperties.d.ts +7 -0
- package/dist/types/src/containers/ScriptProperties/ScriptProperties.d.ts.map +1 -0
- package/dist/types/src/containers/ScriptProperties/index.d.ts +3 -0
- package/dist/types/src/containers/ScriptProperties/index.d.ts.map +1 -0
- package/dist/types/src/containers/TestContainer/TestContainer.d.ts +8 -0
- package/dist/types/src/containers/TestContainer/TestContainer.d.ts.map +1 -0
- package/dist/types/src/containers/TestContainer/index.d.ts +3 -0
- package/dist/types/src/containers/TestContainer/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +9 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/e2e/ai.test.d.ts +2 -0
- package/dist/types/src/e2e/ai.test.d.ts.map +1 -0
- package/dist/types/src/e2e/deploy.test.d.ts +2 -0
- package/dist/types/src/e2e/deploy.test.d.ts.map +1 -0
- package/dist/types/src/hooks/deploy.d.ts +17 -31
- package/dist/types/src/hooks/deploy.d.ts.map +1 -1
- package/dist/types/src/hooks/format.d.ts +5 -4
- package/dist/types/src/hooks/format.d.ts.map +1 -1
- package/dist/types/src/hooks/index.d.ts +1 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/template.d.ts +7 -16
- package/dist/types/src/hooks/template.d.ts.map +1 -1
- package/dist/types/src/hooks/useCompiler.d.ts +7 -0
- package/dist/types/src/hooks/useCompiler.d.ts.map +1 -0
- package/dist/types/src/hooks/useCreateAndDeployScriptTemplates.d.ts.map +1 -1
- package/dist/types/src/hooks/useToolbarState.d.ts +8 -1
- package/dist/types/src/hooks/useToolbarState.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +2 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/notebook/compute-graph.d.ts +58 -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 +1 -1
- package/dist/types/src/notebook/index.d.ts.map +1 -1
- package/dist/types/src/notebook/vfs-parser.d.ts.map +1 -1
- package/dist/types/src/templates/anthropic.d.ts +8 -0
- package/dist/types/src/templates/anthropic.d.ts.map +1 -0
- package/dist/types/src/templates/chess-bot.d.ts +16 -0
- package/dist/types/src/templates/chess-bot.d.ts.map +1 -0
- package/dist/types/src/templates/commentary.d.ts +16 -0
- package/dist/types/src/templates/commentary.d.ts.map +1 -0
- package/dist/types/src/templates/forex-effect.d.ts +4 -1
- package/dist/types/src/templates/forex-effect.d.ts.map +1 -1
- package/dist/types/src/templates/forex.d.ts +4 -1
- package/dist/types/src/templates/forex.d.ts.map +1 -1
- package/dist/types/src/templates/index.d.ts +52 -1
- package/dist/types/src/templates/index.d.ts.map +1 -1
- package/dist/types/src/templates/ping.d.ts +3 -0
- package/dist/types/src/templates/ping.d.ts.map +1 -0
- package/dist/types/src/testing/data.d.ts +2 -9
- package/dist/types/src/testing/data.d.ts.map +1 -1
- package/dist/types/src/testing/simulator.test.d.ts +2 -0
- package/dist/types/src/testing/simulator.test.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +11 -3
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Notebook.d.ts +108 -0
- package/dist/types/src/types/Notebook.d.ts.map +1 -0
- package/dist/types/src/types/actions.d.ts +30 -48
- package/dist/types/src/types/actions.d.ts.map +1 -1
- package/dist/types/src/types/capabilities.d.ts +12 -0
- package/dist/types/src/types/capabilities.d.ts.map +1 -0
- package/dist/types/src/types/events.d.ts +5 -0
- package/dist/types/src/types/events.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +4 -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 +3 -3
- package/dist/types/src/util/functions.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +114 -79
- package/src/ScriptPlugin.tsx +44 -85
- package/src/blueprints/index.ts +5 -0
- package/src/blueprints/script-blueprint.ts +31 -0
- package/src/capabilities/app-graph-builder/app-graph-builder.ts +56 -0
- package/src/capabilities/app-graph-builder/index.ts +7 -0
- package/src/capabilities/{artifact-definition.ts → artifact-definition/artifact-definition.ts} +97 -95
- package/src/capabilities/artifact-definition/index.ts +7 -0
- package/src/capabilities/blueprint-definition/blueprint-definition.ts +17 -0
- package/src/capabilities/blueprint-definition/index.ts +7 -0
- package/src/capabilities/compiler/compiler.ts +103 -0
- package/src/capabilities/compiler/index.ts +7 -0
- package/src/capabilities/index.ts +6 -10
- package/src/capabilities/operation-resolver/index.ts +7 -0
- package/src/capabilities/operation-resolver/operation-resolver.ts +75 -0
- package/src/capabilities/react-surface/index.ts +7 -0
- package/src/capabilities/react-surface/react-surface.tsx +121 -0
- package/src/capabilities/settings/index.ts +7 -0
- package/src/capabilities/settings/settings.ts +33 -0
- package/src/compiler/compiler.ts +10 -3
- package/src/components/FrameContainer/FrameContainer.tsx +6 -5
- package/src/components/FrameContainer/frame.html +21 -21
- package/src/components/NotebookStack/NotebookCell.tsx +215 -0
- package/src/components/NotebookStack/NotebookMenu.tsx +47 -0
- package/src/components/NotebookStack/NotebookStack.stories.tsx +33 -15
- package/src/components/NotebookStack/NotebookStack.tsx +55 -82
- package/src/components/NotebookStack/index.ts +1 -0
- package/src/components/QueryEditor/QueryEditor.stories.tsx +102 -0
- package/src/components/QueryEditor/QueryEditor.tsx +47 -0
- package/src/components/QueryEditor/index.ts +5 -0
- package/src/components/ScriptToolbar/ScriptToolbar.stories.tsx +46 -23
- package/src/components/ScriptToolbar/ScriptToolbar.tsx +28 -31
- package/src/components/TestPanel/TestPanel.tsx +61 -36
- package/src/components/TestPanel/index.ts +0 -1
- package/src/components/TypescriptEditor/TypescriptEditor.stories.tsx +26 -25
- package/src/components/TypescriptEditor/TypescriptEditor.tsx +70 -74
- package/src/components/index.ts +4 -9
- package/src/constants.ts +7 -0
- package/src/containers/DeploymentDialog/DeploymentDialog.stories.tsx +61 -0
- package/src/containers/DeploymentDialog/DeploymentDialog.tsx +99 -0
- package/src/containers/DeploymentDialog/index.ts +7 -0
- package/src/containers/NotebookContainer/NotebookContainer.stories.tsx +87 -0
- package/src/containers/NotebookContainer/NotebookContainer.tsx +268 -0
- package/src/containers/NotebookContainer/index.ts +7 -0
- package/src/containers/ScriptContainer/ScriptContainer.tsx +84 -0
- package/src/containers/ScriptContainer/index.ts +7 -0
- package/src/{components/Settings → containers/ScriptObjectSettings}/ScriptObjectSettings.tsx +55 -50
- package/src/containers/ScriptObjectSettings/index.ts +7 -0
- package/src/{components/Settings → containers/ScriptPluginSettings}/ScriptPluginSettings.tsx +19 -14
- package/src/containers/ScriptPluginSettings/index.ts +7 -0
- package/src/containers/ScriptProperties/ScriptProperties.tsx +33 -0
- package/src/containers/ScriptProperties/index.ts +7 -0
- package/src/containers/TestContainer/TestContainer.tsx +28 -0
- package/src/containers/TestContainer/index.ts +7 -0
- package/src/containers/index.ts +13 -0
- package/src/e2e/ai.test.ts +92 -0
- package/src/e2e/deploy.test.ts +64 -0
- package/src/hooks/deploy.ts +43 -35
- package/src/hooks/format.ts +8 -3
- package/src/hooks/index.ts +1 -0
- package/src/hooks/template.ts +22 -26
- package/src/hooks/useCompiler.ts +24 -0
- package/src/hooks/useCreateAndDeployScriptTemplates.ts +14 -16
- package/src/hooks/useToolbarState.ts +29 -4
- package/src/index.ts +2 -1
- package/src/meta.ts +8 -4
- package/src/notebook/compute-graph.test.ts +82 -0
- package/src/notebook/{notebook.ts → compute-graph.ts} +75 -33
- package/src/notebook/eval.ts +105 -0
- package/src/notebook/index.ts +1 -1
- package/src/notebook/vfs-parser.ts +43 -82
- package/src/templates/anthropic.ts +42 -0
- package/src/templates/chess-bot.ts +58 -0
- package/src/templates/commentary.ts +231 -0
- package/src/templates/data-generator.ts +1 -1
- package/src/templates/forex-effect.ts +22 -27
- package/src/templates/forex.ts +7 -6
- package/src/templates/gmail.ts +1 -2
- package/src/templates/index.ts +24 -11
- package/src/templates/ping.ts +17 -0
- package/src/testing/data.ts +43 -8
- package/src/testing/simulator.test.ts +40 -0
- package/src/translations.ts +11 -3
- package/src/types/Notebook.ts +41 -0
- package/src/types/actions.ts +23 -27
- package/src/types/capabilities.ts +17 -0
- package/src/types/events.ts +11 -0
- package/src/types/index.ts +4 -1
- package/src/types/types.ts +15 -0
- package/src/util/deploy.ts +30 -40
- package/src/util/functions.ts +32 -28
- package/src/vite-env.d.ts +2 -0
- package/dist/lib/browser/DeploymentDialog-7FNPALCV.mjs +0 -12
- package/dist/lib/browser/NotebookContainer-ZSXYRRZB.mjs +0 -578
- package/dist/lib/browser/NotebookContainer-ZSXYRRZB.mjs.map +0 -7
- package/dist/lib/browser/ScriptContainer-24LLLTLB.mjs +0 -149
- package/dist/lib/browser/ScriptContainer-24LLLTLB.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-DPYULSME.mjs +0 -65
- package/dist/lib/browser/app-graph-builder-DPYULSME.mjs.map +0 -7
- package/dist/lib/browser/blueprint-definition-ET5KZ46I.mjs +0 -28
- package/dist/lib/browser/blueprint-definition-ET5KZ46I.mjs.map +0 -7
- package/dist/lib/browser/chunk-DXWTBOND.mjs +0 -282
- package/dist/lib/browser/chunk-DXWTBOND.mjs.map +0 -7
- package/dist/lib/browser/chunk-ETFBQURU.mjs +0 -254
- package/dist/lib/browser/chunk-ETFBQURU.mjs.map +0 -7
- package/dist/lib/browser/chunk-EZVXV6DA.mjs.map +0 -7
- package/dist/lib/browser/chunk-I3THDIT5.mjs +0 -90
- package/dist/lib/browser/chunk-I3THDIT5.mjs.map +0 -7
- package/dist/lib/browser/chunk-N6M34EUC.mjs +0 -112
- package/dist/lib/browser/chunk-N6M34EUC.mjs.map +0 -7
- package/dist/lib/browser/chunk-NNYSARXK.mjs +0 -153
- package/dist/lib/browser/chunk-NNYSARXK.mjs.map +0 -7
- package/dist/lib/browser/chunk-OKXN2N7M.mjs +0 -15
- package/dist/lib/browser/chunk-OKXN2N7M.mjs.map +0 -7
- package/dist/lib/browser/chunk-SRSEZWDY.mjs +0 -646
- package/dist/lib/browser/chunk-SRSEZWDY.mjs.map +0 -7
- package/dist/lib/browser/chunk-SWBZUZDX.mjs +0 -80
- package/dist/lib/browser/chunk-SWBZUZDX.mjs.map +0 -7
- package/dist/lib/browser/chunk-VFJJA4WR.mjs +0 -88
- package/dist/lib/browser/chunk-VFJJA4WR.mjs.map +0 -7
- package/dist/lib/browser/compiler-G2N2CG63.mjs +0 -98
- package/dist/lib/browser/compiler-G2N2CG63.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-FYZRLYNT.mjs +0 -105
- package/dist/lib/browser/intent-resolver-FYZRLYNT.mjs.map +0 -7
- package/dist/lib/browser/react-surface-CFRYAL2P.mjs +0 -127
- package/dist/lib/browser/react-surface-CFRYAL2P.mjs.map +0 -7
- package/dist/lib/browser/settings-L3HCZRBP.mjs +0 -24
- package/dist/lib/browser/settings-L3HCZRBP.mjs.map +0 -7
- package/dist/lib/node-esm/DeploymentDialog-AKAGR37W.mjs +0 -13
- package/dist/lib/node-esm/NotebookContainer-2O3N3XPE.mjs +0 -579
- package/dist/lib/node-esm/NotebookContainer-2O3N3XPE.mjs.map +0 -7
- package/dist/lib/node-esm/ScriptContainer-IKOB6FHQ.mjs +0 -150
- package/dist/lib/node-esm/ScriptContainer-IKOB6FHQ.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-UXJGHXSL.mjs +0 -66
- package/dist/lib/node-esm/app-graph-builder-UXJGHXSL.mjs.map +0 -7
- package/dist/lib/node-esm/blueprint-definition-AIYFOT7Q.mjs +0 -30
- package/dist/lib/node-esm/blueprint-definition-AIYFOT7Q.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-5IKGUOMI.mjs +0 -154
- package/dist/lib/node-esm/chunk-5IKGUOMI.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-7MR2L4T3.mjs +0 -283
- package/dist/lib/node-esm/chunk-7MR2L4T3.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-C33FKUSC.mjs +0 -91
- package/dist/lib/node-esm/chunk-C33FKUSC.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-NUXZQQ6P.mjs +0 -16
- package/dist/lib/node-esm/chunk-NUXZQQ6P.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-OG2SIKHE.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-OQGBKNYU.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-PMQ3D535.mjs +0 -647
- package/dist/lib/node-esm/chunk-PMQ3D535.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-U4CZGISN.mjs +0 -255
- package/dist/lib/node-esm/chunk-U4CZGISN.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-VRSDE4CI.mjs +0 -114
- package/dist/lib/node-esm/chunk-VRSDE4CI.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ZF5ULKED.mjs +0 -81
- package/dist/lib/node-esm/chunk-ZF5ULKED.mjs.map +0 -7
- package/dist/lib/node-esm/compiler-PLDAZ5GJ.mjs +0 -99
- package/dist/lib/node-esm/compiler-PLDAZ5GJ.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-6J3CFL5T.mjs +0 -106
- package/dist/lib/node-esm/intent-resolver-6J3CFL5T.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-NPKEO7SA.mjs +0 -128
- package/dist/lib/node-esm/react-surface-NPKEO7SA.mjs.map +0 -7
- package/dist/lib/node-esm/settings-YWGZP4EW.mjs +0 -25
- package/dist/lib/node-esm/settings-YWGZP4EW.mjs.map +0 -7
- package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -4
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
- package/dist/types/src/capabilities/artifact-definition.d.ts +0 -11
- package/dist/types/src/capabilities/artifact-definition.d.ts.map +0 -1
- package/dist/types/src/capabilities/blueprint-definition.d.ts +0 -5
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +0 -1
- package/dist/types/src/capabilities/capabilities.d.ts +0 -5
- package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
- package/dist/types/src/capabilities/compiler.d.ts +0 -4
- package/dist/types/src/capabilities/compiler.d.ts.map +0 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface.d.ts +0 -4
- package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
- package/dist/types/src/capabilities/settings.d.ts +0 -4
- package/dist/types/src/capabilities/settings.d.ts.map +0 -1
- package/dist/types/src/components/DeploymentDialog/DeploymentDialog.d.ts.map +0 -1
- package/dist/types/src/components/DeploymentDialog/DeploymentDialog.stories.d.ts.map +0 -1
- package/dist/types/src/components/DeploymentDialog/index.d.ts +0 -4
- package/dist/types/src/components/DeploymentDialog/index.d.ts.map +0 -1
- package/dist/types/src/components/NotebookContainer.d.ts +0 -10
- package/dist/types/src/components/NotebookContainer.d.ts.map +0 -1
- package/dist/types/src/components/NotebookContainer.stories.d.ts +0 -231
- package/dist/types/src/components/NotebookContainer.stories.d.ts.map +0 -1
- package/dist/types/src/components/ScriptContainer.d.ts +0 -12
- package/dist/types/src/components/ScriptContainer.d.ts.map +0 -1
- package/dist/types/src/components/Settings/ScriptObjectSettings.d.ts +0 -8
- package/dist/types/src/components/Settings/ScriptObjectSettings.d.ts.map +0 -1
- package/dist/types/src/components/Settings/ScriptPluginSettings.d.ts +0 -6
- package/dist/types/src/components/Settings/ScriptPluginSettings.d.ts.map +0 -1
- package/dist/types/src/components/Settings/index.d.ts +0 -3
- package/dist/types/src/components/Settings/index.d.ts.map +0 -1
- package/dist/types/src/components/TestPanel/TestContainer.d.ts +0 -8
- package/dist/types/src/components/TestPanel/TestContainer.d.ts.map +0 -1
- package/dist/types/src/events.d.ts +0 -4
- package/dist/types/src/events.d.ts.map +0 -1
- package/dist/types/src/notebook/notebook.d.ts +0 -39
- package/dist/types/src/notebook/notebook.d.ts.map +0 -1
- package/dist/types/src/notebook/notebook.test.d.ts +0 -2
- package/dist/types/src/notebook/notebook.test.d.ts.map +0 -1
- package/dist/types/src/templates/chess.d.ts +0 -3
- package/dist/types/src/templates/chess.d.ts.map +0 -1
- package/dist/types/src/templates/echo.d.ts +0 -6
- package/dist/types/src/templates/echo.d.ts.map +0 -1
- package/dist/types/src/types/schema.d.ts +0 -35
- package/dist/types/src/types/schema.d.ts.map +0 -1
- package/src/capabilities/app-graph-builder.ts +0 -65
- package/src/capabilities/blueprint-definition.ts +0 -30
- package/src/capabilities/capabilities.ts +0 -12
- package/src/capabilities/compiler.ts +0 -34
- package/src/capabilities/intent-resolver.ts +0 -87
- package/src/capabilities/react-surface.tsx +0 -102
- package/src/capabilities/settings.ts +0 -21
- package/src/components/DeploymentDialog/DeploymentDialog.stories.tsx +0 -53
- package/src/components/DeploymentDialog/DeploymentDialog.tsx +0 -106
- package/src/components/DeploymentDialog/index.ts +0 -9
- package/src/components/NotebookContainer.stories.tsx +0 -36
- package/src/components/NotebookContainer.tsx +0 -82
- package/src/components/ScriptContainer.tsx +0 -69
- package/src/components/Settings/index.ts +0 -6
- package/src/components/TestPanel/TestContainer.tsx +0 -27
- package/src/events.ts +0 -11
- package/src/notebook/notebook.test.ts +0 -38
- package/src/templates/chess.ts +0 -49
- package/src/templates/echo.ts +0 -8
- package/src/types/schema.ts +0 -42
- /package/dist/lib/browser/{DeploymentDialog-7FNPALCV.mjs.map → blueprints/index.mjs.map} +0 -0
- /package/dist/lib/{node-esm/DeploymentDialog-AKAGR37W.mjs.map → browser/chunk-J5LGTIGS.mjs.map} +0 -0
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
DEPLOYMENT_DIALOG,
|
|
3
|
-
DeploymentDialog_default
|
|
4
|
-
} from "./chunk-NNYSARXK.mjs";
|
|
5
|
-
import "./chunk-ETFBQURU.mjs";
|
|
6
|
-
import "./chunk-SWBZUZDX.mjs";
|
|
7
|
-
import "./chunk-EZVXV6DA.mjs";
|
|
8
|
-
export {
|
|
9
|
-
DEPLOYMENT_DIALOG,
|
|
10
|
-
DeploymentDialog_default as default
|
|
11
|
-
};
|
|
12
|
-
//# sourceMappingURL=DeploymentDialog-7FNPALCV.mjs.map
|
|
@@ -1,578 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
NotebookStack
|
|
3
|
-
} from "./chunk-I3THDIT5.mjs";
|
|
4
|
-
import "./chunk-N6M34EUC.mjs";
|
|
5
|
-
import {
|
|
6
|
-
meta
|
|
7
|
-
} from "./chunk-EZVXV6DA.mjs";
|
|
8
|
-
|
|
9
|
-
// src/components/NotebookContainer.tsx
|
|
10
|
-
import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
|
|
11
|
-
import React, { useCallback, useMemo } from "react";
|
|
12
|
-
import { Ref } from "@dxos/echo";
|
|
13
|
-
import { Toolbar, useTranslation } from "@dxos/react-ui";
|
|
14
|
-
import { StackItem } from "@dxos/react-ui-stack";
|
|
15
|
-
import { DataType } from "@dxos/schema";
|
|
16
|
-
|
|
17
|
-
// src/notebook/notebook.ts
|
|
18
|
-
import { signal } from "@preact/signals-core";
|
|
19
|
-
import { log } from "@dxos/log";
|
|
20
|
-
|
|
21
|
-
// src/notebook/vfs-parser.ts
|
|
22
|
-
import { createSystem, createVirtualTypeScriptEnvironment } from "@typescript/vfs";
|
|
23
|
-
import ts from "typescript";
|
|
24
|
-
import { invariant } from "@dxos/invariant";
|
|
25
|
-
import { trim } from "@dxos/util";
|
|
26
|
-
function _define_property(obj, key, value) {
|
|
27
|
-
if (key in obj) {
|
|
28
|
-
Object.defineProperty(obj, key, {
|
|
29
|
-
value,
|
|
30
|
-
enumerable: true,
|
|
31
|
-
configurable: true,
|
|
32
|
-
writable: true
|
|
33
|
-
});
|
|
34
|
-
} else {
|
|
35
|
-
obj[key] = value;
|
|
36
|
-
}
|
|
37
|
-
return obj;
|
|
38
|
-
}
|
|
39
|
-
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-script/src/notebook/vfs-parser.ts";
|
|
40
|
-
var VirtualTypeScriptParser = class {
|
|
41
|
-
/**
|
|
42
|
-
* Parse a single expression or statement.
|
|
43
|
-
*/
|
|
44
|
-
parseExpression(input) {
|
|
45
|
-
invariant(input.trim() !== "", "input must not be empty", {
|
|
46
|
-
F: __dxlog_file,
|
|
47
|
-
L: 46,
|
|
48
|
-
S: this,
|
|
49
|
-
A: [
|
|
50
|
-
"input.trim() !== ''",
|
|
51
|
-
"'input must not be empty'"
|
|
52
|
-
]
|
|
53
|
-
});
|
|
54
|
-
const files = [
|
|
55
|
-
{
|
|
56
|
-
filename: "/temp.ts",
|
|
57
|
-
content: input
|
|
58
|
-
}
|
|
59
|
-
];
|
|
60
|
-
const analysis = this.analyzeFiles(files);
|
|
61
|
-
if (analysis.length === 0) {
|
|
62
|
-
const sourcefilename = "/temp.ts";
|
|
63
|
-
const env = this.createEnvironment([
|
|
64
|
-
{
|
|
65
|
-
filename: sourcefilename,
|
|
66
|
-
content: input
|
|
67
|
-
},
|
|
68
|
-
...systemFiles
|
|
69
|
-
]);
|
|
70
|
-
const sourceFile = env.getSourceFile(sourcefilename);
|
|
71
|
-
const typeChecker = env.languageService.getProgram()?.getTypeChecker();
|
|
72
|
-
if (sourceFile && typeChecker) {
|
|
73
|
-
const assignmentInfo = this.findAssignmentExpression(sourceFile, typeChecker);
|
|
74
|
-
if (assignmentInfo) {
|
|
75
|
-
return assignmentInfo;
|
|
76
|
-
}
|
|
77
|
-
const references = this.findAllReferences(sourceFile, typeChecker);
|
|
78
|
-
return {
|
|
79
|
-
references
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
return analysis[0];
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Analyze multiple files with full type information.
|
|
87
|
-
*/
|
|
88
|
-
analyzeFiles(files) {
|
|
89
|
-
const env = this.createEnvironment([
|
|
90
|
-
...files,
|
|
91
|
-
...systemFiles
|
|
92
|
-
]);
|
|
93
|
-
const results = [];
|
|
94
|
-
const typeChecker = env.languageService.getProgram()?.getTypeChecker();
|
|
95
|
-
files.forEach((file) => {
|
|
96
|
-
const sourceFile = env.getSourceFile(file.filename);
|
|
97
|
-
if (!sourceFile || !typeChecker) return;
|
|
98
|
-
const fileResults = this.analyzeSourceFile(sourceFile, typeChecker);
|
|
99
|
-
results.push(...fileResults);
|
|
100
|
-
});
|
|
101
|
-
return results;
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* Analyze a source file with type information.
|
|
105
|
-
*/
|
|
106
|
-
analyzeSourceFile(sourceFile, typeChecker) {
|
|
107
|
-
const results = [];
|
|
108
|
-
const visit = (node) => {
|
|
109
|
-
if (ts.isFunctionDeclaration(node) && node.name) {
|
|
110
|
-
const symbol = typeChecker.getSymbolAtLocation(node.name);
|
|
111
|
-
const type = symbol && typeChecker.getTypeOfSymbolAtLocation(symbol, node);
|
|
112
|
-
const signature = type && typeChecker.getSignaturesOfType(type, ts.SignatureKind.Call)[0];
|
|
113
|
-
results.push({
|
|
114
|
-
name: node.name.text,
|
|
115
|
-
type: "function",
|
|
116
|
-
parameters: this.extractParameters(signature, typeChecker),
|
|
117
|
-
returnType: signature ? typeChecker.typeToString(signature.getReturnType()) : "any",
|
|
118
|
-
references: this.findReferences(node, sourceFile, typeChecker)
|
|
119
|
-
});
|
|
120
|
-
} else if (ts.isVariableStatement(node)) {
|
|
121
|
-
node.declarationList.declarations.forEach((declaration) => {
|
|
122
|
-
if (ts.isIdentifier(declaration.name)) {
|
|
123
|
-
const symbol = typeChecker.getSymbolAtLocation(declaration.name);
|
|
124
|
-
const type = symbol && typeChecker.getTypeOfSymbolAtLocation(symbol, declaration);
|
|
125
|
-
let kind = "variable";
|
|
126
|
-
let parameters;
|
|
127
|
-
let returnType;
|
|
128
|
-
let value;
|
|
129
|
-
const typeString = type ? typeChecker.typeToString(type) : "any";
|
|
130
|
-
if (declaration.initializer) {
|
|
131
|
-
if (ts.isArrowFunction(declaration.initializer) || ts.isFunctionExpression(declaration.initializer)) {
|
|
132
|
-
kind = "function";
|
|
133
|
-
const funcType = typeChecker.getTypeAtLocation(declaration.initializer);
|
|
134
|
-
const signature = typeChecker.getSignaturesOfType(funcType, ts.SignatureKind.Call)[0];
|
|
135
|
-
if (signature) {
|
|
136
|
-
parameters = this.extractParameters(signature, typeChecker);
|
|
137
|
-
returnType = typeChecker.typeToString(signature.getReturnType());
|
|
138
|
-
}
|
|
139
|
-
} else {
|
|
140
|
-
if (ts.isNumericLiteral(declaration.initializer)) {
|
|
141
|
-
value = Number(declaration.initializer.text);
|
|
142
|
-
} else if (ts.isStringLiteral(declaration.initializer)) {
|
|
143
|
-
value = declaration.initializer.text;
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
const refs = declaration.initializer ? this.findReferences(declaration.initializer, sourceFile, typeChecker) : [];
|
|
148
|
-
results.push({
|
|
149
|
-
name: declaration.name.text,
|
|
150
|
-
type: kind,
|
|
151
|
-
valueType: typeString,
|
|
152
|
-
value,
|
|
153
|
-
parameters,
|
|
154
|
-
returnType,
|
|
155
|
-
references: refs
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
|
-
});
|
|
159
|
-
} else if (ts.isClassDeclaration(node) && node.name) {
|
|
160
|
-
results.push({
|
|
161
|
-
name: node.name.text,
|
|
162
|
-
type: "class",
|
|
163
|
-
references: this.findReferences(node, sourceFile, typeChecker)
|
|
164
|
-
});
|
|
165
|
-
} else if (ts.isInterfaceDeclaration(node)) {
|
|
166
|
-
results.push({
|
|
167
|
-
name: node.name.text,
|
|
168
|
-
type: "interface",
|
|
169
|
-
references: this.findReferences(node, sourceFile, typeChecker)
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
|
-
ts.forEachChild(node, visit);
|
|
173
|
-
};
|
|
174
|
-
visit(sourceFile);
|
|
175
|
-
return results;
|
|
176
|
-
}
|
|
177
|
-
/**
|
|
178
|
-
* Extract parameter information from a signature.
|
|
179
|
-
*/
|
|
180
|
-
extractParameters(signature, typeChecker) {
|
|
181
|
-
if (!signature) return [];
|
|
182
|
-
return signature.parameters.map((param) => ({
|
|
183
|
-
name: param.getName(),
|
|
184
|
-
type: typeChecker.typeToString(typeChecker.getTypeOfSymbolAtLocation(param, param.valueDeclaration))
|
|
185
|
-
}));
|
|
186
|
-
}
|
|
187
|
-
/**
|
|
188
|
-
* Find all references to variables used in a node.
|
|
189
|
-
*/
|
|
190
|
-
findReferences(node, _sourceFile, _typeChecker) {
|
|
191
|
-
const references = /* @__PURE__ */ new Set();
|
|
192
|
-
const localSymbols = /* @__PURE__ */ new Set();
|
|
193
|
-
const collectLocalSymbols = (n) => {
|
|
194
|
-
if (ts.isFunctionDeclaration(n) || ts.isArrowFunction(n) || ts.isFunctionExpression(n)) {
|
|
195
|
-
n.parameters.forEach((param) => {
|
|
196
|
-
if (ts.isIdentifier(param.name)) {
|
|
197
|
-
localSymbols.add(param.name.text);
|
|
198
|
-
}
|
|
199
|
-
});
|
|
200
|
-
}
|
|
201
|
-
if (ts.isVariableDeclaration(n) && ts.isIdentifier(n.name)) {
|
|
202
|
-
localSymbols.add(n.name.text);
|
|
203
|
-
}
|
|
204
|
-
ts.forEachChild(n, collectLocalSymbols);
|
|
205
|
-
};
|
|
206
|
-
collectLocalSymbols(node);
|
|
207
|
-
const findRefs = (n) => {
|
|
208
|
-
if (ts.isIdentifier(n)) {
|
|
209
|
-
if (!localSymbols.has(n.text)) {
|
|
210
|
-
const parent = n.parent;
|
|
211
|
-
const isDeclaration = ts.isVariableDeclaration(parent) && parent.name === n || ts.isFunctionDeclaration(parent) && parent.name === n || ts.isParameter(parent) && parent.name === n;
|
|
212
|
-
if (!isDeclaration && !this.isBuiltIn(n.text)) {
|
|
213
|
-
references.add(n.text);
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
ts.forEachChild(n, findRefs);
|
|
218
|
-
};
|
|
219
|
-
findRefs(node);
|
|
220
|
-
return Array.from(references);
|
|
221
|
-
}
|
|
222
|
-
/**
|
|
223
|
-
* Check if a name is a built-in global.
|
|
224
|
-
*/
|
|
225
|
-
isBuiltIn(name) {
|
|
226
|
-
return builtIns.has(name);
|
|
227
|
-
}
|
|
228
|
-
/**
|
|
229
|
-
* Find assignment expressions in a source file.
|
|
230
|
-
*/
|
|
231
|
-
findAssignmentExpression(sourceFile, typeChecker) {
|
|
232
|
-
let result = null;
|
|
233
|
-
const visit = (node) => {
|
|
234
|
-
if (ts.isExpressionStatement(node) && ts.isBinaryExpression(node.expression)) {
|
|
235
|
-
const expr = node.expression;
|
|
236
|
-
if (expr.operatorToken.kind === ts.SyntaxKind.EqualsToken && ts.isIdentifier(expr.left)) {
|
|
237
|
-
const type = typeChecker.getTypeAtLocation(expr.right);
|
|
238
|
-
const typeString = typeChecker.typeToString(type);
|
|
239
|
-
let value;
|
|
240
|
-
if (ts.isNumericLiteral(expr.right)) {
|
|
241
|
-
value = Number(expr.right.text);
|
|
242
|
-
} else if (ts.isStringLiteral(expr.right)) {
|
|
243
|
-
value = expr.right.text;
|
|
244
|
-
}
|
|
245
|
-
const references = this.findReferences(expr.right, sourceFile, typeChecker);
|
|
246
|
-
result = {
|
|
247
|
-
name: expr.left.text,
|
|
248
|
-
type: "variable",
|
|
249
|
-
valueType: typeString,
|
|
250
|
-
value,
|
|
251
|
-
references
|
|
252
|
-
};
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
if (!result) {
|
|
256
|
-
ts.forEachChild(node, visit);
|
|
257
|
-
}
|
|
258
|
-
};
|
|
259
|
-
visit(sourceFile);
|
|
260
|
-
return result;
|
|
261
|
-
}
|
|
262
|
-
/**
|
|
263
|
-
* Find all identifier references in a source file.
|
|
264
|
-
*/
|
|
265
|
-
findAllReferences(sourceFile, _typeChecker) {
|
|
266
|
-
const references = /* @__PURE__ */ new Set();
|
|
267
|
-
const visit = (node) => {
|
|
268
|
-
if (ts.isIdentifier(node)) {
|
|
269
|
-
const parent = node.parent;
|
|
270
|
-
const isDeclaration = ts.isVariableDeclaration(parent) && parent.name === node || ts.isFunctionDeclaration(parent) && parent.name === node || ts.isParameter(parent) && parent.name === node;
|
|
271
|
-
const isAssignmentTarget = ts.isBinaryExpression(parent) && parent.operatorToken.kind === ts.SyntaxKind.EqualsToken && parent.left === node;
|
|
272
|
-
if (!isDeclaration && !isAssignmentTarget && !this.isBuiltIn(node.text)) {
|
|
273
|
-
references.add(node.text);
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
ts.forEachChild(node, visit);
|
|
277
|
-
};
|
|
278
|
-
visit(sourceFile);
|
|
279
|
-
return Array.from(references);
|
|
280
|
-
}
|
|
281
|
-
createEnvironment(files) {
|
|
282
|
-
const fileMap = /* @__PURE__ */ new Map();
|
|
283
|
-
files.forEach(({ filename, content }) => {
|
|
284
|
-
fileMap.set(filename, content);
|
|
285
|
-
});
|
|
286
|
-
const system = createSystem(fileMap);
|
|
287
|
-
return createVirtualTypeScriptEnvironment(system, files.map(({ filename }) => filename), ts, this.compilerOptions);
|
|
288
|
-
}
|
|
289
|
-
constructor() {
|
|
290
|
-
_define_property(this, "compilerOptions", {
|
|
291
|
-
target: ts.ScriptTarget.ES2020,
|
|
292
|
-
module: ts.ModuleKind.ESNext,
|
|
293
|
-
strict: true,
|
|
294
|
-
esModuleInterop: true,
|
|
295
|
-
skipLibCheck: true,
|
|
296
|
-
forceConsistentCasingInfilenames: true,
|
|
297
|
-
jsx: ts.JsxEmit.React,
|
|
298
|
-
noLib: true
|
|
299
|
-
});
|
|
300
|
-
}
|
|
301
|
-
};
|
|
302
|
-
var builtIns = /* @__PURE__ */ new Set([
|
|
303
|
-
// Types.
|
|
304
|
-
"Array",
|
|
305
|
-
"Date",
|
|
306
|
-
"Error",
|
|
307
|
-
"JSON",
|
|
308
|
-
"Map",
|
|
309
|
-
"Math",
|
|
310
|
-
"Number",
|
|
311
|
-
"Promise",
|
|
312
|
-
"Object",
|
|
313
|
-
"RegExp",
|
|
314
|
-
"Set",
|
|
315
|
-
"String",
|
|
316
|
-
// Functions.
|
|
317
|
-
"console",
|
|
318
|
-
"document",
|
|
319
|
-
"global",
|
|
320
|
-
"isFinite",
|
|
321
|
-
"isNaN",
|
|
322
|
-
"parseFloat",
|
|
323
|
-
"parseInt",
|
|
324
|
-
"process",
|
|
325
|
-
"window"
|
|
326
|
-
]);
|
|
327
|
-
var systemFiles = [
|
|
328
|
-
{
|
|
329
|
-
filename: "/lib.d.ts",
|
|
330
|
-
content: trim`
|
|
331
|
-
interface Array<T> { length: number; [n: number]: T; }
|
|
332
|
-
interface Boolean {}
|
|
333
|
-
interface Function {}
|
|
334
|
-
interface IArguments {}
|
|
335
|
-
interface Number {}
|
|
336
|
-
interface Object {}
|
|
337
|
-
interface RegExp {}
|
|
338
|
-
interface String { length: number; }
|
|
339
|
-
interface CallableFunction extends Function {}
|
|
340
|
-
interface NewableFunction extends Function {}
|
|
341
|
-
declare var console: { log(...args: any[]): void };
|
|
342
|
-
`
|
|
343
|
-
}
|
|
344
|
-
];
|
|
345
|
-
|
|
346
|
-
// src/notebook/notebook.ts
|
|
347
|
-
function _define_property2(obj, key, value) {
|
|
348
|
-
if (key in obj) {
|
|
349
|
-
Object.defineProperty(obj, key, {
|
|
350
|
-
value,
|
|
351
|
-
enumerable: true,
|
|
352
|
-
configurable: true,
|
|
353
|
-
writable: true
|
|
354
|
-
});
|
|
355
|
-
} else {
|
|
356
|
-
obj[key] = value;
|
|
357
|
-
}
|
|
358
|
-
return obj;
|
|
359
|
-
}
|
|
360
|
-
var __dxlog_file2 = "/__w/dxos/dxos/packages/plugins/plugin-script/src/notebook/notebook.ts";
|
|
361
|
-
var ComputeGraph = class {
|
|
362
|
-
/**
|
|
363
|
-
* Parsed expressions by cell ID.
|
|
364
|
-
*/
|
|
365
|
-
get expressions() {
|
|
366
|
-
return this._expressions;
|
|
367
|
-
}
|
|
368
|
-
/**
|
|
369
|
-
* Computed values by cell ID.
|
|
370
|
-
*/
|
|
371
|
-
get values() {
|
|
372
|
-
return this._values;
|
|
373
|
-
}
|
|
374
|
-
/**
|
|
375
|
-
* Compute values.
|
|
376
|
-
*/
|
|
377
|
-
evaluate() {
|
|
378
|
-
const { expressions, dependencyGraph } = this.parse();
|
|
379
|
-
this._values.value = {};
|
|
380
|
-
const cellExpressions = /* @__PURE__ */ new Map();
|
|
381
|
-
Object.entries(expressions).forEach(([id, expr]) => {
|
|
382
|
-
cellExpressions.set(id, expr);
|
|
383
|
-
});
|
|
384
|
-
const evaluationOrder = this.topologicalSort(Object.keys(expressions), dependencyGraph);
|
|
385
|
-
const valuesByName = {};
|
|
386
|
-
const valuesByCellId = {};
|
|
387
|
-
for (const cellId of evaluationOrder) {
|
|
388
|
-
const expr = cellExpressions.get(cellId);
|
|
389
|
-
if (!expr) {
|
|
390
|
-
log.error("no expression for cell", {
|
|
391
|
-
cellId
|
|
392
|
-
}, {
|
|
393
|
-
F: __dxlog_file2,
|
|
394
|
-
L: 63,
|
|
395
|
-
S: this,
|
|
396
|
-
C: (f, a) => f(...a)
|
|
397
|
-
});
|
|
398
|
-
continue;
|
|
399
|
-
}
|
|
400
|
-
const cellSource = this._notebook.cells.find((cell) => cell.id === cellId)?.script.target?.content;
|
|
401
|
-
if (!cellSource) {
|
|
402
|
-
log.error("no source for cell", {
|
|
403
|
-
cellId
|
|
404
|
-
}, {
|
|
405
|
-
F: __dxlog_file2,
|
|
406
|
-
L: 69,
|
|
407
|
-
S: this,
|
|
408
|
-
C: (f, a) => f(...a)
|
|
409
|
-
});
|
|
410
|
-
continue;
|
|
411
|
-
}
|
|
412
|
-
try {
|
|
413
|
-
if (expr.name && expr.value !== void 0) {
|
|
414
|
-
valuesByName[expr.name] = expr.value;
|
|
415
|
-
valuesByCellId[cellId] = expr.value;
|
|
416
|
-
} else if (expr.name) {
|
|
417
|
-
const equalIndex = cellSource.indexOf("=");
|
|
418
|
-
if (equalIndex !== -1) {
|
|
419
|
-
let rhs = cellSource.substring(equalIndex + 1).trim();
|
|
420
|
-
if (rhs.endsWith(";")) {
|
|
421
|
-
rhs = rhs.slice(0, -1).trim();
|
|
422
|
-
}
|
|
423
|
-
const result = this.evalScript(rhs, valuesByName);
|
|
424
|
-
valuesByName[expr.name] = result;
|
|
425
|
-
if (typeof result !== "function") {
|
|
426
|
-
valuesByCellId[cellId] = result;
|
|
427
|
-
}
|
|
428
|
-
}
|
|
429
|
-
} else {
|
|
430
|
-
const result = this.evalScript(cellSource, valuesByName);
|
|
431
|
-
valuesByCellId[cellId] = result;
|
|
432
|
-
}
|
|
433
|
-
} catch (error) {
|
|
434
|
-
log.error("error evaluating cell", {
|
|
435
|
-
cellId,
|
|
436
|
-
error
|
|
437
|
-
}, {
|
|
438
|
-
F: __dxlog_file2,
|
|
439
|
-
L: 104,
|
|
440
|
-
S: this,
|
|
441
|
-
C: (f, a) => f(...a)
|
|
442
|
-
});
|
|
443
|
-
}
|
|
444
|
-
}
|
|
445
|
-
this._values.value = valuesByCellId;
|
|
446
|
-
return valuesByCellId;
|
|
447
|
-
}
|
|
448
|
-
/**
|
|
449
|
-
* Parse expressions.
|
|
450
|
-
*/
|
|
451
|
-
parse() {
|
|
452
|
-
const expressions = this._notebook.cells.reduce((acc, cell) => {
|
|
453
|
-
const text = cell.script.target?.content.trim();
|
|
454
|
-
if (text) {
|
|
455
|
-
const parsed = this._parser.parseExpression(text);
|
|
456
|
-
acc[cell.id] = parsed;
|
|
457
|
-
}
|
|
458
|
-
return acc;
|
|
459
|
-
}, {});
|
|
460
|
-
const dependencyGraph = this.buildDependencyGraph(expressions);
|
|
461
|
-
this._expressions.value = expressions;
|
|
462
|
-
return {
|
|
463
|
-
expressions,
|
|
464
|
-
dependencyGraph
|
|
465
|
-
};
|
|
466
|
-
}
|
|
467
|
-
topologicalSort(nodes, dependencies) {
|
|
468
|
-
const visited = /* @__PURE__ */ new Set();
|
|
469
|
-
const result = [];
|
|
470
|
-
const visit = (node) => {
|
|
471
|
-
if (visited.has(node)) {
|
|
472
|
-
return;
|
|
473
|
-
}
|
|
474
|
-
visited.add(node);
|
|
475
|
-
const deps = dependencies[node] || [];
|
|
476
|
-
deps.forEach((dep) => visit(dep));
|
|
477
|
-
result.push(node);
|
|
478
|
-
};
|
|
479
|
-
nodes.forEach((node) => visit(node));
|
|
480
|
-
return result;
|
|
481
|
-
}
|
|
482
|
-
buildDependencyGraph(expressions) {
|
|
483
|
-
const nameToCellId = /* @__PURE__ */ new Map();
|
|
484
|
-
Object.entries(expressions).forEach(([id, expr]) => {
|
|
485
|
-
if (expr.name) {
|
|
486
|
-
nameToCellId.set(expr.name, id);
|
|
487
|
-
}
|
|
488
|
-
});
|
|
489
|
-
const graph = {};
|
|
490
|
-
Object.entries(expressions).forEach(([id, expr]) => {
|
|
491
|
-
if (expr.references && expr.references.length > 0) {
|
|
492
|
-
const dependencyCellIds = expr.references.map((ref) => nameToCellId.get(ref)).filter((cellId) => cellId !== void 0 && cellId !== id);
|
|
493
|
-
if (dependencyCellIds.length > 0) {
|
|
494
|
-
graph[id] = dependencyCellIds;
|
|
495
|
-
}
|
|
496
|
-
}
|
|
497
|
-
});
|
|
498
|
-
return graph;
|
|
499
|
-
}
|
|
500
|
-
/**
|
|
501
|
-
* Evaluate the script (with dependencies as arguments).
|
|
502
|
-
*/
|
|
503
|
-
evalScript(code, deps = {}) {
|
|
504
|
-
return new Function(...Object.keys(deps), "return " + code)(...Object.values(deps));
|
|
505
|
-
}
|
|
506
|
-
constructor(_notebook) {
|
|
507
|
-
_define_property2(this, "_notebook", void 0);
|
|
508
|
-
_define_property2(this, "_parser", void 0);
|
|
509
|
-
_define_property2(this, "_expressions", void 0);
|
|
510
|
-
_define_property2(this, "_values", void 0);
|
|
511
|
-
this._notebook = _notebook;
|
|
512
|
-
this._parser = new VirtualTypeScriptParser();
|
|
513
|
-
this._expressions = signal({});
|
|
514
|
-
this._values = signal({});
|
|
515
|
-
}
|
|
516
|
-
};
|
|
517
|
-
|
|
518
|
-
// src/components/NotebookContainer.tsx
|
|
519
|
-
var NotebookContainer = ({ notebook, env }) => {
|
|
520
|
-
var _effect = _useSignals();
|
|
521
|
-
try {
|
|
522
|
-
const { t } = useTranslation(meta.id);
|
|
523
|
-
const graph = useMemo(() => notebook && new ComputeGraph(notebook), [
|
|
524
|
-
notebook
|
|
525
|
-
]);
|
|
526
|
-
const handleCompute = useCallback(() => {
|
|
527
|
-
graph?.evaluate();
|
|
528
|
-
}, [
|
|
529
|
-
graph
|
|
530
|
-
]);
|
|
531
|
-
const handleCellInsert = useCallback((after) => {
|
|
532
|
-
const idx = after ? notebook.cells.findIndex((cell) => cell.id === after) : notebook.cells.length;
|
|
533
|
-
notebook?.cells.splice(idx, 0, {
|
|
534
|
-
id: crypto.randomUUID(),
|
|
535
|
-
script: Ref.make(DataType.makeText("\n\n\n"))
|
|
536
|
-
});
|
|
537
|
-
}, [
|
|
538
|
-
notebook
|
|
539
|
-
]);
|
|
540
|
-
const handleCellDelete = useCallback((id) => {
|
|
541
|
-
const idx = notebook.cells.findIndex((cell) => cell.id === id);
|
|
542
|
-
if (idx !== -1) {
|
|
543
|
-
notebook.cells.splice(idx, 1);
|
|
544
|
-
}
|
|
545
|
-
}, [
|
|
546
|
-
notebook
|
|
547
|
-
]);
|
|
548
|
-
return /* @__PURE__ */ React.createElement(StackItem.Content, {
|
|
549
|
-
classNames: "container-max-width border-l border-r border-subduedSeparator",
|
|
550
|
-
toolbar: true
|
|
551
|
-
}, /* @__PURE__ */ React.createElement(Toolbar.Root, null, /* @__PURE__ */ React.createElement(Toolbar.IconButton, {
|
|
552
|
-
icon: "ph--plus--regular",
|
|
553
|
-
iconOnly: true,
|
|
554
|
-
label: t("add cell label"),
|
|
555
|
-
onClick: () => handleCellInsert("")
|
|
556
|
-
}), /* @__PURE__ */ React.createElement(Toolbar.IconButton, {
|
|
557
|
-
icon: "ph--play--fill",
|
|
558
|
-
iconOnly: true,
|
|
559
|
-
label: t("compute label"),
|
|
560
|
-
classNames: "text-green-500",
|
|
561
|
-
onClick: handleCompute
|
|
562
|
-
})), /* @__PURE__ */ React.createElement(NotebookStack, {
|
|
563
|
-
notebook,
|
|
564
|
-
graph,
|
|
565
|
-
env,
|
|
566
|
-
onCellInsert: handleCellInsert,
|
|
567
|
-
onCellDelete: handleCellDelete
|
|
568
|
-
}));
|
|
569
|
-
} finally {
|
|
570
|
-
_effect.f();
|
|
571
|
-
}
|
|
572
|
-
};
|
|
573
|
-
var NotebookContainer_default = NotebookContainer;
|
|
574
|
-
export {
|
|
575
|
-
NotebookContainer,
|
|
576
|
-
NotebookContainer_default as default
|
|
577
|
-
};
|
|
578
|
-
//# sourceMappingURL=NotebookContainer-ZSXYRRZB.mjs.map
|