@dxos/plugin-assistant 0.8.3-staging.0fa589b → 0.8.4-main.28f8d3d
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/{TemplateContainer-QQHVOTSI.mjs → BlueprintContainer-H7H4BQ2C.mjs} +11 -10
- package/dist/lib/browser/BlueprintContainer-H7H4BQ2C.mjs.map +7 -0
- package/dist/lib/browser/ChatContainer-OUVSX5V5.mjs +76 -0
- package/dist/lib/browser/ChatContainer-OUVSX5V5.mjs.map +7 -0
- package/dist/lib/browser/ChatDialog-P4FLEOHG.mjs +86 -0
- package/dist/lib/browser/ChatDialog-P4FLEOHG.mjs.map +7 -0
- package/dist/lib/browser/SequenceContainer-627OQ557.mjs +163 -0
- package/dist/lib/browser/SequenceContainer-627OQ557.mjs.map +7 -0
- package/dist/lib/browser/ai-service-7KJ5LXBT.mjs +22 -0
- package/dist/lib/browser/ai-service-7KJ5LXBT.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-builder-E4H5DCOJ.mjs → app-graph-builder-AVHHQ3KV.mjs} +30 -89
- package/dist/lib/browser/app-graph-builder-AVHHQ3KV.mjs.map +7 -0
- package/dist/lib/browser/blueprint-definition-CMGIZAOW.mjs +146 -0
- package/dist/lib/browser/blueprint-definition-CMGIZAOW.mjs.map +7 -0
- package/dist/lib/browser/chunk-BRLHDHOF.mjs +244 -0
- package/dist/lib/browser/chunk-BRLHDHOF.mjs.map +7 -0
- package/dist/lib/browser/chunk-HRLMD35M.mjs +191 -0
- package/dist/lib/browser/chunk-HRLMD35M.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-XOZ7YMO3.mjs → chunk-LKP65RPA.mjs} +2 -2
- package/dist/lib/browser/{chunk-JQFUME3B.mjs → chunk-NZDCKQ6W.mjs} +36 -34
- package/dist/lib/browser/chunk-NZDCKQ6W.mjs.map +7 -0
- package/dist/lib/browser/chunk-QB7OVS6Z.mjs +16 -0
- package/dist/lib/browser/chunk-QB7OVS6Z.mjs.map +7 -0
- package/dist/lib/browser/chunk-VEBVAHNM.mjs +2231 -0
- package/dist/lib/browser/chunk-VEBVAHNM.mjs.map +7 -0
- package/dist/lib/browser/edge-model-resolver-2HB4PCWH.mjs +24 -0
- package/dist/lib/browser/edge-model-resolver-2HB4PCWH.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +141 -128
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/intent-resolver-MVOIEJXZ.mjs +81 -0
- package/dist/lib/browser/intent-resolver-MVOIEJXZ.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-LXCNUSZN.mjs → react-surface-4HXS3YLT.mjs} +66 -62
- package/dist/lib/browser/react-surface-4HXS3YLT.mjs.map +7 -0
- package/dist/lib/browser/{settings-XRHXVWGB.mjs → settings-G2EZXMWT.mjs} +7 -6
- package/dist/lib/browser/settings-G2EZXMWT.mjs.map +7 -0
- package/dist/lib/browser/toolkit-IW4FBLLB.mjs +105 -0
- package/dist/lib/browser/toolkit-IW4FBLLB.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +7 -20
- package/dist/lib/node-esm/{TemplateContainer-SOEWY2ZN.mjs → BlueprintContainer-VH4EE4CM.mjs} +11 -10
- package/dist/lib/node-esm/BlueprintContainer-VH4EE4CM.mjs.map +7 -0
- package/dist/lib/node-esm/ChatContainer-D5FABDNE.mjs +77 -0
- package/dist/lib/node-esm/ChatContainer-D5FABDNE.mjs.map +7 -0
- package/dist/lib/node-esm/ChatDialog-NKWVXHJP.mjs +87 -0
- package/dist/lib/node-esm/ChatDialog-NKWVXHJP.mjs.map +7 -0
- package/dist/lib/node-esm/SequenceContainer-EQ5NP2PG.mjs +164 -0
- package/dist/lib/node-esm/SequenceContainer-EQ5NP2PG.mjs.map +7 -0
- package/dist/lib/node-esm/ai-service-LDD32477.mjs +23 -0
- package/dist/lib/node-esm/ai-service-LDD32477.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-builder-3SY5MBIK.mjs → app-graph-builder-RMOUJMMG.mjs} +30 -89
- package/dist/lib/node-esm/app-graph-builder-RMOUJMMG.mjs.map +7 -0
- package/dist/lib/node-esm/blueprint-definition-AEWYMW6I.mjs +147 -0
- package/dist/lib/node-esm/blueprint-definition-AEWYMW6I.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-3SOC5GOP.mjs +2232 -0
- package/dist/lib/node-esm/chunk-3SOC5GOP.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-F7RXCX5Y.mjs +192 -0
- package/dist/lib/node-esm/chunk-F7RXCX5Y.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-OYN6HLXZ.mjs → chunk-GAWXJ7K5.mjs} +36 -34
- package/dist/lib/node-esm/chunk-GAWXJ7K5.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-BB2TAT4P.mjs → chunk-KOC6ESG7.mjs} +2 -2
- package/dist/lib/node-esm/chunk-RD755HN3.mjs +245 -0
- package/dist/lib/node-esm/chunk-RD755HN3.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-X6AANUHZ.mjs +17 -0
- package/dist/lib/node-esm/chunk-X6AANUHZ.mjs.map +7 -0
- package/dist/lib/node-esm/edge-model-resolver-UDDR2IA6.mjs +25 -0
- package/dist/lib/node-esm/edge-model-resolver-UDDR2IA6.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +141 -128
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/intent-resolver-DTDNCX3C.mjs +82 -0
- package/dist/lib/node-esm/intent-resolver-DTDNCX3C.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-surface-7HA5EDWY.mjs → react-surface-V6JNEZVO.mjs} +66 -62
- package/dist/lib/node-esm/react-surface-V6JNEZVO.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-5IAY6BT4.mjs → settings-AIP5FOJG.mjs} +7 -6
- package/dist/lib/node-esm/settings-AIP5FOJG.mjs.map +7 -0
- package/dist/lib/node-esm/toolkit-2VNUL77B.mjs +106 -0
- package/dist/lib/node-esm/toolkit-2VNUL77B.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +7 -20
- package/dist/types/src/AssistantPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/ai-service.d.ts +5 -0
- package/dist/types/src/capabilities/ai-service.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/blueprint-definition.d.ts +3 -0
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -0
- package/dist/types/src/capabilities/capabilities.d.ts +8 -3
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
- package/dist/types/src/capabilities/edge-model-resolver.d.ts +5 -0
- package/dist/types/src/capabilities/edge-model-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +6 -3
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +2 -2
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/toolkit.d.ts +5 -0
- package/dist/types/src/capabilities/toolkit.d.ts.map +1 -0
- package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts +2 -2
- package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts.map +1 -1
- package/dist/types/src/components/BlueprintContainer.d.ts +5 -6
- package/dist/types/src/components/BlueprintContainer.d.ts.map +1 -1
- package/dist/types/src/components/Chat/Chat.d.ts +45 -0
- package/dist/types/src/components/Chat/Chat.d.ts.map +1 -0
- package/dist/types/src/components/Chat/events.d.ts +30 -0
- package/dist/types/src/components/Chat/events.d.ts.map +1 -0
- package/dist/types/src/components/Chat/index.d.ts +3 -0
- package/dist/types/src/components/Chat/index.d.ts.map +1 -0
- package/dist/types/src/components/ChatContainer.d.ts +8 -7
- package/dist/types/src/components/ChatContainer.d.ts.map +1 -1
- package/dist/types/src/components/ChatDialog.d.ts +8 -0
- package/dist/types/src/components/ChatDialog.d.ts.map +1 -0
- package/dist/types/src/components/ChatPrompt/ChatActions.d.ts +11 -0
- package/dist/types/src/components/ChatPrompt/ChatActions.d.ts.map +1 -0
- package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts +13 -0
- package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts.map +1 -0
- package/dist/types/src/components/ChatPrompt/ChatPresets.d.ts +11 -0
- package/dist/types/src/components/ChatPrompt/ChatPresets.d.ts.map +1 -0
- package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts +11 -0
- package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts.map +1 -0
- package/dist/types/src/components/ChatPrompt/ChatStatusIndicator.d.ts +8 -0
- package/dist/types/src/components/ChatPrompt/ChatStatusIndicator.d.ts.map +1 -0
- package/dist/types/src/components/ChatPrompt/index.d.ts +6 -0
- package/dist/types/src/components/ChatPrompt/index.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/ChatMessage.d.ts +18 -0
- package/dist/types/src/components/ChatThread/ChatMessage.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/ChatThread.d.ts +19 -0
- package/dist/types/src/components/ChatThread/ChatThread.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts +226 -0
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts.map +1 -0
- 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/ToolBlock.d.ts +19 -0
- package/dist/types/src/components/ChatThread/ToolBlock.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/index.d.ts +2 -0
- package/dist/types/src/components/ChatThread/index.d.ts.map +1 -0
- package/dist/types/src/components/{Thread → ChatThread}/reducer.d.ts +4 -4
- package/dist/types/src/components/ChatThread/reducer.d.ts.map +1 -0
- package/dist/types/src/components/PromptSettings.d.ts +2 -2
- package/dist/types/src/components/PromptSettings.d.ts.map +1 -1
- package/dist/types/src/components/SequenceContainer.d.ts +8 -0
- package/dist/types/src/components/SequenceContainer.d.ts.map +1 -0
- package/dist/types/src/components/SequenceEditor/SequenceEditor.d.ts +13 -0
- package/dist/types/src/components/SequenceEditor/SequenceEditor.d.ts.map +1 -0
- package/dist/types/src/components/SequenceEditor/SequenceEditor.stories.d.ts +8 -0
- package/dist/types/src/components/SequenceEditor/SequenceEditor.stories.d.ts.map +1 -0
- package/dist/types/src/components/SequenceEditor/index.d.ts +2 -0
- package/dist/types/src/components/SequenceEditor/index.d.ts.map +1 -0
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts +4 -3
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts +3 -3
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts +5 -4
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts.map +1 -1
- package/dist/types/src/components/Timeline/Timeline.d.ts +24 -0
- package/dist/types/src/components/Timeline/Timeline.d.ts.map +1 -0
- package/dist/types/src/components/Timeline/Timeline.stories.d.ts +9 -0
- package/dist/types/src/components/Timeline/Timeline.stories.d.ts.map +1 -0
- package/dist/types/src/components/Timeline/index.d.ts +2 -0
- package/dist/types/src/components/Timeline/index.d.ts.map +1 -0
- package/dist/types/src/components/Toolbox/Toolbox.d.ts +10 -6
- package/dist/types/src/components/Toolbox/Toolbox.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts +2 -3
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +7 -12
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/events.d.ts +1 -1
- package/dist/types/src/events.d.ts.map +1 -1
- package/dist/types/src/functions/analysis.d.ts +5 -0
- package/dist/types/src/functions/analysis.d.ts.map +1 -0
- package/dist/types/src/functions/index.d.ts +4 -0
- package/dist/types/src/functions/index.d.ts.map +1 -0
- package/dist/types/src/functions/list.d.ts +10 -0
- package/dist/types/src/functions/list.d.ts.map +1 -0
- package/dist/types/src/functions/load.d.ts +8 -0
- package/dist/types/src/functions/load.d.ts.map +1 -0
- package/dist/types/src/hooks/chat-processor.d.ts +72 -0
- package/dist/types/src/hooks/chat-processor.d.ts.map +1 -0
- package/dist/types/src/hooks/errors.d.ts +4 -0
- package/dist/types/src/hooks/errors.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +9 -5
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/presets.d.ts +13 -0
- package/dist/types/src/hooks/presets.d.ts.map +1 -0
- package/dist/types/src/hooks/useBlueprintRegistry.d.ts +21 -0
- package/dist/types/src/hooks/useBlueprintRegistry.d.ts.map +1 -0
- package/dist/types/src/hooks/useChatProcessor.d.ts +16 -11
- package/dist/types/src/hooks/useChatProcessor.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatServices.d.ts +13 -0
- package/dist/types/src/hooks/useChatServices.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 +7 -0
- package/dist/types/src/hooks/useReferencesProvider.d.ts.map +1 -0
- package/dist/types/src/hooks/useResolveRef.d.ts +4 -0
- package/dist/types/src/hooks/useResolveRef.d.ts.map +1 -0
- package/dist/types/src/parser/filter-generator.d.ts.map +1 -1
- package/dist/types/src/parser/index.d.ts +1 -1
- package/dist/types/src/parser/index.d.ts.map +1 -1
- package/dist/types/src/parser/query-parser.d.ts.map +1 -1
- package/dist/types/src/queue-logger.d.ts +5 -5
- package/dist/types/src/queue-logger.d.ts.map +1 -1
- package/dist/types/src/stories/Chat.stories.d.ts +268 -0
- package/dist/types/src/stories/Chat.stories.d.ts.map +1 -0
- package/dist/types/src/stories/components/BlueprintContainer.d.ts +5 -0
- package/dist/types/src/stories/components/BlueprintContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/ChatContainer.d.ts +5 -0
- package/dist/types/src/stories/components/ChatContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/GraphContainer.d.ts +6 -0
- package/dist/types/src/stories/components/GraphContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/LoggingContainer.d.ts +5 -0
- package/dist/types/src/stories/components/LoggingContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/SurfaceContainer.d.ts +8 -0
- package/dist/types/src/stories/components/SurfaceContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/TasksContainer.d.ts +5 -0
- package/dist/types/src/stories/components/TasksContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/index.d.ts +8 -0
- package/dist/types/src/stories/components/index.d.ts.map +1 -0
- package/dist/types/src/stories/components/types.d.ts +7 -0
- package/dist/types/src/stories/components/types.d.ts.map +1 -0
- package/dist/types/src/stories/hooks/index.d.ts +3 -0
- package/dist/types/src/stories/hooks/index.d.ts.map +1 -0
- package/dist/types/src/stories/hooks/useFlush.d.ts +6 -0
- package/dist/types/src/stories/hooks/useFlush.d.ts.map +1 -0
- package/dist/types/src/stories/hooks/useMatcherExtension.d.ts +3 -0
- package/dist/types/src/stories/hooks/useMatcherExtension.d.ts.map +1 -0
- package/dist/types/src/stories/testing/data.d.ts +142 -0
- package/dist/types/src/stories/testing/data.d.ts.map +1 -0
- package/dist/types/src/stories/testing/index.d.ts +3 -0
- package/dist/types/src/stories/testing/index.d.ts.map +1 -0
- package/dist/types/src/stories/testing/testing.d.ts +26 -0
- package/dist/types/src/stories/testing/testing.d.ts.map +1 -0
- 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-functions.d.ts +5 -2
- package/dist/types/src/testing/test-functions.d.ts.map +1 -1
- package/dist/types/src/testing/test-sequence.d.ts +8 -0
- package/dist/types/src/testing/test-sequence.d.ts.map +1 -0
- package/dist/types/src/tools/function.d.ts.map +1 -1
- package/dist/types/src/tools/openapi.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +73 -113
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/{chat.d.ts → Assistant.d.ts} +20 -3
- package/dist/types/src/types/Assistant.d.ts.map +1 -0
- package/dist/types/src/types/AssistantAction.d.ts +90 -0
- package/dist/types/src/types/AssistantAction.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/index.d.ts +3 -3
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/service.d.ts +12 -12
- package/dist/types/src/types/service.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +86 -74
- package/src/AssistantPlugin.tsx +63 -43
- package/src/capabilities/ai-service.ts +28 -0
- package/src/capabilities/app-graph-builder.ts +28 -107
- package/src/capabilities/blueprint-definition.ts +32 -0
- package/src/capabilities/capabilities.ts +12 -5
- package/src/capabilities/edge-model-resolver.ts +29 -0
- package/src/capabilities/index.ts +6 -3
- package/src/capabilities/intent-resolver.ts +40 -12
- package/src/capabilities/react-surface.tsx +54 -46
- package/src/capabilities/settings.ts +3 -3
- package/src/capabilities/toolkit.ts +106 -0
- package/src/components/AssistantSettings/AssistantSettings.tsx +4 -4
- package/src/components/BlueprintContainer.tsx +9 -133
- package/src/components/Chat/Chat.tsx +401 -0
- package/src/components/Chat/events.ts +50 -0
- package/src/components/Chat/index.ts +7 -0
- package/src/components/ChatContainer.tsx +51 -21
- package/src/components/ChatDialog.tsx +68 -0
- package/src/components/ChatPrompt/ChatActions.tsx +71 -0
- package/src/components/ChatPrompt/ChatOptions.tsx +59 -0
- package/src/components/ChatPrompt/ChatPresets.tsx +28 -0
- package/src/components/ChatPrompt/ChatReferences.tsx +55 -0
- package/src/components/ChatPrompt/ChatStatusIndicator.tsx +39 -0
- package/src/components/ChatPrompt/index.ts +9 -0
- package/src/components/ChatThread/ChatMessage.tsx +282 -0
- package/src/components/ChatThread/ChatThread.stories.tsx +260 -0
- package/src/components/ChatThread/ChatThread.tsx +57 -0
- package/src/components/ChatThread/Link.tsx +39 -0
- package/src/components/ChatThread/ToolBlock.tsx +125 -0
- package/src/components/{AmbientDialog → ChatThread}/index.ts +1 -1
- package/src/components/{Thread → ChatThread}/reducer.ts +14 -14
- package/src/components/PromptSettings.tsx +43 -45
- package/src/components/SequenceContainer.tsx +133 -0
- package/src/components/SequenceEditor/SequenceEditor.stories.tsx +33 -0
- package/src/components/{BlueprintEditor/BlueprintEditor.tsx → SequenceEditor/SequenceEditor.tsx} +8 -8
- package/src/components/SequenceEditor/index.ts +5 -0
- package/src/components/TemplateEditor/TemplateEditor.stories.tsx +38 -36
- package/src/components/TemplateEditor/TemplateEditor.tsx +41 -25
- package/src/components/TemplateEditor/TemplateForm.stories.tsx +24 -17
- package/src/components/TemplateEditor/TemplateForm.tsx +51 -57
- package/src/components/Timeline/Timeline.stories.tsx +53 -0
- package/src/components/Timeline/Timeline.tsx +159 -0
- package/src/{experimental/transcription → components/Timeline}/index.ts +2 -0
- package/src/components/Toolbox/Toolbox.stories.tsx +9 -16
- package/src/components/Toolbox/Toolbox.tsx +49 -17
- package/src/components/index.ts +4 -8
- package/src/events.ts +3 -3
- package/src/functions/analysis.ts +20 -0
- package/src/functions/index.ts +7 -0
- package/src/functions/list.ts +42 -0
- package/src/functions/load.ts +43 -0
- package/src/hooks/chat-processor.ts +260 -0
- package/src/hooks/errors.ts +8 -0
- package/src/hooks/index.ts +9 -5
- package/src/hooks/presets.ts +53 -0
- package/src/hooks/useBlueprintRegistry.ts +79 -0
- package/src/hooks/useChatProcessor.ts +81 -0
- package/src/hooks/useChatServices.ts +72 -0
- package/src/hooks/useOnline.ts +10 -0
- package/src/hooks/usePresets.ts +45 -0
- package/src/hooks/{useContextProvider.ts → useReferencesProvider.ts} +22 -20
- package/src/hooks/useResolveRef.ts +33 -0
- package/src/parser/filter-generator.ts +6 -13
- package/src/parser/index.ts +1 -1
- package/src/parser/query-parser.ts +1 -1
- package/src/queue-logger.ts +11 -11
- package/src/stories/Chat.stories.tsx +317 -0
- package/src/stories/components/BlueprintContainer.tsx +34 -0
- package/src/stories/components/ChatContainer.tsx +80 -0
- package/src/stories/components/GraphContainer.tsx +118 -0
- package/src/stories/components/LoggingContainer.tsx +22 -0
- package/src/stories/components/SurfaceContainer.tsx +62 -0
- package/src/stories/components/TasksContainer.tsx +51 -0
- package/src/stories/components/index.ts +12 -0
- package/src/stories/components/types.ts +11 -0
- package/src/stories/hooks/index.ts +6 -0
- package/src/stories/hooks/useFlush.ts +35 -0
- package/src/stories/hooks/useMatcherExtension.ts +45 -0
- package/src/stories/{test-data.ts → testing/data.ts} +10 -8
- package/src/stories/testing/index.ts +6 -0
- package/src/stories/testing/testing.tsx +162 -0
- package/src/testing/index.ts +1 -1
- package/src/testing/test-functions.ts +9 -4
- package/src/testing/test-sequence.ts +51 -0
- package/src/tools/function.ts +4 -1
- package/src/tools/openapi.test.ts +14 -12
- package/src/tools/openapi.ts +4 -1
- package/src/translations.ts +46 -28
- package/src/types/Assistant.ts +59 -0
- package/src/types/AssistantAction.ts +54 -0
- package/src/types/defs.ts +5 -0
- package/src/types/index.ts +4 -3
- package/dist/lib/browser/AssistantDialog-MQOOR364.mjs +0 -47
- package/dist/lib/browser/AssistantDialog-MQOOR364.mjs.map +0 -7
- package/dist/lib/browser/BlueprintContainer-AT5Y7EXG.mjs +0 -321
- package/dist/lib/browser/BlueprintContainer-AT5Y7EXG.mjs.map +0 -7
- package/dist/lib/browser/ChatContainer-C2NEAS3A.mjs +0 -40
- package/dist/lib/browser/ChatContainer-C2NEAS3A.mjs.map +0 -7
- package/dist/lib/browser/TemplateContainer-QQHVOTSI.mjs.map +0 -7
- package/dist/lib/browser/ai-client-MK2ZZII2.mjs +0 -39
- package/dist/lib/browser/ai-client-MK2ZZII2.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-E4H5DCOJ.mjs.map +0 -7
- package/dist/lib/browser/chunk-AAOKC2JN.mjs +0 -208
- package/dist/lib/browser/chunk-AAOKC2JN.mjs.map +0 -7
- package/dist/lib/browser/chunk-BI6AHRNJ.mjs +0 -157
- package/dist/lib/browser/chunk-BI6AHRNJ.mjs.map +0 -7
- package/dist/lib/browser/chunk-JO4W3MF7.mjs +0 -2101
- package/dist/lib/browser/chunk-JO4W3MF7.mjs.map +0 -7
- package/dist/lib/browser/chunk-JQFUME3B.mjs.map +0 -7
- package/dist/lib/browser/chunk-MEGMOFJB.mjs +0 -16
- package/dist/lib/browser/chunk-MEGMOFJB.mjs.map +0 -7
- package/dist/lib/browser/chunk-Q6UZ4F3H.mjs +0 -96
- package/dist/lib/browser/chunk-Q6UZ4F3H.mjs.map +0 -7
- package/dist/lib/browser/chunk-UE3IZ4PN.mjs +0 -15
- package/dist/lib/browser/chunk-UE3IZ4PN.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-3UICTGPM.mjs +0 -43
- package/dist/lib/browser/intent-resolver-3UICTGPM.mjs.map +0 -7
- package/dist/lib/browser/react-surface-LXCNUSZN.mjs.map +0 -7
- package/dist/lib/browser/settings-XRHXVWGB.mjs.map +0 -7
- package/dist/lib/node/AssistantDialog-AN4Z6YUV.cjs +0 -73
- package/dist/lib/node/AssistantDialog-AN4Z6YUV.cjs.map +0 -7
- package/dist/lib/node/BlueprintContainer-NOWLDYCZ.cjs +0 -344
- package/dist/lib/node/BlueprintContainer-NOWLDYCZ.cjs.map +0 -7
- package/dist/lib/node/ChatContainer-VKYBQHUB.cjs +0 -68
- package/dist/lib/node/ChatContainer-VKYBQHUB.cjs.map +0 -7
- package/dist/lib/node/TemplateContainer-JZF2DCCG.cjs +0 -58
- package/dist/lib/node/TemplateContainer-JZF2DCCG.cjs.map +0 -7
- package/dist/lib/node/ai-client-7HNSMUMT.cjs +0 -53
- package/dist/lib/node/ai-client-7HNSMUMT.cjs.map +0 -7
- package/dist/lib/node/app-graph-builder-PPR5B5KU.cjs +0 -235
- package/dist/lib/node/app-graph-builder-PPR5B5KU.cjs.map +0 -7
- package/dist/lib/node/chunk-4EEWTDQK.cjs +0 -117
- package/dist/lib/node/chunk-4EEWTDQK.cjs.map +0 -7
- package/dist/lib/node/chunk-FUAGEO7Q.cjs +0 -52
- package/dist/lib/node/chunk-FUAGEO7Q.cjs.map +0 -7
- package/dist/lib/node/chunk-HRNIUYVQ.cjs +0 -128
- package/dist/lib/node/chunk-HRNIUYVQ.cjs.map +0 -7
- package/dist/lib/node/chunk-IKZBMHSW.cjs +0 -184
- package/dist/lib/node/chunk-IKZBMHSW.cjs.map +0 -7
- package/dist/lib/node/chunk-LMDJEGZ2.cjs +0 -233
- package/dist/lib/node/chunk-LMDJEGZ2.cjs.map +0 -7
- package/dist/lib/node/chunk-NIDICM57.cjs +0 -2080
- package/dist/lib/node/chunk-NIDICM57.cjs.map +0 -7
- package/dist/lib/node/chunk-P74TWGMG.cjs +0 -44
- package/dist/lib/node/chunk-P74TWGMG.cjs.map +0 -7
- package/dist/lib/node/chunk-QGPWY6GW.cjs +0 -34
- package/dist/lib/node/chunk-QGPWY6GW.cjs.map +0 -7
- package/dist/lib/node/index.cjs +0 -289
- package/dist/lib/node/index.cjs.map +0 -7
- package/dist/lib/node/intent-resolver-QSWGTKON.cjs +0 -58
- package/dist/lib/node/intent-resolver-QSWGTKON.cjs.map +0 -7
- package/dist/lib/node/meta.json +0 -1
- package/dist/lib/node/react-surface-D3NBYRZ6.cjs +0 -172
- package/dist/lib/node/react-surface-D3NBYRZ6.cjs.map +0 -7
- package/dist/lib/node/settings-2JXLKYGE.cjs +0 -36
- package/dist/lib/node/settings-2JXLKYGE.cjs.map +0 -7
- package/dist/lib/node/types/index.cjs +0 -54
- package/dist/lib/node/types/index.cjs.map +0 -7
- package/dist/lib/node-esm/AssistantDialog-6WEMLUPU.mjs +0 -48
- package/dist/lib/node-esm/AssistantDialog-6WEMLUPU.mjs.map +0 -7
- package/dist/lib/node-esm/BlueprintContainer-STOJAVML.mjs +0 -322
- package/dist/lib/node-esm/BlueprintContainer-STOJAVML.mjs.map +0 -7
- package/dist/lib/node-esm/ChatContainer-3MVBTUJN.mjs +0 -41
- package/dist/lib/node-esm/ChatContainer-3MVBTUJN.mjs.map +0 -7
- package/dist/lib/node-esm/TemplateContainer-SOEWY2ZN.mjs.map +0 -7
- package/dist/lib/node-esm/ai-client-XGZBJ6BE.mjs +0 -40
- package/dist/lib/node-esm/ai-client-XGZBJ6BE.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-3SY5MBIK.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-34EX6E5Q.mjs +0 -18
- package/dist/lib/node-esm/chunk-34EX6E5Q.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-3UEZLJ2V.mjs +0 -16
- package/dist/lib/node-esm/chunk-3UEZLJ2V.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-CDAILLCU.mjs +0 -98
- package/dist/lib/node-esm/chunk-CDAILLCU.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-J6UXXZGJ.mjs +0 -209
- package/dist/lib/node-esm/chunk-J6UXXZGJ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-OD574YIU.mjs +0 -2102
- package/dist/lib/node-esm/chunk-OD574YIU.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-OYN6HLXZ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-UCOFKNKN.mjs +0 -158
- package/dist/lib/node-esm/chunk-UCOFKNKN.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-E6MXTYAU.mjs +0 -44
- package/dist/lib/node-esm/intent-resolver-E6MXTYAU.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-7HA5EDWY.mjs.map +0 -7
- package/dist/lib/node-esm/settings-5IAY6BT4.mjs.map +0 -7
- package/dist/types/src/capabilities/ai-client.d.ts +0 -5
- package/dist/types/src/capabilities/ai-client.d.ts.map +0 -1
- package/dist/types/src/components/AmbientDialog/AmbientDialog.d.ts +0 -10
- package/dist/types/src/components/AmbientDialog/AmbientDialog.d.ts.map +0 -1
- package/dist/types/src/components/AmbientDialog/AmbientDialog.stories.d.ts +0 -8
- package/dist/types/src/components/AmbientDialog/AmbientDialog.stories.d.ts.map +0 -1
- package/dist/types/src/components/AmbientDialog/index.d.ts +0 -2
- package/dist/types/src/components/AmbientDialog/index.d.ts.map +0 -1
- package/dist/types/src/components/AssistantDialog.d.ts +0 -7
- package/dist/types/src/components/AssistantDialog.d.ts.map +0 -1
- package/dist/types/src/components/BlueprintEditor/BlueprintEditor.d.ts +0 -13
- package/dist/types/src/components/BlueprintEditor/BlueprintEditor.d.ts.map +0 -1
- package/dist/types/src/components/BlueprintEditor/BlueprintEditor.stories.d.ts +0 -8
- package/dist/types/src/components/BlueprintEditor/BlueprintEditor.stories.d.ts.map +0 -1
- package/dist/types/src/components/BlueprintEditor/index.d.ts +0 -2
- package/dist/types/src/components/BlueprintEditor/index.d.ts.map +0 -1
- package/dist/types/src/components/Prompt/Prompt.d.ts +0 -23
- package/dist/types/src/components/Prompt/Prompt.d.ts.map +0 -1
- package/dist/types/src/components/Prompt/Prompt.stories.d.ts +0 -13
- package/dist/types/src/components/Prompt/Prompt.stories.d.ts.map +0 -1
- package/dist/types/src/components/Prompt/PromptBar.d.ts +0 -16
- package/dist/types/src/components/Prompt/PromptBar.d.ts.map +0 -1
- package/dist/types/src/components/Prompt/PromptBar.stories.d.ts +0 -9
- package/dist/types/src/components/Prompt/PromptBar.stories.d.ts.map +0 -1
- package/dist/types/src/components/Prompt/autocomplete.d.ts +0 -25
- package/dist/types/src/components/Prompt/autocomplete.d.ts.map +0 -1
- package/dist/types/src/components/Prompt/index.d.ts +0 -3
- package/dist/types/src/components/Prompt/index.d.ts.map +0 -1
- package/dist/types/src/components/Prompt/references.d.ts +0 -30
- package/dist/types/src/components/Prompt/references.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/components/Thread/Thread.d.ts +0 -28
- package/dist/types/src/components/Thread/Thread.d.ts.map +0 -1
- package/dist/types/src/components/Thread/Thread.stories.d.ts +0 -11
- package/dist/types/src/components/Thread/Thread.stories.d.ts.map +0 -1
- package/dist/types/src/components/Thread/ThreadContainer.d.ts +0 -13
- package/dist/types/src/components/Thread/ThreadContainer.d.ts.map +0 -1
- package/dist/types/src/components/Thread/ThreadContainer.stories.d.ts +0 -16
- package/dist/types/src/components/Thread/ThreadContainer.stories.d.ts.map +0 -1
- package/dist/types/src/components/Thread/ThreadMessage.d.ts +0 -16
- package/dist/types/src/components/Thread/ThreadMessage.d.ts.map +0 -1
- package/dist/types/src/components/Thread/ToolInvocations.d.ts +0 -13
- package/dist/types/src/components/Thread/ToolInvocations.d.ts.map +0 -1
- package/dist/types/src/components/Thread/index.d.ts +0 -3
- package/dist/types/src/components/Thread/index.d.ts.map +0 -1
- package/dist/types/src/components/Thread/reducer.d.ts.map +0 -1
- package/dist/types/src/experimental/transcription/index.d.ts +0 -1
- package/dist/types/src/experimental/transcription/index.d.ts.map +0 -1
- package/dist/types/src/hooks/processor.d.ts +0 -72
- package/dist/types/src/hooks/processor.d.ts.map +0 -1
- package/dist/types/src/hooks/processor.test.d.ts +0 -2
- package/dist/types/src/hooks/processor.test.d.ts.map +0 -1
- package/dist/types/src/hooks/useContextProvider.d.ts +0 -17
- package/dist/types/src/hooks/useContextProvider.d.ts.map +0 -1
- package/dist/types/src/hooks/useMessageQueue.d.ts +0 -42
- package/dist/types/src/hooks/useMessageQueue.d.ts.map +0 -1
- package/dist/types/src/hooks/useServices.d.ts +0 -7
- package/dist/types/src/hooks/useServices.d.ts.map +0 -1
- package/dist/types/src/hooks/useTextInputEvents.d.ts +0 -13
- package/dist/types/src/hooks/useTextInputEvents.d.ts.map +0 -1
- package/dist/types/src/stories/Prompt.stories.d.ts +0 -8
- package/dist/types/src/stories/Prompt.stories.d.ts.map +0 -1
- package/dist/types/src/stories/Query.stories.d.ts +0 -19
- package/dist/types/src/stories/Query.stories.d.ts.map +0 -1
- package/dist/types/src/stories/Research.stories.d.ts +0 -15
- package/dist/types/src/stories/Research.stories.d.ts.map +0 -1
- package/dist/types/src/stories/test-data.d.ts +0 -3
- package/dist/types/src/stories/test-data.d.ts.map +0 -1
- package/dist/types/src/stories/testing.d.ts +0 -12
- package/dist/types/src/stories/testing.d.ts.map +0 -1
- package/dist/types/src/testing/test-blueprint.d.ts +0 -8
- package/dist/types/src/testing/test-blueprint.d.ts.map +0 -1
- package/dist/types/src/types/chat.d.ts.map +0 -1
- package/dist/types/src/types/template.d.ts +0 -56
- package/dist/types/src/types/template.d.ts.map +0 -1
- package/dist/types/src/types/types.d.ts +0 -50
- package/dist/types/src/types/types.d.ts.map +0 -1
- package/src/capabilities/ai-client.ts +0 -42
- package/src/components/AmbientDialog/AmbientDialog.stories.tsx +0 -84
- package/src/components/AmbientDialog/AmbientDialog.tsx +0 -117
- package/src/components/AssistantDialog.tsx +0 -37
- package/src/components/BlueprintEditor/BlueprintEditor.stories.tsx +0 -32
- package/src/components/BlueprintEditor/index.ts +0 -5
- package/src/components/Prompt/Prompt.stories.tsx +0 -121
- package/src/components/Prompt/Prompt.tsx +0 -124
- package/src/components/Prompt/PromptBar.stories.tsx +0 -69
- package/src/components/Prompt/PromptBar.tsx +0 -105
- package/src/components/Prompt/autocomplete.ts +0 -218
- package/src/components/Prompt/index.ts +0 -6
- package/src/components/Prompt/references.ts +0 -180
- package/src/components/TemplateContainer.tsx +0 -23
- package/src/components/Thread/Thread.stories.tsx +0 -201
- package/src/components/Thread/Thread.tsx +0 -118
- package/src/components/Thread/ThreadContainer.stories.tsx +0 -283
- package/src/components/Thread/ThreadContainer.tsx +0 -105
- package/src/components/Thread/ThreadMessage.tsx +0 -234
- package/src/components/Thread/ToolInvocations.tsx +0 -106
- package/src/components/Thread/index.ts +0 -6
- package/src/hooks/processor.test.ts +0 -15
- package/src/hooks/processor.ts +0 -238
- package/src/hooks/useChatProcessor.tsx +0 -97
- package/src/hooks/useMessageQueue.ts +0 -22
- package/src/hooks/useServices.ts +0 -28
- package/src/hooks/useTextInputEvents.ts +0 -49
- package/src/stories/Prompt.stories.tsx +0 -60
- package/src/stories/Query.stories.tsx +0 -514
- package/src/stories/Research.stories.tsx +0 -482
- package/src/stories/testing.ts +0 -60
- package/src/testing/test-blueprint.ts +0 -58
- package/src/types/chat.ts +0 -32
- package/src/types/template.ts +0 -66
- package/src/types/types.ts +0 -48
- /package/dist/lib/browser/{chunk-XOZ7YMO3.mjs.map → chunk-LKP65RPA.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-BB2TAT4P.mjs.map → chunk-KOC6ESG7.mjs.map} +0 -0
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import '@dxos-theme';
|
|
6
|
+
|
|
7
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
|
+
import { Effect, Layer } from 'effect';
|
|
9
|
+
import React, { useEffect, useMemo } from 'react';
|
|
10
|
+
|
|
11
|
+
import { Obj } from '@dxos/echo';
|
|
12
|
+
import { ContextQueueService, DatabaseService } from '@dxos/functions';
|
|
13
|
+
import { faker } from '@dxos/random';
|
|
14
|
+
import { useQueue, useSpace } from '@dxos/react-client/echo';
|
|
15
|
+
import { withClientProvider } from '@dxos/react-client/testing';
|
|
16
|
+
import { type ContentBlock, DataType } from '@dxos/schema';
|
|
17
|
+
import { ColumnContainer, render, withLayout, withTheme } from '@dxos/storybook-utils';
|
|
18
|
+
|
|
19
|
+
import { translations } from '../../translations';
|
|
20
|
+
|
|
21
|
+
import { renderObjectLink } from './ChatMessage';
|
|
22
|
+
import { ChatThread, type ChatThreadProps } from './ChatThread';
|
|
23
|
+
|
|
24
|
+
faker.seed(1);
|
|
25
|
+
|
|
26
|
+
const StoryContainer = ({ delay = 0, ...props }: ChatThreadProps & { delay?: number }) => {
|
|
27
|
+
const space = useSpace();
|
|
28
|
+
const queueDxn = useMemo(() => space?.queues.create().dxn, [space]);
|
|
29
|
+
const queue = useQueue<DataType.Message>(queueDxn);
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
if (!space || !queue) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
void Effect.runPromise(
|
|
36
|
+
Effect.gen(function* () {
|
|
37
|
+
for (const step of MESSAGES) {
|
|
38
|
+
yield* step;
|
|
39
|
+
yield* Effect.sleep(delay);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return queue;
|
|
43
|
+
}).pipe(Effect.provide(Layer.mergeAll(DatabaseService.layer(space.db), ContextQueueService.layer(queue)))),
|
|
44
|
+
);
|
|
45
|
+
}, [space, queue]);
|
|
46
|
+
|
|
47
|
+
if (!space) {
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return (
|
|
52
|
+
<ChatThread {...props} space={space} messages={queue?.objects ?? []} onEvent={(event) => console.log(event)} />
|
|
53
|
+
);
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
const createMessage = (role: DataType.ActorRole, blocks: ContentBlock.Any[]): DataType.Message => {
|
|
57
|
+
return Obj.make(DataType.Message, {
|
|
58
|
+
created: new Date().toISOString(),
|
|
59
|
+
sender: { role },
|
|
60
|
+
blocks,
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
const MESSAGES: Effect.Effect<void, never, DatabaseService | ContextQueueService>[] = [
|
|
65
|
+
Effect.gen(function* () {
|
|
66
|
+
const { queue } = yield* ContextQueueService;
|
|
67
|
+
yield* Effect.promise(() =>
|
|
68
|
+
queue.append([
|
|
69
|
+
createMessage('user', [
|
|
70
|
+
{
|
|
71
|
+
_tag: 'text',
|
|
72
|
+
text: faker.lorem.sentence(5),
|
|
73
|
+
},
|
|
74
|
+
]),
|
|
75
|
+
]),
|
|
76
|
+
);
|
|
77
|
+
}),
|
|
78
|
+
|
|
79
|
+
Effect.gen(function* () {
|
|
80
|
+
const { queue } = yield* ContextQueueService;
|
|
81
|
+
yield* Effect.promise(() =>
|
|
82
|
+
queue.append([
|
|
83
|
+
createMessage('assistant', [
|
|
84
|
+
{
|
|
85
|
+
_tag: 'suggest',
|
|
86
|
+
text: 'Search...',
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
_tag: 'suggest',
|
|
90
|
+
text: faker.lorem.paragraphs(1),
|
|
91
|
+
},
|
|
92
|
+
]),
|
|
93
|
+
createMessage('assistant', [
|
|
94
|
+
{
|
|
95
|
+
_tag: 'text',
|
|
96
|
+
text: 'Select an option:',
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
_tag: 'select',
|
|
100
|
+
options: ['Option 1', 'Option 2', 'Option 3'],
|
|
101
|
+
},
|
|
102
|
+
]),
|
|
103
|
+
]),
|
|
104
|
+
);
|
|
105
|
+
}),
|
|
106
|
+
|
|
107
|
+
Effect.gen(function* () {
|
|
108
|
+
const { queue } = yield* ContextQueueService;
|
|
109
|
+
const { db } = yield* DatabaseService;
|
|
110
|
+
const obj1 = db.add(Obj.make(DataType.Organization, { name: 'DXOS' }));
|
|
111
|
+
const obj2 = db.add(Obj.make(DataType.Person, { fullName: 'Alice' }));
|
|
112
|
+
const obj3 = db.add(Obj.make(DataType.Person, { fullName: 'Bob' }));
|
|
113
|
+
const obj4 = db.add(Obj.make(DataType.Person, { fullName: 'Charlie' }));
|
|
114
|
+
yield* Effect.promise(() =>
|
|
115
|
+
queue.append([
|
|
116
|
+
createMessage('assistant', [
|
|
117
|
+
// Inline tag.
|
|
118
|
+
{
|
|
119
|
+
_tag: 'text',
|
|
120
|
+
text: [faker.lorem.paragraph(), renderObjectLink(obj1), faker.lorem.paragraph()].join(' '),
|
|
121
|
+
},
|
|
122
|
+
// Inline cards.
|
|
123
|
+
...[obj2, obj3, obj4].map(
|
|
124
|
+
(obj) =>
|
|
125
|
+
({
|
|
126
|
+
_tag: 'text',
|
|
127
|
+
text: renderObjectLink(obj),
|
|
128
|
+
}) satisfies ContentBlock.Text,
|
|
129
|
+
),
|
|
130
|
+
]),
|
|
131
|
+
]),
|
|
132
|
+
);
|
|
133
|
+
}),
|
|
134
|
+
|
|
135
|
+
Effect.gen(function* () {
|
|
136
|
+
const { queue } = yield* ContextQueueService;
|
|
137
|
+
yield* Effect.promise(() =>
|
|
138
|
+
queue.append([
|
|
139
|
+
createMessage('assistant', [
|
|
140
|
+
{
|
|
141
|
+
_tag: 'text',
|
|
142
|
+
text: faker.lorem.paragraphs(1),
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
_tag: 'toolkit',
|
|
146
|
+
},
|
|
147
|
+
]),
|
|
148
|
+
]),
|
|
149
|
+
);
|
|
150
|
+
}),
|
|
151
|
+
|
|
152
|
+
Effect.gen(function* () {
|
|
153
|
+
const { queue } = yield* ContextQueueService;
|
|
154
|
+
yield* Effect.promise(() =>
|
|
155
|
+
queue.append([
|
|
156
|
+
createMessage('assistant', [
|
|
157
|
+
{
|
|
158
|
+
_tag: 'text',
|
|
159
|
+
disposition: 'cot',
|
|
160
|
+
text: Array.from({ length: faker.number.int({ min: 3, max: 5 }) })
|
|
161
|
+
.map((_, idx) => `${idx + 1}. ${faker.lorem.paragraph()}`)
|
|
162
|
+
.join('\n'),
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
_tag: 'toolCall',
|
|
166
|
+
toolCallId: '1234',
|
|
167
|
+
name: 'search',
|
|
168
|
+
input: {},
|
|
169
|
+
},
|
|
170
|
+
]),
|
|
171
|
+
createMessage('user', [
|
|
172
|
+
{
|
|
173
|
+
_tag: 'toolResult',
|
|
174
|
+
toolCallId: '1234',
|
|
175
|
+
name: 'search',
|
|
176
|
+
result: 'This is a tool result.',
|
|
177
|
+
},
|
|
178
|
+
]),
|
|
179
|
+
]),
|
|
180
|
+
);
|
|
181
|
+
}),
|
|
182
|
+
|
|
183
|
+
Effect.gen(function* () {
|
|
184
|
+
const { queue } = yield* ContextQueueService;
|
|
185
|
+
yield* Effect.promise(() =>
|
|
186
|
+
queue.append([
|
|
187
|
+
createMessage('assistant', [
|
|
188
|
+
{
|
|
189
|
+
_tag: 'toolCall',
|
|
190
|
+
toolCallId: '4567',
|
|
191
|
+
name: 'create',
|
|
192
|
+
input: {},
|
|
193
|
+
},
|
|
194
|
+
]),
|
|
195
|
+
createMessage('user', [
|
|
196
|
+
{
|
|
197
|
+
_tag: 'toolResult',
|
|
198
|
+
toolCallId: '4567',
|
|
199
|
+
name: 'create',
|
|
200
|
+
result: 'This is a tool result.',
|
|
201
|
+
},
|
|
202
|
+
]),
|
|
203
|
+
createMessage('assistant', [
|
|
204
|
+
{
|
|
205
|
+
_tag: 'text',
|
|
206
|
+
text: Array.from({ length: faker.number.int({ min: 2, max: 3 }) })
|
|
207
|
+
.map(() => faker.lorem.paragraphs())
|
|
208
|
+
.join('\n\n'),
|
|
209
|
+
},
|
|
210
|
+
]),
|
|
211
|
+
]),
|
|
212
|
+
);
|
|
213
|
+
}),
|
|
214
|
+
|
|
215
|
+
Effect.gen(function* () {
|
|
216
|
+
const { queue } = yield* ContextQueueService;
|
|
217
|
+
yield* Effect.promise(() =>
|
|
218
|
+
queue.append([
|
|
219
|
+
createMessage('assistant', [
|
|
220
|
+
{
|
|
221
|
+
_tag: 'text',
|
|
222
|
+
text: faker.lorem.paragraphs(2),
|
|
223
|
+
},
|
|
224
|
+
]),
|
|
225
|
+
]),
|
|
226
|
+
);
|
|
227
|
+
}),
|
|
228
|
+
];
|
|
229
|
+
|
|
230
|
+
const meta = {
|
|
231
|
+
title: 'plugins/plugin-assistant/ChatThread',
|
|
232
|
+
component: ChatThread,
|
|
233
|
+
render: render(StoryContainer),
|
|
234
|
+
decorators: [
|
|
235
|
+
withClientProvider({
|
|
236
|
+
createIdentity: true,
|
|
237
|
+
types: [DataType.Organization, DataType.Person],
|
|
238
|
+
}),
|
|
239
|
+
withTheme,
|
|
240
|
+
withLayout({
|
|
241
|
+
Container: ColumnContainer,
|
|
242
|
+
classNames: 'is-[40rem]',
|
|
243
|
+
}),
|
|
244
|
+
],
|
|
245
|
+
parameters: {
|
|
246
|
+
translations,
|
|
247
|
+
},
|
|
248
|
+
} satisfies Meta<typeof ChatThread>;
|
|
249
|
+
|
|
250
|
+
export default meta;
|
|
251
|
+
|
|
252
|
+
type Story = StoryObj<typeof meta>;
|
|
253
|
+
|
|
254
|
+
export const Default = {} satisfies Story;
|
|
255
|
+
|
|
256
|
+
export const Delayed = {
|
|
257
|
+
args: {
|
|
258
|
+
delay: 2_000,
|
|
259
|
+
},
|
|
260
|
+
} satisfies Story;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { type CSSProperties, forwardRef, useMemo } from 'react';
|
|
6
|
+
|
|
7
|
+
import { PublicKey } from '@dxos/keys';
|
|
8
|
+
import { type Identity } from '@dxos/react-client/halo';
|
|
9
|
+
import { type ThemedClassName } from '@dxos/react-ui';
|
|
10
|
+
import { ScrollContainer, type ScrollController } from '@dxos/react-ui-components';
|
|
11
|
+
import { mx } from '@dxos/react-ui-theme';
|
|
12
|
+
import { type DataType } from '@dxos/schema';
|
|
13
|
+
import { keyToFallback } from '@dxos/util';
|
|
14
|
+
|
|
15
|
+
import { ChatMessage, type ChatMessageProps } from './ChatMessage';
|
|
16
|
+
import { messageReducer } from './reducer';
|
|
17
|
+
|
|
18
|
+
export type ChatThreadProps = ThemedClassName<
|
|
19
|
+
{
|
|
20
|
+
identity?: Identity;
|
|
21
|
+
messages?: DataType.Message[];
|
|
22
|
+
collapse?: boolean;
|
|
23
|
+
} & Pick<ChatMessageProps, 'debug' | 'space' | 'tools' | 'onEvent'>
|
|
24
|
+
>;
|
|
25
|
+
|
|
26
|
+
export const ChatThread = forwardRef<ScrollController, ChatThreadProps>(
|
|
27
|
+
({ classNames, identity, messages, collapse = true, ...props }, forwardedRef) => {
|
|
28
|
+
const userHue = useMemo(() => {
|
|
29
|
+
return identity?.profile?.data?.hue || keyToFallback(identity?.identityKey ?? PublicKey.random()).hue;
|
|
30
|
+
}, [identity]);
|
|
31
|
+
|
|
32
|
+
// TODO(dmaretskyi): This needs to be a separate type: `id` is not a valid ObjectId, this needs to accommodate messageId for deletion.
|
|
33
|
+
const { messages: filteredMessages = [] } = useMemo(() => {
|
|
34
|
+
if (collapse) {
|
|
35
|
+
return (messages ?? []).reduce<{ messages: DataType.Message[]; current?: DataType.Message }>(messageReducer, {
|
|
36
|
+
messages: [],
|
|
37
|
+
});
|
|
38
|
+
} else {
|
|
39
|
+
return { messages: messages ?? [] };
|
|
40
|
+
}
|
|
41
|
+
}, [messages, collapse]);
|
|
42
|
+
|
|
43
|
+
return (
|
|
44
|
+
<ScrollContainer ref={forwardedRef} classNames={classNames} fade>
|
|
45
|
+
<div
|
|
46
|
+
role='none'
|
|
47
|
+
className={mx('flex flex-col gap-2', filteredMessages.length > 0 && 'pbs-4 pbe-4')}
|
|
48
|
+
style={{ '--user-fill': `var(--dx-${userHue}Fill)` } as CSSProperties}
|
|
49
|
+
>
|
|
50
|
+
{filteredMessages.map((message) => (
|
|
51
|
+
<ChatMessage key={message.id} message={message} {...props} />
|
|
52
|
+
))}
|
|
53
|
+
</div>
|
|
54
|
+
</ScrollContainer>
|
|
55
|
+
);
|
|
56
|
+
},
|
|
57
|
+
);
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
import { type Space } from '@dxos/client/echo';
|
|
8
|
+
import { Obj, Ref } from '@dxos/echo';
|
|
9
|
+
import { type DXN } from '@dxos/keys';
|
|
10
|
+
import { mx } from '@dxos/react-ui-theme';
|
|
11
|
+
|
|
12
|
+
import { useResolvedRef } from '../../hooks';
|
|
13
|
+
|
|
14
|
+
export type ObjectLinkProps = {
|
|
15
|
+
space: Space;
|
|
16
|
+
dxn: DXN;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
// TODO(burdon): Factor out.
|
|
20
|
+
export const ObjectLink = ({ space, dxn }: ObjectLinkProps) => {
|
|
21
|
+
const object = useResolvedRef(space, Ref.fromDXN(dxn));
|
|
22
|
+
const title = Obj.getLabel(object) ?? object?.id ?? dxn.toString();
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<a
|
|
26
|
+
// href={dxn.toString()}
|
|
27
|
+
title={title}
|
|
28
|
+
className={mx(
|
|
29
|
+
// TODO(burdon): Use style for tags.
|
|
30
|
+
'inline-flex items-center max-w-[16rem] px-1.5 overflow-hidden',
|
|
31
|
+
'border border-separator rounded whitespace-nowrap text-ellipsis text-primary-500 hover:text-primary-500 hover:border-primary-500 cursor-pointer',
|
|
32
|
+
)}
|
|
33
|
+
target='_blank'
|
|
34
|
+
rel='noopener noreferrer'
|
|
35
|
+
>
|
|
36
|
+
<span className='truncate'>{title}</span>
|
|
37
|
+
</a>
|
|
38
|
+
);
|
|
39
|
+
};
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { type FC, useEffect, useMemo, useRef, useState } from 'react';
|
|
6
|
+
|
|
7
|
+
import { type AgentStatus, type Tool } from '@dxos/ai';
|
|
8
|
+
import { type ThemedClassName, useTranslation } from '@dxos/react-ui';
|
|
9
|
+
import { NumericTabs, StatusRoll, ToggleContainer } from '@dxos/react-ui-components';
|
|
10
|
+
import { type JsonProps, Json as NativeJson } from '@dxos/react-ui-syntax-highlighter';
|
|
11
|
+
import { type DataType } from '@dxos/schema';
|
|
12
|
+
import { isNonNullable, isNotFalsy } from '@dxos/util';
|
|
13
|
+
|
|
14
|
+
import { meta } from '../../meta';
|
|
15
|
+
|
|
16
|
+
export const isToolMessage = (message: DataType.Message) => {
|
|
17
|
+
return message.blocks.some((block) => block._tag === 'toolCall' || block._tag === 'toolResult');
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const getToolName = (tool: Tool) => {
|
|
21
|
+
return tool.namespace && tool.function ? `${tool.namespace}:${tool.function}` : tool.name.split('_').pop();
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export type ToolBlockProps = ThemedClassName<{
|
|
25
|
+
message: DataType.Message;
|
|
26
|
+
tools?: Tool[];
|
|
27
|
+
}>;
|
|
28
|
+
|
|
29
|
+
export const ToolBlock: FC<ToolBlockProps> = ({ classNames, message, tools }) => {
|
|
30
|
+
const { t } = useTranslation(meta.id);
|
|
31
|
+
const { blocks = [] } = message;
|
|
32
|
+
|
|
33
|
+
const getToolCaption = (tool?: Tool, status?: AgentStatus) => {
|
|
34
|
+
if (!tool) {
|
|
35
|
+
return t('calling tool label');
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return status?.message ?? tool.caption ?? [t('calling label') + getToolName(tool)].join(' ');
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
let request: { tool: Tool | undefined; block: any } | undefined;
|
|
42
|
+
const toolBlocks = blocks.filter((block) => block._tag === 'toolCall' || block._tag === 'toolResult');
|
|
43
|
+
const items = toolBlocks
|
|
44
|
+
.map((block) => {
|
|
45
|
+
switch (block._tag) {
|
|
46
|
+
case 'toolCall': {
|
|
47
|
+
// TODO(burdon): Skip these updates?
|
|
48
|
+
if (block.pending && request?.block.toolCallId === block.toolCallId) {
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
request = { tool: tools?.find((tool) => tool.name === block.name), block };
|
|
53
|
+
return {
|
|
54
|
+
title: getToolCaption(request.tool, request.block.status),
|
|
55
|
+
block,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
case 'toolResult': {
|
|
60
|
+
if (!request || block.error) {
|
|
61
|
+
return {
|
|
62
|
+
title: t('error label'),
|
|
63
|
+
block,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return {
|
|
68
|
+
title: getToolCaption(request.tool, request.block.status),
|
|
69
|
+
block,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
default: {
|
|
74
|
+
request = undefined;
|
|
75
|
+
return {
|
|
76
|
+
title: t('error label'),
|
|
77
|
+
block,
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
})
|
|
82
|
+
.filter(isNonNullable);
|
|
83
|
+
|
|
84
|
+
return <ToolContainer classNames={classNames} items={items} />;
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
export const ToolContainer: FC<ThemedClassName<{ items: { title: string; block: any }[] }>> = ({
|
|
88
|
+
classNames,
|
|
89
|
+
items,
|
|
90
|
+
}) => {
|
|
91
|
+
const tabsRef = useRef<HTMLDivElement>(null);
|
|
92
|
+
const [selected, setSelected] = useState(0);
|
|
93
|
+
const [open, setOpen] = useState(false);
|
|
94
|
+
useEffect(() => {
|
|
95
|
+
if (open) {
|
|
96
|
+
tabsRef.current?.focus();
|
|
97
|
+
}
|
|
98
|
+
}, [open]);
|
|
99
|
+
|
|
100
|
+
const handleSelect = (index: number) => {
|
|
101
|
+
if (index === selected) {
|
|
102
|
+
setOpen(false);
|
|
103
|
+
} else {
|
|
104
|
+
setSelected(index);
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
const title = useMemo(() => {
|
|
109
|
+
const lines = items.map((item) => item.title).filter(isNotFalsy);
|
|
110
|
+
return <StatusRoll key='status-roll' lines={lines} duration={1_000} autoAdvance />;
|
|
111
|
+
}, [items]);
|
|
112
|
+
|
|
113
|
+
return (
|
|
114
|
+
<ToggleContainer classNames={['flex flex-col', classNames]} title={title} open={open} onChangeOpen={setOpen}>
|
|
115
|
+
<div className='w-full grid grid-cols-[32px_1fr]'>
|
|
116
|
+
<NumericTabs ref={tabsRef} length={items.length} selected={selected} onSelect={handleSelect} />
|
|
117
|
+
<Json data={items[selected].block} />
|
|
118
|
+
</div>
|
|
119
|
+
</ToggleContainer>
|
|
120
|
+
);
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
export const Json = ({ data }: Pick<JsonProps, 'data'>) => (
|
|
124
|
+
<NativeJson data={data} classNames='!p-1 text-xs bg-transparent' />
|
|
125
|
+
);
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { type
|
|
5
|
+
import { type DataType } from '@dxos/schema';
|
|
6
6
|
|
|
7
7
|
// TODO(burdon): Move to util?
|
|
8
8
|
type Reducer<R, I> = (acc: R, value: I) => R;
|
|
@@ -11,24 +11,24 @@ type Reducer<R, I> = (acc: R, value: I) => R;
|
|
|
11
11
|
* Reducer that collapses related message blocks into single messages.
|
|
12
12
|
* For example, combines tool request/response pairs into a single message.
|
|
13
13
|
*/
|
|
14
|
-
export const messageReducer: Reducer<{ messages: Message[]; current?: Message }, Message> = (
|
|
14
|
+
export const messageReducer: Reducer<{ messages: DataType.Message[]; current?: DataType.Message }, DataType.Message> = (
|
|
15
15
|
{ current, messages },
|
|
16
16
|
message,
|
|
17
17
|
) => {
|
|
18
18
|
let i = 0;
|
|
19
|
-
for (const block of message.
|
|
20
|
-
switch (block.
|
|
21
|
-
case '
|
|
22
|
-
case '
|
|
19
|
+
for (const block of message.blocks) {
|
|
20
|
+
switch (block._tag) {
|
|
21
|
+
case 'toolCall':
|
|
22
|
+
case 'toolResult': {
|
|
23
23
|
if (current) {
|
|
24
|
-
current.
|
|
24
|
+
current.blocks.push(block);
|
|
25
25
|
} else {
|
|
26
26
|
current = {
|
|
27
|
+
...message,
|
|
27
28
|
id: [message.id, i].join('_'),
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
messages.push(current as any);
|
|
29
|
+
blocks: [block],
|
|
30
|
+
};
|
|
31
|
+
messages.push(current);
|
|
32
32
|
}
|
|
33
33
|
break;
|
|
34
34
|
}
|
|
@@ -37,10 +37,10 @@ export const messageReducer: Reducer<{ messages: Message[]; current?: Message },
|
|
|
37
37
|
default: {
|
|
38
38
|
current = undefined;
|
|
39
39
|
messages.push({
|
|
40
|
+
...message,
|
|
40
41
|
id: [message.id, i].join('_'),
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
} as any);
|
|
42
|
+
blocks: [block],
|
|
43
|
+
});
|
|
44
44
|
break;
|
|
45
45
|
}
|
|
46
46
|
}
|
|
@@ -2,63 +2,61 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
6
|
-
import React, { type ChangeEvent, useCallback } from 'react';
|
|
5
|
+
import React from 'react';
|
|
7
6
|
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
7
|
+
import { type Template } from '@dxos/blueprints';
|
|
8
|
+
import { Toolbar, useTranslation } from '@dxos/react-ui';
|
|
10
9
|
|
|
11
|
-
import {
|
|
12
|
-
import { TemplateKinds, type TemplateType, type TemplateKindSchema } from '../types';
|
|
10
|
+
import { meta } from '../meta';
|
|
13
11
|
|
|
14
|
-
export const PromptSettings = ({ template }: { template:
|
|
15
|
-
const { t } = useTranslation(
|
|
12
|
+
export const PromptSettings = ({ template }: { template: Template.Template }) => {
|
|
13
|
+
const { t } = useTranslation(meta.id);
|
|
16
14
|
|
|
17
|
-
const handleKindChange = useCallback(
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
15
|
+
// const handleKindChange = useCallback(
|
|
16
|
+
// (value: string) => {
|
|
17
|
+
// const kind = Match.type<string>().pipe(
|
|
18
|
+
// Match.withReturnType<Schema.Schema.Type<typeof Template.Template>>(),
|
|
19
|
+
// Match.when('always', () => ({ include: 'always' })),
|
|
20
|
+
// Match.when('schema-matching', () => ({ include: 'schema-matching', typename: '' })),
|
|
21
|
+
// Match.when('automatically', () => ({ include: 'automatically', description: '' })),
|
|
22
|
+
// Match.orElse(() => ({ include: 'manual' })),
|
|
23
|
+
// )(value);
|
|
24
|
+
//
|
|
25
|
+
// template.kind = kind;
|
|
26
|
+
// },
|
|
27
|
+
// [template],
|
|
28
|
+
// );
|
|
26
29
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
template.kind.typename = event.target.value;
|
|
36
|
-
}
|
|
37
|
-
}, 300),
|
|
38
|
-
[template.kind.include],
|
|
39
|
-
);
|
|
30
|
+
// const handleTypenameChange = useCallback(
|
|
31
|
+
// debounce((event: ChangeEvent<HTMLInputElement>) => {
|
|
32
|
+
// if (template.kind.include === 'schema-matching') {
|
|
33
|
+
// template.kind.typename = event.target.value;
|
|
34
|
+
// }
|
|
35
|
+
// }, 300),
|
|
36
|
+
// [template.kind.include],
|
|
37
|
+
// );
|
|
40
38
|
|
|
41
|
-
const handleDescriptionChange = useCallback(
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
);
|
|
39
|
+
// const handleDescriptionChange = useCallback(
|
|
40
|
+
// debounce((event: ChangeEvent<HTMLInputElement>) => {
|
|
41
|
+
// if (template.kind.include === 'automatically') {
|
|
42
|
+
// template.kind.description = event.target.value;
|
|
43
|
+
// }
|
|
44
|
+
// }, 300),
|
|
45
|
+
// [template.kind.include],
|
|
46
|
+
// );
|
|
49
47
|
|
|
50
48
|
return (
|
|
51
49
|
<div className='flex flex-col gap-4'>
|
|
52
50
|
<h2>{t('prompt rules label')}</h2>
|
|
53
51
|
<Toolbar.Root>
|
|
54
|
-
<Select.Root value={template.kind.include} onValueChange={handleKindChange}>
|
|
52
|
+
{/* <Select.Root value={template.kind.include} onValueChange={handleKindChange}>
|
|
55
53
|
<Toolbar.Button asChild>
|
|
56
54
|
<Select.TriggerButton />
|
|
57
55
|
</Toolbar.Button>
|
|
58
56
|
<Select.Portal>
|
|
59
57
|
<Select.Content>
|
|
60
58
|
<Select.Viewport>
|
|
61
|
-
{
|
|
59
|
+
{Template.Kinds.map((kind) => (
|
|
62
60
|
<Select.Option key={kind} value={kind}>
|
|
63
61
|
{kind}
|
|
64
62
|
</Select.Option>
|
|
@@ -66,8 +64,8 @@ export const PromptSettings = ({ template }: { template: TemplateType }) => {
|
|
|
66
64
|
</Select.Viewport>
|
|
67
65
|
</Select.Content>
|
|
68
66
|
</Select.Portal>
|
|
69
|
-
</Select.Root>
|
|
70
|
-
{template.kind.include === 'schema-matching' && (
|
|
67
|
+
</Select.Root> */}
|
|
68
|
+
{/* {template.kind.include === 'schema-matching' && (
|
|
71
69
|
<Input.Root>
|
|
72
70
|
<Input.TextInput
|
|
73
71
|
placeholder={t('typename placeholder')}
|
|
@@ -75,8 +73,8 @@ export const PromptSettings = ({ template }: { template: TemplateType }) => {
|
|
|
75
73
|
onChange={handleTypenameChange}
|
|
76
74
|
/>
|
|
77
75
|
</Input.Root>
|
|
78
|
-
)}
|
|
79
|
-
{template.kind.include === 'automatically' && (
|
|
76
|
+
)} */}
|
|
77
|
+
{/* {template.kind.include === 'automatically' && (
|
|
80
78
|
<Input.Root>
|
|
81
79
|
<Input.TextInput
|
|
82
80
|
placeholder={t('description placeholder')}
|
|
@@ -84,7 +82,7 @@ export const PromptSettings = ({ template }: { template: TemplateType }) => {
|
|
|
84
82
|
onChange={handleDescriptionChange}
|
|
85
83
|
/>
|
|
86
84
|
</Input.Root>
|
|
87
|
-
)}
|
|
85
|
+
)} */}
|
|
88
86
|
</Toolbar.Root>
|
|
89
87
|
</div>
|
|
90
88
|
);
|