@dxos/plugin-assistant 0.8.4-main.ae835ea → 0.8.4-main.bcb3aa67d6
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-PTNCDWC6.mjs +100 -0
- package/dist/lib/browser/AssistantSettings-PTNCDWC6.mjs.map +7 -0
- package/dist/lib/browser/blueprints/index.mjs +8 -0
- package/dist/lib/browser/chunk-EZRS3J25.mjs +30 -0
- package/dist/lib/browser/chunk-EZRS3J25.mjs.map +7 -0
- package/dist/lib/browser/chunk-OWBVGFDF.mjs +345 -0
- package/dist/lib/browser/chunk-OWBVGFDF.mjs.map +7 -0
- package/dist/lib/browser/chunk-RUV2WOQH.mjs +154 -0
- package/dist/lib/browser/chunk-RUV2WOQH.mjs.map +7 -0
- package/dist/lib/browser/chunk-YD4JTOO5.mjs +173 -0
- package/dist/lib/browser/chunk-YD4JTOO5.mjs.map +7 -0
- package/dist/lib/browser/create-chat-6G6WROW2.mjs +89 -0
- package/dist/lib/browser/create-chat-6G6WROW2.mjs.map +7 -0
- package/dist/lib/browser/ensure-companion-chat-F46BGW2T.mjs +65 -0
- package/dist/lib/browser/ensure-companion-chat-F46BGW2T.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +2511 -311
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/on-create-space-F5HHB3GI.mjs +22 -0
- package/dist/lib/browser/on-create-space-F5HHB3GI.mjs.map +7 -0
- package/dist/lib/browser/operations/index.mjs +13 -0
- package/dist/lib/browser/operations/index.mjs.map +7 -0
- package/dist/lib/browser/resolve-navigation-targets-5Y7FT4CQ.mjs +22 -0
- package/dist/lib/browser/resolve-navigation-targets-5Y7FT4CQ.mjs.map +7 -0
- package/dist/lib/browser/run-prompt-in-new-chat-XSPRWOSR.mjs +144 -0
- package/dist/lib/browser/run-prompt-in-new-chat-XSPRWOSR.mjs.map +7 -0
- package/dist/lib/browser/set-current-chat-JPWBMS7N.mjs +35 -0
- package/dist/lib/browser/set-current-chat-JPWBMS7N.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +5 -4
- package/dist/lib/browser/update-chat-name-AEMFSIJX.mjs +60 -0
- package/dist/lib/browser/update-chat-name-AEMFSIJX.mjs.map +7 -0
- package/dist/lib/node-esm/AssistantSettings-Z5ZZWWSN.mjs +101 -0
- package/dist/lib/node-esm/AssistantSettings-Z5ZZWWSN.mjs.map +7 -0
- package/dist/lib/node-esm/blueprints/index.mjs +9 -0
- package/dist/lib/node-esm/chunk-NZIKC7AN.mjs +32 -0
- package/dist/lib/node-esm/chunk-NZIKC7AN.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-POJO5MTX.mjs +347 -0
- package/dist/lib/node-esm/chunk-POJO5MTX.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-PY4X6FJT.mjs +155 -0
- package/dist/lib/node-esm/chunk-PY4X6FJT.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-QHPGS4A4.mjs +174 -0
- package/dist/lib/node-esm/chunk-QHPGS4A4.mjs.map +7 -0
- package/dist/lib/node-esm/create-chat-EEMDTQRE.mjs +90 -0
- package/dist/lib/node-esm/create-chat-EEMDTQRE.mjs.map +7 -0
- package/dist/lib/node-esm/ensure-companion-chat-YAKJY7TB.mjs +66 -0
- package/dist/lib/node-esm/ensure-companion-chat-YAKJY7TB.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +2511 -311
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/on-create-space-YE5NQ3D2.mjs +23 -0
- package/dist/lib/node-esm/on-create-space-YE5NQ3D2.mjs.map +7 -0
- package/dist/lib/node-esm/operations/index.mjs +14 -0
- package/dist/lib/node-esm/operations/index.mjs.map +7 -0
- package/dist/lib/node-esm/resolve-navigation-targets-W3GTFXDD.mjs +23 -0
- package/dist/lib/node-esm/resolve-navigation-targets-W3GTFXDD.mjs.map +7 -0
- package/dist/lib/node-esm/run-prompt-in-new-chat-Q2CLUUM4.mjs +145 -0
- package/dist/lib/node-esm/run-prompt-in-new-chat-Q2CLUUM4.mjs.map +7 -0
- package/dist/lib/node-esm/set-current-chat-ZBEFWS6P.mjs +36 -0
- package/dist/lib/node-esm/set-current-chat-ZBEFWS6P.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +5 -4
- package/dist/lib/node-esm/update-chat-name-6F7COUGR.mjs +61 -0
- package/dist/lib/node-esm/update-chat-name-6F7COUGR.mjs.map +7 -0
- 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.d.ts +4 -2
- package/dist/types/src/capabilities/ai-service.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +4 -2
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/blueprint-definition.d.ts +4 -6
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -1
- package/dist/types/src/capabilities/companion-chat-provisioner.d.ts +9 -0
- package/dist/types/src/capabilities/companion-chat-provisioner.d.ts.map +1 -0
- package/dist/types/src/capabilities/edge-model-resolver.d.ts +6 -3
- package/dist/types/src/capabilities/edge-model-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +41 -12
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/local-model-resolver.d.ts +6 -3
- package/dist/types/src/capabilities/local-model-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/markdown.d.ts +5 -0
- package/dist/types/src/capabilities/markdown.d.ts.map +1 -0
- package/dist/types/src/capabilities/migrations.d.ts +5 -0
- package/dist/types/src/capabilities/migrations.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts +3 -2
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings.d.ts +16 -2
- package/dist/types/src/capabilities/settings.d.ts.map +1 -1
- package/dist/types/src/capabilities/state.d.ts +19 -2
- package/dist/types/src/capabilities/state.d.ts.map +1 -1
- package/dist/types/src/capabilities/toolkit.d.ts +4 -2
- package/dist/types/src/capabilities/toolkit.d.ts.map +1 -1
- package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts +4 -4
- package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts.map +1 -1
- package/dist/types/src/components/AssistantSettings/AssistantSettings.stories.d.ts +511 -0
- package/dist/types/src/components/AssistantSettings/AssistantSettings.stories.d.ts.map +1 -0
- package/dist/types/src/components/AssistantSettings/index.d.ts +2 -1
- package/dist/types/src/components/AssistantSettings/index.d.ts.map +1 -1
- package/dist/types/src/components/Chat/Chat.d.ts +36 -15
- package/dist/types/src/components/Chat/Chat.d.ts.map +1 -1
- package/dist/types/src/components/Chat/events.d.ts +5 -1
- package/dist/types/src/components/Chat/events.d.ts.map +1 -1
- package/dist/types/src/components/ChatProgress/ChatProgress.d.ts +6 -3
- package/dist/types/src/components/ChatProgress/ChatProgress.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatActions.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts +3 -3
- package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts +3 -3
- package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.d.ts +7 -10
- package/dist/types/src/components/ChatThread/ChatThread.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts +504 -257
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/registry.d.ts +1 -1
- package/dist/types/src/components/ChatThread/registry.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/sync.d.ts +12 -6
- package/dist/types/src/components/ChatThread/sync.d.ts.map +1 -1
- package/dist/types/src/components/ProcessTree/ProcessTree.d.ts +14 -0
- package/dist/types/src/components/ProcessTree/ProcessTree.d.ts.map +1 -0
- package/dist/types/src/components/ProcessTree/ProcessTree.stories.d.ts +8 -0
- package/dist/types/src/components/ProcessTree/ProcessTree.stories.d.ts.map +1 -0
- package/dist/types/src/components/ProcessTree/index.d.ts +2 -0
- package/dist/types/src/components/ProcessTree/index.d.ts.map +1 -0
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts +9 -4
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts +488 -244
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts +11 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts +489 -245
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/extensions/handlebars-extension.d.ts.map +1 -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 +10 -8
- package/dist/types/src/components/ToolBlock/ToolBlock.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.d.ts +17 -12
- package/dist/types/src/components/Toolbox/Toolbox.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts +488 -244
- 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 +3 -7
- package/dist/types/src/components/index.d.ts.map +1 -1
- 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 +14 -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 +20 -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/ProjectArticle/ProjectArticle.d.ts +6 -0
- package/dist/types/src/containers/ProjectArticle/ProjectArticle.d.ts.map +1 -0
- package/dist/types/src/containers/ProjectArticle/index.d.ts +3 -0
- package/dist/types/src/containers/ProjectArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/ProjectSettings/ProjectSettings.d.ts +6 -0
- package/dist/types/src/containers/ProjectSettings/ProjectSettings.d.ts.map +1 -0
- package/dist/types/src/containers/ProjectSettings/index.d.ts +3 -0
- package/dist/types/src/containers/ProjectSettings/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/PromptList/PromptList.d.ts +6 -0
- package/dist/types/src/containers/PromptList/PromptList.d.ts.map +1 -0
- package/dist/types/src/containers/PromptList/PromptList.stories.d.ts +517 -0
- package/dist/types/src/containers/PromptList/PromptList.stories.d.ts.map +1 -0
- package/dist/types/src/containers/PromptList/index.d.ts +3 -0
- package/dist/types/src/containers/PromptList/index.d.ts.map +1 -0
- package/dist/types/src/containers/TracePanel/TracePanel.d.ts +6 -0
- package/dist/types/src/containers/TracePanel/TracePanel.d.ts.map +1 -0
- package/dist/types/src/containers/TracePanel/dxn-extractor.d.ts +19 -0
- package/dist/types/src/containers/TracePanel/dxn-extractor.d.ts.map +1 -0
- package/dist/types/src/containers/TracePanel/dxn-extractor.test.d.ts +2 -0
- package/dist/types/src/containers/TracePanel/dxn-extractor.test.d.ts.map +1 -0
- package/dist/types/src/containers/TracePanel/index.d.ts +4 -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 +12 -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 +2 -1
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useBlueprintRegistry.d.ts +5 -5
- package/dist/types/src/hooks/useBlueprintRegistry.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatProcessor.d.ts +9 -6
- package/dist/types/src/hooks/useChatProcessor.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatServices.d.ts +5 -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 +2 -2
- package/dist/types/src/hooks/useContextBinder.d.ts.map +1 -1
- package/dist/types/src/hooks/useContextObjects.d.ts +7 -7
- package/dist/types/src/hooks/useContextObjects.d.ts.map +1 -1
- package/dist/types/src/hooks/useFilteredTypes.d.ts +3 -0
- package/dist/types/src/hooks/useFilteredTypes.d.ts.map +1 -0
- package/dist/types/src/hooks/usePresets.d.ts +1 -1
- package/dist/types/src/hooks/usePresets.d.ts.map +1 -1
- package/dist/types/src/hooks/useReferencesProvider.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +4 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/operations/create-chat.d.ts +5 -0
- package/dist/types/src/operations/create-chat.d.ts.map +1 -0
- package/dist/types/src/operations/definitions.d.ts +134 -0
- package/dist/types/src/operations/definitions.d.ts.map +1 -0
- package/dist/types/src/operations/ensure-companion-chat.d.ts +5 -0
- package/dist/types/src/operations/ensure-companion-chat.d.ts.map +1 -0
- package/dist/types/src/operations/index.d.ts +4 -0
- package/dist/types/src/operations/index.d.ts.map +1 -0
- package/dist/types/src/operations/on-create-space.d.ts +5 -0
- package/dist/types/src/operations/on-create-space.d.ts.map +1 -0
- package/dist/types/src/operations/resolve-navigation-targets.d.ts +15 -0
- package/dist/types/src/operations/resolve-navigation-targets.d.ts.map +1 -0
- package/dist/types/src/operations/run-prompt-in-new-chat.d.ts +5 -0
- package/dist/types/src/operations/run-prompt-in-new-chat.d.ts.map +1 -0
- package/dist/types/src/operations/set-current-chat.d.ts +5 -0
- package/dist/types/src/operations/set-current-chat.d.ts.map +1 -0
- package/dist/types/src/operations/update-chat-name.d.ts +5 -0
- package/dist/types/src/operations/update-chat-name.d.ts.map +1 -0
- package/dist/types/src/processor/processor.d.ts +34 -34
- package/dist/types/src/processor/processor.d.ts.map +1 -1
- package/dist/types/src/processor/update-name.d.ts +2 -2
- package/dist/types/src/processor/update-name.d.ts.map +1 -1
- package/dist/types/src/queue-logger.d.ts.map +1 -1
- package/dist/types/src/testing/test-generator.d.ts +5 -4
- package/dist/types/src/testing/test-generator.d.ts.map +1 -1
- package/dist/types/src/testing/test-services.d.ts +1 -1
- package/dist/types/src/testing/test-services.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +492 -83
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Assistant.d.ts +18 -46
- package/dist/types/src/types/Assistant.d.ts.map +1 -1
- package/dist/types/src/types/Settings.d.ts +10 -0
- package/dist/types/src/types/Settings.d.ts.map +1 -0
- package/dist/types/src/types/capabilities.d.ts +44 -0
- package/dist/types/src/types/capabilities.d.ts.map +1 -0
- package/dist/types/src/types/events.d.ts +5 -0
- package/dist/types/src/types/events.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +3 -1
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/service.d.ts +10 -212
- package/dist/types/src/types/service.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +139 -91
- package/src/AssistantPlugin.tsx +186 -123
- package/src/blueprints/assistant/blueprint.conversations.json +1 -0
- package/src/blueprints/assistant/blueprint.test.ts +46 -0
- package/src/blueprints/assistant/blueprint.ts +31 -0
- package/src/blueprints/assistant/index.ts +5 -0
- package/src/{components/ChatToolbar → blueprints}/index.ts +1 -1
- package/src/capabilities/ai-service.ts +20 -17
- package/src/capabilities/app-graph-builder.ts +184 -170
- package/src/capabilities/blueprint-definition.ts +47 -55
- package/src/capabilities/companion-chat-provisioner.ts +165 -0
- package/src/capabilities/edge-model-resolver.ts +22 -14
- package/src/capabilities/index.ts +21 -14
- package/src/capabilities/local-model-resolver.ts +21 -13
- package/src/capabilities/markdown.ts +39 -0
- package/src/capabilities/migrations.ts +34 -0
- package/src/capabilities/operation-handler.ts +16 -0
- package/src/capabilities/react-surface.tsx +141 -59
- package/src/capabilities/settings.ts +24 -12
- package/src/capabilities/state.ts +27 -12
- package/src/capabilities/toolkit.ts +7 -13
- package/src/components/AssistantSettings/AssistantSettings.stories.tsx +35 -0
- package/src/components/AssistantSettings/AssistantSettings.tsx +105 -85
- package/src/components/AssistantSettings/index.ts +4 -2
- package/src/components/Chat/Chat.tsx +201 -136
- package/src/components/Chat/events.ts +7 -1
- package/src/components/ChatProgress/ChatProgress.tsx +11 -22
- package/src/components/ChatPrompt/ChatActions.tsx +13 -7
- package/src/components/ChatPrompt/ChatOptions.tsx +117 -90
- package/src/components/ChatPrompt/ChatReferences.tsx +23 -14
- package/src/components/ChatPrompt/ChatStatusIndicator.tsx +1 -1
- package/src/components/ChatThread/ChatThread.stories.tsx +59 -38
- package/src/components/ChatThread/ChatThread.tsx +41 -38
- package/src/components/ChatThread/Link.tsx +4 -4
- package/src/components/ChatThread/registry.tsx +74 -51
- package/src/components/ChatThread/sync.test.ts +36 -18
- package/src/components/ChatThread/sync.ts +61 -14
- package/src/components/ChatThread/testing/thread.md +37 -0
- package/src/components/ProcessTree/ProcessTree.stories.tsx +109 -0
- package/src/components/ProcessTree/ProcessTree.tsx +85 -0
- package/src/components/ProcessTree/index.ts +5 -0
- package/src/components/TemplateEditor/TemplateEditor.stories.tsx +15 -11
- package/src/components/TemplateEditor/TemplateEditor.tsx +54 -42
- package/src/components/TemplateEditor/TemplateForm.stories.tsx +19 -9
- package/src/components/TemplateEditor/TemplateForm.tsx +83 -37
- 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 +44 -53
- package/src/components/Toolbox/Toolbox.stories.tsx +11 -13
- package/src/components/Toolbox/Toolbox.tsx +69 -65
- package/src/components/Typewriter/AssistantToolbar.tsx +161 -0
- package/src/components/Typewriter/Typewriter.stories.tsx +86 -0
- package/src/components/Typewriter/Typewriter.tsx +50 -0
- package/src/components/Typewriter/assistant-extension.tsx +141 -0
- package/src/components/Typewriter/index.ts +5 -0
- package/src/components/index.ts +3 -8
- package/src/containers/BlueprintArticle/BlueprintArticle.tsx +29 -0
- package/src/containers/BlueprintArticle/index.ts +7 -0
- package/src/containers/ChatCompanion/ChatCompanion.tsx +143 -0
- package/src/containers/ChatCompanion/index.ts +7 -0
- package/src/containers/ChatContainer/ChatContainer.tsx +95 -0
- package/src/containers/ChatContainer/index.ts +7 -0
- package/src/{components → containers/ChatDialog}/ChatDialog.tsx +19 -15
- package/src/containers/ChatDialog/index.ts +7 -0
- package/src/containers/ProjectArticle/ProjectArticle.tsx +127 -0
- package/src/containers/ProjectArticle/index.ts +7 -0
- package/src/containers/ProjectSettings/ProjectSettings.tsx +139 -0
- package/src/containers/ProjectSettings/index.ts +7 -0
- package/src/containers/PromptArticle/PromptArticle.tsx +59 -0
- package/src/containers/PromptArticle/index.ts +7 -0
- package/src/containers/PromptList/PromptList.stories.tsx +130 -0
- package/src/containers/PromptList/PromptList.tsx +49 -0
- package/src/containers/PromptList/index.ts +7 -0
- package/src/containers/TracePanel/TracePanel.tsx +258 -0
- package/src/containers/TracePanel/dxn-extractor.test.ts +153 -0
- package/src/containers/TracePanel/dxn-extractor.ts +178 -0
- package/src/containers/TracePanel/index.ts +9 -0
- package/src/containers/TriggerStatus/TriggerStatus.tsx +144 -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 +111 -0
- package/src/hooks/index.ts +2 -1
- package/src/hooks/useBlueprintRegistry.ts +36 -21
- package/src/hooks/useChatProcessor.ts +32 -23
- package/src/hooks/useChatServices.ts +9 -31
- package/src/hooks/useChatToolbarActions.ts +122 -0
- package/src/hooks/useContextBinder.ts +9 -7
- package/src/hooks/useContextObjects.ts +16 -24
- package/src/hooks/useFilteredTypes.ts +37 -0
- package/src/hooks/usePresets.ts +1 -1
- package/src/hooks/useReferencesProvider.ts +5 -8
- package/src/index.ts +1 -2
- package/src/meta.ts +7 -4
- package/src/operations/create-chat.ts +79 -0
- package/src/operations/definitions.ts +126 -0
- package/src/operations/ensure-companion-chat.ts +59 -0
- package/src/operations/index.ts +17 -0
- package/src/operations/on-create-space.ts +24 -0
- package/src/operations/resolve-navigation-targets.ts +26 -0
- package/src/operations/run-prompt-in-new-chat.ts +114 -0
- package/src/operations/set-current-chat.ts +35 -0
- package/src/operations/update-chat-name.ts +55 -0
- package/src/processor/presets.ts +1 -1
- package/src/processor/processor.test.ts +21 -63
- package/src/processor/processor.ts +168 -139
- package/src/processor/update-name.ts +6 -5
- package/src/queue-logger.ts +8 -9
- package/src/testing/test-generator.ts +14 -13
- package/src/testing/test-sequence.ts +3 -3
- package/src/testing/test-services.ts +9 -7
- package/src/translations.ts +129 -76
- package/src/types/Assistant.ts +8 -57
- package/src/types/Settings.ts +21 -0
- package/src/types/capabilities.ts +35 -0
- package/src/types/events.ts +11 -0
- package/src/types/index.ts +5 -1
- package/src/types/service.ts +14 -11
- package/dist/lib/browser/BlueprintContainer-GMSYKGSO.mjs +0 -36
- package/dist/lib/browser/BlueprintContainer-GMSYKGSO.mjs.map +0 -7
- package/dist/lib/browser/ChatCompanion-M3FDKTQM.mjs +0 -151
- package/dist/lib/browser/ChatCompanion-M3FDKTQM.mjs.map +0 -7
- package/dist/lib/browser/ChatContainer-KAH7XITI.mjs +0 -74
- package/dist/lib/browser/ChatContainer-KAH7XITI.mjs.map +0 -7
- package/dist/lib/browser/ChatDialog-ZWRGABW6.mjs +0 -87
- package/dist/lib/browser/ChatDialog-ZWRGABW6.mjs.map +0 -7
- package/dist/lib/browser/ai-service-ERTZBTP3.mjs +0 -19
- package/dist/lib/browser/ai-service-ERTZBTP3.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-R5T7BJPC.mjs +0 -183
- package/dist/lib/browser/app-graph-builder-R5T7BJPC.mjs.map +0 -7
- package/dist/lib/browser/blueprint-definition-AGTDXTXO.mjs +0 -13
- package/dist/lib/browser/chunk-357IHWQL.mjs +0 -1519
- package/dist/lib/browser/chunk-357IHWQL.mjs.map +0 -7
- package/dist/lib/browser/chunk-A2NVNXPL.mjs +0 -170
- package/dist/lib/browser/chunk-A2NVNXPL.mjs.map +0 -7
- package/dist/lib/browser/chunk-CQW6UPJM.mjs +0 -199
- package/dist/lib/browser/chunk-CQW6UPJM.mjs.map +0 -7
- package/dist/lib/browser/chunk-GNI6HL6G.mjs +0 -219
- package/dist/lib/browser/chunk-GNI6HL6G.mjs.map +0 -7
- package/dist/lib/browser/chunk-GXHZTOWJ.mjs +0 -378
- package/dist/lib/browser/chunk-GXHZTOWJ.mjs.map +0 -7
- package/dist/lib/browser/chunk-L5OA5OGS.mjs +0 -262
- package/dist/lib/browser/chunk-L5OA5OGS.mjs.map +0 -7
- package/dist/lib/browser/chunk-MEN5WTLA.mjs +0 -182
- package/dist/lib/browser/chunk-MEN5WTLA.mjs.map +0 -7
- package/dist/lib/browser/chunk-PUG24BEC.mjs +0 -277
- package/dist/lib/browser/chunk-PUG24BEC.mjs.map +0 -7
- package/dist/lib/browser/chunk-SJJV3HEX.mjs +0 -16
- package/dist/lib/browser/chunk-SJJV3HEX.mjs.map +0 -7
- package/dist/lib/browser/chunk-WBG5PTSX.mjs +0 -23
- package/dist/lib/browser/chunk-WBG5PTSX.mjs.map +0 -7
- package/dist/lib/browser/edge-model-resolver-O6OFYIO2.mjs +0 -18
- package/dist/lib/browser/edge-model-resolver-O6OFYIO2.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-3C5TABOX.mjs +0 -136
- package/dist/lib/browser/intent-resolver-3C5TABOX.mjs.map +0 -7
- package/dist/lib/browser/local-model-resolver-GO6ZEMLL.mjs +0 -17
- package/dist/lib/browser/local-model-resolver-GO6ZEMLL.mjs.map +0 -7
- package/dist/lib/browser/react-surface-EYKA5IFU.mjs +0 -90
- package/dist/lib/browser/react-surface-EYKA5IFU.mjs.map +0 -7
- package/dist/lib/browser/settings-VMVBYZLN.mjs +0 -23
- package/dist/lib/browser/settings-VMVBYZLN.mjs.map +0 -7
- package/dist/lib/browser/state-CFREPBB6.mjs +0 -21
- package/dist/lib/browser/state-CFREPBB6.mjs.map +0 -7
- package/dist/lib/browser/toolkit-F3NQ7TSI.mjs +0 -21
- package/dist/lib/browser/toolkit-F3NQ7TSI.mjs.map +0 -7
- package/dist/lib/node-esm/BlueprintContainer-6GBLMK4Z.mjs +0 -37
- package/dist/lib/node-esm/BlueprintContainer-6GBLMK4Z.mjs.map +0 -7
- package/dist/lib/node-esm/ChatCompanion-OV426GCP.mjs +0 -152
- package/dist/lib/node-esm/ChatCompanion-OV426GCP.mjs.map +0 -7
- package/dist/lib/node-esm/ChatContainer-UKY7NHFY.mjs +0 -75
- package/dist/lib/node-esm/ChatContainer-UKY7NHFY.mjs.map +0 -7
- package/dist/lib/node-esm/ChatDialog-2BDQIEXH.mjs +0 -88
- package/dist/lib/node-esm/ChatDialog-2BDQIEXH.mjs.map +0 -7
- package/dist/lib/node-esm/ai-service-MUYLV3NT.mjs +0 -20
- package/dist/lib/node-esm/ai-service-MUYLV3NT.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-I52RYVWH.mjs +0 -184
- package/dist/lib/node-esm/app-graph-builder-I52RYVWH.mjs.map +0 -7
- package/dist/lib/node-esm/blueprint-definition-CFCUD2VC.mjs +0 -14
- package/dist/lib/node-esm/chunk-2CAETDW2.mjs +0 -183
- package/dist/lib/node-esm/chunk-2CAETDW2.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-4J5FYNNM.mjs +0 -171
- package/dist/lib/node-esm/chunk-4J5FYNNM.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-5ARE4R2I.mjs +0 -220
- package/dist/lib/node-esm/chunk-5ARE4R2I.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-7ZYOYW7F.mjs +0 -264
- package/dist/lib/node-esm/chunk-7ZYOYW7F.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HJPIYMWD.mjs +0 -1520
- package/dist/lib/node-esm/chunk-HJPIYMWD.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-O36P4LN5.mjs +0 -200
- package/dist/lib/node-esm/chunk-O36P4LN5.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-WE6KTH72.mjs +0 -25
- package/dist/lib/node-esm/chunk-WE6KTH72.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-XM4BVQQR.mjs +0 -278
- package/dist/lib/node-esm/chunk-XM4BVQQR.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-XQBL2SBL.mjs +0 -17
- package/dist/lib/node-esm/chunk-XQBL2SBL.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-YIO5MEPR.mjs +0 -380
- package/dist/lib/node-esm/chunk-YIO5MEPR.mjs.map +0 -7
- package/dist/lib/node-esm/edge-model-resolver-2ARXDOYS.mjs +0 -19
- package/dist/lib/node-esm/edge-model-resolver-2ARXDOYS.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-HQ27YALS.mjs +0 -137
- package/dist/lib/node-esm/intent-resolver-HQ27YALS.mjs.map +0 -7
- package/dist/lib/node-esm/local-model-resolver-WOQ2D2R2.mjs +0 -18
- package/dist/lib/node-esm/local-model-resolver-WOQ2D2R2.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-UOC3CBPH.mjs +0 -91
- package/dist/lib/node-esm/react-surface-UOC3CBPH.mjs.map +0 -7
- package/dist/lib/node-esm/settings-7AUVNDM2.mjs +0 -24
- package/dist/lib/node-esm/settings-7AUVNDM2.mjs.map +0 -7
- package/dist/lib/node-esm/state-XXND44OW.mjs +0 -22
- package/dist/lib/node-esm/state-XXND44OW.mjs.map +0 -7
- package/dist/lib/node-esm/toolkit-7CH5UNSQ.mjs +0 -22
- package/dist/lib/node-esm/toolkit-7CH5UNSQ.mjs.map +0 -7
- package/dist/types/src/capabilities/capabilities.d.ts +0 -11
- package/dist/types/src/capabilities/capabilities.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/components/BlueprintContainer.d.ts +0 -8
- package/dist/types/src/components/BlueprintContainer.d.ts.map +0 -1
- package/dist/types/src/components/ChatCompanion.d.ts +0 -13
- package/dist/types/src/components/ChatCompanion.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/ChatThread/reducers.d.ts +0 -40
- package/dist/types/src/components/ChatThread/reducers.d.ts.map +0 -1
- package/dist/types/src/components/ChatToolbar/ChatToolbar.d.ts +0 -6
- package/dist/types/src/components/ChatToolbar/ChatToolbar.d.ts.map +0 -1
- package/dist/types/src/components/ChatToolbar/index.d.ts +0 -2
- package/dist/types/src/components/ChatToolbar/index.d.ts.map +0 -1
- package/dist/types/src/components/ChatToolbar/useChatToolbarActions.d.ts +0 -9
- package/dist/types/src/components/ChatToolbar/useChatToolbarActions.d.ts.map +0 -1
- package/dist/types/src/components/TemplateEditor/handlebars-extension.d.ts.map +0 -1
- package/dist/types/src/events.d.ts +0 -4
- package/dist/types/src/events.d.ts.map +0 -1
- package/dist/types/src/functions/analysis.d.ts +0 -5
- package/dist/types/src/functions/analysis.d.ts.map +0 -1
- package/dist/types/src/functions/index.d.ts +0 -4
- package/dist/types/src/functions/index.d.ts.map +0 -1
- package/dist/types/src/functions/object-list.d.ts +0 -10
- package/dist/types/src/functions/object-list.d.ts.map +0 -1
- package/dist/types/src/functions/object-load.d.ts +0 -8
- package/dist/types/src/functions/object-load.d.ts.map +0 -1
- package/dist/types/src/hooks/useItemTypes.d.ts +0 -4
- package/dist/types/src/hooks/useItemTypes.d.ts.map +0 -1
- package/dist/types/src/toolkits/AssistantToolkit.d.ts +0 -21
- package/dist/types/src/toolkits/AssistantToolkit.d.ts.map +0 -1
- package/dist/types/src/toolkits/SystemToolkit.d.ts +0 -69
- package/dist/types/src/toolkits/SystemToolkit.d.ts.map +0 -1
- package/dist/types/src/toolkits/index.d.ts +0 -3
- package/dist/types/src/toolkits/index.d.ts.map +0 -1
- package/dist/types/src/types/AssistantAction.d.ts +0 -119
- package/dist/types/src/types/AssistantAction.d.ts.map +0 -1
- package/src/capabilities/capabilities.ts +0 -18
- package/src/capabilities/intent-resolver.ts +0 -121
- package/src/components/BlueprintContainer.tsx +0 -30
- package/src/components/ChatCompanion.tsx +0 -136
- package/src/components/ChatContainer.tsx +0 -51
- package/src/components/ChatThread/reducers.ts +0 -151
- package/src/components/ChatToolbar/ChatToolbar.tsx +0 -23
- package/src/components/ChatToolbar/useChatToolbarActions.ts +0 -126
- package/src/components/TemplateEditor/handlebars-extension.ts +0 -166
- package/src/events.ts +0 -11
- package/src/functions/analysis.ts +0 -22
- package/src/functions/index.ts +0 -7
- package/src/functions/object-list.ts +0 -48
- package/src/functions/object-load.ts +0 -45
- package/src/hooks/useItemTypes.ts +0 -37
- package/src/toolkits/AssistantToolkit.ts +0 -55
- package/src/toolkits/SystemToolkit.ts +0 -292
- package/src/toolkits/index.ts +0 -6
- package/src/types/AssistantAction.ts +0 -70
- /package/dist/lib/browser/{blueprint-definition-AGTDXTXO.mjs.map → blueprints/index.mjs.map} +0 -0
- /package/dist/lib/node-esm/{blueprint-definition-CFCUD2VC.mjs.map → blueprints/index.mjs.map} +0 -0
- /package/dist/types/src/components/TemplateEditor/{handlebars-extension.d.ts → extensions/handlebars-extension.d.ts} +0 -0
|
@@ -2,22 +2,14 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import React, {
|
|
6
|
-
type CSSProperties,
|
|
7
|
-
forwardRef,
|
|
8
|
-
useCallback,
|
|
9
|
-
useEffect,
|
|
10
|
-
useImperativeHandle,
|
|
11
|
-
useMemo,
|
|
12
|
-
useState,
|
|
13
|
-
} from 'react';
|
|
5
|
+
import React, { type CSSProperties, forwardRef, useCallback, useEffect, useMemo, useState } from 'react';
|
|
14
6
|
|
|
15
7
|
import { PublicKey } from '@dxos/keys';
|
|
16
8
|
import { type Identity } from '@dxos/react-client/halo';
|
|
17
|
-
import { type ThemedClassName } from '@dxos/react-ui';
|
|
9
|
+
import { type ThemedClassName, useForwardedRef } from '@dxos/react-ui';
|
|
18
10
|
import { MarkdownStream, type MarkdownStreamController, type MarkdownStreamProps } from '@dxos/react-ui-components';
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
11
|
+
import { type Message } from '@dxos/types';
|
|
12
|
+
import { mx } from '@dxos/ui-theme';
|
|
21
13
|
import { keyToFallback } from '@dxos/util';
|
|
22
14
|
|
|
23
15
|
import { type ChatEvent } from '../Chat';
|
|
@@ -25,30 +17,37 @@ import { type ChatEvent } from '../Chat';
|
|
|
25
17
|
import { blockToMarkdown, componentRegistry } from './registry';
|
|
26
18
|
import { MessageSyncer } from './sync';
|
|
27
19
|
|
|
28
|
-
export type ChatThreadController = Pick<MarkdownStreamController, 'setContext' | 'scrollToBottom'>;
|
|
29
|
-
|
|
30
20
|
export type ChatThreadProps = ThemedClassName<
|
|
31
21
|
{
|
|
32
22
|
identity?: Identity;
|
|
33
|
-
messages?:
|
|
23
|
+
messages?: Message.Message[];
|
|
34
24
|
error?: Error;
|
|
35
|
-
overscroll?: number;
|
|
36
25
|
onEvent?: (event: ChatEvent) => void;
|
|
37
|
-
} & Pick<MarkdownStreamProps, 'cursor' | 'fadeIn' | '
|
|
26
|
+
} & Pick<MarkdownStreamProps, 'cursor' | 'fadeIn' | 'debug'>
|
|
38
27
|
>;
|
|
39
28
|
|
|
40
|
-
|
|
29
|
+
// TODO(burdon): Memo thread position.
|
|
30
|
+
export const ChatThread = forwardRef<MarkdownStreamController | null, ChatThreadProps>(
|
|
41
31
|
(
|
|
42
|
-
{ classNames, identity, messages = [], error, cursor = false, fadeIn = true,
|
|
32
|
+
{ classNames, identity, messages = [], error, cursor = false, fadeIn = true, debug = false, onEvent },
|
|
43
33
|
forwardedRef,
|
|
44
34
|
) => {
|
|
45
|
-
const
|
|
46
|
-
return identity?.profile?.data?.hue || keyToFallback(identity?.identityKey ?? PublicKey.random()).hue;
|
|
47
|
-
}, [identity]);
|
|
48
|
-
|
|
49
|
-
// Expose controller.
|
|
35
|
+
const controllerRef = useForwardedRef(forwardedRef);
|
|
50
36
|
const [controller, setController] = useState<MarkdownStreamController | null>(null);
|
|
51
|
-
|
|
37
|
+
|
|
38
|
+
// Callback ref to capture when MarkdownStream is mounted and trigger re-render.
|
|
39
|
+
const refCallback = useCallback(
|
|
40
|
+
(node: MarkdownStreamController | null) => {
|
|
41
|
+
controllerRef.current = node;
|
|
42
|
+
setController(node);
|
|
43
|
+
},
|
|
44
|
+
[controllerRef],
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
const userHue = useMemo(
|
|
48
|
+
() => identity?.profile?.data?.hue || keyToFallback(identity?.identityKey ?? PublicKey.random()).hue,
|
|
49
|
+
[identity],
|
|
50
|
+
);
|
|
52
51
|
|
|
53
52
|
// Show error.
|
|
54
53
|
useEffect(() => {
|
|
@@ -58,19 +57,18 @@ export const ChatThread = forwardRef<ChatThreadController | null, ChatThreadProp
|
|
|
58
57
|
// Update document.
|
|
59
58
|
const syncer = useMemo(() => controller && new MessageSyncer(controller, blockToMarkdown), [controller]);
|
|
60
59
|
useEffect(() => {
|
|
61
|
-
syncer?.
|
|
60
|
+
const reset = syncer?.append(messages, true);
|
|
61
|
+
if (reset) {
|
|
62
|
+
controller?.scrollToBottom('instant');
|
|
63
|
+
}
|
|
62
64
|
}, [syncer, messages]);
|
|
63
65
|
|
|
64
|
-
// Event
|
|
66
|
+
// Event adapter.
|
|
65
67
|
const handleEvent = useCallback<NonNullable<MarkdownStreamProps['onEvent']>>(
|
|
66
|
-
(
|
|
67
|
-
switch (
|
|
68
|
+
({ type, value }) => {
|
|
69
|
+
switch (type) {
|
|
68
70
|
case 'submit': {
|
|
69
|
-
|
|
70
|
-
onEvent?.({
|
|
71
|
-
type: 'submit',
|
|
72
|
-
text: ev.value,
|
|
73
|
-
});
|
|
71
|
+
value && onEvent?.({ type, text: value });
|
|
74
72
|
break;
|
|
75
73
|
}
|
|
76
74
|
}
|
|
@@ -80,15 +78,20 @@ export const ChatThread = forwardRef<ChatThreadController | null, ChatThreadProp
|
|
|
80
78
|
|
|
81
79
|
return (
|
|
82
80
|
<div
|
|
83
|
-
|
|
84
|
-
|
|
81
|
+
role='none'
|
|
82
|
+
className={mx('flex h-full w-full justify-center overflow-hidden', classNames)}
|
|
83
|
+
style={
|
|
84
|
+
{
|
|
85
|
+
'--user-fill': `var(--color-${userHue}-fill)`,
|
|
86
|
+
} as CSSProperties
|
|
87
|
+
}
|
|
85
88
|
>
|
|
86
89
|
<MarkdownStream
|
|
87
|
-
ref={
|
|
90
|
+
ref={refCallback}
|
|
88
91
|
registry={componentRegistry}
|
|
89
92
|
cursor={cursor}
|
|
90
93
|
fadeIn={fadeIn}
|
|
91
|
-
|
|
94
|
+
debug={debug}
|
|
92
95
|
onEvent={handleEvent}
|
|
93
96
|
/>
|
|
94
97
|
</div>
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import React, { useMemo } from 'react';
|
|
6
6
|
|
|
7
7
|
import { type Space } from '@dxos/client/echo';
|
|
8
|
-
import {
|
|
8
|
+
import { Entity } from '@dxos/echo';
|
|
9
9
|
import { type DXN } from '@dxos/keys';
|
|
10
10
|
import { DxAnchor } from '@dxos/lit-ui/react';
|
|
11
11
|
|
|
@@ -15,11 +15,11 @@ export type ObjectLinkProps = {
|
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
export const ObjectLink = ({ space, dxn }: ObjectLinkProps) => {
|
|
18
|
-
const ref = useMemo(() => space.db.
|
|
18
|
+
const ref = useMemo(() => space.db.makeRef(dxn), [space, dxn.toString()]);
|
|
19
19
|
|
|
20
|
-
const title =
|
|
20
|
+
const title = (ref.target && Entity.getLabel(ref.target)) ?? ref.target?.id ?? ref.dxn.toString();
|
|
21
21
|
return (
|
|
22
|
-
<DxAnchor rootclassname='dx-tag--anchor'
|
|
22
|
+
<DxAnchor rootclassname='dx-tag--anchor' dxn={dxn.toString()}>
|
|
23
23
|
{title}
|
|
24
24
|
</DxAnchor>
|
|
25
25
|
);
|
|
@@ -5,17 +5,18 @@
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
7
|
import { log } from '@dxos/log';
|
|
8
|
+
import { TogglePanel } from '@dxos/react-ui-components';
|
|
8
9
|
import {
|
|
9
10
|
PromptWidget,
|
|
11
|
+
ReasoningWidget,
|
|
10
12
|
ReferenceWidget,
|
|
11
13
|
SelectWidget,
|
|
12
14
|
SuggestionWidget,
|
|
13
15
|
SummaryWidget,
|
|
14
|
-
ToggleContainer,
|
|
15
16
|
} from '@dxos/react-ui-components';
|
|
16
|
-
import { type XmlWidgetProps, type XmlWidgetRegistry, getXmlTextChild } from '@dxos/react-ui-editor';
|
|
17
17
|
import { Json } from '@dxos/react-ui-syntax-highlighter';
|
|
18
|
-
import { ContentBlock, type
|
|
18
|
+
import { ContentBlock, type Message } from '@dxos/types';
|
|
19
|
+
import { type XmlWidgetProps, type XmlWidgetRegistry, getXmlTextChild } from '@dxos/ui-editor';
|
|
19
20
|
|
|
20
21
|
import { ToolBlock } from '../ToolBlock';
|
|
21
22
|
|
|
@@ -23,12 +24,21 @@ import { type BlockRenderer, type MessageThreadContext } from './sync';
|
|
|
23
24
|
|
|
24
25
|
const Fallback = ({ _tag, ...props }: XmlWidgetProps<MessageThreadContext>) => {
|
|
25
26
|
return (
|
|
26
|
-
<
|
|
27
|
-
<
|
|
28
|
-
<
|
|
29
|
-
<Json classNames='
|
|
30
|
-
</
|
|
31
|
-
</
|
|
27
|
+
<TogglePanel.Root classNames='rounded-xs'>
|
|
28
|
+
<TogglePanel.Header classNames='bg-group-surface'>{_tag}</TogglePanel.Header>
|
|
29
|
+
<TogglePanel.Content classNames='bg-modal-surface'>
|
|
30
|
+
<Json.Data classNames='p-2! text-sm' data={props} />
|
|
31
|
+
</TogglePanel.Content>
|
|
32
|
+
</TogglePanel.Root>
|
|
33
|
+
);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const Summary = ({ text }: { text: string }) => {
|
|
37
|
+
return (
|
|
38
|
+
<TogglePanel.Root classNames='rounded-sm'>
|
|
39
|
+
<TogglePanel.Header classNames='bg-group-surface'>Conversation summarized</TogglePanel.Header>
|
|
40
|
+
<TogglePanel.Content classNames='bg-modal-surface'>{text}</TogglePanel.Content>
|
|
41
|
+
</TogglePanel.Root>
|
|
32
42
|
);
|
|
33
43
|
};
|
|
34
44
|
|
|
@@ -40,40 +50,47 @@ export const componentRegistry: XmlWidgetRegistry = {
|
|
|
40
50
|
// Widgets
|
|
41
51
|
//
|
|
42
52
|
|
|
43
|
-
|
|
53
|
+
prompt: {
|
|
44
54
|
block: true,
|
|
45
|
-
factory: (
|
|
46
|
-
const text = getXmlTextChild(
|
|
55
|
+
factory: ({ children }) => {
|
|
56
|
+
const text = getXmlTextChild(children);
|
|
47
57
|
return text ? new PromptWidget(text) : null;
|
|
48
58
|
},
|
|
49
59
|
},
|
|
50
|
-
|
|
60
|
+
reasoning: {
|
|
61
|
+
block: true,
|
|
62
|
+
factory: ({ children }) => {
|
|
63
|
+
const text = getXmlTextChild(children);
|
|
64
|
+
return text ? new ReasoningWidget(text) : null;
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
reference: {
|
|
51
68
|
block: false,
|
|
52
|
-
factory: (
|
|
53
|
-
const text = getXmlTextChild(
|
|
54
|
-
return text &&
|
|
69
|
+
factory: ({ children, ref }) => {
|
|
70
|
+
const text = getXmlTextChild(children);
|
|
71
|
+
return text && ref ? new ReferenceWidget(text, ref) : null;
|
|
55
72
|
},
|
|
56
73
|
},
|
|
57
|
-
|
|
74
|
+
select: {
|
|
58
75
|
block: true,
|
|
59
|
-
factory: (
|
|
60
|
-
const options =
|
|
76
|
+
factory: ({ children }) => {
|
|
77
|
+
const options = children
|
|
61
78
|
?.map((option: any) => option._tag === 'option' && getXmlTextChild(option.children))
|
|
62
79
|
.filter(Boolean);
|
|
63
80
|
return options?.length ? new SelectWidget(options) : null;
|
|
64
81
|
},
|
|
65
82
|
},
|
|
66
|
-
|
|
83
|
+
suggestion: {
|
|
67
84
|
block: true,
|
|
68
|
-
factory: (
|
|
69
|
-
const text = getXmlTextChild(
|
|
85
|
+
factory: ({ children }) => {
|
|
86
|
+
const text = getXmlTextChild(children);
|
|
70
87
|
return text ? new SuggestionWidget(text) : null;
|
|
71
88
|
},
|
|
72
89
|
},
|
|
73
|
-
|
|
90
|
+
stats: {
|
|
74
91
|
block: true,
|
|
75
|
-
factory: (
|
|
76
|
-
const text = getXmlTextChild(
|
|
92
|
+
factory: ({ children }) => {
|
|
93
|
+
const text = getXmlTextChild(children);
|
|
77
94
|
return text ? new SummaryWidget(text) : null;
|
|
78
95
|
},
|
|
79
96
|
},
|
|
@@ -82,24 +99,28 @@ export const componentRegistry: XmlWidgetRegistry = {
|
|
|
82
99
|
// React
|
|
83
100
|
//
|
|
84
101
|
|
|
85
|
-
|
|
102
|
+
toolCall: {
|
|
86
103
|
block: true,
|
|
87
104
|
Component: ToolBlock,
|
|
88
105
|
},
|
|
89
|
-
|
|
106
|
+
toolResult: {
|
|
90
107
|
block: true,
|
|
91
108
|
Component: Fallback,
|
|
92
109
|
},
|
|
93
|
-
|
|
110
|
+
toolkit: {
|
|
94
111
|
block: true,
|
|
95
112
|
Component: Fallback,
|
|
96
113
|
},
|
|
114
|
+
summary: {
|
|
115
|
+
block: true,
|
|
116
|
+
Component: Summary,
|
|
117
|
+
},
|
|
97
118
|
|
|
98
119
|
//
|
|
99
120
|
// Fallback
|
|
100
121
|
//
|
|
101
122
|
|
|
102
|
-
|
|
123
|
+
json: {
|
|
103
124
|
block: true,
|
|
104
125
|
Component: Fallback,
|
|
105
126
|
},
|
|
@@ -110,10 +131,10 @@ export const componentRegistry: XmlWidgetRegistry = {
|
|
|
110
131
|
*/
|
|
111
132
|
export const blockToMarkdown: BlockRenderer = (
|
|
112
133
|
context: MessageThreadContext,
|
|
113
|
-
message:
|
|
134
|
+
message: Message.Message,
|
|
114
135
|
block: ContentBlock.Any,
|
|
115
136
|
) => {
|
|
116
|
-
let str =
|
|
137
|
+
let str = blockToMarkdownImpl(context, message, block);
|
|
117
138
|
if (str && !block.pending) {
|
|
118
139
|
return (str += '\n');
|
|
119
140
|
}
|
|
@@ -121,12 +142,12 @@ export const blockToMarkdown: BlockRenderer = (
|
|
|
121
142
|
return str;
|
|
122
143
|
};
|
|
123
144
|
|
|
124
|
-
const
|
|
145
|
+
const blockToMarkdownImpl = (context: MessageThreadContext, message: Message.Message, block: ContentBlock.Any) => {
|
|
125
146
|
log('blockToMarkdown', { block: JSON.stringify(block) });
|
|
126
147
|
switch (block._tag) {
|
|
127
148
|
case 'text': {
|
|
128
149
|
if (message.sender.role === 'user') {
|
|
129
|
-
return
|
|
150
|
+
return `<prompt>${block.text}</prompt>`;
|
|
130
151
|
} else {
|
|
131
152
|
const text = block.text.trim();
|
|
132
153
|
if (text.length > 0) {
|
|
@@ -135,7 +156,10 @@ const _blockToMarkdown = (context: MessageThreadContext, message: DataType.Messa
|
|
|
135
156
|
}
|
|
136
157
|
break;
|
|
137
158
|
}
|
|
138
|
-
|
|
159
|
+
case 'reference': {
|
|
160
|
+
const dxn = block.reference.dxn;
|
|
161
|
+
return `<reference ref="${dxn.toString()}">${context.getObjectLabel(dxn)}</reference>`;
|
|
162
|
+
}
|
|
139
163
|
case 'suggestion': {
|
|
140
164
|
if (block.pending) {
|
|
141
165
|
return;
|
|
@@ -146,38 +170,37 @@ const _blockToMarkdown = (context: MessageThreadContext, message: DataType.Messa
|
|
|
146
170
|
if (block.pending || block.options.length === 0) {
|
|
147
171
|
return;
|
|
148
172
|
}
|
|
149
|
-
|
|
150
173
|
return `<select>${block.options.map((option) => `<option>${option}</option>`).join('')}</select>`;
|
|
151
174
|
}
|
|
152
|
-
|
|
153
|
-
// TODO(burdon): Need label.
|
|
154
|
-
case 'reference': {
|
|
155
|
-
return `<reference ref="${block.reference.dxn.toString()}">Ref</reference>`;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
// case 'toolkit': {
|
|
159
|
-
// return `<toolkit />`;
|
|
160
|
-
// }
|
|
161
|
-
|
|
162
175
|
case 'toolCall': {
|
|
163
|
-
context.updateWidget(block.toolCallId, {
|
|
176
|
+
context.updateWidget<{ blocks: ContentBlock.Any[] }>(block.toolCallId, {
|
|
164
177
|
blocks: [block],
|
|
165
178
|
});
|
|
166
179
|
return `<toolCall id="${block.toolCallId}" />`;
|
|
167
180
|
}
|
|
168
181
|
case 'toolResult': {
|
|
169
|
-
|
|
182
|
+
// TODO(dmaretskyi): the parameter could be undefined, perhaps tool blocks are not arriving in order.
|
|
183
|
+
context.updateWidget<{ blocks: ContentBlock.Any[] }>(block.toolCallId, ({ blocks = [] } = { blocks: [] }) => ({
|
|
170
184
|
blocks: [...blocks, block],
|
|
171
185
|
}));
|
|
172
186
|
break;
|
|
173
187
|
}
|
|
174
|
-
|
|
188
|
+
case 'stats': {
|
|
189
|
+
return `<stats>${ContentBlock.createStatsMessage(block)}</stats>`;
|
|
190
|
+
}
|
|
191
|
+
case 'reasoning': {
|
|
192
|
+
const text = block.reasoningText ?? block.redactedText;
|
|
193
|
+
if (!text) {
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
// TODO(dmaretskyi): The mixed Markdown/XML parser does not support parsing multi-line XML tags.
|
|
197
|
+
return `<reasoning>${text.replace(/\n/g, ' ').trim()}</reasoning>`;
|
|
198
|
+
}
|
|
175
199
|
case 'summary': {
|
|
176
|
-
return `<summary>${
|
|
200
|
+
return `<summary>${block.content}</summary>`;
|
|
177
201
|
}
|
|
178
|
-
|
|
179
|
-
// TODO(burdon): Need stable ID.
|
|
180
202
|
default: {
|
|
203
|
+
// TODO(burdon): Needs stable ID.
|
|
181
204
|
return `<json id="${message.id}">\n${JSON.stringify(block)}\n</json>`;
|
|
182
205
|
}
|
|
183
206
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
// @vitest-environment jsdom
|
|
2
|
+
|
|
1
3
|
//
|
|
2
4
|
// Copyright 2025 DXOS.org
|
|
3
5
|
//
|
|
@@ -6,9 +8,11 @@ import { EditorView } from '@codemirror/view';
|
|
|
6
8
|
import { describe, it } from '@effect/vitest';
|
|
7
9
|
import * as Effect from 'effect/Effect';
|
|
8
10
|
|
|
9
|
-
import {
|
|
11
|
+
import { Obj } from '@dxos/echo';
|
|
12
|
+
import { type Mutable } from '@dxos/echo/internal';
|
|
13
|
+
import { type ContentBlock } from '@dxos/types';
|
|
10
14
|
|
|
11
|
-
import { createMessage } from '
|
|
15
|
+
import { createMessage } from '#testing';
|
|
12
16
|
|
|
13
17
|
import { blockToMarkdown } from './registry';
|
|
14
18
|
import { MessageSyncer, type TextModel } from './sync';
|
|
@@ -16,16 +20,24 @@ import { MessageSyncer, type TextModel } from './sync';
|
|
|
16
20
|
class TestDocument implements TextModel {
|
|
17
21
|
private readonly _view = new EditorView({ extensions: [] });
|
|
18
22
|
|
|
23
|
+
get view() {
|
|
24
|
+
return this._view;
|
|
25
|
+
}
|
|
26
|
+
|
|
19
27
|
get content() {
|
|
20
28
|
return this._view.state.doc.toString();
|
|
21
29
|
}
|
|
22
30
|
|
|
23
31
|
async reset(text: string) {
|
|
24
|
-
this._view.dispatch({
|
|
32
|
+
this._view.dispatch({
|
|
33
|
+
changes: { from: 0, to: this._view.state.doc.length, insert: text },
|
|
34
|
+
});
|
|
25
35
|
}
|
|
26
36
|
|
|
27
37
|
async append(text: string) {
|
|
28
|
-
this._view.dispatch({
|
|
38
|
+
this._view.dispatch({
|
|
39
|
+
changes: { from: this._view.state.doc.length, insert: text },
|
|
40
|
+
});
|
|
29
41
|
}
|
|
30
42
|
|
|
31
43
|
updateWidget(_id: string, _value: any) {}
|
|
@@ -43,12 +55,14 @@ describe('reducers', () => {
|
|
|
43
55
|
createMessage('assistant', [{ _tag: 'text', text: 'Hi there!' }]),
|
|
44
56
|
];
|
|
45
57
|
|
|
46
|
-
syncer.
|
|
47
|
-
expect(doc.content).toEqual(['
|
|
58
|
+
syncer.append(messages);
|
|
59
|
+
expect(doc.content).toEqual(['<prompt>Hello</prompt>', 'Hi there!', ''].join('\n'));
|
|
48
60
|
|
|
49
|
-
messages[1]
|
|
50
|
-
|
|
51
|
-
|
|
61
|
+
Obj.change(messages[1], (obj) => {
|
|
62
|
+
obj.blocks.push({ _tag: 'text', text: 'How can I help?' });
|
|
63
|
+
});
|
|
64
|
+
syncer.append(messages);
|
|
65
|
+
expect(doc.content).toEqual(['<prompt>Hello</prompt>', 'Hi there!', 'How can I help?', ''].join('\n'));
|
|
52
66
|
}),
|
|
53
67
|
);
|
|
54
68
|
|
|
@@ -63,18 +77,22 @@ describe('reducers', () => {
|
|
|
63
77
|
createMessage('assistant', [{ _tag: 'text', text: 'Hi there!', pending: true }]),
|
|
64
78
|
];
|
|
65
79
|
|
|
66
|
-
syncer.
|
|
67
|
-
expect(doc.content).toEqual(['
|
|
80
|
+
syncer.append(messages);
|
|
81
|
+
expect(doc.content).toEqual(['<prompt>Hello</prompt>', 'Hi there!'].join('\n'));
|
|
68
82
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
83
|
+
Obj.change(messages[1], (obj) => {
|
|
84
|
+
const block = obj.blocks[0] as Mutable<ContentBlock.Text>;
|
|
85
|
+
block.text = 'Hi there! How are you?';
|
|
86
|
+
block.pending = false;
|
|
87
|
+
});
|
|
88
|
+
syncer.append(messages);
|
|
73
89
|
|
|
74
|
-
messages[1]
|
|
75
|
-
|
|
90
|
+
Obj.change(messages[1], (obj) => {
|
|
91
|
+
obj.blocks.push({ _tag: 'text', text: 'How can I help?' });
|
|
92
|
+
});
|
|
93
|
+
syncer.append(messages);
|
|
76
94
|
expect(doc.content).toEqual(
|
|
77
|
-
['
|
|
95
|
+
['<prompt>Hello</prompt>', 'Hi there! How are you?', 'How can I help?', ''].join('\n'),
|
|
78
96
|
);
|
|
79
97
|
}),
|
|
80
98
|
);
|
|
@@ -2,15 +2,16 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import { type DXN } from '@dxos/echo';
|
|
5
6
|
import { log } from '@dxos/log';
|
|
6
7
|
import { type MarkdownStreamController } from '@dxos/react-ui-components';
|
|
7
|
-
import { type
|
|
8
|
-
import { type
|
|
8
|
+
import { type ContentBlock, type Message } from '@dxos/types';
|
|
9
|
+
import { type StateDispatch, type XmlWidgetStateManager } from '@dxos/ui-editor';
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* Update document.
|
|
12
13
|
*/
|
|
13
|
-
export type TextModel = Pick<MarkdownStreamController, 'reset' | 'append' | 'updateWidget'>;
|
|
14
|
+
export type TextModel = Pick<MarkdownStreamController, 'view' | 'reset' | 'append' | 'updateWidget'>;
|
|
14
15
|
|
|
15
16
|
/**
|
|
16
17
|
* Thread context passed to renderer.
|
|
@@ -18,9 +19,14 @@ export type TextModel = Pick<MarkdownStreamController, 'reset' | 'append' | 'upd
|
|
|
18
19
|
export class MessageThreadContext implements Pick<MarkdownStreamController, 'updateWidget'> {
|
|
19
20
|
constructor(private readonly _widgetState?: XmlWidgetStateManager) {}
|
|
20
21
|
|
|
21
|
-
updateWidget<T>(id: string, value: T) {
|
|
22
|
+
updateWidget<T>(id: string, value: StateDispatch<T>) {
|
|
22
23
|
this._widgetState?.updateWidget(id, value);
|
|
23
24
|
}
|
|
25
|
+
|
|
26
|
+
// TODO(burdon): Resolve from hypergraph.
|
|
27
|
+
getObjectLabel(_id: DXN) {
|
|
28
|
+
return 'Object';
|
|
29
|
+
}
|
|
24
30
|
}
|
|
25
31
|
|
|
26
32
|
/**
|
|
@@ -28,7 +34,7 @@ export class MessageThreadContext implements Pick<MarkdownStreamController, 'upd
|
|
|
28
34
|
*/
|
|
29
35
|
export type BlockRenderer = (
|
|
30
36
|
context: MessageThreadContext,
|
|
31
|
-
message:
|
|
37
|
+
message: Message.Message,
|
|
32
38
|
block: ContentBlock.Any,
|
|
33
39
|
) => string | undefined;
|
|
34
40
|
|
|
@@ -63,18 +69,59 @@ export class MessageSyncer {
|
|
|
63
69
|
void this._model.reset('');
|
|
64
70
|
}
|
|
65
71
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
72
|
+
/**
|
|
73
|
+
* Syncs messages with the editor.
|
|
74
|
+
*/
|
|
75
|
+
append(messages: Message.Message[], flush = false): boolean {
|
|
76
|
+
// TODO(dmaretskyi): MarkdownStream currently does not support streaming XML tags, so we need to remove pending non-text blocks.
|
|
77
|
+
messages = messages.map((message) => ({
|
|
78
|
+
...message,
|
|
79
|
+
blocks: message.blocks.filter((block) => !block.pending || block._tag === 'text'),
|
|
80
|
+
}));
|
|
81
|
+
|
|
82
|
+
// Check if new set of messages.
|
|
73
83
|
if (this._initialMessageId !== messages[0]?.id) {
|
|
74
84
|
this.reset();
|
|
75
85
|
this._initialMessageId = messages[0]?.id;
|
|
76
86
|
}
|
|
77
87
|
|
|
88
|
+
if (flush && this._model.view?.state.doc.length === 0) {
|
|
89
|
+
const buffer: string[] = [];
|
|
90
|
+
this.process(messages, (content) => {
|
|
91
|
+
buffer.push(content);
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
const content = buffer.join('');
|
|
95
|
+
this._model.view?.dispatch({
|
|
96
|
+
changes: [
|
|
97
|
+
{
|
|
98
|
+
from: 0,
|
|
99
|
+
to: this._model.view?.state.doc.length ?? 0,
|
|
100
|
+
insert: content,
|
|
101
|
+
},
|
|
102
|
+
],
|
|
103
|
+
selection: { anchor: content.length },
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
return true;
|
|
107
|
+
} else {
|
|
108
|
+
this.process(messages, (content) => {
|
|
109
|
+
void this._model.append(content);
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
return false;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
private process(messages: Message.Message[], append: (content: string) => void) {
|
|
117
|
+
// console.log('sync', {
|
|
118
|
+
// doc: this._model.view?.state.doc.length,
|
|
119
|
+
// messages: messages.map((message) => message.blocks.length),
|
|
120
|
+
// currentMessageIndex: this._currentMessageIndex,
|
|
121
|
+
// currentBlockIndex: this._currentBlockIndex,
|
|
122
|
+
// currentBlockContent: this._currentBlockContent,
|
|
123
|
+
// });
|
|
124
|
+
|
|
78
125
|
let i = this._currentMessageIndex;
|
|
79
126
|
for (const message of messages.slice(this._currentMessageIndex)) {
|
|
80
127
|
if (i > this._currentMessageIndex) {
|
|
@@ -94,9 +141,9 @@ export class MessageSyncer {
|
|
|
94
141
|
content = currentBlockContent;
|
|
95
142
|
}
|
|
96
143
|
|
|
97
|
-
|
|
144
|
+
// console.log('append', { message: i, block: j, content });
|
|
98
145
|
this._currentBlockContent = currentBlockContent;
|
|
99
|
-
|
|
146
|
+
append(content);
|
|
100
147
|
}
|
|
101
148
|
|
|
102
149
|
if (block.pending) {
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<prompt>hi</prompt>
|
|
2
|
+
Hi! I'm Kai, your AI assistant powered by DXOS. I see you have a document in your context. Let me take a look at it to see how I can help you.
|
|
3
|
+
<toolCall id="toolu_012MB5XWrQhsyjUBoBCr7jXB" />
|
|
4
|
+
|
|
5
|
+
<summary>OK (1 tool uses · 2.62k tokens · 4.8s)</summary>
|
|
6
|
+
I can see you have a comprehensive welcome document for Composer by DXOS. This document explains what Composer is - an extensible collaborative application with features like documents, diagrams, tables, and sheets.
|
|
7
|
+
|
|
8
|
+
Here are some suggestions based on what's available:
|
|
9
|
+
<suggestion>Create a new document</suggestion>
|
|
10
|
+
<suggestion>Edit the welcome document</suggestion>
|
|
11
|
+
<suggestion>Create a table to organize information</suggestion>
|
|
12
|
+
<suggestion>Create a sketch for diagrams</suggestion>
|
|
13
|
+
<suggestion>Learn about collaboration features</suggestion>
|
|
14
|
+
|
|
15
|
+
Is there something specific you'd like to do with this document or would you like to explore other features of Composer?
|
|
16
|
+
|
|
17
|
+
<summary>OK (3.91k tokens · 7.0s)</summary>
|
|
18
|
+
<prompt>Create a table to organize information</prompt>
|
|
19
|
+
I'll help you create a table to organize information. Let me check what table creation tools are available.
|
|
20
|
+
<toolCall id="toolu_01Gk8ZNGYQEczAjGkbDZ9n1D" />
|
|
21
|
+
<summary>OK (1 tool uses · 3.99k tokens · 3.4s)</summary>
|
|
22
|
+
I need to check what artifact definitions are available for creating tables. Based on the blueprint instructions, I should first query for available artifact definitions to see what table-related tools I can use.
|
|
23
|
+
|
|
24
|
+
However, I notice that the function definitions provided don't include the artifact-related tools mentioned in the blueprint (like `require_artifact_definitions` or table creation tools). The available functions are focused on document operations (open, diff, add-to-context, open-item) and analysis mode.
|
|
25
|
+
|
|
26
|
+
Let me work with what's available. Since I can't directly create a table artifact with the current tools, I can help you create a table structure within a markdown document instead.
|
|
27
|
+
|
|
28
|
+
Would you like me to:
|
|
29
|
+
|
|
30
|
+
1. Create a simple markdown table structure in a new document that you can use to organize your information?
|
|
31
|
+
2. Or would you prefer to use Composer's built-in Tables plugin (as mentioned in the welcome document) by creating one through the Composer interface?
|
|
32
|
+
|
|
33
|
+
What kind of information are you looking to organize? This will help me suggest the best table structure for your needs.
|
|
34
|
+
<toolCall id="toolu_01CQXUsyLw2uoV3k1mPLqFee" />
|
|
35
|
+
|
|
36
|
+
<summary>OK (1 tool uses · 4.28k tokens · 11.1s)</summary>
|
|
37
|
+
<summary>OK (4.30k tokens · 1.6s)</summary>
|