@dxos/plugin-assistant 0.8.4-main.69d29f4 → 0.8.4-main.6fa680abb7
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/AssistantSettings-PP6JSHWB.mjs +93 -0
- package/dist/lib/browser/AssistantSettings-PP6JSHWB.mjs.map +7 -0
- package/dist/lib/browser/BlueprintArticle-H6R33TZZ.mjs +35 -0
- package/dist/lib/browser/BlueprintArticle-H6R33TZZ.mjs.map +7 -0
- package/dist/lib/browser/{ChatCompanion-ECQYUQ2B.mjs → ChatCompanion-GXS6DK4X.mjs} +75 -26
- package/dist/lib/browser/ChatCompanion-GXS6DK4X.mjs.map +7 -0
- package/dist/lib/browser/ChatContainer-SMSZXEF5.mjs +12 -0
- package/dist/lib/browser/{ChatDialog-SMK4RSZU.mjs → ChatDialog-ZCVPPONM.mjs} +9 -9
- package/dist/lib/browser/ChatDialog-ZCVPPONM.mjs.map +7 -0
- package/dist/lib/browser/ProjectArticle-QDBTIFNE.mjs +91 -0
- package/dist/lib/browser/ProjectArticle-QDBTIFNE.mjs.map +7 -0
- package/dist/lib/browser/ProjectSettings-L5MCDUXK.mjs +232 -0
- package/dist/lib/browser/ProjectSettings-L5MCDUXK.mjs.map +7 -0
- package/dist/lib/browser/PromptArticle-G5YSAEGK.mjs +71 -0
- package/dist/lib/browser/PromptArticle-G5YSAEGK.mjs.map +7 -0
- package/dist/lib/browser/TriggerStatus-X35WDCK5.mjs +112 -0
- package/dist/lib/browser/TriggerStatus-X35WDCK5.mjs.map +7 -0
- package/dist/lib/browser/{ai-service-5GUDOEWF.mjs → ai-service-CY2BYPH6.mjs} +5 -4
- package/dist/lib/browser/ai-service-CY2BYPH6.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-builder-DSNH2OMY.mjs → app-graph-builder-ECQCWGCN.mjs} +54 -42
- package/dist/lib/browser/app-graph-builder-ECQCWGCN.mjs.map +7 -0
- package/dist/lib/browser/blueprint-definition-CKG4TQ2J.mjs +35 -0
- package/dist/lib/browser/blueprint-definition-CKG4TQ2J.mjs.map +7 -0
- package/dist/lib/browser/blueprints/index.mjs +3 -7
- package/dist/lib/browser/{chunk-EXVT7D4B.mjs → chunk-2VIEX4RA.mjs} +3 -3
- package/dist/lib/browser/{chunk-EXVT7D4B.mjs.map → chunk-2VIEX4RA.mjs.map} +1 -1
- package/dist/lib/browser/{chunk-V772AMZM.mjs → chunk-734CB3XG.mjs} +28 -48
- package/dist/lib/browser/chunk-734CB3XG.mjs.map +7 -0
- package/dist/lib/browser/{chunk-3JYPE2MM.mjs → chunk-A346P45I.mjs} +623 -330
- package/dist/lib/browser/chunk-A346P45I.mjs.map +7 -0
- package/dist/lib/browser/{chunk-ML3QCFKA.mjs → chunk-JYY5AD65.mjs} +50 -29
- package/dist/lib/browser/chunk-JYY5AD65.mjs.map +7 -0
- package/dist/lib/browser/{ChatContainer-QCCOFBUX.mjs → chunk-WP4WY2Y6.mjs} +18 -22
- package/dist/lib/browser/chunk-WP4WY2Y6.mjs.map +7 -0
- package/dist/lib/browser/chunk-ZZRRSIQQ.mjs +26 -0
- package/dist/lib/browser/chunk-ZZRRSIQQ.mjs.map +7 -0
- package/dist/lib/browser/{edge-model-resolver-26BOY6HY.mjs → edge-model-resolver-YTMFQEN5.mjs} +4 -3
- package/dist/lib/browser/edge-model-resolver-YTMFQEN5.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +109 -85
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/{local-model-resolver-ZFIM6GGV.mjs → local-model-resolver-CGRQH37T.mjs} +4 -3
- package/dist/lib/browser/local-model-resolver-CGRQH37T.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{operation-resolver-7XJLBRQY.mjs → operation-resolver-DYSWWNVG.mjs} +34 -43
- package/dist/lib/browser/operation-resolver-DYSWWNVG.mjs.map +7 -0
- package/dist/lib/browser/react-surface-M3GSSFPC.mjs +142 -0
- package/dist/lib/browser/react-surface-M3GSSFPC.mjs.map +7 -0
- package/dist/lib/browser/{settings-4ZDLUMYE.mjs → settings-NC5DQWES.mjs} +6 -5
- package/dist/lib/browser/settings-NC5DQWES.mjs.map +7 -0
- package/dist/lib/browser/{state-AN6336ZX.mjs → state-EMIKHGYZ.mjs} +3 -3
- package/dist/lib/browser/toolkit-XRSBBB3L.mjs +16 -0
- package/dist/lib/browser/toolkit-XRSBBB3L.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +2 -2
- package/dist/lib/node-esm/AssistantSettings-3MNGBQB2.mjs +94 -0
- package/dist/lib/node-esm/AssistantSettings-3MNGBQB2.mjs.map +7 -0
- package/dist/lib/node-esm/BlueprintArticle-2KYFUQKY.mjs +36 -0
- package/dist/lib/node-esm/BlueprintArticle-2KYFUQKY.mjs.map +7 -0
- package/dist/lib/node-esm/{ChatCompanion-Q4FUZ2MW.mjs → ChatCompanion-MPQGSWZB.mjs} +75 -26
- package/dist/lib/node-esm/ChatCompanion-MPQGSWZB.mjs.map +7 -0
- package/dist/lib/node-esm/ChatContainer-DMOAYUUM.mjs +13 -0
- package/dist/lib/node-esm/{ChatDialog-AP45PVZR.mjs → ChatDialog-PV2EU2XM.mjs} +9 -9
- package/dist/lib/node-esm/ChatDialog-PV2EU2XM.mjs.map +7 -0
- package/dist/lib/node-esm/ProjectArticle-BCIBESJN.mjs +92 -0
- package/dist/lib/node-esm/ProjectArticle-BCIBESJN.mjs.map +7 -0
- package/dist/lib/node-esm/ProjectSettings-K3YBQWDD.mjs +233 -0
- package/dist/lib/node-esm/ProjectSettings-K3YBQWDD.mjs.map +7 -0
- package/dist/lib/node-esm/PromptArticle-HAGZPZWV.mjs +72 -0
- package/dist/lib/node-esm/PromptArticle-HAGZPZWV.mjs.map +7 -0
- package/dist/lib/node-esm/TriggerStatus-V3QMIE7T.mjs +113 -0
- package/dist/lib/node-esm/TriggerStatus-V3QMIE7T.mjs.map +7 -0
- package/dist/lib/node-esm/{ai-service-PXKKCFIF.mjs → ai-service-ZI3A6RVG.mjs} +5 -4
- package/dist/lib/node-esm/ai-service-ZI3A6RVG.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-builder-TJCUEXW5.mjs → app-graph-builder-YPHP6X6W.mjs} +54 -42
- package/dist/lib/node-esm/app-graph-builder-YPHP6X6W.mjs.map +7 -0
- package/dist/lib/node-esm/blueprint-definition-UZWGSFBI.mjs +36 -0
- package/dist/lib/node-esm/blueprint-definition-UZWGSFBI.mjs.map +7 -0
- package/dist/lib/node-esm/blueprints/index.mjs +3 -7
- package/dist/lib/node-esm/{chunk-XI5T3MJC.mjs → chunk-5DLYAEBK.mjs} +623 -330
- package/dist/lib/node-esm/chunk-5DLYAEBK.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-AK3JJ76X.mjs +28 -0
- package/dist/lib/node-esm/chunk-AK3JJ76X.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-ZRIPP7YF.mjs → chunk-JMBYVUD6.mjs} +50 -29
- package/dist/lib/node-esm/chunk-JMBYVUD6.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-355W5B27.mjs → chunk-JQAXFBBU.mjs} +28 -48
- package/dist/lib/node-esm/chunk-JQAXFBBU.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-POWB2BPC.mjs → chunk-TEYTGR67.mjs} +3 -3
- package/dist/lib/node-esm/{chunk-POWB2BPC.mjs.map → chunk-TEYTGR67.mjs.map} +1 -1
- package/dist/lib/node-esm/{ChatContainer-AKI33HIB.mjs → chunk-ZTL6HRDB.mjs} +18 -22
- package/dist/lib/node-esm/chunk-ZTL6HRDB.mjs.map +7 -0
- package/dist/lib/node-esm/{edge-model-resolver-G5KMODPO.mjs → edge-model-resolver-CMJ3KNLQ.mjs} +4 -3
- package/dist/lib/node-esm/edge-model-resolver-CMJ3KNLQ.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +109 -85
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/{local-model-resolver-KDZLYI7Y.mjs → local-model-resolver-FFDAKOXN.mjs} +4 -3
- package/dist/lib/node-esm/local-model-resolver-FFDAKOXN.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{operation-resolver-SX4WMNA7.mjs → operation-resolver-EE4EBO2Y.mjs} +34 -43
- package/dist/lib/node-esm/operation-resolver-EE4EBO2Y.mjs.map +7 -0
- package/dist/lib/node-esm/react-surface-U3PGFTKA.mjs +143 -0
- package/dist/lib/node-esm/react-surface-U3PGFTKA.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-CQEOHR3R.mjs → settings-OOAN5LAO.mjs} +6 -5
- package/dist/lib/node-esm/settings-OOAN5LAO.mjs.map +7 -0
- package/dist/lib/node-esm/{state-HDON4REW.mjs → state-7A7QPQKK.mjs} +3 -3
- package/dist/lib/node-esm/toolkit-5IWGLUF4.mjs +17 -0
- package/dist/lib/node-esm/toolkit-5IWGLUF4.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +2 -2
- package/dist/types/src/AssistantPlugin.d.ts.map +1 -1
- package/dist/types/src/blueprints/assistant/blueprint.d.ts +4 -0
- package/dist/types/src/blueprints/assistant/blueprint.d.ts.map +1 -0
- package/dist/types/src/blueprints/assistant/blueprint.test.d.ts +2 -0
- package/dist/types/src/blueprints/assistant/blueprint.test.d.ts.map +1 -0
- package/dist/types/src/blueprints/assistant/index.d.ts +2 -0
- package/dist/types/src/blueprints/assistant/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/index.d.ts +1 -6
- package/dist/types/src/blueprints/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/ai-service/ai-service.d.ts +3 -2
- package/dist/types/src/capabilities/ai-service/ai-service.d.ts.map +1 -1
- package/dist/types/src/capabilities/ai-service/index.d.ts +1 -1
- package/dist/types/src/capabilities/ai-service/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +1 -1
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts +4 -19
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts.map +1 -1
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts +1 -2
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/edge-model-resolver/edge-model-resolver.d.ts +4 -3
- package/dist/types/src/capabilities/edge-model-resolver/edge-model-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +0 -1
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/local-model-resolver/local-model-resolver.d.ts +4 -3
- package/dist/types/src/capabilities/local-model-resolver/local-model-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-resolver/index.d.ts +1 -1
- package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +2 -2
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts +1 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +2 -2
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings/index.d.ts +1 -1
- package/dist/types/src/capabilities/settings/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings/settings.d.ts +4 -3
- package/dist/types/src/capabilities/settings/settings.d.ts.map +1 -1
- package/dist/types/src/capabilities/state/state.d.ts +1 -1
- package/dist/types/src/capabilities/toolkit/index.d.ts +1 -1
- package/dist/types/src/capabilities/toolkit/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/toolkit/toolkit.d.ts +3 -2
- package/dist/types/src/capabilities/toolkit/toolkit.d.ts.map +1 -1
- package/dist/types/src/components/Chat/Chat.d.ts +11 -7
- package/dist/types/src/components/Chat/Chat.d.ts.map +1 -1
- package/dist/types/src/components/ChatProgress/ChatProgress.d.ts +2 -2
- package/dist/types/src/components/ChatProgress/ChatProgress.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatActions.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.d.ts +2 -2
- package/dist/types/src/components/ChatThread/ChatThread.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts +128 -8
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/registry.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/sync.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts +125 -5
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts +125 -5
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts.map +1 -1
- package/dist/types/src/components/ToolBlock/ToolBlock.d.ts +4 -4
- package/dist/types/src/components/ToolBlock/ToolBlock.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.d.ts +2 -2
- package/dist/types/src/components/Toolbox/Toolbox.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts +125 -5
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts.map +1 -1
- package/dist/types/src/components/Typewriter/AssistantToolbar.d.ts +2 -2
- package/dist/types/src/components/Typewriter/AssistantToolbar.d.ts.map +1 -1
- package/dist/types/src/components/Typewriter/Typewriter.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +0 -12
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/{components → containers}/AssistantSettings/AssistantSettings.d.ts.map +1 -1
- package/dist/types/src/containers/AssistantSettings/index.d.ts +3 -0
- package/dist/types/src/containers/AssistantSettings/index.d.ts.map +1 -0
- package/dist/types/src/containers/BlueprintArticle/BlueprintArticle.d.ts +6 -0
- package/dist/types/src/containers/BlueprintArticle/BlueprintArticle.d.ts.map +1 -0
- package/dist/types/src/containers/BlueprintArticle/index.d.ts +3 -0
- package/dist/types/src/containers/BlueprintArticle/index.d.ts.map +1 -0
- package/dist/types/src/{components → containers/ChatCompanion}/ChatCompanion.d.ts +2 -3
- package/dist/types/src/containers/ChatCompanion/ChatCompanion.d.ts.map +1 -0
- package/dist/types/src/containers/ChatCompanion/index.d.ts +3 -0
- package/dist/types/src/containers/ChatCompanion/index.d.ts.map +1 -0
- package/dist/types/src/{components → containers/ChatContainer}/ChatContainer.d.ts +6 -6
- package/dist/types/src/containers/ChatContainer/ChatContainer.d.ts.map +1 -0
- package/dist/types/src/containers/ChatContainer/index.d.ts +3 -0
- package/dist/types/src/containers/ChatContainer/index.d.ts.map +1 -0
- package/dist/types/src/{components → containers/ChatDialog}/ChatDialog.d.ts +2 -3
- package/dist/types/src/containers/ChatDialog/ChatDialog.d.ts.map +1 -0
- package/dist/types/src/containers/ChatDialog/index.d.ts +3 -0
- package/dist/types/src/containers/ChatDialog/index.d.ts.map +1 -0
- package/dist/types/src/containers/Project/ProjectArticle.d.ts +7 -0
- package/dist/types/src/containers/Project/ProjectArticle.d.ts.map +1 -0
- package/dist/types/src/containers/Project/ProjectSettings.d.ts +6 -0
- package/dist/types/src/containers/Project/ProjectSettings.d.ts.map +1 -0
- package/dist/types/src/containers/Project/index.d.ts +7 -0
- package/dist/types/src/containers/Project/index.d.ts.map +1 -0
- package/dist/types/src/containers/Project/triggers.d.ts +6 -0
- package/dist/types/src/containers/Project/triggers.d.ts.map +1 -0
- package/dist/types/src/containers/PromptArticle/PromptArticle.d.ts +6 -0
- package/dist/types/src/containers/PromptArticle/PromptArticle.d.ts.map +1 -0
- package/dist/types/src/containers/PromptArticle/index.d.ts +3 -0
- package/dist/types/src/containers/PromptArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/TriggerStatus/TriggerStatus.d.ts +4 -0
- package/dist/types/src/containers/TriggerStatus/TriggerStatus.d.ts.map +1 -0
- package/dist/types/src/containers/TriggerStatus/index.d.ts +3 -0
- package/dist/types/src/containers/TriggerStatus/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +10 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/hooks/useBlueprintRegistry.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatProcessor.d.ts +2 -1
- package/dist/types/src/hooks/useChatProcessor.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatServices.d.ts +2 -2
- package/dist/types/src/hooks/useChatServices.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatToolbarActions.d.ts +2 -2
- package/dist/types/src/hooks/useChatToolbarActions.d.ts.map +1 -1
- package/dist/types/src/hooks/useFilteredTypes.d.ts +1 -1
- package/dist/types/src/hooks/useFilteredTypes.d.ts.map +1 -1
- package/dist/types/src/hooks/useReferencesProvider.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -0
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/processor/processor.d.ts +7 -3
- package/dist/types/src/processor/processor.d.ts.map +1 -1
- package/dist/types/src/processor/update-name.d.ts +2 -2
- package/dist/types/src/processor/update-name.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +125 -5
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Assistant.d.ts +5 -27
- package/dist/types/src/types/Assistant.d.ts.map +1 -1
- package/dist/types/src/types/AssistantAction.d.ts +13 -15
- package/dist/types/src/types/AssistantAction.d.ts.map +1 -1
- package/dist/types/src/types/index.d.ts +1 -0
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/service.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +95 -92
- package/src/AssistantPlugin.tsx +64 -36
- package/src/blueprints/assistant/blueprint.conversations.json +1 -0
- package/src/blueprints/assistant/blueprint.test.ts +48 -0
- package/src/blueprints/assistant/blueprint.ts +27 -0
- package/src/blueprints/assistant/index.ts +5 -0
- package/src/blueprints/index.ts +1 -8
- package/src/capabilities/ai-service/ai-service.ts +4 -3
- package/src/capabilities/app-graph-builder/app-graph-builder.ts +48 -31
- package/src/capabilities/blueprint-definition/blueprint-definition.ts +32 -42
- package/src/capabilities/blueprint-definition/index.ts +0 -1
- package/src/capabilities/edge-model-resolver/edge-model-resolver.ts +4 -3
- package/src/capabilities/index.ts +0 -1
- package/src/capabilities/local-model-resolver/local-model-resolver.ts +4 -3
- package/src/capabilities/operation-resolver/operation-resolver.ts +29 -26
- package/src/capabilities/react-surface/react-surface.tsx +53 -29
- package/src/capabilities/settings/settings.ts +3 -2
- package/src/capabilities/toolkit/toolkit.ts +5 -16
- package/src/components/Chat/Chat.tsx +67 -30
- package/src/components/ChatProgress/ChatProgress.tsx +4 -5
- package/src/components/ChatPrompt/ChatActions.tsx +9 -1
- package/src/components/ChatPrompt/ChatOptions.tsx +29 -9
- package/src/components/ChatPrompt/ChatReferences.tsx +14 -4
- package/src/components/ChatThread/ChatThread.stories.tsx +11 -11
- package/src/components/ChatThread/ChatThread.tsx +15 -6
- package/src/components/ChatThread/Link.tsx +1 -1
- package/src/components/ChatThread/registry.tsx +51 -18
- package/src/components/ChatThread/sync.test.ts +2 -0
- package/src/components/ChatThread/sync.ts +14 -8
- package/src/components/TemplateEditor/TemplateEditor.stories.tsx +3 -3
- package/src/components/TemplateEditor/TemplateEditor.tsx +2 -2
- package/src/components/TemplateEditor/TemplateForm.stories.tsx +3 -3
- package/src/components/TemplateEditor/TemplateForm.tsx +6 -7
- package/src/components/TemplateEditor/extensions/handlebars-extension.ts +4 -4
- package/src/components/ToolBlock/ToolBlock.tsx +15 -15
- package/src/components/Toolbox/Toolbox.stories.tsx +3 -3
- package/src/components/Toolbox/Toolbox.tsx +49 -48
- package/src/components/Typewriter/AssistantToolbar.tsx +3 -3
- package/src/components/Typewriter/Typewriter.stories.tsx +18 -15
- package/src/components/Typewriter/Typewriter.tsx +1 -1
- package/src/components/Typewriter/assistant-extension.tsx +3 -5
- package/src/components/index.ts +0 -9
- package/src/{components → containers}/AssistantSettings/AssistantSettings.tsx +15 -15
- package/src/containers/AssistantSettings/index.ts +7 -0
- package/src/containers/BlueprintArticle/BlueprintArticle.tsx +29 -0
- package/src/containers/BlueprintArticle/index.ts +7 -0
- package/src/{components → containers/ChatCompanion}/ChatCompanion.tsx +84 -22
- package/src/containers/ChatCompanion/index.ts +7 -0
- package/src/containers/ChatContainer/ChatContainer.tsx +69 -0
- package/src/containers/ChatContainer/index.ts +7 -0
- package/src/{components → containers/ChatDialog}/ChatDialog.tsx +7 -9
- package/src/containers/ChatDialog/index.ts +7 -0
- package/src/containers/Project/ProjectArticle.tsx +117 -0
- package/src/containers/Project/ProjectSettings.tsx +134 -0
- package/src/containers/Project/index.ts +16 -0
- package/src/containers/Project/triggers.ts +149 -0
- package/src/containers/PromptArticle/PromptArticle.tsx +59 -0
- package/src/containers/PromptArticle/index.ts +7 -0
- package/src/containers/TriggerStatus/TriggerStatus.tsx +140 -0
- package/src/containers/TriggerStatus/index.ts +7 -0
- package/src/containers/index.ts +15 -0
- package/src/hooks/useBlueprintRegistry.ts +7 -4
- package/src/hooks/useChatProcessor.ts +2 -1
- package/src/hooks/useChatServices.ts +3 -3
- package/src/hooks/useChatToolbarActions.ts +6 -5
- package/src/hooks/useFilteredTypes.ts +2 -2
- package/src/hooks/useReferencesProvider.ts +1 -5
- package/src/index.ts +1 -0
- package/src/meta.ts +2 -2
- package/src/processor/processor.test.ts +8 -7
- package/src/processor/processor.ts +47 -26
- package/src/processor/update-name.ts +2 -3
- package/src/testing/test-sequence.ts +3 -3
- package/src/testing/test-services.ts +1 -1
- package/src/translations.ts +29 -3
- package/src/types/Assistant.ts +4 -38
- package/src/types/AssistantAction.ts +14 -13
- package/src/types/capabilities.ts +2 -2
- package/src/types/events.ts +1 -1
- package/src/types/index.ts +3 -0
- package/src/types/service.ts +4 -4
- package/dist/lib/browser/BlueprintArticle-WP3G5GLG.mjs +0 -31
- package/dist/lib/browser/BlueprintArticle-WP3G5GLG.mjs.map +0 -7
- package/dist/lib/browser/ChatCompanion-ECQYUQ2B.mjs.map +0 -7
- package/dist/lib/browser/ChatContainer-QCCOFBUX.mjs.map +0 -7
- package/dist/lib/browser/ChatDialog-SMK4RSZU.mjs.map +0 -7
- package/dist/lib/browser/PromptArticle-K362ZPAE.mjs +0 -53
- package/dist/lib/browser/PromptArticle-K362ZPAE.mjs.map +0 -7
- package/dist/lib/browser/ai-service-5GUDOEWF.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-DSNH2OMY.mjs.map +0 -7
- package/dist/lib/browser/blueprint-definition-DGHH7MUU.mjs +0 -14
- package/dist/lib/browser/chunk-3JYPE2MM.mjs.map +0 -7
- package/dist/lib/browser/chunk-DKQMSMBN.mjs +0 -326
- package/dist/lib/browser/chunk-DKQMSMBN.mjs.map +0 -7
- package/dist/lib/browser/chunk-ML3QCFKA.mjs.map +0 -7
- package/dist/lib/browser/chunk-MRJVYGLU.mjs +0 -208
- package/dist/lib/browser/chunk-MRJVYGLU.mjs.map +0 -7
- package/dist/lib/browser/chunk-V772AMZM.mjs.map +0 -7
- package/dist/lib/browser/chunk-WGQTU6UJ.mjs +0 -41
- package/dist/lib/browser/chunk-WGQTU6UJ.mjs.map +0 -7
- package/dist/lib/browser/edge-model-resolver-26BOY6HY.mjs.map +0 -7
- package/dist/lib/browser/local-model-resolver-ZFIM6GGV.mjs.map +0 -7
- package/dist/lib/browser/operation-resolver-7XJLBRQY.mjs.map +0 -7
- package/dist/lib/browser/react-surface-NCITRSJJ.mjs +0 -109
- package/dist/lib/browser/react-surface-NCITRSJJ.mjs.map +0 -7
- package/dist/lib/browser/repair-6QGAKOVM.mjs +0 -54
- package/dist/lib/browser/repair-6QGAKOVM.mjs.map +0 -7
- package/dist/lib/browser/settings-4ZDLUMYE.mjs.map +0 -7
- package/dist/lib/browser/toolkit-7AVTEPMA.mjs +0 -18
- package/dist/lib/browser/toolkit-7AVTEPMA.mjs.map +0 -7
- package/dist/lib/node-esm/BlueprintArticle-WZ76E2C4.mjs +0 -32
- package/dist/lib/node-esm/BlueprintArticle-WZ76E2C4.mjs.map +0 -7
- package/dist/lib/node-esm/ChatCompanion-Q4FUZ2MW.mjs.map +0 -7
- package/dist/lib/node-esm/ChatContainer-AKI33HIB.mjs.map +0 -7
- package/dist/lib/node-esm/ChatDialog-AP45PVZR.mjs.map +0 -7
- package/dist/lib/node-esm/PromptArticle-D4HAIIC6.mjs +0 -54
- package/dist/lib/node-esm/PromptArticle-D4HAIIC6.mjs.map +0 -7
- package/dist/lib/node-esm/ai-service-PXKKCFIF.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-TJCUEXW5.mjs.map +0 -7
- package/dist/lib/node-esm/blueprint-definition-SEMDEIYG.mjs +0 -15
- package/dist/lib/node-esm/chunk-355W5B27.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-75PHXBN3.mjs +0 -327
- package/dist/lib/node-esm/chunk-75PHXBN3.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-DCA5QWQT.mjs +0 -209
- package/dist/lib/node-esm/chunk-DCA5QWQT.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-MSBPC4RJ.mjs +0 -42
- package/dist/lib/node-esm/chunk-MSBPC4RJ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-XI5T3MJC.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ZRIPP7YF.mjs.map +0 -7
- package/dist/lib/node-esm/edge-model-resolver-G5KMODPO.mjs.map +0 -7
- package/dist/lib/node-esm/local-model-resolver-KDZLYI7Y.mjs.map +0 -7
- package/dist/lib/node-esm/operation-resolver-SX4WMNA7.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-ST6V7LPE.mjs +0 -110
- package/dist/lib/node-esm/react-surface-ST6V7LPE.mjs.map +0 -7
- package/dist/lib/node-esm/repair-QJ7CQDKU.mjs +0 -55
- package/dist/lib/node-esm/repair-QJ7CQDKU.mjs.map +0 -7
- package/dist/lib/node-esm/settings-CQEOHR3R.mjs.map +0 -7
- package/dist/lib/node-esm/toolkit-OWGCEKOO.mjs +0 -19
- package/dist/lib/node-esm/toolkit-OWGCEKOO.mjs.map +0 -7
- package/dist/types/src/blueprints/assistant-blueprint.d.ts +0 -209
- package/dist/types/src/blueprints/assistant-blueprint.d.ts.map +0 -1
- package/dist/types/src/capabilities/repair/index.d.ts +0 -3
- package/dist/types/src/capabilities/repair/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/repair/repair.d.ts +0 -6
- package/dist/types/src/capabilities/repair/repair.d.ts.map +0 -1
- package/dist/types/src/components/AssistantSettings/index.d.ts +0 -2
- package/dist/types/src/components/AssistantSettings/index.d.ts.map +0 -1
- package/dist/types/src/components/BlueprintArticle.d.ts +0 -7
- package/dist/types/src/components/BlueprintArticle.d.ts.map +0 -1
- package/dist/types/src/components/ChatCompanion.d.ts.map +0 -1
- package/dist/types/src/components/ChatContainer.d.ts.map +0 -1
- package/dist/types/src/components/ChatDialog.d.ts.map +0 -1
- package/dist/types/src/components/PromptArticle.d.ts +0 -7
- package/dist/types/src/components/PromptArticle.d.ts.map +0 -1
- package/dist/types/src/functions/index.d.ts +0 -4
- package/dist/types/src/functions/index.d.ts.map +0 -1
- package/dist/types/src/functions/object-list.d.ts +0 -10
- package/dist/types/src/functions/object-list.d.ts.map +0 -1
- package/dist/types/src/functions/object-load.d.ts +0 -8
- package/dist/types/src/functions/object-load.d.ts.map +0 -1
- package/dist/types/src/functions/object-search.d.ts +0 -10
- package/dist/types/src/functions/object-search.d.ts.map +0 -1
- package/src/blueprints/assistant-blueprint.ts +0 -62
- package/src/capabilities/repair/index.ts +0 -7
- package/src/capabilities/repair/repair.ts +0 -63
- package/src/components/AssistantSettings/index.ts +0 -5
- package/src/components/BlueprintArticle.tsx +0 -29
- package/src/components/ChatContainer.tsx +0 -61
- package/src/components/PromptArticle.tsx +0 -50
- package/src/functions/index.ts +0 -7
- package/src/functions/object-list.ts +0 -49
- package/src/functions/object-load.ts +0 -47
- package/src/functions/object-search.ts +0 -46
- /package/dist/lib/browser/{blueprint-definition-DGHH7MUU.mjs.map → ChatContainer-SMSZXEF5.mjs.map} +0 -0
- /package/dist/lib/browser/{state-AN6336ZX.mjs.map → state-EMIKHGYZ.mjs.map} +0 -0
- /package/dist/lib/node-esm/{blueprint-definition-SEMDEIYG.mjs.map → ChatContainer-DMOAYUUM.mjs.map} +0 -0
- /package/dist/lib/node-esm/{state-HDON4REW.mjs.map → state-7A7QPQKK.mjs.map} +0 -0
- /package/dist/types/src/{components → containers}/AssistantSettings/AssistantSettings.d.ts +0 -0
|
@@ -5,14 +5,16 @@
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
import React from 'react';
|
|
7
7
|
|
|
8
|
-
import {
|
|
9
|
-
import { useSettingsState } from '@dxos/app-framework/
|
|
8
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
9
|
+
import { Surface, useSettingsState } from '@dxos/app-framework/ui';
|
|
10
|
+
import { AppCapabilities } from '@dxos/app-toolkit';
|
|
11
|
+
import { Chat, Project } from '@dxos/assistant-toolkit';
|
|
10
12
|
import { Blueprint, Prompt } from '@dxos/blueprints';
|
|
11
13
|
import { getSpace } from '@dxos/client/echo';
|
|
12
14
|
import { Sequence } from '@dxos/conductor';
|
|
13
15
|
import { InvocationTraceContainer } from '@dxos/devtools';
|
|
14
16
|
import { Obj } from '@dxos/echo';
|
|
15
|
-
import {
|
|
17
|
+
import { Panel } from '@dxos/react-ui';
|
|
16
18
|
|
|
17
19
|
import {
|
|
18
20
|
AssistantSettings,
|
|
@@ -20,42 +22,57 @@ import {
|
|
|
20
22
|
ChatCompanion,
|
|
21
23
|
ChatContainer,
|
|
22
24
|
ChatDialog,
|
|
25
|
+
ProjectArticle,
|
|
26
|
+
ProjectSettings,
|
|
23
27
|
PromptArticle,
|
|
24
|
-
|
|
28
|
+
TriggerStatus,
|
|
29
|
+
} from '../../containers';
|
|
25
30
|
import { ASSISTANT_DIALOG, meta } from '../../meta';
|
|
26
|
-
import { Assistant } from '../../types';
|
|
31
|
+
import { type Assistant } from '../../types';
|
|
27
32
|
|
|
28
33
|
export default Capability.makeModule(() =>
|
|
29
34
|
Effect.succeed(
|
|
30
|
-
Capability.contributes(
|
|
31
|
-
|
|
32
|
-
id: `${meta.id}
|
|
35
|
+
Capability.contributes(Capabilities.ReactSurface, [
|
|
36
|
+
Surface.create({
|
|
37
|
+
id: `${meta.id}.plugin-settings`,
|
|
33
38
|
role: 'article',
|
|
34
|
-
filter: (data): data is { subject:
|
|
35
|
-
|
|
39
|
+
filter: (data): data is { subject: AppCapabilities.Settings } =>
|
|
40
|
+
AppCapabilities.isSettings(data.subject) && data.subject.prefix === meta.id,
|
|
36
41
|
component: ({ data: { subject } }) => {
|
|
37
42
|
const { settings, updateSettings } = useSettingsState<Assistant.Settings>(subject.atom);
|
|
38
43
|
return <AssistantSettings settings={settings} onSettingsChange={updateSettings} />;
|
|
39
44
|
},
|
|
40
45
|
}),
|
|
41
|
-
|
|
42
|
-
id: `${meta.id}
|
|
46
|
+
Surface.create({
|
|
47
|
+
id: `${meta.id}.chat`,
|
|
43
48
|
role: 'article',
|
|
44
|
-
filter: (data): data is { subject:
|
|
45
|
-
Obj.instanceOf(
|
|
49
|
+
filter: (data): data is { subject: Chat.Chat; variant: undefined } =>
|
|
50
|
+
Obj.instanceOf(Chat.Chat, data.subject) && data.variant !== 'assistant-chat',
|
|
46
51
|
component: ({ data, role, ref }) => <ChatContainer role={role} subject={data.subject} ref={ref} />,
|
|
47
52
|
}),
|
|
53
|
+
Surface.create({
|
|
54
|
+
id: `${meta.id}.project`,
|
|
55
|
+
role: 'article',
|
|
56
|
+
filter: (data): data is { subject: Project.Project } => Obj.instanceOf(Project.Project, data.subject),
|
|
57
|
+
component: ({ data, role }) => <ProjectArticle role={role} subject={data.subject} />,
|
|
58
|
+
}),
|
|
59
|
+
Surface.create({
|
|
60
|
+
id: `${meta.id}.project.companion.settings`,
|
|
61
|
+
role: 'object-settings',
|
|
62
|
+
filter: (data): data is { subject: Project.Project } => Obj.instanceOf(Project.Project, data.subject),
|
|
63
|
+
component: ({ data }) => <ProjectSettings subject={data.subject} />,
|
|
64
|
+
}),
|
|
48
65
|
// TODO(wittjosiah): This is flashing when chat changes.
|
|
49
|
-
|
|
50
|
-
id: `${meta.id}
|
|
66
|
+
Surface.create({
|
|
67
|
+
id: `${meta.id}.companion-chat`,
|
|
51
68
|
role: 'article',
|
|
52
|
-
filter: (data): data is { companionTo: Obj.Unknown; subject:
|
|
69
|
+
filter: (data): data is { companionTo: Obj.Unknown; subject: Chat.Chat | 'assistant-chat' } =>
|
|
53
70
|
Obj.isObject(data.companionTo) &&
|
|
54
|
-
(Obj.instanceOf(
|
|
71
|
+
(Obj.instanceOf(Chat.Chat, data.subject) || data.subject === 'assistant-chat'),
|
|
55
72
|
component: ({ data, role, ref }) => <ChatCompanion role={role} data={data} ref={ref} />,
|
|
56
73
|
}),
|
|
57
|
-
|
|
58
|
-
id: `${meta.id}
|
|
74
|
+
Surface.create({
|
|
75
|
+
id: `${meta.id}.companion-invocations`,
|
|
59
76
|
role: 'article',
|
|
60
77
|
filter: (data): data is { companionTo: Sequence } =>
|
|
61
78
|
(Obj.instanceOf(Sequence, data.companionTo) || Obj.instanceOf(Prompt.Prompt, data.companionTo)) &&
|
|
@@ -66,30 +83,37 @@ export default Capability.makeModule(() =>
|
|
|
66
83
|
// TODO(wittjosiah): Support invocation filtering for prompts.
|
|
67
84
|
const target = Obj.instanceOf(Prompt.Prompt, data.companionTo) ? undefined : data.companionTo;
|
|
68
85
|
return (
|
|
69
|
-
<
|
|
70
|
-
<
|
|
71
|
-
|
|
86
|
+
<Panel.Root role={role} className='dx-article'>
|
|
87
|
+
<Panel.Content asChild>
|
|
88
|
+
<InvocationTraceContainer db={space?.db} queueDxn={queueDxn} target={target} detailAxis='block' />
|
|
89
|
+
</Panel.Content>
|
|
90
|
+
</Panel.Root>
|
|
72
91
|
);
|
|
73
92
|
},
|
|
74
93
|
}),
|
|
75
|
-
|
|
76
|
-
id: `${meta.id}
|
|
94
|
+
Surface.create({
|
|
95
|
+
id: `${meta.id}.blueprint`,
|
|
77
96
|
role: 'article',
|
|
78
97
|
filter: (data): data is { subject: Blueprint.Blueprint } => Obj.instanceOf(Blueprint.Blueprint, data.subject),
|
|
79
98
|
component: ({ data }) => <BlueprintArticle subject={data.subject} />,
|
|
80
99
|
}),
|
|
81
|
-
|
|
82
|
-
id: `${meta.id}
|
|
100
|
+
Surface.create({
|
|
101
|
+
id: `${meta.id}.prompt`,
|
|
83
102
|
role: 'article',
|
|
84
103
|
filter: (data): data is { subject: Prompt.Prompt } => Obj.instanceOf(Prompt.Prompt, data.subject),
|
|
85
104
|
component: ({ data }) => <PromptArticle subject={data.subject} />,
|
|
86
105
|
}),
|
|
87
|
-
|
|
106
|
+
Surface.create({
|
|
88
107
|
id: ASSISTANT_DIALOG,
|
|
89
108
|
role: 'dialog',
|
|
90
|
-
filter: (data): data is { props: { chat:
|
|
109
|
+
filter: (data): data is { props: { chat: Chat.Chat } } => data.component === ASSISTANT_DIALOG,
|
|
91
110
|
component: ({ data }) => <ChatDialog {...data.props} />,
|
|
92
111
|
}),
|
|
112
|
+
Surface.create({
|
|
113
|
+
id: `${meta.id}.status`,
|
|
114
|
+
role: 'status',
|
|
115
|
+
component: () => <TriggerStatus />,
|
|
116
|
+
}),
|
|
93
117
|
]),
|
|
94
118
|
),
|
|
95
119
|
);
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
|
|
7
|
-
import { Capability
|
|
7
|
+
import { Capability } from '@dxos/app-framework';
|
|
8
|
+
import { AppCapabilities } from '@dxos/app-toolkit';
|
|
8
9
|
import { createKvsStore } from '@dxos/effect';
|
|
9
10
|
|
|
10
11
|
import { meta } from '../../meta';
|
|
@@ -20,7 +21,7 @@ export default Capability.makeModule(() =>
|
|
|
20
21
|
|
|
21
22
|
return [
|
|
22
23
|
Capability.contributes(AssistantCapabilities.Settings, settingsAtom),
|
|
23
|
-
Capability.contributes(
|
|
24
|
+
Capability.contributes(AppCapabilities.Settings, {
|
|
24
25
|
prefix: meta.id,
|
|
25
26
|
schema: Assistant.Settings,
|
|
26
27
|
atom: settingsAtom,
|
|
@@ -5,22 +5,11 @@
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
import * as Layer from 'effect/Layer';
|
|
7
7
|
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
8
|
+
import { GenericToolkit } from '@dxos/ai';
|
|
9
|
+
import { Capability } from '@dxos/app-framework';
|
|
10
|
+
import { AppCapabilities } from '@dxos/app-toolkit';
|
|
11
|
+
import { WebSearchToolkit } from '@dxos/assistant-toolkit';
|
|
11
12
|
|
|
12
13
|
export default Capability.makeModule(() =>
|
|
13
|
-
Effect.succeed([
|
|
14
|
-
Capability.contributes(
|
|
15
|
-
Common.Capability.Toolkit,
|
|
16
|
-
GenericToolkit.make(AssistantToolkit.AssistantToolkit, AssistantToolkit.layer()),
|
|
17
|
-
),
|
|
18
|
-
|
|
19
|
-
// TODO(burdon): How to manage dependencies across blueprints.
|
|
20
|
-
Capability.contributes(
|
|
21
|
-
Common.Capability.Toolkit,
|
|
22
|
-
GenericToolkit.make(SystemToolkit.SystemToolkit, SystemToolkit.layer()),
|
|
23
|
-
),
|
|
24
|
-
Capability.contributes(Common.Capability.Toolkit, GenericToolkit.make(WebSearchToolkit, Layer.empty)),
|
|
25
|
-
]),
|
|
14
|
+
Effect.succeed([Capability.contributes(AppCapabilities.Toolkit, GenericToolkit.make(WebSearchToolkit, Layer.empty))]),
|
|
26
15
|
);
|
|
@@ -8,17 +8,26 @@ import { useAtomValue } from '@effect-atom/atom-react';
|
|
|
8
8
|
import { createContext } from '@radix-ui/react-context';
|
|
9
9
|
import * as Array from 'effect/Array';
|
|
10
10
|
import * as Option from 'effect/Option';
|
|
11
|
-
import React, {
|
|
12
|
-
|
|
11
|
+
import React, {
|
|
12
|
+
type ComponentPropsWithoutRef,
|
|
13
|
+
type PropsWithChildren,
|
|
14
|
+
useCallback,
|
|
15
|
+
useEffect,
|
|
16
|
+
useMemo,
|
|
17
|
+
useRef,
|
|
18
|
+
useState,
|
|
19
|
+
} from 'react';
|
|
20
|
+
|
|
21
|
+
import { type Chat as ChatModule } from '@dxos/assistant-toolkit';
|
|
13
22
|
import { Event } from '@dxos/async';
|
|
14
|
-
import { type Database, Obj } from '@dxos/echo';
|
|
23
|
+
import { type Database, Filter, Obj } from '@dxos/echo';
|
|
15
24
|
import { useVoiceInput } from '@dxos/plugin-transcription';
|
|
16
|
-
import {
|
|
25
|
+
import { useQuery } from '@dxos/react-client/echo';
|
|
17
26
|
import { useIdentity } from '@dxos/react-client/halo';
|
|
18
27
|
import { Input, type ThemedClassName, useDynamicRef, useTranslation } from '@dxos/react-ui';
|
|
19
28
|
import { ChatEditor, type ChatEditorController, type ChatEditorProps } from '@dxos/react-ui-chat';
|
|
20
29
|
import { type MarkdownStreamController } from '@dxos/react-ui-components';
|
|
21
|
-
import {
|
|
30
|
+
import { Menu } from '@dxos/react-ui-menu';
|
|
22
31
|
import { Message } from '@dxos/types';
|
|
23
32
|
import { mx } from '@dxos/ui-theme';
|
|
24
33
|
import { isTruthy } from '@dxos/util';
|
|
@@ -26,7 +35,6 @@ import { isTruthy } from '@dxos/util';
|
|
|
26
35
|
import { useChatToolbarActions } from '../../hooks';
|
|
27
36
|
import { meta } from '../../meta';
|
|
28
37
|
import { type AiChatProcessor } from '../../processor';
|
|
29
|
-
import { type Assistant } from '../../types';
|
|
30
38
|
import {
|
|
31
39
|
ChatActions,
|
|
32
40
|
type ChatActionsProps,
|
|
@@ -49,7 +57,7 @@ type ChatContextValue = {
|
|
|
49
57
|
debug?: boolean;
|
|
50
58
|
event: Event<ChatEvent>;
|
|
51
59
|
db?: Database.Database;
|
|
52
|
-
chat?:
|
|
60
|
+
chat?: ChatModule.Chat;
|
|
53
61
|
messages: Message.Message[];
|
|
54
62
|
processor: AiChatProcessor;
|
|
55
63
|
};
|
|
@@ -73,11 +81,10 @@ const ChatRoot = ({ children, chat, processor, onEvent, ...props }: ChatRootProp
|
|
|
73
81
|
const lastPrompt = useRef<string | undefined>(undefined);
|
|
74
82
|
|
|
75
83
|
// Messages.
|
|
76
|
-
const
|
|
84
|
+
const storedMessages = useQuery(chat?.queue?.target, Filter.type(Message.Message));
|
|
77
85
|
const messages = useMemo(() => {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}, [queue?.objects, pending]);
|
|
86
|
+
return Array.dedupeWith([...storedMessages, ...pending], ({ id: a }, { id: b }) => a === b);
|
|
87
|
+
}, [storedMessages, pending]);
|
|
81
88
|
|
|
82
89
|
// Events.
|
|
83
90
|
const event = useMemo(() => new Event<ChatEvent>(), []);
|
|
@@ -85,7 +92,26 @@ const ChatRoot = ({ children, chat, processor, onEvent, ...props }: ChatRootProp
|
|
|
85
92
|
return event.on((ev) => {
|
|
86
93
|
switch (ev.type) {
|
|
87
94
|
case 'toggle-debug': {
|
|
88
|
-
setDebug((
|
|
95
|
+
setDebug((debug) => !debug);
|
|
96
|
+
|
|
97
|
+
// Dump state to console.
|
|
98
|
+
queueMicrotask(async () => {
|
|
99
|
+
const objects = processor.context.getObjects();
|
|
100
|
+
const blueprints = processor.context.getBlueprints();
|
|
101
|
+
const tools = await processor.getTools();
|
|
102
|
+
const system = await processor.getSystemPrompt();
|
|
103
|
+
// eslint-disable-next-line no-console
|
|
104
|
+
console.log('Chat processor state:', { objects, blueprints });
|
|
105
|
+
// eslint-disable-next-line no-console
|
|
106
|
+
console.log(`
|
|
107
|
+
==== System Prompt ====
|
|
108
|
+
${system}
|
|
109
|
+
==== Tools ====
|
|
110
|
+
${Object.values(tools)
|
|
111
|
+
.map((tool) => JSON.stringify(tool, null, 2))
|
|
112
|
+
.join('\n')}
|
|
113
|
+
`);
|
|
114
|
+
});
|
|
89
115
|
break;
|
|
90
116
|
}
|
|
91
117
|
|
|
@@ -143,24 +169,30 @@ ChatRoot.displayName = 'Chat.Root';
|
|
|
143
169
|
// Viewport
|
|
144
170
|
//
|
|
145
171
|
|
|
146
|
-
|
|
172
|
+
const CHAT_VIEWPORT_NAME = 'Chat.Viewport';
|
|
173
|
+
|
|
174
|
+
type ChatViewportProps = ThemedClassName<PropsWithChildren<ComponentPropsWithoutRef<'div'>>>;
|
|
147
175
|
|
|
148
|
-
const ChatViewport = ({ classNames, children }: ChatViewportProps) => {
|
|
176
|
+
const ChatViewport = ({ classNames, children, ...props }: ChatViewportProps) => {
|
|
149
177
|
return (
|
|
150
|
-
<div role='none' className={mx('flex flex-col
|
|
178
|
+
<div role='none' {...props} className={mx('flex flex-col h-full w-full', classNames)}>
|
|
151
179
|
{children}
|
|
152
180
|
</div>
|
|
153
181
|
);
|
|
154
182
|
};
|
|
155
183
|
|
|
184
|
+
ChatViewport.displayName = CHAT_VIEWPORT_NAME;
|
|
185
|
+
|
|
156
186
|
//
|
|
157
187
|
// Thread
|
|
158
188
|
//
|
|
159
189
|
|
|
190
|
+
const CHAT_THREAD_NAME = 'Chat.Thread';
|
|
191
|
+
|
|
160
192
|
type ChatThreadProps = Omit<NaturalChatThreadProps, 'identity' | 'messages' | 'tools'>;
|
|
161
193
|
|
|
162
194
|
const ChatThread = (props: ChatThreadProps) => {
|
|
163
|
-
const { debug, event, messages, processor } = useChatContext(
|
|
195
|
+
const { debug, event, messages, processor } = useChatContext(CHAT_THREAD_NAME);
|
|
164
196
|
const identity = useIdentity();
|
|
165
197
|
const error = useAtomValue(processor.error).pipe(Option.getOrUndefined);
|
|
166
198
|
|
|
@@ -206,12 +238,14 @@ const ChatThread = (props: ChatThreadProps) => {
|
|
|
206
238
|
);
|
|
207
239
|
};
|
|
208
240
|
|
|
209
|
-
ChatThread.displayName =
|
|
241
|
+
ChatThread.displayName = CHAT_THREAD_NAME;
|
|
210
242
|
|
|
211
243
|
//
|
|
212
244
|
// Prompt
|
|
213
245
|
//
|
|
214
246
|
|
|
247
|
+
const CHAT_PROMPT_NAME = 'Chat.Prompt';
|
|
248
|
+
|
|
215
249
|
type ChatPromptProps = ThemedClassName<
|
|
216
250
|
{
|
|
217
251
|
outline?: boolean;
|
|
@@ -238,7 +272,7 @@ const ChatPrompt = ({
|
|
|
238
272
|
onOnlineChange,
|
|
239
273
|
}: ChatPromptProps) => {
|
|
240
274
|
const { t } = useTranslation(meta.id);
|
|
241
|
-
const { db, processor, event } = useChatContext(
|
|
275
|
+
const { db, processor, event } = useChatContext(CHAT_PROMPT_NAME);
|
|
242
276
|
|
|
243
277
|
const error = useAtomValue(processor.error).pipe(Option.getOrUndefined);
|
|
244
278
|
const streaming = useAtomValue(processor.streaming);
|
|
@@ -337,9 +371,9 @@ const ChatPrompt = ({
|
|
|
337
371
|
<div
|
|
338
372
|
role='group'
|
|
339
373
|
className={mx(
|
|
340
|
-
'flex flex-col
|
|
374
|
+
'flex flex-col w-full dx-density-fine',
|
|
341
375
|
outline &&
|
|
342
|
-
'bg-
|
|
376
|
+
'bg-group-surface border border-subdued-separator transition transition-border [&:has(.cm-content:focus)]:border-separator rounded-sm',
|
|
343
377
|
classNames,
|
|
344
378
|
)}
|
|
345
379
|
>
|
|
@@ -349,7 +383,7 @@ const ChatPrompt = ({
|
|
|
349
383
|
ref={editorRef}
|
|
350
384
|
autoFocus
|
|
351
385
|
lineWrapping
|
|
352
|
-
classNames='col-span-2
|
|
386
|
+
classNames='col-span-2 pt-0.5'
|
|
353
387
|
placeholder={placeholder ?? t('prompt placeholder')}
|
|
354
388
|
extensions={extensions}
|
|
355
389
|
onSubmit={handleSubmit}
|
|
@@ -382,7 +416,7 @@ const ChatPrompt = ({
|
|
|
382
416
|
{online !== undefined && (
|
|
383
417
|
<Input.Root>
|
|
384
418
|
<Input.Label srOnly>{t('online switch label')}</Input.Label>
|
|
385
|
-
<Input.Switch classNames='
|
|
419
|
+
<Input.Switch classNames='mx-2' checked={online} onCheckedChange={onOnlineChange} />
|
|
386
420
|
</Input.Root>
|
|
387
421
|
)}
|
|
388
422
|
</ChatActions>
|
|
@@ -392,29 +426,32 @@ const ChatPrompt = ({
|
|
|
392
426
|
);
|
|
393
427
|
};
|
|
394
428
|
|
|
395
|
-
ChatPrompt.displayName =
|
|
429
|
+
ChatPrompt.displayName = CHAT_PROMPT_NAME;
|
|
396
430
|
|
|
397
431
|
//
|
|
398
432
|
// Toolbar
|
|
399
433
|
//
|
|
400
434
|
|
|
401
|
-
|
|
435
|
+
const CHAT_TOOLBAR_NAME = 'Chat.Toolbar';
|
|
436
|
+
|
|
437
|
+
type ChatToolbarProps = ThemedClassName<{ companionTo?: Obj.Unknown } & ComponentPropsWithoutRef<typeof Menu.Root>>;
|
|
402
438
|
|
|
403
|
-
const ChatToolbar = ({ classNames, companionTo }: ChatToolbarProps) => {
|
|
404
|
-
const { chat } = useChatContext(
|
|
439
|
+
const ChatToolbar = ({ classNames, companionTo, ...props }: ChatToolbarProps) => {
|
|
440
|
+
const { chat } = useChatContext(CHAT_TOOLBAR_NAME);
|
|
405
441
|
const menu = useChatToolbarActions({ chat, companionTo });
|
|
406
442
|
|
|
407
443
|
return (
|
|
408
|
-
<
|
|
444
|
+
<Menu.Root
|
|
445
|
+
{...props}
|
|
409
446
|
{...menu}
|
|
410
447
|
attendableId={companionTo ? Obj.getDXN(companionTo).toString() : chat ? Obj.getDXN(chat).toString() : ''}
|
|
411
448
|
>
|
|
412
|
-
<
|
|
413
|
-
</
|
|
449
|
+
<Menu.Toolbar classNames={classNames} textBlockWidth />
|
|
450
|
+
</Menu.Root>
|
|
414
451
|
);
|
|
415
452
|
};
|
|
416
453
|
|
|
417
|
-
ChatToolbar.displayName =
|
|
454
|
+
ChatToolbar.displayName = CHAT_TOOLBAR_NAME;
|
|
418
455
|
|
|
419
456
|
//
|
|
420
457
|
// Chat
|
|
@@ -4,13 +4,12 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
6
6
|
|
|
7
|
+
import { type Chat } from '@dxos/assistant-toolkit';
|
|
7
8
|
import { addEventListener } from '@dxos/async';
|
|
8
9
|
import { ProgressBar, type ProgressBarProps, TextCrawl, useExecutionGraph } from '@dxos/react-ui-components';
|
|
9
10
|
|
|
10
|
-
import { type Assistant } from '../../types';
|
|
11
|
-
|
|
12
11
|
export type ChatProgressProps = {
|
|
13
|
-
chat:
|
|
12
|
+
chat: Chat.Chat;
|
|
14
13
|
};
|
|
15
14
|
|
|
16
15
|
export const ChatProgress = ({ chat }: ChatProgressProps) => {
|
|
@@ -46,9 +45,9 @@ export const ChatProgress = ({ chat }: ChatProgressProps) => {
|
|
|
46
45
|
}, [nodes.length]);
|
|
47
46
|
|
|
48
47
|
return (
|
|
49
|
-
<div role='none' tabIndex={0} ref={ref} className='flex flex-col outline-
|
|
48
|
+
<div role='none' tabIndex={0} ref={ref} className='flex flex-col outline-hidden'>
|
|
50
49
|
<ProgressBar nodes={nodes} index={index} onSelect={handleSelect} />
|
|
51
|
-
<TextCrawl classNames='
|
|
50
|
+
<TextCrawl classNames='ps-4 text-sm text-description' lines={lines} autoAdvance />
|
|
52
51
|
</div>
|
|
53
52
|
);
|
|
54
53
|
};
|
|
@@ -23,7 +23,7 @@ export const ChatActions = ({ classNames, children, microphone, recording, proce
|
|
|
23
23
|
const { t } = useTranslation(meta.id);
|
|
24
24
|
|
|
25
25
|
return (
|
|
26
|
-
<div className={mx('flex items-center
|
|
26
|
+
<div className={mx('flex items-center me-1', classNames)}>
|
|
27
27
|
{children}
|
|
28
28
|
|
|
29
29
|
<IconButton
|
|
@@ -50,6 +50,14 @@ export const ChatActions = ({ classNames, children, microphone, recording, proce
|
|
|
50
50
|
onTouchEnd={() => onEvent?.({ type: 'record-stop' })}
|
|
51
51
|
/>
|
|
52
52
|
)}
|
|
53
|
+
|
|
54
|
+
<IconButton
|
|
55
|
+
variant='ghost'
|
|
56
|
+
icon='ph--wrench--regular'
|
|
57
|
+
iconOnly
|
|
58
|
+
label={t('debug button')}
|
|
59
|
+
onClick={() => onEvent?.({ type: 'toggle-debug' })}
|
|
60
|
+
/>
|
|
53
61
|
</div>
|
|
54
62
|
);
|
|
55
63
|
};
|
|
@@ -2,15 +2,18 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import * as Option from 'effect/Option';
|
|
5
6
|
import React, { type JSX, useMemo, useState } from 'react';
|
|
6
7
|
|
|
7
8
|
import { type AiContextBinder } from '@dxos/assistant';
|
|
8
9
|
import { type Blueprint } from '@dxos/blueprints';
|
|
9
10
|
import { type Database, Filter, Obj, Type } from '@dxos/echo';
|
|
11
|
+
import { Annotation } from '@dxos/echo';
|
|
10
12
|
import { useQuery } from '@dxos/react-client/echo';
|
|
11
13
|
import { IconButton, Popover, Select, useTranslation } from '@dxos/react-ui';
|
|
12
14
|
import { Listbox, SearchList, useSearchListResults } from '@dxos/react-ui-searchlist';
|
|
13
15
|
import { Tabs } from '@dxos/react-ui-tabs';
|
|
16
|
+
import { getStyles, mx } from '@dxos/ui-theme';
|
|
14
17
|
|
|
15
18
|
import {
|
|
16
19
|
useActiveBlueprints,
|
|
@@ -21,7 +24,7 @@ import {
|
|
|
21
24
|
} from '../../hooks';
|
|
22
25
|
import { meta } from '../../meta';
|
|
23
26
|
|
|
24
|
-
const panelClassNames = '
|
|
27
|
+
const panelClassNames = 'w-[calc(100dvw-.5rem)] sm:w-max md:w-72 max-w-text-content';
|
|
25
28
|
|
|
26
29
|
export type ChatOptionsProps = {
|
|
27
30
|
db: Database.Database;
|
|
@@ -67,14 +70,21 @@ export const ChatOptions = ({ db, context, blueprintRegistry, presets, preset, o
|
|
|
67
70
|
<Popover.Content side='top' classNames={panelClassNames}>
|
|
68
71
|
<Popover.Viewport>
|
|
69
72
|
<Tabs.Root orientation='horizontal' defaultValue='blueprints' defaultActivePart='list' tabIndex={-1}>
|
|
70
|
-
<Tabs.Viewport
|
|
73
|
+
<Tabs.Viewport
|
|
74
|
+
classNames={mx(
|
|
75
|
+
'max-h-(--radix-popover-content-available-height) grid grid-rows-[1fr_min-content]',
|
|
76
|
+
'[&_[cmdk-root]]:contents [&_[role="tabpanel"]]:grid [&_[role="tabpanel"]]:grid-rows-[1fr_min-content]',
|
|
77
|
+
'[&_[role="listbox"]]:min-h-0 [&_[role="listbox"]]:overflow-y-auto',
|
|
78
|
+
'[&_[role="tabpanel"]]:min-h-0 [&_[role="tabpanel"]]:px-form-chrome [&_[role="tabpanel"][data-state="active"]]:order-first [&_[role="tabpanel"][data-state="inactive"]]:hidden',
|
|
79
|
+
)}
|
|
80
|
+
>
|
|
71
81
|
<Tabs.Tabpanel value='blueprints' tabIndex={-1} classNames='dx-focus-ring-inset'>
|
|
72
82
|
<BlueprintsPanel blueprintRegistry={blueprintRegistry} db={db} context={context} />
|
|
73
83
|
</Tabs.Tabpanel>
|
|
74
|
-
<Tabs.Tabpanel value='model' tabIndex={-1} classNames='dx-focus-ring-inset
|
|
84
|
+
<Tabs.Tabpanel value='model' tabIndex={-1} classNames='dx-focus-ring-inset px-0!'>
|
|
75
85
|
<ModelsPanel presets={presets} preset={preset} onPresetChange={onPresetChange} />
|
|
76
86
|
</Tabs.Tabpanel>
|
|
77
|
-
<Tabs.Tablist classNames='sm:overflow-x-hidden justify-center p-
|
|
87
|
+
<Tabs.Tablist classNames='sm:overflow-x-hidden justify-center p-form-chrome border-y border-subdued-separator order-last'>
|
|
78
88
|
<Tabs.IconTab
|
|
79
89
|
value='blueprints'
|
|
80
90
|
icon='ph--blueprint--regular'
|
|
@@ -111,7 +121,7 @@ const BlueprintsPanel = ({
|
|
|
111
121
|
|
|
112
122
|
return (
|
|
113
123
|
<SearchList.Root onSearch={handleSearch}>
|
|
114
|
-
<SearchList.Content classNames='
|
|
124
|
+
<SearchList.Content classNames='py-form-chrome'>
|
|
115
125
|
<SearchList.Viewport>
|
|
116
126
|
{results.map((blueprint) => {
|
|
117
127
|
const isActive = activeBlueprints.has(blueprint.key);
|
|
@@ -128,7 +138,7 @@ const BlueprintsPanel = ({
|
|
|
128
138
|
})}
|
|
129
139
|
</SearchList.Viewport>
|
|
130
140
|
</SearchList.Content>
|
|
131
|
-
<SearchList.Input placeholder={t('search placeholder')} classNames='
|
|
141
|
+
<SearchList.Input placeholder={t('search placeholder')} classNames='mb-form-chrome' autoFocus />
|
|
132
142
|
</SearchList.Root>
|
|
133
143
|
);
|
|
134
144
|
};
|
|
@@ -190,16 +200,23 @@ const ObjectsPanel = ({ db, context }: Pick<ChatOptionsProps, 'db' | 'context'>)
|
|
|
190
200
|
|
|
191
201
|
return (
|
|
192
202
|
<SearchList.Root onSearch={handleSearch}>
|
|
193
|
-
<SearchList.Content classNames='p-
|
|
203
|
+
<SearchList.Content classNames='p-form-chrome [&:has([cmdk-list-sizer]:empty)]:py-0'>
|
|
194
204
|
<SearchList.Viewport>
|
|
195
205
|
{results.length ? (
|
|
196
206
|
results.map((object) => {
|
|
197
207
|
const isActive = contextObjects.findIndex((obj) => obj.id === object.id) !== -1;
|
|
208
|
+
const { icon, hue } = Option.fromNullable(Obj.getSchema(object)).pipe(
|
|
209
|
+
Option.flatMap(Annotation.IconAnnotation.get),
|
|
210
|
+
Option.getOrElse(() => ({ icon: DEFAULT_OBJECT_ICON, hue: undefined as string | undefined })),
|
|
211
|
+
);
|
|
212
|
+
const styles = hue ? getStyles(hue) : undefined;
|
|
198
213
|
return (
|
|
199
214
|
<SearchList.Item
|
|
200
215
|
classNames='flex items-center overflow-hidden'
|
|
201
216
|
key={object.id}
|
|
202
217
|
value={object.id}
|
|
218
|
+
icon={icon}
|
|
219
|
+
iconClassNames={styles?.surfaceText}
|
|
203
220
|
label={Obj.getLabel(object) ?? Obj.getTypename(object) ?? object.id}
|
|
204
221
|
checked={isActive}
|
|
205
222
|
onSelect={() => onUpdateObject?.(Obj.getDXN(object), !isActive)}
|
|
@@ -212,7 +229,7 @@ const ObjectsPanel = ({ db, context }: Pick<ChatOptionsProps, 'db' | 'context'>)
|
|
|
212
229
|
</SearchList.Viewport>
|
|
213
230
|
</SearchList.Content>
|
|
214
231
|
|
|
215
|
-
<div role='none' className='grid grid-cols-[min-content_1fr] gap-2
|
|
232
|
+
<div role='none' className='grid grid-cols-[min-content_1fr] gap-2 px-form-chrome mb-form-chrome'>
|
|
216
233
|
<Select.Root value={typename === ANY ? undefined : typename} onValueChange={setTypename}>
|
|
217
234
|
<Select.TriggerButton density='fine' placeholder={t('type filter placeholder')} />
|
|
218
235
|
<Select.Portal>
|
|
@@ -231,8 +248,11 @@ const ObjectsPanel = ({ db, context }: Pick<ChatOptionsProps, 'db' | 'context'>)
|
|
|
231
248
|
</Select.Content>
|
|
232
249
|
</Select.Portal>
|
|
233
250
|
</Select.Root>
|
|
234
|
-
<SearchList.Input placeholder={t('search placeholder')} classNames='
|
|
251
|
+
<SearchList.Input placeholder={t('search placeholder')} classNames='mb-0' autoFocus />
|
|
235
252
|
</div>
|
|
236
253
|
</SearchList.Root>
|
|
237
254
|
);
|
|
238
255
|
};
|
|
256
|
+
|
|
257
|
+
// TODO(dmaretskyi): Extract those somewhere else.
|
|
258
|
+
const DEFAULT_OBJECT_ICON = 'ph--cube--regular';
|
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import * as Option from 'effect/Option';
|
|
5
6
|
import React from 'react';
|
|
6
7
|
|
|
7
8
|
import { type AiContextBinder } from '@dxos/assistant';
|
|
8
|
-
import { type Database, Obj } from '@dxos/echo';
|
|
9
|
-
import { IconButton, type Label, type ThemedClassName, toLocalizedString, useTranslation } from '@dxos/react-ui';
|
|
10
|
-
import { mx } from '@dxos/ui-theme';
|
|
9
|
+
import { Annotation, type Database, Obj } from '@dxos/echo';
|
|
10
|
+
import { Icon, IconButton, type Label, type ThemedClassName, toLocalizedString, useTranslation } from '@dxos/react-ui';
|
|
11
|
+
import { getStyles, mx } from '@dxos/ui-theme';
|
|
11
12
|
|
|
12
13
|
import { useContextObjects } from '../../hooks';
|
|
13
14
|
import { meta } from '../../meta';
|
|
@@ -27,8 +28,14 @@ export const ChatReferences = ({ classNames, context, db }: ChatReferencesProps)
|
|
|
27
28
|
const dxn = Obj.getDXN(obj);
|
|
28
29
|
const typename = Obj.getTypename(obj);
|
|
29
30
|
const label: Label = Obj.getLabel(obj) ?? (typename ? ['object name placeholder', { ns: typename }] : obj.id);
|
|
31
|
+
const { icon, hue } = Option.fromNullable(Obj.getSchema(obj)).pipe(
|
|
32
|
+
Option.flatMap(Annotation.IconAnnotation.get),
|
|
33
|
+
Option.getOrElse(() => ({ icon: DEFAULT_OBJECT_ICON, hue: undefined as string | undefined })),
|
|
34
|
+
);
|
|
35
|
+
const styles = hue ? getStyles(hue) : undefined;
|
|
30
36
|
return (
|
|
31
|
-
<li key={dxn.toString()} className='dx-tag
|
|
37
|
+
<li key={dxn.toString()} className='dx-tag py-0 ps-2 flex items-center gap-1' data-hue='neutral'>
|
|
38
|
+
<Icon icon={icon} size={4} classNames={styles?.surfaceText} />
|
|
32
39
|
{toLocalizedString(label, t)}
|
|
33
40
|
<IconButton
|
|
34
41
|
icon='ph--x--bold'
|
|
@@ -45,3 +52,6 @@ export const ChatReferences = ({ classNames, context, db }: ChatReferencesProps)
|
|
|
45
52
|
</ul>
|
|
46
53
|
);
|
|
47
54
|
};
|
|
55
|
+
|
|
56
|
+
// TODO(dmaretskyi): Extract those somewhere else.
|
|
57
|
+
const DEFAULT_OBJECT_ICON = 'ph--cube--regular';
|