@dxos/plugin-script 0.8.4-main.3c1ae3b → 0.8.4-main.3eb6e50203
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-GL2Z5I5Q.mjs → NotebookContainer-UQ4I24R6.mjs} +266 -238
- 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-S22N3BUR.mjs → chunk-4N5TLXEJ.mjs} +26 -9
- 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-LYMPME7J.mjs +609 -0
- package/dist/lib/browser/chunk-LYMPME7J.mjs.map +7 -0
- package/dist/lib/browser/{chunk-UGDRMROB.mjs → chunk-WWCDIB6Z.mjs} +160 -145
- package/dist/lib/browser/chunk-WWCDIB6Z.mjs.map +7 -0
- package/dist/lib/browser/{chunk-EB6AXFXO.mjs → chunk-WYR4QHPE.mjs} +1 -1
- package/dist/lib/browser/chunk-WYR4QHPE.mjs.map +7 -0
- package/dist/lib/browser/{compiler-2HV5KXV4.mjs → compiler-VPUVTFQD.mjs} +40 -22
- package/dist/lib/browser/compiler-VPUVTFQD.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +93 -103
- 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-ASV2KBRA.mjs → react-surface-FYOQSC6S.mjs} +48 -36
- 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 +1 -1
- package/dist/lib/browser/types/index.mjs +9 -5
- package/dist/lib/node-esm/{DeploymentDialog-5EN2KZE5.mjs → DeploymentDialog-GGWDQMEB.mjs} +6 -7
- package/dist/lib/node-esm/DeploymentDialog-GGWDQMEB.mjs.map +7 -0
- package/dist/lib/node-esm/{NotebookContainer-7RCEXND7.mjs → NotebookContainer-DQGZ6QHI.mjs} +266 -238
- 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-IBV2DR36.mjs → chunk-5HSJPAK7.mjs} +1 -1
- package/dist/lib/node-esm/chunk-5HSJPAK7.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-4VVV5L5A.mjs → chunk-ECRSTVR6.mjs} +160 -145
- package/dist/lib/node-esm/chunk-ECRSTVR6.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-2S43VHAM.mjs → chunk-V37R7KB5.mjs} +26 -9
- 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-KPEZKEHC.mjs → compiler-WUOSY6MS.mjs} +40 -22
- package/dist/lib/node-esm/compiler-WUOSY6MS.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +93 -103
- 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-NXBO7VYB.mjs → react-surface-LREMOVNJ.mjs} +48 -36
- 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 +1 -1
- package/dist/lib/node-esm/types/index.mjs +9 -5
- 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/components/DeploymentDialog/DeploymentDialog.d.ts.map +1 -1
- package/dist/types/src/components/DeploymentDialog/DeploymentDialog.stories.d.ts +1 -3
- package/dist/types/src/components/DeploymentDialog/DeploymentDialog.stories.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 -250
- package/dist/types/src/components/NotebookContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/NotebookStack/NotebookCell.d.ts +3 -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 +2 -1
- package/dist/types/src/components/NotebookStack/NotebookStack.stories.d.ts.map +1 -1
- package/dist/types/src/components/QueryEditor/QueryEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/ScriptContainer.d.ts +4 -5
- package/dist/types/src/components/ScriptContainer.d.ts.map +1 -1
- package/dist/types/src/components/ScriptToolbar/ScriptToolbar.d.ts +2 -2
- package/dist/types/src/components/ScriptToolbar/ScriptToolbar.d.ts.map +1 -1
- package/dist/types/src/components/ScriptToolbar/ScriptToolbar.stories.d.ts +2 -1
- package/dist/types/src/components/ScriptToolbar/ScriptToolbar.stories.d.ts.map +1 -1
- package/dist/types/src/components/Settings/ScriptObjectSettings.d.ts.map +1 -1
- package/dist/types/src/components/Settings/ScriptPluginSettings.d.ts +4 -2
- package/dist/types/src/components/Settings/ScriptPluginSettings.d.ts.map +1 -1
- package/dist/types/src/components/TestPanel/TestContainer.d.ts +1 -1
- 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/hooks/deploy.d.ts +7 -6
- package/dist/types/src/hooks/deploy.d.ts.map +1 -1
- package/dist/types/src/hooks/format.d.ts +2 -2
- package/dist/types/src/hooks/format.d.ts.map +1 -1
- package/dist/types/src/hooks/template.d.ts +2 -2
- package/dist/types/src/hooks/template.d.ts.map +1 -1
- package/dist/types/src/hooks/useCompiler.d.ts.map +1 -1
- 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 +24 -11
- package/dist/types/src/notebook/compute-graph.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/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/types/Notebook.d.ts +88 -19
- package/dist/types/src/types/Notebook.d.ts.map +1 -1
- package/dist/types/src/types/actions.d.ts +30 -44
- 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 +2 -0
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/util/deploy.d.ts.map +1 -1
- package/dist/types/src/util/functions.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +113 -90
- package/src/ScriptPlugin.tsx +38 -61
- 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} +88 -85
- 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/components/DeploymentDialog/DeploymentDialog.stories.tsx +28 -24
- package/src/components/DeploymentDialog/DeploymentDialog.tsx +22 -42
- package/src/components/FrameContainer/FrameContainer.tsx +1 -1
- package/src/components/NotebookContainer.stories.tsx +24 -20
- package/src/components/NotebookContainer.tsx +49 -38
- package/src/components/NotebookStack/NotebookCell.tsx +18 -17
- package/src/components/NotebookStack/NotebookStack.stories.tsx +20 -19
- package/src/components/NotebookStack/NotebookStack.tsx +4 -4
- package/src/components/QueryEditor/QueryEditor.stories.tsx +18 -7
- package/src/components/ScriptContainer.tsx +46 -32
- package/src/components/ScriptToolbar/ScriptToolbar.stories.tsx +39 -16
- package/src/components/ScriptToolbar/ScriptToolbar.tsx +14 -17
- package/src/components/Settings/ScriptObjectSettings.tsx +40 -29
- package/src/components/Settings/ScriptPluginSettings.tsx +19 -14
- package/src/components/TestPanel/TestContainer.tsx +5 -5
- package/src/components/TestPanel/TestPanel.tsx +25 -23
- package/src/components/TypescriptEditor/TypescriptEditor.stories.tsx +12 -7
- package/src/components/TypescriptEditor/TypescriptEditor.tsx +69 -68
- package/src/e2e/ai.test.ts +92 -0
- package/src/hooks/deploy.ts +33 -26
- package/src/hooks/format.ts +5 -1
- package/src/hooks/template.ts +15 -9
- package/src/hooks/useCompiler.ts +5 -4
- package/src/hooks/useCreateAndDeployScriptTemplates.ts +13 -19
- package/src/hooks/useToolbarState.ts +29 -4
- package/src/index.ts +1 -1
- package/src/meta.ts +2 -2
- package/src/notebook/compute-graph.test.ts +20 -8
- package/src/notebook/compute-graph.ts +45 -21
- 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/forex-effect.ts +1 -1
- package/src/templates/index.ts +18 -5
- package/src/templates/ping.ts +14 -5
- package/src/types/Notebook.ts +7 -8
- package/src/types/actions.ts +17 -25
- package/src/types/capabilities.ts +17 -0
- package/src/types/events.ts +11 -0
- package/src/types/index.ts +2 -0
- package/src/types/types.ts +1 -1
- package/src/util/deploy.ts +6 -2
- package/src/util/functions.ts +24 -22
- package/dist/lib/browser/DeploymentDialog-FIHD4UVK.mjs +0 -15
- package/dist/lib/browser/NotebookContainer-GL2Z5I5Q.mjs.map +0 -7
- package/dist/lib/browser/ScriptContainer-F4OK3OG6.mjs +0 -149
- package/dist/lib/browser/ScriptContainer-F4OK3OG6.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-2WR2ATTJ.mjs +0 -66
- package/dist/lib/browser/app-graph-builder-2WR2ATTJ.mjs.map +0 -7
- package/dist/lib/browser/blueprint-definition-6PZWZM2Y.mjs +0 -30
- package/dist/lib/browser/blueprint-definition-6PZWZM2Y.mjs.map +0 -7
- package/dist/lib/browser/chunk-2SXDKBM7.mjs +0 -304
- package/dist/lib/browser/chunk-2SXDKBM7.mjs.map +0 -7
- package/dist/lib/browser/chunk-6X7QVTRB.mjs +0 -112
- package/dist/lib/browser/chunk-6X7QVTRB.mjs.map +0 -7
- package/dist/lib/browser/chunk-75RTLLH4.mjs +0 -155
- package/dist/lib/browser/chunk-75RTLLH4.mjs.map +0 -7
- package/dist/lib/browser/chunk-7WFISUBY.mjs +0 -647
- package/dist/lib/browser/chunk-7WFISUBY.mjs.map +0 -7
- package/dist/lib/browser/chunk-EB6AXFXO.mjs.map +0 -7
- package/dist/lib/browser/chunk-MQHBMJLH.mjs +0 -103
- package/dist/lib/browser/chunk-MQHBMJLH.mjs.map +0 -7
- package/dist/lib/browser/chunk-S22N3BUR.mjs.map +0 -7
- package/dist/lib/browser/chunk-UGDRMROB.mjs.map +0 -7
- package/dist/lib/browser/chunk-UOQ6NCH3.mjs +0 -15
- package/dist/lib/browser/chunk-UOQ6NCH3.mjs.map +0 -7
- package/dist/lib/browser/compiler-2HV5KXV4.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-3B4ESSCU.mjs +0 -105
- package/dist/lib/browser/intent-resolver-3B4ESSCU.mjs.map +0 -7
- package/dist/lib/browser/react-surface-ASV2KBRA.mjs.map +0 -7
- package/dist/lib/browser/settings-4NKLTJTT.mjs +0 -26
- package/dist/lib/browser/settings-4NKLTJTT.mjs.map +0 -7
- package/dist/lib/node-esm/NotebookContainer-7RCEXND7.mjs.map +0 -7
- package/dist/lib/node-esm/ScriptContainer-763IAKOD.mjs +0 -150
- package/dist/lib/node-esm/ScriptContainer-763IAKOD.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-NCVLUL5R.mjs +0 -67
- package/dist/lib/node-esm/app-graph-builder-NCVLUL5R.mjs.map +0 -7
- package/dist/lib/node-esm/blueprint-definition-5R6YCSZZ.mjs +0 -31
- package/dist/lib/node-esm/blueprint-definition-5R6YCSZZ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-2S43VHAM.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-32AMTGGN.mjs +0 -104
- package/dist/lib/node-esm/chunk-32AMTGGN.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-4VVV5L5A.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-535YDI5V.mjs +0 -156
- package/dist/lib/node-esm/chunk-535YDI5V.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-55JZVM6K.mjs +0 -16
- package/dist/lib/node-esm/chunk-55JZVM6K.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-6H4FYMCX.mjs +0 -114
- package/dist/lib/node-esm/chunk-6H4FYMCX.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-DKS2EQW6.mjs +0 -648
- package/dist/lib/node-esm/chunk-DKS2EQW6.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-IBV2DR36.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-NQN3JE2R.mjs +0 -305
- package/dist/lib/node-esm/chunk-NQN3JE2R.mjs.map +0 -7
- package/dist/lib/node-esm/compiler-KPEZKEHC.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-GIACMXI4.mjs +0 -106
- package/dist/lib/node-esm/intent-resolver-GIACMXI4.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-NXBO7VYB.mjs.map +0 -7
- package/dist/lib/node-esm/settings-PW5NXWLW.mjs +0 -27
- package/dist/lib/node-esm/settings-PW5NXWLW.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/templates/chess.d.ts +0 -8
- package/dist/types/src/templates/chess.d.ts.map +0 -1
- package/dist/types/src/testing/deploy.test.d.ts +0 -2
- package/dist/types/src/testing/deploy.test.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 -84
- package/src/capabilities/intent-resolver.ts +0 -86
- 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 -50
- package/src/testing/deploy.test.ts +0 -63
- /package/dist/lib/browser/{DeploymentDialog-FIHD4UVK.mjs.map → DeploymentDialog-XUAFCNI7.mjs.map} +0 -0
- /package/dist/lib/{node-esm/DeploymentDialog-5EN2KZE5.mjs.map → browser/blueprints/index.mjs.map} +0 -0
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
|
-
import React from 'react';
|
|
6
|
+
import React, { useMemo } from 'react';
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { OperationPlugin } from '@dxos/app-framework';
|
|
9
9
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
10
10
|
import { Obj } from '@dxos/echo';
|
|
11
11
|
import { ClientPlugin } from '@dxos/plugin-client';
|
|
@@ -15,44 +15,48 @@ import { AccessToken } from '@dxos/types';
|
|
|
15
15
|
|
|
16
16
|
import { translations } from '../../translations';
|
|
17
17
|
|
|
18
|
-
import { DeploymentDialog
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
import { DeploymentDialog } from './DeploymentDialog';
|
|
19
|
+
|
|
20
|
+
// TODO(wittjosiah): ECHO objects don't work when passed via Storybook args.
|
|
21
|
+
const DeploymentDialogStory = () => {
|
|
22
|
+
const accessToken = useMemo(
|
|
23
|
+
() =>
|
|
24
|
+
Obj.make(AccessToken.AccessToken, {
|
|
25
|
+
source: 'example.com',
|
|
26
|
+
token: 'example-token',
|
|
27
|
+
}),
|
|
28
|
+
[],
|
|
29
|
+
);
|
|
30
|
+
const scriptTemplates = useMemo(
|
|
31
|
+
() => [
|
|
32
|
+
{ id: 't-1', name: 'Script 1', source: 'template1' },
|
|
33
|
+
{ id: 't-2', name: 'Script 2', source: 'template2' },
|
|
34
|
+
{ id: 't-3', name: 'Script 3', source: 'template3' },
|
|
35
|
+
],
|
|
36
|
+
[],
|
|
37
|
+
);
|
|
21
38
|
return (
|
|
22
39
|
<Dialog.Root defaultOpen={true}>
|
|
23
|
-
<DeploymentDialog {
|
|
40
|
+
<DeploymentDialog accessToken={accessToken} scriptTemplates={scriptTemplates} />
|
|
24
41
|
</Dialog.Root>
|
|
25
42
|
);
|
|
26
43
|
};
|
|
27
44
|
|
|
28
45
|
const meta = {
|
|
29
46
|
title: 'plugins/plugin-script/DeploymentDialog',
|
|
30
|
-
component:
|
|
31
|
-
render: DefaultStory,
|
|
47
|
+
component: DeploymentDialogStory,
|
|
32
48
|
parameters: { translations },
|
|
33
49
|
// TODO(wittjosiah): Try to write story which does not depend on plugin manager.
|
|
34
50
|
decorators: [
|
|
35
|
-
withTheme,
|
|
51
|
+
withTheme(),
|
|
36
52
|
withPluginManager({
|
|
37
|
-
plugins: [
|
|
53
|
+
plugins: [OperationPlugin(), ClientPlugin({})],
|
|
38
54
|
}),
|
|
39
55
|
],
|
|
40
|
-
} satisfies Meta<typeof
|
|
56
|
+
} satisfies Meta<typeof DeploymentDialogStory>;
|
|
41
57
|
|
|
42
58
|
export default meta;
|
|
43
59
|
|
|
44
60
|
type Story = StoryObj<typeof meta>;
|
|
45
61
|
|
|
46
|
-
export const Default: Story = {
|
|
47
|
-
args: {
|
|
48
|
-
accessToken: Obj.make(AccessToken.AccessToken, {
|
|
49
|
-
source: 'example.com',
|
|
50
|
-
token: 'example-token',
|
|
51
|
-
}),
|
|
52
|
-
scriptTemplates: [
|
|
53
|
-
{ id: 't-1', name: 'Script 1', source: 'template1' },
|
|
54
|
-
{ id: 't-2', name: 'Script 2', source: 'template2' },
|
|
55
|
-
{ id: 't-3', name: 'Script 3', source: 'template3' },
|
|
56
|
-
],
|
|
57
|
-
},
|
|
58
|
-
};
|
|
62
|
+
export const Default: Story = {};
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useEffect, useMemo } from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { useOperationInvoker } from '@dxos/app-framework/ui';
|
|
8
|
+
import { LayoutOperation } from '@dxos/app-toolkit';
|
|
9
9
|
import { getSpace } from '@dxos/react-client/echo';
|
|
10
10
|
import { Button, Dialog, IconButton, useTranslation } from '@dxos/react-ui';
|
|
11
11
|
import { type AccessToken } from '@dxos/types';
|
|
@@ -33,53 +33,33 @@ export const DeploymentDialog = ({ accessToken, scriptTemplates }: DeploymentDia
|
|
|
33
33
|
// TODO(ZaymonFC): Thinking further. All of this should get moved to intents to run async in the background.
|
|
34
34
|
// Deployment shouldn't be tied to the lifecycle of the dialogue component.
|
|
35
35
|
const { handleCreateAndDeployScripts, status } = useCreateAndDeployScriptTemplates(space, scriptTemplates);
|
|
36
|
-
const {
|
|
36
|
+
const { invokePromise } = useOperationInvoker();
|
|
37
37
|
|
|
38
38
|
useEffect(() => {
|
|
39
39
|
if (status === 'success') {
|
|
40
40
|
// TODO(ZaymonFC): We can probably re-use this toast for normal script deployment.
|
|
41
|
-
void
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
closeLabel: ['script deployment toast close label', { ns: meta.id, count: scriptTemplates.length }],
|
|
51
|
-
},
|
|
52
|
-
}),
|
|
53
|
-
);
|
|
54
|
-
void dispatch(
|
|
55
|
-
createIntent(LayoutAction.UpdateDialog, {
|
|
56
|
-
part: 'dialog',
|
|
57
|
-
options: { state: false },
|
|
58
|
-
}),
|
|
59
|
-
);
|
|
41
|
+
void invokePromise(LayoutOperation.AddToast, {
|
|
42
|
+
id: `${meta.id}/deployment-success`,
|
|
43
|
+
icon: 'ph--check--regular',
|
|
44
|
+
duration: Infinity,
|
|
45
|
+
title: ['script deployment toast label', { ns: meta.id, count: scriptTemplates.length }],
|
|
46
|
+
description: ['script deployment toast description', { ns: meta.id, count: scriptTemplates.length }],
|
|
47
|
+
closeLabel: ['script deployment toast close label', { ns: meta.id, count: scriptTemplates.length }],
|
|
48
|
+
});
|
|
49
|
+
void invokePromise(LayoutOperation.UpdateDialog, { state: false });
|
|
60
50
|
}
|
|
61
51
|
if (status === 'error') {
|
|
62
|
-
void
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
subject: {
|
|
72
|
-
id: `${meta.id}/deployment-error`,
|
|
73
|
-
icon: 'ph--warning--regular',
|
|
74
|
-
duration: Infinity,
|
|
75
|
-
title: ['script deployment error toast label', { ns: meta.id, count: scriptTemplates.length }],
|
|
76
|
-
description: ['script deployment error toast description', { ns: meta.id, count: scriptTemplates.length }],
|
|
77
|
-
closeLabel: ['script deployment error toast close label', { ns: meta.id, count: scriptTemplates.length }],
|
|
78
|
-
},
|
|
79
|
-
}),
|
|
80
|
-
);
|
|
52
|
+
void invokePromise(LayoutOperation.UpdateDialog, { state: false });
|
|
53
|
+
void invokePromise(LayoutOperation.AddToast, {
|
|
54
|
+
id: `${meta.id}/deployment-error`,
|
|
55
|
+
icon: 'ph--warning--regular',
|
|
56
|
+
duration: Infinity,
|
|
57
|
+
title: ['script deployment error toast label', { ns: meta.id, count: scriptTemplates.length }],
|
|
58
|
+
description: ['script deployment error toast description', { ns: meta.id, count: scriptTemplates.length }],
|
|
59
|
+
closeLabel: ['script deployment error toast close label', { ns: meta.id, count: scriptTemplates.length }],
|
|
60
|
+
});
|
|
81
61
|
}
|
|
82
|
-
}, [status,
|
|
62
|
+
}, [status, invokePromise]);
|
|
83
63
|
|
|
84
64
|
return (
|
|
85
65
|
<Dialog.Content>
|
|
@@ -9,9 +9,9 @@ import { type BundleResult } from '@dxos/functions-runtime/bundler';
|
|
|
9
9
|
import { invariant } from '@dxos/invariant';
|
|
10
10
|
import { log } from '@dxos/log';
|
|
11
11
|
import { useClient } from '@dxos/react-client';
|
|
12
|
-
import { baseSurface, mx } from '@dxos/react-ui-theme';
|
|
13
12
|
import { createProtoRpcPeer } from '@dxos/rpc';
|
|
14
13
|
import { createIFramePort } from '@dxos/rpc-tunnel';
|
|
14
|
+
import { baseSurface, mx } from '@dxos/ui-theme';
|
|
15
15
|
|
|
16
16
|
export type FrameContainerProps = {
|
|
17
17
|
containerUrl: string;
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
6
7
|
import React from 'react';
|
|
7
8
|
|
|
8
9
|
import { SERVICES_CONFIG } from '@dxos/ai/testing';
|
|
9
|
-
import { IntentPlugin, SettingsPlugin } from '@dxos/app-framework';
|
|
10
10
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
11
11
|
import { Agent } from '@dxos/assistant-toolkit';
|
|
12
12
|
import { Filter } from '@dxos/echo';
|
|
@@ -16,7 +16,7 @@ import { AutomationPlugin } from '@dxos/plugin-automation';
|
|
|
16
16
|
import { ClientPlugin } from '@dxos/plugin-client';
|
|
17
17
|
import { ExplorerPlugin } from '@dxos/plugin-explorer';
|
|
18
18
|
import { Markdown, MarkdownPlugin } from '@dxos/plugin-markdown';
|
|
19
|
-
import {
|
|
19
|
+
import { corePlugins } from '@dxos/plugin-testing';
|
|
20
20
|
import { Config, useClient } from '@dxos/react-client';
|
|
21
21
|
import { useQuery } from '@dxos/react-client/echo';
|
|
22
22
|
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
@@ -28,20 +28,21 @@ import { Notebook } from '../types';
|
|
|
28
28
|
|
|
29
29
|
import { NotebookContainer } from './NotebookContainer';
|
|
30
30
|
|
|
31
|
-
const meta = {
|
|
31
|
+
const meta: Meta<typeof NotebookContainer> = {
|
|
32
32
|
title: 'plugins/plugin-script/NotebookContainer',
|
|
33
33
|
component: NotebookContainer,
|
|
34
34
|
render: (args) => {
|
|
35
35
|
const client = useClient();
|
|
36
36
|
const space = client.spaces.default;
|
|
37
37
|
const notebooks = useQuery(space?.db, Filter.type(Notebook.Notebook));
|
|
38
|
-
return <NotebookContainer {...args}
|
|
38
|
+
return <NotebookContainer {...args} subject={notebooks[0]} />;
|
|
39
39
|
},
|
|
40
40
|
decorators: [
|
|
41
|
-
withTheme,
|
|
42
|
-
withLayout({
|
|
41
|
+
withTheme(),
|
|
42
|
+
withLayout({ layout: 'column', classNames: 'is-proseMaxWidth' }),
|
|
43
43
|
withPluginManager({
|
|
44
44
|
plugins: [
|
|
45
|
+
...corePlugins(),
|
|
45
46
|
ClientPlugin({
|
|
46
47
|
// TODO(wittjosiah): ComputeRuntime requires edge to be configured or it will throw.
|
|
47
48
|
config: new Config({
|
|
@@ -50,20 +51,18 @@ const meta = {
|
|
|
50
51
|
},
|
|
51
52
|
}),
|
|
52
53
|
types: [...DataTypes, Notebook.Notebook, Function.Function, Markdown.Document],
|
|
53
|
-
onClientInitialized:
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
54
|
+
onClientInitialized: ({ client }) =>
|
|
55
|
+
Effect.gen(function* () {
|
|
56
|
+
yield* Effect.promise(() => client.halo.createIdentity());
|
|
57
|
+
yield* Effect.promise(() => client.spaces.waitUntilReady());
|
|
58
|
+
const space = client.spaces.default;
|
|
59
|
+
yield* Effect.promise(() => space.waitUntilReady());
|
|
58
60
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
space.db.add(createNotebook());
|
|
62
|
+
space.db.add(Markdown.make({ content: '# Hello World' }));
|
|
63
|
+
space.db.add(serializeFunction(Agent.prompt));
|
|
64
|
+
}),
|
|
63
65
|
}),
|
|
64
|
-
SpacePlugin({}),
|
|
65
|
-
SettingsPlugin(),
|
|
66
|
-
IntentPlugin(),
|
|
67
66
|
AssistantPlugin(),
|
|
68
67
|
AutomationPlugin(),
|
|
69
68
|
ExplorerPlugin(),
|
|
@@ -74,10 +73,15 @@ const meta = {
|
|
|
74
73
|
parameters: {
|
|
75
74
|
translations,
|
|
76
75
|
},
|
|
77
|
-
}
|
|
76
|
+
};
|
|
78
77
|
|
|
79
78
|
export default meta;
|
|
80
79
|
|
|
81
80
|
type Story = StoryObj<typeof meta>;
|
|
82
81
|
|
|
83
|
-
export const Default: Story = {
|
|
82
|
+
export const Default: Story = {
|
|
83
|
+
args: {
|
|
84
|
+
role: 'article',
|
|
85
|
+
subject: undefined as any,
|
|
86
|
+
},
|
|
87
|
+
};
|
|
@@ -2,26 +2,26 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import { RegistryContext } from '@effect-atom/atom-react';
|
|
5
6
|
import * as Cause from 'effect/Cause';
|
|
6
7
|
import * as Effect from 'effect/Effect';
|
|
7
8
|
import * as Exit from 'effect/Exit';
|
|
8
|
-
import
|
|
9
|
+
import type * as Types from 'effect/Types';
|
|
10
|
+
import React, { useCallback, useContext, useMemo, useState } from 'react';
|
|
9
11
|
|
|
12
|
+
import { type SurfaceComponentProps } from '@dxos/app-toolkit/ui';
|
|
10
13
|
import { Agent } from '@dxos/assistant-toolkit';
|
|
11
14
|
import { Blueprint, Prompt } from '@dxos/blueprints';
|
|
12
15
|
import { Filter, Obj, Query, Ref } from '@dxos/echo';
|
|
13
16
|
import { QueryBuilder } from '@dxos/echo-query';
|
|
14
|
-
import { type FunctionDefinition, FunctionInvocationService } from '@dxos/functions';
|
|
15
|
-
import { InvocationTracer } from '@dxos/functions-runtime';
|
|
16
|
-
import { TracingServiceExt } from '@dxos/functions-runtime';
|
|
17
|
+
import { type FunctionDefinition, FunctionInvocationService, TracingService } from '@dxos/functions';
|
|
17
18
|
import { invariant } from '@dxos/invariant';
|
|
18
19
|
import { log } from '@dxos/log';
|
|
19
20
|
import { useComputeRuntimeCallback } from '@dxos/plugin-automation';
|
|
20
21
|
import { Graph } from '@dxos/plugin-explorer/types';
|
|
21
|
-
import { getSpace } from '@dxos/react-client/echo';
|
|
22
22
|
import { DropdownMenu, IconButton, Toolbar, useTranslation } from '@dxos/react-ui';
|
|
23
|
+
import { Layout } from '@dxos/react-ui';
|
|
23
24
|
import { useAttention } from '@dxos/react-ui-attention';
|
|
24
|
-
import { StackItem } from '@dxos/react-ui-stack';
|
|
25
25
|
import { Text, View } from '@dxos/schema';
|
|
26
26
|
import { isNonNullable } from '@dxos/util';
|
|
27
27
|
|
|
@@ -36,24 +36,22 @@ const INCLUDE_BLUEPRINTS = ['dxos.org/blueprint/assistant', 'dxos.org/blueprint/
|
|
|
36
36
|
|
|
37
37
|
// TODO(burdon): Support calling named deployed functions (as with sheet).
|
|
38
38
|
|
|
39
|
-
export type NotebookContainerProps =
|
|
40
|
-
role?: string;
|
|
41
|
-
notebook?: Notebook.Notebook;
|
|
42
|
-
} & Pick<TypescriptEditorProps, 'env'>;
|
|
39
|
+
export type NotebookContainerProps = SurfaceComponentProps<Notebook.Notebook, Pick<TypescriptEditorProps, 'env'>>;
|
|
43
40
|
|
|
44
|
-
export const NotebookContainer = ({ notebook, env }: NotebookContainerProps) => {
|
|
41
|
+
export const NotebookContainer = ({ role, subject: notebook, env }: NotebookContainerProps) => {
|
|
45
42
|
const { t } = useTranslation(meta.id);
|
|
46
|
-
const
|
|
43
|
+
const registry = useContext(RegistryContext);
|
|
44
|
+
const db = notebook && Obj.getDatabase(notebook);
|
|
47
45
|
const attendableId = notebook ? Obj.getDXN(notebook).toString() : '';
|
|
48
46
|
const { hasAttention } = useAttention(attendableId);
|
|
49
47
|
|
|
50
48
|
// TODO(burdon): Consolidate execution and state (with graph).
|
|
51
49
|
// Generalize ComputeGraph evaluation function (using effects).
|
|
52
|
-
const graph = useMemo(() => notebook && new ComputeGraph(notebook), [notebook]);
|
|
50
|
+
const graph = useMemo(() => notebook && new ComputeGraph(notebook, registry), [notebook, registry]);
|
|
53
51
|
|
|
54
52
|
const [queryValues, setQueryValues] = useState<Record<string, any>>({});
|
|
55
53
|
const handleExecQueries = useCallback(async () => {
|
|
56
|
-
invariant(
|
|
54
|
+
invariant(db);
|
|
57
55
|
|
|
58
56
|
const builder = new QueryBuilder();
|
|
59
57
|
for (const cell of notebook?.cells ?? []) {
|
|
@@ -65,12 +63,19 @@ export const NotebookContainer = ({ notebook, env }: NotebookContainerProps) =>
|
|
|
65
63
|
const ast = Query.select(filter).ast;
|
|
66
64
|
const graph = cell.graph?.target;
|
|
67
65
|
if (!graph) {
|
|
68
|
-
const { view } = await View.
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
|
|
66
|
+
const { view } = await View.makeFromDatabase({ db });
|
|
67
|
+
const newGraph = Graph.make({ query: { ast }, view });
|
|
68
|
+
Obj.change(notebook!, (n) => {
|
|
69
|
+
const c = n.cells.find((c) => c.id === cell.id);
|
|
70
|
+
if (c) {
|
|
71
|
+
c.graph = Ref.make(newGraph);
|
|
72
|
+
c.name = name;
|
|
73
|
+
}
|
|
74
|
+
});
|
|
72
75
|
} else {
|
|
73
|
-
graph
|
|
76
|
+
Obj.change(graph, (g) => {
|
|
77
|
+
g.query.ast = ast as Obj.Mutable<typeof ast>;
|
|
78
|
+
});
|
|
74
79
|
}
|
|
75
80
|
}
|
|
76
81
|
}
|
|
@@ -78,17 +83,17 @@ export const NotebookContainer = ({ notebook, env }: NotebookContainerProps) =>
|
|
|
78
83
|
if (cell.name && cell.graph?.target) {
|
|
79
84
|
const graph = Obj.getSnapshot(cell.graph?.target);
|
|
80
85
|
const query = Query.fromAst(graph.query.ast);
|
|
81
|
-
const objects = await
|
|
86
|
+
const objects = await db.query(query).run();
|
|
82
87
|
const objectIds = objects?.map((obj) => obj.id);
|
|
83
88
|
setQueryValues((prev) => ({ ...prev, [cell.name!]: objectIds }));
|
|
84
89
|
}
|
|
85
90
|
}
|
|
86
91
|
}
|
|
87
|
-
}, [
|
|
92
|
+
}, [db, notebook, graph]);
|
|
88
93
|
|
|
89
94
|
const [promptResults, setPromptResults] = useState<Record<string, string>>({});
|
|
90
95
|
const handleExecPrompts = useComputeRuntimeCallback(
|
|
91
|
-
|
|
96
|
+
db?.spaceId,
|
|
92
97
|
Effect.fnUntraced(function* () {
|
|
93
98
|
invariant(graph);
|
|
94
99
|
|
|
@@ -101,7 +106,7 @@ export const NotebookContainer = ({ notebook, env }: NotebookContainerProps) =>
|
|
|
101
106
|
for (const prompt of prompts) {
|
|
102
107
|
yield* runPrompt({
|
|
103
108
|
prompt,
|
|
104
|
-
input: { ...queryValues, ...graph.
|
|
109
|
+
input: { ...queryValues, ...graph.getValuesByName() },
|
|
105
110
|
onResult: (result) =>
|
|
106
111
|
setPromptResults((prev) => ({
|
|
107
112
|
...prev,
|
|
@@ -127,10 +132,12 @@ export const NotebookContainer = ({ notebook, env }: NotebookContainerProps) =>
|
|
|
127
132
|
const from = notebook.cells.findIndex((cell) => cell.id === source.id);
|
|
128
133
|
const to = notebook.cells.findIndex((cell) => cell.id === target.id);
|
|
129
134
|
if (from != null && to != null) {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
135
|
+
Obj.change(notebook, (n) => {
|
|
136
|
+
const cell = n.cells.splice(from, 1)[0];
|
|
137
|
+
if (cell) {
|
|
138
|
+
n.cells.splice(to, 0, cell);
|
|
139
|
+
}
|
|
140
|
+
});
|
|
134
141
|
}
|
|
135
142
|
},
|
|
136
143
|
[notebook],
|
|
@@ -139,7 +146,7 @@ export const NotebookContainer = ({ notebook, env }: NotebookContainerProps) =>
|
|
|
139
146
|
const handleCellInsert = useCallback<NonNullable<NotebookStackProps['onCellInsert']>>(
|
|
140
147
|
async (type, after) => {
|
|
141
148
|
invariant(notebook);
|
|
142
|
-
const cell: Notebook.Cell = { id: crypto.randomUUID(), type };
|
|
149
|
+
const cell: Types.Mutable<Notebook.Cell> = { id: crypto.randomUUID(), type };
|
|
143
150
|
switch (type) {
|
|
144
151
|
case 'markdown':
|
|
145
152
|
case 'script':
|
|
@@ -149,8 +156,8 @@ export const NotebookContainer = ({ notebook, env }: NotebookContainerProps) =>
|
|
|
149
156
|
}
|
|
150
157
|
|
|
151
158
|
case 'prompt': {
|
|
152
|
-
if (
|
|
153
|
-
const objects = await
|
|
159
|
+
if (db) {
|
|
160
|
+
const objects = await db.query(Query.select(Filter.type(Blueprint.Blueprint))).run();
|
|
154
161
|
const blueprints = objects
|
|
155
162
|
.filter((blueprint) => INCLUDE_BLUEPRINTS.includes(blueprint.key))
|
|
156
163
|
.map((blueprint) => Ref.make(blueprint));
|
|
@@ -161,9 +168,11 @@ export const NotebookContainer = ({ notebook, env }: NotebookContainerProps) =>
|
|
|
161
168
|
}
|
|
162
169
|
|
|
163
170
|
const idx = after ? notebook.cells.findIndex((cell) => cell.id === after) : notebook.cells.length;
|
|
164
|
-
|
|
171
|
+
Obj.change(notebook, (n) => {
|
|
172
|
+
n.cells.splice(idx, 0, cell);
|
|
173
|
+
});
|
|
165
174
|
},
|
|
166
|
-
[
|
|
175
|
+
[db, notebook],
|
|
167
176
|
);
|
|
168
177
|
|
|
169
178
|
const handleCellDelete = useCallback<NonNullable<NotebookStackProps['onCellDelete']>>(
|
|
@@ -171,14 +180,16 @@ export const NotebookContainer = ({ notebook, env }: NotebookContainerProps) =>
|
|
|
171
180
|
invariant(notebook);
|
|
172
181
|
const idx = notebook.cells.findIndex((cell) => cell.id === id);
|
|
173
182
|
if (idx !== -1) {
|
|
174
|
-
|
|
183
|
+
Obj.change(notebook, (n) => {
|
|
184
|
+
n.cells.splice(idx, 1);
|
|
185
|
+
});
|
|
175
186
|
}
|
|
176
187
|
},
|
|
177
188
|
[notebook],
|
|
178
189
|
);
|
|
179
190
|
|
|
180
191
|
return (
|
|
181
|
-
<
|
|
192
|
+
<Layout.Main role={role} toolbar>
|
|
182
193
|
<Toolbar.Root disabled={!hasAttention} textBlockWidth>
|
|
183
194
|
<DropdownMenu.Root>
|
|
184
195
|
<DropdownMenu.Trigger asChild>
|
|
@@ -197,7 +208,7 @@ export const NotebookContainer = ({ notebook, env }: NotebookContainerProps) =>
|
|
|
197
208
|
<div role='none' className='flex bs-full overflow-hidden -mis-[1px] -mie-[1px]'>
|
|
198
209
|
<NotebookStack
|
|
199
210
|
classNames='container-max-width border-l border-r border-subduedSeparator'
|
|
200
|
-
|
|
211
|
+
db={db}
|
|
201
212
|
notebook={notebook}
|
|
202
213
|
graph={graph}
|
|
203
214
|
env={env}
|
|
@@ -207,7 +218,7 @@ export const NotebookContainer = ({ notebook, env }: NotebookContainerProps) =>
|
|
|
207
218
|
onCellDelete={handleCellDelete}
|
|
208
219
|
/>
|
|
209
220
|
</div>
|
|
210
|
-
</
|
|
221
|
+
</Layout.Main>
|
|
211
222
|
);
|
|
212
223
|
};
|
|
213
224
|
|
|
@@ -227,7 +238,7 @@ const runPrompt = Effect.fn(function* ({
|
|
|
227
238
|
prompt,
|
|
228
239
|
input,
|
|
229
240
|
};
|
|
230
|
-
const tracer = yield*
|
|
241
|
+
const tracer = yield* TracingService;
|
|
231
242
|
const trace = yield* tracer.traceInvocationStart({
|
|
232
243
|
target: undefined,
|
|
233
244
|
payload: {
|
|
@@ -237,7 +248,7 @@ const runPrompt = Effect.fn(function* ({
|
|
|
237
248
|
|
|
238
249
|
// Invoke the function.
|
|
239
250
|
const result = yield* FunctionInvocationService.invokeFunction(Agent.prompt, inputData).pipe(
|
|
240
|
-
Effect.provide(
|
|
251
|
+
Effect.provide(trace.invocationTraceQueue ? TracingService.layerInvocation(trace) : TracingService.layerNoop),
|
|
241
252
|
Effect.exit,
|
|
242
253
|
);
|
|
243
254
|
|
|
@@ -4,24 +4,23 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useCallback, useMemo } from 'react';
|
|
6
6
|
|
|
7
|
-
import { Surface } from '@dxos/app-framework/
|
|
7
|
+
import { Surface } from '@dxos/app-framework/ui';
|
|
8
|
+
import { type Database, Obj } from '@dxos/echo';
|
|
8
9
|
import { createDocAccessor } from '@dxos/echo-db';
|
|
9
10
|
import { invariant } from '@dxos/invariant';
|
|
10
11
|
import { TemplateEditor } from '@dxos/plugin-assistant';
|
|
11
|
-
import { type Space } from '@dxos/react-client/echo';
|
|
12
12
|
import { useThemeContext, useTranslation } from '@dxos/react-ui';
|
|
13
13
|
import { QueryEditor, type QueryEditorProps } from '@dxos/react-ui-components';
|
|
14
|
+
import { EditorContent, type EditorContentProps } from '@dxos/react-ui-editor';
|
|
14
15
|
import {
|
|
15
16
|
type BasicExtensionsOptions,
|
|
16
|
-
EditorContent,
|
|
17
|
-
type EditorContentProps,
|
|
18
17
|
createBasicExtensions,
|
|
19
18
|
createDataExtensions,
|
|
20
19
|
createMarkdownExtensions,
|
|
21
20
|
createThemeExtensions,
|
|
22
21
|
decorateMarkdown,
|
|
23
|
-
} from '@dxos/
|
|
24
|
-
import { mx } from '@dxos/
|
|
22
|
+
} from '@dxos/ui-editor';
|
|
23
|
+
import { mx } from '@dxos/ui-theme';
|
|
25
24
|
import { isNonNullable } from '@dxos/util';
|
|
26
25
|
|
|
27
26
|
import { meta } from '../../meta';
|
|
@@ -35,7 +34,7 @@ const editorStyles = 'p-2 pis-3';
|
|
|
35
34
|
const valueStyles = 'p-1 pis-3';
|
|
36
35
|
|
|
37
36
|
export type NotebookCellProps = {
|
|
38
|
-
|
|
37
|
+
db?: Database.Database;
|
|
39
38
|
graph?: ComputeGraph;
|
|
40
39
|
dragging?: boolean;
|
|
41
40
|
cell: Notebook.Cell;
|
|
@@ -43,7 +42,7 @@ export type NotebookCellProps = {
|
|
|
43
42
|
} & (Pick<NotebookMenuProps, 'onCellInsert' | 'onCellDelete'> & Pick<TypescriptEditorProps, 'env'>);
|
|
44
43
|
|
|
45
44
|
// TODO(burdon): Show evaluation errors.
|
|
46
|
-
export const NotebookCell = ({
|
|
45
|
+
export const NotebookCell = ({ db, graph, dragging, cell, promptResults, env }: NotebookCellProps) => {
|
|
47
46
|
const { t } = useTranslation(meta.id);
|
|
48
47
|
|
|
49
48
|
const extensions = useMemo(() => {
|
|
@@ -62,7 +61,9 @@ export const NotebookCell = ({ space, graph, dragging, cell, promptResults, env
|
|
|
62
61
|
const handleQueryChange = useCallback<NonNullable<QueryEditorProps['onChange']>>(
|
|
63
62
|
(value: string) => {
|
|
64
63
|
invariant(cell.source?.target);
|
|
65
|
-
cell.source.target
|
|
64
|
+
Obj.change(cell.source.target, (s) => {
|
|
65
|
+
s.content = value;
|
|
66
|
+
});
|
|
66
67
|
},
|
|
67
68
|
[cell],
|
|
68
69
|
);
|
|
@@ -119,11 +120,11 @@ export const NotebookCell = ({ space, graph, dragging, cell, promptResults, env
|
|
|
119
120
|
<QueryEditor
|
|
120
121
|
id={cell.id}
|
|
121
122
|
classNames={[editorStyles, 'border-be border-subduedSeparator']}
|
|
122
|
-
db={
|
|
123
|
+
db={db}
|
|
123
124
|
value={cell.source.target.content}
|
|
124
125
|
onChange={handleQueryChange}
|
|
125
126
|
/>
|
|
126
|
-
{explorerGraph && !dragging && <Surface role='section' limit={1} data={{ subject: explorerGraph }} />}
|
|
127
|
+
{explorerGraph && !dragging && <Surface.Surface role='section' limit={1} data={{ subject: explorerGraph }} />}
|
|
127
128
|
</div>
|
|
128
129
|
);
|
|
129
130
|
|
|
@@ -151,7 +152,7 @@ export const NotebookCell = ({ space, graph, dragging, cell, promptResults, env
|
|
|
151
152
|
};
|
|
152
153
|
|
|
153
154
|
const NotebookCellValue = ({ cell, graph }: NotebookCellProps) => {
|
|
154
|
-
const name = graph?.
|
|
155
|
+
const name = graph?.getExpressions()[cell.id]?.name;
|
|
155
156
|
const value = graph?.getValue(cell.id);
|
|
156
157
|
if (value == null) {
|
|
157
158
|
return null;
|
|
@@ -160,7 +161,7 @@ const NotebookCellValue = ({ cell, graph }: NotebookCellProps) => {
|
|
|
160
161
|
return (
|
|
161
162
|
<div
|
|
162
163
|
className={mx(
|
|
163
|
-
'flex is-full bg-groupSurface border-
|
|
164
|
+
'flex is-full bg-groupSurface border-bs border-subduedSeparator text-description font-mono',
|
|
164
165
|
valueStyles,
|
|
165
166
|
)}
|
|
166
167
|
>
|
|
@@ -186,14 +187,14 @@ const NotebookPromptResult = ({ cell, promptResults }: NotebookCellProps) => {
|
|
|
186
187
|
}
|
|
187
188
|
|
|
188
189
|
return (
|
|
189
|
-
<div className={mx('flex is-full bg-groupSurface text-description border-
|
|
190
|
+
<div className={mx('flex is-full bg-groupSurface text-description border-bs border-subduedSeparator', valueStyles)}>
|
|
190
191
|
<NotebookTextEditor readOnly value={value} />
|
|
191
192
|
</div>
|
|
192
193
|
);
|
|
193
194
|
};
|
|
194
195
|
|
|
195
196
|
const NotebookTextEditor = ({
|
|
196
|
-
extensions:
|
|
197
|
+
extensions: extensionsProp,
|
|
197
198
|
readOnly,
|
|
198
199
|
...props
|
|
199
200
|
}: EditorContentProps & Pick<BasicExtensionsOptions, 'readOnly'>) => {
|
|
@@ -208,9 +209,9 @@ const NotebookTextEditor = ({
|
|
|
208
209
|
createThemeExtensions({ themeMode, syntaxHighlighting: true }),
|
|
209
210
|
createMarkdownExtensions(),
|
|
210
211
|
decorateMarkdown(),
|
|
211
|
-
|
|
212
|
+
extensionsProp,
|
|
212
213
|
].filter(isNonNullable);
|
|
213
|
-
}, [
|
|
214
|
+
}, [extensionsProp]);
|
|
214
215
|
|
|
215
216
|
return <EditorContent {...props} extensions={extensions} selectionEnd />;
|
|
216
217
|
};
|