@dxos/plugin-assistant 0.8.4-main.3c1ae3b → 0.8.4-main.3eb6e50203
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/BlueprintArticle-6SP2ZWJ2.mjs +30 -0
- package/dist/lib/browser/BlueprintArticle-6SP2ZWJ2.mjs.map +7 -0
- package/dist/lib/browser/ChatCompanion-CAKFZAWN.mjs +200 -0
- package/dist/lib/browser/ChatCompanion-CAKFZAWN.mjs.map +7 -0
- package/dist/lib/browser/ChatContainer-QB37VONJ.mjs +73 -0
- package/dist/lib/browser/ChatContainer-QB37VONJ.mjs.map +7 -0
- package/dist/lib/browser/ChatDialog-ASVBLOOS.mjs +85 -0
- package/dist/lib/browser/ChatDialog-ASVBLOOS.mjs.map +7 -0
- package/dist/lib/browser/InitiativeContainer-V522FCYH.mjs +266 -0
- package/dist/lib/browser/InitiativeContainer-V522FCYH.mjs.map +7 -0
- package/dist/lib/browser/PromptArticle-PK3CBRUB.mjs +52 -0
- package/dist/lib/browser/PromptArticle-PK3CBRUB.mjs.map +7 -0
- package/dist/lib/browser/ai-service-CY2BYPH6.mjs +22 -0
- package/dist/lib/browser/ai-service-CY2BYPH6.mjs.map +7 -0
- package/dist/lib/browser/app-graph-builder-MUZGUQSC.mjs +234 -0
- package/dist/lib/browser/app-graph-builder-MUZGUQSC.mjs.map +7 -0
- package/dist/lib/browser/blueprint-definition-YAGWYVCL.mjs +14 -0
- package/dist/lib/browser/blueprints/index.mjs +12 -0
- package/dist/lib/browser/chunk-3ETBCBMH.mjs +47 -0
- package/dist/lib/browser/chunk-3ETBCBMH.mjs.map +7 -0
- package/dist/lib/browser/chunk-6BVCG5SJ.mjs +230 -0
- package/dist/lib/browser/chunk-6BVCG5SJ.mjs.map +7 -0
- package/dist/lib/browser/{chunk-7ZJIXQ2Y.mjs → chunk-DKQMSMBN.mjs} +54 -63
- package/dist/lib/browser/chunk-DKQMSMBN.mjs.map +7 -0
- package/dist/lib/browser/{chunk-WBG5PTSX.mjs → chunk-EXVT7D4B.mjs} +1 -1
- package/dist/lib/browser/chunk-EXVT7D4B.mjs.map +7 -0
- package/dist/lib/browser/{chunk-F6YX2HHA.mjs → chunk-IJYAKPEU.mjs} +45 -21
- package/dist/lib/browser/chunk-IJYAKPEU.mjs.map +7 -0
- package/dist/lib/browser/chunk-JA7PUZC7.mjs +1974 -0
- package/dist/lib/browser/chunk-JA7PUZC7.mjs.map +7 -0
- package/dist/lib/browser/chunk-POPBT2AQ.mjs +198 -0
- package/dist/lib/browser/chunk-POPBT2AQ.mjs.map +7 -0
- package/dist/lib/browser/edge-model-resolver-YTMFQEN5.mjs +21 -0
- package/dist/lib/browser/edge-model-resolver-YTMFQEN5.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +205 -177
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/local-model-resolver-CGRQH37T.mjs +20 -0
- 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-2673CFJS.mjs +133 -0
- package/dist/lib/browser/operation-resolver-2673CFJS.mjs.map +7 -0
- package/dist/lib/browser/react-surface-T3FN4GVP.mjs +125 -0
- package/dist/lib/browser/react-surface-T3FN4GVP.mjs.map +7 -0
- package/dist/lib/browser/{repair-3MZXLUHO.mjs → repair-IRXDYF4R.mjs} +24 -17
- package/dist/lib/browser/repair-IRXDYF4R.mjs.map +7 -0
- package/dist/lib/browser/settings-XF6GKHCG.mjs +33 -0
- package/dist/lib/browser/settings-XF6GKHCG.mjs.map +7 -0
- package/dist/lib/browser/state-OYDPWLKA.mjs +26 -0
- package/dist/lib/browser/state-OYDPWLKA.mjs.map +7 -0
- package/dist/lib/browser/toolkit-IDXQCSTX.mjs +19 -0
- package/dist/lib/browser/toolkit-IDXQCSTX.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +8 -4
- package/dist/lib/node-esm/BlueprintArticle-7LI6UXKZ.mjs +31 -0
- package/dist/lib/node-esm/BlueprintArticle-7LI6UXKZ.mjs.map +7 -0
- package/dist/lib/node-esm/ChatCompanion-W4PGOCGR.mjs +201 -0
- package/dist/lib/node-esm/ChatCompanion-W4PGOCGR.mjs.map +7 -0
- package/dist/lib/node-esm/ChatContainer-ECFQVH6O.mjs +74 -0
- package/dist/lib/node-esm/ChatContainer-ECFQVH6O.mjs.map +7 -0
- package/dist/lib/node-esm/ChatDialog-AFLPYSIU.mjs +86 -0
- package/dist/lib/node-esm/ChatDialog-AFLPYSIU.mjs.map +7 -0
- package/dist/lib/node-esm/InitiativeContainer-U4LGO3BW.mjs +267 -0
- package/dist/lib/node-esm/InitiativeContainer-U4LGO3BW.mjs.map +7 -0
- package/dist/lib/node-esm/PromptArticle-BHPABYLT.mjs +53 -0
- package/dist/lib/node-esm/PromptArticle-BHPABYLT.mjs.map +7 -0
- package/dist/lib/node-esm/ai-service-ZI3A6RVG.mjs +23 -0
- package/dist/lib/node-esm/ai-service-ZI3A6RVG.mjs.map +7 -0
- package/dist/lib/node-esm/app-graph-builder-4QN5M6PD.mjs +235 -0
- package/dist/lib/node-esm/app-graph-builder-4QN5M6PD.mjs.map +7 -0
- package/dist/lib/node-esm/{blueprint-definition-S3DNWJFV.mjs → blueprint-definition-H3LFAEK2.mjs} +6 -4
- package/dist/lib/node-esm/blueprint-definition-H3LFAEK2.mjs.map +7 -0
- package/dist/lib/node-esm/blueprints/index.mjs +13 -0
- package/dist/lib/node-esm/blueprints/index.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-2LEN26ZQ.mjs +48 -0
- package/dist/lib/node-esm/chunk-2LEN26ZQ.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-3XC7LQSO.mjs +1975 -0
- package/dist/lib/node-esm/chunk-3XC7LQSO.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-CKW4IYLY.mjs → chunk-75PHXBN3.mjs} +54 -63
- package/dist/lib/node-esm/chunk-75PHXBN3.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-F6LA7XNS.mjs +199 -0
- package/dist/lib/node-esm/chunk-F6LA7XNS.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-LB72WG6R.mjs +231 -0
- package/dist/lib/node-esm/chunk-LB72WG6R.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-GWKWQSEQ.mjs → chunk-MJD5XWQV.mjs} +45 -21
- package/dist/lib/node-esm/chunk-MJD5XWQV.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-WE6KTH72.mjs → chunk-POWB2BPC.mjs} +1 -1
- package/dist/lib/node-esm/chunk-POWB2BPC.mjs.map +7 -0
- package/dist/lib/node-esm/edge-model-resolver-CMJ3KNLQ.mjs +22 -0
- package/dist/lib/node-esm/edge-model-resolver-CMJ3KNLQ.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +205 -177
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/local-model-resolver-FFDAKOXN.mjs +21 -0
- 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-2ZD2DXOU.mjs +134 -0
- package/dist/lib/node-esm/operation-resolver-2ZD2DXOU.mjs.map +7 -0
- package/dist/lib/node-esm/{react-surface-AOBQALOV.mjs → react-surface-T4VMCCKZ.mjs} +57 -32
- package/dist/lib/node-esm/react-surface-T4VMCCKZ.mjs.map +7 -0
- package/dist/lib/node-esm/{repair-RER5H7Y6.mjs → repair-DMI55PON.mjs} +24 -17
- package/dist/lib/node-esm/repair-DMI55PON.mjs.map +7 -0
- package/dist/lib/node-esm/settings-NGGZA7S7.mjs +34 -0
- package/dist/lib/node-esm/settings-NGGZA7S7.mjs.map +7 -0
- package/dist/lib/node-esm/state-VSCPGN7R.mjs +27 -0
- package/dist/lib/node-esm/state-VSCPGN7R.mjs.map +7 -0
- package/dist/lib/node-esm/toolkit-JPRJRDDB.mjs +20 -0
- package/dist/lib/node-esm/toolkit-JPRJRDDB.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +8 -4
- package/dist/types/src/AssistantPlugin.d.ts +2 -1
- package/dist/types/src/AssistantPlugin.d.ts.map +1 -1
- package/dist/types/src/blueprints/assistant-blueprint.d.ts +11 -0
- package/dist/types/src/blueprints/assistant-blueprint.d.ts.map +1 -0
- package/dist/types/src/blueprints/index.d.ts +7 -0
- package/dist/types/src/blueprints/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/ai-service/ai-service.d.ts +6 -0
- package/dist/types/src/capabilities/ai-service/ai-service.d.ts.map +1 -0
- package/dist/types/src/capabilities/ai-service/index.d.ts +3 -0
- package/dist/types/src/capabilities/ai-service/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +6 -0
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts +3 -0
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts +26 -0
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts.map +1 -0
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts +4 -0
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/edge-model-resolver/edge-model-resolver.d.ts +7 -0
- package/dist/types/src/capabilities/edge-model-resolver/edge-model-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/edge-model-resolver/index.d.ts +3 -0
- package/dist/types/src/capabilities/edge-model-resolver/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +10 -12
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/local-model-resolver/index.d.ts +3 -0
- package/dist/types/src/capabilities/local-model-resolver/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/local-model-resolver/local-model-resolver.d.ts +13 -0
- package/dist/types/src/capabilities/local-model-resolver/local-model-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-resolver/index.d.ts +3 -0
- package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +5 -0
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts +3 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +5 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/repair/index.d.ts +3 -0
- package/dist/types/src/capabilities/repair/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/repair/repair.d.ts +6 -0
- package/dist/types/src/capabilities/repair/repair.d.ts.map +1 -0
- package/dist/types/src/capabilities/settings/index.d.ts +15 -0
- package/dist/types/src/capabilities/settings/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/settings/settings.d.ts +18 -0
- package/dist/types/src/capabilities/settings/settings.d.ts.map +1 -0
- package/dist/types/src/capabilities/state/index.d.ts +11 -0
- package/dist/types/src/capabilities/state/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/state/state.d.ts +13 -0
- package/dist/types/src/capabilities/state/state.d.ts.map +1 -0
- package/dist/types/src/capabilities/toolkit/index.d.ts +3 -0
- package/dist/types/src/capabilities/toolkit/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/toolkit/toolkit.d.ts +6 -0
- package/dist/types/src/capabilities/toolkit/toolkit.d.ts.map +1 -0
- package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts +4 -2
- package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts.map +1 -1
- package/dist/types/src/components/BlueprintArticle.d.ts +2 -2
- package/dist/types/src/components/BlueprintArticle.d.ts.map +1 -1
- package/dist/types/src/components/Chat/Chat.d.ts +13 -11
- package/dist/types/src/components/Chat/Chat.d.ts.map +1 -1
- package/dist/types/src/components/Chat/events.d.ts +1 -1
- package/dist/types/src/components/Chat/events.d.ts.map +1 -1
- package/dist/types/src/components/ChatCompanion.d.ts +3 -3
- package/dist/types/src/components/ChatCompanion.d.ts.map +1 -1
- package/dist/types/src/components/ChatContainer.d.ts +8 -8
- package/dist/types/src/components/ChatContainer.d.ts.map +1 -1
- package/dist/types/src/components/ChatDialog.d.ts +2 -2
- package/dist/types/src/components/ChatDialog.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 +3 -3
- package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts +3 -3
- package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.d.ts +2 -2
- package/dist/types/src/components/ChatThread/ChatThread.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts +116 -2
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/registry.d.ts +1 -1
- package/dist/types/src/components/ChatThread/registry.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/sync.d.ts +1 -1
- package/dist/types/src/components/ChatThread/sync.d.ts.map +1 -1
- package/dist/types/src/components/InitiativeContainer.d.ts +9 -0
- package/dist/types/src/components/InitiativeContainer.d.ts.map +1 -0
- package/dist/types/src/components/PromptArticle.d.ts +2 -2
- package/dist/types/src/components/PromptArticle.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts +114 -0
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts +11 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts +115 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/extensions/handlebars-extension.d.ts.map +1 -1
- package/dist/types/src/components/ToolBlock/ToolBlock.d.ts +3 -3
- package/dist/types/src/components/ToolBlock/ToolBlock.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.d.ts +4 -5
- package/dist/types/src/components/Toolbox/Toolbox.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts +114 -0
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts.map +1 -1
- package/dist/types/src/components/TriggerStatus/TriggerStatus.d.ts +4 -0
- package/dist/types/src/components/TriggerStatus/TriggerStatus.d.ts.map +1 -0
- package/dist/types/src/components/TriggerStatus/index.d.ts +2 -0
- package/dist/types/src/components/TriggerStatus/index.d.ts.map +1 -0
- package/dist/types/src/components/Typewriter/AssistantToolbar.d.ts +12 -0
- package/dist/types/src/components/Typewriter/AssistantToolbar.d.ts.map +1 -0
- package/dist/types/src/components/Typewriter/Typewriter.d.ts +11 -0
- package/dist/types/src/components/Typewriter/Typewriter.d.ts.map +1 -0
- package/dist/types/src/components/Typewriter/Typewriter.stories.d.ts +7 -0
- package/dist/types/src/components/Typewriter/Typewriter.stories.d.ts.map +1 -0
- package/dist/types/src/components/Typewriter/assistant-extension.d.ts +5 -0
- package/dist/types/src/components/Typewriter/assistant-extension.d.ts.map +1 -0
- package/dist/types/src/components/Typewriter/index.d.ts +2 -0
- package/dist/types/src/components/Typewriter/index.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +10 -10
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/functions/index.d.ts +1 -1
- package/dist/types/src/functions/index.d.ts.map +1 -1
- package/dist/types/src/functions/object-list.d.ts +1 -1
- package/dist/types/src/functions/object-load.d.ts +1 -1
- package/dist/types/src/functions/object-load.d.ts.map +1 -1
- package/dist/types/src/functions/object-search.d.ts +10 -0
- package/dist/types/src/functions/object-search.d.ts.map +1 -0
- package/dist/types/src/hooks/useBlueprintRegistry.d.ts +5 -5
- package/dist/types/src/hooks/useBlueprintRegistry.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatProcessor.d.ts +2 -1
- package/dist/types/src/hooks/useChatProcessor.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatServices.d.ts +5 -5
- package/dist/types/src/hooks/useChatServices.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatToolbarActions.d.ts +3 -3
- package/dist/types/src/hooks/useChatToolbarActions.d.ts.map +1 -1
- package/dist/types/src/hooks/useContextBinder.d.ts.map +1 -1
- package/dist/types/src/hooks/useContextObjects.d.ts +7 -7
- package/dist/types/src/hooks/useContextObjects.d.ts.map +1 -1
- package/dist/types/src/hooks/useFilteredTypes.d.ts +2 -3
- package/dist/types/src/hooks/useFilteredTypes.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +0 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/processor/processor.d.ts +13 -9
- 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/queue-logger.d.ts.map +1 -1
- package/dist/types/src/testing/test-services.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +114 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Assistant.d.ts +7 -32
- package/dist/types/src/types/Assistant.d.ts.map +1 -1
- package/dist/types/src/types/AssistantAction.d.ts +90 -122
- package/dist/types/src/types/AssistantAction.d.ts.map +1 -1
- package/dist/types/src/types/capabilities.d.ts +33 -0
- package/dist/types/src/types/capabilities.d.ts.map +1 -0
- package/dist/types/src/types/events.d.ts +5 -0
- package/dist/types/src/types/events.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +4 -1
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/service.d.ts +11 -260
- package/dist/types/src/types/service.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +116 -93
- package/src/AssistantPlugin.tsx +104 -99
- package/src/blueprints/assistant-blueprint.ts +57 -0
- package/src/blueprints/index.ts +12 -0
- package/src/capabilities/ai-service/ai-service.ts +30 -0
- package/src/capabilities/ai-service/index.ts +7 -0
- package/src/capabilities/app-graph-builder/app-graph-builder.ts +200 -0
- package/src/capabilities/app-graph-builder/index.ts +7 -0
- package/src/capabilities/blueprint-definition/blueprint-definition.ts +74 -0
- package/src/capabilities/blueprint-definition/index.ts +8 -0
- package/src/capabilities/edge-model-resolver/edge-model-resolver.ts +33 -0
- package/src/capabilities/edge-model-resolver/index.ts +7 -0
- package/src/capabilities/index.ts +10 -15
- package/src/capabilities/local-model-resolver/index.ts +7 -0
- package/src/capabilities/local-model-resolver/local-model-resolver.ts +38 -0
- package/src/capabilities/operation-resolver/index.ts +7 -0
- package/src/capabilities/operation-resolver/operation-resolver.ts +112 -0
- package/src/capabilities/react-surface/index.ts +7 -0
- package/src/capabilities/react-surface/react-surface.tsx +111 -0
- package/src/capabilities/repair/index.ts +7 -0
- package/src/capabilities/{repair.ts → repair/repair.ts} +24 -11
- package/src/capabilities/settings/index.ts +7 -0
- package/src/capabilities/settings/settings.ts +31 -0
- package/src/capabilities/state/index.ts +7 -0
- package/src/capabilities/state/state.ts +27 -0
- package/src/capabilities/toolkit/index.ts +7 -0
- package/src/capabilities/toolkit/toolkit.ts +27 -0
- package/src/components/AssistantSettings/AssistantSettings.tsx +28 -20
- package/src/components/BlueprintArticle.tsx +5 -6
- package/src/components/Chat/Chat.tsx +104 -77
- package/src/components/Chat/events.ts +1 -1
- package/src/components/ChatCompanion.tsx +103 -43
- package/src/components/ChatContainer.tsx +30 -24
- package/src/components/ChatDialog.tsx +8 -8
- package/src/components/ChatProgress/ChatProgress.tsx +5 -19
- package/src/components/ChatPrompt/ChatActions.tsx +9 -1
- package/src/components/ChatPrompt/ChatOptions.tsx +62 -58
- package/src/components/ChatPrompt/ChatReferences.tsx +5 -6
- package/src/components/ChatPrompt/ChatStatusIndicator.tsx +1 -1
- package/src/components/ChatThread/ChatThread.stories.tsx +9 -8
- package/src/components/ChatThread/ChatThread.tsx +14 -5
- package/src/components/ChatThread/Link.tsx +3 -3
- package/src/components/ChatThread/registry.tsx +1 -1
- package/src/components/ChatThread/sync.test.ts +13 -5
- package/src/components/ChatThread/sync.ts +8 -2
- package/src/components/InitiativeContainer.tsx +340 -0
- package/src/components/PromptArticle.tsx +9 -11
- package/src/components/TemplateEditor/TemplateEditor.stories.tsx +3 -3
- package/src/components/TemplateEditor/TemplateEditor.tsx +7 -4
- package/src/components/TemplateEditor/TemplateForm.stories.tsx +15 -7
- package/src/components/TemplateEditor/TemplateForm.tsx +75 -28
- package/src/components/TemplateEditor/extensions/handlebars-extension.ts +10 -5
- package/src/components/ToolBlock/ToolBlock.tsx +6 -6
- package/src/components/Toolbox/Toolbox.stories.tsx +10 -11
- package/src/components/Toolbox/Toolbox.tsx +50 -52
- package/src/components/TriggerStatus/TriggerStatus.tsx +142 -0
- package/src/components/TriggerStatus/index.ts +5 -0
- package/src/components/Typewriter/AssistantToolbar.tsx +161 -0
- package/src/components/Typewriter/Typewriter.stories.tsx +83 -0
- package/src/components/Typewriter/Typewriter.tsx +54 -0
- package/src/components/Typewriter/assistant-extension.tsx +144 -0
- package/src/components/Typewriter/index.ts +5 -0
- package/src/components/index.ts +11 -2
- package/src/functions/index.ts +1 -1
- package/src/functions/object-list.ts +2 -2
- package/src/functions/object-load.ts +9 -11
- package/src/functions/object-search.ts +46 -0
- package/src/hooks/useBlueprintRegistry.ts +31 -21
- package/src/hooks/useChatProcessor.ts +7 -3
- package/src/hooks/useChatServices.ts +14 -18
- package/src/hooks/useChatToolbarActions.ts +27 -27
- package/src/hooks/useContextBinder.ts +4 -2
- package/src/hooks/useContextObjects.ts +13 -25
- package/src/hooks/useFilteredTypes.ts +6 -7
- package/src/hooks/useReferencesProvider.ts +4 -4
- package/src/index.ts +0 -1
- package/src/meta.ts +2 -2
- package/src/processor/processor.test.ts +8 -8
- package/src/processor/processor.ts +49 -25
- package/src/processor/update-name.ts +6 -4
- package/src/queue-logger.ts +4 -1
- package/src/testing/test-services.ts +8 -6
- package/src/translations.ts +23 -2
- package/src/types/Assistant.ts +4 -39
- package/src/types/AssistantAction.ts +61 -64
- package/src/types/capabilities.ts +27 -0
- package/src/types/events.ts +11 -0
- package/src/types/index.ts +6 -1
- package/src/types/service.ts +10 -7
- package/dist/lib/browser/BlueprintArticle-BWSLH6LG.mjs +0 -36
- package/dist/lib/browser/BlueprintArticle-BWSLH6LG.mjs.map +0 -7
- package/dist/lib/browser/ChatCompanion-U7VMDYO6.mjs +0 -159
- package/dist/lib/browser/ChatCompanion-U7VMDYO6.mjs.map +0 -7
- package/dist/lib/browser/ChatContainer-JXDZQ2EY.mjs +0 -79
- package/dist/lib/browser/ChatContainer-JXDZQ2EY.mjs.map +0 -7
- package/dist/lib/browser/ChatDialog-5NNGCRKJ.mjs +0 -90
- package/dist/lib/browser/ChatDialog-5NNGCRKJ.mjs.map +0 -7
- package/dist/lib/browser/PromptArticle-Q7JYGFQV.mjs +0 -59
- package/dist/lib/browser/PromptArticle-Q7JYGFQV.mjs.map +0 -7
- package/dist/lib/browser/ai-service-ERTZBTP3.mjs +0 -19
- package/dist/lib/browser/ai-service-ERTZBTP3.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-ADZRPJ3V.mjs +0 -199
- package/dist/lib/browser/app-graph-builder-ADZRPJ3V.mjs.map +0 -7
- package/dist/lib/browser/blueprint-definition-7HPQPCL7.mjs +0 -12
- package/dist/lib/browser/chunk-5JZRYQZL.mjs +0 -229
- package/dist/lib/browser/chunk-5JZRYQZL.mjs.map +0 -7
- package/dist/lib/browser/chunk-7ZJIXQ2Y.mjs.map +0 -7
- package/dist/lib/browser/chunk-F6YX2HHA.mjs.map +0 -7
- package/dist/lib/browser/chunk-LRE4VEZV.mjs +0 -16
- package/dist/lib/browser/chunk-LRE4VEZV.mjs.map +0 -7
- package/dist/lib/browser/chunk-SWEOO227.mjs +0 -1930
- package/dist/lib/browser/chunk-SWEOO227.mjs.map +0 -7
- package/dist/lib/browser/chunk-WBG5PTSX.mjs.map +0 -7
- package/dist/lib/browser/chunk-YDSFERCV.mjs +0 -178
- package/dist/lib/browser/chunk-YDSFERCV.mjs.map +0 -7
- package/dist/lib/browser/edge-model-resolver-O6OFYIO2.mjs +0 -18
- package/dist/lib/browser/edge-model-resolver-O6OFYIO2.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-Q7TX3MV7.mjs +0 -143
- package/dist/lib/browser/intent-resolver-Q7TX3MV7.mjs.map +0 -7
- package/dist/lib/browser/local-model-resolver-34MVHRKD.mjs +0 -17
- package/dist/lib/browser/local-model-resolver-34MVHRKD.mjs.map +0 -7
- package/dist/lib/browser/react-surface-VXXS6ZVC.mjs +0 -100
- package/dist/lib/browser/react-surface-VXXS6ZVC.mjs.map +0 -7
- package/dist/lib/browser/repair-3MZXLUHO.mjs.map +0 -7
- package/dist/lib/browser/settings-HD5WA24I.mjs +0 -23
- package/dist/lib/browser/settings-HD5WA24I.mjs.map +0 -7
- package/dist/lib/browser/state-GG7Z3NB7.mjs +0 -25
- package/dist/lib/browser/state-GG7Z3NB7.mjs.map +0 -7
- package/dist/lib/browser/toolkit-VYDAWNE4.mjs +0 -17
- package/dist/lib/browser/toolkit-VYDAWNE4.mjs.map +0 -7
- package/dist/lib/node-esm/BlueprintArticle-R2XYBRCK.mjs +0 -37
- package/dist/lib/node-esm/BlueprintArticle-R2XYBRCK.mjs.map +0 -7
- package/dist/lib/node-esm/ChatCompanion-O4T7PMMC.mjs +0 -160
- package/dist/lib/node-esm/ChatCompanion-O4T7PMMC.mjs.map +0 -7
- package/dist/lib/node-esm/ChatContainer-OWAZI6ZF.mjs +0 -80
- package/dist/lib/node-esm/ChatContainer-OWAZI6ZF.mjs.map +0 -7
- package/dist/lib/node-esm/ChatDialog-IBXH5FRI.mjs +0 -91
- package/dist/lib/node-esm/ChatDialog-IBXH5FRI.mjs.map +0 -7
- package/dist/lib/node-esm/PromptArticle-IV7O5UZ3.mjs +0 -60
- package/dist/lib/node-esm/PromptArticle-IV7O5UZ3.mjs.map +0 -7
- package/dist/lib/node-esm/ai-service-MUYLV3NT.mjs +0 -20
- package/dist/lib/node-esm/ai-service-MUYLV3NT.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-26KXQ5ZY.mjs +0 -200
- package/dist/lib/node-esm/app-graph-builder-26KXQ5ZY.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-CKW4IYLY.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-E4JSYCWZ.mjs +0 -230
- package/dist/lib/node-esm/chunk-E4JSYCWZ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-GWKWQSEQ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-VGSP5WMV.mjs +0 -180
- package/dist/lib/node-esm/chunk-VGSP5WMV.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-WE6KTH72.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-YWFWT57N.mjs +0 -17
- package/dist/lib/node-esm/chunk-YWFWT57N.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ZNSHGWE4.mjs +0 -1931
- package/dist/lib/node-esm/chunk-ZNSHGWE4.mjs.map +0 -7
- package/dist/lib/node-esm/edge-model-resolver-2ARXDOYS.mjs +0 -19
- package/dist/lib/node-esm/edge-model-resolver-2ARXDOYS.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-LTKMN3YB.mjs +0 -144
- package/dist/lib/node-esm/intent-resolver-LTKMN3YB.mjs.map +0 -7
- package/dist/lib/node-esm/local-model-resolver-TP2NTSAX.mjs +0 -18
- package/dist/lib/node-esm/local-model-resolver-TP2NTSAX.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-AOBQALOV.mjs.map +0 -7
- package/dist/lib/node-esm/repair-RER5H7Y6.mjs.map +0 -7
- package/dist/lib/node-esm/settings-YJQVKHH5.mjs +0 -24
- package/dist/lib/node-esm/settings-YJQVKHH5.mjs.map +0 -7
- package/dist/lib/node-esm/state-FSUHFMDM.mjs +0 -26
- package/dist/lib/node-esm/state-FSUHFMDM.mjs.map +0 -7
- package/dist/lib/node-esm/toolkit-HFJZLVIR.mjs +0 -18
- package/dist/lib/node-esm/toolkit-HFJZLVIR.mjs.map +0 -7
- package/dist/types/src/capabilities/ai-service.d.ts +0 -4
- package/dist/types/src/capabilities/ai-service.d.ts.map +0 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -4
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
- package/dist/types/src/capabilities/blueprint-definition.d.ts +0 -7
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +0 -1
- package/dist/types/src/capabilities/capabilities.d.ts +0 -10
- package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
- package/dist/types/src/capabilities/edge-model-resolver.d.ts +0 -4
- package/dist/types/src/capabilities/edge-model-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/local-model-resolver.d.ts +0 -10
- package/dist/types/src/capabilities/local-model-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface.d.ts +0 -4
- package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
- package/dist/types/src/capabilities/repair.d.ts +0 -4
- package/dist/types/src/capabilities/repair.d.ts.map +0 -1
- package/dist/types/src/capabilities/settings.d.ts +0 -4
- package/dist/types/src/capabilities/settings.d.ts.map +0 -1
- package/dist/types/src/capabilities/state.d.ts +0 -4
- package/dist/types/src/capabilities/state.d.ts.map +0 -1
- package/dist/types/src/capabilities/toolkit.d.ts +0 -4
- package/dist/types/src/capabilities/toolkit.d.ts.map +0 -1
- package/dist/types/src/components/ChatThread/reducers.d.ts +0 -40
- package/dist/types/src/components/ChatThread/reducers.d.ts.map +0 -1
- package/dist/types/src/events.d.ts +0 -4
- package/dist/types/src/events.d.ts.map +0 -1
- package/dist/types/src/functions/analysis.d.ts +0 -5
- package/dist/types/src/functions/analysis.d.ts.map +0 -1
- package/src/capabilities/ai-service.ts +0 -27
- package/src/capabilities/app-graph-builder.ts +0 -208
- package/src/capabilities/blueprint-definition.ts +0 -66
- package/src/capabilities/capabilities.ts +0 -17
- package/src/capabilities/edge-model-resolver.ts +0 -25
- package/src/capabilities/intent-resolver.ts +0 -135
- package/src/capabilities/local-model-resolver.ts +0 -30
- package/src/capabilities/react-surface.tsx +0 -87
- package/src/capabilities/settings.ts +0 -19
- package/src/capabilities/state.ts +0 -22
- package/src/capabilities/toolkit.ts +0 -17
- package/src/components/ChatThread/reducers.ts +0 -151
- package/src/events.ts +0 -11
- package/src/functions/analysis.ts +0 -22
- /package/dist/lib/browser/{blueprint-definition-7HPQPCL7.mjs.map → blueprint-definition-YAGWYVCL.mjs.map} +0 -0
- /package/dist/lib/{node-esm/blueprint-definition-S3DNWJFV.mjs.map → browser/blueprints/index.mjs.map} +0 -0
|
@@ -9,6 +9,7 @@ import * as Layer from 'effect/Layer';
|
|
|
9
9
|
import React, { type CSSProperties, useEffect, useMemo, useState } from 'react';
|
|
10
10
|
|
|
11
11
|
import { Database } from '@dxos/echo';
|
|
12
|
+
import { runAndForwardErrors } from '@dxos/effect';
|
|
12
13
|
import { ContextQueueService } from '@dxos/functions';
|
|
13
14
|
import { faker } from '@dxos/random';
|
|
14
15
|
import { useQueue, useSpace } from '@dxos/react-client/echo';
|
|
@@ -17,7 +18,7 @@ import { Popover } from '@dxos/react-ui';
|
|
|
17
18
|
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
18
19
|
import { MarkdownStream } from '@dxos/react-ui-components';
|
|
19
20
|
import { EditorPreviewProvider, useEditorPreview } from '@dxos/react-ui-editor';
|
|
20
|
-
import { Card } from '@dxos/react-ui-
|
|
21
|
+
import { Card } from '@dxos/react-ui-mosaic';
|
|
21
22
|
import { render } from '@dxos/storybook-utils';
|
|
22
23
|
import { type Message, Organization, Person } from '@dxos/types';
|
|
23
24
|
|
|
@@ -55,11 +56,11 @@ const DefaultStory = ({ generator = [], delay = 0, wait, ...props }: StoryProps)
|
|
|
55
56
|
}
|
|
56
57
|
}
|
|
57
58
|
setDone(true);
|
|
58
|
-
}).pipe(Effect.provide(Layer.mergeAll(Database.
|
|
59
|
+
}).pipe(Effect.provide(Layer.mergeAll(Database.layer(space.db), ContextQueueService.layer(queue)))),
|
|
59
60
|
);
|
|
60
61
|
|
|
61
62
|
return () => {
|
|
62
|
-
void
|
|
63
|
+
void runAndForwardErrors(Fiber.interrupt(fiber));
|
|
63
64
|
};
|
|
64
65
|
}, [space, queue, generator]);
|
|
65
66
|
|
|
@@ -68,7 +69,7 @@ const DefaultStory = ({ generator = [], delay = 0, wait, ...props }: StoryProps)
|
|
|
68
69
|
}
|
|
69
70
|
|
|
70
71
|
return (
|
|
71
|
-
<EditorPreviewProvider onLookup={async ({
|
|
72
|
+
<EditorPreviewProvider onLookup={async ({ dxn, label }) => ({ label, text: dxn })}>
|
|
72
73
|
<ChatThread {...props} messages={queue?.objects} />
|
|
73
74
|
<PreviewCard />
|
|
74
75
|
</EditorPreviewProvider>
|
|
@@ -82,10 +83,10 @@ const PreviewCard = () => {
|
|
|
82
83
|
<Popover.Portal>
|
|
83
84
|
<Popover.Content onOpenAutoFocus={(event) => event.preventDefault()}>
|
|
84
85
|
<Popover.Viewport>
|
|
85
|
-
<Card.
|
|
86
|
+
<Card.Root>
|
|
86
87
|
<Card.Heading>{target?.label}</Card.Heading>
|
|
87
88
|
{target && <Card.Text classNames='truncate line-clamp-3'>{target.text}</Card.Text>}
|
|
88
|
-
</Card.
|
|
89
|
+
</Card.Root>
|
|
89
90
|
</Popover.Viewport>
|
|
90
91
|
<Popover.Arrow />
|
|
91
92
|
</Popover.Content>
|
|
@@ -98,8 +99,8 @@ const meta = {
|
|
|
98
99
|
component: ChatThread,
|
|
99
100
|
render: render(DefaultStory),
|
|
100
101
|
decorators: [
|
|
101
|
-
withTheme,
|
|
102
|
-
withLayout({
|
|
102
|
+
withTheme(),
|
|
103
|
+
withLayout({ layout: 'column' }),
|
|
103
104
|
withClientProvider({
|
|
104
105
|
createIdentity: true,
|
|
105
106
|
createSpace: true,
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import React, { type CSSProperties, forwardRef, useCallback, useEffect, useMemo } from 'react';
|
|
5
|
+
import React, { type CSSProperties, forwardRef, useCallback, useEffect, useMemo, useState } from 'react';
|
|
6
6
|
|
|
7
7
|
import { PublicKey } from '@dxos/keys';
|
|
8
8
|
import { type Identity } from '@dxos/react-client/halo';
|
|
9
9
|
import { type ThemedClassName, useForwardedRef } from '@dxos/react-ui';
|
|
10
10
|
import { MarkdownStream, type MarkdownStreamController, type MarkdownStreamProps } from '@dxos/react-ui-components';
|
|
11
|
-
import { mx } from '@dxos/react-ui-theme';
|
|
12
11
|
import { type Message } from '@dxos/types';
|
|
12
|
+
import { mx } from '@dxos/ui-theme';
|
|
13
13
|
import { keyToFallback } from '@dxos/util';
|
|
14
14
|
|
|
15
15
|
import { type ChatEvent } from '../Chat';
|
|
@@ -27,13 +27,22 @@ export type ChatThreadProps = ThemedClassName<
|
|
|
27
27
|
>;
|
|
28
28
|
|
|
29
29
|
// TODO(burdon): Memo thread position.
|
|
30
|
-
export const ChatThread = forwardRef<MarkdownStreamController, ChatThreadProps>(
|
|
30
|
+
export const ChatThread = forwardRef<MarkdownStreamController | null, ChatThreadProps>(
|
|
31
31
|
(
|
|
32
32
|
{ classNames, identity, messages = [], error, cursor = false, fadeIn = true, debug = false, onEvent },
|
|
33
33
|
forwardedRef,
|
|
34
34
|
) => {
|
|
35
35
|
const controllerRef = useForwardedRef(forwardedRef);
|
|
36
|
-
const controller =
|
|
36
|
+
const [controller, setController] = useState<MarkdownStreamController | null>(null);
|
|
37
|
+
|
|
38
|
+
// Callback ref to capture when MarkdownStream is mounted and trigger re-render.
|
|
39
|
+
const refCallback = useCallback(
|
|
40
|
+
(node: MarkdownStreamController | null) => {
|
|
41
|
+
controllerRef.current = node;
|
|
42
|
+
setController(node);
|
|
43
|
+
},
|
|
44
|
+
[controllerRef],
|
|
45
|
+
);
|
|
37
46
|
|
|
38
47
|
const userHue = useMemo(
|
|
39
48
|
() => identity?.profile?.data?.hue || keyToFallback(identity?.identityKey ?? PublicKey.random()).hue,
|
|
@@ -74,7 +83,7 @@ export const ChatThread = forwardRef<MarkdownStreamController, ChatThreadProps>(
|
|
|
74
83
|
style={{ '--user-fill': `var(--dx-${userHue}Fill)` } as CSSProperties}
|
|
75
84
|
>
|
|
76
85
|
<MarkdownStream
|
|
77
|
-
ref={
|
|
86
|
+
ref={refCallback}
|
|
78
87
|
registry={componentRegistry}
|
|
79
88
|
cursor={cursor}
|
|
80
89
|
fadeIn={fadeIn}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import React, { useMemo } from 'react';
|
|
6
6
|
|
|
7
7
|
import { type Space } from '@dxos/client/echo';
|
|
8
|
-
import {
|
|
8
|
+
import { Entity } from '@dxos/echo';
|
|
9
9
|
import { type DXN } from '@dxos/keys';
|
|
10
10
|
import { DxAnchor } from '@dxos/lit-ui/react';
|
|
11
11
|
|
|
@@ -17,9 +17,9 @@ export type ObjectLinkProps = {
|
|
|
17
17
|
export const ObjectLink = ({ space, dxn }: ObjectLinkProps) => {
|
|
18
18
|
const ref = useMemo(() => space.db.makeRef(dxn), [space, dxn.toString()]);
|
|
19
19
|
|
|
20
|
-
const title = (ref.target &&
|
|
20
|
+
const title = (ref.target && Entity.getLabel(ref.target)) ?? ref.target?.id ?? ref.dxn.toString();
|
|
21
21
|
return (
|
|
22
|
-
<DxAnchor rootclassname='dx-tag--anchor'
|
|
22
|
+
<DxAnchor rootclassname='dx-tag--anchor' dxn={dxn.toString()}>
|
|
23
23
|
{title}
|
|
24
24
|
</DxAnchor>
|
|
25
25
|
);
|
|
@@ -13,9 +13,9 @@ import {
|
|
|
13
13
|
SuggestionWidget,
|
|
14
14
|
SummaryWidget,
|
|
15
15
|
} from '@dxos/react-ui-components';
|
|
16
|
-
import { type XmlWidgetProps, type XmlWidgetRegistry, getXmlTextChild } from '@dxos/react-ui-editor';
|
|
17
16
|
import { Json } from '@dxos/react-ui-syntax-highlighter';
|
|
18
17
|
import { ContentBlock, type Message } from '@dxos/types';
|
|
18
|
+
import { type XmlWidgetProps, type XmlWidgetRegistry, getXmlTextChild } from '@dxos/ui-editor';
|
|
19
19
|
|
|
20
20
|
import { ToolBlock } from '../ToolBlock';
|
|
21
21
|
|
|
@@ -6,6 +6,8 @@ import { EditorView } from '@codemirror/view';
|
|
|
6
6
|
import { describe, it } from '@effect/vitest';
|
|
7
7
|
import * as Effect from 'effect/Effect';
|
|
8
8
|
|
|
9
|
+
import { Obj } from '@dxos/echo';
|
|
10
|
+
import { type Mutable } from '@dxos/echo/internal';
|
|
9
11
|
import { type ContentBlock } from '@dxos/types';
|
|
10
12
|
|
|
11
13
|
import { createMessage } from '../../testing';
|
|
@@ -54,7 +56,9 @@ describe('reducers', () => {
|
|
|
54
56
|
syncer.append(messages);
|
|
55
57
|
expect(doc.content).toEqual(['<prompt>Hello</prompt>', 'Hi there!', ''].join('\n'));
|
|
56
58
|
|
|
57
|
-
messages[1]
|
|
59
|
+
Obj.change(messages[1], (m) => {
|
|
60
|
+
m.blocks.push({ _tag: 'text', text: 'How can I help?' });
|
|
61
|
+
});
|
|
58
62
|
syncer.append(messages);
|
|
59
63
|
expect(doc.content).toEqual(['<prompt>Hello</prompt>', 'Hi there!', 'How can I help?', ''].join('\n'));
|
|
60
64
|
}),
|
|
@@ -74,12 +78,16 @@ describe('reducers', () => {
|
|
|
74
78
|
syncer.append(messages);
|
|
75
79
|
expect(doc.content).toEqual(['<prompt>Hello</prompt>', 'Hi there!'].join('\n'));
|
|
76
80
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
81
|
+
Obj.change(messages[1], (m) => {
|
|
82
|
+
const block = m.blocks[0] as Mutable<ContentBlock.Text>;
|
|
83
|
+
block.text = 'Hi there! How are you?';
|
|
84
|
+
block.pending = false;
|
|
85
|
+
});
|
|
80
86
|
syncer.append(messages);
|
|
81
87
|
|
|
82
|
-
messages[1]
|
|
88
|
+
Obj.change(messages[1], (m) => {
|
|
89
|
+
m.blocks.push({ _tag: 'text', text: 'How can I help?' });
|
|
90
|
+
});
|
|
83
91
|
syncer.append(messages);
|
|
84
92
|
expect(doc.content).toEqual(
|
|
85
93
|
['<prompt>Hello</prompt>', 'Hi there! How are you?', 'How can I help?', ''].join('\n'),
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
import { type DXN } from '@dxos/echo';
|
|
6
6
|
import { log } from '@dxos/log';
|
|
7
7
|
import { type MarkdownStreamController } from '@dxos/react-ui-components';
|
|
8
|
-
import { type StateDispatch, type XmlWidgetStateManager } from '@dxos/react-ui-editor';
|
|
9
8
|
import { type ContentBlock, type Message } from '@dxos/types';
|
|
9
|
+
import { type StateDispatch, type XmlWidgetStateManager } from '@dxos/ui-editor';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Update document.
|
|
@@ -87,7 +87,13 @@ export class MessageSyncer {
|
|
|
87
87
|
|
|
88
88
|
const content = buffer.join('');
|
|
89
89
|
this._model.view?.dispatch({
|
|
90
|
-
changes: [
|
|
90
|
+
changes: [
|
|
91
|
+
{
|
|
92
|
+
from: 0,
|
|
93
|
+
to: this._model.view?.state.doc.length ?? 0,
|
|
94
|
+
insert: content,
|
|
95
|
+
},
|
|
96
|
+
],
|
|
91
97
|
selection: { anchor: content.length },
|
|
92
98
|
});
|
|
93
99
|
|
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Atom, useAtomValue } from '@effect-atom/atom-react';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
7
|
+
import * as Match from 'effect/Match';
|
|
8
|
+
import * as Option from 'effect/Option';
|
|
9
|
+
import type * as Record from 'effect/Record';
|
|
10
|
+
import React, { useCallback, useMemo, useState } from 'react';
|
|
11
|
+
|
|
12
|
+
import { Surface, useCapability } from '@dxos/app-framework/ui';
|
|
13
|
+
import { Initiative } from '@dxos/assistant-toolkit';
|
|
14
|
+
import { DXN, Filter, Obj, Query, Ref } from '@dxos/echo';
|
|
15
|
+
import { type JsonPath, splitJsonPath } from '@dxos/echo/internal';
|
|
16
|
+
import { AtomObj, AtomRef } from '@dxos/echo-atom';
|
|
17
|
+
import { FunctionDefinition, QueueService, Trigger } from '@dxos/functions';
|
|
18
|
+
import { AutomationCapabilities } from '@dxos/plugin-automation/types';
|
|
19
|
+
import { MarkdownEditor } from '@dxos/plugin-markdown';
|
|
20
|
+
import { useObject, useQuery } from '@dxos/react-client/echo';
|
|
21
|
+
import { Button, ButtonGroup, IconButton, Input, toLocalizedString, useTranslation } from '@dxos/react-ui';
|
|
22
|
+
import { Form, type FormFieldMap, omitId } from '@dxos/react-ui-form';
|
|
23
|
+
import { StackItem } from '@dxos/react-ui-stack';
|
|
24
|
+
import { type Text } from '@dxos/schema';
|
|
25
|
+
|
|
26
|
+
export type InitiativeContainerProps = {
|
|
27
|
+
role?: string;
|
|
28
|
+
initiative: Initiative.Initiative;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const TAB_INITATIVE = 'Initiative';
|
|
32
|
+
const TAB_CHAT = 'Chat';
|
|
33
|
+
|
|
34
|
+
export const InitiativeContainer = ({ role, initiative }: InitiativeContainerProps) => {
|
|
35
|
+
const [selectedTab, setSelectedTab] = useState<string>(TAB_INITATIVE);
|
|
36
|
+
|
|
37
|
+
const tabs = useAtomValue(
|
|
38
|
+
useMemo(
|
|
39
|
+
() =>
|
|
40
|
+
AtomObj.make(initiative).pipe((initiative) =>
|
|
41
|
+
Atom.make((get) => {
|
|
42
|
+
return [TAB_INITATIVE, TAB_CHAT, ...get(initiative).artifacts.map((artifact) => artifact.name)];
|
|
43
|
+
}),
|
|
44
|
+
),
|
|
45
|
+
[initiative],
|
|
46
|
+
),
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
const chat = useAtomValue(
|
|
50
|
+
useMemo(
|
|
51
|
+
() =>
|
|
52
|
+
AtomObj.make(initiative).pipe((initiative) =>
|
|
53
|
+
Atom.make((get) => {
|
|
54
|
+
const chat = get(initiative).chat;
|
|
55
|
+
return chat ? get(AtomRef.make(chat)) : undefined;
|
|
56
|
+
}),
|
|
57
|
+
),
|
|
58
|
+
[initiative],
|
|
59
|
+
),
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
const artifacts = useAtomValue(
|
|
63
|
+
useMemo(
|
|
64
|
+
() =>
|
|
65
|
+
AtomObj.make(initiative).pipe((initiative) =>
|
|
66
|
+
Atom.make((get) => {
|
|
67
|
+
return get(initiative).artifacts.map((artifact) => ({
|
|
68
|
+
name: artifact.name,
|
|
69
|
+
data: get(AtomRef.make(artifact.data)),
|
|
70
|
+
}));
|
|
71
|
+
}),
|
|
72
|
+
),
|
|
73
|
+
[initiative],
|
|
74
|
+
),
|
|
75
|
+
);
|
|
76
|
+
|
|
77
|
+
const selectedArtifact = artifacts.find((artifact) => artifact.name === selectedTab);
|
|
78
|
+
|
|
79
|
+
return (
|
|
80
|
+
<StackItem.Content toolbar>
|
|
81
|
+
<div
|
|
82
|
+
role='none'
|
|
83
|
+
className='flex-1 min-is-0 overflow-x-auto scrollbar-none flex gap-1 border-b border-subduedSeparator'
|
|
84
|
+
>
|
|
85
|
+
{tabs.map((tab) => (
|
|
86
|
+
<IconButton
|
|
87
|
+
key={tab}
|
|
88
|
+
icon={Match.value(tab).pipe(
|
|
89
|
+
Match.when(TAB_INITATIVE, () => 'ph--sparkle--regular'),
|
|
90
|
+
Match.when(TAB_CHAT, () => 'ph--chat--regular'),
|
|
91
|
+
Match.orElse(() => 'ph--file--regular'),
|
|
92
|
+
)}
|
|
93
|
+
label={tab}
|
|
94
|
+
variant={selectedTab === tab ? 'primary' : 'ghost'}
|
|
95
|
+
onClick={() => setSelectedTab(tab)}
|
|
96
|
+
/>
|
|
97
|
+
))}
|
|
98
|
+
</div>
|
|
99
|
+
{selectedTab === TAB_INITATIVE && <InitiativeForm initiative={initiative} />}
|
|
100
|
+
{selectedTab === TAB_CHAT && <Surface.Surface role='article' data={{ subject: chat }} limit={1} />}
|
|
101
|
+
{selectedArtifact && <Surface.Surface role='section' data={{ subject: selectedArtifact.data }} limit={1} />}
|
|
102
|
+
</StackItem.Content>
|
|
103
|
+
);
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
export default InitiativeContainer;
|
|
107
|
+
|
|
108
|
+
const InitiativeForm = ({ initiative }: { initiative: Initiative.Initiative }) => {
|
|
109
|
+
const handleChange = useCallback(
|
|
110
|
+
(
|
|
111
|
+
values: Omit<Initiative.Initiative, 'id'>,
|
|
112
|
+
{ isValid, changed }: { isValid: boolean; changed: Record<string, boolean> },
|
|
113
|
+
) => {
|
|
114
|
+
if (!isValid) {
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
const changedPaths = Object.keys(changed).filter((path) => changed[path as string]) as JsonPath[];
|
|
119
|
+
// Handle other property changes.
|
|
120
|
+
if (changedPaths.length > 0) {
|
|
121
|
+
Obj.change(initiative, () => {
|
|
122
|
+
for (const path of changedPaths) {
|
|
123
|
+
const parts = splitJsonPath(path);
|
|
124
|
+
const value = Obj.getValue(values as any, parts);
|
|
125
|
+
Obj.setValue(initiative, parts, value);
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
queueMicrotask(() => syncTriggers(initiative));
|
|
131
|
+
},
|
|
132
|
+
[initiative],
|
|
133
|
+
);
|
|
134
|
+
|
|
135
|
+
const fieldMap = useMemo<FormFieldMap>(
|
|
136
|
+
() => ({
|
|
137
|
+
spec: ({ type, label, getValue, onValueChange }) => {
|
|
138
|
+
const { t } = useTranslation();
|
|
139
|
+
|
|
140
|
+
const value: Ref.Ref<Text.Text> = getValue();
|
|
141
|
+
const target = useAtomValue(AtomRef.make(value));
|
|
142
|
+
const [initialValue] = useObject(target, 'content');
|
|
143
|
+
|
|
144
|
+
return (
|
|
145
|
+
<Input.Root>
|
|
146
|
+
<div role='none'>
|
|
147
|
+
<Input.Label>{toLocalizedString(label, t)}</Input.Label>
|
|
148
|
+
</div>
|
|
149
|
+
<MarkdownEditor.Root id={target?.id ?? ''} object={target}>
|
|
150
|
+
<MarkdownEditor.Content initialValue={initialValue} />
|
|
151
|
+
</MarkdownEditor.Root>
|
|
152
|
+
</Input.Root>
|
|
153
|
+
);
|
|
154
|
+
},
|
|
155
|
+
plan: ({ type, label, getValue, onValueChange }) => {
|
|
156
|
+
const { t } = useTranslation();
|
|
157
|
+
|
|
158
|
+
const value: Ref.Ref<Initiative.Plan> = getValue();
|
|
159
|
+
const target = useAtomValue(AtomRef.make(value));
|
|
160
|
+
|
|
161
|
+
return (
|
|
162
|
+
<Input.Root>
|
|
163
|
+
<div role='none'>
|
|
164
|
+
<Input.Label>{toLocalizedString(label, t)}</Input.Label>
|
|
165
|
+
</div>
|
|
166
|
+
<MarkdownEditor.Root id={target?.id ?? ''}>
|
|
167
|
+
<MarkdownEditor.Content initialValue={target ? Initiative.formatPlan(target) : ''} />
|
|
168
|
+
</MarkdownEditor.Root>
|
|
169
|
+
</Input.Root>
|
|
170
|
+
);
|
|
171
|
+
},
|
|
172
|
+
}),
|
|
173
|
+
[],
|
|
174
|
+
);
|
|
175
|
+
|
|
176
|
+
const computeRuntime = useCapability(AutomationCapabilities.ComputeRuntime);
|
|
177
|
+
|
|
178
|
+
const handleResetHistory = useCallback(async () => {
|
|
179
|
+
const runtime = computeRuntime.getRuntime(Obj.getDatabase(initiative)!.spaceId);
|
|
180
|
+
|
|
181
|
+
await runtime.runPromise(Initiative.resetChatHistory(initiative));
|
|
182
|
+
|
|
183
|
+
if (!initiative.queue) {
|
|
184
|
+
await runtime.runPromise(
|
|
185
|
+
Effect.gen(function* () {
|
|
186
|
+
const queue = yield* QueueService.createQueue();
|
|
187
|
+
Obj.change(initiative, (initiative) => {
|
|
188
|
+
initiative.queue = Ref.fromDXN(queue.dxn);
|
|
189
|
+
});
|
|
190
|
+
}),
|
|
191
|
+
);
|
|
192
|
+
}
|
|
193
|
+
}, [initiative, computeRuntime]);
|
|
194
|
+
|
|
195
|
+
const inputQueue = useAtomValue(
|
|
196
|
+
AtomObj.make(initiative).pipe((_) =>
|
|
197
|
+
Atom.make((get) =>
|
|
198
|
+
Option.fromNullable(get(_).queue).pipe(Option.map(AtomRef.make), Option.map(get), Option.getOrUndefined),
|
|
199
|
+
),
|
|
200
|
+
),
|
|
201
|
+
);
|
|
202
|
+
|
|
203
|
+
const inputQueueItems = useQuery(inputQueue, Query.select(Filter.everything()));
|
|
204
|
+
|
|
205
|
+
// TODO(dmaretskyi): Form breaks if we provide the echo object directly.
|
|
206
|
+
const spreadValue = useMemo(() => ({ ...initiative }), [initiative]);
|
|
207
|
+
return (
|
|
208
|
+
<div className='flex flex-col gap-2'>
|
|
209
|
+
<ButtonGroup classNames='h-10'>
|
|
210
|
+
<Button onClick={handleResetHistory}>Reset History</Button>
|
|
211
|
+
</ButtonGroup>
|
|
212
|
+
<h3 className='mb-2'>Input Queue</h3>
|
|
213
|
+
<div className='border border-subduedSeparator rounded-md p-2 h-64 overflow-y-auto'>
|
|
214
|
+
{inputQueueItems.map((item) => (
|
|
215
|
+
<Surface.Surface key={item.id} role='section' data={{ subject: item }} limit={1} />
|
|
216
|
+
))}
|
|
217
|
+
{inputQueueItems.length === 0 && <div className='text-subdued'>No items in queue</div>}
|
|
218
|
+
</div>
|
|
219
|
+
<Form.Root
|
|
220
|
+
schema={omitId(Initiative.Initiative)}
|
|
221
|
+
onValuesChanged={handleChange as any}
|
|
222
|
+
values={spreadValue}
|
|
223
|
+
db={Obj.getDatabase(initiative)}
|
|
224
|
+
fieldMap={fieldMap}
|
|
225
|
+
>
|
|
226
|
+
<Form.FieldSet />
|
|
227
|
+
</Form.Root>
|
|
228
|
+
</div>
|
|
229
|
+
);
|
|
230
|
+
};
|
|
231
|
+
|
|
232
|
+
// TODO(dmaretskyi): Perhaps the association is better done with a relation.
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* Foreign key {@link INITIATIVE_TRIGGER_EXTENSION_KEY} => <initative id : ObjectId>
|
|
236
|
+
*/
|
|
237
|
+
const INITIATIVE_TRIGGER_EXTENSION_KEY = 'dxos.org/extension/InitiativeTrigger';
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* Foreign key {@link INITIATIVE_TRIGGER_EXTENSION_KEY} => <dxn string of subscription target>
|
|
241
|
+
*/
|
|
242
|
+
const INITIATIVE_TRIGGER_TARGET_EXTENSION_KEY = 'dxos.org/extension/InitiativeTriggerTarget';
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* Syncs triggers in the database with the initiative subscriptions.
|
|
246
|
+
*/
|
|
247
|
+
|
|
248
|
+
const syncTriggers = async (initiative: Initiative.Initiative) => {
|
|
249
|
+
const db = Obj.getDatabase(initiative);
|
|
250
|
+
if (!db) {
|
|
251
|
+
return;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
const triggers = await db
|
|
255
|
+
.query(Filter.foreignKeys(Trigger.Trigger, [{ source: INITIATIVE_TRIGGER_EXTENSION_KEY, id: initiative.id }]))
|
|
256
|
+
.run();
|
|
257
|
+
|
|
258
|
+
// Delete triggers that are not in subscriptions.
|
|
259
|
+
for (const trigger of triggers) {
|
|
260
|
+
const target = Obj.getKeys(trigger, INITIATIVE_TRIGGER_TARGET_EXTENSION_KEY).at(0)?.id;
|
|
261
|
+
|
|
262
|
+
const exists = initiative.subscriptions.find((subscription) => subscription.dxn.toString() === target);
|
|
263
|
+
if (!exists && !(initiative.useQualifyingAgent && target === Obj.getDXN(initiative)?.toString())) {
|
|
264
|
+
db.remove(trigger);
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
// Add triggers that are not in the database.
|
|
269
|
+
for (const subscription of initiative.subscriptions) {
|
|
270
|
+
const relevantTrigger = triggers.find((trigger) =>
|
|
271
|
+
Obj.getKeys(trigger, INITIATIVE_TRIGGER_TARGET_EXTENSION_KEY).some(
|
|
272
|
+
(key) => key.id === subscription.dxn.toString(),
|
|
273
|
+
),
|
|
274
|
+
);
|
|
275
|
+
if (relevantTrigger) {
|
|
276
|
+
continue;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
const target = await subscription.tryLoad();
|
|
280
|
+
if (!target || !target.queue || !(target.queue.dxn instanceof DXN) || target.queue.dxn.kind !== DXN.kind.QUEUE) {
|
|
281
|
+
continue;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
db.add(
|
|
285
|
+
Trigger.make({
|
|
286
|
+
[Obj.Meta]: {
|
|
287
|
+
keys: [
|
|
288
|
+
{ source: INITIATIVE_TRIGGER_EXTENSION_KEY, id: initiative.id },
|
|
289
|
+
{ source: INITIATIVE_TRIGGER_TARGET_EXTENSION_KEY, id: subscription.dxn.toString() },
|
|
290
|
+
],
|
|
291
|
+
},
|
|
292
|
+
enabled: true,
|
|
293
|
+
spec: {
|
|
294
|
+
kind: 'queue',
|
|
295
|
+
queue: target.queue.dxn.toString(),
|
|
296
|
+
},
|
|
297
|
+
function: Ref.make(
|
|
298
|
+
FunctionDefinition.serialize(initiative.useQualifyingAgent ? Initiative.qualifier : Initiative.agent),
|
|
299
|
+
),
|
|
300
|
+
input: {
|
|
301
|
+
initiative: Ref.make(initiative),
|
|
302
|
+
event: '{{event}}',
|
|
303
|
+
},
|
|
304
|
+
concurrency: initiative.useQualifyingAgent ? 5 : undefined,
|
|
305
|
+
}),
|
|
306
|
+
);
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
if (initiative.useQualifyingAgent) {
|
|
310
|
+
const qualifierTrigger = triggers.find((trigger) =>
|
|
311
|
+
Obj.getKeys(trigger, INITIATIVE_TRIGGER_TARGET_EXTENSION_KEY).some(
|
|
312
|
+
(key) => key.id === Obj.getDXN(initiative)?.toString(),
|
|
313
|
+
),
|
|
314
|
+
);
|
|
315
|
+
if (!qualifierTrigger && initiative.queue) {
|
|
316
|
+
db.add(
|
|
317
|
+
Trigger.make({
|
|
318
|
+
[Obj.Meta]: {
|
|
319
|
+
keys: [
|
|
320
|
+
{ source: INITIATIVE_TRIGGER_EXTENSION_KEY, id: initiative.id },
|
|
321
|
+
{ source: INITIATIVE_TRIGGER_TARGET_EXTENSION_KEY, id: Obj.getDXN(initiative)?.toString() ?? '' },
|
|
322
|
+
],
|
|
323
|
+
},
|
|
324
|
+
function: Ref.make(FunctionDefinition.serialize(Initiative.agent)),
|
|
325
|
+
enabled: true,
|
|
326
|
+
spec: {
|
|
327
|
+
kind: 'queue',
|
|
328
|
+
queue: initiative.queue.dxn.toString(),
|
|
329
|
+
},
|
|
330
|
+
input: {
|
|
331
|
+
initiative: Ref.make(initiative),
|
|
332
|
+
event: '{{event}}',
|
|
333
|
+
},
|
|
334
|
+
}),
|
|
335
|
+
);
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
await db.flush({ indexes: true });
|
|
340
|
+
};
|
|
@@ -4,15 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useMemo } from 'react';
|
|
6
6
|
|
|
7
|
-
import { type SurfaceComponentProps } from '@dxos/app-
|
|
7
|
+
import { type SurfaceComponentProps } from '@dxos/app-toolkit/ui';
|
|
8
8
|
import { Agent } from '@dxos/assistant-toolkit';
|
|
9
9
|
import { type Prompt } from '@dxos/blueprints';
|
|
10
10
|
import { Obj } from '@dxos/echo';
|
|
11
11
|
import { invokeFunctionWithTracing, useComputeRuntimeCallback } from '@dxos/plugin-automation';
|
|
12
|
-
import {
|
|
13
|
-
import { Toolbar, useTranslation } from '@dxos/react-ui';
|
|
12
|
+
import { Layout, Toolbar, useTranslation } from '@dxos/react-ui';
|
|
14
13
|
import { useAttention } from '@dxos/react-ui-attention';
|
|
15
|
-
import { StackItem } from '@dxos/react-ui-stack';
|
|
16
14
|
|
|
17
15
|
import { meta } from '../meta';
|
|
18
16
|
|
|
@@ -20,31 +18,31 @@ import { TemplateEditor } from './TemplateEditor';
|
|
|
20
18
|
|
|
21
19
|
export type PromptArticleProps = SurfaceComponentProps<Prompt.Prompt>;
|
|
22
20
|
|
|
23
|
-
export const PromptArticle = ({ subject }: PromptArticleProps) => {
|
|
21
|
+
export const PromptArticle = ({ role, subject }: PromptArticleProps) => {
|
|
24
22
|
const { t } = useTranslation(meta.id);
|
|
25
|
-
const
|
|
23
|
+
const db = Obj.getDatabase(subject);
|
|
26
24
|
const { hasAttention } = useAttention(Obj.getDXN(subject).toString());
|
|
27
25
|
|
|
28
26
|
const inputData = useMemo(
|
|
29
27
|
() =>
|
|
30
28
|
subject && {
|
|
31
|
-
prompt:
|
|
29
|
+
prompt: db?.makeRef(Obj.getDXN(subject)),
|
|
32
30
|
input: {},
|
|
33
31
|
},
|
|
34
|
-
[subject,
|
|
32
|
+
[subject, db],
|
|
35
33
|
);
|
|
36
34
|
|
|
37
|
-
const handleRun = useComputeRuntimeCallback(
|
|
35
|
+
const handleRun = useComputeRuntimeCallback(db?.spaceId, () => invokeFunctionWithTracing(Agent.prompt, inputData), [
|
|
38
36
|
inputData,
|
|
39
37
|
]);
|
|
40
38
|
|
|
41
39
|
return (
|
|
42
|
-
<
|
|
40
|
+
<Layout.Main role={role} toolbar>
|
|
43
41
|
<Toolbar.Root disabled={!hasAttention} onClick={handleRun}>
|
|
44
42
|
<Toolbar.IconButton iconOnly icon='ph--play--regular' label={t('run prompt label')} onClick={handleRun} />
|
|
45
43
|
</Toolbar.Root>
|
|
46
44
|
<TemplateEditor id={subject.id} template={subject.instructions} classNames='container-max-width' />
|
|
47
|
-
</
|
|
45
|
+
</Layout.Main>
|
|
48
46
|
);
|
|
49
47
|
};
|
|
50
48
|
|
|
@@ -57,7 +57,7 @@ const DefaultStory = ({ source }: TemplateEditorProps & { source: string }) => {
|
|
|
57
57
|
|
|
58
58
|
return (
|
|
59
59
|
<TemplateEditor
|
|
60
|
-
classNames='bg-baseSurface
|
|
60
|
+
classNames='bg-baseSurface is-full max-is-proseMaxWidth'
|
|
61
61
|
id={blueprint.id}
|
|
62
62
|
template={blueprint.instructions}
|
|
63
63
|
/>
|
|
@@ -69,8 +69,8 @@ const meta = {
|
|
|
69
69
|
component: TemplateEditor as any,
|
|
70
70
|
render: DefaultStory,
|
|
71
71
|
decorators: [
|
|
72
|
-
withTheme,
|
|
73
|
-
withLayout({
|
|
72
|
+
withTheme(),
|
|
73
|
+
withLayout({ layout: 'column' }),
|
|
74
74
|
withClientProvider({
|
|
75
75
|
types: [Blueprint.Blueprint],
|
|
76
76
|
createIdentity: true,
|
|
@@ -8,15 +8,15 @@ import React from 'react';
|
|
|
8
8
|
import { type Template } from '@dxos/blueprints';
|
|
9
9
|
import { createDocAccessor } from '@dxos/echo-db';
|
|
10
10
|
import { type ThemedClassName, useThemeContext, useTranslation } from '@dxos/react-ui';
|
|
11
|
+
import { useTextEditor } from '@dxos/react-ui-editor';
|
|
11
12
|
import {
|
|
12
13
|
createBasicExtensions,
|
|
13
14
|
createDataExtensions,
|
|
14
15
|
createMarkdownExtensions,
|
|
15
16
|
createThemeExtensions,
|
|
16
17
|
decorateMarkdown,
|
|
17
|
-
|
|
18
|
-
} from '@dxos/
|
|
19
|
-
import { mx } from '@dxos/react-ui-theme';
|
|
18
|
+
} from '@dxos/ui-editor';
|
|
19
|
+
import { mx } from '@dxos/ui-theme';
|
|
20
20
|
import { isNonNullable } from '@dxos/util';
|
|
21
21
|
|
|
22
22
|
import { meta } from '../../meta';
|
|
@@ -51,7 +51,10 @@ export const TemplateEditor = ({ id, classNames, template, lineNumbers = true }:
|
|
|
51
51
|
lineWrapping: true,
|
|
52
52
|
placeholder: t('template placeholder'),
|
|
53
53
|
}),
|
|
54
|
-
createThemeExtensions({
|
|
54
|
+
createThemeExtensions({
|
|
55
|
+
themeMode,
|
|
56
|
+
slots: { content: { className: '!pie-4' } },
|
|
57
|
+
}),
|
|
55
58
|
createMarkdownExtensions(),
|
|
56
59
|
decorateMarkdown(),
|
|
57
60
|
handlebars(),
|