@dxos/plugin-assistant 0.8.4-main.7ace549 → 0.8.4-main.937b3ca
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/BlueprintArticle-WP3G5GLG.mjs +31 -0
- package/dist/lib/browser/BlueprintArticle-WP3G5GLG.mjs.map +7 -0
- package/dist/lib/browser/ChatCompanion-GFSJZTOT.mjs +153 -0
- package/dist/lib/browser/ChatCompanion-GFSJZTOT.mjs.map +7 -0
- package/dist/lib/browser/ChatContainer-IHAPBIZE.mjs +72 -0
- package/dist/lib/browser/ChatContainer-IHAPBIZE.mjs.map +7 -0
- package/dist/lib/browser/ChatDialog-EGRMPCTL.mjs +85 -0
- package/dist/lib/browser/ChatDialog-EGRMPCTL.mjs.map +7 -0
- package/dist/lib/browser/PromptArticle-K362ZPAE.mjs +53 -0
- package/dist/lib/browser/PromptArticle-K362ZPAE.mjs.map +7 -0
- package/dist/lib/browser/ai-service-5GUDOEWF.mjs +21 -0
- package/dist/lib/browser/ai-service-5GUDOEWF.mjs.map +7 -0
- package/dist/lib/browser/app-graph-builder-DSNH2OMY.mjs +212 -0
- package/dist/lib/browser/app-graph-builder-DSNH2OMY.mjs.map +7 -0
- package/dist/lib/browser/blueprint-definition-DGHH7MUU.mjs +14 -0
- package/dist/lib/browser/blueprints/index.mjs +12 -0
- package/dist/lib/browser/chunk-A75V4MOQ.mjs +1832 -0
- package/dist/lib/browser/chunk-A75V4MOQ.mjs.map +7 -0
- package/dist/lib/browser/{chunk-7ZJIXQ2Y.mjs → chunk-DKQMSMBN.mjs} +54 -63
- package/dist/lib/browser/chunk-DKQMSMBN.mjs.map +7 -0
- package/dist/lib/browser/{chunk-WBG5PTSX.mjs → chunk-EXVT7D4B.mjs} +1 -1
- package/dist/lib/browser/chunk-EXVT7D4B.mjs.map +7 -0
- package/dist/lib/browser/{chunk-2BOE3OTW.mjs → chunk-ML3QCFKA.mjs} +23 -20
- package/dist/lib/browser/chunk-ML3QCFKA.mjs.map +7 -0
- package/dist/lib/browser/chunk-MRJVYGLU.mjs +208 -0
- package/dist/lib/browser/chunk-MRJVYGLU.mjs.map +7 -0
- package/dist/lib/browser/chunk-V772AMZM.mjs +250 -0
- package/dist/lib/browser/chunk-V772AMZM.mjs.map +7 -0
- package/dist/lib/browser/chunk-WGQTU6UJ.mjs +41 -0
- package/dist/lib/browser/chunk-WGQTU6UJ.mjs.map +7 -0
- package/dist/lib/browser/edge-model-resolver-26BOY6HY.mjs +20 -0
- package/dist/lib/browser/edge-model-resolver-26BOY6HY.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +156 -174
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/local-model-resolver-ZFIM6GGV.mjs +19 -0
- package/dist/lib/browser/local-model-resolver-ZFIM6GGV.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/operation-resolver-7XJLBRQY.mjs +132 -0
- package/dist/lib/browser/operation-resolver-7XJLBRQY.mjs.map +7 -0
- package/dist/lib/browser/{react-surface-ECKZNDSU.mjs → react-surface-S7SBFOSW.mjs} +41 -30
- package/dist/lib/browser/react-surface-S7SBFOSW.mjs.map +7 -0
- package/dist/lib/browser/{repair-3MZXLUHO.mjs → repair-6QGAKOVM.mjs} +23 -13
- package/dist/lib/browser/repair-6QGAKOVM.mjs.map +7 -0
- package/dist/lib/browser/settings-4ZDLUMYE.mjs +32 -0
- package/dist/lib/browser/settings-4ZDLUMYE.mjs.map +7 -0
- package/dist/lib/browser/state-AN6336ZX.mjs +26 -0
- package/dist/lib/browser/state-AN6336ZX.mjs.map +7 -0
- package/dist/lib/browser/toolkit-7AVTEPMA.mjs +18 -0
- package/dist/lib/browser/toolkit-7AVTEPMA.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +8 -4
- package/dist/lib/node-esm/BlueprintArticle-WZ76E2C4.mjs +32 -0
- package/dist/lib/node-esm/BlueprintArticle-WZ76E2C4.mjs.map +7 -0
- package/dist/lib/node-esm/ChatCompanion-UR7DXZ54.mjs +154 -0
- package/dist/lib/node-esm/ChatCompanion-UR7DXZ54.mjs.map +7 -0
- package/dist/lib/node-esm/ChatContainer-YMLLGOZK.mjs +73 -0
- package/dist/lib/node-esm/ChatContainer-YMLLGOZK.mjs.map +7 -0
- package/dist/lib/node-esm/ChatDialog-D24WJPK4.mjs +86 -0
- package/dist/lib/node-esm/ChatDialog-D24WJPK4.mjs.map +7 -0
- package/dist/lib/node-esm/PromptArticle-D4HAIIC6.mjs +54 -0
- package/dist/lib/node-esm/PromptArticle-D4HAIIC6.mjs.map +7 -0
- package/dist/lib/node-esm/ai-service-PXKKCFIF.mjs +22 -0
- package/dist/lib/node-esm/ai-service-PXKKCFIF.mjs.map +7 -0
- package/dist/lib/node-esm/app-graph-builder-TJCUEXW5.mjs +213 -0
- package/dist/lib/node-esm/app-graph-builder-TJCUEXW5.mjs.map +7 -0
- package/dist/lib/node-esm/{blueprint-definition-RDCLLIQH.mjs → blueprint-definition-SEMDEIYG.mjs} +6 -4
- package/dist/lib/node-esm/blueprint-definition-SEMDEIYG.mjs.map +7 -0
- package/dist/lib/node-esm/blueprints/index.mjs +13 -0
- package/dist/lib/node-esm/blueprints/index.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-355W5B27.mjs +251 -0
- package/dist/lib/node-esm/chunk-355W5B27.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-4BERCIES.mjs +1833 -0
- package/dist/lib/node-esm/chunk-4BERCIES.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-CKW4IYLY.mjs → chunk-75PHXBN3.mjs} +54 -63
- package/dist/lib/node-esm/chunk-75PHXBN3.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-DCA5QWQT.mjs +209 -0
- package/dist/lib/node-esm/chunk-DCA5QWQT.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-MSBPC4RJ.mjs +42 -0
- package/dist/lib/node-esm/chunk-MSBPC4RJ.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-WE6KTH72.mjs → chunk-POWB2BPC.mjs} +1 -1
- package/dist/lib/node-esm/chunk-POWB2BPC.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-3Q22TTXW.mjs → chunk-ZRIPP7YF.mjs} +23 -20
- package/dist/lib/node-esm/chunk-ZRIPP7YF.mjs.map +7 -0
- package/dist/lib/node-esm/{edge-model-resolver-2ARXDOYS.mjs → edge-model-resolver-G5KMODPO.mjs} +9 -7
- package/dist/lib/node-esm/edge-model-resolver-G5KMODPO.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +156 -174
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/local-model-resolver-KDZLYI7Y.mjs +20 -0
- package/dist/lib/node-esm/local-model-resolver-KDZLYI7Y.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/operation-resolver-SX4WMNA7.mjs +133 -0
- package/dist/lib/node-esm/operation-resolver-SX4WMNA7.mjs.map +7 -0
- package/dist/lib/node-esm/{react-surface-NLIG5VAI.mjs → react-surface-ZR6FXGLF.mjs} +41 -30
- package/dist/lib/node-esm/react-surface-ZR6FXGLF.mjs.map +7 -0
- package/dist/lib/node-esm/{repair-RER5H7Y6.mjs → repair-QJ7CQDKU.mjs} +23 -13
- package/dist/lib/node-esm/repair-QJ7CQDKU.mjs.map +7 -0
- package/dist/lib/node-esm/settings-CQEOHR3R.mjs +33 -0
- package/dist/lib/node-esm/settings-CQEOHR3R.mjs.map +7 -0
- package/dist/lib/node-esm/state-HDON4REW.mjs +27 -0
- package/dist/lib/node-esm/state-HDON4REW.mjs.map +7 -0
- package/dist/lib/node-esm/toolkit-OWGCEKOO.mjs +19 -0
- package/dist/lib/node-esm/toolkit-OWGCEKOO.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +8 -4
- package/dist/types/src/AssistantPlugin.d.ts +2 -1
- package/dist/types/src/AssistantPlugin.d.ts.map +1 -1
- package/dist/types/src/blueprints/assistant-blueprint.d.ts +209 -0
- package/dist/types/src/blueprints/assistant-blueprint.d.ts.map +1 -0
- package/dist/types/src/blueprints/index.d.ts +7 -0
- package/dist/types/src/blueprints/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/ai-service/ai-service.d.ts +5 -0
- package/dist/types/src/capabilities/ai-service/ai-service.d.ts.map +1 -0
- package/dist/types/src/capabilities/ai-service/index.d.ts +3 -0
- package/dist/types/src/capabilities/ai-service/index.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/blueprint-definition/blueprint-definition.d.ts +21 -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 +4 -0
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/edge-model-resolver/edge-model-resolver.d.ts +6 -0
- package/dist/types/src/capabilities/edge-model-resolver/edge-model-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/edge-model-resolver/index.d.ts +3 -0
- package/dist/types/src/capabilities/edge-model-resolver/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +10 -12
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/local-model-resolver/index.d.ts +3 -0
- package/dist/types/src/capabilities/local-model-resolver/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/local-model-resolver/local-model-resolver.d.ts +12 -0
- package/dist/types/src/capabilities/local-model-resolver/local-model-resolver.d.ts.map +1 -0
- 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/repair/index.d.ts +3 -0
- package/dist/types/src/capabilities/repair/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/repair/repair.d.ts +6 -0
- package/dist/types/src/capabilities/repair/repair.d.ts.map +1 -0
- package/dist/types/src/capabilities/settings/index.d.ts +15 -0
- package/dist/types/src/capabilities/settings/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/settings/settings.d.ts +17 -0
- package/dist/types/src/capabilities/settings/settings.d.ts.map +1 -0
- package/dist/types/src/capabilities/state/index.d.ts +11 -0
- package/dist/types/src/capabilities/state/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/state/state.d.ts +13 -0
- package/dist/types/src/capabilities/state/state.d.ts.map +1 -0
- package/dist/types/src/capabilities/toolkit/index.d.ts +3 -0
- package/dist/types/src/capabilities/toolkit/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/toolkit/toolkit.d.ts +5 -0
- package/dist/types/src/capabilities/toolkit/toolkit.d.ts.map +1 -0
- package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts +4 -2
- package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts.map +1 -1
- package/dist/types/src/components/BlueprintArticle.d.ts +1 -1
- package/dist/types/src/components/BlueprintArticle.d.ts.map +1 -1
- package/dist/types/src/components/Chat/Chat.d.ts +9 -10
- package/dist/types/src/components/Chat/Chat.d.ts.map +1 -1
- package/dist/types/src/components/Chat/events.d.ts +1 -1
- package/dist/types/src/components/Chat/events.d.ts.map +1 -1
- package/dist/types/src/components/ChatCompanion.d.ts +2 -2
- package/dist/types/src/components/ChatCompanion.d.ts.map +1 -1
- package/dist/types/src/components/ChatContainer.d.ts +10 -5
- package/dist/types/src/components/ChatContainer.d.ts.map +1 -1
- package/dist/types/src/components/ChatDialog.d.ts.map +1 -1
- package/dist/types/src/components/ChatProgress/ChatProgress.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts +3 -3
- package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts +3 -3
- package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.d.ts +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts +4 -3
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/registry.d.ts +1 -1
- package/dist/types/src/components/ChatThread/registry.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/sync.d.ts +1 -1
- package/dist/types/src/components/ChatThread/sync.d.ts.map +1 -1
- package/dist/types/src/components/PromptArticle.d.ts +1 -1
- package/dist/types/src/components/PromptArticle.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts +11 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/extensions/handlebars-extension.d.ts.map +1 -1
- package/dist/types/src/components/ToolBlock/ToolBlock.d.ts +3 -3
- package/dist/types/src/components/ToolBlock/ToolBlock.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.d.ts +4 -5
- package/dist/types/src/components/Toolbox/Toolbox.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts.map +1 -1
- package/dist/types/src/components/Typewriter/AssistantToolbar.d.ts +12 -0
- package/dist/types/src/components/Typewriter/AssistantToolbar.d.ts.map +1 -0
- package/dist/types/src/components/Typewriter/Typewriter.d.ts +11 -0
- package/dist/types/src/components/Typewriter/Typewriter.d.ts.map +1 -0
- package/dist/types/src/components/Typewriter/Typewriter.stories.d.ts +7 -0
- package/dist/types/src/components/Typewriter/Typewriter.stories.d.ts.map +1 -0
- package/dist/types/src/components/Typewriter/assistant-extension.d.ts +5 -0
- package/dist/types/src/components/Typewriter/assistant-extension.d.ts.map +1 -0
- package/dist/types/src/components/Typewriter/index.d.ts +2 -0
- package/dist/types/src/components/Typewriter/index.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +10 -4
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/functions/index.d.ts +1 -1
- package/dist/types/src/functions/index.d.ts.map +1 -1
- package/dist/types/src/functions/object-list.d.ts +1 -1
- package/dist/types/src/functions/object-list.d.ts.map +1 -1
- package/dist/types/src/functions/object-load.d.ts.map +1 -1
- package/dist/types/src/functions/object-search.d.ts +10 -0
- package/dist/types/src/functions/object-search.d.ts.map +1 -0
- package/dist/types/src/hooks/useBlueprintRegistry.d.ts +5 -5
- package/dist/types/src/hooks/useBlueprintRegistry.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatProcessor.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatServices.d.ts +3 -3
- package/dist/types/src/hooks/useChatServices.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatToolbarActions.d.ts +1 -1
- package/dist/types/src/hooks/useChatToolbarActions.d.ts.map +1 -1
- package/dist/types/src/hooks/useContextBinder.d.ts.map +1 -1
- package/dist/types/src/hooks/useContextObjects.d.ts +7 -7
- package/dist/types/src/hooks/useContextObjects.d.ts.map +1 -1
- package/dist/types/src/hooks/useFilteredTypes.d.ts +2 -3
- package/dist/types/src/hooks/useFilteredTypes.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +0 -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/processor/processor.d.ts +10 -9
- package/dist/types/src/processor/processor.d.ts.map +1 -1
- package/dist/types/src/processor/update-name.d.ts.map +1 -1
- package/dist/types/src/queue-logger.d.ts.map +1 -1
- package/dist/types/src/testing/test-generator.d.ts +3 -2
- package/dist/types/src/testing/test-generator.d.ts.map +1 -1
- package/dist/types/src/testing/test-services.d.ts.map +1 -1
- package/dist/types/src/types/Assistant.d.ts +16 -19
- package/dist/types/src/types/Assistant.d.ts.map +1 -1
- package/dist/types/src/types/AssistantAction.d.ts +88 -122
- package/dist/types/src/types/AssistantAction.d.ts.map +1 -1
- package/dist/types/src/types/capabilities.d.ts +33 -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 +3 -1
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/service.d.ts +11 -260
- package/dist/types/src/types/service.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +113 -92
- package/src/AssistantPlugin.tsx +62 -90
- package/src/blueprints/assistant-blueprint.ts +62 -0
- package/src/blueprints/index.ts +12 -0
- package/src/capabilities/ai-service/ai-service.ts +29 -0
- package/src/capabilities/ai-service/index.ts +7 -0
- package/src/capabilities/app-graph-builder/app-graph-builder.ts +180 -0
- package/src/capabilities/app-graph-builder/index.ts +7 -0
- package/src/capabilities/blueprint-definition/blueprint-definition.ts +60 -0
- package/src/capabilities/blueprint-definition/index.ts +8 -0
- package/src/capabilities/edge-model-resolver/edge-model-resolver.ts +32 -0
- package/src/capabilities/edge-model-resolver/index.ts +7 -0
- package/src/capabilities/index.ts +10 -15
- package/src/capabilities/local-model-resolver/index.ts +7 -0
- package/src/capabilities/local-model-resolver/local-model-resolver.ts +37 -0
- package/src/capabilities/operation-resolver/index.ts +7 -0
- package/src/capabilities/operation-resolver/operation-resolver.ts +110 -0
- package/src/capabilities/react-surface/index.ts +7 -0
- package/src/capabilities/react-surface/react-surface.tsx +95 -0
- package/src/capabilities/repair/index.ts +7 -0
- package/src/capabilities/{repair.ts → repair/repair.ts} +23 -9
- package/src/capabilities/settings/index.ts +7 -0
- package/src/capabilities/settings/settings.ts +30 -0
- package/src/capabilities/state/index.ts +7 -0
- package/src/capabilities/state/state.ts +27 -0
- package/src/capabilities/toolkit/index.ts +7 -0
- package/src/capabilities/toolkit/toolkit.ts +26 -0
- package/src/components/AssistantSettings/AssistantSettings.tsx +13 -5
- package/src/components/BlueprintArticle.tsx +4 -4
- package/src/components/Chat/Chat.tsx +68 -68
- package/src/components/Chat/events.ts +1 -1
- package/src/components/ChatCompanion.tsx +125 -117
- package/src/components/ChatContainer.tsx +19 -19
- package/src/components/ChatDialog.tsx +6 -7
- package/src/components/ChatProgress/ChatProgress.tsx +3 -16
- package/src/components/ChatPrompt/ChatActions.tsx +1 -1
- package/src/components/ChatPrompt/ChatOptions.tsx +62 -58
- package/src/components/ChatPrompt/ChatReferences.tsx +5 -6
- package/src/components/ChatPrompt/ChatStatusIndicator.tsx +1 -1
- package/src/components/ChatThread/ChatThread.stories.tsx +10 -8
- package/src/components/ChatThread/ChatThread.tsx +1 -1
- package/src/components/ChatThread/Link.tsx +2 -2
- package/src/components/ChatThread/registry.tsx +2 -2
- package/src/components/ChatThread/sync.test.ts +12 -5
- package/src/components/ChatThread/sync.ts +8 -2
- package/src/components/PromptArticle.tsx +8 -9
- package/src/components/TemplateEditor/TemplateEditor.stories.tsx +2 -2
- package/src/components/TemplateEditor/TemplateEditor.tsx +7 -4
- package/src/components/TemplateEditor/TemplateForm.stories.tsx +14 -6
- package/src/components/TemplateEditor/TemplateForm.tsx +75 -28
- package/src/components/TemplateEditor/extensions/handlebars-extension.ts +10 -5
- package/src/components/ToolBlock/ToolBlock.tsx +6 -6
- package/src/components/Toolbox/Toolbox.stories.tsx +8 -9
- package/src/components/Toolbox/Toolbox.tsx +14 -15
- package/src/components/Typewriter/AssistantToolbar.tsx +161 -0
- package/src/components/Typewriter/Typewriter.stories.tsx +83 -0
- package/src/components/Typewriter/Typewriter.tsx +54 -0
- package/src/components/Typewriter/assistant-extension.tsx +144 -0
- package/src/components/Typewriter/index.ts +5 -0
- package/src/functions/index.ts +1 -1
- package/src/functions/object-list.ts +4 -3
- package/src/functions/object-load.ts +6 -4
- package/src/functions/object-search.ts +46 -0
- package/src/hooks/useBlueprintRegistry.ts +30 -20
- package/src/hooks/useChatProcessor.ts +5 -2
- package/src/hooks/useChatServices.ts +11 -15
- package/src/hooks/useChatToolbarActions.ts +24 -25
- package/src/hooks/useContextBinder.ts +4 -2
- package/src/hooks/useContextObjects.ts +13 -25
- package/src/hooks/useFilteredTypes.ts +6 -7
- package/src/hooks/useReferencesProvider.ts +6 -6
- package/src/index.ts +0 -1
- package/src/meta.ts +2 -2
- package/src/processor/processor.test.ts +3 -2
- package/src/processor/processor.ts +23 -25
- package/src/processor/update-name.ts +4 -1
- package/src/queue-logger.ts +4 -1
- package/src/testing/test-generator.ts +4 -3
- package/src/testing/test-services.ts +8 -6
- package/src/types/Assistant.ts +5 -6
- package/src/types/AssistantAction.ts +58 -62
- package/src/types/capabilities.ts +27 -0
- package/src/types/events.ts +11 -0
- package/src/types/index.ts +3 -1
- package/src/types/service.ts +10 -7
- package/dist/lib/browser/BlueprintArticle-BWSLH6LG.mjs +0 -36
- package/dist/lib/browser/BlueprintArticle-BWSLH6LG.mjs.map +0 -7
- package/dist/lib/browser/ChatCompanion-OSZZZSWV.mjs +0 -158
- package/dist/lib/browser/ChatCompanion-OSZZZSWV.mjs.map +0 -7
- package/dist/lib/browser/ChatContainer-2W6FNSJD.mjs +0 -77
- package/dist/lib/browser/ChatContainer-2W6FNSJD.mjs.map +0 -7
- package/dist/lib/browser/ChatDialog-XQ3KDYWE.mjs +0 -90
- package/dist/lib/browser/ChatDialog-XQ3KDYWE.mjs.map +0 -7
- package/dist/lib/browser/PromptArticle-Q7JYGFQV.mjs +0 -59
- package/dist/lib/browser/PromptArticle-Q7JYGFQV.mjs.map +0 -7
- package/dist/lib/browser/ai-service-ERTZBTP3.mjs +0 -19
- package/dist/lib/browser/ai-service-ERTZBTP3.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-LM6GVHQO.mjs +0 -199
- package/dist/lib/browser/app-graph-builder-LM6GVHQO.mjs.map +0 -7
- package/dist/lib/browser/blueprint-definition-VBEOXNBS.mjs +0 -12
- package/dist/lib/browser/chunk-2BOE3OTW.mjs.map +0 -7
- package/dist/lib/browser/chunk-5JZRYQZL.mjs +0 -229
- package/dist/lib/browser/chunk-5JZRYQZL.mjs.map +0 -7
- package/dist/lib/browser/chunk-7ZJIXQ2Y.mjs.map +0 -7
- package/dist/lib/browser/chunk-LRE4VEZV.mjs +0 -16
- package/dist/lib/browser/chunk-LRE4VEZV.mjs.map +0 -7
- package/dist/lib/browser/chunk-NC2QNMBF.mjs +0 -176
- package/dist/lib/browser/chunk-NC2QNMBF.mjs.map +0 -7
- package/dist/lib/browser/chunk-PWSTPQUY.mjs +0 -1929
- package/dist/lib/browser/chunk-PWSTPQUY.mjs.map +0 -7
- package/dist/lib/browser/chunk-WBG5PTSX.mjs.map +0 -7
- package/dist/lib/browser/edge-model-resolver-O6OFYIO2.mjs +0 -18
- package/dist/lib/browser/edge-model-resolver-O6OFYIO2.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-EEYS2GJF.mjs +0 -143
- package/dist/lib/browser/intent-resolver-EEYS2GJF.mjs.map +0 -7
- package/dist/lib/browser/local-model-resolver-34MVHRKD.mjs +0 -17
- package/dist/lib/browser/local-model-resolver-34MVHRKD.mjs.map +0 -7
- package/dist/lib/browser/react-surface-ECKZNDSU.mjs.map +0 -7
- package/dist/lib/browser/repair-3MZXLUHO.mjs.map +0 -7
- package/dist/lib/browser/settings-HD5WA24I.mjs +0 -23
- package/dist/lib/browser/settings-HD5WA24I.mjs.map +0 -7
- package/dist/lib/browser/state-GG7Z3NB7.mjs +0 -25
- package/dist/lib/browser/state-GG7Z3NB7.mjs.map +0 -7
- package/dist/lib/browser/toolkit-VYDAWNE4.mjs +0 -17
- package/dist/lib/browser/toolkit-VYDAWNE4.mjs.map +0 -7
- package/dist/lib/node-esm/BlueprintArticle-R2XYBRCK.mjs +0 -37
- package/dist/lib/node-esm/BlueprintArticle-R2XYBRCK.mjs.map +0 -7
- package/dist/lib/node-esm/ChatCompanion-IUMU7WRQ.mjs +0 -159
- package/dist/lib/node-esm/ChatCompanion-IUMU7WRQ.mjs.map +0 -7
- package/dist/lib/node-esm/ChatContainer-CTUNUEU3.mjs +0 -78
- package/dist/lib/node-esm/ChatContainer-CTUNUEU3.mjs.map +0 -7
- package/dist/lib/node-esm/ChatDialog-X42ASXQD.mjs +0 -91
- package/dist/lib/node-esm/ChatDialog-X42ASXQD.mjs.map +0 -7
- package/dist/lib/node-esm/PromptArticle-IV7O5UZ3.mjs +0 -60
- package/dist/lib/node-esm/PromptArticle-IV7O5UZ3.mjs.map +0 -7
- package/dist/lib/node-esm/ai-service-MUYLV3NT.mjs +0 -20
- package/dist/lib/node-esm/ai-service-MUYLV3NT.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-6XUAGTRS.mjs +0 -200
- package/dist/lib/node-esm/app-graph-builder-6XUAGTRS.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-25GMMNY5.mjs +0 -178
- package/dist/lib/node-esm/chunk-25GMMNY5.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-3Q22TTXW.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-CKW4IYLY.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-E4JSYCWZ.mjs +0 -230
- package/dist/lib/node-esm/chunk-E4JSYCWZ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-WE6KTH72.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-YWFWT57N.mjs +0 -17
- package/dist/lib/node-esm/chunk-YWFWT57N.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-Z37USO4K.mjs +0 -1930
- package/dist/lib/node-esm/chunk-Z37USO4K.mjs.map +0 -7
- package/dist/lib/node-esm/edge-model-resolver-2ARXDOYS.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-4SRYLDK5.mjs +0 -144
- package/dist/lib/node-esm/intent-resolver-4SRYLDK5.mjs.map +0 -7
- package/dist/lib/node-esm/local-model-resolver-TP2NTSAX.mjs +0 -18
- package/dist/lib/node-esm/local-model-resolver-TP2NTSAX.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-NLIG5VAI.mjs.map +0 -7
- package/dist/lib/node-esm/repair-RER5H7Y6.mjs.map +0 -7
- package/dist/lib/node-esm/settings-YJQVKHH5.mjs +0 -24
- package/dist/lib/node-esm/settings-YJQVKHH5.mjs.map +0 -7
- package/dist/lib/node-esm/state-FSUHFMDM.mjs +0 -26
- package/dist/lib/node-esm/state-FSUHFMDM.mjs.map +0 -7
- package/dist/lib/node-esm/toolkit-HFJZLVIR.mjs +0 -18
- package/dist/lib/node-esm/toolkit-HFJZLVIR.mjs.map +0 -7
- package/dist/types/src/capabilities/ai-service.d.ts +0 -4
- package/dist/types/src/capabilities/ai-service.d.ts.map +0 -1
- 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/blueprint-definition.d.ts +0 -7
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +0 -1
- package/dist/types/src/capabilities/capabilities.d.ts +0 -10
- package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
- package/dist/types/src/capabilities/edge-model-resolver.d.ts +0 -4
- package/dist/types/src/capabilities/edge-model-resolver.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/local-model-resolver.d.ts +0 -10
- package/dist/types/src/capabilities/local-model-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/repair.d.ts +0 -4
- package/dist/types/src/capabilities/repair.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/capabilities/state.d.ts +0 -4
- package/dist/types/src/capabilities/state.d.ts.map +0 -1
- package/dist/types/src/capabilities/toolkit.d.ts +0 -4
- package/dist/types/src/capabilities/toolkit.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/functions/analysis.d.ts +0 -5
- package/dist/types/src/functions/analysis.d.ts.map +0 -1
- package/src/capabilities/ai-service.ts +0 -27
- package/src/capabilities/app-graph-builder.ts +0 -210
- package/src/capabilities/blueprint-definition.ts +0 -66
- package/src/capabilities/capabilities.ts +0 -17
- package/src/capabilities/edge-model-resolver.ts +0 -25
- package/src/capabilities/intent-resolver.ts +0 -135
- package/src/capabilities/local-model-resolver.ts +0 -30
- package/src/capabilities/react-surface.tsx +0 -87
- package/src/capabilities/settings.ts +0 -19
- package/src/capabilities/state.ts +0 -22
- package/src/capabilities/toolkit.ts +0 -17
- package/src/events.ts +0 -11
- package/src/functions/analysis.ts +0 -22
- /package/dist/lib/browser/{blueprint-definition-VBEOXNBS.mjs.map → blueprint-definition-DGHH7MUU.mjs.map} +0 -0
- /package/dist/lib/{node-esm/blueprint-definition-RDCLLIQH.mjs.map → browser/blueprints/index.mjs.map} +0 -0
|
@@ -8,7 +8,9 @@ import * as Fiber from 'effect/Fiber';
|
|
|
8
8
|
import * as Layer from 'effect/Layer';
|
|
9
9
|
import React, { type CSSProperties, useEffect, useMemo, useState } from 'react';
|
|
10
10
|
|
|
11
|
-
import {
|
|
11
|
+
import { Database } from '@dxos/echo';
|
|
12
|
+
import { runAndForwardErrors } from '@dxos/effect';
|
|
13
|
+
import { ContextQueueService } from '@dxos/functions';
|
|
12
14
|
import { faker } from '@dxos/random';
|
|
13
15
|
import { useQueue, useSpace } from '@dxos/react-client/echo';
|
|
14
16
|
import { withClientProvider } from '@dxos/react-client/testing';
|
|
@@ -16,7 +18,7 @@ import { Popover } from '@dxos/react-ui';
|
|
|
16
18
|
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
17
19
|
import { MarkdownStream } from '@dxos/react-ui-components';
|
|
18
20
|
import { EditorPreviewProvider, useEditorPreview } from '@dxos/react-ui-editor';
|
|
19
|
-
import { Card } from '@dxos/react-ui-
|
|
21
|
+
import { Card } from '@dxos/react-ui-mosaic';
|
|
20
22
|
import { render } from '@dxos/storybook-utils';
|
|
21
23
|
import { type Message, Organization, Person } from '@dxos/types';
|
|
22
24
|
|
|
@@ -29,7 +31,7 @@ import TEXT from './testing/thread.md?raw';
|
|
|
29
31
|
|
|
30
32
|
faker.seed(1);
|
|
31
33
|
|
|
32
|
-
type MessageGenerator = Effect.Effect<void, never,
|
|
34
|
+
type MessageGenerator = Effect.Effect<void, never, Database.Service | ContextQueueService>;
|
|
33
35
|
|
|
34
36
|
type StoryProps = { generator?: MessageGenerator[]; delay?: number; wait?: boolean } & ChatThreadProps;
|
|
35
37
|
|
|
@@ -54,11 +56,11 @@ const DefaultStory = ({ generator = [], delay = 0, wait, ...props }: StoryProps)
|
|
|
54
56
|
}
|
|
55
57
|
}
|
|
56
58
|
setDone(true);
|
|
57
|
-
}).pipe(Effect.provide(Layer.mergeAll(
|
|
59
|
+
}).pipe(Effect.provide(Layer.mergeAll(Database.Service.layer(space.db), ContextQueueService.layer(queue)))),
|
|
58
60
|
);
|
|
59
61
|
|
|
60
62
|
return () => {
|
|
61
|
-
void
|
|
63
|
+
void runAndForwardErrors(Fiber.interrupt(fiber));
|
|
62
64
|
};
|
|
63
65
|
}, [space, queue, generator]);
|
|
64
66
|
|
|
@@ -81,10 +83,10 @@ const PreviewCard = () => {
|
|
|
81
83
|
<Popover.Portal>
|
|
82
84
|
<Popover.Content onOpenAutoFocus={(event) => event.preventDefault()}>
|
|
83
85
|
<Popover.Viewport>
|
|
84
|
-
<Card.
|
|
86
|
+
<Card.Root>
|
|
85
87
|
<Card.Heading>{target?.label}</Card.Heading>
|
|
86
88
|
{target && <Card.Text classNames='truncate line-clamp-3'>{target.text}</Card.Text>}
|
|
87
|
-
</Card.
|
|
89
|
+
</Card.Root>
|
|
88
90
|
</Popover.Viewport>
|
|
89
91
|
<Popover.Arrow />
|
|
90
92
|
</Popover.Content>
|
|
@@ -98,7 +100,7 @@ const meta = {
|
|
|
98
100
|
render: render(DefaultStory),
|
|
99
101
|
decorators: [
|
|
100
102
|
withTheme,
|
|
101
|
-
withLayout({
|
|
103
|
+
withLayout({ layout: 'column' }),
|
|
102
104
|
withClientProvider({
|
|
103
105
|
createIdentity: true,
|
|
104
106
|
createSpace: true,
|
|
@@ -8,8 +8,8 @@ import { PublicKey } from '@dxos/keys';
|
|
|
8
8
|
import { type Identity } from '@dxos/react-client/halo';
|
|
9
9
|
import { type ThemedClassName, useForwardedRef } from '@dxos/react-ui';
|
|
10
10
|
import { MarkdownStream, type MarkdownStreamController, type MarkdownStreamProps } from '@dxos/react-ui-components';
|
|
11
|
-
import { mx } from '@dxos/react-ui-theme';
|
|
12
11
|
import { type Message } from '@dxos/types';
|
|
12
|
+
import { mx } from '@dxos/ui-theme';
|
|
13
13
|
import { keyToFallback } from '@dxos/util';
|
|
14
14
|
|
|
15
15
|
import { type ChatEvent } from '../Chat';
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import React, { useMemo } from 'react';
|
|
6
6
|
|
|
7
7
|
import { type Space } from '@dxos/client/echo';
|
|
8
|
-
import {
|
|
8
|
+
import { Entity } from '@dxos/echo';
|
|
9
9
|
import { type DXN } from '@dxos/keys';
|
|
10
10
|
import { DxAnchor } from '@dxos/lit-ui/react';
|
|
11
11
|
|
|
@@ -17,7 +17,7 @@ export type ObjectLinkProps = {
|
|
|
17
17
|
export const ObjectLink = ({ space, dxn }: ObjectLinkProps) => {
|
|
18
18
|
const ref = useMemo(() => space.db.makeRef(dxn), [space, dxn.toString()]);
|
|
19
19
|
|
|
20
|
-
const title = (ref.target &&
|
|
20
|
+
const title = (ref.target && Entity.getLabel(ref.target)) ?? ref.target?.id ?? ref.dxn.toString();
|
|
21
21
|
return (
|
|
22
22
|
<DxAnchor rootclassname='dx-tag--anchor' refid={dxn.toString()}>
|
|
23
23
|
{title}
|
|
@@ -5,17 +5,17 @@
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
7
|
import { log } from '@dxos/log';
|
|
8
|
+
import { ToggleContainer } from '@dxos/react-ui-components';
|
|
8
9
|
import {
|
|
9
10
|
PromptWidget,
|
|
10
11
|
ReferenceWidget,
|
|
11
12
|
SelectWidget,
|
|
12
13
|
SuggestionWidget,
|
|
13
14
|
SummaryWidget,
|
|
14
|
-
ToggleContainer,
|
|
15
15
|
} from '@dxos/react-ui-components';
|
|
16
|
-
import { type XmlWidgetProps, type XmlWidgetRegistry, getXmlTextChild } from '@dxos/react-ui-editor';
|
|
17
16
|
import { Json } from '@dxos/react-ui-syntax-highlighter';
|
|
18
17
|
import { ContentBlock, type Message } from '@dxos/types';
|
|
18
|
+
import { type XmlWidgetProps, type XmlWidgetRegistry, getXmlTextChild } from '@dxos/ui-editor';
|
|
19
19
|
|
|
20
20
|
import { ToolBlock } from '../ToolBlock';
|
|
21
21
|
|
|
@@ -6,6 +6,7 @@ import { EditorView } from '@codemirror/view';
|
|
|
6
6
|
import { describe, it } from '@effect/vitest';
|
|
7
7
|
import * as Effect from 'effect/Effect';
|
|
8
8
|
|
|
9
|
+
import { Obj } from '@dxos/echo';
|
|
9
10
|
import { type ContentBlock } from '@dxos/types';
|
|
10
11
|
|
|
11
12
|
import { createMessage } from '../../testing';
|
|
@@ -54,7 +55,9 @@ describe('reducers', () => {
|
|
|
54
55
|
syncer.append(messages);
|
|
55
56
|
expect(doc.content).toEqual(['<prompt>Hello</prompt>', 'Hi there!', ''].join('\n'));
|
|
56
57
|
|
|
57
|
-
messages[1]
|
|
58
|
+
Obj.change(messages[1], (m) => {
|
|
59
|
+
m.blocks.push({ _tag: 'text', text: 'How can I help?' });
|
|
60
|
+
});
|
|
58
61
|
syncer.append(messages);
|
|
59
62
|
expect(doc.content).toEqual(['<prompt>Hello</prompt>', 'Hi there!', 'How can I help?', ''].join('\n'));
|
|
60
63
|
}),
|
|
@@ -74,12 +77,16 @@ describe('reducers', () => {
|
|
|
74
77
|
syncer.append(messages);
|
|
75
78
|
expect(doc.content).toEqual(['<prompt>Hello</prompt>', 'Hi there!'].join('\n'));
|
|
76
79
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
+
Obj.change(messages[1], (m) => {
|
|
81
|
+
const block = m.blocks[0] as ContentBlock.Text;
|
|
82
|
+
block.text = 'Hi there! How are you?';
|
|
83
|
+
block.pending = false;
|
|
84
|
+
});
|
|
80
85
|
syncer.append(messages);
|
|
81
86
|
|
|
82
|
-
messages[1]
|
|
87
|
+
Obj.change(messages[1], (m) => {
|
|
88
|
+
m.blocks.push({ _tag: 'text', text: 'How can I help?' });
|
|
89
|
+
});
|
|
83
90
|
syncer.append(messages);
|
|
84
91
|
expect(doc.content).toEqual(
|
|
85
92
|
['<prompt>Hello</prompt>', 'Hi there! How are you?', 'How can I help?', ''].join('\n'),
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
import { type DXN } from '@dxos/echo';
|
|
6
6
|
import { log } from '@dxos/log';
|
|
7
7
|
import { type MarkdownStreamController } from '@dxos/react-ui-components';
|
|
8
|
-
import { type StateDispatch, type XmlWidgetStateManager } from '@dxos/react-ui-editor';
|
|
9
8
|
import { type ContentBlock, type Message } from '@dxos/types';
|
|
9
|
+
import { type StateDispatch, type XmlWidgetStateManager } from '@dxos/ui-editor';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Update document.
|
|
@@ -87,7 +87,13 @@ export class MessageSyncer {
|
|
|
87
87
|
|
|
88
88
|
const content = buffer.join('');
|
|
89
89
|
this._model.view?.dispatch({
|
|
90
|
-
changes: [
|
|
90
|
+
changes: [
|
|
91
|
+
{
|
|
92
|
+
from: 0,
|
|
93
|
+
to: this._model.view?.state.doc.length ?? 0,
|
|
94
|
+
insert: content,
|
|
95
|
+
},
|
|
96
|
+
],
|
|
91
97
|
selection: { anchor: content.length },
|
|
92
98
|
});
|
|
93
99
|
|
|
@@ -9,10 +9,9 @@ import { Agent } from '@dxos/assistant-toolkit';
|
|
|
9
9
|
import { type Prompt } from '@dxos/blueprints';
|
|
10
10
|
import { Obj } from '@dxos/echo';
|
|
11
11
|
import { invokeFunctionWithTracing, useComputeRuntimeCallback } from '@dxos/plugin-automation';
|
|
12
|
-
import { getSpace } from '@dxos/react-client/echo';
|
|
13
12
|
import { Toolbar, useTranslation } from '@dxos/react-ui';
|
|
14
13
|
import { useAttention } from '@dxos/react-ui-attention';
|
|
15
|
-
import {
|
|
14
|
+
import { Layout } from '@dxos/react-ui-mosaic';
|
|
16
15
|
|
|
17
16
|
import { meta } from '../meta';
|
|
18
17
|
|
|
@@ -20,31 +19,31 @@ import { TemplateEditor } from './TemplateEditor';
|
|
|
20
19
|
|
|
21
20
|
export type PromptArticleProps = SurfaceComponentProps<Prompt.Prompt>;
|
|
22
21
|
|
|
23
|
-
export const PromptArticle = ({ subject }: PromptArticleProps) => {
|
|
22
|
+
export const PromptArticle = ({ role, subject }: PromptArticleProps) => {
|
|
24
23
|
const { t } = useTranslation(meta.id);
|
|
25
|
-
const
|
|
24
|
+
const db = Obj.getDatabase(subject);
|
|
26
25
|
const { hasAttention } = useAttention(Obj.getDXN(subject).toString());
|
|
27
26
|
|
|
28
27
|
const inputData = useMemo(
|
|
29
28
|
() =>
|
|
30
29
|
subject && {
|
|
31
|
-
prompt:
|
|
30
|
+
prompt: db?.makeRef(Obj.getDXN(subject)),
|
|
32
31
|
input: {},
|
|
33
32
|
},
|
|
34
|
-
[subject,
|
|
33
|
+
[subject, db],
|
|
35
34
|
);
|
|
36
35
|
|
|
37
|
-
const handleRun = useComputeRuntimeCallback(
|
|
36
|
+
const handleRun = useComputeRuntimeCallback(db?.spaceId, () => invokeFunctionWithTracing(Agent.prompt, inputData), [
|
|
38
37
|
inputData,
|
|
39
38
|
]);
|
|
40
39
|
|
|
41
40
|
return (
|
|
42
|
-
<
|
|
41
|
+
<Layout.Main role={role} toolbar>
|
|
43
42
|
<Toolbar.Root disabled={!hasAttention} onClick={handleRun}>
|
|
44
43
|
<Toolbar.IconButton iconOnly icon='ph--play--regular' label={t('run prompt label')} onClick={handleRun} />
|
|
45
44
|
</Toolbar.Root>
|
|
46
45
|
<TemplateEditor id={subject.id} template={subject.instructions} classNames='container-max-width' />
|
|
47
|
-
</
|
|
46
|
+
</Layout.Main>
|
|
48
47
|
);
|
|
49
48
|
};
|
|
50
49
|
|
|
@@ -57,7 +57,7 @@ const DefaultStory = ({ source }: TemplateEditorProps & { source: string }) => {
|
|
|
57
57
|
|
|
58
58
|
return (
|
|
59
59
|
<TemplateEditor
|
|
60
|
-
classNames='bg-baseSurface
|
|
60
|
+
classNames='bg-baseSurface is-full max-is-proseMaxWidth'
|
|
61
61
|
id={blueprint.id}
|
|
62
62
|
template={blueprint.instructions}
|
|
63
63
|
/>
|
|
@@ -70,7 +70,7 @@ const meta = {
|
|
|
70
70
|
render: DefaultStory,
|
|
71
71
|
decorators: [
|
|
72
72
|
withTheme,
|
|
73
|
-
withLayout({
|
|
73
|
+
withLayout({ layout: 'column' }),
|
|
74
74
|
withClientProvider({
|
|
75
75
|
types: [Blueprint.Blueprint],
|
|
76
76
|
createIdentity: true,
|
|
@@ -8,15 +8,15 @@ import React from 'react';
|
|
|
8
8
|
import { type Template } from '@dxos/blueprints';
|
|
9
9
|
import { createDocAccessor } from '@dxos/echo-db';
|
|
10
10
|
import { type ThemedClassName, useThemeContext, useTranslation } from '@dxos/react-ui';
|
|
11
|
+
import { useTextEditor } from '@dxos/react-ui-editor';
|
|
11
12
|
import {
|
|
12
13
|
createBasicExtensions,
|
|
13
14
|
createDataExtensions,
|
|
14
15
|
createMarkdownExtensions,
|
|
15
16
|
createThemeExtensions,
|
|
16
17
|
decorateMarkdown,
|
|
17
|
-
|
|
18
|
-
} from '@dxos/
|
|
19
|
-
import { mx } from '@dxos/react-ui-theme';
|
|
18
|
+
} from '@dxos/ui-editor';
|
|
19
|
+
import { mx } from '@dxos/ui-theme';
|
|
20
20
|
import { isNonNullable } from '@dxos/util';
|
|
21
21
|
|
|
22
22
|
import { meta } from '../../meta';
|
|
@@ -51,7 +51,10 @@ export const TemplateEditor = ({ id, classNames, template, lineNumbers = true }:
|
|
|
51
51
|
lineWrapping: true,
|
|
52
52
|
placeholder: t('template placeholder'),
|
|
53
53
|
}),
|
|
54
|
-
createThemeExtensions({
|
|
54
|
+
createThemeExtensions({
|
|
55
|
+
themeMode,
|
|
56
|
+
slots: { content: { className: '!pie-4' } },
|
|
57
|
+
}),
|
|
55
58
|
createMarkdownExtensions(),
|
|
56
59
|
decorateMarkdown(),
|
|
57
60
|
handlebars(),
|
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { type Meta } from '@storybook/react-vite';
|
|
6
|
-
import React, { useState } from 'react';
|
|
6
|
+
import React, { useCallback, useState } from 'react';
|
|
7
7
|
|
|
8
8
|
import { Blueprint, Template } from '@dxos/blueprints';
|
|
9
|
+
import { Obj } from '@dxos/echo';
|
|
9
10
|
import { useClient } from '@dxos/react-client';
|
|
10
11
|
import { withClientProvider } from '@dxos/react-client/testing';
|
|
11
12
|
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
@@ -13,15 +14,15 @@ import { trim } from '@dxos/util';
|
|
|
13
14
|
|
|
14
15
|
import { translations } from '../../translations';
|
|
15
16
|
|
|
16
|
-
import { TemplateForm } from './TemplateForm';
|
|
17
|
+
import { type TemplateChangeCallback, TemplateForm } from './TemplateForm';
|
|
17
18
|
|
|
18
19
|
const TEMPLATE = trim`
|
|
19
20
|
You are a machine that is an expert chess player.
|
|
20
21
|
The move history of the current game is: {{history}}
|
|
21
22
|
If asked to suggest a move explain why it is a good move.
|
|
22
|
-
|
|
23
|
+
|
|
23
24
|
---
|
|
24
|
-
|
|
25
|
+
|
|
25
26
|
{{input}},
|
|
26
27
|
`;
|
|
27
28
|
|
|
@@ -38,9 +39,16 @@ const DefaultStory = () => {
|
|
|
38
39
|
);
|
|
39
40
|
});
|
|
40
41
|
|
|
42
|
+
const handleChange: TemplateChangeCallback = useCallback(
|
|
43
|
+
(mutate) => {
|
|
44
|
+
Obj.change(blueprint, (b) => mutate(b.instructions));
|
|
45
|
+
},
|
|
46
|
+
[blueprint],
|
|
47
|
+
);
|
|
48
|
+
|
|
41
49
|
return (
|
|
42
50
|
<div role='none' className='flex is-[40rem] border border-separator overflow-hidden'>
|
|
43
|
-
<TemplateForm id={blueprint.id} template={blueprint.instructions} />
|
|
51
|
+
<TemplateForm id={blueprint.id} template={blueprint.instructions} onChange={handleChange} />
|
|
44
52
|
</div>
|
|
45
53
|
);
|
|
46
54
|
};
|
|
@@ -51,7 +59,7 @@ const meta = {
|
|
|
51
59
|
render: DefaultStory,
|
|
52
60
|
decorators: [
|
|
53
61
|
withTheme,
|
|
54
|
-
withLayout({
|
|
62
|
+
withLayout({ layout: 'column' }),
|
|
55
63
|
withClientProvider({
|
|
56
64
|
types: [Blueprint.Blueprint],
|
|
57
65
|
createIdentity: true,
|
|
@@ -3,27 +3,62 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import type * as Schema from 'effect/Schema';
|
|
6
|
-
import React, { Fragment, useEffect } from 'react';
|
|
6
|
+
import React, { Fragment, useCallback, useEffect } from 'react';
|
|
7
7
|
|
|
8
8
|
import { type Template } from '@dxos/blueprints';
|
|
9
|
+
import { type Obj } from '@dxos/echo';
|
|
9
10
|
import { Input, Select, useTranslation } from '@dxos/react-ui';
|
|
10
|
-
import { attentionSurface, groupBorder, mx } from '@dxos/
|
|
11
|
+
import { attentionSurface, groupBorder, mx } from '@dxos/ui-theme';
|
|
11
12
|
import { isNonNullable } from '@dxos/util';
|
|
12
13
|
|
|
13
14
|
import { meta } from '../../meta';
|
|
14
15
|
|
|
15
16
|
import { TemplateEditor } from './TemplateEditor';
|
|
16
17
|
|
|
18
|
+
/**
|
|
19
|
+
* Callback type for mutating template within a parent object's Obj.change context.
|
|
20
|
+
*/
|
|
21
|
+
export type TemplateChangeCallback = (mutate: (template: Obj.Mutable<Template.Template>) => void) => void;
|
|
22
|
+
|
|
17
23
|
export type TemplateFormProps = {
|
|
18
24
|
id: string;
|
|
19
25
|
template: Template.Template;
|
|
20
26
|
schema?: Schema.Schema<any, any, any>;
|
|
21
27
|
commandEditable?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Callback to mutate the template. Should wrap mutations in parent's Obj.change.
|
|
30
|
+
* If not provided, the component is read-only.
|
|
31
|
+
*/
|
|
32
|
+
onChange?: TemplateChangeCallback;
|
|
22
33
|
};
|
|
23
34
|
|
|
24
|
-
export const TemplateForm = ({ id, template, commandEditable = true }: TemplateFormProps) => {
|
|
35
|
+
export const TemplateForm = ({ id, template, commandEditable = true, onChange }: TemplateFormProps) => {
|
|
25
36
|
const { t } = useTranslation(meta.id);
|
|
26
|
-
usePromptInputs(template);
|
|
37
|
+
usePromptInputs(template, onChange);
|
|
38
|
+
|
|
39
|
+
const handleInputKindChange = useCallback(
|
|
40
|
+
(inputName: string, kind: Template.InputKind) => {
|
|
41
|
+
onChange?.((t) => {
|
|
42
|
+
const input = t.inputs?.find((i) => i?.name === inputName);
|
|
43
|
+
if (input) {
|
|
44
|
+
input.kind = kind;
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
},
|
|
48
|
+
[onChange],
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
const handleInputDefaultChange = useCallback(
|
|
52
|
+
(inputName: string, value: string) => {
|
|
53
|
+
onChange?.((t) => {
|
|
54
|
+
const input = t.inputs?.find((i) => i?.name === inputName);
|
|
55
|
+
if (input) {
|
|
56
|
+
input.default = value;
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
},
|
|
60
|
+
[onChange],
|
|
61
|
+
);
|
|
27
62
|
|
|
28
63
|
return (
|
|
29
64
|
<div className={mx('flex flex-col is-full overflow-hidden gap-4', groupBorder)}>
|
|
@@ -36,7 +71,9 @@ export const TemplateForm = ({ id, template, commandEditable = true }: TemplateF
|
|
|
36
71
|
classNames='is-full bg-transparent m-2'
|
|
37
72
|
value={template.command ?? ''}
|
|
38
73
|
onChange={(event) => {
|
|
39
|
-
|
|
74
|
+
onChange?.((t) => {
|
|
75
|
+
t.command = event.target.value.replace(/\w/g, '');
|
|
76
|
+
});
|
|
40
77
|
}}
|
|
41
78
|
/>
|
|
42
79
|
</Input.Root>
|
|
@@ -54,9 +91,7 @@ export const TemplateForm = ({ id, template, commandEditable = true }: TemplateF
|
|
|
54
91
|
<Input.Root>
|
|
55
92
|
<Select.Root
|
|
56
93
|
value={input.kind}
|
|
57
|
-
onValueChange={(kind) =>
|
|
58
|
-
input.kind = kind as Template.InputKind;
|
|
59
|
-
}}
|
|
94
|
+
onValueChange={(kind) => handleInputKindChange(input.name, kind as Template.InputKind)}
|
|
60
95
|
>
|
|
61
96
|
<Select.TriggerButton placeholder='Type' classNames='is-full' />
|
|
62
97
|
<Select.Portal>
|
|
@@ -82,9 +117,7 @@ export const TemplateForm = ({ id, template, commandEditable = true }: TemplateF
|
|
|
82
117
|
placeholder={t('command placeholder')}
|
|
83
118
|
classNames='is-full bg-transparent'
|
|
84
119
|
value={input.default ?? ''}
|
|
85
|
-
onChange={(event) =>
|
|
86
|
-
input.default = event.target.value;
|
|
87
|
-
}}
|
|
120
|
+
onChange={(event) => handleInputDefaultChange(input.name, event.target.value)}
|
|
88
121
|
/>
|
|
89
122
|
</Input.Root>
|
|
90
123
|
</div>
|
|
@@ -136,13 +169,14 @@ const inputs: { kind: Template.InputKind; label: string }[] = [
|
|
|
136
169
|
|
|
137
170
|
export const NAME_REGEXP = /\{\{([\w-]+)\}\}/;
|
|
138
171
|
|
|
139
|
-
const usePromptInputs = (template: Template.Template) => {
|
|
172
|
+
const usePromptInputs = (template: Template.Template, onChange?: TemplateChangeCallback) => {
|
|
140
173
|
useEffect(() => {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
template.inputs = []; // TODO(burdon): Required?
|
|
174
|
+
if (!onChange) {
|
|
175
|
+
return;
|
|
144
176
|
}
|
|
145
177
|
|
|
178
|
+
const text = template.source ?? '';
|
|
179
|
+
|
|
146
180
|
const regex = new RegExp(NAME_REGEXP, 'g');
|
|
147
181
|
const variables = new Set<string>([...(text.target?.content.matchAll(regex) ?? [])].map((m) => m[1]));
|
|
148
182
|
|
|
@@ -161,19 +195,32 @@ const usePromptInputs = (template: Template.Template) => {
|
|
|
161
195
|
|
|
162
196
|
// Match or create new inputs.
|
|
163
197
|
const values = unclaimed.values();
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
next.name = name;
|
|
168
|
-
} else {
|
|
169
|
-
template.inputs?.push({ name });
|
|
198
|
+
onChange((t) => {
|
|
199
|
+
if (!t.inputs) {
|
|
200
|
+
t.inputs = [];
|
|
170
201
|
}
|
|
171
|
-
});
|
|
172
202
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
203
|
+
missing.forEach((name) => {
|
|
204
|
+
const next = values.next().value;
|
|
205
|
+
if (next) {
|
|
206
|
+
// Find the input in the mutable draft and update it.
|
|
207
|
+
const inputIndex = t.inputs!.findIndex((i) => i?.name === next.name);
|
|
208
|
+
if (inputIndex !== -1) {
|
|
209
|
+
t.inputs![inputIndex].name = name;
|
|
210
|
+
}
|
|
211
|
+
} else {
|
|
212
|
+
t.inputs!.push({ name });
|
|
213
|
+
}
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
// Remove unclaimed (deleted) inputs.
|
|
217
|
+
// TODO(burdon): If user types incorrect name value, it will be deleted. Garbage collect?
|
|
218
|
+
for (const input of values) {
|
|
219
|
+
const inputIndex = t.inputs!.findIndex((i) => i?.name === input.name);
|
|
220
|
+
if (inputIndex !== -1) {
|
|
221
|
+
t.inputs!.splice(inputIndex, 1);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
}, [template.source, onChange]);
|
|
179
226
|
};
|
|
@@ -19,8 +19,7 @@ import {
|
|
|
19
19
|
keymap,
|
|
20
20
|
} from '@codemirror/view';
|
|
21
21
|
|
|
22
|
-
import { Domino } from '@dxos/
|
|
23
|
-
import { mx } from '@dxos/react-ui-theme';
|
|
22
|
+
import { Domino, mx } from '@dxos/ui';
|
|
24
23
|
|
|
25
24
|
export type HandlebarsOptions = {};
|
|
26
25
|
|
|
@@ -87,7 +86,11 @@ const handlebarsHighlightPlugin = ViewPlugin.fromClass(
|
|
|
87
86
|
// NOTE: Decorations may clash with other extensions (e.g., markdown).
|
|
88
87
|
buildDecorations(view: EditorView) {
|
|
89
88
|
const selection = view.state.selection.main;
|
|
90
|
-
const decorations: Array<{
|
|
89
|
+
const decorations: Array<{
|
|
90
|
+
from: number;
|
|
91
|
+
to: number;
|
|
92
|
+
decoration: Decoration;
|
|
93
|
+
}> = [];
|
|
91
94
|
|
|
92
95
|
for (const { from, to } of view.visibleRanges) {
|
|
93
96
|
const text = view.state.doc.sliceString(from, to);
|
|
@@ -121,7 +124,9 @@ const handlebarsHighlightPlugin = ViewPlugin.fromClass(
|
|
|
121
124
|
decorations.push({
|
|
122
125
|
from: start,
|
|
123
126
|
to: end,
|
|
124
|
-
decoration: Decoration.mark({
|
|
127
|
+
decoration: Decoration.mark({
|
|
128
|
+
class: mx('dx-tag--blue', tagPadding),
|
|
129
|
+
}),
|
|
125
130
|
});
|
|
126
131
|
}
|
|
127
132
|
}
|
|
@@ -222,7 +227,7 @@ class DXNWidget extends WidgetType {
|
|
|
222
227
|
return part;
|
|
223
228
|
})
|
|
224
229
|
.join(':');
|
|
225
|
-
return Domino.of('span').classNames(
|
|
230
|
+
return Domino.of('span').classNames(mx('font-mono dx-tag--blue', tagPadding)).text(text).root;
|
|
226
231
|
}
|
|
227
232
|
}
|
|
228
233
|
|
|
@@ -7,9 +7,9 @@ import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
|
|
|
7
7
|
|
|
8
8
|
import { useTranslation } from '@dxos/react-ui';
|
|
9
9
|
import { NumericTabs, TextCrawl, ToggleContainer, type ToggleContainerRootProps } from '@dxos/react-ui-components';
|
|
10
|
-
import { type XmlWidgetProps } from '@dxos/react-ui-editor';
|
|
11
10
|
import { Json } from '@dxos/react-ui-syntax-highlighter';
|
|
12
11
|
import { type ContentBlock, type Message } from '@dxos/types';
|
|
12
|
+
import { type XmlWidgetProps } from '@dxos/ui-editor';
|
|
13
13
|
import { isNonNullable, safeParseJson } from '@dxos/util';
|
|
14
14
|
|
|
15
15
|
import { meta } from '../../meta';
|
|
@@ -25,7 +25,7 @@ export type ToolBlockProps = XmlWidgetProps<{
|
|
|
25
25
|
export const ToolBlock = ({ view, blocks = [] }: ToolBlockProps) => {
|
|
26
26
|
const { t } = useTranslation(meta.id);
|
|
27
27
|
|
|
28
|
-
const items = useMemo<
|
|
28
|
+
const items = useMemo<ToolContainerProps['items']>(() => {
|
|
29
29
|
let lastToolCall: { tool: Tool.Any | undefined; block: ContentBlock.ToolCall } | undefined;
|
|
30
30
|
// TODO(burdon): Get from context?
|
|
31
31
|
const tools: Tool.Any[] = []; //processor.conversation.toolkit?.tools ?? [];
|
|
@@ -101,11 +101,11 @@ export const ToolBlock = ({ view, blocks = [] }: ToolBlockProps) => {
|
|
|
101
101
|
|
|
102
102
|
ToolBlock.displayName = 'ToolBlock';
|
|
103
103
|
|
|
104
|
-
type
|
|
104
|
+
type ToolContainerProps = {
|
|
105
105
|
items: { title: string; content: any }[];
|
|
106
106
|
} & Pick<ToggleContainerRootProps, 'onChangeOpen'>;
|
|
107
107
|
|
|
108
|
-
export const ToolContainer = ({ items, onChangeOpen }:
|
|
108
|
+
export const ToolContainer = ({ items, onChangeOpen }: ToolContainerProps) => {
|
|
109
109
|
const tabsRef = useRef<HTMLDivElement>(null);
|
|
110
110
|
const [selected, setSelected] = useState(0);
|
|
111
111
|
const [open, setOpen] = useState(false);
|
|
@@ -117,9 +117,9 @@ export const ToolContainer = ({ items, onChangeOpen }: ToolContainerParams) => {
|
|
|
117
117
|
}
|
|
118
118
|
}, [open, onChangeOpen]);
|
|
119
119
|
|
|
120
|
-
const handleSelect = (index: number) => {
|
|
120
|
+
const handleSelect = useCallback((index: number) => {
|
|
121
121
|
setSelected(index);
|
|
122
|
-
};
|
|
122
|
+
}, []);
|
|
123
123
|
|
|
124
124
|
return (
|
|
125
125
|
<ToggleContainer.Root classNames='mbs-2 is-full rounded-sm' open={open} onChangeOpen={setOpen}>
|
|
@@ -3,16 +3,16 @@
|
|
|
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
|
-
import { IntentPlugin, SettingsPlugin } from '@dxos/app-framework';
|
|
9
9
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
10
|
-
import { capabilities } from '@dxos/assistant-toolkit';
|
|
10
|
+
import { capabilities } from '@dxos/assistant-toolkit/testing';
|
|
11
11
|
import { ChessPlugin } from '@dxos/plugin-chess';
|
|
12
12
|
import { ClientPlugin } from '@dxos/plugin-client';
|
|
13
13
|
import { MapPlugin } from '@dxos/plugin-map';
|
|
14
|
-
import { SpacePlugin } from '@dxos/plugin-space';
|
|
15
14
|
import { TablePlugin } from '@dxos/plugin-table';
|
|
15
|
+
import { corePlugins } from '@dxos/plugin-testing';
|
|
16
16
|
import { withTheme } from '@dxos/react-ui/testing';
|
|
17
17
|
|
|
18
18
|
import { translations } from '../../translations';
|
|
@@ -31,14 +31,13 @@ const meta = {
|
|
|
31
31
|
withTheme,
|
|
32
32
|
withPluginManager({
|
|
33
33
|
plugins: [
|
|
34
|
+
...corePlugins(),
|
|
34
35
|
ClientPlugin({
|
|
35
|
-
onClientInitialized:
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
onClientInitialized: ({ client }) =>
|
|
37
|
+
Effect.gen(function* () {
|
|
38
|
+
yield* Effect.promise(() => client.halo.createIdentity());
|
|
39
|
+
}),
|
|
38
40
|
}),
|
|
39
|
-
SpacePlugin({}),
|
|
40
|
-
SettingsPlugin(),
|
|
41
|
-
IntentPlugin(),
|
|
42
41
|
ChessPlugin(),
|
|
43
42
|
MapPlugin(),
|
|
44
43
|
TablePlugin(),
|