@dxos/plugin-assistant 0.8.4-main.c1de068 → 0.8.4-main.c85a9c8dae
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/AssistantSettings-2LFAG5OQ.mjs +93 -0
- package/dist/lib/browser/AssistantSettings-2LFAG5OQ.mjs.map +7 -0
- package/dist/lib/browser/BlueprintArticle-CCS25MNW.mjs +36 -0
- package/dist/lib/browser/BlueprintArticle-CCS25MNW.mjs.map +7 -0
- package/dist/lib/browser/ChatCompanion-UGD4V34A.mjs +202 -0
- package/dist/lib/browser/ChatCompanion-UGD4V34A.mjs.map +7 -0
- package/dist/lib/browser/ChatContainer-ZGRSZ5EU.mjs +12 -0
- package/dist/lib/browser/ChatContainer-ZGRSZ5EU.mjs.map +7 -0
- package/dist/lib/browser/ChatDialog-AET7GVIB.mjs +85 -0
- package/dist/lib/browser/ChatDialog-AET7GVIB.mjs.map +7 -0
- package/dist/lib/browser/ProjectArticle-QDBTIFNE.mjs +91 -0
- package/dist/lib/browser/ProjectArticle-QDBTIFNE.mjs.map +7 -0
- package/dist/lib/browser/ProjectSettings-R6RRARLO.mjs +194 -0
- package/dist/lib/browser/ProjectSettings-R6RRARLO.mjs.map +7 -0
- package/dist/lib/browser/PromptArticle-USQO4WX6.mjs +71 -0
- package/dist/lib/browser/PromptArticle-USQO4WX6.mjs.map +7 -0
- package/dist/lib/browser/TriggerStatus-65X3EUSN.mjs +122 -0
- package/dist/lib/browser/TriggerStatus-65X3EUSN.mjs.map +7 -0
- package/dist/lib/browser/ai-service-CY2BYPH6.mjs +22 -0
- package/dist/lib/browser/ai-service-CY2BYPH6.mjs.map +7 -0
- package/dist/lib/browser/app-graph-builder-SFYYUKTT.mjs +234 -0
- package/dist/lib/browser/app-graph-builder-SFYYUKTT.mjs.map +7 -0
- package/dist/lib/browser/blueprint-definition-RB5RHZZM.mjs +34 -0
- package/dist/lib/browser/blueprint-definition-RB5RHZZM.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-7DXYAXLZ.mjs +230 -0
- package/dist/lib/browser/chunk-7DXYAXLZ.mjs.map +7 -0
- package/dist/lib/browser/chunk-EXVT7D4B.mjs +23 -0
- package/dist/lib/browser/chunk-EXVT7D4B.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-LEXIQDXZ.mjs +26 -0
- package/dist/lib/browser/chunk-LEXIQDXZ.mjs.map +7 -0
- package/dist/lib/browser/chunk-RU4G5NY4.mjs +69 -0
- package/dist/lib/browser/chunk-RU4G5NY4.mjs.map +7 -0
- package/dist/lib/browser/chunk-UUA6GNGG.mjs +2125 -0
- package/dist/lib/browser/chunk-UUA6GNGG.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 +299 -161
- 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-ELXDQZEG.mjs +136 -0
- package/dist/lib/browser/operation-resolver-ELXDQZEG.mjs.map +7 -0
- package/dist/lib/browser/react-surface-KYQSZO2I.mjs +144 -0
- package/dist/lib/browser/react-surface-KYQSZO2I.mjs.map +7 -0
- package/dist/lib/browser/repair-ZFZWZALX.mjs +52 -0
- package/dist/lib/browser/repair-ZFZWZALX.mjs.map +7 -0
- package/dist/lib/browser/settings-YREVQAZ5.mjs +33 -0
- package/dist/lib/browser/settings-YREVQAZ5.mjs.map +7 -0
- package/dist/lib/browser/state-MPG42ZO4.mjs +26 -0
- package/dist/lib/browser/state-MPG42ZO4.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-QWFEMJG7.mjs +94 -0
- package/dist/lib/node-esm/AssistantSettings-QWFEMJG7.mjs.map +7 -0
- package/dist/lib/node-esm/BlueprintArticle-SNEN6LOY.mjs +37 -0
- package/dist/lib/node-esm/BlueprintArticle-SNEN6LOY.mjs.map +7 -0
- package/dist/lib/node-esm/ChatCompanion-NP4R5BFE.mjs +203 -0
- package/dist/lib/node-esm/ChatCompanion-NP4R5BFE.mjs.map +7 -0
- package/dist/lib/node-esm/ChatContainer-IFHDIFJH.mjs +13 -0
- package/dist/lib/node-esm/ChatContainer-IFHDIFJH.mjs.map +7 -0
- package/dist/lib/node-esm/ChatDialog-UZNQBTKZ.mjs +86 -0
- package/dist/lib/node-esm/ChatDialog-UZNQBTKZ.mjs.map +7 -0
- package/dist/lib/node-esm/ProjectArticle-BCIBESJN.mjs +92 -0
- package/dist/lib/node-esm/ProjectArticle-BCIBESJN.mjs.map +7 -0
- package/dist/lib/node-esm/ProjectSettings-Q5QY6BYS.mjs +195 -0
- package/dist/lib/node-esm/ProjectSettings-Q5QY6BYS.mjs.map +7 -0
- package/dist/lib/node-esm/PromptArticle-PGMJMQK7.mjs +72 -0
- package/dist/lib/node-esm/PromptArticle-PGMJMQK7.mjs.map +7 -0
- package/dist/lib/node-esm/TriggerStatus-UR5S7PXJ.mjs +123 -0
- package/dist/lib/node-esm/TriggerStatus-UR5S7PXJ.mjs.map +7 -0
- package/dist/lib/node-esm/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-E25JXI34.mjs +235 -0
- package/dist/lib/node-esm/app-graph-builder-E25JXI34.mjs.map +7 -0
- package/dist/lib/node-esm/blueprint-definition-L7XKRYIW.mjs +35 -0
- package/dist/lib/node-esm/blueprint-definition-L7XKRYIW.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-3QBVFAYO.mjs +28 -0
- package/dist/lib/node-esm/chunk-3QBVFAYO.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-6NCLKQCL.mjs +70 -0
- package/dist/lib/node-esm/chunk-6NCLKQCL.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-GZ4ERNT2.mjs +2126 -0
- package/dist/lib/node-esm/chunk-GZ4ERNT2.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-MWYYLALM.mjs +231 -0
- package/dist/lib/node-esm/chunk-MWYYLALM.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-POWB2BPC.mjs +25 -0
- 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 +299 -161
- 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-Q5GNP2GH.mjs +137 -0
- package/dist/lib/node-esm/operation-resolver-Q5GNP2GH.mjs.map +7 -0
- package/dist/lib/node-esm/react-surface-JJRGVGKD.mjs +145 -0
- package/dist/lib/node-esm/react-surface-JJRGVGKD.mjs.map +7 -0
- package/dist/lib/node-esm/repair-LXFVOK4B.mjs +53 -0
- package/dist/lib/node-esm/repair-LXFVOK4B.mjs.map +7 -0
- package/dist/lib/node-esm/settings-N452OW6Y.mjs +34 -0
- package/dist/lib/node-esm/settings-N452OW6Y.mjs.map +7 -0
- package/dist/lib/node-esm/state-WHZFKIEL.mjs +27 -0
- package/dist/lib/node-esm/state-WHZFKIEL.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 +11 -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/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/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 +285 -71
- 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 +3 -6
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts +431 -7
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts +13 -2
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts +428 -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 +9 -15
- package/dist/types/src/components/Toolbox/Toolbox.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts +432 -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 +18 -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 +376 -37
- 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 +125 -96
- package/src/AssistantPlugin.tsx +162 -88
- 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 +198 -0
- package/src/capabilities/app-graph-builder/index.ts +7 -0
- package/src/capabilities/blueprint-definition/blueprint-definition.ts +48 -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 +11 -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 +121 -0
- package/src/capabilities/react-surface/index.ts +7 -0
- package/src/capabilities/react-surface/react-surface.tsx +121 -0
- package/src/capabilities/repair/index.ts +7 -0
- package/src/capabilities/repair/repair.ts +69 -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 +124 -117
- 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 +41 -20
- package/src/components/TemplateEditor/TemplateEditor.tsx +33 -52
- package/src/components/TemplateEditor/TemplateForm.stories.tsx +30 -17
- package/src/components/TemplateEditor/TemplateForm.tsx +85 -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 +68 -100
- 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 +30 -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 +118 -0
- package/src/containers/Project/index.ts +16 -0
- package/src/containers/Project/triggers.ts +131 -0
- package/src/containers/PromptArticle/PromptArticle.tsx +59 -0
- package/src/containers/PromptArticle/index.ts +7 -0
- package/src/containers/TriggerStatus/TriggerStatus.tsx +150 -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 -75
- 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 +71 -28
- 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/ChatContainer-M3IHQLRS.mjs +0 -54
- package/dist/lib/browser/ChatContainer-M3IHQLRS.mjs.map +0 -7
- package/dist/lib/browser/ChatDialog-X6VN6QZI.mjs +0 -72
- package/dist/lib/browser/ChatDialog-X6VN6QZI.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/TemplateContainer-RPJ2LBOB.mjs +0 -27
- package/dist/lib/browser/TemplateContainer-RPJ2LBOB.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-JTXBKE7O.mjs +0 -223
- package/dist/lib/browser/app-graph-builder-JTXBKE7O.mjs.map +0 -7
- package/dist/lib/browser/chunk-AEAEKWOC.mjs +0 -98
- package/dist/lib/browser/chunk-AEAEKWOC.mjs.map +0 -7
- package/dist/lib/browser/chunk-EQDW6BYQ.mjs +0 -108
- package/dist/lib/browser/chunk-EQDW6BYQ.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-JQBVLTM5.mjs +0 -158
- package/dist/lib/browser/chunk-JQBVLTM5.mjs.map +0 -7
- package/dist/lib/browser/chunk-OWY4CUQY.mjs +0 -2245
- package/dist/lib/browser/chunk-OWY4CUQY.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-5RMMCMXG.mjs +0 -60
- package/dist/lib/browser/intent-resolver-5RMMCMXG.mjs.map +0 -7
- package/dist/lib/browser/react-surface-66VY37YQ.mjs +0 -150
- package/dist/lib/browser/react-surface-66VY37YQ.mjs.map +0 -7
- package/dist/lib/browser/settings-2DGP3UTS.mjs +0 -22
- package/dist/lib/browser/settings-2DGP3UTS.mjs.map +0 -7
- package/dist/lib/node-esm/ChatContainer-VZT74PO2.mjs +0 -55
- package/dist/lib/node-esm/ChatContainer-VZT74PO2.mjs.map +0 -7
- package/dist/lib/node-esm/ChatDialog-RJ6FDX4Q.mjs +0 -73
- package/dist/lib/node-esm/ChatDialog-RJ6FDX4Q.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/TemplateContainer-A3NAQCZE.mjs +0 -28
- package/dist/lib/node-esm/TemplateContainer-A3NAQCZE.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-OWSOXFTD.mjs +0 -224
- package/dist/lib/node-esm/app-graph-builder-OWSOXFTD.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-2XL6MNPE.mjs +0 -99
- package/dist/lib/node-esm/chunk-2XL6MNPE.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-BISJDTBK.mjs +0 -159
- package/dist/lib/node-esm/chunk-BISJDTBK.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-E33DNNDW.mjs +0 -109
- package/dist/lib/node-esm/chunk-E33DNNDW.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-SENTQAEO.mjs +0 -2246
- package/dist/lib/node-esm/chunk-SENTQAEO.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-YPPYELY3.mjs +0 -61
- package/dist/lib/node-esm/intent-resolver-YPPYELY3.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-RJMRBR2M.mjs +0 -151
- package/dist/lib/node-esm/react-surface-RJMRBR2M.mjs.map +0 -7
- package/dist/lib/node-esm/settings-47RYZOU4.mjs +0 -23
- package/dist/lib/node-esm/settings-47RYZOU4.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/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/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/components/TemplateContainer.d.ts +0 -8
- package/dist/types/src/components/TemplateContainer.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 -249
- 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 -88
- package/dist/types/src/types/schema.d.ts.map +0 -1
- package/src/capabilities/app-graph-builder.ts +0 -253
- package/src/capabilities/intent-resolver.ts +0 -58
- package/src/capabilities/react-surface.tsx +0 -138
- package/src/capabilities/settings.ts +0 -19
- package/src/components/AssistantSettings/AssistantSettings.tsx +0 -105
- package/src/components/AssistantSettings/index.ts +0 -5
- 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/components/TemplateContainer.tsx +0 -24
- 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 -378
- 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 -95
- package/src/typings.d.ts +0 -9
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { useCallback, useState } from 'react';
|
|
6
|
+
|
|
7
|
+
import { useAtomCapability } from '@dxos/app-framework/ui';
|
|
8
|
+
import { type Chat as ChatTypes } from '@dxos/assistant-toolkit';
|
|
9
|
+
import { Obj } from '@dxos/echo';
|
|
10
|
+
import { useTranslation } from '@dxos/react-ui';
|
|
11
|
+
import { ChatDialog as NaturalChatDialog } from '@dxos/react-ui-chat';
|
|
12
|
+
|
|
13
|
+
import { Chat, type ChatRootProps } from '../../components';
|
|
14
|
+
import { useBlueprintRegistry, useChatProcessor, useChatServices, useOnline, usePresets } from '../../hooks';
|
|
15
|
+
import { meta } from '../../meta';
|
|
16
|
+
import { AssistantCapabilities } from '../../types';
|
|
17
|
+
|
|
18
|
+
export type ChatDialogProps = {
|
|
19
|
+
chat?: ChatTypes.Chat;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export const ChatDialog = ({ chat }: ChatDialogProps) => {
|
|
23
|
+
const { t } = useTranslation(meta.id);
|
|
24
|
+
|
|
25
|
+
const db = chat && Obj.getDatabase(chat);
|
|
26
|
+
const settings = useAtomCapability(AssistantCapabilities.Settings);
|
|
27
|
+
const services = useChatServices({ id: db?.spaceId, chat });
|
|
28
|
+
const [online, setOnline] = useOnline();
|
|
29
|
+
const { preset, ...chatProps } = usePresets(online);
|
|
30
|
+
const blueprintRegistry = useBlueprintRegistry();
|
|
31
|
+
const processor = useChatProcessor({
|
|
32
|
+
chat,
|
|
33
|
+
preset,
|
|
34
|
+
services,
|
|
35
|
+
blueprintRegistry,
|
|
36
|
+
settings,
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
// TODO(burdon): Refocus when open.
|
|
40
|
+
const [open, setOpen] = useState(true);
|
|
41
|
+
const [expanded, setExpanded] = useState(false);
|
|
42
|
+
const handleEvent = useCallback<NonNullable<ChatRootProps['onEvent']>>((event) => {
|
|
43
|
+
switch (event.type) {
|
|
44
|
+
case 'submit':
|
|
45
|
+
case 'thread-open':
|
|
46
|
+
setOpen(true);
|
|
47
|
+
setExpanded(true);
|
|
48
|
+
break;
|
|
49
|
+
case 'thread-close':
|
|
50
|
+
setOpen(false);
|
|
51
|
+
break;
|
|
52
|
+
}
|
|
53
|
+
}, []);
|
|
54
|
+
|
|
55
|
+
if (!chat || !processor) {
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return (
|
|
60
|
+
<Chat.Root chat={chat} processor={processor} onEvent={handleEvent}>
|
|
61
|
+
<NaturalChatDialog.Root open={open} expanded={expanded} onOpenChange={setOpen}>
|
|
62
|
+
<NaturalChatDialog.Header title={t('assistant dialog title')} />
|
|
63
|
+
<NaturalChatDialog.Content>
|
|
64
|
+
<Chat.Thread />
|
|
65
|
+
</NaturalChatDialog.Content>
|
|
66
|
+
<NaturalChatDialog.Footer classNames='p-1.5'>
|
|
67
|
+
<Chat.Prompt {...chatProps} preset={preset?.id} online={online} onOnlineChange={setOnline} expandable />
|
|
68
|
+
</NaturalChatDialog.Footer>
|
|
69
|
+
</NaturalChatDialog.Root>
|
|
70
|
+
</Chat.Root>
|
|
71
|
+
);
|
|
72
|
+
};
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Atom, useAtomValue } from '@effect-atom/atom-react';
|
|
6
|
+
import * as Option from 'effect/Option';
|
|
7
|
+
import React, { forwardRef, useMemo, useState } from 'react';
|
|
8
|
+
|
|
9
|
+
import { Surface } from '@dxos/app-framework/ui';
|
|
10
|
+
import { type SurfaceComponentProps, useObjectMenuItems, useObjectNavigate } from '@dxos/app-toolkit/ui';
|
|
11
|
+
import { type Project } from '@dxos/assistant-toolkit';
|
|
12
|
+
import { Filter, Obj, Query } from '@dxos/echo';
|
|
13
|
+
import { AtomObj, AtomRef } from '@dxos/echo-atom';
|
|
14
|
+
import { useQuery } from '@dxos/react-client/echo';
|
|
15
|
+
import { Card, Panel, ScrollArea, Toolbar } from '@dxos/react-ui';
|
|
16
|
+
import { Menu } from '@dxos/react-ui-menu';
|
|
17
|
+
import { Focus, Mosaic, type MosaicTileProps } from '@dxos/react-ui-mosaic';
|
|
18
|
+
import { isNonNullable } from '@dxos/util';
|
|
19
|
+
|
|
20
|
+
export type ProjectArticleProps = SurfaceComponentProps<Project.Project>;
|
|
21
|
+
|
|
22
|
+
export const ProjectArticle = ({ subject: project }: ProjectArticleProps) => {
|
|
23
|
+
const inputQueue = useAtomValue(
|
|
24
|
+
AtomObj.make(project).pipe((_) =>
|
|
25
|
+
Atom.make((get) =>
|
|
26
|
+
Option.fromNullable(get(_).queue).pipe(Option.map(AtomRef.make), Option.map(get), Option.getOrUndefined),
|
|
27
|
+
),
|
|
28
|
+
),
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
const inputQueueItems: Obj.Unknown[] = useQuery(inputQueue, Query.select(Filter.everything()));
|
|
32
|
+
|
|
33
|
+
const artifacts = useAtomValue(
|
|
34
|
+
useMemo(
|
|
35
|
+
() =>
|
|
36
|
+
AtomObj.make(project).pipe((project) =>
|
|
37
|
+
Atom.make((get) => {
|
|
38
|
+
return get(project).artifacts.map((artifact) => get(AtomRef.make(artifact.data)) as Obj.Unknown);
|
|
39
|
+
}),
|
|
40
|
+
),
|
|
41
|
+
[project],
|
|
42
|
+
),
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
const [viewport, setViewport] = useState<HTMLElement | null>(null);
|
|
46
|
+
|
|
47
|
+
const stackObjects = [...artifacts, ...inputQueueItems].filter(isNonNullable);
|
|
48
|
+
|
|
49
|
+
return (
|
|
50
|
+
<Panel.Root className='dx-article'>
|
|
51
|
+
<Panel.Content>
|
|
52
|
+
{/* TODO(burdon): Factor out. */}
|
|
53
|
+
{stackObjects.length === 0 && (
|
|
54
|
+
<div className='text-subdued'>
|
|
55
|
+
Project has no objects associated with it.
|
|
56
|
+
<br />
|
|
57
|
+
<br />
|
|
58
|
+
To get started:
|
|
59
|
+
<br />- Write the initative spec: what is the goal of the project?
|
|
60
|
+
<br />- subscribe project to your email.
|
|
61
|
+
<br />- Chat with the agent.
|
|
62
|
+
</div>
|
|
63
|
+
)}
|
|
64
|
+
|
|
65
|
+
{stackObjects.length > 0 && (
|
|
66
|
+
<Focus.Group asChild>
|
|
67
|
+
<Mosaic.Container asChild withFocus autoScroll={viewport}>
|
|
68
|
+
<ScrollArea.Root orientation='vertical'>
|
|
69
|
+
<ScrollArea.Viewport classNames='p-2' ref={setViewport}>
|
|
70
|
+
<Mosaic.Stack items={stackObjects} getId={(item) => item.id} draggable={false} Tile={StackTile} />
|
|
71
|
+
</ScrollArea.Viewport>
|
|
72
|
+
</ScrollArea.Root>
|
|
73
|
+
</Mosaic.Container>
|
|
74
|
+
</Focus.Group>
|
|
75
|
+
)}
|
|
76
|
+
</Panel.Content>
|
|
77
|
+
</Panel.Root>
|
|
78
|
+
);
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
const StackTile = forwardRef<HTMLDivElement, MosaicTileProps<Obj.Unknown>>(
|
|
82
|
+
({ data, location, debug }, forwardedRef) => {
|
|
83
|
+
const objectMenuItems = useObjectMenuItems(data);
|
|
84
|
+
const handleNavigate = useObjectNavigate(data);
|
|
85
|
+
|
|
86
|
+
return (
|
|
87
|
+
<Mosaic.Tile asChild id={data.id} data={data} location={location} debug={debug}>
|
|
88
|
+
<Focus.Group asChild>
|
|
89
|
+
<Menu.Root>
|
|
90
|
+
<Card.Root ref={forwardedRef} data-testid='board-item'>
|
|
91
|
+
<Card.Toolbar>
|
|
92
|
+
<Card.IconBlock></Card.IconBlock>
|
|
93
|
+
<Card.Title onClick={handleNavigate}>{Obj.getLabel(data)}</Card.Title>
|
|
94
|
+
{/* TODO(wittjosiah): Reconcile with Card.Menu. */}
|
|
95
|
+
<Menu.Trigger asChild disabled={!objectMenuItems?.length}>
|
|
96
|
+
<Toolbar.IconButton
|
|
97
|
+
iconOnly
|
|
98
|
+
variant='ghost'
|
|
99
|
+
icon='ph--dots-three-vertical--regular'
|
|
100
|
+
label='Actions'
|
|
101
|
+
/>
|
|
102
|
+
</Menu.Trigger>
|
|
103
|
+
<Menu.Content items={objectMenuItems} />
|
|
104
|
+
</Card.Toolbar>
|
|
105
|
+
<Card.Content>
|
|
106
|
+
<Surface.Surface role='card--content' limit={1} data={{ subject: data }} />
|
|
107
|
+
</Card.Content>
|
|
108
|
+
</Card.Root>
|
|
109
|
+
</Menu.Root>
|
|
110
|
+
</Focus.Group>
|
|
111
|
+
</Mosaic.Tile>
|
|
112
|
+
);
|
|
113
|
+
},
|
|
114
|
+
);
|
|
115
|
+
StackTile.displayName = 'StackTile';
|
|
116
|
+
|
|
117
|
+
export default ProjectArticle;
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Atom } from '@effect-atom/atom';
|
|
6
|
+
import { useAtomValue } from '@effect-atom/atom-react';
|
|
7
|
+
import * as Effect from 'effect/Effect';
|
|
8
|
+
import React, { useCallback, useEffect, useMemo } from 'react';
|
|
9
|
+
|
|
10
|
+
import { useCapability } from '@dxos/app-framework/ui';
|
|
11
|
+
import { type SurfaceComponentProps } from '@dxos/app-toolkit/ui';
|
|
12
|
+
import { Project } from '@dxos/assistant-toolkit';
|
|
13
|
+
import { Feed, Obj, Query, Ref } from '@dxos/echo';
|
|
14
|
+
import { DXN } from '@dxos/echo';
|
|
15
|
+
import { AtomObj, AtomRef } from '@dxos/echo-atom';
|
|
16
|
+
import { QueueService } from '@dxos/functions';
|
|
17
|
+
import { AutomationCapabilities } from '@dxos/plugin-automation/types';
|
|
18
|
+
import { MarkdownEditor } from '@dxos/plugin-markdown';
|
|
19
|
+
import { Filter, useQuery } from '@dxos/react-client/echo';
|
|
20
|
+
import { useObject } from '@dxos/react-client/echo';
|
|
21
|
+
import { Button } from '@dxos/react-ui';
|
|
22
|
+
import { ButtonGroup, Input } from '@dxos/react-ui';
|
|
23
|
+
|
|
24
|
+
import { syncTriggers } from './triggers';
|
|
25
|
+
|
|
26
|
+
export const ProjectSettings = ({ subject: project }: SurfaceComponentProps<Project.Project>) => {
|
|
27
|
+
const computeRuntime = useCapability(AutomationCapabilities.ComputeRuntime);
|
|
28
|
+
|
|
29
|
+
const handleResetHistory = useCallback(async () => {
|
|
30
|
+
const runtime = computeRuntime.getRuntime(Obj.getDatabase(project)!.spaceId);
|
|
31
|
+
|
|
32
|
+
await runtime.runPromise(Project.resetChatHistory(project));
|
|
33
|
+
|
|
34
|
+
if (!project.queue) {
|
|
35
|
+
await runtime.runPromise(
|
|
36
|
+
Effect.gen(function* () {
|
|
37
|
+
const queue = yield* QueueService.createQueue();
|
|
38
|
+
Obj.change(project, (project) => {
|
|
39
|
+
project.queue = Ref.fromDXN(queue.dxn);
|
|
40
|
+
});
|
|
41
|
+
}),
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
}, [project, computeRuntime]);
|
|
45
|
+
|
|
46
|
+
const spec = useAtomValue(AtomRef.make(project.spec));
|
|
47
|
+
const [specInitialValue] = useObject(spec, 'content');
|
|
48
|
+
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
return Obj.subscribe(project, () => {
|
|
51
|
+
queueMicrotask(() => syncTriggers(project));
|
|
52
|
+
});
|
|
53
|
+
}, [project]);
|
|
54
|
+
|
|
55
|
+
const subscribableObjects = useQuery(Obj.getDatabase(project), Query.select(Filter.type(Feed.Feed)));
|
|
56
|
+
|
|
57
|
+
const existingSubscripts = useAtomValue(
|
|
58
|
+
useMemo(
|
|
59
|
+
() =>
|
|
60
|
+
AtomObj.make(project).pipe((_) =>
|
|
61
|
+
Atom.make((get) => {
|
|
62
|
+
const project = get(_);
|
|
63
|
+
const selectedSubscriptions: Obj.Unknown[] = subscribableObjects.filter((object) =>
|
|
64
|
+
project.subscriptions.some((subscription) => DXN.equals(subscription.dxn, Obj.getDXN(object))),
|
|
65
|
+
);
|
|
66
|
+
|
|
67
|
+
return selectedSubscriptions;
|
|
68
|
+
}),
|
|
69
|
+
),
|
|
70
|
+
[project, subscribableObjects],
|
|
71
|
+
),
|
|
72
|
+
);
|
|
73
|
+
|
|
74
|
+
return (
|
|
75
|
+
<div className='flex flex-col gap-4'>
|
|
76
|
+
<Input.Root>
|
|
77
|
+
<Input.Label>Spec (what is the goal of the project?)</Input.Label>
|
|
78
|
+
<MarkdownEditor.Root id={spec?.id ?? ''} object={spec}>
|
|
79
|
+
<MarkdownEditor.Content initialValue={specInitialValue} />
|
|
80
|
+
</MarkdownEditor.Root>
|
|
81
|
+
</Input.Root>
|
|
82
|
+
<ButtonGroup classNames='h-10'>
|
|
83
|
+
<Button onClick={handleResetHistory}>Reset Chat History</Button>
|
|
84
|
+
</ButtonGroup>
|
|
85
|
+
<div>
|
|
86
|
+
<h2 className='text-lg font-bold'>Subscriptions</h2>
|
|
87
|
+
{subscribableObjects.length > 0 && (
|
|
88
|
+
<div>
|
|
89
|
+
{subscribableObjects.map((object) => (
|
|
90
|
+
<Input.Root key={object.id}>
|
|
91
|
+
<Input.Checkbox
|
|
92
|
+
checked={existingSubscripts.includes(object)}
|
|
93
|
+
onCheckedChange={(checked) => {
|
|
94
|
+
Obj.change(project, (project) => {
|
|
95
|
+
if (checked) {
|
|
96
|
+
project.subscriptions.push(Ref.fromDXN(Obj.getDXN(object)));
|
|
97
|
+
} else {
|
|
98
|
+
project.subscriptions = project.subscriptions.filter(
|
|
99
|
+
(subscription) => !DXN.equals(subscription.dxn, Obj.getDXN(object)),
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
}}
|
|
104
|
+
/>
|
|
105
|
+
<Input.Label>{Obj.getLabel(object)}</Input.Label>
|
|
106
|
+
</Input.Root>
|
|
107
|
+
))}
|
|
108
|
+
</div>
|
|
109
|
+
)}
|
|
110
|
+
{subscribableObjects.length === 0 && (
|
|
111
|
+
<div className='text-sm text-description'>Space has no feeds to subscribe to.</div>
|
|
112
|
+
)}
|
|
113
|
+
</div>
|
|
114
|
+
</div>
|
|
115
|
+
);
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
export default ProjectSettings;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type ComponentType, type FunctionComponent, lazy } from 'react';
|
|
6
|
+
|
|
7
|
+
import { type SurfaceComponentProps } from '@dxos/app-toolkit/ui';
|
|
8
|
+
import type { Project } from '@dxos/assistant-toolkit';
|
|
9
|
+
|
|
10
|
+
import type { ProjectArticleProps } from './ProjectArticle';
|
|
11
|
+
|
|
12
|
+
export const ProjectArticle: ComponentType<ProjectArticleProps> = lazy(() => import('./ProjectArticle'));
|
|
13
|
+
|
|
14
|
+
export const ProjectSettings: FunctionComponent<SurfaceComponentProps<Project.Project>> = lazy(
|
|
15
|
+
() => import('./ProjectSettings'),
|
|
16
|
+
);
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Option from 'effect/Option';
|
|
6
|
+
|
|
7
|
+
import { type Project, ProjectFunctions } from '@dxos/assistant-toolkit';
|
|
8
|
+
import { Feed, Obj, Ref } from '@dxos/echo';
|
|
9
|
+
import { FunctionDefinition, Trigger } from '@dxos/functions';
|
|
10
|
+
import { Filter } from '@dxos/react-client/echo';
|
|
11
|
+
|
|
12
|
+
// TODO(dmaretskyi): Perhaps the association is better done with a relation.
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Foreign key {@link PROJECT_TRIGGER_EXTENSION_KEY} => <initative id : ObjectId>
|
|
16
|
+
*/
|
|
17
|
+
const PROJECT_TRIGGER_EXTENSION_KEY = 'dxos.org/extension/ProjectTrigger';
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Foreign key {@link PROJECT_TRIGGER_EXTENSION_KEY} => <dxn string of subscription target>
|
|
21
|
+
*/
|
|
22
|
+
const PROJECT_TRIGGER_TARGET_EXTENSION_KEY = 'dxos.org/extension/ProjectTriggerTarget';
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Syncs triggers in the database with the project subscriptions.
|
|
26
|
+
*/
|
|
27
|
+
export const syncTriggers = async (project: Project.Project) => {
|
|
28
|
+
const db = Obj.getDatabase(project);
|
|
29
|
+
if (!db) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const triggers = await db
|
|
34
|
+
.query(Filter.foreignKeys(Trigger.Trigger, [{ source: PROJECT_TRIGGER_EXTENSION_KEY, id: project.id }]))
|
|
35
|
+
.run();
|
|
36
|
+
|
|
37
|
+
// Delete triggers that are not in subscriptions.
|
|
38
|
+
for (const trigger of triggers) {
|
|
39
|
+
const target = Obj.getKeys(trigger, PROJECT_TRIGGER_TARGET_EXTENSION_KEY).at(0)?.id;
|
|
40
|
+
|
|
41
|
+
const exists = project.subscriptions.find((subscription) => subscription.dxn.toString() === target);
|
|
42
|
+
if (!exists && !(project.useQualifyingAgent && target === Obj.getDXN(project)?.toString())) {
|
|
43
|
+
db.remove(trigger);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// Add triggers that are not in the database.
|
|
48
|
+
for (const subscription of project.subscriptions) {
|
|
49
|
+
const relevantTrigger = triggers.find((trigger) =>
|
|
50
|
+
Obj.getKeys(trigger, PROJECT_TRIGGER_TARGET_EXTENSION_KEY).some((key) => key.id === subscription.dxn.toString()),
|
|
51
|
+
);
|
|
52
|
+
if (relevantTrigger) {
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const target = await subscription.tryLoad();
|
|
57
|
+
if (!target) {
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const queueDxn = Option.some(target).pipe(
|
|
62
|
+
Option.filter(Obj.instanceOf(Feed.Feed)),
|
|
63
|
+
Option.map(Feed.getQueueDxn),
|
|
64
|
+
Option.getOrUndefined,
|
|
65
|
+
);
|
|
66
|
+
if (!queueDxn) {
|
|
67
|
+
continue;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
db.add(
|
|
71
|
+
Trigger.make({
|
|
72
|
+
[Obj.Parent]: project,
|
|
73
|
+
[Obj.Meta]: {
|
|
74
|
+
keys: [
|
|
75
|
+
// TODO(dmaretskyi): Query by parent instead of manually adding keys.
|
|
76
|
+
{ source: PROJECT_TRIGGER_EXTENSION_KEY, id: project.id },
|
|
77
|
+
{ source: PROJECT_TRIGGER_TARGET_EXTENSION_KEY, id: subscription.dxn.toString() },
|
|
78
|
+
],
|
|
79
|
+
},
|
|
80
|
+
enabled: true,
|
|
81
|
+
spec: {
|
|
82
|
+
kind: 'queue',
|
|
83
|
+
queue: queueDxn.toString(),
|
|
84
|
+
},
|
|
85
|
+
function: Ref.make(
|
|
86
|
+
FunctionDefinition.serialize(
|
|
87
|
+
project.useQualifyingAgent ? ProjectFunctions.Qualifier : ProjectFunctions.Agent,
|
|
88
|
+
),
|
|
89
|
+
),
|
|
90
|
+
input: {
|
|
91
|
+
project: Ref.make(project),
|
|
92
|
+
event: '{{event}}',
|
|
93
|
+
},
|
|
94
|
+
concurrency: project.useQualifyingAgent ? 5 : undefined,
|
|
95
|
+
}),
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
if (project.useQualifyingAgent) {
|
|
100
|
+
const qualifierTrigger = triggers.find((trigger) =>
|
|
101
|
+
Obj.getKeys(trigger, PROJECT_TRIGGER_TARGET_EXTENSION_KEY).some(
|
|
102
|
+
(key) => key.id === Obj.getDXN(project)?.toString(),
|
|
103
|
+
),
|
|
104
|
+
);
|
|
105
|
+
if (!qualifierTrigger && project.queue) {
|
|
106
|
+
db.add(
|
|
107
|
+
Trigger.make({
|
|
108
|
+
[Obj.Parent]: project,
|
|
109
|
+
[Obj.Meta]: {
|
|
110
|
+
keys: [
|
|
111
|
+
{ source: PROJECT_TRIGGER_EXTENSION_KEY, id: project.id },
|
|
112
|
+
{ source: PROJECT_TRIGGER_TARGET_EXTENSION_KEY, id: Obj.getDXN(project)?.toString() ?? '' },
|
|
113
|
+
],
|
|
114
|
+
},
|
|
115
|
+
function: Ref.make(FunctionDefinition.serialize(ProjectFunctions.Agent)),
|
|
116
|
+
enabled: true,
|
|
117
|
+
spec: {
|
|
118
|
+
kind: 'queue',
|
|
119
|
+
queue: project.queue.dxn.toString(),
|
|
120
|
+
},
|
|
121
|
+
input: {
|
|
122
|
+
project: Ref.make(project),
|
|
123
|
+
event: '{{event}}',
|
|
124
|
+
},
|
|
125
|
+
}),
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
await db.flush({ indexes: true });
|
|
131
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { useMemo } from 'react';
|
|
6
|
+
|
|
7
|
+
import { type SurfaceComponentProps } from '@dxos/app-toolkit/ui';
|
|
8
|
+
import { AgentFunctions } from '@dxos/assistant-toolkit';
|
|
9
|
+
import { type Prompt } from '@dxos/blueprints';
|
|
10
|
+
import { Obj } from '@dxos/echo';
|
|
11
|
+
import { type FunctionDefinition } from '@dxos/functions';
|
|
12
|
+
import { invariant } from '@dxos/invariant';
|
|
13
|
+
import { invokeFunctionWithTracing, useComputeRuntimeCallback } from '@dxos/plugin-automation';
|
|
14
|
+
import { Panel, Toolbar, useTranslation } from '@dxos/react-ui';
|
|
15
|
+
import { useAttention } from '@dxos/react-ui-attention';
|
|
16
|
+
|
|
17
|
+
import { TemplateEditor } from '../../components';
|
|
18
|
+
import { meta } from '../../meta';
|
|
19
|
+
|
|
20
|
+
export type PromptArticleProps = SurfaceComponentProps<Prompt.Prompt>;
|
|
21
|
+
|
|
22
|
+
export const PromptArticle = ({ role, subject }: PromptArticleProps) => {
|
|
23
|
+
const { t } = useTranslation(meta.id);
|
|
24
|
+
const { hasAttention } = useAttention(Obj.getDXN(subject).toString());
|
|
25
|
+
const db = Obj.getDatabase(subject);
|
|
26
|
+
|
|
27
|
+
const inputData = useMemo<FunctionDefinition.Input<typeof AgentFunctions.Prompt> | undefined>(
|
|
28
|
+
() =>
|
|
29
|
+
subject && db
|
|
30
|
+
? {
|
|
31
|
+
prompt: db.makeRef(Obj.getDXN(subject)),
|
|
32
|
+
input: {},
|
|
33
|
+
}
|
|
34
|
+
: undefined,
|
|
35
|
+
[subject, db],
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
const handleRun = useComputeRuntimeCallback(
|
|
39
|
+
db?.spaceId,
|
|
40
|
+
() => {
|
|
41
|
+
invariant(inputData);
|
|
42
|
+
return invokeFunctionWithTracing(AgentFunctions.Prompt, inputData);
|
|
43
|
+
},
|
|
44
|
+
[inputData],
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<Panel.Root role={role} className='dx-article'>
|
|
49
|
+
<Panel.Toolbar asChild>
|
|
50
|
+
<Toolbar.Root disabled={!hasAttention} onClick={handleRun}>
|
|
51
|
+
<Toolbar.IconButton iconOnly icon='ph--play--regular' label={t('run prompt label')} onClick={handleRun} />
|
|
52
|
+
</Toolbar.Root>
|
|
53
|
+
</Panel.Toolbar>
|
|
54
|
+
<Panel.Content asChild>
|
|
55
|
+
<TemplateEditor id={subject.id} template={subject.instructions} />
|
|
56
|
+
</Panel.Content>
|
|
57
|
+
</Panel.Root>
|
|
58
|
+
);
|
|
59
|
+
};
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { useMemo } from 'react';
|
|
6
|
+
|
|
7
|
+
import { useCapability } from '@dxos/app-framework/ui';
|
|
8
|
+
import { useLayout } from '@dxos/app-toolkit/ui';
|
|
9
|
+
import { type InvocationsState } from '@dxos/functions-runtime';
|
|
10
|
+
import { useTriggerRuntimeControls } from '@dxos/plugin-automation';
|
|
11
|
+
import { ClientCapabilities } from '@dxos/plugin-client/types';
|
|
12
|
+
import { StatusBar } from '@dxos/plugin-status-bar';
|
|
13
|
+
import { type Database, parseId } from '@dxos/react-client/echo';
|
|
14
|
+
import { Icon, Input, Popover, useTranslation } from '@dxos/react-ui';
|
|
15
|
+
import { Settings } from '@dxos/react-ui-form';
|
|
16
|
+
import { mx } from '@dxos/ui-theme';
|
|
17
|
+
|
|
18
|
+
import { meta } from '../../meta';
|
|
19
|
+
|
|
20
|
+
type TriggerStatusState = 'disabled' | 'idle' | 'running' | 'error';
|
|
21
|
+
|
|
22
|
+
const getIcon = (state: TriggerStatusState): string => {
|
|
23
|
+
switch (state) {
|
|
24
|
+
case 'disabled':
|
|
25
|
+
return 'ph--lightning-slash--regular';
|
|
26
|
+
case 'idle':
|
|
27
|
+
return 'ph--lightning--regular';
|
|
28
|
+
case 'running':
|
|
29
|
+
return 'ph--lightning--fill';
|
|
30
|
+
case 'error':
|
|
31
|
+
return 'ph--warning--regular';
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const getIconClassNames = (state: TriggerStatusState): string | undefined => {
|
|
36
|
+
switch (state) {
|
|
37
|
+
case 'running':
|
|
38
|
+
return 'animate-pulse text-accent-text';
|
|
39
|
+
case 'error':
|
|
40
|
+
return 'text-error-text';
|
|
41
|
+
default:
|
|
42
|
+
return undefined;
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const useCurrentSpace = () => {
|
|
47
|
+
const layout = useLayout();
|
|
48
|
+
const client = useCapability(ClientCapabilities.Client);
|
|
49
|
+
const { spaceId } = parseId(layout.workspace);
|
|
50
|
+
const space = spaceId ? client.spaces.get(spaceId) : undefined;
|
|
51
|
+
return space;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export const TriggerStatus = () => {
|
|
55
|
+
const space = useCurrentSpace();
|
|
56
|
+
const db = space?.db;
|
|
57
|
+
if (!db) {
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return <SpaceStatusMain db={db} />;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
const SpaceStatusMain = ({ db }: { db: Database.Database }) => {
|
|
65
|
+
const { state, start, stop } = useTriggerRuntimeControls(db);
|
|
66
|
+
const isRunning = state?.enabled ?? false;
|
|
67
|
+
|
|
68
|
+
// Determine the current trigger status state.
|
|
69
|
+
const triggerState: TriggerStatusState = useMemo(() => {
|
|
70
|
+
if (!isRunning) {
|
|
71
|
+
return 'disabled';
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// Check if there's any pending invocation.
|
|
75
|
+
const hasPending = state?.invocations.some((invocation) => invocation.result === null);
|
|
76
|
+
if (hasPending) {
|
|
77
|
+
return 'running';
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// Check if the last invocation failed.
|
|
81
|
+
const lastInvocation = state?.invocations.at(-1);
|
|
82
|
+
if (lastInvocation?.result?._tag === 'Failure') {
|
|
83
|
+
return 'error';
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
return 'idle';
|
|
87
|
+
}, [isRunning, state?.invocations]);
|
|
88
|
+
|
|
89
|
+
const { t } = useTranslation(meta.id);
|
|
90
|
+
const title = t(`trigger status ${triggerState} label`);
|
|
91
|
+
const icon = <Icon icon={getIcon(triggerState)} classNames={getIconClassNames(triggerState)} />;
|
|
92
|
+
|
|
93
|
+
return (
|
|
94
|
+
<Popover.Root>
|
|
95
|
+
<Popover.Trigger asChild>
|
|
96
|
+
<StatusBar.Item title={title}>{icon}</StatusBar.Item>
|
|
97
|
+
</Popover.Trigger>
|
|
98
|
+
<Popover.Portal>
|
|
99
|
+
<Popover.Content>
|
|
100
|
+
<TriggerStatusPopover
|
|
101
|
+
isRunning={isRunning}
|
|
102
|
+
state={triggerState}
|
|
103
|
+
currentFunctionName={state?.invocations.at(-1)?.function?.name ?? state?.invocations.at(-1)?.function?.key}
|
|
104
|
+
lastInvocation={state?.invocations.at(-1)}
|
|
105
|
+
onToggle={isRunning ? stop : start}
|
|
106
|
+
/>
|
|
107
|
+
<Popover.Arrow />
|
|
108
|
+
</Popover.Content>
|
|
109
|
+
</Popover.Portal>
|
|
110
|
+
</Popover.Root>
|
|
111
|
+
);
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
interface TriggerStatusPopoverProps {
|
|
115
|
+
isRunning: boolean;
|
|
116
|
+
state: TriggerStatusState;
|
|
117
|
+
currentFunctionName?: string;
|
|
118
|
+
lastInvocation?: InvocationsState;
|
|
119
|
+
onToggle: () => void;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
const TriggerStatusPopover = ({
|
|
123
|
+
isRunning,
|
|
124
|
+
state,
|
|
125
|
+
currentFunctionName,
|
|
126
|
+
lastInvocation,
|
|
127
|
+
onToggle,
|
|
128
|
+
}: TriggerStatusPopoverProps) => {
|
|
129
|
+
const { t } = useTranslation(meta.id);
|
|
130
|
+
|
|
131
|
+
return (
|
|
132
|
+
<div className='min-w-[240px] p-2 space-y-3'>
|
|
133
|
+
{/* Runtime Toggle */}
|
|
134
|
+
<Settings.ItemInput title={t('trigger runtime label')} description={t('trigger runtime description')}>
|
|
135
|
+
<Input.Switch classNames='justify-self-end' checked={isRunning} onCheckedChange={onToggle} />
|
|
136
|
+
</Settings.ItemInput>
|
|
137
|
+
|
|
138
|
+
{/* Status Indicator */}
|
|
139
|
+
<div className='flex items-center gap-2 pt-2 border-t border-separator'>
|
|
140
|
+
<Icon icon={getIcon(state)} classNames={mx(getIconClassNames(state), 'shrink-0')} />
|
|
141
|
+
<span className='text-sm'>{t(`trigger status ${state} label`)}</span>
|
|
142
|
+
{currentFunctionName && state === 'running' && (
|
|
143
|
+
<span className='text-xs text-description'>{currentFunctionName}</span>
|
|
144
|
+
)}
|
|
145
|
+
</div>
|
|
146
|
+
</div>
|
|
147
|
+
);
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
export default TriggerStatus;
|