@dxos/plugin-assistant 0.8.4-main.67995b8 → 0.8.4-main.6fa680abb7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/AssistantSettings-PP6JSHWB.mjs +93 -0
- package/dist/lib/browser/AssistantSettings-PP6JSHWB.mjs.map +7 -0
- package/dist/lib/browser/BlueprintArticle-H6R33TZZ.mjs +35 -0
- package/dist/lib/browser/BlueprintArticle-H6R33TZZ.mjs.map +7 -0
- package/dist/lib/browser/ChatCompanion-GXS6DK4X.mjs +202 -0
- package/dist/lib/browser/ChatCompanion-GXS6DK4X.mjs.map +7 -0
- package/dist/lib/browser/ChatContainer-SMSZXEF5.mjs +12 -0
- package/dist/lib/browser/ChatContainer-SMSZXEF5.mjs.map +7 -0
- package/dist/lib/browser/ChatDialog-ZCVPPONM.mjs +85 -0
- package/dist/lib/browser/ChatDialog-ZCVPPONM.mjs.map +7 -0
- package/dist/lib/browser/ProjectArticle-QDBTIFNE.mjs +91 -0
- package/dist/lib/browser/ProjectArticle-QDBTIFNE.mjs.map +7 -0
- package/dist/lib/browser/ProjectSettings-L5MCDUXK.mjs +232 -0
- package/dist/lib/browser/ProjectSettings-L5MCDUXK.mjs.map +7 -0
- package/dist/lib/browser/PromptArticle-G5YSAEGK.mjs +71 -0
- package/dist/lib/browser/PromptArticle-G5YSAEGK.mjs.map +7 -0
- package/dist/lib/browser/TriggerStatus-X35WDCK5.mjs +112 -0
- package/dist/lib/browser/TriggerStatus-X35WDCK5.mjs.map +7 -0
- package/dist/lib/browser/ai-service-CY2BYPH6.mjs +22 -0
- package/dist/lib/browser/ai-service-CY2BYPH6.mjs.map +7 -0
- package/dist/lib/browser/app-graph-builder-ECQCWGCN.mjs +224 -0
- package/dist/lib/browser/app-graph-builder-ECQCWGCN.mjs.map +7 -0
- package/dist/lib/browser/blueprint-definition-CKG4TQ2J.mjs +35 -0
- package/dist/lib/browser/blueprint-definition-CKG4TQ2J.mjs.map +7 -0
- package/dist/lib/browser/blueprints/index.mjs +8 -0
- package/dist/lib/browser/blueprints/index.mjs.map +7 -0
- package/dist/lib/browser/chunk-2VIEX4RA.mjs +23 -0
- package/dist/lib/browser/chunk-2VIEX4RA.mjs.map +7 -0
- package/dist/lib/browser/chunk-734CB3XG.mjs +230 -0
- package/dist/lib/browser/chunk-734CB3XG.mjs.map +7 -0
- package/dist/lib/browser/chunk-A346P45I.mjs +2125 -0
- package/dist/lib/browser/chunk-A346P45I.mjs.map +7 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs.map +7 -0
- package/dist/lib/browser/chunk-JYY5AD65.mjs +286 -0
- package/dist/lib/browser/chunk-JYY5AD65.mjs.map +7 -0
- package/dist/lib/browser/chunk-WP4WY2Y6.mjs +69 -0
- package/dist/lib/browser/chunk-WP4WY2Y6.mjs.map +7 -0
- package/dist/lib/browser/chunk-ZZRRSIQQ.mjs +26 -0
- package/dist/lib/browser/chunk-ZZRRSIQQ.mjs.map +7 -0
- package/dist/lib/browser/edge-model-resolver-YTMFQEN5.mjs +21 -0
- package/dist/lib/browser/edge-model-resolver-YTMFQEN5.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +295 -175
- 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-DYSWWNVG.mjs +123 -0
- package/dist/lib/browser/operation-resolver-DYSWWNVG.mjs.map +7 -0
- package/dist/lib/browser/react-surface-M3GSSFPC.mjs +142 -0
- package/dist/lib/browser/react-surface-M3GSSFPC.mjs.map +7 -0
- package/dist/lib/browser/settings-NC5DQWES.mjs +33 -0
- package/dist/lib/browser/settings-NC5DQWES.mjs.map +7 -0
- package/dist/lib/browser/state-EMIKHGYZ.mjs +26 -0
- package/dist/lib/browser/state-EMIKHGYZ.mjs.map +7 -0
- 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 +11 -4
- package/dist/lib/node-esm/AssistantSettings-3MNGBQB2.mjs +94 -0
- package/dist/lib/node-esm/AssistantSettings-3MNGBQB2.mjs.map +7 -0
- package/dist/lib/node-esm/BlueprintArticle-2KYFUQKY.mjs +36 -0
- package/dist/lib/node-esm/BlueprintArticle-2KYFUQKY.mjs.map +7 -0
- package/dist/lib/node-esm/ChatCompanion-MPQGSWZB.mjs +203 -0
- package/dist/lib/node-esm/ChatCompanion-MPQGSWZB.mjs.map +7 -0
- package/dist/lib/node-esm/ChatContainer-DMOAYUUM.mjs +13 -0
- package/dist/lib/node-esm/ChatContainer-DMOAYUUM.mjs.map +7 -0
- package/dist/lib/node-esm/ChatDialog-PV2EU2XM.mjs +86 -0
- package/dist/lib/node-esm/ChatDialog-PV2EU2XM.mjs.map +7 -0
- package/dist/lib/node-esm/ProjectArticle-BCIBESJN.mjs +92 -0
- package/dist/lib/node-esm/ProjectArticle-BCIBESJN.mjs.map +7 -0
- package/dist/lib/node-esm/ProjectSettings-K3YBQWDD.mjs +233 -0
- package/dist/lib/node-esm/ProjectSettings-K3YBQWDD.mjs.map +7 -0
- package/dist/lib/node-esm/PromptArticle-HAGZPZWV.mjs +72 -0
- package/dist/lib/node-esm/PromptArticle-HAGZPZWV.mjs.map +7 -0
- package/dist/lib/node-esm/TriggerStatus-V3QMIE7T.mjs +113 -0
- package/dist/lib/node-esm/TriggerStatus-V3QMIE7T.mjs.map +7 -0
- package/dist/lib/node-esm/ai-service-ZI3A6RVG.mjs +23 -0
- package/dist/lib/node-esm/ai-service-ZI3A6RVG.mjs.map +7 -0
- package/dist/lib/node-esm/app-graph-builder-YPHP6X6W.mjs +225 -0
- package/dist/lib/node-esm/app-graph-builder-YPHP6X6W.mjs.map +7 -0
- package/dist/lib/node-esm/blueprint-definition-UZWGSFBI.mjs +36 -0
- package/dist/lib/node-esm/blueprint-definition-UZWGSFBI.mjs.map +7 -0
- package/dist/lib/node-esm/blueprints/index.mjs +9 -0
- package/dist/lib/node-esm/blueprints/index.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-5DLYAEBK.mjs +2126 -0
- package/dist/lib/node-esm/chunk-5DLYAEBK.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-AK3JJ76X.mjs +28 -0
- package/dist/lib/node-esm/chunk-AK3JJ76X.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-JMBYVUD6.mjs +288 -0
- package/dist/lib/node-esm/chunk-JMBYVUD6.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-JQAXFBBU.mjs +231 -0
- package/dist/lib/node-esm/chunk-JQAXFBBU.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-TEYTGR67.mjs +25 -0
- package/dist/lib/node-esm/chunk-TEYTGR67.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-ZTL6HRDB.mjs +70 -0
- package/dist/lib/node-esm/chunk-ZTL6HRDB.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 +295 -175
- 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-EE4EBO2Y.mjs +124 -0
- package/dist/lib/node-esm/operation-resolver-EE4EBO2Y.mjs.map +7 -0
- package/dist/lib/node-esm/react-surface-U3PGFTKA.mjs +143 -0
- package/dist/lib/node-esm/react-surface-U3PGFTKA.mjs.map +7 -0
- package/dist/lib/node-esm/settings-OOAN5LAO.mjs +34 -0
- package/dist/lib/node-esm/settings-OOAN5LAO.mjs.map +7 -0
- package/dist/lib/node-esm/state-7A7QPQKK.mjs +27 -0
- package/dist/lib/node-esm/state-7A7QPQKK.mjs.map +7 -0
- package/dist/lib/node-esm/toolkit-5IWGLUF4.mjs +17 -0
- package/dist/lib/node-esm/toolkit-5IWGLUF4.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +11 -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 +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 +2 -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 +6 -0
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts.map +1 -0
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts +3 -0
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/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 -4
- 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/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/Chat/Chat.d.ts +39 -22
- package/dist/types/src/components/Chat/Chat.d.ts.map +1 -1
- package/dist/types/src/components/Chat/events.d.ts +10 -1
- package/dist/types/src/components/Chat/events.d.ts.map +1 -1
- package/dist/types/src/components/ChatProgress/ChatProgress.d.ts +7 -0
- package/dist/types/src/components/ChatProgress/ChatProgress.d.ts.map +1 -0
- package/dist/types/src/components/ChatProgress/index.d.ts +2 -0
- package/dist/types/src/components/ChatProgress/index.d.ts.map +1 -0
- package/dist/types/src/components/ChatPrompt/ChatActions.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts +20 -0
- package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts.map +1 -0
- package/dist/types/src/components/ChatPrompt/ChatPresets.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts +5 -6
- package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatStatusIndicator.d.ts +6 -4
- package/dist/types/src/components/ChatPrompt/ChatStatusIndicator.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/index.d.ts +1 -1
- package/dist/types/src/components/ChatPrompt/index.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.d.ts +13 -11
- package/dist/types/src/components/ChatThread/ChatThread.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts +318 -56
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/Link.d.ts +9 -0
- package/dist/types/src/components/ChatThread/Link.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/registry.d.ts +11 -0
- package/dist/types/src/components/ChatThread/registry.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/sync.d.ts +42 -0
- package/dist/types/src/components/ChatThread/sync.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/sync.test.d.ts +2 -0
- package/dist/types/src/components/ChatThread/sync.test.d.ts.map +1 -0
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts +2 -6
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts +437 -7
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts +12 -2
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts +434 -2
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/extensions/handlebars-extension.d.ts +12 -0
- package/dist/types/src/components/TemplateEditor/extensions/handlebars-extension.d.ts.map +1 -0
- package/dist/types/src/components/TemplateEditor/extensions/index.d.ts +3 -0
- package/dist/types/src/components/TemplateEditor/extensions/index.d.ts.map +1 -0
- package/dist/types/src/components/TemplateEditor/extensions/xml-extension.d.ts +8 -0
- package/dist/types/src/components/TemplateEditor/extensions/xml-extension.d.ts.map +1 -0
- package/dist/types/src/components/ToolBlock/ToolBlock.d.ts +21 -0
- package/dist/types/src/components/ToolBlock/ToolBlock.d.ts.map +1 -0
- package/dist/types/src/components/ToolBlock/ToolBlockWidget.d.ts +2 -0
- package/dist/types/src/components/ToolBlock/ToolBlockWidget.d.ts.map +1 -0
- package/dist/types/src/components/ToolBlock/index.d.ts +3 -0
- package/dist/types/src/components/ToolBlock/index.d.ts.map +1 -0
- package/dist/types/src/components/Toolbox/Toolbox.d.ts +10 -16
- package/dist/types/src/components/Toolbox/Toolbox.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts +438 -5
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts.map +1 -1
- package/dist/types/src/components/Typewriter/AssistantToolbar.d.ts +12 -0
- package/dist/types/src/components/Typewriter/AssistantToolbar.d.ts.map +1 -0
- package/dist/types/src/components/Typewriter/Typewriter.d.ts +11 -0
- package/dist/types/src/components/Typewriter/Typewriter.d.ts.map +1 -0
- package/dist/types/src/components/Typewriter/Typewriter.stories.d.ts +7 -0
- package/dist/types/src/components/Typewriter/Typewriter.stories.d.ts.map +1 -0
- package/dist/types/src/components/Typewriter/assistant-extension.d.ts +5 -0
- package/dist/types/src/components/Typewriter/assistant-extension.d.ts.map +1 -0
- package/dist/types/src/components/Typewriter/index.d.ts +2 -0
- package/dist/types/src/components/Typewriter/index.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +0 -8
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/AssistantSettings/AssistantSettings.d.ts +8 -0
- package/dist/types/src/containers/AssistantSettings/AssistantSettings.d.ts.map +1 -0
- package/dist/types/src/containers/AssistantSettings/index.d.ts +3 -0
- package/dist/types/src/containers/AssistantSettings/index.d.ts.map +1 -0
- package/dist/types/src/containers/BlueprintArticle/BlueprintArticle.d.ts +6 -0
- package/dist/types/src/containers/BlueprintArticle/BlueprintArticle.d.ts.map +1 -0
- package/dist/types/src/containers/BlueprintArticle/index.d.ts +3 -0
- package/dist/types/src/containers/BlueprintArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/ChatCompanion/ChatCompanion.d.ts +12 -0
- 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/containers/ChatContainer/ChatContainer.d.ts +19 -0
- package/dist/types/src/containers/ChatContainer/ChatContainer.d.ts.map +1 -0
- package/dist/types/src/containers/ChatContainer/index.d.ts +3 -0
- package/dist/types/src/containers/ChatContainer/index.d.ts.map +1 -0
- package/dist/types/src/{components → containers/ChatDialog}/ChatDialog.d.ts +2 -3
- package/dist/types/src/containers/ChatDialog/ChatDialog.d.ts.map +1 -0
- package/dist/types/src/containers/ChatDialog/index.d.ts +3 -0
- package/dist/types/src/containers/ChatDialog/index.d.ts.map +1 -0
- package/dist/types/src/containers/Project/ProjectArticle.d.ts +7 -0
- package/dist/types/src/containers/Project/ProjectArticle.d.ts.map +1 -0
- package/dist/types/src/containers/Project/ProjectSettings.d.ts +6 -0
- package/dist/types/src/containers/Project/ProjectSettings.d.ts.map +1 -0
- package/dist/types/src/containers/Project/index.d.ts +7 -0
- package/dist/types/src/containers/Project/index.d.ts.map +1 -0
- package/dist/types/src/containers/Project/triggers.d.ts +6 -0
- package/dist/types/src/containers/Project/triggers.d.ts.map +1 -0
- package/dist/types/src/containers/PromptArticle/PromptArticle.d.ts +6 -0
- package/dist/types/src/containers/PromptArticle/PromptArticle.d.ts.map +1 -0
- package/dist/types/src/containers/PromptArticle/index.d.ts +3 -0
- package/dist/types/src/containers/PromptArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/TriggerStatus/TriggerStatus.d.ts +4 -0
- package/dist/types/src/containers/TriggerStatus/TriggerStatus.d.ts.map +1 -0
- package/dist/types/src/containers/TriggerStatus/index.d.ts +3 -0
- package/dist/types/src/containers/TriggerStatus/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +10 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +8 -3
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useBlueprintRegistry.d.ts +25 -0
- package/dist/types/src/hooks/useBlueprintRegistry.d.ts.map +1 -0
- package/dist/types/src/hooks/useChatProcessor.d.ts +10 -20
- package/dist/types/src/hooks/useChatProcessor.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatServices.d.ts +7 -8
- package/dist/types/src/hooks/useChatServices.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatToolbarActions.d.ts +8 -0
- package/dist/types/src/hooks/useChatToolbarActions.d.ts.map +1 -0
- package/dist/types/src/hooks/useContextBinder.d.ts +4 -0
- package/dist/types/src/hooks/useContextBinder.d.ts.map +1 -0
- package/dist/types/src/hooks/useContextObjects.d.ts +15 -0
- package/dist/types/src/hooks/useContextObjects.d.ts.map +1 -0
- package/dist/types/src/hooks/useFilteredTypes.d.ts +3 -0
- package/dist/types/src/hooks/useFilteredTypes.d.ts.map +1 -0
- package/dist/types/src/hooks/useFlush.d.ts +6 -0
- package/dist/types/src/hooks/useFlush.d.ts.map +1 -0
- package/dist/types/src/hooks/useOnline.d.ts +3 -0
- package/dist/types/src/hooks/useOnline.d.ts.map +1 -0
- package/dist/types/src/hooks/usePresets.d.ts +7 -0
- package/dist/types/src/hooks/usePresets.d.ts.map +1 -0
- package/dist/types/src/hooks/useReferencesProvider.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +3 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +3 -4
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/processor/index.d.ts +4 -0
- package/dist/types/src/processor/index.d.ts.map +1 -0
- package/dist/types/src/{hooks → processor}/presets.d.ts +3 -3
- package/dist/types/src/processor/presets.d.ts.map +1 -0
- package/dist/types/src/processor/processor.d.ts +79 -0
- package/dist/types/src/processor/processor.d.ts.map +1 -0
- package/dist/types/src/processor/processor.test.d.ts +2 -0
- package/dist/types/src/processor/processor.test.d.ts.map +1 -0
- package/dist/types/src/processor/update-name.d.ts +10 -0
- package/dist/types/src/processor/update-name.d.ts.map +1 -0
- package/dist/types/src/queue-logger.d.ts.map +1 -1
- package/dist/types/src/testing/index.d.ts +1 -1
- package/dist/types/src/testing/index.d.ts.map +1 -1
- package/dist/types/src/testing/test-generator.d.ts +8 -0
- package/dist/types/src/testing/test-generator.d.ts.map +1 -0
- package/dist/types/src/testing/test-sequence.d.ts +0 -4
- package/dist/types/src/testing/test-sequence.d.ts.map +1 -1
- package/dist/types/src/testing/test-services.d.ts +2 -2
- package/dist/types/src/testing/test-services.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +382 -28
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Assistant.d.ts +20 -0
- package/dist/types/src/types/Assistant.d.ts.map +1 -0
- package/dist/types/src/types/AssistantAction.d.ts +93 -0
- package/dist/types/src/types/AssistantAction.d.ts.map +1 -0
- 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/defs.d.ts +2 -0
- package/dist/types/src/types/defs.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 +6 -1
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/service.d.ts +14 -213
- package/dist/types/src/types/service.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +127 -100
- package/src/AssistantPlugin.tsx +153 -113
- 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/{components/SequenceEditor → blueprints}/index.ts +1 -1
- 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 +197 -0
- package/src/capabilities/app-graph-builder/index.ts +7 -0
- package/src/capabilities/blueprint-definition/blueprint-definition.ts +50 -0
- package/src/capabilities/blueprint-definition/index.ts +7 -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 -6
- 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 +113 -0
- package/src/capabilities/react-surface/index.ts +7 -0
- package/src/capabilities/react-surface/react-surface.tsx +119 -0
- 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 +15 -0
- package/src/components/Chat/Chat.tsx +278 -198
- package/src/components/Chat/events.ts +14 -1
- package/src/components/ChatProgress/ChatProgress.tsx +53 -0
- package/src/components/ChatProgress/index.ts +5 -0
- package/src/components/ChatPrompt/ChatActions.tsx +20 -28
- package/src/components/ChatPrompt/ChatOptions.tsx +258 -0
- package/src/components/ChatPrompt/ChatPresets.tsx +1 -0
- package/src/components/ChatPrompt/ChatReferences.tsx +42 -38
- package/src/components/ChatPrompt/ChatStatusIndicator.tsx +25 -22
- package/src/components/ChatPrompt/index.ts +1 -1
- package/src/components/ChatThread/ChatThread.stories.tsx +123 -116
- package/src/components/ChatThread/ChatThread.tsx +75 -36
- package/src/components/ChatThread/Link.tsx +26 -0
- package/src/components/ChatThread/registry.tsx +207 -0
- package/src/components/ChatThread/sync.test.ts +99 -0
- package/src/components/ChatThread/sync.ts +160 -0
- package/src/components/ChatThread/testing/thread.md +37 -0
- package/src/components/TemplateEditor/TemplateEditor.stories.tsx +39 -18
- package/src/components/TemplateEditor/TemplateEditor.tsx +33 -54
- package/src/components/TemplateEditor/TemplateForm.stories.tsx +28 -15
- package/src/components/TemplateEditor/TemplateForm.tsx +84 -36
- package/src/components/TemplateEditor/extensions/handlebars-extension.ts +274 -0
- package/src/components/TemplateEditor/extensions/index.ts +6 -0
- package/src/components/TemplateEditor/extensions/xml-extension.ts +64 -0
- package/src/components/ToolBlock/ToolBlock.tsx +143 -0
- package/src/components/ToolBlock/ToolBlockWidget.tsx +5 -0
- package/src/components/ToolBlock/index.ts +6 -0
- package/src/components/Toolbox/Toolbox.stories.tsx +19 -29
- package/src/components/Toolbox/Toolbox.tsx +74 -104
- package/src/components/Typewriter/AssistantToolbar.tsx +161 -0
- package/src/components/Typewriter/Typewriter.stories.tsx +86 -0
- package/src/components/Typewriter/Typewriter.tsx +54 -0
- package/src/components/Typewriter/assistant-extension.tsx +142 -0
- package/src/components/Typewriter/index.ts +5 -0
- package/src/components/index.ts +0 -13
- package/src/containers/AssistantSettings/AssistantSettings.tsx +120 -0
- package/src/containers/AssistantSettings/index.ts +7 -0
- package/src/containers/BlueprintArticle/BlueprintArticle.tsx +29 -0
- package/src/containers/BlueprintArticle/index.ts +7 -0
- package/src/containers/ChatCompanion/ChatCompanion.tsx +225 -0
- package/src/containers/ChatCompanion/index.ts +7 -0
- package/src/containers/ChatContainer/ChatContainer.tsx +69 -0
- package/src/containers/ChatContainer/index.ts +7 -0
- package/src/containers/ChatDialog/ChatDialog.tsx +72 -0
- package/src/containers/ChatDialog/index.ts +7 -0
- package/src/containers/Project/ProjectArticle.tsx +117 -0
- package/src/containers/Project/ProjectSettings.tsx +134 -0
- package/src/containers/Project/index.ts +16 -0
- package/src/containers/Project/triggers.ts +149 -0
- package/src/containers/PromptArticle/PromptArticle.tsx +59 -0
- package/src/containers/PromptArticle/index.ts +7 -0
- package/src/containers/TriggerStatus/TriggerStatus.tsx +140 -0
- package/src/containers/TriggerStatus/index.ts +7 -0
- package/src/containers/index.ts +15 -0
- package/src/hooks/index.ts +8 -4
- package/src/hooks/useBlueprintRegistry.ts +108 -0
- package/src/hooks/useChatProcessor.ts +40 -105
- package/src/hooks/useChatServices.ts +31 -51
- package/src/hooks/useChatToolbarActions.ts +122 -0
- package/src/hooks/useContextBinder.ts +32 -0
- package/src/hooks/useContextObjects.ts +46 -0
- package/src/hooks/useFilteredTypes.ts +37 -0
- package/src/hooks/useFlush.ts +35 -0
- package/src/hooks/useOnline.ts +10 -0
- package/src/hooks/usePresets.ts +44 -0
- package/src/hooks/useReferencesProvider.ts +12 -13
- package/src/index.ts +3 -1
- package/src/meta.ts +11 -8
- package/src/processor/index.ts +7 -0
- package/src/{hooks → processor}/presets.ts +16 -8
- package/src/processor/processor.test.ts +73 -0
- package/src/processor/processor.ts +296 -0
- package/src/processor/update-name.ts +58 -0
- package/src/queue-logger.ts +17 -18
- package/src/testing/index.ts +1 -1
- package/src/testing/test-generator.ts +262 -0
- package/src/testing/test-sequence.ts +5 -30
- package/src/testing/test-services.ts +10 -14
- package/src/translations.ts +77 -20
- package/src/types/Assistant.ts +28 -0
- package/src/types/AssistantAction.ts +76 -0
- package/src/types/capabilities.ts +27 -0
- package/src/types/defs.ts +5 -0
- package/src/types/events.ts +11 -0
- package/src/types/index.ts +9 -1
- package/src/types/service.ts +27 -16
- package/src/vite-env.d.ts +30 -0
- package/dist/lib/browser/BlueprintContainer-IZ4AK5EO.mjs +0 -28
- package/dist/lib/browser/BlueprintContainer-IZ4AK5EO.mjs.map +0 -7
- package/dist/lib/browser/ChatContainer-RP3QEXYX.mjs +0 -54
- package/dist/lib/browser/ChatContainer-RP3QEXYX.mjs.map +0 -7
- package/dist/lib/browser/ChatDialog-ZVLXFHEY.mjs +0 -72
- package/dist/lib/browser/ChatDialog-ZVLXFHEY.mjs.map +0 -7
- package/dist/lib/browser/SequenceContainer-3UDVKWPA.mjs +0 -162
- package/dist/lib/browser/SequenceContainer-3UDVKWPA.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-XSEOKJLG.mjs +0 -164
- package/dist/lib/browser/app-graph-builder-XSEOKJLG.mjs.map +0 -7
- package/dist/lib/browser/chunk-63GG6U6D.mjs +0 -2226
- package/dist/lib/browser/chunk-63GG6U6D.mjs.map +0 -7
- package/dist/lib/browser/chunk-7W7LHTRH.mjs +0 -171
- package/dist/lib/browser/chunk-7W7LHTRH.mjs.map +0 -7
- package/dist/lib/browser/chunk-FDCJSQYF.mjs +0 -40
- package/dist/lib/browser/chunk-FDCJSQYF.mjs.map +0 -7
- package/dist/lib/browser/chunk-KFXSBNZR.mjs +0 -89
- package/dist/lib/browser/chunk-KFXSBNZR.mjs.map +0 -7
- package/dist/lib/browser/chunk-LERGF5YG.mjs +0 -108
- package/dist/lib/browser/chunk-LERGF5YG.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-MV3VSZLS.mjs +0 -75
- package/dist/lib/browser/intent-resolver-MV3VSZLS.mjs.map +0 -7
- package/dist/lib/browser/react-surface-3GYEHQRP.mjs +0 -150
- package/dist/lib/browser/react-surface-3GYEHQRP.mjs.map +0 -7
- package/dist/lib/browser/settings-5GTTCVGD.mjs +0 -22
- package/dist/lib/browser/settings-5GTTCVGD.mjs.map +0 -7
- package/dist/lib/node-esm/BlueprintContainer-RGTMNLNX.mjs +0 -29
- package/dist/lib/node-esm/BlueprintContainer-RGTMNLNX.mjs.map +0 -7
- package/dist/lib/node-esm/ChatContainer-W3W6FWV3.mjs +0 -55
- package/dist/lib/node-esm/ChatContainer-W3W6FWV3.mjs.map +0 -7
- package/dist/lib/node-esm/ChatDialog-QW4JRKVO.mjs +0 -73
- package/dist/lib/node-esm/ChatDialog-QW4JRKVO.mjs.map +0 -7
- package/dist/lib/node-esm/SequenceContainer-RQQH5XOC.mjs +0 -163
- package/dist/lib/node-esm/SequenceContainer-RQQH5XOC.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-PANCJUHV.mjs +0 -165
- package/dist/lib/node-esm/app-graph-builder-PANCJUHV.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-BFO3KHYL.mjs +0 -2227
- package/dist/lib/node-esm/chunk-BFO3KHYL.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-MS3PJARN.mjs +0 -109
- package/dist/lib/node-esm/chunk-MS3PJARN.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-QN2H2EHV.mjs +0 -41
- package/dist/lib/node-esm/chunk-QN2H2EHV.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-VIIMA3XQ.mjs +0 -90
- package/dist/lib/node-esm/chunk-VIIMA3XQ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-Z7PUODRT.mjs +0 -172
- package/dist/lib/node-esm/chunk-Z7PUODRT.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-3FMC3GHC.mjs +0 -76
- package/dist/lib/node-esm/intent-resolver-3FMC3GHC.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-QDQWJ7FZ.mjs +0 -151
- package/dist/lib/node-esm/react-surface-QDQWJ7FZ.mjs.map +0 -7
- package/dist/lib/node-esm/settings-J2EXEM5H.mjs +0 -23
- package/dist/lib/node-esm/settings-J2EXEM5H.mjs.map +0 -7
- package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -4
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface.d.ts +0 -4
- package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
- package/dist/types/src/capabilities/settings.d.ts +0 -4
- package/dist/types/src/capabilities/settings.d.ts.map +0 -1
- package/dist/types/src/capability-definitions.d.ts +0 -7
- package/dist/types/src/capability-definitions.d.ts.map +0 -1
- package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts +0 -6
- package/dist/types/src/components/AssistantSettings/AssistantSettings.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/BlueprintContainer.d.ts +0 -8
- package/dist/types/src/components/BlueprintContainer.d.ts.map +0 -1
- package/dist/types/src/components/ChatContainer.d.ts +0 -11
- 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/ChatPrompt/ChatOptionsMenu.d.ts +0 -9
- package/dist/types/src/components/ChatPrompt/ChatOptionsMenu.d.ts.map +0 -1
- package/dist/types/src/components/ChatThread/ChatMessage.d.ts +0 -17
- package/dist/types/src/components/ChatThread/ChatMessage.d.ts.map +0 -1
- package/dist/types/src/components/ChatThread/ToolBlock.d.ts +0 -19
- package/dist/types/src/components/ChatThread/ToolBlock.d.ts.map +0 -1
- package/dist/types/src/components/ChatThread/reducer.d.ts +0 -12
- package/dist/types/src/components/ChatThread/reducer.d.ts.map +0 -1
- package/dist/types/src/components/PromptSettings.d.ts +0 -6
- package/dist/types/src/components/PromptSettings.d.ts.map +0 -1
- package/dist/types/src/components/SequenceContainer.d.ts +0 -8
- package/dist/types/src/components/SequenceContainer.d.ts.map +0 -1
- package/dist/types/src/components/SequenceEditor/SequenceEditor.d.ts +0 -13
- package/dist/types/src/components/SequenceEditor/SequenceEditor.d.ts.map +0 -1
- package/dist/types/src/components/SequenceEditor/SequenceEditor.stories.d.ts +0 -8
- package/dist/types/src/components/SequenceEditor/SequenceEditor.stories.d.ts.map +0 -1
- package/dist/types/src/components/SequenceEditor/index.d.ts +0 -2
- package/dist/types/src/components/SequenceEditor/index.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/hooks/chat-processor.d.ts +0 -86
- package/dist/types/src/hooks/chat-processor.d.ts.map +0 -1
- package/dist/types/src/hooks/chat-processor.test.d.ts +0 -2
- package/dist/types/src/hooks/chat-processor.test.d.ts.map +0 -1
- package/dist/types/src/hooks/presets.d.ts.map +0 -1
- package/dist/types/src/hooks/useBlueprints.d.ts +0 -9
- package/dist/types/src/hooks/useBlueprints.d.ts.map +0 -1
- package/dist/types/src/parser/filter-generator.d.ts +0 -4
- package/dist/types/src/parser/filter-generator.d.ts.map +0 -1
- package/dist/types/src/parser/filter-generator.test.d.ts +0 -2
- package/dist/types/src/parser/filter-generator.test.d.ts.map +0 -1
- package/dist/types/src/parser/index.d.ts +0 -4
- package/dist/types/src/parser/index.d.ts.map +0 -1
- package/dist/types/src/parser/query-parser.d.ts +0 -15
- package/dist/types/src/parser/query-parser.d.ts.map +0 -1
- package/dist/types/src/parser/query-parser.test.d.ts +0 -2
- package/dist/types/src/parser/query-parser.test.d.ts.map +0 -1
- package/dist/types/src/parser/types.d.ts +0 -24
- package/dist/types/src/parser/types.d.ts.map +0 -1
- package/dist/types/src/stories/Chat.stories.d.ts +0 -207
- package/dist/types/src/stories/Chat.stories.d.ts.map +0 -1
- package/dist/types/src/testing/test-functions.d.ts +0 -3
- package/dist/types/src/testing/test-functions.d.ts.map +0 -1
- package/dist/types/src/tools/function.d.ts +0 -5
- package/dist/types/src/tools/function.d.ts.map +0 -1
- package/dist/types/src/tools/index.d.ts +0 -3
- package/dist/types/src/tools/index.d.ts.map +0 -1
- package/dist/types/src/tools/openapi.d.ts +0 -10
- package/dist/types/src/tools/openapi.d.ts.map +0 -1
- package/dist/types/src/tools/openapi.test.d.ts +0 -2
- package/dist/types/src/tools/openapi.test.d.ts.map +0 -1
- package/dist/types/src/types/schema.d.ts +0 -120
- package/dist/types/src/types/schema.d.ts.map +0 -1
- package/src/capabilities/app-graph-builder.ts +0 -169
- package/src/capabilities/intent-resolver.ts +0 -72
- package/src/capabilities/react-surface.tsx +0 -138
- package/src/capabilities/settings.ts +0 -19
- package/src/capability-definitions.ts +0 -15
- package/src/components/AssistantSettings/AssistantSettings.tsx +0 -105
- package/src/components/AssistantSettings/index.ts +0 -5
- package/src/components/BlueprintContainer.tsx +0 -24
- package/src/components/ChatContainer.tsx +0 -45
- package/src/components/ChatDialog.tsx +0 -64
- package/src/components/ChatPrompt/ChatOptionsMenu.tsx +0 -52
- package/src/components/ChatThread/ChatMessage.tsx +0 -268
- package/src/components/ChatThread/ToolBlock.tsx +0 -121
- package/src/components/ChatThread/reducer.ts +0 -52
- package/src/components/PromptSettings.tsx +0 -89
- package/src/components/SequenceContainer.tsx +0 -132
- package/src/components/SequenceEditor/SequenceEditor.stories.tsx +0 -32
- package/src/components/SequenceEditor/SequenceEditor.tsx +0 -50
- package/src/events.ts +0 -11
- package/src/hooks/chat-processor.test.ts +0 -16
- package/src/hooks/chat-processor.ts +0 -314
- package/src/hooks/useBlueprints.ts +0 -57
- package/src/parser/filter-generator.test.ts +0 -32
- package/src/parser/filter-generator.ts +0 -81
- package/src/parser/index.ts +0 -7
- package/src/parser/query-parser.test.ts +0 -139
- package/src/parser/query-parser.ts +0 -199
- package/src/parser/types.ts +0 -34
- package/src/shims.d.ts +0 -8
- package/src/stories/Chat.stories.tsx +0 -371
- package/src/testing/test-functions.ts +0 -11
- package/src/tools/function.ts +0 -46
- package/src/tools/index.ts +0 -6
- package/src/tools/openapi.test.ts +0 -217
- package/src/tools/openapi.ts +0 -338
- package/src/types/schema.ts +0 -108
- package/src/typings.d.ts +0 -9
|
@@ -1,268 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React, { Fragment, type FC, type PropsWithChildren } from 'react';
|
|
6
|
-
|
|
7
|
-
import { type Tool } from '@dxos/ai';
|
|
8
|
-
import { Surface } from '@dxos/app-framework';
|
|
9
|
-
import { invariant } from '@dxos/invariant';
|
|
10
|
-
import { type Space } from '@dxos/react-client/echo';
|
|
11
|
-
import { Button, Icon, IconButton, useTranslation, type ThemedClassName } from '@dxos/react-ui';
|
|
12
|
-
import {
|
|
13
|
-
MarkdownViewer,
|
|
14
|
-
ToggleContainer as NativeToggleContainer,
|
|
15
|
-
type ToggleContainerProps,
|
|
16
|
-
} from '@dxos/react-ui-components';
|
|
17
|
-
import { mx } from '@dxos/react-ui-theme';
|
|
18
|
-
import { type ContentBlock, type DataType } from '@dxos/schema';
|
|
19
|
-
import { safeParseJson } from '@dxos/util';
|
|
20
|
-
|
|
21
|
-
import { Json, ToolBlock, isToolMessage } from './ToolBlock';
|
|
22
|
-
import { type ChatProcessor } from '../../hooks';
|
|
23
|
-
import { meta } from '../../meta';
|
|
24
|
-
import { type ChatEvent } from '../Chat';
|
|
25
|
-
import { ToolboxContainer } from '../Toolbox';
|
|
26
|
-
|
|
27
|
-
export type ChatMessageProps = ThemedClassName<{
|
|
28
|
-
debug?: boolean;
|
|
29
|
-
space?: Space;
|
|
30
|
-
message: DataType.Message;
|
|
31
|
-
// TODO(burdon): Move to context.
|
|
32
|
-
processor?: ChatProcessor;
|
|
33
|
-
tools?: Tool[];
|
|
34
|
-
onEvent?: (event: ChatEvent) => void;
|
|
35
|
-
}>;
|
|
36
|
-
|
|
37
|
-
export const ChatMessage = ({ classNames, debug, space, message, processor, tools, onEvent }: ChatMessageProps) => {
|
|
38
|
-
const { t } = useTranslation(meta.id);
|
|
39
|
-
const {
|
|
40
|
-
sender: { role },
|
|
41
|
-
blocks,
|
|
42
|
-
} = message;
|
|
43
|
-
|
|
44
|
-
// TODO(burdon): Restructure types to make check unnecessary.
|
|
45
|
-
if (isToolMessage(message)) {
|
|
46
|
-
return (
|
|
47
|
-
<MessageContainer classNames={mx(classNames, 'animate-[fadeIn_0.5s]')}>
|
|
48
|
-
<ToolBlock classNames={panelClasses} message={message} tools={tools} />
|
|
49
|
-
</MessageContainer>
|
|
50
|
-
);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
return (
|
|
54
|
-
<>
|
|
55
|
-
{debug && (
|
|
56
|
-
<div className={mx('flex justify-end text-subdued', marginClasses)}>
|
|
57
|
-
<pre className='text-xs'>{JSON.stringify({ created: message.created })}</pre>
|
|
58
|
-
</div>
|
|
59
|
-
)}
|
|
60
|
-
|
|
61
|
-
{blocks.map((block, idx) => {
|
|
62
|
-
// TODO(burdon): Filter empty messages.
|
|
63
|
-
if (block._tag === 'text' && block.text.replaceAll(/\s+/g, '').length === 0) {
|
|
64
|
-
return null;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
const Component: BlockComponent = components[block._tag] ?? components.default!;
|
|
68
|
-
if (!Component) {
|
|
69
|
-
return null;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
return (
|
|
73
|
-
<Fragment key={idx}>
|
|
74
|
-
<MessageContainer classNames={classNames} user={block._tag === 'text' && role === 'user'}>
|
|
75
|
-
<Component space={space} processor={processor} block={block} onEvent={onEvent} />
|
|
76
|
-
</MessageContainer>
|
|
77
|
-
{debug && (
|
|
78
|
-
<div className={mx('flex justify-end text-subdued', marginClasses)}>
|
|
79
|
-
<pre className='text-xs'>{JSON.stringify({ block: block._tag })}</pre>
|
|
80
|
-
</div>
|
|
81
|
-
)}
|
|
82
|
-
</Fragment>
|
|
83
|
-
);
|
|
84
|
-
})}
|
|
85
|
-
<div className={mx('flex justify-end pbs-2 pbe-2 opacity-50 hover:opacity-100', marginClasses)}>
|
|
86
|
-
<IconButton
|
|
87
|
-
classNames='animate-[fadeIn_0.5s]'
|
|
88
|
-
icon='ph--trash--regular'
|
|
89
|
-
iconOnly
|
|
90
|
-
label={t('button delete message')}
|
|
91
|
-
onClick={() => onEvent?.({ type: 'delete', id: message.id })}
|
|
92
|
-
/>
|
|
93
|
-
</div>
|
|
94
|
-
</>
|
|
95
|
-
);
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
type BlockComponentProps = {
|
|
99
|
-
space?: Space;
|
|
100
|
-
block: ContentBlock.Any;
|
|
101
|
-
/** @deprecated Replace with context */
|
|
102
|
-
processor?: ChatProcessor;
|
|
103
|
-
onEvent?: (event: ChatEvent) => void;
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
type BlockComponent = FC<BlockComponentProps>;
|
|
107
|
-
|
|
108
|
-
const components: Partial<Record<ContentBlock.Any['_tag'] | 'default', BlockComponent>> = {
|
|
109
|
-
//
|
|
110
|
-
// Text
|
|
111
|
-
//
|
|
112
|
-
['text' as const]: ({ block }) => {
|
|
113
|
-
invariant(block._tag === 'text');
|
|
114
|
-
// const [open, setOpen] = useState(block.disposition === 'cot' && block.pending);
|
|
115
|
-
const title = block.disposition ? titles[block.disposition] : undefined;
|
|
116
|
-
if (!title) {
|
|
117
|
-
return <MarkdownViewer content={block.text} />;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
// TOOD(burdon): Store last time user opened/closed COT.
|
|
121
|
-
// Autoclose when streaming ends.
|
|
122
|
-
// useEffect(() => {
|
|
123
|
-
// if (block.disposition === 'cot' && !block.pending) {
|
|
124
|
-
// setOpen(false);
|
|
125
|
-
// }
|
|
126
|
-
// }, [block.disposition, block.pending]);
|
|
127
|
-
|
|
128
|
-
return (
|
|
129
|
-
<ToggleContainer
|
|
130
|
-
// open={open}
|
|
131
|
-
defaultOpen={systemDispositions.includes(block.disposition ?? '') && block.pending}
|
|
132
|
-
title={title}
|
|
133
|
-
icon={
|
|
134
|
-
block.pending ? (
|
|
135
|
-
<Icon icon={'ph--circle-notch--regular'} classNames='text-subdued animate-spin' size={4} />
|
|
136
|
-
) : undefined
|
|
137
|
-
}
|
|
138
|
-
>
|
|
139
|
-
<MarkdownViewer
|
|
140
|
-
content={block.text}
|
|
141
|
-
classNames={['pbe-2', systemDispositions.includes(block.disposition ?? '') && 'text-sm text-subdued']}
|
|
142
|
-
/>
|
|
143
|
-
</ToggleContainer>
|
|
144
|
-
);
|
|
145
|
-
},
|
|
146
|
-
|
|
147
|
-
//
|
|
148
|
-
// JSON
|
|
149
|
-
//
|
|
150
|
-
['json' as const]: ({ space, processor, block, onEvent }) => {
|
|
151
|
-
invariant(block._tag === 'json');
|
|
152
|
-
|
|
153
|
-
switch (block.disposition) {
|
|
154
|
-
case 'tool_list': {
|
|
155
|
-
return (
|
|
156
|
-
<ToggleContainer title={titles[block.disposition]} defaultOpen={true}>
|
|
157
|
-
<ToolboxContainer space={space} processor={processor} classNames='pbe-2' />
|
|
158
|
-
</ToggleContainer>
|
|
159
|
-
);
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
case 'suggest': {
|
|
163
|
-
const { text = '' }: { text: string } = safeParseJson(block.data ?? '{}') ?? ({} as any);
|
|
164
|
-
return (
|
|
165
|
-
<IconButton icon='ph--lightning--regular' label={text} onClick={() => onEvent?.({ type: 'submit', text })} />
|
|
166
|
-
);
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
case 'select': {
|
|
170
|
-
const { options = [] }: { options: string[] } = safeParseJson(block.data ?? '{}') ?? ({} as any);
|
|
171
|
-
return (
|
|
172
|
-
<div className='flex flex-wrap gap-1'>
|
|
173
|
-
{options.map((text, idx) => (
|
|
174
|
-
<Button
|
|
175
|
-
classNames={'animate-[fadeIn_0.5s] rounded-sm text-sm'}
|
|
176
|
-
key={idx}
|
|
177
|
-
onClick={() => onEvent?.({ type: 'submit', text })}
|
|
178
|
-
>
|
|
179
|
-
{text}
|
|
180
|
-
</Button>
|
|
181
|
-
))}
|
|
182
|
-
</div>
|
|
183
|
-
);
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
case 'graph': {
|
|
187
|
-
return (
|
|
188
|
-
<div className='flex flex-wrap gap-1'>
|
|
189
|
-
<Surface
|
|
190
|
-
role='card'
|
|
191
|
-
data={{ subject: JSON.parse(block.data ?? '{}') }}
|
|
192
|
-
limit={1}
|
|
193
|
-
fallback={<div className='font-mono text-xs text-pre'>{block.data}</div>}
|
|
194
|
-
/>
|
|
195
|
-
{onEvent && (
|
|
196
|
-
<IconButton
|
|
197
|
-
icon='ph--plus--regular'
|
|
198
|
-
label='Add to graph'
|
|
199
|
-
onClick={() => onEvent?.({ type: 'add', object: JSON.parse(block.data ?? '{}') })}
|
|
200
|
-
/>
|
|
201
|
-
)}
|
|
202
|
-
</div>
|
|
203
|
-
);
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
default: {
|
|
207
|
-
const title = block.disposition ? titles[block.disposition] : undefined;
|
|
208
|
-
return (
|
|
209
|
-
<ToggleContainer title={title ?? 'JSON'}>
|
|
210
|
-
<Json data={safeParseJson(block.data ?? block)} />
|
|
211
|
-
</ToggleContainer>
|
|
212
|
-
);
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
},
|
|
216
|
-
|
|
217
|
-
//
|
|
218
|
-
// Default
|
|
219
|
-
//
|
|
220
|
-
default: ({ block }) => {
|
|
221
|
-
let title = titles[block._tag];
|
|
222
|
-
if (block._tag === 'toolCall') {
|
|
223
|
-
title = `Tool [${block.name}]`; // TODO(burdon): Get label from tool.
|
|
224
|
-
} else {
|
|
225
|
-
title = block._tag;
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
return (
|
|
229
|
-
<ToggleContainer title={title ?? 'JSON'}>
|
|
230
|
-
<Json data={block} />
|
|
231
|
-
</ToggleContainer>
|
|
232
|
-
);
|
|
233
|
-
},
|
|
234
|
-
};
|
|
235
|
-
|
|
236
|
-
// TODO(burdon): Translations.
|
|
237
|
-
const titles: Record<string, string> = {
|
|
238
|
-
['cot' as const]: 'Chain of thought',
|
|
239
|
-
['artifact' as const]: 'Artifact',
|
|
240
|
-
['tool_use' as const]: 'Tool request',
|
|
241
|
-
['tool_result' as const]: 'Tool result',
|
|
242
|
-
['tool_list' as const]: 'Tools',
|
|
243
|
-
['artifact-update' as const]: 'Artifact(s) changed',
|
|
244
|
-
};
|
|
245
|
-
|
|
246
|
-
const systemDispositions: string[] = ['cot', 'artifact-update'];
|
|
247
|
-
|
|
248
|
-
const panelClasses = 'flex flex-col is-full bg-activeSurface rounded-sm';
|
|
249
|
-
const marginClasses = 'pie-4 pis-4';
|
|
250
|
-
const paddingClasses = 'pis-2 pie-2 pbs-0.5 pbe-0.5';
|
|
251
|
-
|
|
252
|
-
const MessageContainer = ({ classNames, children, user }: ThemedClassName<PropsWithChildren<{ user?: boolean }>>) => {
|
|
253
|
-
if (!children) {
|
|
254
|
-
return null;
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
return (
|
|
258
|
-
<div role='list-item' className={mx('flex is-full', user && 'justify-end', marginClasses, classNames)}>
|
|
259
|
-
<div className={mx(user ? ['rounded-sm', 'bg-[--user-fill] text-accentSurfaceText', paddingClasses] : 'is-full')}>
|
|
260
|
-
{children}
|
|
261
|
-
</div>
|
|
262
|
-
</div>
|
|
263
|
-
);
|
|
264
|
-
};
|
|
265
|
-
|
|
266
|
-
const ToggleContainer = (props: ToggleContainerProps) => {
|
|
267
|
-
return <NativeToggleContainer {...props} classNames={mx(panelClasses, props.classNames)} />;
|
|
268
|
-
};
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React, { type FC, useEffect, useMemo, useRef, useState } from 'react';
|
|
6
|
-
|
|
7
|
-
import { type AgentStatus, type Tool } from '@dxos/ai';
|
|
8
|
-
import { log } from '@dxos/log';
|
|
9
|
-
import { type ThemedClassName } from '@dxos/react-ui';
|
|
10
|
-
import { NumericTabs, StatusRoll, ToggleContainer } from '@dxos/react-ui-components';
|
|
11
|
-
import { type JsonProps, Json as NativeJson } from '@dxos/react-ui-syntax-highlighter';
|
|
12
|
-
import { type DataType } from '@dxos/schema';
|
|
13
|
-
import { isNonNullable, isNotFalsy } from '@dxos/util';
|
|
14
|
-
|
|
15
|
-
export const isToolMessage = (message: DataType.Message) => {
|
|
16
|
-
return message.blocks.some((block) => block._tag === 'toolCall' || block._tag === 'toolResult');
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
const getToolName = (tool: Tool) => {
|
|
20
|
-
return tool.namespace && tool.function ? `${tool.namespace}:${tool.function}` : tool.name.split('_').pop();
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
const getToolCaption = (tool: Tool | undefined, status: AgentStatus | undefined) => {
|
|
24
|
-
if (!tool) {
|
|
25
|
-
return 'Calling tool...';
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
return status?.message ?? tool.caption ?? `Calling ${getToolName(tool)}...`;
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export type ToolBlockProps = ThemedClassName<{
|
|
32
|
-
message: DataType.Message;
|
|
33
|
-
tools?: Tool[];
|
|
34
|
-
}>;
|
|
35
|
-
|
|
36
|
-
export const ToolBlock: FC<ToolBlockProps> = ({ classNames, message, tools }) => {
|
|
37
|
-
const { blocks = [] } = message;
|
|
38
|
-
|
|
39
|
-
let request: { tool: Tool | undefined; block: any } | undefined;
|
|
40
|
-
const toolBlocks = blocks.filter((block) => block._tag === 'toolCall' || block._tag === 'toolResult');
|
|
41
|
-
const items = toolBlocks
|
|
42
|
-
.map((block) => {
|
|
43
|
-
switch (block._tag) {
|
|
44
|
-
case 'toolCall': {
|
|
45
|
-
// TODO(burdon): Skip these updates?
|
|
46
|
-
if (block.pending && request?.block.toolCallId === block.toolCallId) {
|
|
47
|
-
return null;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
request = { tool: tools?.find((tool) => tool.name === block.name), block };
|
|
51
|
-
return {
|
|
52
|
-
title: getToolCaption(request.tool, undefined), // block.status), // TODO(burdon): Get status?
|
|
53
|
-
block,
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
case 'toolResult': {
|
|
58
|
-
if (!request) {
|
|
59
|
-
log.warn('unexpected message', { block });
|
|
60
|
-
return { title: 'Error', block };
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
return {
|
|
64
|
-
title: `${getToolCaption(request.tool, undefined)} (Success)`,
|
|
65
|
-
block,
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
default: {
|
|
70
|
-
request = undefined;
|
|
71
|
-
return {
|
|
72
|
-
title: 'Error',
|
|
73
|
-
block,
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
})
|
|
78
|
-
.filter(isNonNullable);
|
|
79
|
-
|
|
80
|
-
return <ToolContainer classNames={classNames} items={items} />;
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
export const ToolContainer: FC<ThemedClassName<{ items: { title: string; block: any }[] }>> = ({
|
|
84
|
-
classNames,
|
|
85
|
-
items,
|
|
86
|
-
}) => {
|
|
87
|
-
const tabsRef = useRef<HTMLDivElement>(null);
|
|
88
|
-
const [selected, setSelected] = useState(0);
|
|
89
|
-
const [open, setOpen] = useState(false);
|
|
90
|
-
useEffect(() => {
|
|
91
|
-
if (open) {
|
|
92
|
-
tabsRef.current?.focus();
|
|
93
|
-
}
|
|
94
|
-
}, [open]);
|
|
95
|
-
|
|
96
|
-
const handleSelect = (index: number) => {
|
|
97
|
-
if (index === selected) {
|
|
98
|
-
setOpen(false);
|
|
99
|
-
} else {
|
|
100
|
-
setSelected(index);
|
|
101
|
-
}
|
|
102
|
-
};
|
|
103
|
-
|
|
104
|
-
const title = useMemo(() => {
|
|
105
|
-
const lines = items.map((item) => item.title).filter(isNotFalsy);
|
|
106
|
-
return <StatusRoll key='status-roll' lines={lines} duration={1_000} autoAdvance />;
|
|
107
|
-
}, [items]);
|
|
108
|
-
|
|
109
|
-
return (
|
|
110
|
-
<ToggleContainer classNames={['flex flex-col', classNames]} title={title} open={open} onChangeOpen={setOpen}>
|
|
111
|
-
<div className='w-full grid grid-cols-[32px_1fr]'>
|
|
112
|
-
<NumericTabs ref={tabsRef} length={items.length} selected={selected} onSelect={handleSelect} />
|
|
113
|
-
<Json data={items[selected].block} />
|
|
114
|
-
</div>
|
|
115
|
-
</ToggleContainer>
|
|
116
|
-
);
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
export const Json = ({ data }: Pick<JsonProps, 'data'>) => (
|
|
120
|
-
<NativeJson data={data} classNames='!p-1 text-xs bg-transparent' />
|
|
121
|
-
);
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { type DataType } from '@dxos/schema';
|
|
6
|
-
|
|
7
|
-
// TODO(burdon): Move to util?
|
|
8
|
-
type Reducer<R, I> = (acc: R, value: I) => R;
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Reducer that collapses related message blocks into single messages.
|
|
12
|
-
* For example, combines tool request/response pairs into a single message.
|
|
13
|
-
*/
|
|
14
|
-
export const messageReducer: Reducer<{ messages: DataType.Message[]; current?: DataType.Message }, DataType.Message> = (
|
|
15
|
-
{ current, messages },
|
|
16
|
-
message,
|
|
17
|
-
) => {
|
|
18
|
-
let i = 0;
|
|
19
|
-
for (const block of message.blocks) {
|
|
20
|
-
switch (block._tag) {
|
|
21
|
-
case 'toolCall':
|
|
22
|
-
case 'toolResult': {
|
|
23
|
-
if (current) {
|
|
24
|
-
current.blocks.push(block);
|
|
25
|
-
} else {
|
|
26
|
-
current = {
|
|
27
|
-
...message,
|
|
28
|
-
id: [message.id, i].join('_'),
|
|
29
|
-
blocks: [block],
|
|
30
|
-
};
|
|
31
|
-
messages.push(current);
|
|
32
|
-
}
|
|
33
|
-
break;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
case 'text':
|
|
37
|
-
default: {
|
|
38
|
-
current = undefined;
|
|
39
|
-
messages.push({
|
|
40
|
-
...message,
|
|
41
|
-
id: [message.id, i].join('_'),
|
|
42
|
-
blocks: [block],
|
|
43
|
-
});
|
|
44
|
-
break;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
i++;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
return { current, messages };
|
|
52
|
-
};
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React from 'react';
|
|
6
|
-
|
|
7
|
-
import { type Template } from '@dxos/blueprints';
|
|
8
|
-
import { Toolbar, useTranslation } from '@dxos/react-ui';
|
|
9
|
-
|
|
10
|
-
import { meta } from '../meta';
|
|
11
|
-
|
|
12
|
-
export const PromptSettings = ({ template }: { template: Template.Template }) => {
|
|
13
|
-
const { t } = useTranslation(meta.id);
|
|
14
|
-
|
|
15
|
-
// const handleKindChange = useCallback(
|
|
16
|
-
// (value: string) => {
|
|
17
|
-
// const kind = Match.type<string>().pipe(
|
|
18
|
-
// Match.withReturnType<Schema.Schema.Type<typeof Template.Template>>(),
|
|
19
|
-
// Match.when('always', () => ({ include: 'always' })),
|
|
20
|
-
// Match.when('schema-matching', () => ({ include: 'schema-matching', typename: '' })),
|
|
21
|
-
// Match.when('automatically', () => ({ include: 'automatically', description: '' })),
|
|
22
|
-
// Match.orElse(() => ({ include: 'manual' })),
|
|
23
|
-
// )(value);
|
|
24
|
-
//
|
|
25
|
-
// template.kind = kind;
|
|
26
|
-
// },
|
|
27
|
-
// [template],
|
|
28
|
-
// );
|
|
29
|
-
|
|
30
|
-
// const handleTypenameChange = useCallback(
|
|
31
|
-
// debounce((event: ChangeEvent<HTMLInputElement>) => {
|
|
32
|
-
// if (template.kind.include === 'schema-matching') {
|
|
33
|
-
// template.kind.typename = event.target.value;
|
|
34
|
-
// }
|
|
35
|
-
// }, 300),
|
|
36
|
-
// [template.kind.include],
|
|
37
|
-
// );
|
|
38
|
-
|
|
39
|
-
// const handleDescriptionChange = useCallback(
|
|
40
|
-
// debounce((event: ChangeEvent<HTMLInputElement>) => {
|
|
41
|
-
// if (template.kind.include === 'automatically') {
|
|
42
|
-
// template.kind.description = event.target.value;
|
|
43
|
-
// }
|
|
44
|
-
// }, 300),
|
|
45
|
-
// [template.kind.include],
|
|
46
|
-
// );
|
|
47
|
-
|
|
48
|
-
return (
|
|
49
|
-
<div className='flex flex-col gap-4'>
|
|
50
|
-
<h2>{t('prompt rules label')}</h2>
|
|
51
|
-
<Toolbar.Root>
|
|
52
|
-
{/* <Select.Root value={template.kind.include} onValueChange={handleKindChange}>
|
|
53
|
-
<Toolbar.Button asChild>
|
|
54
|
-
<Select.TriggerButton />
|
|
55
|
-
</Toolbar.Button>
|
|
56
|
-
<Select.Portal>
|
|
57
|
-
<Select.Content>
|
|
58
|
-
<Select.Viewport>
|
|
59
|
-
{Template.Kinds.map((kind) => (
|
|
60
|
-
<Select.Option key={kind} value={kind}>
|
|
61
|
-
{kind}
|
|
62
|
-
</Select.Option>
|
|
63
|
-
))}
|
|
64
|
-
</Select.Viewport>
|
|
65
|
-
</Select.Content>
|
|
66
|
-
</Select.Portal>
|
|
67
|
-
</Select.Root> */}
|
|
68
|
-
{/* {template.kind.include === 'schema-matching' && (
|
|
69
|
-
<Input.Root>
|
|
70
|
-
<Input.TextInput
|
|
71
|
-
placeholder={t('typename placeholder')}
|
|
72
|
-
defaultValue={template.kind.typename}
|
|
73
|
-
onChange={handleTypenameChange}
|
|
74
|
-
/>
|
|
75
|
-
</Input.Root>
|
|
76
|
-
)} */}
|
|
77
|
-
{/* {template.kind.include === 'automatically' && (
|
|
78
|
-
<Input.Root>
|
|
79
|
-
<Input.TextInput
|
|
80
|
-
placeholder={t('description placeholder')}
|
|
81
|
-
defaultValue={template.kind.description}
|
|
82
|
-
onChange={handleDescriptionChange}
|
|
83
|
-
/>
|
|
84
|
-
</Input.Root>
|
|
85
|
-
)} */}
|
|
86
|
-
</Toolbar.Root>
|
|
87
|
-
</div>
|
|
88
|
-
);
|
|
89
|
-
};
|
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { type EditorView } from '@codemirror/view';
|
|
6
|
-
import JSON5 from 'json5';
|
|
7
|
-
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
8
|
-
|
|
9
|
-
import { ToolRegistry } from '@dxos/ai';
|
|
10
|
-
import { getSpace } from '@dxos/client/echo';
|
|
11
|
-
import { type Sequence, type SequenceDefinition } from '@dxos/conductor';
|
|
12
|
-
import { Key } from '@dxos/echo';
|
|
13
|
-
import { Toolbar, useTranslation } from '@dxos/react-ui';
|
|
14
|
-
import { useSelectionManager } from '@dxos/react-ui-attention';
|
|
15
|
-
import { StackItem } from '@dxos/react-ui-stack';
|
|
16
|
-
|
|
17
|
-
import { SequenceEditor } from './SequenceEditor';
|
|
18
|
-
import { meta } from '../meta';
|
|
19
|
-
|
|
20
|
-
// TODO(burdon): Move to config.
|
|
21
|
-
export const EXA_API_KEY = '9c7e17ff-0c85-4cd5-827a-8b489f139e03';
|
|
22
|
-
|
|
23
|
-
// TODO(burdon): Validate.
|
|
24
|
-
const parseSequence = (text: string): SequenceDefinition | undefined => {
|
|
25
|
-
try {
|
|
26
|
-
const json = JSON5.parse(text);
|
|
27
|
-
const { steps } = json;
|
|
28
|
-
return { steps };
|
|
29
|
-
} catch (error) {
|
|
30
|
-
// Ignore.
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
export const SequenceContainer = ({ sequence }: { sequence: Sequence }) => {
|
|
35
|
-
const { t } = useTranslation(meta.id);
|
|
36
|
-
const selectionManager = useSelectionManager();
|
|
37
|
-
const [definition, setDefinition] = useState<SequenceDefinition>();
|
|
38
|
-
useEffect(() => {
|
|
39
|
-
setDefinition({
|
|
40
|
-
steps: sequence.steps.map(({ instructions, tools }) => ({ instructions, tools })),
|
|
41
|
-
});
|
|
42
|
-
}, [sequence]);
|
|
43
|
-
|
|
44
|
-
const editorRef = useRef<EditorView | undefined>(undefined);
|
|
45
|
-
|
|
46
|
-
// TODO(burdon): Factor out.
|
|
47
|
-
const toolRegistry = useMemo(() => {
|
|
48
|
-
const space = getSpace(sequence);
|
|
49
|
-
if (!space) {
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
// TODO(burdon): How should the queue be created?
|
|
54
|
-
// eslint-disable-next-line no-unused-vars
|
|
55
|
-
const _queue = space.queues.create();
|
|
56
|
-
|
|
57
|
-
return new ToolRegistry([
|
|
58
|
-
// createExaTool({ apiKey: EXA_API_KEY }),
|
|
59
|
-
// createLocalSearchTool(space.db, queue),
|
|
60
|
-
// createGraphWriterTool({
|
|
61
|
-
// db: space.db,
|
|
62
|
-
// queue,
|
|
63
|
-
// schema: [], // TODO(burdon): Get schema from client/sequence?
|
|
64
|
-
// onDone: async (objects) => {
|
|
65
|
-
// await queue.append(objects);
|
|
66
|
-
// },
|
|
67
|
-
// }),
|
|
68
|
-
]);
|
|
69
|
-
}, [sequence]);
|
|
70
|
-
|
|
71
|
-
const formatAndSave = useCallback((): SequenceDefinition | undefined => {
|
|
72
|
-
if (!sequence) {
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
const text = editorRef.current?.state.doc.toString();
|
|
77
|
-
if (!text) {
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
const definition = parseSequence(text);
|
|
82
|
-
if (!definition) {
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
setDefinition(definition);
|
|
87
|
-
const formatted = JSON.stringify(definition, null, 2);
|
|
88
|
-
editorRef.current?.dispatch({
|
|
89
|
-
changes: { from: 0, to: text.length, insert: formatted },
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
sequence.steps.length = 0;
|
|
93
|
-
for (const step of definition.steps) {
|
|
94
|
-
sequence.steps.push({
|
|
95
|
-
id: Key.ObjectId.random(),
|
|
96
|
-
instructions: step.instructions,
|
|
97
|
-
tools: step.tools,
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
return sequence;
|
|
102
|
-
}, [sequence]);
|
|
103
|
-
|
|
104
|
-
// TODO(burdon): Save raw sequence separately from parsed sequence? (like Script).
|
|
105
|
-
const handleSave = useCallback(() => formatAndSave(), [formatAndSave]);
|
|
106
|
-
|
|
107
|
-
const handleRun = useCallback(async () => {
|
|
108
|
-
// if (!aiClient?.value || !toolRegistry) {
|
|
109
|
-
// return;
|
|
110
|
-
// }
|
|
111
|
-
// formatAndSave();
|
|
112
|
-
// // Get input from selection.
|
|
113
|
-
// const input = Array.from(getSelectionSet(selectionManager)).map((id) => DXN.fromLocalObjectId(id));
|
|
114
|
-
// if (!input.length) {
|
|
115
|
-
// return;
|
|
116
|
-
// }
|
|
117
|
-
// const machine = new SequenceMachine(toolRegistry, sequence).setLogger(new QueueLogger(sequence));
|
|
118
|
-
// await machine.runToCompletion({ aiClient: aiClient.value, input });
|
|
119
|
-
}, [sequence, formatAndSave, selectionManager, toolRegistry]);
|
|
120
|
-
|
|
121
|
-
return (
|
|
122
|
-
<StackItem.Content toolbar>
|
|
123
|
-
<Toolbar.Root>
|
|
124
|
-
<Toolbar.Button onClick={handleSave}>{t('button save')}</Toolbar.Button>
|
|
125
|
-
<Toolbar.Button onClick={handleRun}>{t('button run')}</Toolbar.Button>
|
|
126
|
-
</Toolbar.Root>
|
|
127
|
-
{definition && <SequenceEditor ref={editorRef} sequence={definition} />}
|
|
128
|
-
</StackItem.Content>
|
|
129
|
-
);
|
|
130
|
-
};
|
|
131
|
-
|
|
132
|
-
export default SequenceContainer;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import '@dxos-theme';
|
|
6
|
-
|
|
7
|
-
import { type StoryObj, type Meta } from '@storybook/react-vite';
|
|
8
|
-
|
|
9
|
-
import { withLayout, withTheme } from '@dxos/storybook-utils';
|
|
10
|
-
|
|
11
|
-
import { SequenceEditor } from './SequenceEditor';
|
|
12
|
-
import { RESEARCH_SEQUENCE_DEFINITION } from '../../testing';
|
|
13
|
-
import { translations } from '../../translations';
|
|
14
|
-
|
|
15
|
-
const meta: Meta<typeof SequenceEditor> = {
|
|
16
|
-
title: 'plugins/plugin-assistant/SequenceEditor',
|
|
17
|
-
component: SequenceEditor,
|
|
18
|
-
decorators: [withTheme, withLayout({ fullscreen: true, classNames: 'mli-auto max-is-[50rem] justify-center' })],
|
|
19
|
-
parameters: {
|
|
20
|
-
translations,
|
|
21
|
-
},
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export default meta;
|
|
25
|
-
|
|
26
|
-
type Story = StoryObj<typeof SequenceEditor>;
|
|
27
|
-
|
|
28
|
-
export const Default: Story = {
|
|
29
|
-
args: {
|
|
30
|
-
sequence: RESEARCH_SEQUENCE_DEFINITION,
|
|
31
|
-
},
|
|
32
|
-
};
|