@dxos/plugin-script 0.8.4-main.c1de068 → 0.8.4-main.c351d160a8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -13
- package/dist/lib/browser/DeploymentDialog-SSJP2BBZ.mjs +138 -0
- package/dist/lib/browser/DeploymentDialog-SSJP2BBZ.mjs.map +7 -0
- package/dist/lib/browser/NotebookContainer-Q6Z2CPH6.mjs +848 -0
- package/dist/lib/browser/NotebookContainer-Q6Z2CPH6.mjs.map +7 -0
- package/dist/lib/browser/ScriptContainer-IKITE6OA.mjs +93 -0
- package/dist/lib/browser/ScriptContainer-IKITE6OA.mjs.map +7 -0
- package/dist/lib/browser/ScriptObjectSettings-X4WV5TBD.mjs +294 -0
- package/dist/lib/browser/ScriptObjectSettings-X4WV5TBD.mjs.map +7 -0
- package/dist/lib/browser/ScriptPluginSettings-5WUKIWCC.mjs +55 -0
- package/dist/lib/browser/ScriptPluginSettings-5WUKIWCC.mjs.map +7 -0
- package/dist/lib/browser/ScriptProperties-5YERQAL2.mjs +28 -0
- package/dist/lib/browser/ScriptProperties-5YERQAL2.mjs.map +7 -0
- package/dist/lib/browser/TestContainer-ZI2PQRXB.mjs +39 -0
- package/dist/lib/browser/TestContainer-ZI2PQRXB.mjs.map +7 -0
- package/dist/lib/browser/app-graph-builder-QPXX4YK5.mjs +63 -0
- package/dist/lib/browser/app-graph-builder-QPXX4YK5.mjs.map +7 -0
- package/dist/lib/browser/blueprint-definition-2UX353LT.mjs +17 -0
- package/dist/lib/browser/blueprint-definition-2UX353LT.mjs.map +7 -0
- package/dist/lib/browser/blueprints/index.mjs +8 -0
- package/dist/lib/browser/{chunk-QYAREHGH.mjs → chunk-37XPSUAH.mjs} +9 -6
- package/dist/lib/browser/chunk-37XPSUAH.mjs.map +7 -0
- package/dist/lib/browser/chunk-7JL6WNT6.mjs +397 -0
- package/dist/lib/browser/chunk-7JL6WNT6.mjs.map +7 -0
- package/dist/lib/browser/chunk-7SXHORK4.mjs +105 -0
- package/dist/lib/browser/chunk-7SXHORK4.mjs.map +7 -0
- package/dist/lib/browser/{compiler-CXCUA4UQ.mjs → chunk-ATTZUDT7.mjs} +17 -32
- package/dist/lib/browser/chunk-ATTZUDT7.mjs.map +7 -0
- package/dist/lib/browser/chunk-G3XIOLLI.mjs +174 -0
- package/dist/lib/browser/chunk-G3XIOLLI.mjs.map +7 -0
- package/dist/lib/browser/chunk-IHEZBW44.mjs +789 -0
- package/dist/lib/browser/chunk-IHEZBW44.mjs.map +7 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/browser/chunk-KIYJ6XPN.mjs +20 -0
- package/dist/lib/browser/chunk-KIYJ6XPN.mjs.map +7 -0
- package/dist/lib/browser/chunk-MYSQ4VH5.mjs +29 -0
- package/dist/lib/browser/chunk-MYSQ4VH5.mjs.map +7 -0
- package/dist/lib/browser/chunk-OWMMXCIP.mjs +116 -0
- package/dist/lib/browser/chunk-OWMMXCIP.mjs.map +7 -0
- package/dist/lib/browser/chunk-X44CJ7F5.mjs +11 -0
- package/dist/lib/browser/chunk-X44CJ7F5.mjs.map +7 -0
- package/dist/lib/browser/compiler-ZVLONXEG.mjs +99 -0
- package/dist/lib/browser/compiler-ZVLONXEG.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +150 -108
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/operation-resolver-YYHZGLYR.mjs +79 -0
- package/dist/lib/browser/operation-resolver-YYHZGLYR.mjs.map +7 -0
- package/dist/lib/browser/react-surface-SZ7BHELP.mjs +142 -0
- package/dist/lib/browser/react-surface-SZ7BHELP.mjs.map +7 -0
- package/dist/lib/browser/settings-XGV2T3PC.mjs +36 -0
- package/dist/lib/browser/settings-XGV2T3PC.mjs.map +7 -0
- package/dist/lib/browser/templates/index.mjs +2 -1
- package/dist/lib/browser/types/index.mjs +14 -6
- package/dist/lib/node-esm/DeploymentDialog-V3HYTNFB.mjs +139 -0
- package/dist/lib/node-esm/DeploymentDialog-V3HYTNFB.mjs.map +7 -0
- package/dist/lib/node-esm/NotebookContainer-MDHOETIH.mjs +849 -0
- package/dist/lib/node-esm/NotebookContainer-MDHOETIH.mjs.map +7 -0
- package/dist/lib/node-esm/ScriptContainer-4E4EK6ZF.mjs +94 -0
- package/dist/lib/node-esm/ScriptContainer-4E4EK6ZF.mjs.map +7 -0
- package/dist/lib/node-esm/ScriptObjectSettings-RPY2ZLDJ.mjs +295 -0
- package/dist/lib/node-esm/ScriptObjectSettings-RPY2ZLDJ.mjs.map +7 -0
- package/dist/lib/node-esm/ScriptPluginSettings-H4ESISSG.mjs +56 -0
- package/dist/lib/node-esm/ScriptPluginSettings-H4ESISSG.mjs.map +7 -0
- package/dist/lib/node-esm/ScriptProperties-NNDYQTOW.mjs +29 -0
- package/dist/lib/node-esm/ScriptProperties-NNDYQTOW.mjs.map +7 -0
- package/dist/lib/node-esm/TestContainer-G2TVP2KS.mjs +40 -0
- package/dist/lib/node-esm/TestContainer-G2TVP2KS.mjs.map +7 -0
- package/dist/lib/node-esm/app-graph-builder-GNGOYXIU.mjs +64 -0
- package/dist/lib/node-esm/app-graph-builder-GNGOYXIU.mjs.map +7 -0
- package/dist/lib/node-esm/blueprint-definition-4UDBPYRQ.mjs +18 -0
- package/dist/lib/node-esm/blueprint-definition-4UDBPYRQ.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-3EV4C6GW.mjs +107 -0
- package/dist/lib/node-esm/chunk-3EV4C6GW.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-4YAEFFW2.mjs +12 -0
- package/dist/lib/node-esm/chunk-4YAEFFW2.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-5BG7OJGQ.mjs +176 -0
- package/dist/lib/node-esm/chunk-5BG7OJGQ.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-BOPXK25O.mjs +790 -0
- package/dist/lib/node-esm/chunk-BOPXK25O.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-DMELV4YV.mjs +22 -0
- package/dist/lib/node-esm/chunk-DMELV4YV.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-DQMM7ZL5.mjs +31 -0
- package/dist/lib/node-esm/chunk-DQMM7ZL5.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-EV57E4Q4.mjs +117 -0
- package/dist/lib/node-esm/chunk-EV57E4Q4.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/{compiler-EPFKQXPE.mjs → chunk-JGN7TDJH.mjs} +17 -31
- package/dist/lib/node-esm/chunk-JGN7TDJH.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-KL6LGVVM.mjs +398 -0
- package/dist/lib/node-esm/chunk-KL6LGVVM.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-AHXJ6NQU.mjs → chunk-L3JLWXB5.mjs} +9 -6
- package/dist/lib/node-esm/chunk-L3JLWXB5.mjs.map +7 -0
- package/dist/lib/node-esm/compiler-INUOAXU7.mjs +100 -0
- package/dist/lib/node-esm/compiler-INUOAXU7.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +150 -108
- 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-OTHAYHTN.mjs +80 -0
- package/dist/lib/node-esm/operation-resolver-OTHAYHTN.mjs.map +7 -0
- package/dist/lib/node-esm/react-surface-DLEXFWGV.mjs +143 -0
- package/dist/lib/node-esm/react-surface-DLEXFWGV.mjs.map +7 -0
- package/dist/lib/node-esm/settings-JZUMGPNG.mjs +37 -0
- package/dist/lib/node-esm/settings-JZUMGPNG.mjs.map +7 -0
- package/dist/lib/node-esm/templates/index.mjs +2 -1
- package/dist/lib/node-esm/types/index.mjs +14 -6
- package/dist/types/src/ScriptPlugin.d.ts +2 -1
- package/dist/types/src/ScriptPlugin.d.ts.map +1 -1
- package/dist/types/src/blueprints/index.d.ts +2 -0
- package/dist/types/src/blueprints/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/script-blueprint.d.ts +4 -0
- package/dist/types/src/blueprints/script-blueprint.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +6 -0
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts +3 -0
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/artifact-definition/artifact-definition.d.ts +12 -0
- package/dist/types/src/capabilities/artifact-definition/artifact-definition.d.ts.map +1 -0
- package/dist/types/src/capabilities/artifact-definition/index.d.ts +3 -0
- package/dist/types/src/capabilities/artifact-definition/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts +6 -0
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts.map +1 -0
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts +3 -0
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/compiler/compiler.d.ts +6 -0
- package/dist/types/src/capabilities/compiler/compiler.d.ts.map +1 -0
- package/dist/types/src/capabilities/compiler/index.d.ts +3 -0
- package/dist/types/src/capabilities/compiler/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +6 -7
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-resolver/index.d.ts +3 -0
- package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +5 -0
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts +3 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +5 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/settings/index.d.ts +7 -0
- package/dist/types/src/capabilities/settings/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/settings/settings.d.ts +10 -0
- package/dist/types/src/capabilities/settings/settings.d.ts.map +1 -0
- package/dist/types/src/compiler/compiler.d.ts +1 -1
- package/dist/types/src/compiler/compiler.d.ts.map +1 -1
- package/dist/types/src/components/FramePanel/FramePanel.d.ts +12 -0
- package/dist/types/src/components/FramePanel/FramePanel.d.ts.map +1 -0
- package/dist/types/src/components/FramePanel/index.d.ts +2 -0
- package/dist/types/src/components/FramePanel/index.d.ts.map +1 -0
- package/dist/types/src/components/NotebookStack/NotebookCell.d.ts +15 -0
- package/dist/types/src/components/NotebookStack/NotebookCell.d.ts.map +1 -0
- package/dist/types/src/components/NotebookStack/NotebookMenu.d.ts +9 -0
- package/dist/types/src/components/NotebookStack/NotebookMenu.d.ts.map +1 -0
- package/dist/types/src/components/NotebookStack/NotebookStack.d.ts +14 -0
- package/dist/types/src/components/NotebookStack/NotebookStack.d.ts.map +1 -0
- package/dist/types/src/components/NotebookStack/NotebookStack.stories.d.ts +252 -0
- package/dist/types/src/components/NotebookStack/NotebookStack.stories.d.ts.map +1 -0
- package/dist/types/src/components/NotebookStack/index.d.ts +3 -0
- package/dist/types/src/components/NotebookStack/index.d.ts.map +1 -0
- package/dist/types/src/components/QueryEditor/QueryEditor.d.ts +5 -0
- package/dist/types/src/components/QueryEditor/QueryEditor.d.ts.map +1 -0
- package/dist/types/src/components/QueryEditor/QueryEditor.stories.d.ts +13 -0
- package/dist/types/src/components/QueryEditor/QueryEditor.stories.d.ts.map +1 -0
- package/dist/types/src/components/QueryEditor/index.d.ts +2 -0
- package/dist/types/src/components/QueryEditor/index.d.ts.map +1 -0
- package/dist/types/src/components/ScriptToolbar/ScriptToolbar.d.ts +8 -8
- package/dist/types/src/components/ScriptToolbar/ScriptToolbar.d.ts.map +1 -1
- package/dist/types/src/components/ScriptToolbar/ScriptToolbar.stories.d.ts +249 -10
- package/dist/types/src/components/ScriptToolbar/ScriptToolbar.stories.d.ts.map +1 -1
- package/dist/types/src/components/TestPanel/TestPanel.d.ts.map +1 -1
- package/dist/types/src/components/TestPanel/index.d.ts +0 -1
- package/dist/types/src/components/TestPanel/index.d.ts.map +1 -1
- package/dist/types/src/components/TypescriptEditor/TypescriptEditor.d.ts +5 -2
- package/dist/types/src/components/TypescriptEditor/TypescriptEditor.d.ts.map +1 -1
- package/dist/types/src/components/TypescriptEditor/TypescriptEditor.stories.d.ts +11 -4
- package/dist/types/src/components/TypescriptEditor/TypescriptEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +5 -7
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/constants.d.ts +2 -0
- package/dist/types/src/constants.d.ts.map +1 -0
- package/dist/types/src/containers/DeploymentDialog/DeploymentDialog.d.ts +9 -0
- package/dist/types/src/containers/DeploymentDialog/DeploymentDialog.d.ts.map +1 -0
- package/dist/types/src/containers/DeploymentDialog/DeploymentDialog.stories.d.ts +252 -0
- package/dist/types/src/containers/DeploymentDialog/DeploymentDialog.stories.d.ts.map +1 -0
- package/dist/types/src/containers/DeploymentDialog/index.d.ts +3 -0
- package/dist/types/src/containers/DeploymentDialog/index.d.ts.map +1 -0
- package/dist/types/src/containers/NotebookContainer/NotebookContainer.d.ts +7 -0
- package/dist/types/src/containers/NotebookContainer/NotebookContainer.d.ts.map +1 -0
- package/dist/types/src/containers/NotebookContainer/NotebookContainer.stories.d.ts +7 -0
- package/dist/types/src/containers/NotebookContainer/NotebookContainer.stories.d.ts.map +1 -0
- package/dist/types/src/containers/NotebookContainer/index.d.ts +3 -0
- package/dist/types/src/containers/NotebookContainer/index.d.ts.map +1 -0
- package/dist/types/src/containers/ScriptContainer/ScriptContainer.d.ts +10 -0
- package/dist/types/src/containers/ScriptContainer/ScriptContainer.d.ts.map +1 -0
- package/dist/types/src/containers/ScriptContainer/index.d.ts +3 -0
- package/dist/types/src/containers/ScriptContainer/index.d.ts.map +1 -0
- package/dist/types/src/containers/ScriptObjectSettings/ScriptObjectSettings.d.ts +7 -0
- package/dist/types/src/containers/ScriptObjectSettings/ScriptObjectSettings.d.ts.map +1 -0
- package/dist/types/src/containers/ScriptObjectSettings/index.d.ts +3 -0
- package/dist/types/src/containers/ScriptObjectSettings/index.d.ts.map +1 -0
- package/dist/types/src/containers/ScriptPluginSettings/ScriptPluginSettings.d.ts +8 -0
- package/dist/types/src/containers/ScriptPluginSettings/ScriptPluginSettings.d.ts.map +1 -0
- package/dist/types/src/containers/ScriptPluginSettings/index.d.ts +3 -0
- package/dist/types/src/containers/ScriptPluginSettings/index.d.ts.map +1 -0
- package/dist/types/src/containers/ScriptProperties/ScriptProperties.d.ts +7 -0
- package/dist/types/src/containers/ScriptProperties/ScriptProperties.d.ts.map +1 -0
- package/dist/types/src/containers/ScriptProperties/index.d.ts +3 -0
- package/dist/types/src/containers/ScriptProperties/index.d.ts.map +1 -0
- package/dist/types/src/containers/TestContainer/TestContainer.d.ts +8 -0
- package/dist/types/src/containers/TestContainer/TestContainer.d.ts.map +1 -0
- package/dist/types/src/containers/TestContainer/index.d.ts +3 -0
- package/dist/types/src/containers/TestContainer/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +9 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/e2e/ai.test.d.ts +2 -0
- package/dist/types/src/e2e/ai.test.d.ts.map +1 -0
- package/dist/types/src/e2e/deploy.test.d.ts +2 -0
- package/dist/types/src/e2e/deploy.test.d.ts.map +1 -0
- package/dist/types/src/hooks/deploy.d.ts +20 -33
- package/dist/types/src/hooks/deploy.d.ts.map +1 -1
- package/dist/types/src/hooks/format.d.ts +5 -4
- package/dist/types/src/hooks/format.d.ts.map +1 -1
- package/dist/types/src/hooks/index.d.ts +1 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/template.d.ts +7 -16
- package/dist/types/src/hooks/template.d.ts.map +1 -1
- package/dist/types/src/hooks/useCompiler.d.ts +7 -0
- package/dist/types/src/hooks/useCompiler.d.ts.map +1 -0
- package/dist/types/src/hooks/useCreateAndDeployScriptTemplates.d.ts.map +1 -1
- package/dist/types/src/hooks/useToolbarState.d.ts +8 -1
- package/dist/types/src/hooks/useToolbarState.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +3 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -3
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/notebook/compute-graph.d.ts +58 -0
- package/dist/types/src/notebook/compute-graph.d.ts.map +1 -0
- package/dist/types/src/notebook/compute-graph.test.d.ts +2 -0
- package/dist/types/src/notebook/compute-graph.test.d.ts.map +1 -0
- package/dist/types/src/notebook/eval.d.ts +13 -0
- package/dist/types/src/notebook/eval.d.ts.map +1 -0
- package/dist/types/src/notebook/index.d.ts +2 -0
- package/dist/types/src/notebook/index.d.ts.map +1 -0
- package/dist/types/src/notebook/vfs-parser.d.ts +74 -0
- package/dist/types/src/notebook/vfs-parser.d.ts.map +1 -0
- package/dist/types/src/notebook/vfs-parser.test.d.ts +2 -0
- package/dist/types/src/notebook/vfs-parser.test.d.ts.map +1 -0
- package/dist/types/src/templates/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/data-generator.d.ts.map +1 -1
- package/dist/types/src/templates/discord.d.ts.map +1 -1
- package/dist/types/src/templates/forex-effect.d.ts +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/gmail.d.ts.map +1 -1
- package/dist/types/src/templates/index.d.ts +52 -1
- package/dist/types/src/templates/index.d.ts.map +1 -1
- package/dist/types/src/templates/ping.d.ts +3 -0
- package/dist/types/src/templates/ping.d.ts.map +1 -0
- package/dist/types/src/testing/data.d.ts +3 -0
- package/dist/types/src/testing/data.d.ts.map +1 -0
- package/dist/types/src/testing/index.d.ts +2 -0
- package/dist/types/src/testing/index.d.ts.map +1 -0
- package/dist/types/src/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 +34 -5
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Notebook.d.ts +108 -0
- package/dist/types/src/types/Notebook.d.ts.map +1 -0
- package/dist/types/src/types/actions.d.ts +40 -0
- package/dist/types/src/types/actions.d.ts.map +1 -0
- 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 +5 -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 +7 -7
- package/dist/types/src/util/deploy.d.ts.map +1 -1
- package/dist/types/src/util/functions.d.ts +6 -3
- package/dist/types/src/util/functions.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +124 -85
- package/src/ScriptPlugin.tsx +57 -77
- package/src/blueprints/index.ts +5 -0
- package/src/blueprints/script-blueprint.ts +31 -0
- package/src/capabilities/app-graph-builder/app-graph-builder.ts +56 -0
- package/src/capabilities/app-graph-builder/index.ts +7 -0
- package/src/capabilities/{artifact-definition.ts → artifact-definition/artifact-definition.ts} +103 -105
- package/src/capabilities/artifact-definition/index.ts +7 -0
- package/src/capabilities/blueprint-definition/blueprint-definition.ts +17 -0
- package/src/capabilities/blueprint-definition/index.ts +7 -0
- package/src/capabilities/compiler/compiler.ts +103 -0
- package/src/capabilities/compiler/index.ts +7 -0
- package/src/capabilities/index.ts +6 -10
- package/src/capabilities/operation-resolver/index.ts +7 -0
- package/src/capabilities/operation-resolver/operation-resolver.ts +75 -0
- package/src/capabilities/react-surface/index.ts +7 -0
- package/src/capabilities/react-surface/react-surface.tsx +129 -0
- package/src/capabilities/settings/index.ts +7 -0
- package/src/capabilities/settings/settings.ts +33 -0
- package/src/compiler/compiler.ts +11 -4
- package/src/components/{FrameContainer/FrameContainer.tsx → FramePanel/FramePanel.tsx} +10 -8
- package/src/components/{FrameContainer → FramePanel}/index.ts +1 -1
- package/src/components/NotebookStack/NotebookCell.tsx +215 -0
- package/src/components/NotebookStack/NotebookMenu.tsx +47 -0
- package/src/components/NotebookStack/NotebookStack.stories.tsx +54 -0
- package/src/components/NotebookStack/NotebookStack.tsx +86 -0
- package/src/components/NotebookStack/index.ts +6 -0
- package/src/components/QueryEditor/QueryEditor.stories.tsx +96 -0
- package/src/components/QueryEditor/QueryEditor.tsx +47 -0
- package/src/components/QueryEditor/index.ts +5 -0
- package/src/components/ScriptToolbar/ScriptToolbar.stories.tsx +56 -17
- package/src/components/ScriptToolbar/ScriptToolbar.tsx +38 -34
- package/src/components/TestPanel/TestPanel.tsx +67 -42
- package/src/components/TestPanel/index.ts +0 -1
- package/src/components/TypescriptEditor/TypescriptEditor.stories.tsx +89 -34
- package/src/components/TypescriptEditor/TypescriptEditor.tsx +84 -81
- package/src/components/index.ts +5 -7
- package/src/constants.ts +7 -0
- package/src/containers/DeploymentDialog/DeploymentDialog.stories.tsx +61 -0
- package/src/containers/DeploymentDialog/DeploymentDialog.tsx +99 -0
- package/src/containers/DeploymentDialog/index.ts +7 -0
- package/src/containers/NotebookContainer/NotebookContainer.stories.tsx +87 -0
- package/src/containers/NotebookContainer/NotebookContainer.tsx +267 -0
- package/src/containers/NotebookContainer/index.ts +7 -0
- package/src/containers/ScriptContainer/ScriptContainer.tsx +84 -0
- package/src/containers/ScriptContainer/index.ts +7 -0
- package/src/containers/ScriptObjectSettings/ScriptObjectSettings.tsx +291 -0
- package/src/containers/ScriptObjectSettings/index.ts +7 -0
- package/src/containers/ScriptPluginSettings/ScriptPluginSettings.tsx +66 -0
- package/src/containers/ScriptPluginSettings/index.ts +7 -0
- package/src/containers/ScriptProperties/ScriptProperties.tsx +33 -0
- package/src/containers/ScriptProperties/index.ts +7 -0
- package/src/containers/TestContainer/TestContainer.tsx +28 -0
- package/src/containers/TestContainer/index.ts +7 -0
- package/src/containers/index.ts +13 -0
- package/src/e2e/ai.test.ts +92 -0
- package/src/e2e/deploy.test.ts +64 -0
- package/src/hooks/deploy.ts +52 -45
- package/src/hooks/format.ts +10 -5
- package/src/hooks/index.ts +1 -0
- package/src/hooks/template.ts +22 -25
- package/src/hooks/useCompiler.ts +24 -0
- package/src/hooks/useCreateAndDeployScriptTemplates.ts +15 -16
- package/src/hooks/useToolbarState.ts +29 -4
- package/src/index.ts +3 -1
- package/src/meta.ts +10 -8
- package/src/notebook/compute-graph.test.ts +82 -0
- package/src/notebook/compute-graph.ts +230 -0
- package/src/notebook/eval.ts +105 -0
- package/src/notebook/index.ts +5 -0
- package/src/notebook/vfs-parser.test.ts +149 -0
- package/src/notebook/vfs-parser.ts +451 -0
- package/src/templates/anthropic.ts +42 -0
- package/src/templates/chat.ts +1 -1
- package/src/templates/chess-bot.ts +58 -0
- package/src/templates/commentary.ts +231 -0
- package/src/templates/data-generator.ts +10 -4
- package/src/templates/discord.ts +14 -6
- package/src/templates/forex-effect.ts +24 -25
- package/src/templates/forex.ts +9 -6
- package/src/templates/gmail.ts +37 -67
- package/src/templates/index.ts +36 -23
- package/src/templates/ping.ts +17 -0
- package/src/testing/data.ts +72 -0
- package/src/testing/index.ts +5 -0
- package/src/testing/simulator.test.ts +40 -0
- package/src/translations.ts +37 -7
- package/src/types/Notebook.ts +45 -0
- package/src/types/actions.ts +45 -0
- package/src/types/capabilities.ts +17 -0
- package/src/types/events.ts +11 -0
- package/src/types/index.ts +5 -1
- package/src/types/types.ts +15 -0
- package/src/util/deploy.ts +38 -61
- package/src/util/functions.ts +58 -25
- package/src/vite-env.d.ts +2 -0
- package/dist/lib/browser/DeploymentDialog-M4QIHTDR.mjs +0 -12
- package/dist/lib/browser/ScriptContainer-Z6SIGRRC.mjs +0 -262
- package/dist/lib/browser/ScriptContainer-Z6SIGRRC.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-HLQ7K3BT.mjs +0 -64
- package/dist/lib/browser/app-graph-builder-HLQ7K3BT.mjs.map +0 -7
- package/dist/lib/browser/artifact-definition-24Q3IHOU.mjs +0 -249
- package/dist/lib/browser/artifact-definition-24Q3IHOU.mjs.map +0 -7
- package/dist/lib/browser/chunk-3U6DTUH3.mjs +0 -283
- package/dist/lib/browser/chunk-3U6DTUH3.mjs.map +0 -7
- package/dist/lib/browser/chunk-5TVBECWH.mjs +0 -15
- package/dist/lib/browser/chunk-5TVBECWH.mjs.map +0 -7
- package/dist/lib/browser/chunk-FIM2MVNJ.mjs +0 -555
- package/dist/lib/browser/chunk-FIM2MVNJ.mjs.map +0 -7
- package/dist/lib/browser/chunk-FMDXKOP7.mjs +0 -233
- package/dist/lib/browser/chunk-FMDXKOP7.mjs.map +0 -7
- package/dist/lib/browser/chunk-IS4OG2UW.mjs +0 -39
- package/dist/lib/browser/chunk-IS4OG2UW.mjs.map +0 -7
- package/dist/lib/browser/chunk-P4HQKUCP.mjs +0 -153
- package/dist/lib/browser/chunk-P4HQKUCP.mjs.map +0 -7
- package/dist/lib/browser/chunk-QYAREHGH.mjs.map +0 -7
- package/dist/lib/browser/chunk-R4R7VOFY.mjs +0 -88
- package/dist/lib/browser/chunk-R4R7VOFY.mjs.map +0 -7
- package/dist/lib/browser/compiler-CXCUA4UQ.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-7B77IG3N.mjs +0 -91
- package/dist/lib/browser/intent-resolver-7B77IG3N.mjs.map +0 -7
- package/dist/lib/browser/react-surface-FYYXZA7C.mjs +0 -104
- package/dist/lib/browser/react-surface-FYYXZA7C.mjs.map +0 -7
- package/dist/lib/browser/settings-KCTBK5TY.mjs +0 -24
- package/dist/lib/browser/settings-KCTBK5TY.mjs.map +0 -7
- package/dist/lib/node-esm/DeploymentDialog-3KPRWFE7.mjs +0 -13
- package/dist/lib/node-esm/ScriptContainer-KPU75HHI.mjs +0 -263
- package/dist/lib/node-esm/ScriptContainer-KPU75HHI.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-7EYIHWH4.mjs +0 -65
- package/dist/lib/node-esm/app-graph-builder-7EYIHWH4.mjs.map +0 -7
- package/dist/lib/node-esm/artifact-definition-WAJFALUI.mjs +0 -250
- package/dist/lib/node-esm/artifact-definition-WAJFALUI.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-35M3CHYE.mjs +0 -16
- package/dist/lib/node-esm/chunk-35M3CHYE.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-7NMI4CEU.mjs +0 -556
- package/dist/lib/node-esm/chunk-7NMI4CEU.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-AHXJ6NQU.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-F5GFJ3PY.mjs +0 -90
- package/dist/lib/node-esm/chunk-F5GFJ3PY.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-JIPFLBYA.mjs +0 -40
- package/dist/lib/node-esm/chunk-JIPFLBYA.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-QKK3NDHW.mjs +0 -154
- package/dist/lib/node-esm/chunk-QKK3NDHW.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-RT43MACC.mjs +0 -284
- package/dist/lib/node-esm/chunk-RT43MACC.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-XJPK3IYI.mjs +0 -234
- package/dist/lib/node-esm/chunk-XJPK3IYI.mjs.map +0 -7
- package/dist/lib/node-esm/compiler-EPFKQXPE.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-FRZGS4TB.mjs +0 -92
- package/dist/lib/node-esm/intent-resolver-FRZGS4TB.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-V32NWHKN.mjs +0 -105
- package/dist/lib/node-esm/react-surface-V32NWHKN.mjs.map +0 -7
- package/dist/lib/node-esm/settings-DXZ334A3.mjs +0 -25
- package/dist/lib/node-esm/settings-DXZ334A3.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/capabilities.d.ts +0 -5
- package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
- package/dist/types/src/capabilities/compiler.d.ts +0 -4
- package/dist/types/src/capabilities/compiler.d.ts.map +0 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface.d.ts +0 -4
- package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
- package/dist/types/src/capabilities/settings.d.ts +0 -4
- package/dist/types/src/capabilities/settings.d.ts.map +0 -1
- package/dist/types/src/components/DeploymentDialog/DeploymentDialog.d.ts +0 -11
- package/dist/types/src/components/DeploymentDialog/DeploymentDialog.d.ts.map +0 -1
- package/dist/types/src/components/DeploymentDialog/DeploymentDialog.stories.d.ts +0 -18
- package/dist/types/src/components/DeploymentDialog/DeploymentDialog.stories.d.ts.map +0 -1
- package/dist/types/src/components/DeploymentDialog/index.d.ts +0 -4
- package/dist/types/src/components/DeploymentDialog/index.d.ts.map +0 -1
- package/dist/types/src/components/FrameContainer/FrameContainer.d.ts +0 -12
- package/dist/types/src/components/FrameContainer/FrameContainer.d.ts.map +0 -1
- package/dist/types/src/components/FrameContainer/frame.d.ts +0 -2
- package/dist/types/src/components/FrameContainer/frame.d.ts.map +0 -1
- package/dist/types/src/components/FrameContainer/index.d.ts +0 -2
- package/dist/types/src/components/FrameContainer/index.d.ts.map +0 -1
- package/dist/types/src/components/ScriptContainer.d.ts +0 -12
- package/dist/types/src/components/ScriptContainer.d.ts.map +0 -1
- package/dist/types/src/components/Settings/ScriptObjectSettings.d.ts +0 -8
- package/dist/types/src/components/Settings/ScriptObjectSettings.d.ts.map +0 -1
- package/dist/types/src/components/Settings/ScriptPluginSettings.d.ts +0 -6
- package/dist/types/src/components/Settings/ScriptPluginSettings.d.ts.map +0 -1
- package/dist/types/src/components/Settings/index.d.ts +0 -3
- package/dist/types/src/components/Settings/index.d.ts.map +0 -1
- package/dist/types/src/components/TestPanel/TestContainer.d.ts +0 -8
- package/dist/types/src/components/TestPanel/TestContainer.d.ts.map +0 -1
- package/dist/types/src/events.d.ts +0 -4
- package/dist/types/src/events.d.ts.map +0 -1
- package/dist/types/src/templates/chess.d.ts +0 -3
- package/dist/types/src/templates/chess.d.ts.map +0 -1
- package/dist/types/src/templates/echo.d.ts +0 -6
- package/dist/types/src/templates/echo.d.ts.map +0 -1
- package/dist/types/src/types/schema.d.ts +0 -38
- package/dist/types/src/types/schema.d.ts.map +0 -1
- package/src/capabilities/app-graph-builder.ts +0 -64
- package/src/capabilities/capabilities.ts +0 -12
- package/src/capabilities/compiler.ts +0 -33
- package/src/capabilities/intent-resolver.ts +0 -80
- package/src/capabilities/react-surface.tsx +0 -89
- package/src/capabilities/settings.ts +0 -21
- package/src/components/DeploymentDialog/DeploymentDialog.stories.tsx +0 -39
- package/src/components/DeploymentDialog/DeploymentDialog.tsx +0 -112
- package/src/components/DeploymentDialog/index.ts +0 -9
- package/src/components/FrameContainer/frame.html +0 -25
- package/src/components/FrameContainer/frame.tsx +0 -51
- package/src/components/ScriptContainer.tsx +0 -68
- package/src/components/Settings/ScriptObjectSettings.tsx +0 -206
- package/src/components/Settings/ScriptPluginSettings.tsx +0 -71
- package/src/components/Settings/index.ts +0 -6
- package/src/components/TestPanel/TestContainer.tsx +0 -26
- package/src/events.ts +0 -11
- package/src/templates/chess.ts +0 -47
- package/src/templates/echo.ts +0 -8
- package/src/types/schema.ts +0 -37
- /package/dist/lib/browser/{DeploymentDialog-M4QIHTDR.mjs.map → blueprints/index.mjs.map} +0 -0
- /package/dist/lib/{node-esm/DeploymentDialog-3KPRWFE7.mjs.map → browser/chunk-J5LGTIGS.mjs.map} +0 -0
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as A from '@automerge/automerge';
|
|
6
|
+
import { Chess as ChessJS } from 'chess.js';
|
|
7
|
+
import * as Array from 'effect/Array';
|
|
8
|
+
import * as Effect from 'effect/Effect';
|
|
9
|
+
import * as Function from 'effect/Function';
|
|
10
|
+
import * as Layer from 'effect/Layer';
|
|
11
|
+
import * as Option from 'effect/Option';
|
|
12
|
+
import * as Schema from 'effect/Schema';
|
|
13
|
+
|
|
14
|
+
import { AiService, ConsolePrinter, ToolExecutionService, ToolResolverService } from '@dxos/ai';
|
|
15
|
+
import { AiSession, GenerationObserver } from '@dxos/assistant';
|
|
16
|
+
import { ArtifactId } from '@dxos/assistant';
|
|
17
|
+
import { Database, Filter, Obj, Ref, Relation } from '@dxos/echo';
|
|
18
|
+
import { Collection } from '@dxos/echo';
|
|
19
|
+
import { createDocAccessor } from '@dxos/echo-db';
|
|
20
|
+
import { TracingService, defineFunction } from '@dxos/functions';
|
|
21
|
+
import { log } from '@dxos/log';
|
|
22
|
+
import { Chess } from '@dxos/plugin-chess/types';
|
|
23
|
+
import { Markdown } from '@dxos/plugin-markdown/types';
|
|
24
|
+
import { Text } from '@dxos/schema';
|
|
25
|
+
import { HasSubject } from '@dxos/types';
|
|
26
|
+
import { trim } from '@dxos/util';
|
|
27
|
+
|
|
28
|
+
export default defineFunction({
|
|
29
|
+
key: 'org.dxos.function.chess.commentary',
|
|
30
|
+
name: 'Commentary',
|
|
31
|
+
description: 'Adds commentary about the most recent move to a markdown document associated with the chess game.',
|
|
32
|
+
inputSchema: Schema.Struct({
|
|
33
|
+
game: Ref.Ref(Chess.Game).annotations({
|
|
34
|
+
description: 'The chess game to comment on.',
|
|
35
|
+
}),
|
|
36
|
+
}),
|
|
37
|
+
outputSchema: Schema.Union(
|
|
38
|
+
Schema.Struct({
|
|
39
|
+
documentId: ArtifactId.annotations({
|
|
40
|
+
description: 'The ID of the markdown document that was updated or created.',
|
|
41
|
+
}),
|
|
42
|
+
commentary: Schema.String.annotations({
|
|
43
|
+
description: 'The commentary that was added.',
|
|
44
|
+
}),
|
|
45
|
+
}),
|
|
46
|
+
Schema.Void.annotations({
|
|
47
|
+
description: 'Function did not find anything to comment on.',
|
|
48
|
+
}),
|
|
49
|
+
),
|
|
50
|
+
types: [Chess.Game, Markdown.Document, Text.Text, HasSubject.HasSubject, Collection.Collection],
|
|
51
|
+
services: [AiService.AiService, Database.Service],
|
|
52
|
+
handler: Effect.fnUntraced(
|
|
53
|
+
function* ({ data: { game: gameRef } }) {
|
|
54
|
+
// Load the chess game
|
|
55
|
+
log.info('load game', { gameRef });
|
|
56
|
+
const chessGame = yield* Database.load(gameRef);
|
|
57
|
+
|
|
58
|
+
// Load the chess position from PGN or FEN
|
|
59
|
+
const chess = new ChessJS();
|
|
60
|
+
if (chessGame.pgn) {
|
|
61
|
+
chess.loadPgn(chessGame.pgn);
|
|
62
|
+
} else if (chessGame.fen) {
|
|
63
|
+
chess.load(chessGame.fen);
|
|
64
|
+
} else {
|
|
65
|
+
log.info('Early return: no pgn or fen');
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Get the most recent move
|
|
70
|
+
const history = chess.history({ verbose: true });
|
|
71
|
+
if (history.length === 0) {
|
|
72
|
+
throw new Error('No moves have been played yet');
|
|
73
|
+
}
|
|
74
|
+
const lastMove = history[history.length - 1];
|
|
75
|
+
const moveNumber = Math.ceil(history.length / 2);
|
|
76
|
+
const isWhiteMove = history.length % 2 === 1;
|
|
77
|
+
const player = isWhiteMove ? 'White' : 'Black';
|
|
78
|
+
const moveNotation = lastMove.san;
|
|
79
|
+
|
|
80
|
+
// Generate AI commentary about the move
|
|
81
|
+
const result = yield* new AiSession().run({
|
|
82
|
+
prompt:
|
|
83
|
+
`Comment on this chess move as if you're commentating a live match for an audience:\n\n` +
|
|
84
|
+
`Move ${moveNumber}: ${player} plays ${moveNotation} (${lastMove.from} to ${lastMove.to})${lastMove.captured ? `, capturing ${lastMove.captured}` : ''}\n` +
|
|
85
|
+
`Current position: ${chess.fen()}\n` +
|
|
86
|
+
`${chess.isCheck() ? 'The king is in check! ' : ''}` +
|
|
87
|
+
`${chess.isCheckmate() ? 'CHECKMATE! ' : ''}` +
|
|
88
|
+
`${chess.isStalemate() ? 'STALEMATE! ' : ''}` +
|
|
89
|
+
`\nGame so far:\n${chess.pgn()}`,
|
|
90
|
+
system: COMMENTARY_SYSTEM_PROMPT,
|
|
91
|
+
history: [],
|
|
92
|
+
observer: GenerationObserver.fromPrinter(new ConsolePrinter({ tag: 'chess-commentary' })),
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
const commentaryText = Function.pipe(
|
|
96
|
+
result,
|
|
97
|
+
Array.findLast((msg) => msg.sender.role === 'assistant' && msg.blocks.some((block) => block._tag === 'text')),
|
|
98
|
+
Option.flatMap((msg) =>
|
|
99
|
+
Function.pipe(
|
|
100
|
+
msg.blocks,
|
|
101
|
+
Array.findLast((block) => block._tag === 'text'),
|
|
102
|
+
Option.map((block) => block.text),
|
|
103
|
+
),
|
|
104
|
+
),
|
|
105
|
+
Option.getOrThrowWith(() => new Error('No commentary generated')),
|
|
106
|
+
);
|
|
107
|
+
|
|
108
|
+
const commentary = `## Move ${moveNumber}: ${player} plays ${moveNotation}\n\n${commentaryText}\n\n`;
|
|
109
|
+
log.info('commentary', { commentary });
|
|
110
|
+
|
|
111
|
+
// TODO(wittjosiah): Functions currently don't support traversals.
|
|
112
|
+
// const docs = yield* Database.runQuery(
|
|
113
|
+
// Query.select(Filter.id(chessGame.id)).targetOf(HasSubject.HasSubject).source(),
|
|
114
|
+
// ).pipe(Effect.map((objects) => objects.filter((object) => Obj.instanceOf(Markdown.Document, object))));
|
|
115
|
+
const docs = yield* Database.runQuery(Filter.type(HasSubject.HasSubject)).pipe(
|
|
116
|
+
Effect.map((relations) =>
|
|
117
|
+
relations.filter((relation) => {
|
|
118
|
+
// TODO(wittjosiah): This is a workaround for getTarget not handling deleted objects.
|
|
119
|
+
try {
|
|
120
|
+
log.info('relation', {
|
|
121
|
+
source: Obj.getDXN(Relation.getTarget(relation)).toString(),
|
|
122
|
+
game: Obj.getDXN(chessGame).toString(),
|
|
123
|
+
});
|
|
124
|
+
return Obj.getDXN(Relation.getTarget(relation)).toString() === Obj.getDXN(chessGame).toString();
|
|
125
|
+
} catch {
|
|
126
|
+
return false;
|
|
127
|
+
}
|
|
128
|
+
}),
|
|
129
|
+
),
|
|
130
|
+
Effect.map((relations) =>
|
|
131
|
+
relations
|
|
132
|
+
.map((relation) => {
|
|
133
|
+
// TODO(wittjosiah): This is a workaround for getSource not handling deleted objects.
|
|
134
|
+
try {
|
|
135
|
+
return Relation.getSource(relation);
|
|
136
|
+
} catch {
|
|
137
|
+
return undefined;
|
|
138
|
+
}
|
|
139
|
+
})
|
|
140
|
+
.filter((source) => source !== undefined),
|
|
141
|
+
),
|
|
142
|
+
Effect.map((sources) => {
|
|
143
|
+
const docs = sources.filter((source) => Obj.instanceOf(Markdown.Document, source));
|
|
144
|
+
log.info('docs', { sources, docs });
|
|
145
|
+
return docs;
|
|
146
|
+
}),
|
|
147
|
+
);
|
|
148
|
+
log.info('docs', { count: docs.length });
|
|
149
|
+
|
|
150
|
+
let document: Markdown.Document;
|
|
151
|
+
if (docs.length === 0) {
|
|
152
|
+
// TODO(wittjosiah): Deploy fails if `SpaceProperties` schema is imported because its from `client-protocol`.
|
|
153
|
+
const [properties] = yield* Database.runQuery(Filter.typename('org.dxos.type.space-properties'));
|
|
154
|
+
const rootCollection = yield* Database.load<Collection.Collection>(properties[Collection.Collection.typename]);
|
|
155
|
+
|
|
156
|
+
log.info('rootCollection', { rootCollection });
|
|
157
|
+
|
|
158
|
+
// Create a new markdown document
|
|
159
|
+
const gameName = chessGame.name || 'Chess Game';
|
|
160
|
+
document = yield* Database.add(
|
|
161
|
+
Markdown.make({
|
|
162
|
+
name: `${gameName} Commentary`,
|
|
163
|
+
content: `# ${gameName} Commentary\n\n${commentary}`,
|
|
164
|
+
}),
|
|
165
|
+
);
|
|
166
|
+
|
|
167
|
+
const documentRef = Ref.make(document);
|
|
168
|
+
Obj.change(rootCollection, (c) => {
|
|
169
|
+
c.objects.push(documentRef);
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
// Create the HasSubject relation
|
|
173
|
+
yield* Database.add(
|
|
174
|
+
Relation.make(HasSubject.HasSubject, {
|
|
175
|
+
[Relation.Source]: document,
|
|
176
|
+
[Relation.Target]: chessGame,
|
|
177
|
+
completedAt: new Date().toISOString(),
|
|
178
|
+
}),
|
|
179
|
+
);
|
|
180
|
+
} else {
|
|
181
|
+
document = docs[0];
|
|
182
|
+
|
|
183
|
+
// Load the text content and append the commentary
|
|
184
|
+
const text = yield* Database.load(document.content);
|
|
185
|
+
const accessor = createDocAccessor(text, ['content']);
|
|
186
|
+
accessor.handle.change((doc: A.Doc<Text.Text>) => {
|
|
187
|
+
A.splice(doc, accessor.path.slice(), text.content.length, 0, commentary);
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
log.info('result', { documentId: Obj.getDXN(document).toString(), commentary });
|
|
192
|
+
|
|
193
|
+
yield* Database.flush();
|
|
194
|
+
|
|
195
|
+
return {
|
|
196
|
+
documentId: Obj.getDXN(document).toString(),
|
|
197
|
+
commentary,
|
|
198
|
+
};
|
|
199
|
+
},
|
|
200
|
+
Effect.provide(
|
|
201
|
+
Layer.mergeAll(
|
|
202
|
+
AiService.model('@anthropic/claude-haiku-4-5'),
|
|
203
|
+
ToolResolverService.layerEmpty,
|
|
204
|
+
ToolExecutionService.layerEmpty,
|
|
205
|
+
TracingService.layerNoop,
|
|
206
|
+
),
|
|
207
|
+
),
|
|
208
|
+
),
|
|
209
|
+
});
|
|
210
|
+
|
|
211
|
+
const COMMENTARY_SYSTEM_PROMPT = trim`
|
|
212
|
+
You are a professional chess commentator providing live commentary for a chess match.
|
|
213
|
+
|
|
214
|
+
# Style
|
|
215
|
+
- Write in an engaging, enthusiastic style as if commentating for a live audience
|
|
216
|
+
- Be concise but informative (2-4 sentences)
|
|
217
|
+
- Explain the strategic implications of the move
|
|
218
|
+
- Note any tactical elements (captures, threats, checks)
|
|
219
|
+
- Comment on the position and what it means for the game
|
|
220
|
+
|
|
221
|
+
# Format
|
|
222
|
+
- Write in plain text (no markdown formatting in the commentary itself)
|
|
223
|
+
- Be natural and conversational
|
|
224
|
+
- Use chess terminology appropriately but keep it accessible
|
|
225
|
+
|
|
226
|
+
# Special Situations
|
|
227
|
+
- If it's checkmate, express excitement about the conclusion
|
|
228
|
+
- If it's check, note the pressure on the king
|
|
229
|
+
- If a piece is captured, mention the material exchange
|
|
230
|
+
- Comment on the development of pieces and control of key squares when relevant
|
|
231
|
+
`;
|
|
@@ -3,21 +3,27 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
// @ts-ignore
|
|
6
|
-
import {
|
|
6
|
+
import { Expando, S, create, defineFunction } from 'dxos:functions';
|
|
7
7
|
// @ts-ignore
|
|
8
8
|
import { randText } from 'https://esm.sh/@ngneat/falso@7.1.1?bundle=false';
|
|
9
9
|
|
|
10
10
|
export default defineFunction({
|
|
11
|
+
key: 'org.dxos.script.data-generator',
|
|
12
|
+
name: 'Data Generator',
|
|
11
13
|
inputSchema: S.Struct({
|
|
12
14
|
documentAmount: S.optional(S.Number),
|
|
13
15
|
textSize: S.optional(S.Number),
|
|
14
16
|
mutationAmount: S.optional(S.Number),
|
|
17
|
+
waitAfterCreation: S.optional(S.Number),
|
|
15
18
|
}),
|
|
16
19
|
|
|
17
20
|
outputSchema: S.Struct({}),
|
|
18
21
|
|
|
19
|
-
handler: async ({
|
|
20
|
-
|
|
22
|
+
handler: async ({
|
|
23
|
+
data: { documentAmount = 1, textSize = 10, mutationAmount = 0, waitAfterCreation = 10_000 },
|
|
24
|
+
context: { space },
|
|
25
|
+
}: any) => {
|
|
26
|
+
await space.db.graph.schemaRegistry.register([Expando]);
|
|
21
27
|
const result: Record<string, any> = {};
|
|
22
28
|
const objects: Expando[] = [];
|
|
23
29
|
|
|
@@ -42,7 +48,7 @@ export default defineFunction({
|
|
|
42
48
|
|
|
43
49
|
// Flush and wait for data to propagate.
|
|
44
50
|
await space.db.flush();
|
|
45
|
-
await new Promise((resolve) => setTimeout(resolve,
|
|
51
|
+
await new Promise((resolve) => setTimeout(resolve, waitAfterCreation));
|
|
46
52
|
return { createdObjects: objects.length };
|
|
47
53
|
},
|
|
48
54
|
});
|
package/src/templates/discord.ts
CHANGED
|
@@ -3,17 +3,23 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
// @ts-ignore
|
|
6
|
-
import {
|
|
6
|
+
import { DXN, EchoObject, Filter, ObjectId, S, create, defineFunction } from 'dxos:functions';
|
|
7
7
|
// @ts-ignore
|
|
8
|
-
import { FetchHttpClient } from 'https://esm.sh/@effect/platform@0.
|
|
8
|
+
import { FetchHttpClient } from 'https://esm.sh/@effect/platform@0.89.0?deps=effect@3.17.0&bundle=false';
|
|
9
9
|
import {
|
|
10
10
|
DiscordConfig,
|
|
11
11
|
DiscordREST,
|
|
12
12
|
DiscordRESTMemoryLive,
|
|
13
13
|
// @ts-ignore
|
|
14
|
-
} from 'https://esm.sh/dfx@0.113.0?deps=effect@3.
|
|
14
|
+
} from 'https://esm.sh/dfx@0.113.0?deps=effect@3.17.0&bundle=false';
|
|
15
15
|
// @ts-ignore
|
|
16
|
-
import
|
|
16
|
+
import * as Config from 'https://esm.sh/effect@3.17.0/Config?bundle=false';
|
|
17
|
+
// @ts-ignore
|
|
18
|
+
import * as Effect from 'https://esm.sh/effect@3.17.0/Effect?bundle=false';
|
|
19
|
+
// @ts-ignore
|
|
20
|
+
import * as Redacted from 'https://esm.sh/effect@3.17.0/Redacted?bundle=false';
|
|
21
|
+
// @ts-ignore
|
|
22
|
+
import * as Ref from 'https://esm.sh/effect@3.17.0/Ref?bundle=false';
|
|
17
23
|
|
|
18
24
|
const MessageSchema = S.Struct({
|
|
19
25
|
id: ObjectId,
|
|
@@ -23,7 +29,7 @@ const MessageSchema = S.Struct({
|
|
|
23
29
|
content: S.String,
|
|
24
30
|
}).pipe(
|
|
25
31
|
EchoObject({
|
|
26
|
-
typename: 'example.
|
|
32
|
+
typename: 'com.example.type.message',
|
|
27
33
|
version: '0.1.0',
|
|
28
34
|
}),
|
|
29
35
|
);
|
|
@@ -36,6 +42,8 @@ const generateSnowflake = (unixTimestamp: number): bigint => {
|
|
|
36
42
|
};
|
|
37
43
|
|
|
38
44
|
export default defineFunction({
|
|
45
|
+
key: 'org.dxos.script.discord',
|
|
46
|
+
name: 'Discord',
|
|
39
47
|
inputSchema: S.Struct({
|
|
40
48
|
// TODO(wittjosiah): Remove. This is used to provide a terminal for a cron trigger.
|
|
41
49
|
tick: S.optional(S.String),
|
|
@@ -52,7 +60,7 @@ export default defineFunction({
|
|
|
52
60
|
handler: ({ data: { channelId, queueId, after = DEFAULT_AFTER, pageSize = 5 }, context: { space } }: any) =>
|
|
53
61
|
Effect.gen(function* () {
|
|
54
62
|
const { token } = yield* Effect.tryPromise({
|
|
55
|
-
try: () => space.db.query(Filter.typename('dxos.
|
|
63
|
+
try: () => space.db.query(Filter.typename('org.dxos.type.access-token', { source: 'discord.com' })).first(),
|
|
56
64
|
catch: (e: any) => e,
|
|
57
65
|
});
|
|
58
66
|
const { objects } = yield* Effect.tryPromise({
|
|
@@ -2,37 +2,36 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
} from '
|
|
13
|
-
// @ts-ignore
|
|
14
|
-
import { Effect, Schedule } from 'https://esm.sh/effect@3.14.21?bundle=false';
|
|
5
|
+
import * as FetchHttpClient from '@effect/platform/FetchHttpClient';
|
|
6
|
+
import * as HttpClient from '@effect/platform/HttpClient';
|
|
7
|
+
import * as HttpClientRequest from '@effect/platform/HttpClientRequest';
|
|
8
|
+
import * as Effect from 'effect/Effect';
|
|
9
|
+
import * as Schedule from 'effect/Schedule';
|
|
10
|
+
import * as Schema from 'effect/Schema';
|
|
11
|
+
|
|
12
|
+
import { defineFunction } from '@dxos/functions';
|
|
15
13
|
|
|
16
14
|
export default defineFunction({
|
|
15
|
+
key: 'org.dxos.script.forex-effect',
|
|
16
|
+
name: 'Forex Effect',
|
|
17
17
|
description: 'Returns the exchange rate between two currencies.',
|
|
18
18
|
|
|
19
|
-
inputSchema:
|
|
20
|
-
from:
|
|
21
|
-
to:
|
|
19
|
+
inputSchema: Schema.Struct({
|
|
20
|
+
from: Schema.String.annotations({ description: 'The source currency' }),
|
|
21
|
+
to: Schema.String.annotations({ description: 'The target currency' }),
|
|
22
22
|
}),
|
|
23
23
|
|
|
24
|
-
outputSchema:
|
|
24
|
+
outputSchema: Schema.String.annotations({ description: 'The exchange rate between the two currencies' }),
|
|
25
25
|
|
|
26
|
-
handler:
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
);
|
|
26
|
+
handler: Effect.fnUntraced(function* ({ data: { from, to } }) {
|
|
27
|
+
const res = yield* HttpClientRequest.get(`https://free.ratesdb.com/v1/rates?from=${from}&to=${to}`).pipe(
|
|
28
|
+
HttpClient.execute,
|
|
29
|
+
Effect.flatMap((res: any) => res.json),
|
|
30
|
+
Effect.timeout('5 seconds'),
|
|
31
|
+
Effect.retry(Schedule.exponential(1_000).pipe(Schedule.compose(Schedule.recurs(3)))),
|
|
32
|
+
Effect.scoped,
|
|
33
|
+
);
|
|
35
34
|
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
return (res as any).data.rates[to].toString();
|
|
36
|
+
}, Effect.provide(FetchHttpClient.layer)),
|
|
38
37
|
});
|
package/src/templates/forex.ts
CHANGED
|
@@ -2,18 +2,21 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
import * as Schema from 'effect/Schema';
|
|
6
|
+
|
|
7
|
+
import { defineFunction } from '@dxos/functions';
|
|
7
8
|
|
|
8
9
|
export default defineFunction({
|
|
10
|
+
key: 'org.dxos.script.forex',
|
|
11
|
+
name: 'Forex',
|
|
9
12
|
description: 'Returns the exchange rate between two currencies.',
|
|
10
13
|
|
|
11
|
-
inputSchema:
|
|
12
|
-
from:
|
|
13
|
-
to:
|
|
14
|
+
inputSchema: Schema.Struct({
|
|
15
|
+
from: Schema.String.annotations({ description: 'The source currency' }),
|
|
16
|
+
to: Schema.String.annotations({ description: 'The target currency' }),
|
|
14
17
|
}),
|
|
15
18
|
|
|
16
|
-
handler: async ({ data: { from, to } }
|
|
19
|
+
handler: async ({ data: { from, to } }) => {
|
|
17
20
|
const res = await fetch(`https://free.ratesdb.com/v1/rates?from=${from}&to=${to}`);
|
|
18
21
|
const {
|
|
19
22
|
data: { rates },
|
package/src/templates/gmail.ts
CHANGED
|
@@ -3,20 +3,32 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
// @ts-ignore
|
|
6
|
-
import {
|
|
6
|
+
import { EchoObject, Filter, ObjectId, S, create, defineFunction } from 'dxos:functions';
|
|
7
7
|
// @ts-ignore
|
|
8
8
|
import {
|
|
9
|
+
FetchHttpClient,
|
|
9
10
|
HttpClient,
|
|
10
11
|
HttpClientRequest,
|
|
11
|
-
FetchHttpClient,
|
|
12
12
|
// @ts-ignore
|
|
13
|
-
} from 'https://esm.sh/@effect/platform@0.
|
|
13
|
+
} from 'https://esm.sh/@effect/platform@0.89.0?deps=effect@3.17.0&bundle=false';
|
|
14
14
|
// @ts-ignore
|
|
15
15
|
import { format, subDays } from 'https://esm.sh/date-fns@3.3.1?bundle=false';
|
|
16
16
|
// @ts-ignore
|
|
17
|
-
import
|
|
17
|
+
import * as Chunk from 'https://esm.sh/effect@3.17.0/Chunk?bundle=false';
|
|
18
|
+
// @ts-ignore
|
|
19
|
+
import * as Effect from 'https://esm.sh/effect@3.17.0/Effect?bundle=false';
|
|
20
|
+
// @ts-ignore
|
|
21
|
+
import * as Function from 'https://esm.sh/effect@3.17.0/Function?bundle=false';
|
|
22
|
+
// @ts-ignore
|
|
23
|
+
import * as Ref from 'https://esm.sh/effect@3.17.0/Ref?bundle=false';
|
|
24
|
+
// @ts-ignore
|
|
25
|
+
import * as Schedule from 'https://esm.sh/effect@3.17.0/Schedule?bundle=false';
|
|
26
|
+
// @ts-ignore
|
|
27
|
+
import * as Stream from 'https://esm.sh/effect@3.17.0/Stream?bundle=false';
|
|
18
28
|
|
|
19
29
|
export default defineFunction({
|
|
30
|
+
key: 'org.dxos.script.gmail',
|
|
31
|
+
name: 'Gmail',
|
|
20
32
|
inputSchema: S.Struct({
|
|
21
33
|
mailboxId: S.String,
|
|
22
34
|
userId: S.optional(S.String).pipe(S.withDecodingDefault(() => 'me')),
|
|
@@ -35,13 +47,13 @@ export default defineFunction({
|
|
|
35
47
|
handler: ({ context: { space }, data: { mailboxId, userId, after, pageSize } }: any) =>
|
|
36
48
|
Effect.gen(function* () {
|
|
37
49
|
const { token } = yield* Effect.tryPromise({
|
|
38
|
-
try: () => space.db.query(Filter.typename('dxos.
|
|
50
|
+
try: () => space.db.query(Filter.typename('org.dxos.type.access-token', { source: 'gmail.com' })).first(),
|
|
39
51
|
catch: (e: any) => e,
|
|
40
52
|
});
|
|
41
53
|
|
|
42
54
|
// NOTE: Google API bundles size is v. large and caused runtime issues.
|
|
43
55
|
const makeRequest = (url: string) =>
|
|
44
|
-
pipe(
|
|
56
|
+
Function.pipe(
|
|
45
57
|
url,
|
|
46
58
|
HttpClientRequest.get,
|
|
47
59
|
HttpClientRequest.setHeaders({ Authorization: `Bearer ${token}`, Accept: 'application/json' }),
|
|
@@ -80,7 +92,7 @@ export default defineFunction({
|
|
|
80
92
|
const messageDetails = yield* getMessage(userId, message.id);
|
|
81
93
|
const created = new Date(parseInt(messageDetails.internalDate)).toISOString();
|
|
82
94
|
const from = messageDetails.payload.headers.find((h: any) => h.name === 'From');
|
|
83
|
-
const sender = from &&
|
|
95
|
+
const sender = from && parseFromHeader(from.value);
|
|
84
96
|
// TODO(wittjosiah): Improve parsing of email contents.
|
|
85
97
|
const content =
|
|
86
98
|
messageDetails.payload.body?.data ??
|
|
@@ -98,7 +110,7 @@ export default defineFunction({
|
|
|
98
110
|
sender,
|
|
99
111
|
blocks: [
|
|
100
112
|
{
|
|
101
|
-
|
|
113
|
+
_tag: 'text',
|
|
102
114
|
text: Buffer.from(content, 'base64').toString('utf-8'),
|
|
103
115
|
},
|
|
104
116
|
],
|
|
@@ -114,7 +126,7 @@ export default defineFunction({
|
|
|
114
126
|
|
|
115
127
|
const queueMessages = yield* Ref.get(newMessages);
|
|
116
128
|
if (queueMessages.length > 0) {
|
|
117
|
-
yield* pipe(
|
|
129
|
+
yield* Function.pipe(
|
|
118
130
|
queueMessages,
|
|
119
131
|
Stream.fromIterable,
|
|
120
132
|
Stream.grouped(10),
|
|
@@ -145,17 +157,17 @@ const getUrl = (userId: string, messageId?: string, params?: Record<string, any>
|
|
|
145
157
|
/**
|
|
146
158
|
* Parses an email string in the format "Name <email@example.com>" into separate name and email components.
|
|
147
159
|
*/
|
|
148
|
-
const
|
|
149
|
-
const
|
|
160
|
+
const parseFromHeader = (value: string): { name?: string; email: string } | undefined => {
|
|
161
|
+
const EMAIL_REGEX = /^([^<]+?)\s*<([^>]+@[^>]+)>$/;
|
|
162
|
+
const removeOuterQuotes = (str: string) => str.replace(/^['"]|['"]$/g, '');
|
|
163
|
+
const match = value.match(EMAIL_REGEX);
|
|
150
164
|
if (match) {
|
|
151
165
|
const [, name, email] = match;
|
|
152
166
|
return {
|
|
153
|
-
name: name.trim(),
|
|
167
|
+
name: removeOuterQuotes(name.trim()),
|
|
154
168
|
email: email.trim(),
|
|
155
169
|
};
|
|
156
170
|
}
|
|
157
|
-
|
|
158
|
-
return undefined;
|
|
159
171
|
};
|
|
160
172
|
|
|
161
173
|
//
|
|
@@ -163,8 +175,7 @@ const parseEmailString = (emailString: string): { name?: string; email: string }
|
|
|
163
175
|
// TODO(wittjosiah): These schemas should be imported from @dxos/schema.
|
|
164
176
|
//
|
|
165
177
|
|
|
166
|
-
const
|
|
167
|
-
const ActorRole = S.Literal(...ActorRoles);
|
|
178
|
+
const ActorRole = S.Literal('user', 'assistant');
|
|
168
179
|
type ActorRole = S.Schema.Type<typeof ActorRole>;
|
|
169
180
|
|
|
170
181
|
const ActorSchema = S.Struct({
|
|
@@ -174,57 +185,16 @@ const ActorSchema = S.Struct({
|
|
|
174
185
|
role: S.optional(ActorRole),
|
|
175
186
|
});
|
|
176
187
|
|
|
177
|
-
const
|
|
188
|
+
const Base = S.Struct({
|
|
178
189
|
pending: S.optional(S.Boolean),
|
|
179
190
|
});
|
|
180
|
-
type
|
|
181
|
-
const
|
|
182
|
-
|
|
183
|
-
S.
|
|
184
|
-
|
|
185
|
-
disposition: S.optional(S.String),
|
|
186
|
-
text: S.String,
|
|
187
|
-
}),
|
|
188
|
-
).pipe(S.mutable);
|
|
189
|
-
type TextContentBlock = S.Schema.Type<typeof TextContentBlock>;
|
|
190
|
-
const JsonContentBlock = S.extend(
|
|
191
|
-
AbstractContentBlock,
|
|
192
|
-
S.Struct({
|
|
193
|
-
type: S.Literal('json'),
|
|
194
|
-
disposition: S.optional(S.String),
|
|
195
|
-
data: S.String,
|
|
196
|
-
}),
|
|
197
|
-
).pipe(S.mutable);
|
|
198
|
-
type JsonContentBlock = S.Schema.Type<typeof JsonContentBlock>;
|
|
199
|
-
const Base64ImageSource = S.Struct({
|
|
200
|
-
type: S.Literal('base64'),
|
|
201
|
-
mediaType: S.String,
|
|
202
|
-
data: S.String,
|
|
191
|
+
type Base = S.Schema.Type<typeof Base>;
|
|
192
|
+
const Text = S.TaggedStruct('text', {
|
|
193
|
+
mimeType: S.optional(S.String),
|
|
194
|
+
text: S.String,
|
|
195
|
+
...Base.fields,
|
|
203
196
|
}).pipe(S.mutable);
|
|
204
|
-
|
|
205
|
-
type: S.Literal('http'),
|
|
206
|
-
url: S.String,
|
|
207
|
-
}).pipe(S.mutable);
|
|
208
|
-
const ImageSource = S.Union(Base64ImageSource, HttpImageSource);
|
|
209
|
-
type ImageSource = S.Schema.Type<typeof ImageSource>;
|
|
210
|
-
const ImageContentBlock = S.extend(
|
|
211
|
-
AbstractContentBlock,
|
|
212
|
-
S.Struct({
|
|
213
|
-
type: S.Literal('image'),
|
|
214
|
-
id: S.optional(S.String),
|
|
215
|
-
source: S.optional(ImageSource),
|
|
216
|
-
}),
|
|
217
|
-
).pipe(S.mutable);
|
|
218
|
-
type ImageContentBlock = S.Schema.Type<typeof ImageContentBlock>;
|
|
219
|
-
const ReferenceContentBlock = S.extend(
|
|
220
|
-
AbstractContentBlock,
|
|
221
|
-
S.Struct({
|
|
222
|
-
type: S.Literal('reference'),
|
|
223
|
-
reference: S.Any,
|
|
224
|
-
}),
|
|
225
|
-
).pipe(S.mutable);
|
|
226
|
-
type ReferenceContentBlock = S.Schema.Type<typeof ReferenceContentBlock>;
|
|
227
|
-
const MessageContentBlock = S.Union(TextContentBlock, JsonContentBlock, ImageContentBlock, ReferenceContentBlock);
|
|
197
|
+
interface Text extends S.Schema.Type<typeof Text> {}
|
|
228
198
|
|
|
229
199
|
const MessageType = S.Struct({
|
|
230
200
|
id: ObjectId,
|
|
@@ -234,7 +204,7 @@ const MessageType = S.Struct({
|
|
|
234
204
|
sender: ActorSchema.annotations({
|
|
235
205
|
description: 'Identity of the message sender.',
|
|
236
206
|
}),
|
|
237
|
-
blocks: S.Array(
|
|
207
|
+
blocks: S.Array(Text).annotations({
|
|
238
208
|
description: 'Contents of the message.',
|
|
239
209
|
}),
|
|
240
210
|
properties: S.optional(
|
|
@@ -246,8 +216,8 @@ const MessageType = S.Struct({
|
|
|
246
216
|
),
|
|
247
217
|
}).pipe(
|
|
248
218
|
EchoObject({
|
|
249
|
-
typename: 'dxos.
|
|
250
|
-
version: '0.
|
|
219
|
+
typename: 'org.dxos.type.message',
|
|
220
|
+
version: '0.1.0',
|
|
251
221
|
}),
|
|
252
222
|
);
|
|
253
223
|
type MessageType = S.Schema.Type<typeof MessageType>;
|