@dxos/plugin-assistant 0.8.4-main.3eb6e50203 → 0.8.4-main.4a85c3132b
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-2LFAG5OQ.mjs +93 -0
- package/dist/lib/browser/AssistantSettings-2LFAG5OQ.mjs.map +7 -0
- package/dist/lib/browser/BlueprintArticle-CCS25MNW.mjs +36 -0
- package/dist/lib/browser/BlueprintArticle-CCS25MNW.mjs.map +7 -0
- package/dist/lib/browser/{ChatCompanion-CAKFZAWN.mjs → ChatCompanion-UGD4V34A.mjs} +11 -9
- package/dist/lib/browser/ChatCompanion-UGD4V34A.mjs.map +7 -0
- package/dist/lib/browser/ChatContainer-ZGRSZ5EU.mjs +12 -0
- package/dist/lib/browser/{ChatDialog-ASVBLOOS.mjs → ChatDialog-AET7GVIB.mjs} +7 -7
- package/dist/lib/browser/ChatDialog-AET7GVIB.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-R6RRARLO.mjs +194 -0
- package/dist/lib/browser/ProjectSettings-R6RRARLO.mjs.map +7 -0
- package/dist/lib/browser/PromptArticle-USQO4WX6.mjs +71 -0
- package/dist/lib/browser/PromptArticle-USQO4WX6.mjs.map +7 -0
- package/dist/lib/browser/TriggerStatus-65X3EUSN.mjs +122 -0
- package/dist/lib/browser/TriggerStatus-65X3EUSN.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-builder-MUZGUQSC.mjs → app-graph-builder-SFYYUKTT.mjs} +3 -3
- package/dist/lib/{node-esm/app-graph-builder-4QN5M6PD.mjs.map → browser/app-graph-builder-SFYYUKTT.mjs.map} +2 -2
- package/dist/lib/browser/blueprint-definition-5LQNBZON.mjs +35 -0
- package/dist/lib/browser/blueprint-definition-5LQNBZON.mjs.map +7 -0
- package/dist/lib/browser/blueprints/index.mjs +3 -7
- package/dist/lib/browser/{chunk-6BVCG5SJ.mjs → chunk-7DXYAXLZ.mjs} +8 -8
- package/dist/lib/browser/chunk-7DXYAXLZ.mjs.map +7 -0
- package/dist/lib/browser/{chunk-IJYAKPEU.mjs → chunk-JYY5AD65.mjs} +27 -27
- package/dist/lib/browser/chunk-JYY5AD65.mjs.map +7 -0
- package/dist/lib/browser/chunk-LEXIQDXZ.mjs +26 -0
- package/dist/lib/browser/chunk-LEXIQDXZ.mjs.map +7 -0
- package/dist/lib/browser/{ChatContainer-QB37VONJ.mjs → chunk-RU4G5NY4.mjs} +17 -21
- package/dist/lib/browser/chunk-RU4G5NY4.mjs.map +7 -0
- package/dist/lib/browser/{chunk-JA7PUZC7.mjs → chunk-UUA6GNGG.mjs} +544 -393
- package/dist/lib/browser/chunk-UUA6GNGG.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +38 -54
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{operation-resolver-2673CFJS.mjs → operation-resolver-ELXDQZEG.mjs} +23 -20
- package/dist/lib/browser/operation-resolver-ELXDQZEG.mjs.map +7 -0
- package/dist/lib/browser/{react-surface-T3FN4GVP.mjs → react-surface-KYQSZO2I.mjs} +42 -23
- package/dist/lib/browser/react-surface-KYQSZO2I.mjs.map +7 -0
- package/dist/lib/browser/{repair-IRXDYF4R.mjs → repair-ZFZWZALX.mjs} +9 -8
- package/dist/lib/browser/repair-ZFZWZALX.mjs.map +7 -0
- package/dist/lib/browser/{settings-XF6GKHCG.mjs → settings-YREVQAZ5.mjs} +2 -2
- package/dist/lib/browser/{state-OYDPWLKA.mjs → state-MPG42ZO4.mjs} +2 -2
- 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 +1 -1
- package/dist/lib/node-esm/AssistantSettings-QWFEMJG7.mjs +94 -0
- package/dist/lib/node-esm/AssistantSettings-QWFEMJG7.mjs.map +7 -0
- package/dist/lib/node-esm/BlueprintArticle-SNEN6LOY.mjs +37 -0
- package/dist/lib/node-esm/BlueprintArticle-SNEN6LOY.mjs.map +7 -0
- package/dist/lib/node-esm/{ChatCompanion-W4PGOCGR.mjs → ChatCompanion-NP4R5BFE.mjs} +11 -9
- package/dist/lib/node-esm/ChatCompanion-NP4R5BFE.mjs.map +7 -0
- package/dist/lib/node-esm/ChatContainer-IFHDIFJH.mjs +13 -0
- package/dist/lib/node-esm/{ChatDialog-AFLPYSIU.mjs → ChatDialog-UZNQBTKZ.mjs} +7 -7
- package/dist/lib/node-esm/ChatDialog-UZNQBTKZ.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-Q5QY6BYS.mjs +195 -0
- package/dist/lib/node-esm/ProjectSettings-Q5QY6BYS.mjs.map +7 -0
- package/dist/lib/node-esm/PromptArticle-PGMJMQK7.mjs +72 -0
- package/dist/lib/node-esm/PromptArticle-PGMJMQK7.mjs.map +7 -0
- package/dist/lib/node-esm/TriggerStatus-UR5S7PXJ.mjs +123 -0
- package/dist/lib/node-esm/TriggerStatus-UR5S7PXJ.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-builder-4QN5M6PD.mjs → app-graph-builder-E25JXI34.mjs} +3 -3
- package/dist/lib/node-esm/app-graph-builder-E25JXI34.mjs.map +7 -0
- package/dist/lib/node-esm/blueprint-definition-CMJWGGJO.mjs +36 -0
- package/dist/lib/node-esm/blueprint-definition-CMJWGGJO.mjs.map +7 -0
- package/dist/lib/node-esm/blueprints/index.mjs +3 -7
- package/dist/lib/node-esm/chunk-3QBVFAYO.mjs +28 -0
- package/dist/lib/node-esm/chunk-3QBVFAYO.mjs.map +7 -0
- package/dist/lib/node-esm/{ChatContainer-ECFQVH6O.mjs → chunk-6NCLKQCL.mjs} +17 -21
- package/dist/lib/node-esm/chunk-6NCLKQCL.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-3XC7LQSO.mjs → chunk-GZ4ERNT2.mjs} +544 -393
- package/dist/lib/node-esm/chunk-GZ4ERNT2.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-MJD5XWQV.mjs → chunk-JMBYVUD6.mjs} +27 -27
- package/dist/lib/node-esm/chunk-JMBYVUD6.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-LB72WG6R.mjs → chunk-MWYYLALM.mjs} +8 -8
- package/dist/lib/node-esm/chunk-MWYYLALM.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +38 -54
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{operation-resolver-2ZD2DXOU.mjs → operation-resolver-Q5GNP2GH.mjs} +23 -20
- package/dist/lib/node-esm/operation-resolver-Q5GNP2GH.mjs.map +7 -0
- package/dist/lib/node-esm/{react-surface-T4VMCCKZ.mjs → react-surface-JJRGVGKD.mjs} +42 -23
- package/dist/lib/node-esm/react-surface-JJRGVGKD.mjs.map +7 -0
- package/dist/lib/node-esm/{repair-DMI55PON.mjs → repair-LXFVOK4B.mjs} +9 -8
- package/dist/lib/node-esm/repair-LXFVOK4B.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-NGGZA7S7.mjs → settings-N452OW6Y.mjs} +2 -2
- package/dist/lib/node-esm/{state-VSCPGN7R.mjs → state-WHZFKIEL.mjs} +2 -2
- package/dist/lib/node-esm/{toolkit-JPRJRDDB.mjs → toolkit-5IWGLUF4.mjs} +3 -6
- package/dist/lib/node-esm/toolkit-5IWGLUF4.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +1 -1
- 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 +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 +2 -22
- 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 +1 -1
- package/dist/types/src/capabilities/edge-model-resolver/edge-model-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/local-model-resolver/local-model-resolver.d.ts +1 -1
- package/dist/types/src/capabilities/local-model-resolver/local-model-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +1 -1
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +1 -1
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/repair/repair.d.ts +1 -1
- package/dist/types/src/capabilities/repair/repair.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings/settings.d.ts +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 +1 -1
- package/dist/types/src/capabilities/toolkit/toolkit.d.ts.map +1 -1
- package/dist/types/src/components/Chat/Chat.d.ts +6 -5
- package/dist/types/src/components/Chat/Chat.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 +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts +15 -15
- 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 +14 -14
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts +14 -14
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts +14 -14
- 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 -11
- 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/{components → containers/BlueprintArticle}/BlueprintArticle.d.ts +0 -1
- 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 +0 -1
- 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 +2 -3
- 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 +0 -1
- 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/{components → containers/PromptArticle}/PromptArticle.d.ts +0 -1
- 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/{components → containers}/TriggerStatus/TriggerStatus.d.ts.map +1 -1
- 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/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 +1 -1
- package/dist/types/src/processor/processor.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +14 -14
- package/dist/types/src/types/AssistantAction.d.ts +7 -11
- package/dist/types/src/types/AssistantAction.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 +82 -82
- package/src/AssistantPlugin.tsx +12 -9
- 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/app-graph-builder/app-graph-builder.ts +1 -3
- package/src/capabilities/blueprint-definition/blueprint-definition.ts +25 -49
- package/src/capabilities/blueprint-definition/index.ts +0 -1
- package/src/capabilities/operation-resolver/operation-resolver.ts +21 -12
- package/src/capabilities/react-surface/react-surface.tsx +21 -11
- package/src/capabilities/repair/repair.ts +14 -7
- package/src/capabilities/toolkit/toolkit.ts +3 -15
- package/src/components/Chat/Chat.tsx +25 -15
- package/src/components/ChatProgress/ChatProgress.tsx +2 -2
- package/src/components/ChatPrompt/ChatActions.tsx +1 -1
- package/src/components/ChatPrompt/ChatOptions.tsx +29 -9
- package/src/components/ChatPrompt/ChatReferences.tsx +14 -4
- package/src/components/ChatThread/ChatThread.stories.tsx +4 -4
- package/src/components/ChatThread/ChatThread.tsx +2 -2
- package/src/components/ChatThread/registry.tsx +48 -15
- package/src/components/ChatThread/sync.test.ts +2 -0
- package/src/components/ChatThread/sync.ts +14 -8
- package/src/components/TemplateEditor/TemplateEditor.stories.tsx +2 -2
- package/src/components/TemplateEditor/TemplateEditor.tsx +2 -2
- package/src/components/TemplateEditor/TemplateForm.stories.tsx +2 -2
- package/src/components/TemplateEditor/TemplateForm.tsx +6 -7
- package/src/components/TemplateEditor/extensions/handlebars-extension.ts +4 -4
- package/src/components/ToolBlock/ToolBlock.tsx +4 -4
- package/src/components/Toolbox/Toolbox.stories.tsx +2 -2
- package/src/components/Toolbox/Toolbox.tsx +2 -2
- 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 -18
- package/src/containers/AssistantSettings/index.ts +7 -0
- package/src/{components → containers/BlueprintArticle}/BlueprintArticle.tsx +10 -8
- package/src/containers/BlueprintArticle/index.ts +7 -0
- package/src/{components → containers/ChatCompanion}/ChatCompanion.tsx +4 -5
- package/src/containers/ChatCompanion/index.ts +7 -0
- package/src/{components → containers/ChatContainer}/ChatContainer.tsx +25 -24
- package/src/containers/ChatContainer/index.ts +7 -0
- package/src/{components → containers/ChatDialog}/ChatDialog.tsx +4 -7
- package/src/containers/ChatDialog/index.ts +7 -0
- package/src/containers/Project/ProjectArticle.tsx +117 -0
- package/src/containers/Project/ProjectSettings.tsx +118 -0
- package/src/containers/Project/index.ts +16 -0
- package/src/containers/Project/triggers.ts +131 -0
- package/src/containers/PromptArticle/PromptArticle.tsx +59 -0
- package/src/containers/PromptArticle/index.ts +7 -0
- package/src/{components → containers}/TriggerStatus/TriggerStatus.tsx +12 -4
- package/src/containers/TriggerStatus/index.ts +7 -0
- package/src/containers/index.ts +15 -0
- package/src/hooks/useBlueprintRegistry.ts +5 -2
- package/src/hooks/useFilteredTypes.ts +2 -2
- package/src/hooks/useReferencesProvider.ts +1 -5
- package/src/index.ts +1 -0
- package/src/processor/processor.test.ts +2 -1
- package/src/processor/processor.ts +17 -22
- package/src/testing/test-sequence.ts +3 -3
- package/src/testing/test-services.ts +1 -1
- package/src/translations.ts +11 -11
- package/src/types/AssistantAction.ts +3 -3
- package/src/types/service.ts +3 -3
- package/dist/lib/browser/BlueprintArticle-6SP2ZWJ2.mjs +0 -30
- package/dist/lib/browser/BlueprintArticle-6SP2ZWJ2.mjs.map +0 -7
- package/dist/lib/browser/ChatCompanion-CAKFZAWN.mjs.map +0 -7
- package/dist/lib/browser/ChatContainer-QB37VONJ.mjs.map +0 -7
- package/dist/lib/browser/ChatDialog-ASVBLOOS.mjs.map +0 -7
- package/dist/lib/browser/InitiativeContainer-V522FCYH.mjs +0 -266
- package/dist/lib/browser/InitiativeContainer-V522FCYH.mjs.map +0 -7
- package/dist/lib/browser/PromptArticle-PK3CBRUB.mjs +0 -52
- package/dist/lib/browser/PromptArticle-PK3CBRUB.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-MUZGUQSC.mjs.map +0 -7
- package/dist/lib/browser/blueprint-definition-YAGWYVCL.mjs +0 -14
- package/dist/lib/browser/chunk-3ETBCBMH.mjs +0 -47
- package/dist/lib/browser/chunk-3ETBCBMH.mjs.map +0 -7
- package/dist/lib/browser/chunk-6BVCG5SJ.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-IJYAKPEU.mjs.map +0 -7
- package/dist/lib/browser/chunk-JA7PUZC7.mjs.map +0 -7
- package/dist/lib/browser/chunk-POPBT2AQ.mjs +0 -198
- package/dist/lib/browser/chunk-POPBT2AQ.mjs.map +0 -7
- package/dist/lib/browser/operation-resolver-2673CFJS.mjs.map +0 -7
- package/dist/lib/browser/react-surface-T3FN4GVP.mjs.map +0 -7
- package/dist/lib/browser/repair-IRXDYF4R.mjs.map +0 -7
- package/dist/lib/browser/toolkit-IDXQCSTX.mjs +0 -19
- package/dist/lib/browser/toolkit-IDXQCSTX.mjs.map +0 -7
- package/dist/lib/node-esm/BlueprintArticle-7LI6UXKZ.mjs +0 -31
- package/dist/lib/node-esm/BlueprintArticle-7LI6UXKZ.mjs.map +0 -7
- package/dist/lib/node-esm/ChatCompanion-W4PGOCGR.mjs.map +0 -7
- package/dist/lib/node-esm/ChatContainer-ECFQVH6O.mjs.map +0 -7
- package/dist/lib/node-esm/ChatDialog-AFLPYSIU.mjs.map +0 -7
- package/dist/lib/node-esm/InitiativeContainer-U4LGO3BW.mjs +0 -267
- package/dist/lib/node-esm/InitiativeContainer-U4LGO3BW.mjs.map +0 -7
- package/dist/lib/node-esm/PromptArticle-BHPABYLT.mjs +0 -53
- package/dist/lib/node-esm/PromptArticle-BHPABYLT.mjs.map +0 -7
- package/dist/lib/node-esm/blueprint-definition-H3LFAEK2.mjs +0 -15
- package/dist/lib/node-esm/chunk-2LEN26ZQ.mjs +0 -48
- package/dist/lib/node-esm/chunk-2LEN26ZQ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-3XC7LQSO.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-F6LA7XNS.mjs +0 -199
- package/dist/lib/node-esm/chunk-F6LA7XNS.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-LB72WG6R.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-MJD5XWQV.mjs.map +0 -7
- package/dist/lib/node-esm/operation-resolver-2ZD2DXOU.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-T4VMCCKZ.mjs.map +0 -7
- package/dist/lib/node-esm/repair-DMI55PON.mjs.map +0 -7
- package/dist/lib/node-esm/toolkit-JPRJRDDB.mjs.map +0 -7
- package/dist/types/src/blueprints/assistant-blueprint.d.ts +0 -11
- package/dist/types/src/blueprints/assistant-blueprint.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.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/InitiativeContainer.d.ts +0 -9
- package/dist/types/src/components/InitiativeContainer.d.ts.map +0 -1
- package/dist/types/src/components/PromptArticle.d.ts.map +0 -1
- package/dist/types/src/components/TriggerStatus/TriggerStatus.d.ts +0 -4
- package/dist/types/src/components/TriggerStatus/index.d.ts +0 -2
- package/dist/types/src/components/TriggerStatus/index.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 -57
- package/src/components/AssistantSettings/index.ts +0 -5
- package/src/components/InitiativeContainer.tsx +0 -340
- package/src/components/PromptArticle.tsx +0 -49
- package/src/components/TriggerStatus/index.ts +0 -5
- package/src/functions/index.ts +0 -7
- package/src/functions/object-list.ts +0 -49
- package/src/functions/object-load.ts +0 -44
- package/src/functions/object-search.ts +0 -46
- /package/dist/lib/browser/{blueprint-definition-YAGWYVCL.mjs.map → ChatContainer-ZGRSZ5EU.mjs.map} +0 -0
- /package/dist/lib/browser/{settings-XF6GKHCG.mjs.map → settings-YREVQAZ5.mjs.map} +0 -0
- /package/dist/lib/browser/{state-OYDPWLKA.mjs.map → state-MPG42ZO4.mjs.map} +0 -0
- /package/dist/lib/node-esm/{blueprint-definition-H3LFAEK2.mjs.map → ChatContainer-IFHDIFJH.mjs.map} +0 -0
- /package/dist/lib/node-esm/{settings-NGGZA7S7.mjs.map → settings-N452OW6Y.mjs.map} +0 -0
- /package/dist/lib/node-esm/{state-VSCPGN7R.mjs.map → state-WHZFKIEL.mjs.map} +0 -0
- /package/dist/types/src/{components → containers}/AssistantSettings/AssistantSettings.d.ts +0 -0
- /package/src/{components → containers}/AssistantSettings/AssistantSettings.tsx +0 -0
|
@@ -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';
|
|
@@ -15,10 +15,10 @@ import { faker } from '@dxos/random';
|
|
|
15
15
|
import { useQueue, useSpace } from '@dxos/react-client/echo';
|
|
16
16
|
import { withClientProvider } from '@dxos/react-client/testing';
|
|
17
17
|
import { Popover } from '@dxos/react-ui';
|
|
18
|
+
import { Card } from '@dxos/react-ui';
|
|
18
19
|
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
19
20
|
import { MarkdownStream } from '@dxos/react-ui-components';
|
|
20
21
|
import { EditorPreviewProvider, useEditorPreview } from '@dxos/react-ui-editor';
|
|
21
|
-
import { Card } from '@dxos/react-ui-mosaic';
|
|
22
22
|
import { render } from '@dxos/storybook-utils';
|
|
23
23
|
import { type Message, Organization, Person } from '@dxos/types';
|
|
24
24
|
|
|
@@ -95,7 +95,7 @@ const PreviewCard = () => {
|
|
|
95
95
|
};
|
|
96
96
|
|
|
97
97
|
const meta = {
|
|
98
|
-
title: 'plugins/plugin-assistant/ChatThread',
|
|
98
|
+
title: 'plugins/plugin-assistant/components/ChatThread',
|
|
99
99
|
component: ChatThread,
|
|
100
100
|
render: render(DefaultStory),
|
|
101
101
|
decorators: [
|
|
@@ -135,7 +135,7 @@ export const Delayed: Story = {
|
|
|
135
135
|
|
|
136
136
|
export const Raw: Story = {
|
|
137
137
|
render: () => (
|
|
138
|
-
<div className='contents' style={{ '--user-fill': 'var(--
|
|
138
|
+
<div className='contents' style={{ '--user-fill': 'var(--color-amber-fill)' } as CSSProperties}>
|
|
139
139
|
<MarkdownStream content={TEXT} />
|
|
140
140
|
</div>
|
|
141
141
|
),
|
|
@@ -143,7 +143,7 @@ export const Raw: Story = {
|
|
|
143
143
|
|
|
144
144
|
export const Static: Story = {
|
|
145
145
|
render: () => (
|
|
146
|
-
<div className='contents' style={{ '--user-fill': 'var(--
|
|
146
|
+
<div className='contents' style={{ '--user-fill': 'var(--color-amber-fill)' } as CSSProperties}>
|
|
147
147
|
<MarkdownStream content={TEXT} registry={componentRegistry} />
|
|
148
148
|
</div>
|
|
149
149
|
),
|
|
@@ -79,8 +79,8 @@ export const ChatThread = forwardRef<MarkdownStreamController | null, ChatThread
|
|
|
79
79
|
return (
|
|
80
80
|
<div
|
|
81
81
|
role='none'
|
|
82
|
-
className={mx('flex
|
|
83
|
-
style={{ '--user-fill': `var(--
|
|
82
|
+
className={mx('flex h-full w-full justify-center overflow-hidden', classNames)}
|
|
83
|
+
style={{ '--user-fill': `var(--color-${userHue}-fill)` } as CSSProperties}
|
|
84
84
|
>
|
|
85
85
|
<MarkdownStream
|
|
86
86
|
ref={refCallback}
|
|
@@ -8,6 +8,7 @@ import { log } from '@dxos/log';
|
|
|
8
8
|
import { ToggleContainer } from '@dxos/react-ui-components';
|
|
9
9
|
import {
|
|
10
10
|
PromptWidget,
|
|
11
|
+
ReasoningWidget,
|
|
11
12
|
ReferenceWidget,
|
|
12
13
|
SelectWidget,
|
|
13
14
|
SuggestionWidget,
|
|
@@ -23,15 +24,24 @@ import { type BlockRenderer, type MessageThreadContext } from './sync';
|
|
|
23
24
|
|
|
24
25
|
const Fallback = ({ _tag, ...props }: XmlWidgetProps<MessageThreadContext>) => {
|
|
25
26
|
return (
|
|
26
|
-
<ToggleContainer.Root classNames='rounded-
|
|
27
|
-
<ToggleContainer.Header classNames='bg-
|
|
28
|
-
<ToggleContainer.Content classNames='bg-
|
|
29
|
-
<Json classNames='
|
|
27
|
+
<ToggleContainer.Root classNames='rounded-xs'>
|
|
28
|
+
<ToggleContainer.Header classNames='bg-group-surface'>{_tag}</ToggleContainer.Header>
|
|
29
|
+
<ToggleContainer.Content classNames='bg-modal-surface'>
|
|
30
|
+
<Json classNames='p-2! text-sm' data={props} />
|
|
30
31
|
</ToggleContainer.Content>
|
|
31
32
|
</ToggleContainer.Root>
|
|
32
33
|
);
|
|
33
34
|
};
|
|
34
35
|
|
|
36
|
+
const Summary = ({ text }: { text: string }) => {
|
|
37
|
+
return (
|
|
38
|
+
<ToggleContainer.Root classNames='rounded-sm'>
|
|
39
|
+
<ToggleContainer.Header classNames='bg-group-surface'>Conversation summarized</ToggleContainer.Header>
|
|
40
|
+
<ToggleContainer.Content classNames='bg-modal-surface'>{text}</ToggleContainer.Content>
|
|
41
|
+
</ToggleContainer.Root>
|
|
42
|
+
);
|
|
43
|
+
};
|
|
44
|
+
|
|
35
45
|
/**
|
|
36
46
|
* Custom XML tags registry.
|
|
37
47
|
*/
|
|
@@ -40,21 +50,28 @@ export const componentRegistry: XmlWidgetRegistry = {
|
|
|
40
50
|
// Widgets
|
|
41
51
|
//
|
|
42
52
|
|
|
43
|
-
|
|
53
|
+
prompt: {
|
|
44
54
|
block: true,
|
|
45
55
|
factory: ({ children }) => {
|
|
46
56
|
const text = getXmlTextChild(children);
|
|
47
57
|
return text ? new PromptWidget(text) : null;
|
|
48
58
|
},
|
|
49
59
|
},
|
|
50
|
-
|
|
60
|
+
reasoning: {
|
|
61
|
+
block: true,
|
|
62
|
+
factory: ({ children }) => {
|
|
63
|
+
const text = getXmlTextChild(children);
|
|
64
|
+
return text ? new ReasoningWidget(text) : null;
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
reference: {
|
|
51
68
|
block: false,
|
|
52
69
|
factory: ({ children, ref }) => {
|
|
53
70
|
const text = getXmlTextChild(children);
|
|
54
71
|
return text && ref ? new ReferenceWidget(text, ref) : null;
|
|
55
72
|
},
|
|
56
73
|
},
|
|
57
|
-
|
|
74
|
+
select: {
|
|
58
75
|
block: true,
|
|
59
76
|
factory: ({ children }) => {
|
|
60
77
|
const options = children
|
|
@@ -63,14 +80,14 @@ export const componentRegistry: XmlWidgetRegistry = {
|
|
|
63
80
|
return options?.length ? new SelectWidget(options) : null;
|
|
64
81
|
},
|
|
65
82
|
},
|
|
66
|
-
|
|
83
|
+
suggestion: {
|
|
67
84
|
block: true,
|
|
68
85
|
factory: ({ children }) => {
|
|
69
86
|
const text = getXmlTextChild(children);
|
|
70
87
|
return text ? new SuggestionWidget(text) : null;
|
|
71
88
|
},
|
|
72
89
|
},
|
|
73
|
-
|
|
90
|
+
stats: {
|
|
74
91
|
block: true,
|
|
75
92
|
factory: ({ children }) => {
|
|
76
93
|
const text = getXmlTextChild(children);
|
|
@@ -82,24 +99,28 @@ export const componentRegistry: XmlWidgetRegistry = {
|
|
|
82
99
|
// React
|
|
83
100
|
//
|
|
84
101
|
|
|
85
|
-
|
|
102
|
+
toolCall: {
|
|
86
103
|
block: true,
|
|
87
104
|
Component: ToolBlock,
|
|
88
105
|
},
|
|
89
|
-
|
|
106
|
+
toolResult: {
|
|
90
107
|
block: true,
|
|
91
108
|
Component: Fallback,
|
|
92
109
|
},
|
|
93
|
-
|
|
110
|
+
toolkit: {
|
|
94
111
|
block: true,
|
|
95
112
|
Component: Fallback,
|
|
96
113
|
},
|
|
114
|
+
summary: {
|
|
115
|
+
block: true,
|
|
116
|
+
Component: Summary,
|
|
117
|
+
},
|
|
97
118
|
|
|
98
119
|
//
|
|
99
120
|
// Fallback
|
|
100
121
|
//
|
|
101
122
|
|
|
102
|
-
|
|
123
|
+
json: {
|
|
103
124
|
block: true,
|
|
104
125
|
Component: Fallback,
|
|
105
126
|
},
|
|
@@ -158,13 +179,25 @@ const blockToMarkdownImpl = (context: MessageThreadContext, message: Message.Mes
|
|
|
158
179
|
return `<toolCall id="${block.toolCallId}" />`;
|
|
159
180
|
}
|
|
160
181
|
case 'toolResult': {
|
|
161
|
-
|
|
182
|
+
// TODO(dmaretskyi): the parameter could be undefined, perhaps tool blocks are not arriving in order.
|
|
183
|
+
context.updateWidget<{ blocks: ContentBlock.Any[] }>(block.toolCallId, ({ blocks = [] } = { blocks: [] }) => ({
|
|
162
184
|
blocks: [...blocks, block],
|
|
163
185
|
}));
|
|
164
186
|
break;
|
|
165
187
|
}
|
|
188
|
+
case 'stats': {
|
|
189
|
+
return `<stats>${ContentBlock.createStatsMessage(block)}</stats>`;
|
|
190
|
+
}
|
|
191
|
+
case 'reasoning': {
|
|
192
|
+
const text = block.reasoningText ?? block.redactedText;
|
|
193
|
+
if (!text) {
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
// TODO(dmaretskyi): The mixed Markdown/XML parser does not support parsing multi-line XML tags.
|
|
197
|
+
return `<reasoning>${text.replace(/\n/g, ' ').trim()}</reasoning>`;
|
|
198
|
+
}
|
|
166
199
|
case 'summary': {
|
|
167
|
-
return `<summary>${
|
|
200
|
+
return `<summary>${block.content}</summary>`;
|
|
168
201
|
}
|
|
169
202
|
default: {
|
|
170
203
|
// TODO(burdon): Needs stable ID.
|
|
@@ -73,6 +73,12 @@ export class MessageSyncer {
|
|
|
73
73
|
* Syncs messages with the editor.
|
|
74
74
|
*/
|
|
75
75
|
append(messages: Message.Message[], flush = false): boolean {
|
|
76
|
+
// TODO(dmaretskyi): MarkdownStream currently does not support streaming XML tags, so we need to remove pending non-text blocks.
|
|
77
|
+
messages = messages.map((message) => ({
|
|
78
|
+
...message,
|
|
79
|
+
blocks: message.blocks.filter((block) => !block.pending || block._tag === 'text'),
|
|
80
|
+
}));
|
|
81
|
+
|
|
76
82
|
// Check if new set of messages.
|
|
77
83
|
if (this._initialMessageId !== messages[0]?.id) {
|
|
78
84
|
this.reset();
|
|
@@ -108,13 +114,13 @@ export class MessageSyncer {
|
|
|
108
114
|
}
|
|
109
115
|
|
|
110
116
|
private process(messages: Message.Message[], append: (content: string) => void) {
|
|
111
|
-
log('sync', {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
});
|
|
117
|
+
// console.log('sync', {
|
|
118
|
+
// doc: this._model.view?.state.doc.length,
|
|
119
|
+
// messages: messages.map((message) => message.blocks.length),
|
|
120
|
+
// currentMessageIndex: this._currentMessageIndex,
|
|
121
|
+
// currentBlockIndex: this._currentBlockIndex,
|
|
122
|
+
// currentBlockContent: this._currentBlockContent,
|
|
123
|
+
// });
|
|
118
124
|
|
|
119
125
|
let i = this._currentMessageIndex;
|
|
120
126
|
for (const message of messages.slice(this._currentMessageIndex)) {
|
|
@@ -135,7 +141,7 @@ export class MessageSyncer {
|
|
|
135
141
|
content = currentBlockContent;
|
|
136
142
|
}
|
|
137
143
|
|
|
138
|
-
log('append', { message: i, block: j, content });
|
|
144
|
+
// console.log('append', { message: i, block: j, content });
|
|
139
145
|
this._currentBlockContent = currentBlockContent;
|
|
140
146
|
append(content);
|
|
141
147
|
}
|
|
@@ -57,7 +57,7 @@ const DefaultStory = ({ source }: TemplateEditorProps & { source: string }) => {
|
|
|
57
57
|
|
|
58
58
|
return (
|
|
59
59
|
<TemplateEditor
|
|
60
|
-
classNames='bg-
|
|
60
|
+
classNames='bg-base-surface w-full max-w-prose-max-width'
|
|
61
61
|
id={blueprint.id}
|
|
62
62
|
template={blueprint.instructions}
|
|
63
63
|
/>
|
|
@@ -65,7 +65,7 @@ const DefaultStory = ({ source }: TemplateEditorProps & { source: string }) => {
|
|
|
65
65
|
};
|
|
66
66
|
|
|
67
67
|
const meta = {
|
|
68
|
-
title: 'plugins/plugin-assistant/TemplateEditor',
|
|
68
|
+
title: 'plugins/plugin-assistant/components/TemplateEditor',
|
|
69
69
|
component: TemplateEditor as any,
|
|
70
70
|
render: DefaultStory,
|
|
71
71
|
decorators: [
|
|
@@ -53,7 +53,7 @@ export const TemplateEditor = ({ id, classNames, template, lineNumbers = true }:
|
|
|
53
53
|
}),
|
|
54
54
|
createThemeExtensions({
|
|
55
55
|
themeMode,
|
|
56
|
-
slots: { content: { className: '!
|
|
56
|
+
slots: { content: { className: '!pe-4' } },
|
|
57
57
|
}),
|
|
58
58
|
createMarkdownExtensions(),
|
|
59
59
|
decorateMarkdown(),
|
|
@@ -66,5 +66,5 @@ export const TemplateEditor = ({ id, classNames, template, lineNumbers = true }:
|
|
|
66
66
|
};
|
|
67
67
|
}, [themeMode, template.source?.target, lineNumbers]);
|
|
68
68
|
|
|
69
|
-
return <div ref={parentRef} className={mx('
|
|
69
|
+
return <div ref={parentRef} className={mx('h-full overflow-hidden', classNames)} />;
|
|
70
70
|
};
|
|
@@ -47,14 +47,14 @@ const DefaultStory = () => {
|
|
|
47
47
|
);
|
|
48
48
|
|
|
49
49
|
return (
|
|
50
|
-
<div role='none' className='flex
|
|
50
|
+
<div role='none' className='flex w-[40rem] border border-separator overflow-hidden'>
|
|
51
51
|
<TemplateForm id={blueprint.id} template={blueprint.instructions} onChange={handleChange} />
|
|
52
52
|
</div>
|
|
53
53
|
);
|
|
54
54
|
};
|
|
55
55
|
|
|
56
56
|
const meta = {
|
|
57
|
-
title: 'plugins/plugin-assistant/TemplateForm',
|
|
57
|
+
title: 'plugins/plugin-assistant/components/TemplateForm',
|
|
58
58
|
component: TemplateForm,
|
|
59
59
|
render: DefaultStory,
|
|
60
60
|
decorators: [
|
|
@@ -8,7 +8,6 @@ import React, { Fragment, useCallback, useEffect } from 'react';
|
|
|
8
8
|
import { type Template } from '@dxos/blueprints';
|
|
9
9
|
import { type Obj } from '@dxos/echo';
|
|
10
10
|
import { Input, Select, useTranslation } from '@dxos/react-ui';
|
|
11
|
-
import { attentionSurface, groupBorder, mx } from '@dxos/ui-theme';
|
|
12
11
|
import { isNonNullable } from '@dxos/util';
|
|
13
12
|
|
|
14
13
|
import { meta } from '../../meta';
|
|
@@ -61,14 +60,14 @@ export const TemplateForm = ({ id, template, commandEditable = true, onChange }:
|
|
|
61
60
|
);
|
|
62
61
|
|
|
63
62
|
return (
|
|
64
|
-
<div className=
|
|
63
|
+
<div className='flex flex-col w-full overflow-hidden gap-4'>
|
|
65
64
|
{/* {commandEditable && (
|
|
66
65
|
<div className='flex items-center pl-4'>
|
|
67
66
|
<span className='text-neutral-500'>/</span>
|
|
68
67
|
<Input.Root>
|
|
69
68
|
<Input.TextInput
|
|
70
69
|
placeholder={t('command placeholder')}
|
|
71
|
-
classNames='
|
|
70
|
+
classNames='w-full bg-transparent m-2'
|
|
72
71
|
value={template.command ?? ''}
|
|
73
72
|
onChange={(event) => {
|
|
74
73
|
onChange?.((t) => {
|
|
@@ -80,20 +79,20 @@ export const TemplateForm = ({ id, template, commandEditable = true, onChange }:
|
|
|
80
79
|
</div>
|
|
81
80
|
)} */}
|
|
82
81
|
|
|
83
|
-
<TemplateEditor id={id} template={template} classNames=
|
|
82
|
+
<TemplateEditor id={id} template={template} classNames='bg-base-surface min-h-[120px]' />
|
|
84
83
|
|
|
85
84
|
{(template.inputs?.length ?? 0) > 0 && (
|
|
86
85
|
<div className='grid grid-cols-[10rem_10rem_1fr] gap-1 items-center'>
|
|
87
86
|
{template.inputs?.filter(isNonNullable).map((input) => (
|
|
88
87
|
<Fragment key={input.name}>
|
|
89
|
-
<div className='
|
|
88
|
+
<div className='ps-3 text-blue-text'>{input.name}</div>
|
|
90
89
|
|
|
91
90
|
<Input.Root>
|
|
92
91
|
<Select.Root
|
|
93
92
|
value={input.kind}
|
|
94
93
|
onValueChange={(kind) => handleInputKindChange(input.name, kind as Template.InputKind)}
|
|
95
94
|
>
|
|
96
|
-
<Select.TriggerButton placeholder='Type' classNames='
|
|
95
|
+
<Select.TriggerButton placeholder='Type' classNames='w-full' />
|
|
97
96
|
<Select.Portal>
|
|
98
97
|
<Select.Content>
|
|
99
98
|
<Select.Viewport>
|
|
@@ -115,7 +114,7 @@ export const TemplateForm = ({ id, template, commandEditable = true, onChange }:
|
|
|
115
114
|
<Input.Root>
|
|
116
115
|
<Input.TextInput
|
|
117
116
|
placeholder={t('command placeholder')}
|
|
118
|
-
classNames='
|
|
117
|
+
classNames='w-full bg-transparent'
|
|
119
118
|
value={input.default ?? ''}
|
|
120
119
|
onChange={(event) => handleInputDefaultChange(input.name, event.target.value)}
|
|
121
120
|
/>
|
|
@@ -64,7 +64,7 @@ const regex = {
|
|
|
64
64
|
url: /[\w.-]+\.[\w.-]+\/[\w/]+/g,
|
|
65
65
|
};
|
|
66
66
|
|
|
67
|
-
const tagPadding = '
|
|
67
|
+
const tagPadding = 'mx-0.5 px-1 rounded-xs';
|
|
68
68
|
|
|
69
69
|
/**
|
|
70
70
|
* ViewPlugin that decorates Handlebars syntax.
|
|
@@ -158,14 +158,14 @@ const handlebarsHighlightPlugin = ViewPlugin.fromClass(
|
|
|
158
158
|
decorations.push({
|
|
159
159
|
from: idx,
|
|
160
160
|
to: end,
|
|
161
|
-
decoration: Decoration.mark({ class: 'text-
|
|
161
|
+
decoration: Decoration.mark({ class: 'text-green-text' }),
|
|
162
162
|
});
|
|
163
163
|
end = idx;
|
|
164
164
|
}
|
|
165
165
|
decorations.push({
|
|
166
166
|
from: start,
|
|
167
167
|
to: end,
|
|
168
|
-
decoration: Decoration.mark({ class: 'text-
|
|
168
|
+
decoration: Decoration.mark({ class: 'text-blue-text' }),
|
|
169
169
|
});
|
|
170
170
|
}
|
|
171
171
|
}
|
|
@@ -179,7 +179,7 @@ const handlebarsHighlightPlugin = ViewPlugin.fromClass(
|
|
|
179
179
|
decorations.push({
|
|
180
180
|
from: start,
|
|
181
181
|
to: end,
|
|
182
|
-
decoration: Decoration.mark({ class: 'text-
|
|
182
|
+
decoration: Decoration.mark({ class: 'text-green-text' }),
|
|
183
183
|
});
|
|
184
184
|
}
|
|
185
185
|
}
|
|
@@ -30,7 +30,7 @@ export const ToolBlock = ({ view, blocks = [] }: ToolBlockProps) => {
|
|
|
30
30
|
// TODO(burdon): Get from context?
|
|
31
31
|
const tools: Tool.Any[] = []; //processor.conversation.toolkit?.tools ?? [];
|
|
32
32
|
return blocks
|
|
33
|
-
.filter((block) => block._tag === 'toolCall' || block._tag === 'toolResult' || block._tag === '
|
|
33
|
+
.filter((block) => block._tag === 'toolCall' || block._tag === 'toolResult' || block._tag === 'stats')
|
|
34
34
|
.map((block) => {
|
|
35
35
|
switch (block._tag) {
|
|
36
36
|
case 'toolCall': {
|
|
@@ -70,13 +70,13 @@ export const ToolBlock = ({ view, blocks = [] }: ToolBlockProps) => {
|
|
|
70
70
|
};
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
case '
|
|
73
|
+
case 'stats': {
|
|
74
74
|
if (!lastToolCall) {
|
|
75
75
|
return null;
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
return {
|
|
79
|
-
title: t('
|
|
79
|
+
title: t('stats label'),
|
|
80
80
|
content: block,
|
|
81
81
|
};
|
|
82
82
|
}
|
|
@@ -122,7 +122,7 @@ export const ToolContainer = ({ items, onChangeOpen }: ToolContainerProps) => {
|
|
|
122
122
|
}, []);
|
|
123
123
|
|
|
124
124
|
return (
|
|
125
|
-
<ToggleContainer.Root classNames='
|
|
125
|
+
<ToggleContainer.Root classNames='mt-2 w-full rounded-xs' open={open} onChangeOpen={setOpen}>
|
|
126
126
|
<ToggleContainer.Header classNames='text-sm text-placeholder'>
|
|
127
127
|
<TextCrawl key='status-roll' lines={items.map((item) => item.title)} autoAdvance greedy />
|
|
128
128
|
</ToggleContainer.Header>
|
|
@@ -20,11 +20,11 @@ import { translations } from '../../translations';
|
|
|
20
20
|
import { Toolbox, type ToolboxProps } from './Toolbox';
|
|
21
21
|
|
|
22
22
|
const DefaultStory = (props: ToolboxProps) => {
|
|
23
|
-
return <Toolbox {...props} classNames='
|
|
23
|
+
return <Toolbox {...props} classNames='h-[15rem] w-[30rem] py-1 rounded-xs border border-separator' />;
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
const meta = {
|
|
27
|
-
title: 'plugins/plugin-assistant/Toolbox',
|
|
27
|
+
title: 'plugins/plugin-assistant/components/Toolbox',
|
|
28
28
|
component: Toolbox as any,
|
|
29
29
|
render: DefaultStory,
|
|
30
30
|
decorators: [
|
|
@@ -75,11 +75,11 @@ const Section: FC<{
|
|
|
75
75
|
}> = ({ title, items, striped }) => {
|
|
76
76
|
const stripeClassNames = 'odd:bg-neutral-50 dark:odd:bg-neutral-800';
|
|
77
77
|
const gridClassNames = 'grid grid-cols-[8rem_1fr]';
|
|
78
|
-
const subGridClassNames = mx('col-span-full grid grid-cols-subgrid text-xs
|
|
78
|
+
const subGridClassNames = mx('col-span-full grid grid-cols-subgrid text-xs px-2', striped && stripeClassNames);
|
|
79
79
|
|
|
80
80
|
return (
|
|
81
81
|
<div>
|
|
82
|
-
<h1 className='
|
|
82
|
+
<h1 className='px-2 text-sm'>{title}</h1>
|
|
83
83
|
<div className={gridClassNames}>
|
|
84
84
|
{items.map(({ name, description, subitems }, i) => (
|
|
85
85
|
<Fragment key={i}>
|
|
@@ -12,12 +12,12 @@ import { runInRuntime } from '@dxos/effect';
|
|
|
12
12
|
import { log } from '@dxos/log';
|
|
13
13
|
import { Button, Icon, Input, ThemeProvider } from '@dxos/react-ui';
|
|
14
14
|
|
|
15
|
-
export
|
|
15
|
+
export type AssistantToolbarProps = {
|
|
16
16
|
view: EditorView;
|
|
17
17
|
from: number;
|
|
18
18
|
to: number;
|
|
19
19
|
runtime: Runtime.Runtime<LanguageModel.LanguageModel>;
|
|
20
|
-
}
|
|
20
|
+
};
|
|
21
21
|
|
|
22
22
|
export const AssistantToolbar = ({ view, from, to, runtime }: AssistantToolbarProps) => {
|
|
23
23
|
const [isProcessing, setIsProcessing] = useState(false);
|
|
@@ -99,7 +99,7 @@ export const AssistantToolbar = ({ view, from, to, runtime }: AssistantToolbarPr
|
|
|
99
99
|
</Input.Root>
|
|
100
100
|
<Button
|
|
101
101
|
variant='ghost'
|
|
102
|
-
classNames='p-1 min-
|
|
102
|
+
classNames='p-1 min-h-0 h-6 w-6 rounded-full'
|
|
103
103
|
onClick={handleEditWithPrompt}
|
|
104
104
|
disabled={!customPrompt || isProcessing}
|
|
105
105
|
>
|