@dxos/plugin-script 0.8.4-main.406dc2a → 0.8.4-main.52d7546f51
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-XUAFCNI7.mjs +14 -0
- package/dist/lib/browser/{NotebookContainer-LVGRPFY3.mjs → NotebookContainer-UQ4I24R6.mjs} +357 -195
- package/dist/lib/browser/NotebookContainer-UQ4I24R6.mjs.map +7 -0
- package/dist/lib/browser/ScriptContainer-NB76645V.mjs +149 -0
- package/dist/lib/browser/ScriptContainer-NB76645V.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-5RFKE7VK.mjs +18 -0
- package/dist/lib/browser/blueprint-definition-5RFKE7VK.mjs.map +7 -0
- package/dist/lib/browser/blueprints/index.mjs +8 -0
- package/dist/lib/browser/chunk-3BSF5BIA.mjs +113 -0
- package/dist/lib/browser/chunk-3BSF5BIA.mjs.map +7 -0
- package/dist/lib/browser/{chunk-ST3ACVUC.mjs → chunk-4N5TLXEJ.mjs} +29 -12
- package/dist/lib/browser/chunk-4N5TLXEJ.mjs.map +7 -0
- package/dist/lib/browser/chunk-BKGEAUUH.mjs +270 -0
- package/dist/lib/browser/chunk-BKGEAUUH.mjs.map +7 -0
- package/dist/lib/browser/chunk-BU6CGVU2.mjs +137 -0
- package/dist/lib/browser/chunk-BU6CGVU2.mjs.map +7 -0
- package/dist/lib/browser/chunk-F3QKSKSF.mjs +35 -0
- package/dist/lib/browser/chunk-F3QKSKSF.mjs.map +7 -0
- package/dist/lib/browser/chunk-I7CSE6T3.mjs +110 -0
- package/dist/lib/browser/chunk-I7CSE6T3.mjs.map +7 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs.map +7 -0
- package/dist/lib/browser/chunk-LYMPME7J.mjs +609 -0
- package/dist/lib/browser/chunk-LYMPME7J.mjs.map +7 -0
- package/dist/lib/browser/chunk-WWCDIB6Z.mjs +557 -0
- package/dist/lib/browser/chunk-WWCDIB6Z.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/compiler-VPUVTFQD.mjs +161 -0
- package/dist/lib/browser/compiler-VPUVTFQD.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +103 -137
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/operation-resolver-NYDY7GDT.mjs +83 -0
- package/dist/lib/browser/operation-resolver-NYDY7GDT.mjs.map +7 -0
- package/dist/lib/browser/react-surface-FYOQSC6S.mjs +140 -0
- package/dist/lib/browser/react-surface-FYOQSC6S.mjs.map +7 -0
- package/dist/lib/browser/settings-5SF77MRH.mjs +36 -0
- package/dist/lib/browser/settings-5SF77MRH.mjs.map +7 -0
- package/dist/lib/browser/templates/index.mjs +2 -1
- package/dist/lib/browser/types/index.mjs +12 -7
- package/dist/lib/node-esm/DeploymentDialog-GGWDQMEB.mjs +15 -0
- package/dist/lib/node-esm/DeploymentDialog-GGWDQMEB.mjs.map +7 -0
- package/dist/lib/node-esm/{NotebookContainer-QY5NJGJI.mjs → NotebookContainer-DQGZ6QHI.mjs} +357 -195
- package/dist/lib/node-esm/NotebookContainer-DQGZ6QHI.mjs.map +7 -0
- package/dist/lib/node-esm/ScriptContainer-PCNJFUWX.mjs +150 -0
- package/dist/lib/node-esm/ScriptContainer-PCNJFUWX.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-EYL5GNDC.mjs +19 -0
- package/dist/lib/node-esm/blueprint-definition-EYL5GNDC.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-3CKQUF55.mjs +610 -0
- package/dist/lib/node-esm/chunk-3CKQUF55.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-3QBXN6QC.mjs +271 -0
- package/dist/lib/node-esm/chunk-3QBXN6QC.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-ECRSTVR6.mjs +558 -0
- package/dist/lib/node-esm/chunk-ECRSTVR6.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-KRVL7UYI.mjs +114 -0
- package/dist/lib/node-esm/chunk-KRVL7UYI.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-SLU3KRV3.mjs +112 -0
- package/dist/lib/node-esm/chunk-SLU3KRV3.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-U6PXM2HT.mjs +138 -0
- package/dist/lib/node-esm/chunk-U6PXM2HT.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-2GVTWESW.mjs → chunk-V37R7KB5.mjs} +29 -12
- package/dist/lib/node-esm/chunk-V37R7KB5.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-Y3G5NCTP.mjs +36 -0
- package/dist/lib/node-esm/chunk-Y3G5NCTP.mjs.map +7 -0
- package/dist/lib/node-esm/compiler-WUOSY6MS.mjs +162 -0
- package/dist/lib/node-esm/compiler-WUOSY6MS.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +103 -137
- 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-AJNJXGCE.mjs +84 -0
- package/dist/lib/node-esm/operation-resolver-AJNJXGCE.mjs.map +7 -0
- package/dist/lib/node-esm/react-surface-LREMOVNJ.mjs +141 -0
- package/dist/lib/node-esm/react-surface-LREMOVNJ.mjs.map +7 -0
- package/dist/lib/node-esm/settings-ILI762CY.mjs +37 -0
- package/dist/lib/node-esm/settings-ILI762CY.mjs.map +7 -0
- package/dist/lib/node-esm/templates/index.mjs +2 -1
- package/dist/lib/node-esm/types/index.mjs +12 -7
- 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 +22 -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 +10 -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/DeploymentDialog/DeploymentDialog.d.ts +2 -2
- package/dist/types/src/components/DeploymentDialog/DeploymentDialog.d.ts.map +1 -1
- package/dist/types/src/components/DeploymentDialog/DeploymentDialog.stories.d.ts +4 -6
- package/dist/types/src/components/DeploymentDialog/DeploymentDialog.stories.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/NotebookContainer.d.ts +3 -5
- package/dist/types/src/components/NotebookContainer.d.ts.map +1 -1
- package/dist/types/src/components/NotebookContainer.stories.d.ts +3 -244
- package/dist/types/src/components/NotebookContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/NotebookStack/NotebookCell.d.ts +4 -3
- package/dist/types/src/components/NotebookStack/NotebookCell.d.ts.map +1 -1
- package/dist/types/src/components/NotebookStack/NotebookStack.d.ts +1 -1
- package/dist/types/src/components/NotebookStack/NotebookStack.d.ts.map +1 -1
- package/dist/types/src/components/NotebookStack/NotebookStack.stories.d.ts +5 -4
- package/dist/types/src/components/NotebookStack/NotebookStack.stories.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/ScriptContainer.d.ts +5 -6
- package/dist/types/src/components/ScriptContainer.d.ts.map +1 -1
- package/dist/types/src/components/ScriptToolbar/ScriptToolbar.d.ts +7 -8
- package/dist/types/src/components/ScriptToolbar/ScriptToolbar.d.ts.map +1 -1
- package/dist/types/src/components/ScriptToolbar/ScriptToolbar.stories.d.ts +5 -4
- 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 +4 -2
- package/dist/types/src/components/Settings/ScriptPluginSettings.d.ts.map +1 -1
- package/dist/types/src/components/TestPanel/TestContainer.d.ts +3 -3
- package/dist/types/src/components/TestPanel/TestContainer.d.ts.map +1 -1
- package/dist/types/src/components/TestPanel/TestPanel.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 -1
- package/dist/types/src/components/TypescriptEditor/TypescriptEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +2 -2
- package/dist/types/src/components/index.d.ts.map +1 -1
- 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 +15 -30
- package/dist/types/src/hooks/deploy.d.ts.map +1 -1
- package/dist/types/src/hooks/format.d.ts +4 -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 +6 -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 +1 -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 +1 -1
- package/dist/types/src/notebook/eval.d.ts.map +1 -1
- 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/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 +12 -3
- package/dist/types/src/templates/index.d.ts.map +1 -1
- package/dist/types/src/templates/ping.d.ts +1 -4
- package/dist/types/src/templates/ping.d.ts.map +1 -1
- package/dist/types/src/testing/data.d.ts +2 -18
- 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 +4 -3
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Notebook.d.ts +100 -0
- package/dist/types/src/types/Notebook.d.ts.map +1 -0
- package/dist/types/src/types/actions.d.ts +30 -56
- 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 -82
- package/src/ScriptPlugin.tsx +45 -87
- package/src/blueprints/index.ts +5 -0
- package/src/blueprints/script-blueprint.ts +24 -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 +24 -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 +119 -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/DeploymentDialog/DeploymentDialog.stories.tsx +33 -24
- package/src/components/DeploymentDialog/DeploymentDialog.tsx +38 -41
- package/src/components/FrameContainer/FrameContainer.tsx +6 -4
- package/src/components/NotebookContainer.stories.tsx +60 -5
- package/src/components/NotebookContainer.tsx +179 -32
- package/src/components/NotebookStack/NotebookCell.tsx +84 -84
- package/src/components/NotebookStack/NotebookStack.stories.tsx +32 -9
- package/src/components/NotebookStack/NotebookStack.tsx +13 -6
- package/src/components/QueryEditor/QueryEditor.stories.tsx +100 -0
- package/src/components/QueryEditor/QueryEditor.tsx +47 -0
- package/src/components/QueryEditor/index.ts +5 -0
- package/src/components/ScriptContainer.tsx +49 -34
- package/src/components/ScriptToolbar/ScriptToolbar.stories.tsx +42 -19
- package/src/components/ScriptToolbar/ScriptToolbar.tsx +25 -28
- package/src/components/Settings/ScriptObjectSettings.tsx +55 -32
- package/src/components/Settings/ScriptPluginSettings.tsx +19 -14
- package/src/components/TestPanel/TestContainer.tsx +7 -7
- package/src/components/TestPanel/TestPanel.tsx +60 -35
- package/src/components/TypescriptEditor/TypescriptEditor.stories.tsx +14 -9
- package/src/components/TypescriptEditor/TypescriptEditor.tsx +69 -73
- package/src/e2e/ai.test.ts +92 -0
- package/src/e2e/deploy.test.ts +64 -0
- package/src/hooks/deploy.ts +40 -32
- package/src/hooks/format.ts +7 -3
- package/src/hooks/index.ts +1 -0
- package/src/hooks/template.ts +20 -24
- 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 +1 -1
- package/src/meta.ts +8 -4
- package/src/notebook/{notebook.test.ts → compute-graph.test.ts} +31 -19
- package/src/notebook/{notebook.ts → compute-graph.ts} +65 -18
- package/src/notebook/eval.ts +1 -1
- package/src/notebook/index.ts +1 -1
- package/src/templates/anthropic.ts +42 -0
- package/src/templates/chess-bot.ts +58 -0
- package/src/templates/commentary.ts +230 -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 +18 -5
- package/src/templates/ping.ts +14 -5
- package/src/testing/data.ts +34 -9
- package/src/testing/simulator.test.ts +40 -0
- package/src/translations.ts +4 -3
- package/src/types/Notebook.ts +41 -0
- package/src/types/actions.ts +18 -26
- 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-65TWT6S5.mjs +0 -13
- package/dist/lib/browser/NotebookContainer-LVGRPFY3.mjs.map +0 -7
- package/dist/lib/browser/ScriptContainer-LRTRN7JW.mjs +0 -149
- package/dist/lib/browser/ScriptContainer-LRTRN7JW.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-5CYLWXRH.mjs +0 -89
- package/dist/lib/browser/chunk-5CYLWXRH.mjs.map +0 -7
- package/dist/lib/browser/chunk-75LH4EUR.mjs +0 -326
- package/dist/lib/browser/chunk-75LH4EUR.mjs.map +0 -7
- package/dist/lib/browser/chunk-E7DXDICD.mjs +0 -282
- package/dist/lib/browser/chunk-E7DXDICD.mjs.map +0 -7
- package/dist/lib/browser/chunk-EZVXV6DA.mjs.map +0 -7
- package/dist/lib/browser/chunk-I3QSGUFJ.mjs +0 -646
- package/dist/lib/browser/chunk-I3QSGUFJ.mjs.map +0 -7
- package/dist/lib/browser/chunk-JO2O7W6J.mjs +0 -254
- package/dist/lib/browser/chunk-JO2O7W6J.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-NM4WQS4F.mjs +0 -153
- package/dist/lib/browser/chunk-NM4WQS4F.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-ST3ACVUC.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-JLU7DVLQ.mjs +0 -105
- package/dist/lib/browser/intent-resolver-JLU7DVLQ.mjs.map +0 -7
- package/dist/lib/browser/react-surface-76SDTUYG.mjs +0 -127
- package/dist/lib/browser/react-surface-76SDTUYG.mjs.map +0 -7
- package/dist/lib/browser/settings-ERFKVNUK.mjs +0 -25
- package/dist/lib/browser/settings-ERFKVNUK.mjs.map +0 -7
- package/dist/lib/node-esm/DeploymentDialog-I63ZC2HH.mjs +0 -14
- package/dist/lib/node-esm/NotebookContainer-QY5NJGJI.mjs.map +0 -7
- package/dist/lib/node-esm/ScriptContainer-SVXCSLNH.mjs +0 -150
- package/dist/lib/node-esm/ScriptContainer-SVXCSLNH.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-2GVTWESW.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-4X375PGY.mjs +0 -90
- package/dist/lib/node-esm/chunk-4X375PGY.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-67OVZHI3.mjs +0 -327
- package/dist/lib/node-esm/chunk-67OVZHI3.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-C2ORIPKH.mjs +0 -154
- package/dist/lib/node-esm/chunk-C2ORIPKH.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-SMFPSKQT.mjs +0 -647
- package/dist/lib/node-esm/chunk-SMFPSKQT.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-VZAFGLD7.mjs +0 -283
- package/dist/lib/node-esm/chunk-VZAFGLD7.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-YW36TZ7K.mjs +0 -255
- package/dist/lib/node-esm/chunk-YW36TZ7K.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-SFGTIFOG.mjs +0 -106
- package/dist/lib/node-esm/intent-resolver-SFGTIFOG.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-SHEBNW4R.mjs +0 -128
- package/dist/lib/node-esm/react-surface-SHEBNW4R.mjs.map +0 -7
- package/dist/lib/node-esm/settings-5TYXQ42N.mjs +0 -26
- package/dist/lib/node-esm/settings-5TYXQ42N.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/events.d.ts +0 -4
- package/dist/types/src/events.d.ts.map +0 -1
- package/dist/types/src/notebook/notebook.d.ts +0 -35
- 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/types/schema.d.ts +0 -61
- 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/events.ts +0 -11
- package/src/templates/chess.ts +0 -49
- package/src/types/schema.ts +0 -48
- /package/dist/lib/browser/{DeploymentDialog-65TWT6S5.mjs.map → DeploymentDialog-XUAFCNI7.mjs.map} +0 -0
- /package/dist/lib/{node-esm/DeploymentDialog-I63ZC2HH.mjs.map → browser/blueprints/index.mjs.map} +0 -0
|
@@ -2,30 +2,41 @@ import { createRequire } from 'node:module';const require = createRequire(import
|
|
|
2
2
|
import {
|
|
3
3
|
NotebookMenu,
|
|
4
4
|
NotebookStack
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-3QBXN6QC.mjs";
|
|
6
|
+
import "./chunk-SLU3KRV3.mjs";
|
|
7
7
|
import {
|
|
8
8
|
meta
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-5HSJPAK7.mjs";
|
|
10
|
+
import "./chunk-HSLMI22Q.mjs";
|
|
10
11
|
|
|
11
12
|
// src/components/NotebookContainer.tsx
|
|
12
|
-
import {
|
|
13
|
-
import
|
|
14
|
-
import
|
|
13
|
+
import { RegistryContext } from "@effect-atom/atom-react";
|
|
14
|
+
import * as Cause from "effect/Cause";
|
|
15
|
+
import * as Effect from "effect/Effect";
|
|
16
|
+
import * as Exit from "effect/Exit";
|
|
17
|
+
import React, { useCallback, useContext, useMemo, useState } from "react";
|
|
18
|
+
import { Agent } from "@dxos/assistant-toolkit";
|
|
19
|
+
import { Blueprint, Prompt } from "@dxos/blueprints";
|
|
20
|
+
import { Filter, Obj, Query, Ref } from "@dxos/echo";
|
|
21
|
+
import { QueryBuilder } from "@dxos/echo-query";
|
|
22
|
+
import { FunctionInvocationService, TracingService } from "@dxos/functions";
|
|
15
23
|
import { invariant as invariant2 } from "@dxos/invariant";
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
24
|
+
import { log as log2 } from "@dxos/log";
|
|
25
|
+
import { useComputeRuntimeCallback } from "@dxos/plugin-automation";
|
|
26
|
+
import { Graph } from "@dxos/plugin-explorer/types";
|
|
18
27
|
import { DropdownMenu, IconButton, Toolbar, useTranslation } from "@dxos/react-ui";
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
28
|
+
import { Layout } from "@dxos/react-ui";
|
|
29
|
+
import { useAttention } from "@dxos/react-ui-attention";
|
|
30
|
+
import { Text, View } from "@dxos/schema";
|
|
31
|
+
import { isNonNullable } from "@dxos/util";
|
|
21
32
|
|
|
22
|
-
// src/notebook/
|
|
23
|
-
import {
|
|
33
|
+
// src/notebook/compute-graph.ts
|
|
34
|
+
import { Atom } from "@effect-atom/atom-react";
|
|
24
35
|
import { log } from "@dxos/log";
|
|
25
36
|
|
|
26
37
|
// src/notebook/eval.ts
|
|
27
38
|
import { trim } from "@dxos/util";
|
|
28
|
-
var evalScript = (code, deps = {}) => {
|
|
39
|
+
var evalScript = async (code, deps = {}) => {
|
|
29
40
|
const sandbox = {
|
|
30
41
|
...deps,
|
|
31
42
|
// Block access to global objects.
|
|
@@ -57,11 +68,11 @@ var evalScript = (code, deps = {}) => {
|
|
|
57
68
|
};
|
|
58
69
|
const sandboxKeys = Object.keys(sandbox);
|
|
59
70
|
const sandboxValues = Object.values(sandbox);
|
|
60
|
-
const
|
|
71
|
+
const fn2 = new Function(...sandboxKeys, trim`
|
|
61
72
|
'use strict';
|
|
62
73
|
return ${code};
|
|
63
74
|
`);
|
|
64
|
-
return
|
|
75
|
+
return fn2(...sandboxValues);
|
|
65
76
|
};
|
|
66
77
|
var builtIns = /* @__PURE__ */ new Set([
|
|
67
78
|
// Types.
|
|
@@ -103,19 +114,6 @@ var systemDefinitions = trim`
|
|
|
103
114
|
import { createSystem, createVirtualTypeScriptEnvironment } from "@typescript/vfs";
|
|
104
115
|
import ts from "typescript";
|
|
105
116
|
import { invariant } from "@dxos/invariant";
|
|
106
|
-
function _define_property(obj, key, value) {
|
|
107
|
-
if (key in obj) {
|
|
108
|
-
Object.defineProperty(obj, key, {
|
|
109
|
-
value,
|
|
110
|
-
enumerable: true,
|
|
111
|
-
configurable: true,
|
|
112
|
-
writable: true
|
|
113
|
-
});
|
|
114
|
-
} else {
|
|
115
|
-
obj[key] = value;
|
|
116
|
-
}
|
|
117
|
-
return obj;
|
|
118
|
-
}
|
|
119
117
|
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-script/src/notebook/vfs-parser.ts";
|
|
120
118
|
var systemFiles = [
|
|
121
119
|
{
|
|
@@ -124,6 +122,16 @@ var systemFiles = [
|
|
|
124
122
|
}
|
|
125
123
|
];
|
|
126
124
|
var VirtualTypeScriptParser = class {
|
|
125
|
+
compilerOptions = {
|
|
126
|
+
target: ts.ScriptTarget.ES2020,
|
|
127
|
+
module: ts.ModuleKind.ESNext,
|
|
128
|
+
strict: true,
|
|
129
|
+
esModuleInterop: true,
|
|
130
|
+
skipLibCheck: true,
|
|
131
|
+
forceConsistentCasingInfilenames: true,
|
|
132
|
+
jsx: ts.JsxEmit.React,
|
|
133
|
+
noLib: true
|
|
134
|
+
};
|
|
127
135
|
/**
|
|
128
136
|
* Parse a single expression or statement.
|
|
129
137
|
*/
|
|
@@ -372,54 +380,70 @@ var VirtualTypeScriptParser = class {
|
|
|
372
380
|
const system = createSystem(fileMap);
|
|
373
381
|
return createVirtualTypeScriptEnvironment(system, allFiles.map(({ filename }) => filename), ts, this.compilerOptions);
|
|
374
382
|
}
|
|
375
|
-
constructor() {
|
|
376
|
-
_define_property(this, "compilerOptions", {
|
|
377
|
-
target: ts.ScriptTarget.ES2020,
|
|
378
|
-
module: ts.ModuleKind.ESNext,
|
|
379
|
-
strict: true,
|
|
380
|
-
esModuleInterop: true,
|
|
381
|
-
skipLibCheck: true,
|
|
382
|
-
forceConsistentCasingInfilenames: true,
|
|
383
|
-
jsx: ts.JsxEmit.React,
|
|
384
|
-
noLib: true
|
|
385
|
-
});
|
|
386
|
-
}
|
|
387
383
|
};
|
|
388
384
|
|
|
389
|
-
// src/notebook/
|
|
390
|
-
|
|
391
|
-
if (key in obj) {
|
|
392
|
-
Object.defineProperty(obj, key, {
|
|
393
|
-
value,
|
|
394
|
-
enumerable: true,
|
|
395
|
-
configurable: true,
|
|
396
|
-
writable: true
|
|
397
|
-
});
|
|
398
|
-
} else {
|
|
399
|
-
obj[key] = value;
|
|
400
|
-
}
|
|
401
|
-
return obj;
|
|
402
|
-
}
|
|
403
|
-
var __dxlog_file2 = "/__w/dxos/dxos/packages/plugins/plugin-script/src/notebook/notebook.ts";
|
|
385
|
+
// src/notebook/compute-graph.ts
|
|
386
|
+
var __dxlog_file2 = "/__w/dxos/dxos/packages/plugins/plugin-script/src/notebook/compute-graph.ts";
|
|
404
387
|
var ComputeGraph = class {
|
|
388
|
+
_notebook;
|
|
389
|
+
_registry;
|
|
390
|
+
_parser = new VirtualTypeScriptParser();
|
|
391
|
+
_expressionsAtom = Atom.make({});
|
|
392
|
+
_valuesByCellIdAtom = Atom.make({});
|
|
393
|
+
_valuesByNameAtom = Atom.make({});
|
|
394
|
+
constructor(_notebook, _registry) {
|
|
395
|
+
this._notebook = _notebook;
|
|
396
|
+
this._registry = _registry;
|
|
397
|
+
}
|
|
405
398
|
/**
|
|
406
|
-
*
|
|
399
|
+
* Atom for parsed expressions by cell ID.
|
|
407
400
|
*/
|
|
408
401
|
get expressions() {
|
|
409
|
-
return this.
|
|
402
|
+
return this._expressionsAtom;
|
|
410
403
|
}
|
|
411
404
|
/**
|
|
412
|
-
*
|
|
405
|
+
* Get current expressions by cell ID.
|
|
406
|
+
*/
|
|
407
|
+
getExpressions() {
|
|
408
|
+
return this._registry.get(this._expressionsAtom);
|
|
409
|
+
}
|
|
410
|
+
/**
|
|
411
|
+
* Atom for computed values by cell ID.
|
|
413
412
|
*/
|
|
414
413
|
get values() {
|
|
415
|
-
return this.
|
|
414
|
+
return this._valuesByCellIdAtom;
|
|
415
|
+
}
|
|
416
|
+
/**
|
|
417
|
+
* Get computed values by cell ID.
|
|
418
|
+
*/
|
|
419
|
+
getValues() {
|
|
420
|
+
return this._registry.get(this._valuesByCellIdAtom);
|
|
421
|
+
}
|
|
422
|
+
/**
|
|
423
|
+
* Atom for computed values by name.
|
|
424
|
+
*/
|
|
425
|
+
get valuesByName() {
|
|
426
|
+
return this._valuesByNameAtom;
|
|
427
|
+
}
|
|
428
|
+
/**
|
|
429
|
+
* Get current values by name.
|
|
430
|
+
*/
|
|
431
|
+
getValuesByName() {
|
|
432
|
+
return this._registry.get(this._valuesByNameAtom);
|
|
433
|
+
}
|
|
434
|
+
/**
|
|
435
|
+
* Get computed value by cell ID.
|
|
436
|
+
*/
|
|
437
|
+
getValue(cellId) {
|
|
438
|
+
return this._registry.get(this._valuesByCellIdAtom)[cellId];
|
|
416
439
|
}
|
|
417
440
|
/**
|
|
418
441
|
* Compute values.
|
|
419
442
|
*/
|
|
420
|
-
evaluate() {
|
|
443
|
+
async evaluate() {
|
|
421
444
|
const { expressions, dependencyGraph } = this.parse();
|
|
422
|
-
this.
|
|
445
|
+
this._registry.set(this._valuesByCellIdAtom, {});
|
|
446
|
+
this._registry.set(this._valuesByNameAtom, {});
|
|
423
447
|
const cellExpressions = /* @__PURE__ */ new Map();
|
|
424
448
|
Object.entries(expressions).forEach(([id, expr]) => {
|
|
425
449
|
cellExpressions.set(id, expr);
|
|
@@ -434,19 +458,19 @@ var ComputeGraph = class {
|
|
|
434
458
|
cellId
|
|
435
459
|
}, {
|
|
436
460
|
F: __dxlog_file2,
|
|
437
|
-
L:
|
|
461
|
+
L: 105,
|
|
438
462
|
S: this,
|
|
439
463
|
C: (f, a) => f(...a)
|
|
440
464
|
});
|
|
441
465
|
continue;
|
|
442
466
|
}
|
|
443
|
-
const cellSource = this._notebook.cells.find((cell) => cell.id === cellId)?.
|
|
467
|
+
const cellSource = this._notebook.cells.find((cell) => cell.id === cellId)?.source?.target?.content;
|
|
444
468
|
if (!cellSource) {
|
|
445
469
|
log.error("no source for cell", {
|
|
446
470
|
cellId
|
|
447
471
|
}, {
|
|
448
472
|
F: __dxlog_file2,
|
|
449
|
-
L:
|
|
473
|
+
L: 111,
|
|
450
474
|
S: this,
|
|
451
475
|
C: (f, a) => f(...a)
|
|
452
476
|
});
|
|
@@ -463,14 +487,14 @@ var ComputeGraph = class {
|
|
|
463
487
|
if (rhs.endsWith(";")) {
|
|
464
488
|
rhs = rhs.slice(0, -1).trim();
|
|
465
489
|
}
|
|
466
|
-
const result =
|
|
490
|
+
const result = await this.eval(rhs, valuesByName);
|
|
467
491
|
valuesByName[expr.name] = result;
|
|
468
492
|
if (typeof result !== "function") {
|
|
469
493
|
valuesByCellId[cellId] = result;
|
|
470
494
|
}
|
|
471
495
|
}
|
|
472
496
|
} else {
|
|
473
|
-
const result =
|
|
497
|
+
const result = await this.eval(cellSource, valuesByName);
|
|
474
498
|
valuesByCellId[cellId] = result;
|
|
475
499
|
}
|
|
476
500
|
} catch (error) {
|
|
@@ -479,21 +503,25 @@ var ComputeGraph = class {
|
|
|
479
503
|
error
|
|
480
504
|
}, {
|
|
481
505
|
F: __dxlog_file2,
|
|
482
|
-
L:
|
|
506
|
+
L: 147,
|
|
483
507
|
S: this,
|
|
484
508
|
C: (f, a) => f(...a)
|
|
485
509
|
});
|
|
486
510
|
}
|
|
487
511
|
}
|
|
488
|
-
this.
|
|
512
|
+
this._registry.set(this._valuesByCellIdAtom, valuesByCellId);
|
|
513
|
+
this._registry.set(this._valuesByNameAtom, valuesByName);
|
|
489
514
|
return valuesByCellId;
|
|
490
515
|
}
|
|
516
|
+
async eval(source, values) {
|
|
517
|
+
return evalScript(source, values);
|
|
518
|
+
}
|
|
491
519
|
/**
|
|
492
520
|
* Parse expressions.
|
|
493
521
|
*/
|
|
494
522
|
parse() {
|
|
495
523
|
const expressions = this._notebook.cells.filter((cell) => cell.type === "script").reduce((acc, cell) => {
|
|
496
|
-
const text = cell.
|
|
524
|
+
const text = cell.source?.target?.content.trim();
|
|
497
525
|
if (text) {
|
|
498
526
|
const parsed = this._parser.parseExpression(text);
|
|
499
527
|
acc[cell.id] = parsed;
|
|
@@ -501,7 +529,7 @@ var ComputeGraph = class {
|
|
|
501
529
|
return acc;
|
|
502
530
|
}, {});
|
|
503
531
|
const dependencyGraph = this.buildDependencyGraph(expressions);
|
|
504
|
-
this.
|
|
532
|
+
this._registry.set(this._expressionsAtom, expressions);
|
|
505
533
|
return {
|
|
506
534
|
expressions,
|
|
507
535
|
dependencyGraph
|
|
@@ -540,145 +568,279 @@ var ComputeGraph = class {
|
|
|
540
568
|
});
|
|
541
569
|
return graph;
|
|
542
570
|
}
|
|
543
|
-
constructor(_notebook) {
|
|
544
|
-
_define_property2(this, "_notebook", void 0);
|
|
545
|
-
_define_property2(this, "_parser", void 0);
|
|
546
|
-
_define_property2(this, "_expressions", void 0);
|
|
547
|
-
_define_property2(this, "_values", void 0);
|
|
548
|
-
this._notebook = _notebook;
|
|
549
|
-
this._parser = new VirtualTypeScriptParser();
|
|
550
|
-
this._expressions = signal({});
|
|
551
|
-
this._values = signal({});
|
|
552
|
-
}
|
|
553
571
|
};
|
|
554
572
|
|
|
555
573
|
// src/components/NotebookContainer.tsx
|
|
556
574
|
var __dxlog_file3 = "/__w/dxos/dxos/packages/plugins/plugin-script/src/components/NotebookContainer.tsx";
|
|
557
|
-
var
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
575
|
+
var INCLUDE_BLUEPRINTS = [
|
|
576
|
+
"dxos.org/blueprint/assistant",
|
|
577
|
+
"dxos.org/blueprint/markdown"
|
|
578
|
+
];
|
|
579
|
+
var NotebookContainer = ({ role, subject: notebook, env }) => {
|
|
580
|
+
const { t } = useTranslation(meta.id);
|
|
581
|
+
const registry = useContext(RegistryContext);
|
|
582
|
+
const db = notebook && Obj.getDatabase(notebook);
|
|
583
|
+
const attendableId = notebook ? Obj.getDXN(notebook).toString() : "";
|
|
584
|
+
const { hasAttention } = useAttention(attendableId);
|
|
585
|
+
const graph = useMemo(() => notebook && new ComputeGraph(notebook, registry), [
|
|
586
|
+
notebook,
|
|
587
|
+
registry
|
|
588
|
+
]);
|
|
589
|
+
const [queryValues, setQueryValues] = useState({});
|
|
590
|
+
const handleExecQueries = useCallback(async () => {
|
|
591
|
+
invariant2(db, void 0, {
|
|
592
|
+
F: __dxlog_file3,
|
|
593
|
+
L: 54,
|
|
594
|
+
S: void 0,
|
|
595
|
+
A: [
|
|
596
|
+
"db",
|
|
597
|
+
""
|
|
598
|
+
]
|
|
599
|
+
});
|
|
600
|
+
const builder = new QueryBuilder();
|
|
601
|
+
for (const cell of notebook?.cells ?? []) {
|
|
602
|
+
if (cell.type === "query") {
|
|
603
|
+
if (cell.source?.target) {
|
|
604
|
+
const source = cell.source.target.content;
|
|
605
|
+
const { name, filter } = builder.build(source);
|
|
606
|
+
if (filter) {
|
|
607
|
+
const ast = Query.select(filter).ast;
|
|
608
|
+
const graph2 = cell.graph?.target;
|
|
609
|
+
if (!graph2) {
|
|
610
|
+
const { view } = await View.makeFromDatabase({
|
|
611
|
+
db
|
|
612
|
+
});
|
|
613
|
+
const newGraph = Graph.make({
|
|
614
|
+
query: {
|
|
615
|
+
ast
|
|
616
|
+
},
|
|
617
|
+
view
|
|
618
|
+
});
|
|
619
|
+
Obj.change(notebook, (n) => {
|
|
620
|
+
const c = n.cells.find((c2) => c2.id === cell.id);
|
|
621
|
+
if (c) {
|
|
622
|
+
c.graph = Ref.make(newGraph);
|
|
623
|
+
c.name = name;
|
|
624
|
+
}
|
|
625
|
+
});
|
|
626
|
+
} else {
|
|
627
|
+
Obj.change(graph2, (g) => {
|
|
628
|
+
g.query.ast = ast;
|
|
629
|
+
});
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
if (cell.name && cell.graph?.target) {
|
|
634
|
+
const graph2 = Obj.getSnapshot(cell.graph?.target);
|
|
635
|
+
const query = Query.fromAst(graph2.query.ast);
|
|
636
|
+
const objects = await db.query(query).run();
|
|
637
|
+
const objectIds = objects?.map((obj) => obj.id);
|
|
638
|
+
setQueryValues((prev) => ({
|
|
639
|
+
...prev,
|
|
640
|
+
[cell.name]: objectIds
|
|
641
|
+
}));
|
|
586
642
|
}
|
|
587
643
|
}
|
|
588
|
-
}
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
644
|
+
}
|
|
645
|
+
}, [
|
|
646
|
+
db,
|
|
647
|
+
notebook,
|
|
648
|
+
graph
|
|
649
|
+
]);
|
|
650
|
+
const [promptResults, setPromptResults] = useState({});
|
|
651
|
+
const handleExecPrompts = useComputeRuntimeCallback(db?.spaceId, Effect.fnUntraced(function* () {
|
|
652
|
+
invariant2(graph, void 0, {
|
|
653
|
+
F: __dxlog_file3,
|
|
654
|
+
L: 98,
|
|
655
|
+
S: this,
|
|
656
|
+
A: [
|
|
657
|
+
"graph",
|
|
658
|
+
""
|
|
659
|
+
]
|
|
660
|
+
});
|
|
661
|
+
const prompts = notebook?.cells.filter((cell) => cell.type === "prompt").map((cell) => cell.prompt).filter(isNonNullable) ?? [];
|
|
662
|
+
for (const prompt of prompts) {
|
|
663
|
+
yield* runPrompt({
|
|
664
|
+
prompt,
|
|
665
|
+
input: {
|
|
666
|
+
...queryValues,
|
|
667
|
+
...graph.getValuesByName()
|
|
668
|
+
},
|
|
669
|
+
onResult: (result) => setPromptResults((prev) => ({
|
|
670
|
+
...prev,
|
|
671
|
+
[prompt.dxn.toString()]: result
|
|
672
|
+
}))
|
|
600
673
|
});
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
674
|
+
}
|
|
675
|
+
}), [
|
|
676
|
+
notebook,
|
|
677
|
+
graph,
|
|
678
|
+
queryValues
|
|
679
|
+
]);
|
|
680
|
+
const handleCompute = useCallback(async () => {
|
|
681
|
+
await graph?.evaluate();
|
|
682
|
+
await handleExecQueries();
|
|
683
|
+
await handleExecPrompts();
|
|
684
|
+
}, [
|
|
685
|
+
graph,
|
|
686
|
+
handleExecQueries,
|
|
687
|
+
handleExecPrompts
|
|
688
|
+
]);
|
|
689
|
+
const handleRearrange = useCallback((source, target) => {
|
|
690
|
+
invariant2(notebook, void 0, {
|
|
691
|
+
F: __dxlog_file3,
|
|
692
|
+
L: 131,
|
|
693
|
+
S: void 0,
|
|
694
|
+
A: [
|
|
695
|
+
"notebook",
|
|
696
|
+
""
|
|
697
|
+
]
|
|
698
|
+
});
|
|
699
|
+
const from = notebook.cells.findIndex((cell) => cell.id === source.id);
|
|
700
|
+
const to = notebook.cells.findIndex((cell) => cell.id === target.id);
|
|
701
|
+
if (from != null && to != null) {
|
|
702
|
+
Obj.change(notebook, (n) => {
|
|
703
|
+
const cell = n.cells.splice(from, 1)[0];
|
|
704
|
+
if (cell) {
|
|
705
|
+
n.cells.splice(to, 0, cell);
|
|
611
706
|
}
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
707
|
+
});
|
|
708
|
+
}
|
|
709
|
+
}, [
|
|
710
|
+
notebook
|
|
711
|
+
]);
|
|
712
|
+
const handleCellInsert = useCallback(async (type, after) => {
|
|
713
|
+
invariant2(notebook, void 0, {
|
|
714
|
+
F: __dxlog_file3,
|
|
715
|
+
L: 148,
|
|
716
|
+
S: void 0,
|
|
717
|
+
A: [
|
|
718
|
+
"notebook",
|
|
719
|
+
""
|
|
720
|
+
]
|
|
721
|
+
});
|
|
722
|
+
const cell = {
|
|
723
|
+
id: crypto.randomUUID(),
|
|
724
|
+
type
|
|
725
|
+
};
|
|
726
|
+
switch (type) {
|
|
727
|
+
case "markdown":
|
|
728
|
+
case "script":
|
|
729
|
+
case "query": {
|
|
730
|
+
cell.source = Ref.make(Text.make());
|
|
731
|
+
break;
|
|
732
|
+
}
|
|
733
|
+
case "prompt": {
|
|
734
|
+
if (db) {
|
|
735
|
+
const objects = await db.query(Query.select(Filter.type(Blueprint.Blueprint))).run();
|
|
736
|
+
const blueprints = objects.filter((blueprint) => INCLUDE_BLUEPRINTS.includes(blueprint.key)).map((blueprint) => Ref.make(blueprint));
|
|
737
|
+
cell.prompt = Ref.make(Prompt.make({
|
|
738
|
+
instructions: "",
|
|
739
|
+
blueprints
|
|
740
|
+
}));
|
|
619
741
|
}
|
|
742
|
+
break;
|
|
620
743
|
}
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
744
|
+
}
|
|
745
|
+
const idx = after ? notebook.cells.findIndex((cell2) => cell2.id === after) : notebook.cells.length;
|
|
746
|
+
Obj.change(notebook, (n) => {
|
|
747
|
+
n.cells.splice(idx, 0, cell);
|
|
748
|
+
});
|
|
749
|
+
}, [
|
|
750
|
+
db,
|
|
751
|
+
notebook
|
|
752
|
+
]);
|
|
753
|
+
const handleCellDelete = useCallback((id) => {
|
|
754
|
+
invariant2(notebook, void 0, {
|
|
755
|
+
F: __dxlog_file3,
|
|
756
|
+
L: 180,
|
|
757
|
+
S: void 0,
|
|
758
|
+
A: [
|
|
759
|
+
"notebook",
|
|
760
|
+
""
|
|
761
|
+
]
|
|
762
|
+
});
|
|
763
|
+
const idx = notebook.cells.findIndex((cell) => cell.id === id);
|
|
764
|
+
if (idx !== -1) {
|
|
765
|
+
Obj.change(notebook, (n) => {
|
|
766
|
+
n.cells.splice(idx, 1);
|
|
636
767
|
});
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
} finally {
|
|
676
|
-
_effect.f();
|
|
677
|
-
}
|
|
768
|
+
}
|
|
769
|
+
}, [
|
|
770
|
+
notebook
|
|
771
|
+
]);
|
|
772
|
+
return /* @__PURE__ */ React.createElement(Layout.Main, {
|
|
773
|
+
role,
|
|
774
|
+
toolbar: true
|
|
775
|
+
}, /* @__PURE__ */ React.createElement(Toolbar.Root, {
|
|
776
|
+
disabled: !hasAttention,
|
|
777
|
+
textBlockWidth: true
|
|
778
|
+
}, /* @__PURE__ */ React.createElement(DropdownMenu.Root, null, /* @__PURE__ */ React.createElement(DropdownMenu.Trigger, {
|
|
779
|
+
asChild: true
|
|
780
|
+
}, /* @__PURE__ */ React.createElement(IconButton, {
|
|
781
|
+
icon: "ph--plus--regular",
|
|
782
|
+
iconOnly: true,
|
|
783
|
+
label: t("notebook cell insert label")
|
|
784
|
+
})), /* @__PURE__ */ React.createElement(NotebookMenu, {
|
|
785
|
+
onCellInsert: handleCellInsert
|
|
786
|
+
})), /* @__PURE__ */ React.createElement(Toolbar.IconButton, {
|
|
787
|
+
icon: "ph--play--fill",
|
|
788
|
+
iconOnly: true,
|
|
789
|
+
label: t("compute label"),
|
|
790
|
+
classNames: "text-green-500",
|
|
791
|
+
onClick: handleCompute
|
|
792
|
+
})), /* @__PURE__ */ React.createElement("div", {
|
|
793
|
+
role: "none",
|
|
794
|
+
className: "flex bs-full overflow-hidden -mis-[1px] -mie-[1px]"
|
|
795
|
+
}, /* @__PURE__ */ React.createElement(NotebookStack, {
|
|
796
|
+
classNames: "container-max-width border-l border-r border-subduedSeparator",
|
|
797
|
+
db,
|
|
798
|
+
notebook,
|
|
799
|
+
graph,
|
|
800
|
+
env,
|
|
801
|
+
promptResults,
|
|
802
|
+
onRearrange: handleRearrange,
|
|
803
|
+
onCellInsert: handleCellInsert,
|
|
804
|
+
onCellDelete: handleCellDelete
|
|
805
|
+
})));
|
|
678
806
|
};
|
|
679
807
|
var NotebookContainer_default = NotebookContainer;
|
|
808
|
+
var runPrompt = Effect.fn(function* ({ prompt, input, onResult }) {
|
|
809
|
+
const inputData = {
|
|
810
|
+
prompt,
|
|
811
|
+
input
|
|
812
|
+
};
|
|
813
|
+
const tracer = yield* TracingService;
|
|
814
|
+
const trace = yield* tracer.traceInvocationStart({
|
|
815
|
+
target: void 0,
|
|
816
|
+
payload: {
|
|
817
|
+
data: {}
|
|
818
|
+
}
|
|
819
|
+
});
|
|
820
|
+
const result = yield* FunctionInvocationService.invokeFunction(Agent.prompt, inputData).pipe(Effect.provide(trace.invocationTraceQueue ? TracingService.layerInvocation(trace) : TracingService.layerNoop), Effect.exit);
|
|
821
|
+
Exit.match(result, {
|
|
822
|
+
onFailure: (cause) => {
|
|
823
|
+
const error = Cause.prettyErrors(cause)[0];
|
|
824
|
+
log2.error(error.message, error.cause ?? error.stack, {
|
|
825
|
+
F: __dxlog_file3,
|
|
826
|
+
L: 258,
|
|
827
|
+
S: this,
|
|
828
|
+
C: (f, a) => f(...a)
|
|
829
|
+
});
|
|
830
|
+
onResult(error.message);
|
|
831
|
+
},
|
|
832
|
+
onSuccess: (result2) => {
|
|
833
|
+
onResult(result2.note);
|
|
834
|
+
}
|
|
835
|
+
});
|
|
836
|
+
yield* tracer.traceInvocationEnd({
|
|
837
|
+
trace,
|
|
838
|
+
// TODO(dmaretskyi): Might miss errors.
|
|
839
|
+
exception: Exit.isFailure(result) ? Cause.prettyErrors(result.cause)[0] : void 0
|
|
840
|
+
});
|
|
841
|
+
});
|
|
680
842
|
export {
|
|
681
843
|
NotebookContainer,
|
|
682
844
|
NotebookContainer_default as default
|
|
683
845
|
};
|
|
684
|
-
//# sourceMappingURL=NotebookContainer-
|
|
846
|
+
//# sourceMappingURL=NotebookContainer-DQGZ6QHI.mjs.map
|