@dxos/plugin-assistant 0.8.4-main.c1de068 → 0.8.4-main.c351d160a8
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-RBJHZPUJ.mjs +93 -0
- package/dist/lib/browser/AssistantSettings-RBJHZPUJ.mjs.map +7 -0
- package/dist/lib/browser/BlueprintArticle-FTGO6Y2F.mjs +35 -0
- package/dist/lib/browser/BlueprintArticle-FTGO6Y2F.mjs.map +7 -0
- package/dist/lib/browser/ChatCompanion-J7UAC5TX.mjs +203 -0
- package/dist/lib/browser/ChatCompanion-J7UAC5TX.mjs.map +7 -0
- package/dist/lib/browser/ChatContainer-QPPZHQRQ.mjs +12 -0
- package/dist/lib/browser/ChatContainer-QPPZHQRQ.mjs.map +7 -0
- package/dist/lib/browser/ChatDialog-NYU67AQS.mjs +85 -0
- package/dist/lib/browser/ChatDialog-NYU67AQS.mjs.map +7 -0
- package/dist/lib/browser/ProjectArticle-ZB27ZROW.mjs +92 -0
- package/dist/lib/browser/ProjectArticle-ZB27ZROW.mjs.map +7 -0
- package/dist/lib/browser/ProjectSettings-DDYTUL25.mjs +117 -0
- package/dist/lib/browser/ProjectSettings-DDYTUL25.mjs.map +7 -0
- package/dist/lib/browser/PromptArticle-RHTAHF23.mjs +71 -0
- package/dist/lib/browser/PromptArticle-RHTAHF23.mjs.map +7 -0
- package/dist/lib/browser/TracePanel-UPRPODLO.mjs +228 -0
- package/dist/lib/browser/TracePanel-UPRPODLO.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-RXT6BPSZ.mjs +244 -0
- package/dist/lib/browser/app-graph-builder-RXT6BPSZ.mjs.map +7 -0
- package/dist/lib/browser/blueprint-definition-O4XHPNJB.mjs +37 -0
- package/dist/lib/browser/blueprint-definition-O4XHPNJB.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-IWAEH25L.mjs +101 -0
- package/dist/lib/browser/chunk-IWAEH25L.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-KR3KDUVF.mjs +2123 -0
- package/dist/lib/browser/chunk-KR3KDUVF.mjs.map +7 -0
- package/dist/lib/browser/chunk-MZWRGUND.mjs +253 -0
- package/dist/lib/browser/chunk-MZWRGUND.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 +307 -162
- 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/markdown-QGCIPTMQ.mjs +155 -0
- package/dist/lib/browser/markdown-QGCIPTMQ.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/operation-resolver-BNMDF2JV.mjs +153 -0
- package/dist/lib/browser/operation-resolver-BNMDF2JV.mjs.map +7 -0
- package/dist/lib/browser/react-surface-XPQLYF6H.mjs +150 -0
- package/dist/lib/browser/react-surface-XPQLYF6H.mjs.map +7 -0
- package/dist/lib/browser/settings-BVW4UWJL.mjs +33 -0
- package/dist/lib/browser/settings-BVW4UWJL.mjs.map +7 -0
- package/dist/lib/browser/state-TKE6OVOG.mjs +27 -0
- package/dist/lib/browser/state-TKE6OVOG.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-KYN2CIJJ.mjs +94 -0
- package/dist/lib/node-esm/AssistantSettings-KYN2CIJJ.mjs.map +7 -0
- package/dist/lib/node-esm/BlueprintArticle-DFTPXAYU.mjs +36 -0
- package/dist/lib/node-esm/BlueprintArticle-DFTPXAYU.mjs.map +7 -0
- package/dist/lib/node-esm/ChatCompanion-OJJVO44R.mjs +204 -0
- package/dist/lib/node-esm/ChatCompanion-OJJVO44R.mjs.map +7 -0
- package/dist/lib/node-esm/ChatContainer-RIVOAWFM.mjs +13 -0
- package/dist/lib/node-esm/ChatContainer-RIVOAWFM.mjs.map +7 -0
- package/dist/lib/node-esm/ChatDialog-IEZLH7T5.mjs +86 -0
- package/dist/lib/node-esm/ChatDialog-IEZLH7T5.mjs.map +7 -0
- package/dist/lib/node-esm/ProjectArticle-WVJI6IYZ.mjs +93 -0
- package/dist/lib/node-esm/ProjectArticle-WVJI6IYZ.mjs.map +7 -0
- package/dist/lib/node-esm/ProjectSettings-JQLRY6AS.mjs +118 -0
- package/dist/lib/node-esm/ProjectSettings-JQLRY6AS.mjs.map +7 -0
- package/dist/lib/node-esm/PromptArticle-HPCQDVFD.mjs +72 -0
- package/dist/lib/node-esm/PromptArticle-HPCQDVFD.mjs.map +7 -0
- package/dist/lib/node-esm/TracePanel-KAUU6OVE.mjs +229 -0
- package/dist/lib/node-esm/TracePanel-KAUU6OVE.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-H24ZSWEY.mjs +245 -0
- package/dist/lib/node-esm/app-graph-builder-H24ZSWEY.mjs.map +7 -0
- package/dist/lib/node-esm/blueprint-definition-LWPM3FBG.mjs +38 -0
- package/dist/lib/node-esm/blueprint-definition-LWPM3FBG.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-5BLOZBHM.mjs +102 -0
- package/dist/lib/node-esm/chunk-5BLOZBHM.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-QYHBAOBD.mjs +2124 -0
- package/dist/lib/node-esm/chunk-QYHBAOBD.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-VSA3KDAW.mjs +254 -0
- package/dist/lib/node-esm/chunk-VSA3KDAW.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 +307 -162
- 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/markdown-5FJCWKIE.mjs +156 -0
- package/dist/lib/node-esm/markdown-5FJCWKIE.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/operation-resolver-TWGZ3ODO.mjs +154 -0
- package/dist/lib/node-esm/operation-resolver-TWGZ3ODO.mjs.map +7 -0
- package/dist/lib/node-esm/react-surface-6I6JOQBD.mjs +151 -0
- package/dist/lib/node-esm/react-surface-6I6JOQBD.mjs.map +7 -0
- package/dist/lib/node-esm/settings-5CL6CQFK.mjs +34 -0
- package/dist/lib/node-esm/settings-5CL6CQFK.mjs.map +7 -0
- package/dist/lib/node-esm/state-XBRFX5FL.mjs +28 -0
- package/dist/lib/node-esm/state-XBRFX5FL.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/markdown/index.d.ts +3 -0
- package/dist/types/src/capabilities/markdown/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/markdown/markdown.d.ts +5 -0
- package/dist/types/src/capabilities/markdown/markdown.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 +17 -0
- package/dist/types/src/capabilities/state/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/state/state.d.ts +19 -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 +297 -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 +443 -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 +440 -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 +444 -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 +13 -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/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/TracePanel/TracePanel.d.ts +3 -0
- package/dist/types/src/containers/TracePanel/TracePanel.d.ts.map +1 -0
- package/dist/types/src/containers/TracePanel/index.d.ts +3 -0
- package/dist/types/src/containers/TracePanel/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 +11 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/extensions/index.d.ts +2 -0
- package/dist/types/src/extensions/index.d.ts.map +1 -0
- package/dist/types/src/extensions/prompt-extension.d.ts +10 -0
- package/dist/types/src/extensions/prompt-extension.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 +388 -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 +115 -0
- package/dist/types/src/types/AssistantAction.d.ts.map +1 -0
- package/dist/types/src/types/capabilities.d.ts +41 -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 +163 -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 +216 -0
- package/src/capabilities/app-graph-builder/index.ts +7 -0
- package/src/capabilities/blueprint-definition/blueprint-definition.ts +54 -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/markdown/index.ts +7 -0
- package/src/capabilities/markdown/markdown.ts +39 -0
- package/src/capabilities/operation-resolver/index.ts +7 -0
- package/src/capabilities/operation-resolver/operation-resolver.ts +137 -0
- package/src/capabilities/react-surface/index.ts +7 -0
- package/src/capabilities/react-surface/react-surface.tsx +133 -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 +28 -0
- package/src/capabilities/toolkit/index.ts +7 -0
- package/src/capabilities/toolkit/toolkit.ts +15 -0
- package/src/components/Chat/Chat.tsx +274 -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 +37 -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 +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 +227 -0
- package/src/containers/ChatCompanion/index.ts +7 -0
- package/src/containers/ChatContainer/ChatContainer.tsx +92 -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 +124 -0
- package/src/containers/Project/ProjectSettings.tsx +135 -0
- package/src/containers/Project/index.ts +16 -0
- package/src/containers/PromptArticle/PromptArticle.tsx +59 -0
- package/src/containers/PromptArticle/index.ts +7 -0
- package/src/containers/TracePanel/TracePanel.tsx +260 -0
- package/src/containers/TracePanel/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 +16 -0
- package/src/extensions/index.ts +5 -0
- package/src/extensions/prompt-extension.ts +142 -0
- package/src/hooks/index.ts +8 -4
- package/src/hooks/useBlueprintRegistry.ts +109 -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 +50 -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 -28
- package/src/types/Assistant.ts +28 -0
- package/src/types/AssistantAction.ts +90 -0
- package/src/types/capabilities.ts +29 -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,124 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Atom, useAtomValue } from '@effect-atom/atom-react';
|
|
6
|
+
import * as Function from 'effect/Function';
|
|
7
|
+
import * as Option from 'effect/Option';
|
|
8
|
+
import React, { forwardRef, useMemo, useState } from 'react';
|
|
9
|
+
|
|
10
|
+
import { Surface } from '@dxos/app-framework/ui';
|
|
11
|
+
import { type SurfaceComponentProps, useObjectMenuItems } from '@dxos/app-toolkit/ui';
|
|
12
|
+
import { type Project } from '@dxos/assistant-toolkit';
|
|
13
|
+
import { Annotation, Filter, Obj, Query } from '@dxos/echo';
|
|
14
|
+
import { AtomObj, AtomRef } from '@dxos/echo-atom';
|
|
15
|
+
import { useQuery } from '@dxos/react-client/echo';
|
|
16
|
+
import { Card, Panel, ScrollArea, Toolbar } from '@dxos/react-ui';
|
|
17
|
+
import { Menu } from '@dxos/react-ui-menu';
|
|
18
|
+
import { Focus, Mosaic, type MosaicTileProps } from '@dxos/react-ui-mosaic';
|
|
19
|
+
import { isNonNullable } from '@dxos/util';
|
|
20
|
+
|
|
21
|
+
export type ProjectArticleProps = SurfaceComponentProps<Project.Project>;
|
|
22
|
+
|
|
23
|
+
export const ProjectArticle = ({ subject: project }: ProjectArticleProps) => {
|
|
24
|
+
const inputQueue = useAtomValue(
|
|
25
|
+
AtomObj.make(project).pipe((_) =>
|
|
26
|
+
Atom.make((get) =>
|
|
27
|
+
Option.fromNullable(get(_).queue).pipe(Option.map(AtomRef.make), Option.map(get), Option.getOrUndefined),
|
|
28
|
+
),
|
|
29
|
+
),
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
const inputQueueItems: Obj.Unknown[] = useQuery(inputQueue, Query.select(Filter.everything()));
|
|
33
|
+
|
|
34
|
+
const artifacts = useAtomValue(
|
|
35
|
+
useMemo(
|
|
36
|
+
() =>
|
|
37
|
+
AtomObj.make(project).pipe((project) =>
|
|
38
|
+
Atom.make((get) => {
|
|
39
|
+
return get(project).artifacts.map((artifact) => get(AtomRef.make(artifact.data)) as Obj.Unknown);
|
|
40
|
+
}),
|
|
41
|
+
),
|
|
42
|
+
[project],
|
|
43
|
+
),
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
const [viewport, setViewport] = useState<HTMLElement | null>(null);
|
|
47
|
+
|
|
48
|
+
const stackObjects = [...artifacts, ...inputQueueItems].filter(isNonNullable);
|
|
49
|
+
|
|
50
|
+
return (
|
|
51
|
+
<Panel.Root className='dx-document'>
|
|
52
|
+
<Panel.Content>
|
|
53
|
+
{/* TODO(burdon): Factor out. */}
|
|
54
|
+
{stackObjects.length === 0 && (
|
|
55
|
+
<div className='text-subdued'>
|
|
56
|
+
Project has no objects associated with it.
|
|
57
|
+
<br />
|
|
58
|
+
<br />
|
|
59
|
+
To get started:
|
|
60
|
+
<br />- Write the initative spec: what is the goal of the project?
|
|
61
|
+
<br />- subscribe project to your email.
|
|
62
|
+
<br />- Chat with the agent.
|
|
63
|
+
</div>
|
|
64
|
+
)}
|
|
65
|
+
|
|
66
|
+
{stackObjects.length > 0 && (
|
|
67
|
+
<Focus.Group asChild>
|
|
68
|
+
<Mosaic.Container asChild withFocus autoScroll={viewport}>
|
|
69
|
+
<ScrollArea.Root orientation='vertical'>
|
|
70
|
+
<ScrollArea.Viewport classNames='p-2' ref={setViewport}>
|
|
71
|
+
<Mosaic.Stack items={stackObjects} getId={(item) => item.id} draggable={false} Tile={StackTile} />
|
|
72
|
+
</ScrollArea.Viewport>
|
|
73
|
+
</ScrollArea.Root>
|
|
74
|
+
</Mosaic.Container>
|
|
75
|
+
</Focus.Group>
|
|
76
|
+
)}
|
|
77
|
+
</Panel.Content>
|
|
78
|
+
</Panel.Root>
|
|
79
|
+
);
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
const StackTile = forwardRef<HTMLDivElement, MosaicTileProps<Obj.Unknown>>(
|
|
83
|
+
({ data, location, debug }, forwardedRef) => {
|
|
84
|
+
const objectMenuItems = useObjectMenuItems(data);
|
|
85
|
+
const icon = Function.pipe(
|
|
86
|
+
Obj.getSchema(data),
|
|
87
|
+
Option.fromNullable,
|
|
88
|
+
Option.flatMap(Annotation.IconAnnotation.get),
|
|
89
|
+
Option.map(({ icon }) => icon),
|
|
90
|
+
Option.getOrElse(() => 'ph--placeholder--regular'),
|
|
91
|
+
);
|
|
92
|
+
|
|
93
|
+
return (
|
|
94
|
+
<Mosaic.Tile asChild id={data.id} data={data} location={location} debug={debug}>
|
|
95
|
+
<Focus.Group asChild>
|
|
96
|
+
<Menu.Root>
|
|
97
|
+
<Card.Root ref={forwardedRef} data-testid='board-item'>
|
|
98
|
+
<Card.Toolbar>
|
|
99
|
+
<Card.Icon icon={icon} />
|
|
100
|
+
<Card.Title>{Obj.getLabel(data)}</Card.Title>
|
|
101
|
+
{/* TODO(wittjosiah): Reconcile with Card.Menu. */}
|
|
102
|
+
<Menu.Trigger asChild disabled={!objectMenuItems?.length}>
|
|
103
|
+
<Toolbar.IconButton
|
|
104
|
+
iconOnly
|
|
105
|
+
variant='ghost'
|
|
106
|
+
icon='ph--dots-three-vertical--regular'
|
|
107
|
+
label='Actions'
|
|
108
|
+
/>
|
|
109
|
+
</Menu.Trigger>
|
|
110
|
+
<Menu.Content items={objectMenuItems} />
|
|
111
|
+
</Card.Toolbar>
|
|
112
|
+
<Card.Content>
|
|
113
|
+
<Surface.Surface role='card--content' limit={1} data={{ subject: data }} />
|
|
114
|
+
</Card.Content>
|
|
115
|
+
</Card.Root>
|
|
116
|
+
</Menu.Root>
|
|
117
|
+
</Focus.Group>
|
|
118
|
+
</Mosaic.Tile>
|
|
119
|
+
);
|
|
120
|
+
},
|
|
121
|
+
);
|
|
122
|
+
StackTile.displayName = 'StackTile';
|
|
123
|
+
|
|
124
|
+
export default ProjectArticle;
|
|
@@ -0,0 +1,135 @@
|
|
|
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 * as Option from 'effect/Option';
|
|
9
|
+
import React, { useCallback, useEffect, useMemo } from 'react';
|
|
10
|
+
|
|
11
|
+
import { useCapability } from '@dxos/app-framework/ui';
|
|
12
|
+
import { type SurfaceComponentProps } from '@dxos/app-toolkit/ui';
|
|
13
|
+
import { Project, syncProjectTriggers } from '@dxos/assistant-toolkit';
|
|
14
|
+
import { DXN, Obj, Ref } 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
|
+
import { FeedAnnotation } from '@dxos/schema';
|
|
24
|
+
|
|
25
|
+
export const ProjectSettings = ({ subject: project }: SurfaceComponentProps<Project.Project>) => {
|
|
26
|
+
const computeRuntime = useCapability(AutomationCapabilities.ComputeRuntime);
|
|
27
|
+
|
|
28
|
+
const handleResetHistory = useCallback(async () => {
|
|
29
|
+
const runtime = computeRuntime.getRuntime(Obj.getDatabase(project)!.spaceId);
|
|
30
|
+
|
|
31
|
+
await runtime.runPromise(Project.resetChatHistory(project));
|
|
32
|
+
|
|
33
|
+
if (!project.queue) {
|
|
34
|
+
await runtime.runPromise(
|
|
35
|
+
Effect.gen(function* () {
|
|
36
|
+
const queue = yield* QueueService.createQueue();
|
|
37
|
+
Obj.change(project, (project) => {
|
|
38
|
+
project.queue = Ref.fromDXN(queue.dxn);
|
|
39
|
+
});
|
|
40
|
+
}),
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
}, [project, computeRuntime]);
|
|
44
|
+
|
|
45
|
+
const spec = useAtomValue(AtomRef.make(project.spec));
|
|
46
|
+
const [specInitialValue] = useObject(spec, 'content');
|
|
47
|
+
|
|
48
|
+
useEffect(() => {
|
|
49
|
+
const db = Obj.getDatabase(project);
|
|
50
|
+
if (!db) return;
|
|
51
|
+
const runtime = computeRuntime.getRuntime(db.spaceId);
|
|
52
|
+
return Obj.subscribe(project, () => {
|
|
53
|
+
queueMicrotask(() => runtime.runPromise(syncProjectTriggers(project)));
|
|
54
|
+
});
|
|
55
|
+
}, [project, computeRuntime]);
|
|
56
|
+
|
|
57
|
+
const db = Obj.getDatabase(project);
|
|
58
|
+
const feedFilter = useMemo(() => {
|
|
59
|
+
if (!db) {
|
|
60
|
+
return Filter.nothing();
|
|
61
|
+
}
|
|
62
|
+
const schemas = db.schemaRegistry.query({ location: ['database', 'runtime'] }).runSync();
|
|
63
|
+
const feedSchemas = schemas.filter((schema) => {
|
|
64
|
+
const annotation = FeedAnnotation.get(schema);
|
|
65
|
+
return Option.isSome(annotation) && annotation.value === true;
|
|
66
|
+
});
|
|
67
|
+
if (feedSchemas.length === 0) {
|
|
68
|
+
return Filter.nothing();
|
|
69
|
+
}
|
|
70
|
+
return Filter.or(...feedSchemas.map((schema) => Filter.type(schema)));
|
|
71
|
+
}, [db]);
|
|
72
|
+
const subscribableObjects = useQuery(db, feedFilter);
|
|
73
|
+
|
|
74
|
+
const existingSubscripts = useAtomValue(
|
|
75
|
+
useMemo(
|
|
76
|
+
() =>
|
|
77
|
+
AtomObj.make(project).pipe((_) =>
|
|
78
|
+
Atom.make((get) => {
|
|
79
|
+
const project = get(_);
|
|
80
|
+
const selectedSubscriptions: Obj.Unknown[] = subscribableObjects.filter((object) =>
|
|
81
|
+
project.subscriptions.some((subscription) => DXN.equals(subscription.dxn, Obj.getDXN(object))),
|
|
82
|
+
);
|
|
83
|
+
|
|
84
|
+
return selectedSubscriptions;
|
|
85
|
+
}),
|
|
86
|
+
),
|
|
87
|
+
[project, subscribableObjects],
|
|
88
|
+
),
|
|
89
|
+
);
|
|
90
|
+
|
|
91
|
+
return (
|
|
92
|
+
<div className='flex flex-col gap-4'>
|
|
93
|
+
<Input.Root>
|
|
94
|
+
<Input.Label>Spec (what is the goal of the project?)</Input.Label>
|
|
95
|
+
<MarkdownEditor.Root id={spec?.id ?? ''} object={spec}>
|
|
96
|
+
<MarkdownEditor.Content initialValue={specInitialValue} />
|
|
97
|
+
</MarkdownEditor.Root>
|
|
98
|
+
</Input.Root>
|
|
99
|
+
<ButtonGroup classNames='h-10'>
|
|
100
|
+
<Button onClick={handleResetHistory}>Reset Chat History</Button>
|
|
101
|
+
</ButtonGroup>
|
|
102
|
+
<div>
|
|
103
|
+
<h2 className='text-lg font-bold'>Subscriptions</h2>
|
|
104
|
+
{subscribableObjects.length > 0 && (
|
|
105
|
+
<div>
|
|
106
|
+
{subscribableObjects.map((object) => (
|
|
107
|
+
<Input.Root key={object.id}>
|
|
108
|
+
<Input.Checkbox
|
|
109
|
+
checked={existingSubscripts.includes(object)}
|
|
110
|
+
onCheckedChange={(checked) => {
|
|
111
|
+
Obj.change(project, (project) => {
|
|
112
|
+
if (checked) {
|
|
113
|
+
project.subscriptions.push(Ref.fromDXN(Obj.getDXN(object)));
|
|
114
|
+
} else {
|
|
115
|
+
project.subscriptions = project.subscriptions.filter(
|
|
116
|
+
(subscription) => !DXN.equals(subscription.dxn, Obj.getDXN(object)),
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
}}
|
|
121
|
+
/>
|
|
122
|
+
<Input.Label>{Obj.getLabel(object)}</Input.Label>
|
|
123
|
+
</Input.Root>
|
|
124
|
+
))}
|
|
125
|
+
</div>
|
|
126
|
+
)}
|
|
127
|
+
{subscribableObjects.length === 0 && (
|
|
128
|
+
<div className='text-sm text-description'>Space has no feeds to subscribe to.</div>
|
|
129
|
+
)}
|
|
130
|
+
</div>
|
|
131
|
+
</div>
|
|
132
|
+
);
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
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,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, attendableId, subject }: PromptArticleProps) => {
|
|
23
|
+
const { t } = useTranslation(meta.id);
|
|
24
|
+
const { hasAttention } = useAttention(attendableId);
|
|
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-document'>
|
|
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,260 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Schema from 'effect/Schema';
|
|
6
|
+
import React, { useMemo } from 'react';
|
|
7
|
+
|
|
8
|
+
import { Filter, Obj, Query } from '@dxos/echo';
|
|
9
|
+
import { InvocationOutcome, InvocationTraceEndEvent, InvocationTraceStartEvent } from '@dxos/functions-runtime';
|
|
10
|
+
import { useTriggerRuntimeControls } from '@dxos/plugin-automation';
|
|
11
|
+
import { useActiveSpace } from '@dxos/plugin-space';
|
|
12
|
+
import { type Space } from '@dxos/react-client/echo';
|
|
13
|
+
import { Input, Panel, Toolbar, useTranslation } from '@dxos/react-ui';
|
|
14
|
+
import { Timeline, type Commit } from '@dxos/react-ui-components';
|
|
15
|
+
import { Message } from '@dxos/types';
|
|
16
|
+
|
|
17
|
+
import { AtomObj, AtomQuery, AtomRef } from '@dxos/echo-atom';
|
|
18
|
+
import { LogLevel } from '@dxos/log';
|
|
19
|
+
import { Atom } from '@effect-atom/atom';
|
|
20
|
+
import { useAtomValue } from '@effect-atom/atom-react';
|
|
21
|
+
import * as Array from 'effect/Array';
|
|
22
|
+
import { pipe } from 'effect/Function';
|
|
23
|
+
import { meta } from '../../meta';
|
|
24
|
+
|
|
25
|
+
export const TracePanel = () => {
|
|
26
|
+
const space = useActiveSpace();
|
|
27
|
+
if (!space) {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return <TracePanelMain space={space} />;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const TracePanelMain = ({ space }: { space: Space }) => {
|
|
35
|
+
const { t } = useTranslation(meta.id);
|
|
36
|
+
const { state, start, stop } = useTriggerRuntimeControls(space.db);
|
|
37
|
+
const isRunning = state?.enabled ?? false;
|
|
38
|
+
|
|
39
|
+
const { branches, commits } = useAtomValue(useMemo(() => getExecutionGraph(space), [space]));
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<Panel.Root>
|
|
43
|
+
<Panel.Toolbar asChild>
|
|
44
|
+
<Toolbar.Root>
|
|
45
|
+
<Input.Root>
|
|
46
|
+
<Input.Switch checked={isRunning} onCheckedChange={isRunning ? stop : start} />
|
|
47
|
+
</Input.Root>
|
|
48
|
+
<span className='text-sm'>{t('trigger runtime label')}</span>
|
|
49
|
+
</Toolbar.Root>
|
|
50
|
+
</Panel.Toolbar>
|
|
51
|
+
<Panel.Content>
|
|
52
|
+
<Timeline branches={branches} commits={commits} compact />
|
|
53
|
+
</Panel.Content>
|
|
54
|
+
</Panel.Root>
|
|
55
|
+
);
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
type InvocationInfo = {
|
|
59
|
+
startEvent: InvocationTraceStartEvent;
|
|
60
|
+
endEvent: InvocationTraceEndEvent | null;
|
|
61
|
+
subevents: Obj.Unknown[];
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
const getExecutionGraph = (
|
|
65
|
+
space: Space,
|
|
66
|
+
{
|
|
67
|
+
invocationsLimit = 100,
|
|
68
|
+
subeventsLimit = 20,
|
|
69
|
+
showSubeventsForLastNInvocations = 4,
|
|
70
|
+
}: { invocationsLimit?: number; subeventsLimit?: number; showSubeventsForLastNInvocations?: number } = {},
|
|
71
|
+
): Atom.Atom<{
|
|
72
|
+
branches: string[];
|
|
73
|
+
commits: Commit[];
|
|
74
|
+
}> => {
|
|
75
|
+
return pipe(
|
|
76
|
+
space.properties,
|
|
77
|
+
(_) => AtomObj.make(_),
|
|
78
|
+
// space properies => Atom<Atom<InvocationTraceEvent[]>>
|
|
79
|
+
(_) =>
|
|
80
|
+
Atom.make((get) => {
|
|
81
|
+
const queueDxn = get(_).invocationTraceQueue?.dxn;
|
|
82
|
+
return AtomQuery.make(
|
|
83
|
+
space.db,
|
|
84
|
+
!queueDxn
|
|
85
|
+
? (Query.select(Filter.nothing()) as Query.Query<never>) // TODO(dmaretskyi): Broken echo types here.
|
|
86
|
+
: Query.select(
|
|
87
|
+
Filter.or(Filter.type(InvocationTraceStartEvent), Filter.type(InvocationTraceEndEvent)),
|
|
88
|
+
).from({
|
|
89
|
+
queues: [queueDxn.toString()],
|
|
90
|
+
}),
|
|
91
|
+
);
|
|
92
|
+
}),
|
|
93
|
+
// Flatten atoms
|
|
94
|
+
(_) => Atom.make((get) => get(get(_))),
|
|
95
|
+
// Atom<InvocationTraceEvent[]> => Atom<InvocationInfo[]>
|
|
96
|
+
(_) =>
|
|
97
|
+
Atom.make((get) => {
|
|
98
|
+
const events = get(_);
|
|
99
|
+
const invocations: InvocationInfo[] = [];
|
|
100
|
+
|
|
101
|
+
for (const event of events) {
|
|
102
|
+
if (Schema.is(InvocationTraceStartEvent)(event)) {
|
|
103
|
+
const invocationInfo: InvocationInfo = {
|
|
104
|
+
startEvent: event,
|
|
105
|
+
endEvent: null,
|
|
106
|
+
subevents: [],
|
|
107
|
+
};
|
|
108
|
+
invocations.push(invocationInfo);
|
|
109
|
+
} else if (Schema.is(InvocationTraceEndEvent)(event)) {
|
|
110
|
+
const invocationInfo = invocations.find((i) => i.startEvent.invocationId === event.invocationId);
|
|
111
|
+
if (invocationInfo) {
|
|
112
|
+
invocationInfo.endEvent = event;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
let expandedBudget = showSubeventsForLastNInvocations;
|
|
118
|
+
for (let i = invocations.length - 1; i >= 0; i--) {
|
|
119
|
+
const invocation = invocations[i];
|
|
120
|
+
if (!invocation.startEvent.invocationTraceQueue) {
|
|
121
|
+
continue;
|
|
122
|
+
}
|
|
123
|
+
const subevents = get(
|
|
124
|
+
AtomQuery.make(
|
|
125
|
+
space.db,
|
|
126
|
+
Query.select(Filter.everything())
|
|
127
|
+
.limit(subeventsLimit)
|
|
128
|
+
.from({ queues: [invocation.startEvent.invocationTraceQueue?.dxn?.toString()] }),
|
|
129
|
+
),
|
|
130
|
+
);
|
|
131
|
+
invocation.subevents = subevents;
|
|
132
|
+
if (subevents.length > 0) {
|
|
133
|
+
expandedBudget--;
|
|
134
|
+
}
|
|
135
|
+
if (expandedBudget <= 0) {
|
|
136
|
+
break;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
return invocations;
|
|
141
|
+
}),
|
|
142
|
+
|
|
143
|
+
// Build commit graph from InvocationInfo[]
|
|
144
|
+
(_) =>
|
|
145
|
+
Atom.make((get) => {
|
|
146
|
+
const invocations = get(_);
|
|
147
|
+
// Two alternating branches for subevents to save horizontal space.
|
|
148
|
+
const branches: string[] = ['invocations'];
|
|
149
|
+
const commits: Commit[] = [];
|
|
150
|
+
|
|
151
|
+
const sorted = invocations.sort((a, b) => a.startEvent.timestamp - b.startEvent.timestamp);
|
|
152
|
+
let idx = 0;
|
|
153
|
+
for (const invocation of sorted.slice(-invocationsLimit)) {
|
|
154
|
+
const trigger = invocation.startEvent.trigger && AtomRef.make(invocation.startEvent.trigger).pipe(get);
|
|
155
|
+
const fn =
|
|
156
|
+
(invocation.startEvent.invocationTarget &&
|
|
157
|
+
AtomRef.make(invocation.startEvent.invocationTarget).pipe(get)) ??
|
|
158
|
+
(trigger?.function && AtomRef.make(trigger.function).pipe(get));
|
|
159
|
+
|
|
160
|
+
const functionName = fn ? Obj.getLabel(fn) : undefined;
|
|
161
|
+
const triggerName = trigger?.spec?.kind ?? 'trigger';
|
|
162
|
+
const label = functionName ? `${functionName} on ${triggerName}` : triggerName;
|
|
163
|
+
|
|
164
|
+
const branchName = `invocation-${invocation.startEvent.invocationId.slice(0, 8)}`;
|
|
165
|
+
|
|
166
|
+
if (invocation.endEvent && invocation.subevents.length === 0) {
|
|
167
|
+
commits.push({
|
|
168
|
+
id: invocation.endEvent.id,
|
|
169
|
+
branch: 'invocations',
|
|
170
|
+
parents: commits.length > 0 ? [commits.at(-1)!.id] : [],
|
|
171
|
+
icon:
|
|
172
|
+
invocation.endEvent.outcome === InvocationOutcome.SUCCESS
|
|
173
|
+
? 'ph--check-circle--regular'
|
|
174
|
+
: 'ph--x-circle--regular',
|
|
175
|
+
level: invocation.endEvent.outcome === InvocationOutcome.SUCCESS ? LogLevel.INFO : LogLevel.ERROR,
|
|
176
|
+
message: `${label} - ${invocation.endEvent.outcome}`,
|
|
177
|
+
timestamp: new Date(invocation.endEvent.timestamp),
|
|
178
|
+
});
|
|
179
|
+
continue;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
commits.push({
|
|
183
|
+
id: invocation.startEvent.id,
|
|
184
|
+
branch: 'invocations',
|
|
185
|
+
parents: commits.length > 0 ? [commits.at(-1)!.id] : [],
|
|
186
|
+
icon: invocation.endEvent ? 'ph--play--regular' : 'ph--spinner-gap--regular',
|
|
187
|
+
level: invocation.endEvent ? LogLevel.INFO : LogLevel.VERBOSE,
|
|
188
|
+
message: label,
|
|
189
|
+
timestamp: new Date(invocation.startEvent.timestamp),
|
|
190
|
+
});
|
|
191
|
+
|
|
192
|
+
for (const subevent of invocation.subevents.slice(-subeventsLimit)) {
|
|
193
|
+
if (Obj.instanceOf(Message.Message, subevent)) {
|
|
194
|
+
for (const block of subevent.blocks) {
|
|
195
|
+
switch (block._tag) {
|
|
196
|
+
case 'text':
|
|
197
|
+
commits.push({
|
|
198
|
+
id: subevent.id,
|
|
199
|
+
branch: branchName,
|
|
200
|
+
parents: [commits.at(-1)!.id],
|
|
201
|
+
icon: 'ph--robot--regular',
|
|
202
|
+
level: LogLevel.VERBOSE,
|
|
203
|
+
message: block.text.slice(0, 50),
|
|
204
|
+
timestamp: new Date(subevent.created),
|
|
205
|
+
});
|
|
206
|
+
if (!branches.includes(branchName)) {
|
|
207
|
+
branches.push(branchName);
|
|
208
|
+
}
|
|
209
|
+
break;
|
|
210
|
+
case 'toolCall':
|
|
211
|
+
commits.push({
|
|
212
|
+
id: subevent.id,
|
|
213
|
+
branch: branchName,
|
|
214
|
+
parents: [commits.at(-1)!.id],
|
|
215
|
+
icon: 'ph--wrench--regular',
|
|
216
|
+
level: LogLevel.VERBOSE,
|
|
217
|
+
message: block.name,
|
|
218
|
+
timestamp: new Date(subevent.created),
|
|
219
|
+
});
|
|
220
|
+
if (!branches.includes(branchName)) {
|
|
221
|
+
branches.push(branchName);
|
|
222
|
+
}
|
|
223
|
+
break;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
if (!invocation.endEvent && invocation.subevents.length > 0) {
|
|
230
|
+
commits.push({
|
|
231
|
+
id: invocation.startEvent.invocationId + 'pending',
|
|
232
|
+
branch: branchName,
|
|
233
|
+
parents: [commits.at(-1)!.id],
|
|
234
|
+
icon: 'ph--dots-three-vertical--regular',
|
|
235
|
+
level: LogLevel.VERBOSE,
|
|
236
|
+
message: 'Running...',
|
|
237
|
+
timestamp: new Date(),
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
if (invocation.endEvent && invocation.subevents.length > 0) {
|
|
242
|
+
commits.push({
|
|
243
|
+
id: invocation.endEvent.id,
|
|
244
|
+
branch: 'invocations',
|
|
245
|
+
parents: Array.dedupe([invocation.startEvent.invocationId, commits.at(-1)!.id]),
|
|
246
|
+
icon:
|
|
247
|
+
invocation.endEvent.outcome === InvocationOutcome.SUCCESS
|
|
248
|
+
? 'ph--check-circle--regular'
|
|
249
|
+
: 'ph--x-circle--regular',
|
|
250
|
+
level: invocation.endEvent.outcome === InvocationOutcome.SUCCESS ? LogLevel.INFO : LogLevel.ERROR,
|
|
251
|
+
message: `${label} - ${invocation.endEvent.outcome === InvocationOutcome.SUCCESS ? 'Success' : 'Failure'}`,
|
|
252
|
+
timestamp: new Date(invocation.endEvent.timestamp),
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
return { branches, commits };
|
|
258
|
+
}),
|
|
259
|
+
);
|
|
260
|
+
};
|