@jini-ai/chat 0.1.0
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/LICENSE +201 -0
- package/README.md +109 -0
- package/dist/core/agentic/chat-capabilities.d.ts +19 -0
- package/dist/core/agentic/chat-capabilities.d.ts.map +1 -0
- package/dist/core/agentic/chat-capabilities.js +106 -0
- package/dist/core/agentic/chat-capabilities.js.map +1 -0
- package/dist/core/agentic/index.d.ts +22 -0
- package/dist/core/agentic/index.d.ts.map +1 -0
- package/dist/core/agentic/index.js +21 -0
- package/dist/core/agentic/index.js.map +1 -0
- package/dist/core/events.d.ts +84 -0
- package/dist/core/events.d.ts.map +1 -0
- package/dist/core/events.js +14 -0
- package/dist/core/events.js.map +1 -0
- package/dist/core/index.d.ts +40 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +40 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/messages.d.ts +53 -0
- package/dist/core/messages.d.ts.map +1 -0
- package/dist/core/messages.js +16 -0
- package/dist/core/messages.js.map +1 -0
- package/dist/core/partial-json.d.ts +36 -0
- package/dist/core/partial-json.d.ts.map +1 -0
- package/dist/core/partial-json.js +119 -0
- package/dist/core/partial-json.js.map +1 -0
- package/dist/core/persistence/index.d.ts +11 -0
- package/dist/core/persistence/index.d.ts.map +1 -0
- package/dist/core/persistence/index.js +11 -0
- package/dist/core/persistence/index.js.map +1 -0
- package/dist/core/persistence/ports.d.ts +124 -0
- package/dist/core/persistence/ports.d.ts.map +1 -0
- package/dist/core/persistence/ports.js +2 -0
- package/dist/core/persistence/ports.js.map +1 -0
- package/dist/core/persistence/title.d.ts +35 -0
- package/dist/core/persistence/title.d.ts.map +1 -0
- package/dist/core/persistence/title.js +137 -0
- package/dist/core/persistence/title.js.map +1 -0
- package/dist/core/question-form/format.d.ts +27 -0
- package/dist/core/question-form/format.d.ts.map +1 -0
- package/dist/core/question-form/format.js +45 -0
- package/dist/core/question-form/format.js.map +1 -0
- package/dist/core/question-form/normalize.d.ts +30 -0
- package/dist/core/question-form/normalize.d.ts.map +1 -0
- package/dist/core/question-form/normalize.js +192 -0
- package/dist/core/question-form/normalize.js.map +1 -0
- package/dist/core/question-form/scan.d.ts +50 -0
- package/dist/core/question-form/scan.d.ts.map +1 -0
- package/dist/core/question-form/scan.js +404 -0
- package/dist/core/question-form/scan.js.map +1 -0
- package/dist/core/question-form/types.d.ts +83 -0
- package/dist/core/question-form/types.d.ts.map +1 -0
- package/dist/core/question-form/types.js +11 -0
- package/dist/core/question-form/types.js.map +1 -0
- package/dist/core/question-form.d.ts +39 -0
- package/dist/core/question-form.d.ts.map +1 -0
- package/dist/core/question-form.js +4 -0
- package/dist/core/question-form.js.map +1 -0
- package/dist/core/todos.d.ts +70 -0
- package/dist/core/todos.d.ts.map +1 -0
- package/dist/core/todos.js +175 -0
- package/dist/core/todos.js.map +1 -0
- package/dist/core/tool-events.d.ts +18 -0
- package/dist/core/tool-events.d.ts.map +1 -0
- package/dist/core/tool-events.js +36 -0
- package/dist/core/tool-events.js.map +1 -0
- package/dist/core/tools.d.ts +51 -0
- package/dist/core/tools.d.ts.map +1 -0
- package/dist/core/tools.js +41 -0
- package/dist/core/tools.js.map +1 -0
- package/dist/core/transcript.d.ts +81 -0
- package/dist/core/transcript.d.ts.map +1 -0
- package/dist/core/transcript.js +133 -0
- package/dist/core/transcript.js.map +1 -0
- package/dist/core/transport.d.ts +109 -0
- package/dist/core/transport.d.ts.map +1 -0
- package/dist/core/transport.js +2 -0
- package/dist/core/transport.js.map +1 -0
- package/dist/core/util/index.d.ts +16 -0
- package/dist/core/util/index.d.ts.map +1 -0
- package/dist/core/util/index.js +16 -0
- package/dist/core/util/index.js.map +1 -0
- package/dist/core/util/manifest.d.ts +39 -0
- package/dist/core/util/manifest.d.ts.map +1 -0
- package/dist/core/util/manifest.js +173 -0
- package/dist/core/util/manifest.js.map +1 -0
- package/dist/core/util/markdown-context.d.ts +47 -0
- package/dist/core/util/markdown-context.d.ts.map +1 -0
- package/dist/core/util/markdown-context.js +125 -0
- package/dist/core/util/markdown-context.js.map +1 -0
- package/dist/core/util/markup-attributes.d.ts +20 -0
- package/dist/core/util/markup-attributes.d.ts.map +1 -0
- package/dist/core/util/markup-attributes.js +33 -0
- package/dist/core/util/markup-attributes.js.map +1 -0
- package/dist/core/util/parser.d.ts +42 -0
- package/dist/core/util/parser.d.ts.map +1 -0
- package/dist/core/util/parser.js +238 -0
- package/dist/core/util/parser.js.map +1 -0
- package/dist/core/util/pointer.d.ts +28 -0
- package/dist/core/util/pointer.d.ts.map +1 -0
- package/dist/core/util/pointer.js +75 -0
- package/dist/core/util/pointer.js.map +1 -0
- package/dist/core/util/recover.d.ts +40 -0
- package/dist/core/util/recover.d.ts.map +1 -0
- package/dist/core/util/recover.js +117 -0
- package/dist/core/util/recover.js.map +1 -0
- package/dist/core/util/strip.d.ts +112 -0
- package/dist/core/util/strip.d.ts.map +1 -0
- package/dist/core/util/strip.js +333 -0
- package/dist/core/util/strip.js.map +1 -0
- package/dist/core/util/types.d.ts +31 -0
- package/dist/core/util/types.d.ts.map +1 -0
- package/dist/core/util/types.js +2 -0
- package/dist/core/util/types.js.map +1 -0
- package/dist/core/util/validate.d.ts +50 -0
- package/dist/core/util/validate.d.ts.map +1 -0
- package/dist/core/util/validate.js +202 -0
- package/dist/core/util/validate.js.map +1 -0
- package/dist/react/agent-bridge/frontend-session-bridge.d.ts +45 -0
- package/dist/react/agent-bridge/frontend-session-bridge.d.ts.map +1 -0
- package/dist/react/agent-bridge/frontend-session-bridge.js +214 -0
- package/dist/react/agent-bridge/frontend-session-bridge.js.map +1 -0
- package/dist/react/artifact-types.d.ts +61 -0
- package/dist/react/artifact-types.d.ts.map +1 -0
- package/dist/react/artifact-types.js +33 -0
- package/dist/react/artifact-types.js.map +1 -0
- package/dist/react/chat-pane.d.ts +21 -0
- package/dist/react/chat-pane.d.ts.map +1 -0
- package/dist/react/chat-pane.js +20 -0
- package/dist/react/chat-pane.js.map +1 -0
- package/dist/react/components/A2uiSurfaceCard.d.ts +35 -0
- package/dist/react/components/A2uiSurfaceCard.d.ts.map +1 -0
- package/dist/react/components/A2uiSurfaceCard.js +272 -0
- package/dist/react/components/A2uiSurfaceCard.js.map +1 -0
- package/dist/react/components/AttachmentTray.d.ts +6 -0
- package/dist/react/components/AttachmentTray.d.ts.map +1 -0
- package/dist/react/components/AttachmentTray.js +30 -0
- package/dist/react/components/AttachmentTray.js.map +1 -0
- package/dist/react/components/ChatFab.d.ts +8 -0
- package/dist/react/components/ChatFab.d.ts.map +1 -0
- package/dist/react/components/ChatFab.js +24 -0
- package/dist/react/components/ChatFab.js.map +1 -0
- package/dist/react/components/Composer.d.ts +34 -0
- package/dist/react/components/Composer.d.ts.map +1 -0
- package/dist/react/components/Composer.js +300 -0
- package/dist/react/components/Composer.js.map +1 -0
- package/dist/react/components/ComposerDiscovery.d.ts +46 -0
- package/dist/react/components/ComposerDiscovery.d.ts.map +1 -0
- package/dist/react/components/ComposerDiscovery.js +38 -0
- package/dist/react/components/ComposerDiscovery.js.map +1 -0
- package/dist/react/components/ConversationList.d.ts +31 -0
- package/dist/react/components/ConversationList.d.ts.map +1 -0
- package/dist/react/components/ConversationList.js +221 -0
- package/dist/react/components/ConversationList.js.map +1 -0
- package/dist/react/components/ExtEventErrorBoundary.d.ts +35 -0
- package/dist/react/components/ExtEventErrorBoundary.d.ts.map +1 -0
- package/dist/react/components/ExtEventErrorBoundary.js +38 -0
- package/dist/react/components/ExtEventErrorBoundary.js.map +1 -0
- package/dist/react/components/Icon.d.ts +17 -0
- package/dist/react/components/Icon.d.ts.map +1 -0
- package/dist/react/components/Icon.js +46 -0
- package/dist/react/components/Icon.js.map +1 -0
- package/dist/react/components/JiniChatProvider.d.ts +45 -0
- package/dist/react/components/JiniChatProvider.d.ts.map +1 -0
- package/dist/react/components/JiniChatProvider.js +44 -0
- package/dist/react/components/JiniChatProvider.js.map +1 -0
- package/dist/react/components/Markdown.d.ts +5 -0
- package/dist/react/components/Markdown.d.ts.map +1 -0
- package/dist/react/components/Markdown.js +390 -0
- package/dist/react/components/Markdown.js.map +1 -0
- package/dist/react/components/McpUiSurfaceCard.d.ts +51 -0
- package/dist/react/components/McpUiSurfaceCard.d.ts.map +1 -0
- package/dist/react/components/McpUiSurfaceCard.js +159 -0
- package/dist/react/components/McpUiSurfaceCard.js.map +1 -0
- package/dist/react/components/MessageList.d.ts +15 -0
- package/dist/react/components/MessageList.d.ts.map +1 -0
- package/dist/react/components/MessageList.js +81 -0
- package/dist/react/components/MessageList.js.map +1 -0
- package/dist/react/components/MessageRow.d.ts +60 -0
- package/dist/react/components/MessageRow.d.ts.map +1 -0
- package/dist/react/components/MessageRow.js +156 -0
- package/dist/react/components/MessageRow.js.map +1 -0
- package/dist/react/components/NextStepActions.d.ts +34 -0
- package/dist/react/components/NextStepActions.d.ts.map +1 -0
- package/dist/react/components/NextStepActions.js +9 -0
- package/dist/react/components/NextStepActions.js.map +1 -0
- package/dist/react/components/QuestionForm.d.ts +26 -0
- package/dist/react/components/QuestionForm.d.ts.map +1 -0
- package/dist/react/components/QuestionForm.js +238 -0
- package/dist/react/components/QuestionForm.js.map +1 -0
- package/dist/react/components/QuestionsPanel.d.ts +13 -0
- package/dist/react/components/QuestionsPanel.d.ts.map +1 -0
- package/dist/react/components/QuestionsPanel.js +33 -0
- package/dist/react/components/QuestionsPanel.js.map +1 -0
- package/dist/react/components/TodoCard.d.ts +8 -0
- package/dist/react/components/TodoCard.d.ts.map +1 -0
- package/dist/react/components/TodoCard.js +29 -0
- package/dist/react/components/TodoCard.js.map +1 -0
- package/dist/react/components/ToolCard.d.ts +22 -0
- package/dist/react/components/ToolCard.d.ts.map +1 -0
- package/dist/react/components/ToolCard.js +298 -0
- package/dist/react/components/ToolCard.js.map +1 -0
- package/dist/react/components/composer-discovery.d.ts +107 -0
- package/dist/react/components/composer-discovery.d.ts.map +1 -0
- package/dist/react/components/composer-discovery.js +176 -0
- package/dist/react/components/composer-discovery.js.map +1 -0
- package/dist/react/ext-event-renderer-registry.d.ts +51 -0
- package/dist/react/ext-event-renderer-registry.d.ts.map +1 -0
- package/dist/react/ext-event-renderer-registry.js +20 -0
- package/dist/react/ext-event-renderer-registry.js.map +1 -0
- package/dist/react/features/chat-pane/agent-tools.d.ts +14 -0
- package/dist/react/features/chat-pane/agent-tools.d.ts.map +1 -0
- package/dist/react/features/chat-pane/agent-tools.js +22 -0
- package/dist/react/features/chat-pane/agent-tools.js.map +1 -0
- package/dist/react/features/chat-pane/components/AgentRuntimePicker.d.ts +12 -0
- package/dist/react/features/chat-pane/components/AgentRuntimePicker.d.ts.map +1 -0
- package/dist/react/features/chat-pane/components/AgentRuntimePicker.js +106 -0
- package/dist/react/features/chat-pane/components/AgentRuntimePicker.js.map +1 -0
- package/dist/react/features/chat-pane/components/ChatPane.d.ts +10 -0
- package/dist/react/features/chat-pane/components/ChatPane.d.ts.map +1 -0
- package/dist/react/features/chat-pane/components/ChatPane.js +169 -0
- package/dist/react/features/chat-pane/components/ChatPane.js.map +1 -0
- package/dist/react/features/chat-pane/create-daemon-attachment-uploader.d.ts +21 -0
- package/dist/react/features/chat-pane/create-daemon-attachment-uploader.d.ts.map +1 -0
- package/dist/react/features/chat-pane/create-daemon-attachment-uploader.js +213 -0
- package/dist/react/features/chat-pane/create-daemon-attachment-uploader.js.map +1 -0
- package/dist/react/features/chat-pane/create-mcp-ui-tool-caller.d.ts +70 -0
- package/dist/react/features/chat-pane/create-mcp-ui-tool-caller.d.ts.map +1 -0
- package/dist/react/features/chat-pane/create-mcp-ui-tool-caller.js +76 -0
- package/dist/react/features/chat-pane/create-mcp-ui-tool-caller.js.map +1 -0
- package/dist/react/features/chat-pane/hooks/useAgentRuntimePicker.hooks.d.ts +133 -0
- package/dist/react/features/chat-pane/hooks/useAgentRuntimePicker.hooks.d.ts.map +1 -0
- package/dist/react/features/chat-pane/hooks/useAgentRuntimePicker.hooks.js +258 -0
- package/dist/react/features/chat-pane/hooks/useAgentRuntimePicker.hooks.js.map +1 -0
- package/dist/react/features/chat-pane/hooks/useChatPane.hooks.d.ts +66 -0
- package/dist/react/features/chat-pane/hooks/useChatPane.hooks.d.ts.map +1 -0
- package/dist/react/features/chat-pane/hooks/useChatPane.hooks.js +224 -0
- package/dist/react/features/chat-pane/hooks/useChatPane.hooks.js.map +1 -0
- package/dist/react/features/chat-pane/hooks/useChatPaneAgentControl.hooks.d.ts +38 -0
- package/dist/react/features/chat-pane/hooks/useChatPaneAgentControl.hooks.d.ts.map +1 -0
- package/dist/react/features/chat-pane/hooks/useChatPaneAgentControl.hooks.js +252 -0
- package/dist/react/features/chat-pane/hooks/useChatPaneAgentControl.hooks.js.map +1 -0
- package/dist/react/features/chat-pane/hooks/useChatPaneControlsHeight.hooks.d.ts +16 -0
- package/dist/react/features/chat-pane/hooks/useChatPaneControlsHeight.hooks.d.ts.map +1 -0
- package/dist/react/features/chat-pane/hooks/useChatPaneControlsHeight.hooks.js +59 -0
- package/dist/react/features/chat-pane/hooks/useChatPaneControlsHeight.hooks.js.map +1 -0
- package/dist/react/features/chat-pane/hooks/useChatPaneFileDrop.hooks.d.ts +26 -0
- package/dist/react/features/chat-pane/hooks/useChatPaneFileDrop.hooks.d.ts.map +1 -0
- package/dist/react/features/chat-pane/hooks/useChatPaneFileDrop.hooks.js +74 -0
- package/dist/react/features/chat-pane/hooks/useChatPaneFileDrop.hooks.js.map +1 -0
- package/dist/react/features/chat-pane/hooks/useChatPaneRuntimeInventory.hooks.d.ts +25 -0
- package/dist/react/features/chat-pane/hooks/useChatPaneRuntimeInventory.hooks.d.ts.map +1 -0
- package/dist/react/features/chat-pane/hooks/useChatPaneRuntimeInventory.hooks.js +88 -0
- package/dist/react/features/chat-pane/hooks/useChatPaneRuntimeInventory.hooks.js.map +1 -0
- package/dist/react/features/chat-pane/hooks/useChatPaneWorkingDirectory.hooks.d.ts +38 -0
- package/dist/react/features/chat-pane/hooks/useChatPaneWorkingDirectory.hooks.d.ts.map +1 -0
- package/dist/react/features/chat-pane/hooks/useChatPaneWorkingDirectory.hooks.js +184 -0
- package/dist/react/features/chat-pane/hooks/useChatPaneWorkingDirectory.hooks.js.map +1 -0
- package/dist/react/features/chat-pane/index.d.ts +12 -0
- package/dist/react/features/chat-pane/index.d.ts.map +1 -0
- package/dist/react/features/chat-pane/index.js +11 -0
- package/dist/react/features/chat-pane/index.js.map +1 -0
- package/dist/react/features/chat-pane/react/components/AgentRuntimePicker.d.ts +12 -0
- package/dist/react/features/chat-pane/react/components/AgentRuntimePicker.d.ts.map +1 -0
- package/dist/react/features/chat-pane/react/components/AgentRuntimePicker.js +102 -0
- package/dist/react/features/chat-pane/react/components/AgentRuntimePicker.js.map +1 -0
- package/dist/react/features/chat-pane/react/components/ChatPane.d.ts +10 -0
- package/dist/react/features/chat-pane/react/components/ChatPane.d.ts.map +1 -0
- package/dist/react/features/chat-pane/react/components/ChatPane.js +137 -0
- package/dist/react/features/chat-pane/react/components/ChatPane.js.map +1 -0
- package/dist/react/features/chat-pane/react/hooks/useAgentRuntimePicker.hooks.d.ts +133 -0
- package/dist/react/features/chat-pane/react/hooks/useAgentRuntimePicker.hooks.d.ts.map +1 -0
- package/dist/react/features/chat-pane/react/hooks/useAgentRuntimePicker.hooks.js +258 -0
- package/dist/react/features/chat-pane/react/hooks/useAgentRuntimePicker.hooks.js.map +1 -0
- package/dist/react/features/chat-pane/react/hooks/useChatPane.hooks.d.ts +66 -0
- package/dist/react/features/chat-pane/react/hooks/useChatPane.hooks.d.ts.map +1 -0
- package/dist/react/features/chat-pane/react/hooks/useChatPane.hooks.js +223 -0
- package/dist/react/features/chat-pane/react/hooks/useChatPane.hooks.js.map +1 -0
- package/dist/react/features/chat-pane/react/hooks/useChatPaneAgentControl.hooks.d.ts +38 -0
- package/dist/react/features/chat-pane/react/hooks/useChatPaneAgentControl.hooks.d.ts.map +1 -0
- package/dist/react/features/chat-pane/react/hooks/useChatPaneAgentControl.hooks.js +252 -0
- package/dist/react/features/chat-pane/react/hooks/useChatPaneAgentControl.hooks.js.map +1 -0
- package/dist/react/features/chat-pane/react/hooks/useChatPaneFileDrop.hooks.d.ts +26 -0
- package/dist/react/features/chat-pane/react/hooks/useChatPaneFileDrop.hooks.d.ts.map +1 -0
- package/dist/react/features/chat-pane/react/hooks/useChatPaneFileDrop.hooks.js +60 -0
- package/dist/react/features/chat-pane/react/hooks/useChatPaneFileDrop.hooks.js.map +1 -0
- package/dist/react/features/chat-pane/react/hooks/useChatPaneRuntimeInventory.hooks.d.ts +25 -0
- package/dist/react/features/chat-pane/react/hooks/useChatPaneRuntimeInventory.hooks.d.ts.map +1 -0
- package/dist/react/features/chat-pane/react/hooks/useChatPaneRuntimeInventory.hooks.js +83 -0
- package/dist/react/features/chat-pane/react/hooks/useChatPaneRuntimeInventory.hooks.js.map +1 -0
- package/dist/react/features/chat-pane/react/hooks/useChatPaneWorkingDirectory.hooks.d.ts +38 -0
- package/dist/react/features/chat-pane/react/hooks/useChatPaneWorkingDirectory.hooks.d.ts.map +1 -0
- package/dist/react/features/chat-pane/react/hooks/useChatPaneWorkingDirectory.hooks.js +184 -0
- package/dist/react/features/chat-pane/react/hooks/useChatPaneWorkingDirectory.hooks.js.map +1 -0
- package/dist/react/features/chat-pane/react/styles.d.ts +2 -0
- package/dist/react/features/chat-pane/react/styles.d.ts.map +1 -0
- package/dist/react/features/chat-pane/react/styles.js +863 -0
- package/dist/react/features/chat-pane/react/styles.js.map +1 -0
- package/dist/react/features/chat-pane/rules.d.ts +31 -0
- package/dist/react/features/chat-pane/rules.d.ts.map +1 -0
- package/dist/react/features/chat-pane/rules.js +81 -0
- package/dist/react/features/chat-pane/rules.js.map +1 -0
- package/dist/react/features/chat-pane/styles.d.ts +2 -0
- package/dist/react/features/chat-pane/styles.d.ts.map +1 -0
- package/dist/react/features/chat-pane/styles.js +1327 -0
- package/dist/react/features/chat-pane/styles.js.map +1 -0
- package/dist/react/features/chat-pane/types.d.ts +248 -0
- package/dist/react/features/chat-pane/types.d.ts.map +1 -0
- package/dist/react/features/chat-pane/types.js +2 -0
- package/dist/react/features/chat-pane/types.js.map +1 -0
- package/dist/react/features/model-picker/components/CredentialStatusBadge.d.ts +7 -0
- package/dist/react/features/model-picker/components/CredentialStatusBadge.d.ts.map +1 -0
- package/dist/react/features/model-picker/components/CredentialStatusBadge.js +20 -0
- package/dist/react/features/model-picker/components/CredentialStatusBadge.js.map +1 -0
- package/dist/react/features/model-picker/components/ModelPicker.d.ts +9 -0
- package/dist/react/features/model-picker/components/ModelPicker.d.ts.map +1 -0
- package/dist/react/features/model-picker/components/ModelPicker.js +34 -0
- package/dist/react/features/model-picker/components/ModelPicker.js.map +1 -0
- package/dist/react/features/model-picker/constants.d.ts +6 -0
- package/dist/react/features/model-picker/constants.d.ts.map +1 -0
- package/dist/react/features/model-picker/constants.js +9 -0
- package/dist/react/features/model-picker/constants.js.map +1 -0
- package/dist/react/features/model-picker/dependencies.d.ts +11 -0
- package/dist/react/features/model-picker/dependencies.d.ts.map +1 -0
- package/dist/react/features/model-picker/dependencies.js +10 -0
- package/dist/react/features/model-picker/dependencies.js.map +1 -0
- package/dist/react/features/model-picker/hooks/useModelPicker.hooks.d.ts +27 -0
- package/dist/react/features/model-picker/hooks/useModelPicker.hooks.d.ts.map +1 -0
- package/dist/react/features/model-picker/hooks/useModelPicker.hooks.js +62 -0
- package/dist/react/features/model-picker/hooks/useModelPicker.hooks.js.map +1 -0
- package/dist/react/features/model-picker/index.d.ts +32 -0
- package/dist/react/features/model-picker/index.d.ts.map +1 -0
- package/dist/react/features/model-picker/index.js +29 -0
- package/dist/react/features/model-picker/index.js.map +1 -0
- package/dist/react/features/model-picker/ports.d.ts +11 -0
- package/dist/react/features/model-picker/ports.d.ts.map +1 -0
- package/dist/react/features/model-picker/ports.js +2 -0
- package/dist/react/features/model-picker/ports.js.map +1 -0
- package/dist/react/features/model-picker/react/components/CredentialStatusBadge.d.ts +7 -0
- package/dist/react/features/model-picker/react/components/CredentialStatusBadge.d.ts.map +1 -0
- package/dist/react/features/model-picker/react/components/CredentialStatusBadge.js +20 -0
- package/dist/react/features/model-picker/react/components/CredentialStatusBadge.js.map +1 -0
- package/dist/react/features/model-picker/react/components/ModelPicker.d.ts +9 -0
- package/dist/react/features/model-picker/react/components/ModelPicker.d.ts.map +1 -0
- package/dist/react/features/model-picker/react/components/ModelPicker.js +34 -0
- package/dist/react/features/model-picker/react/components/ModelPicker.js.map +1 -0
- package/dist/react/features/model-picker/react/hooks/useModelPicker.hooks.d.ts +27 -0
- package/dist/react/features/model-picker/react/hooks/useModelPicker.hooks.d.ts.map +1 -0
- package/dist/react/features/model-picker/react/hooks/useModelPicker.hooks.js +62 -0
- package/dist/react/features/model-picker/react/hooks/useModelPicker.hooks.js.map +1 -0
- package/dist/react/features/model-picker/rules.d.ts +26 -0
- package/dist/react/features/model-picker/rules.d.ts.map +1 -0
- package/dist/react/features/model-picker/rules.js +84 -0
- package/dist/react/features/model-picker/rules.js.map +1 -0
- package/dist/react/features/model-picker/types.d.ts +38 -0
- package/dist/react/features/model-picker/types.d.ts.map +1 -0
- package/dist/react/features/model-picker/types.js +2 -0
- package/dist/react/features/model-picker/types.js.map +1 -0
- package/dist/react/hooks/composer-draft-cache.d.ts +65 -0
- package/dist/react/hooks/composer-draft-cache.d.ts.map +1 -0
- package/dist/react/hooks/composer-draft-cache.js +89 -0
- package/dist/react/hooks/composer-draft-cache.js.map +1 -0
- package/dist/react/hooks/context.d.ts +18 -0
- package/dist/react/hooks/context.d.ts.map +1 -0
- package/dist/react/hooks/context.js +60 -0
- package/dist/react/hooks/context.js.map +1 -0
- package/dist/react/hooks/testing/fake-transport.d.ts +34 -0
- package/dist/react/hooks/testing/fake-transport.d.ts.map +1 -0
- package/dist/react/hooks/testing/fake-transport.js +46 -0
- package/dist/react/hooks/testing/fake-transport.js.map +1 -0
- package/dist/react/hooks/useArtifactStream.d.ts +18 -0
- package/dist/react/hooks/useArtifactStream.d.ts.map +1 -0
- package/dist/react/hooks/useArtifactStream.js +55 -0
- package/dist/react/hooks/useArtifactStream.js.map +1 -0
- package/dist/react/hooks/useChatFabDrag.d.ts +25 -0
- package/dist/react/hooks/useChatFabDrag.d.ts.map +1 -0
- package/dist/react/hooks/useChatFabDrag.js +88 -0
- package/dist/react/hooks/useChatFabDrag.js.map +1 -0
- package/dist/react/hooks/useComposer.d.ts +48 -0
- package/dist/react/hooks/useComposer.d.ts.map +1 -0
- package/dist/react/hooks/useComposer.js +121 -0
- package/dist/react/hooks/useComposer.js.map +1 -0
- package/dist/react/hooks/useConversation.d.ts +34 -0
- package/dist/react/hooks/useConversation.d.ts.map +1 -0
- package/dist/react/hooks/useConversation.js +163 -0
- package/dist/react/hooks/useConversation.js.map +1 -0
- package/dist/react/hooks/useCopyToClipboard.d.ts +14 -0
- package/dist/react/hooks/useCopyToClipboard.d.ts.map +1 -0
- package/dist/react/hooks/useCopyToClipboard.js +98 -0
- package/dist/react/hooks/useCopyToClipboard.js.map +1 -0
- package/dist/react/hooks/useExtEventGroups.d.ts +7 -0
- package/dist/react/hooks/useExtEventGroups.d.ts.map +1 -0
- package/dist/react/hooks/useExtEventGroups.js +32 -0
- package/dist/react/hooks/useExtEventGroups.js.map +1 -0
- package/dist/react/hooks/useLatestOperation.d.ts +31 -0
- package/dist/react/hooks/useLatestOperation.d.ts.map +1 -0
- package/dist/react/hooks/useLatestOperation.js +74 -0
- package/dist/react/hooks/useLatestOperation.js.map +1 -0
- package/dist/react/hooks/usePinnedTodos.d.ts +15 -0
- package/dist/react/hooks/usePinnedTodos.d.ts.map +1 -0
- package/dist/react/hooks/usePinnedTodos.js +43 -0
- package/dist/react/hooks/usePinnedTodos.js.map +1 -0
- package/dist/react/hooks/useQuestionForms.d.ts +28 -0
- package/dist/react/hooks/useQuestionForms.d.ts.map +1 -0
- package/dist/react/hooks/useQuestionForms.js +113 -0
- package/dist/react/hooks/useQuestionForms.js.map +1 -0
- package/dist/react/hooks/useRunStream.d.ts +27 -0
- package/dist/react/hooks/useRunStream.d.ts.map +1 -0
- package/dist/react/hooks/useRunStream.js +180 -0
- package/dist/react/hooks/useRunStream.js.map +1 -0
- package/dist/react/hooks/useToolTimeline.d.ts +33 -0
- package/dist/react/hooks/useToolTimeline.d.ts.map +1 -0
- package/dist/react/hooks/useToolTimeline.js +47 -0
- package/dist/react/hooks/useToolTimeline.js.map +1 -0
- package/dist/react/index.d.ts +158 -0
- package/dist/react/index.d.ts.map +1 -0
- package/dist/react/index.js +118 -0
- package/dist/react/index.js.map +1 -0
- package/dist/react/message-blocks.d.ts +86 -0
- package/dist/react/message-blocks.d.ts.map +1 -0
- package/dist/react/message-blocks.js +78 -0
- package/dist/react/message-blocks.js.map +1 -0
- package/dist/react/poc-mcp-ui-official/PocMcpUiCard.d.ts +9 -0
- package/dist/react/poc-mcp-ui-official/PocMcpUiCard.d.ts.map +1 -0
- package/dist/react/poc-mcp-ui-official/PocMcpUiCard.js +29 -0
- package/dist/react/poc-mcp-ui-official/PocMcpUiCard.js.map +1 -0
- package/dist/react/poc-mcp-ui-official/create-poc-resource.d.ts +30 -0
- package/dist/react/poc-mcp-ui-official/create-poc-resource.d.ts.map +1 -0
- package/dist/react/poc-mcp-ui-official/create-poc-resource.js +44 -0
- package/dist/react/poc-mcp-ui-official/create-poc-resource.js.map +1 -0
- package/dist/react/slots.d.ts +215 -0
- package/dist/react/slots.d.ts.map +1 -0
- package/dist/react/slots.js +2 -0
- package/dist/react/slots.js.map +1 -0
- package/dist/react/styles/reference.css +298 -0
- package/dist/react/tool-renderer-registry.d.ts +41 -0
- package/dist/react/tool-renderer-registry.d.ts.map +1 -0
- package/dist/react/tool-renderer-registry.js +22 -0
- package/dist/react/tool-renderer-registry.js.map +1 -0
- package/dist/react/util/defined-props.d.ts +31 -0
- package/dist/react/util/defined-props.d.ts.map +1 -0
- package/dist/react/util/defined-props.js +28 -0
- package/dist/react/util/defined-props.js.map +1 -0
- package/package.json +99 -0
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* @module Composer
|
|
4
|
+
*
|
|
5
|
+
* The dumb, presentational half of the composer: takes a `useComposer()`
|
|
6
|
+
* controller (headless state) plus a few UI-only props and renders the
|
|
7
|
+
* textarea/attachment-tray/send-button chrome. Slot extraction points
|
|
8
|
+
* (`ComposerPlusItem[]`, `leadingAccessories`, `footerAccessories`, the mention popover) are
|
|
9
|
+
* generalized from OD's `ChatComposer.tsx` decomposition
|
|
10
|
+
* (`ComposerPlusMenu`/`LibraryPicker`/`SessionModeToggle`-equivalent) per
|
|
11
|
+
* `ADS-memory/reports/jini-port/recon/r4b-webui-design.md` §2/§3 — this component renders
|
|
12
|
+
* the slots a host supplies; it does not itself know what a "library
|
|
13
|
+
* picker" or "session mode" is.
|
|
14
|
+
*/
|
|
15
|
+
import { useEffect, useLayoutEffect, useRef, useState, } from 'react';
|
|
16
|
+
import { RemixIcon } from '@jini-ai/ui';
|
|
17
|
+
import { useT } from '../hooks/context.js';
|
|
18
|
+
import { AttachmentTray } from './AttachmentTray.js';
|
|
19
|
+
import { ComposerDiscoveryMenu, ComposerSlashMenu } from './ComposerDiscovery.js';
|
|
20
|
+
import { appendComposerDiscovery, composerDiscoveryMenuPosition, composerSlashMenuPosition, filterComposerDiscovery, parseComposerSlashQuery, replaceComposerSlashTrigger, resolveComposerSlashInvocation, resolveComposerSlashKeyAction, } from './composer-discovery.js';
|
|
21
|
+
function reportComposerHostEffectFailure(effectName, error) {
|
|
22
|
+
console.error(`[@jini-ai/chat] Composer ${effectName} host effect failed:`, error);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Invokes host code synchronously, then observes either its synchronous result or async failure.
|
|
26
|
+
*
|
|
27
|
+
* @param onResolved - Optional, called with the host's resolved (non-thrown/non-rejected) return
|
|
28
|
+
* value — never called after a synchronous throw or an async rejection. Added for
|
|
29
|
+
* `onDiscoverySelect`, whose {@link ComposerDiscoveryOutcome} return value the caller applies to
|
|
30
|
+
* the draft; the two other host effects this function backs (`plusMenuItems.onSelect`,
|
|
31
|
+
* `attachmentPicker.onFiles`) simply omit it, which reproduces their exact prior behavior.
|
|
32
|
+
*/
|
|
33
|
+
function runComposerHostEffect(effectName, effect, onSettled, onResolved) {
|
|
34
|
+
let result;
|
|
35
|
+
try {
|
|
36
|
+
result = effect();
|
|
37
|
+
}
|
|
38
|
+
catch (error) {
|
|
39
|
+
reportComposerHostEffectFailure(effectName, error);
|
|
40
|
+
onSettled?.();
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
const asynchronous = result !== undefined;
|
|
44
|
+
if (!asynchronous) {
|
|
45
|
+
onResolved?.(result);
|
|
46
|
+
onSettled?.();
|
|
47
|
+
}
|
|
48
|
+
void Promise.resolve(result)
|
|
49
|
+
.then((resolved) => {
|
|
50
|
+
if (asynchronous)
|
|
51
|
+
onResolved?.(resolved);
|
|
52
|
+
})
|
|
53
|
+
.catch((error) => {
|
|
54
|
+
reportComposerHostEffectFailure(effectName, error);
|
|
55
|
+
})
|
|
56
|
+
.finally(() => {
|
|
57
|
+
if (asynchronous)
|
|
58
|
+
onSettled?.();
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Renders the controlled message composer and optional attachment picker.
|
|
63
|
+
*
|
|
64
|
+
* @complexity Time/space: O(n) in rendered attachments and supplied menu items.
|
|
65
|
+
* @overallScore 100/100
|
|
66
|
+
*/
|
|
67
|
+
export function Composer({ composer, onSend, disabled = false, sendDisabled = false, placeholder, slots, attachmentPicker, running = false, onCancel, }) {
|
|
68
|
+
const t = useT();
|
|
69
|
+
const attachmentInputRef = useRef(null);
|
|
70
|
+
const textareaRef = useRef(null);
|
|
71
|
+
const discoveryEffectInFlightRef = useRef(false);
|
|
72
|
+
/**
|
|
73
|
+
* Mirrors `composer.draft` for the ONE place it must be read outside a render: inside
|
|
74
|
+
* `notifyDiscovery`'s `onResolved` callback, which can fire after arbitrarily many re-renders
|
|
75
|
+
* (nothing here disables the textarea while a host effect is in flight, so the user is free to
|
|
76
|
+
* keep typing). Reassigned every render rather than via an effect — an effect would lag one
|
|
77
|
+
* render behind the value it needs to be compared against at the exact moment the outcome
|
|
78
|
+
* settles.
|
|
79
|
+
*/
|
|
80
|
+
const draftRef = useRef(composer.draft);
|
|
81
|
+
draftRef.current = composer.draft;
|
|
82
|
+
const [discoveryMenuOpen, setDiscoveryMenuOpen] = useState(false);
|
|
83
|
+
const [slashActiveIndex, setSlashActiveIndex] = useState(0);
|
|
84
|
+
const [dismissedSlashDraft, setDismissedSlashDraft] = useState(null);
|
|
85
|
+
const [discoveryMenuPosition, setDiscoveryMenuPosition] = useState();
|
|
86
|
+
const [slashMenuPosition, setSlashMenuPosition] = useState();
|
|
87
|
+
const resolvedPlaceholder = placeholder ?? t('Send a message…');
|
|
88
|
+
const discoveryGroups = slots?.discoveryGroups ?? [];
|
|
89
|
+
const hasDiscoveryItems = discoveryGroups.some((group) => group.items.length > 0);
|
|
90
|
+
const slashQuery = parseComposerSlashQuery(composer.draft);
|
|
91
|
+
const slashMatches = slashQuery === null ? [] : filterComposerDiscovery(discoveryGroups, slashQuery);
|
|
92
|
+
const slashOpen = slashMatches.length > 0 && dismissedSlashDraft !== composer.draft;
|
|
93
|
+
/**
|
|
94
|
+
* A bare "/" intentionally matches every item (`matchesFuzzyCommand`'s own doc) so the palette
|
|
95
|
+
* doubles as a browse-everything view — but with nothing typed yet, nothing on screen tells a
|
|
96
|
+
* first-time user that continuing to type narrows it, and a fuzzy substring match against full
|
|
97
|
+
* descriptions stays broad for the first character or two regardless (owner-reported "it doesn't
|
|
98
|
+
* narrow" — narrowing DOES fire on every keystroke, this is the one state where there's no visual
|
|
99
|
+
* cue that it will). Shown only here, not once the user has started typing a real query — at that
|
|
100
|
+
* point the shrinking list is its own feedback.
|
|
101
|
+
*/
|
|
102
|
+
const showSlashFilterHint = slashQuery !== null && slashQuery.command === '' && slashQuery.argument === null;
|
|
103
|
+
function restoreComposerFocus() {
|
|
104
|
+
textareaRef.current?.focus();
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Neither popover had any way to dismiss on an outside click — Escape worked (each already wires
|
|
108
|
+
* its own keydown), but clicking away left them open with no affordance to close (bug report:
|
|
109
|
+
* "no click-outside, owner is stuck once it opens"). `mousedown`, not `click`, so this settles
|
|
110
|
+
* before the "+" trigger button's own `onToggle` fires on the SAME click — that click's target is
|
|
111
|
+
* inside `.jini-composer-discovery` (the trigger lives there too), so it's correctly treated as
|
|
112
|
+
* "inside" and left for `onToggle` to handle, not fought over by two competing handlers.
|
|
113
|
+
*
|
|
114
|
+
* Scoped by DOM lookup (`closest`/`querySelector`) off `textareaRef`, not new refs threaded
|
|
115
|
+
* through `ComposerDiscovery.tsx`'s props — both popovers already carry stable classes/ids this
|
|
116
|
+
* component doesn't otherwise need direct handles to.
|
|
117
|
+
*/
|
|
118
|
+
useEffect(() => {
|
|
119
|
+
if (!discoveryMenuOpen && !slashOpen)
|
|
120
|
+
return;
|
|
121
|
+
const composerRoot = textareaRef.current?.closest('.jini-composer');
|
|
122
|
+
if (!composerRoot)
|
|
123
|
+
return;
|
|
124
|
+
function handleOutsideMouseDown(event) {
|
|
125
|
+
const target = event.target;
|
|
126
|
+
if (!target)
|
|
127
|
+
return;
|
|
128
|
+
if (discoveryMenuOpen) {
|
|
129
|
+
const trigger = composerRoot.querySelector('.jini-composer-discovery');
|
|
130
|
+
if (!trigger?.contains(target))
|
|
131
|
+
setDiscoveryMenuOpen(false);
|
|
132
|
+
}
|
|
133
|
+
if (slashOpen) {
|
|
134
|
+
const menu = composerRoot.querySelector('#jini-composer-slash-menu');
|
|
135
|
+
const insideTextarea = textareaRef.current?.contains(target) ?? false;
|
|
136
|
+
if (!insideTextarea && !menu?.contains(target))
|
|
137
|
+
setDismissedSlashDraft(composer.draft);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
document.addEventListener('mousedown', handleOutsideMouseDown);
|
|
141
|
+
return () => document.removeEventListener('mousedown', handleOutsideMouseDown);
|
|
142
|
+
}, [discoveryMenuOpen, slashOpen, composer.draft]);
|
|
143
|
+
/**
|
|
144
|
+
* Anchors the "+" menu and slash palette to `.jini-composer`'s live on-screen rect via
|
|
145
|
+
* `position: fixed` (see `composerDiscoveryMenuPosition`/`composerSlashMenuPosition`'s own doc
|
|
146
|
+
* in `composer-discovery.ts` for the ancestor-clipping bug this fixes). `useLayoutEffect`, not
|
|
147
|
+
* `useEffect`, so the measured position lands before the browser paints the just-opened popover
|
|
148
|
+
* — otherwise the very first frame would flash at the CSS default (`position: absolute`)
|
|
149
|
+
* position before snapping to the fixed one. Recomputed on scroll/resize while either popover is
|
|
150
|
+
* open, matching `useAgentRuntimePicker.hooks.ts`'s identical popover-tracking idiom: the
|
|
151
|
+
* composer's on-screen position can change under an open popover without it ever unmounting.
|
|
152
|
+
*/
|
|
153
|
+
useLayoutEffect(() => {
|
|
154
|
+
if (!discoveryMenuOpen && !slashOpen)
|
|
155
|
+
return undefined;
|
|
156
|
+
const composerRoot = textareaRef.current?.closest('.jini-composer');
|
|
157
|
+
if (!composerRoot)
|
|
158
|
+
return undefined;
|
|
159
|
+
function update() {
|
|
160
|
+
const rect = composerRoot.getBoundingClientRect();
|
|
161
|
+
if (discoveryMenuOpen)
|
|
162
|
+
setDiscoveryMenuPosition(composerDiscoveryMenuPosition(rect));
|
|
163
|
+
if (slashOpen)
|
|
164
|
+
setSlashMenuPosition(composerSlashMenuPosition(rect));
|
|
165
|
+
}
|
|
166
|
+
update();
|
|
167
|
+
window.addEventListener('scroll', update, true);
|
|
168
|
+
window.addEventListener('resize', update);
|
|
169
|
+
return () => {
|
|
170
|
+
window.removeEventListener('scroll', update, true);
|
|
171
|
+
window.removeEventListener('resize', update);
|
|
172
|
+
};
|
|
173
|
+
}, [discoveryMenuOpen, slashOpen]);
|
|
174
|
+
/**
|
|
175
|
+
* `expectedDraft` is the draft as the user last saw it at the moment of selection — what the
|
|
176
|
+
* host's effect was computed against. `argument` is passed only for a resolved `'invoke'` on a
|
|
177
|
+
* `command`-bearing item (see `resolveComposerSlashInvocation`); omitted entirely for a plain
|
|
178
|
+
* macro item, matching `ComposerDiscoverySelection.argument`'s own "absent means no command
|
|
179
|
+
* grammar" contract.
|
|
180
|
+
*
|
|
181
|
+
* A `ComposerDiscoveryOutcome` the host returns replaces the draft — this is how a command whose
|
|
182
|
+
* effect is computed asynchronously (e.g. composing agent-directed instruction text) gets to
|
|
183
|
+
* write its result back, since nothing here can guess it in advance the way a plain item's own
|
|
184
|
+
* `insertText` can. But nothing disables the textarea while that effect is in flight, so the
|
|
185
|
+
* live draft (`draftRef.current`) may have moved on by the time it resolves. The outcome is
|
|
186
|
+
* applied only if the live draft still matches `expectedDraft` exactly; otherwise it is
|
|
187
|
+
* DISCARDED — silently overwriting keystrokes the user typed in the meantime would be worse than
|
|
188
|
+
* dropping a result they can reselect.
|
|
189
|
+
*/
|
|
190
|
+
function notifyDiscovery(item, source, expectedDraft, argument) {
|
|
191
|
+
const onDiscoverySelect = slots?.onDiscoverySelect;
|
|
192
|
+
if (!onDiscoverySelect || discoveryEffectInFlightRef.current)
|
|
193
|
+
return;
|
|
194
|
+
discoveryEffectInFlightRef.current = true;
|
|
195
|
+
runComposerHostEffect('onDiscoverySelect', () => onDiscoverySelect({ item, source, ...(argument !== undefined ? { argument } : {}) }), () => {
|
|
196
|
+
discoveryEffectInFlightRef.current = false;
|
|
197
|
+
}, (outcome) => {
|
|
198
|
+
if (!outcome || typeof outcome !== 'object')
|
|
199
|
+
return;
|
|
200
|
+
const draft = outcome.draft;
|
|
201
|
+
if (draft === undefined)
|
|
202
|
+
return;
|
|
203
|
+
if (draftRef.current !== expectedDraft)
|
|
204
|
+
return;
|
|
205
|
+
composer.setDraft(draft);
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
function selectSlashItem(index) {
|
|
209
|
+
const match = slashMatches[index];
|
|
210
|
+
if (!match)
|
|
211
|
+
return;
|
|
212
|
+
const resolution = resolveComposerSlashInvocation(composer.draft, match.item);
|
|
213
|
+
if (!resolution)
|
|
214
|
+
return;
|
|
215
|
+
if (resolution.type === 'complete') {
|
|
216
|
+
// The command word is ambiguous or its argument is still missing — finish the trigger and
|
|
217
|
+
// keep the palette open for further typing. No host effect fires: nothing was invoked yet.
|
|
218
|
+
composer.setDraft(resolution.draft);
|
|
219
|
+
setDismissedSlashDraft(null);
|
|
220
|
+
restoreComposerFocus();
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
let expectedDraft = composer.draft;
|
|
224
|
+
if (!match.item.command) {
|
|
225
|
+
expectedDraft = replaceComposerSlashTrigger(composer.draft, match.item.insertText ?? match.item.label);
|
|
226
|
+
composer.setDraft(expectedDraft);
|
|
227
|
+
}
|
|
228
|
+
setDismissedSlashDraft(null);
|
|
229
|
+
notifyDiscovery(match.item, 'slash', expectedDraft, resolution.argument);
|
|
230
|
+
restoreComposerFocus();
|
|
231
|
+
}
|
|
232
|
+
function selectPlusItem(item) {
|
|
233
|
+
const expectedDraft = item.insertText ? appendComposerDiscovery(composer.draft, item.insertText) : composer.draft;
|
|
234
|
+
if (item.insertText)
|
|
235
|
+
composer.setDraft(expectedDraft);
|
|
236
|
+
setDiscoveryMenuOpen(false);
|
|
237
|
+
notifyDiscovery(item, 'plus', expectedDraft);
|
|
238
|
+
restoreComposerFocus();
|
|
239
|
+
}
|
|
240
|
+
function handleKeyDown(event) {
|
|
241
|
+
if (event.nativeEvent.isComposing)
|
|
242
|
+
return;
|
|
243
|
+
if (slashOpen) {
|
|
244
|
+
const action = resolveComposerSlashKeyAction(event.key, event.shiftKey);
|
|
245
|
+
if (action.type !== 'none') {
|
|
246
|
+
event.preventDefault();
|
|
247
|
+
if (action.type === 'move') {
|
|
248
|
+
setSlashActiveIndex((current) => (current + action.offset + slashMatches.length) % slashMatches.length);
|
|
249
|
+
}
|
|
250
|
+
else if (action.type === 'select') {
|
|
251
|
+
selectSlashItem(Math.min(slashActiveIndex, slashMatches.length - 1));
|
|
252
|
+
}
|
|
253
|
+
else {
|
|
254
|
+
setDismissedSlashDraft(composer.draft);
|
|
255
|
+
}
|
|
256
|
+
return;
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
if (event.key !== 'Enter' || event.shiftKey)
|
|
260
|
+
return;
|
|
261
|
+
event.preventDefault();
|
|
262
|
+
if (!disabled && !sendDisabled && composer.canSubmit)
|
|
263
|
+
onSend();
|
|
264
|
+
}
|
|
265
|
+
function handleAttachmentChange(event) {
|
|
266
|
+
const files = Array.from(event.target.files ?? []);
|
|
267
|
+
event.target.value = '';
|
|
268
|
+
if (files.length > 0 && attachmentPicker) {
|
|
269
|
+
runComposerHostEffect('attachmentPicker.onFiles', () => attachmentPicker.onFiles(files));
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* A screenshot or a Finder-copied video pasted into the textarea previously vanished with no
|
|
274
|
+
* feedback: the browser's default paste has nothing to do with a `File` on the clipboard (it only
|
|
275
|
+
* inserts `text/plain`, which a file-only clipboard entry never carries), so the keystroke was a
|
|
276
|
+
* silent no-op — no chip, no `/api/attachments` call, nothing. This is the paste-side counterpart
|
|
277
|
+
* to `handleAttachmentChange` (the file-input path) and `useChatPaneFileDrop` (the drag-and-drop
|
|
278
|
+
* path); all three now reach `attachmentPicker.onFiles` the same way.
|
|
279
|
+
*
|
|
280
|
+
* `preventDefault` only when `files.length > 0` — an ordinary text paste (the overwhelmingly
|
|
281
|
+
* common case) is left to the browser's own default handling untouched.
|
|
282
|
+
*/
|
|
283
|
+
function handleAttachmentPaste(event) {
|
|
284
|
+
if (!attachmentPicker)
|
|
285
|
+
return;
|
|
286
|
+
const files = Array.from(event.clipboardData?.files ?? []);
|
|
287
|
+
if (files.length === 0)
|
|
288
|
+
return;
|
|
289
|
+
event.preventDefault();
|
|
290
|
+
runComposerHostEffect('attachmentPicker.onFiles', () => attachmentPicker.onFiles(files));
|
|
291
|
+
}
|
|
292
|
+
return (_jsxs("div", { className: "jini-composer", children: [slots?.leadingAccessories ? _jsx("div", { className: "jini-composer-leading", children: slots.leadingAccessories }) : null, _jsx(AttachmentTray, { attachments: composer.attachments, onRemove: composer.removeAttachment }), _jsx("textarea", { ref: textareaRef, className: "jini-composer-input", value: composer.draft, placeholder: resolvedPlaceholder, disabled: disabled, onChange: (e) => {
|
|
293
|
+
composer.setDraft(e.target.value);
|
|
294
|
+
setSlashActiveIndex(0);
|
|
295
|
+
setDismissedSlashDraft(null);
|
|
296
|
+
}, onKeyDown: handleKeyDown, onPaste: handleAttachmentPaste, "aria-controls": slashOpen ? 'jini-composer-slash-menu' : undefined, "aria-expanded": slashOpen, "aria-activedescendant": slashOpen
|
|
297
|
+
? `jini-composer-slash-option-${Math.min(slashActiveIndex, slashMatches.length - 1)}`
|
|
298
|
+
: undefined, rows: 3 }), slashOpen ? (_jsx(ComposerSlashMenu, { matches: slashMatches, activeIndex: Math.min(slashActiveIndex, slashMatches.length - 1), onSelect: (item) => selectSlashItem(slashMatches.findIndex((match) => match.item === item)), showFilterHint: showSlashFilterHint, style: slashMenuPosition, t: t })) : null, _jsxs("div", { className: "jini-composer-footer", children: [attachmentPicker && !hasDiscoveryItems ? (_jsxs("div", { className: "jini-composer-attachment-picker", children: [_jsx("input", { ref: attachmentInputRef, className: "jini-composer-file-input", "data-testid": "composer-attachment-input", type: "file", multiple: true, "aria-label": t('Attach files'), accept: attachmentPicker.accept, disabled: disabled || attachmentPicker.uploading, onChange: handleAttachmentChange }), _jsx("button", { type: "button", className: "jini-composer-attach", disabled: disabled || attachmentPicker.uploading, onClick: () => attachmentInputRef.current?.click(), title: t(attachmentPicker.uploading ? 'Attaching files…' : 'Attach files'), "aria-label": t(attachmentPicker.uploading ? 'Attaching files…' : 'Attach files'), children: _jsx(RemixIcon, { name: attachmentPicker.uploading ? 'refresh-line' : 'add-line', size: 20, ...(attachmentPicker.uploading ? { className: 'jini-composer-spinner' } : {}) }) })] })) : null, hasDiscoveryItems ? (_jsx(ComposerDiscoveryMenu, { groups: discoveryGroups, open: discoveryMenuOpen, disabled: disabled, ...(attachmentPicker ? { attachmentPicker } : {}), attachmentInputRef: attachmentInputRef, onToggle: () => setDiscoveryMenuOpen((open) => !open), onClose: () => setDiscoveryMenuOpen(false), onSelect: selectPlusItem, onAttachmentChange: handleAttachmentChange, style: discoveryMenuPosition, t: t })) : null, slots?.footerAccessories ? (_jsx("div", { className: "jini-composer-footer-accessories", children: slots.footerAccessories })) : null, slots?.plusMenuItems && slots.plusMenuItems.length > 0 ? (_jsx("div", { className: "jini-composer-plus-menu", children: slots.plusMenuItems.map((item) => (_jsxs("button", { type: "button", className: "jini-composer-plus-item", onClick: () => runComposerHostEffect('plusMenuItems.onSelect', () => item.onSelect()), title: t(item.label), children: [item.icon ?? null, _jsx("span", { children: t(item.label) })] }, item.id))) })) : null, running ? (_jsx("button", { type: "button", className: "jini-composer-send jini-composer-send--stop", onClick: onCancel, title: t('Stop run'), "aria-label": t('Stop run'), children: _jsx(RemixIcon, { name: "stop-fill", size: 14 }) })) : (_jsx("button", { type: "button", className: "jini-composer-send", disabled: disabled || sendDisabled || !composer.canSubmit, onClick: onSend, title: t('Send'), "aria-label": t('Send'), children: _jsx(RemixIcon, { name: "send-plane-2-line", size: 16 }) }))] })] }));
|
|
299
|
+
}
|
|
300
|
+
//# sourceMappingURL=Composer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Composer.js","sourceRoot":"","sources":["../../../src/react/components/Composer.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EACL,SAAS,EACT,eAAe,EACf,MAAM,EACN,QAAQ,GAKT,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAG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type { ComposerDiscoveryGroup, ComposerDiscoveryItem } from '../slots.js';
|
|
3
|
+
import type { ComposerDiscoveryMatch } from './composer-discovery.js';
|
|
4
|
+
interface AttachmentPicker {
|
|
5
|
+
onFiles: (files: File[]) => void | Promise<void>;
|
|
6
|
+
accept?: string;
|
|
7
|
+
uploading?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface ComposerDiscoveryMenuProps {
|
|
10
|
+
groups: readonly ComposerDiscoveryGroup[];
|
|
11
|
+
open: boolean;
|
|
12
|
+
disabled: boolean;
|
|
13
|
+
attachmentPicker?: AttachmentPicker;
|
|
14
|
+
attachmentInputRef: RefObject<HTMLInputElement | null>;
|
|
15
|
+
onToggle: () => void;
|
|
16
|
+
onClose: () => void;
|
|
17
|
+
onSelect: (item: ComposerDiscoveryItem) => void;
|
|
18
|
+
onAttachmentChange: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
19
|
+
t: (key: string) => string;
|
|
20
|
+
/** Viewport-fixed position computed by `Composer.tsx` (see `composerDiscoveryMenuPosition` in
|
|
21
|
+
* `composer-discovery.ts`) so the popover escapes any `overflow: hidden` ancestor between the
|
|
22
|
+
* composer and the page root. `undefined` for the one synchronous render before that
|
|
23
|
+
* measurement lands, during which the reference stylesheet's `position: absolute` default
|
|
24
|
+
* still applies — inline `style` always wins once it is set. */
|
|
25
|
+
style?: CSSProperties | undefined;
|
|
26
|
+
}
|
|
27
|
+
/** Generic grouped add-menu; the host owns all inventory labels and items. */
|
|
28
|
+
export declare function ComposerDiscoveryMenu(props: ComposerDiscoveryMenuProps): import("react").JSX.Element | null;
|
|
29
|
+
export interface ComposerSlashMenuProps {
|
|
30
|
+
matches: readonly ComposerDiscoveryMatch[];
|
|
31
|
+
activeIndex: number;
|
|
32
|
+
onSelect: (item: ComposerDiscoveryItem) => void;
|
|
33
|
+
/** True only for a bare "/" (see `Composer.tsx`'s own doc on `showSlashFilterHint`) — shows a
|
|
34
|
+
* one-line "keep typing to narrow" cue above the options, since that's the one state where
|
|
35
|
+
* nothing else on screen signals that typing filters the list. */
|
|
36
|
+
showFilterHint?: boolean;
|
|
37
|
+
t: (key: string) => string;
|
|
38
|
+
/** Viewport-fixed position computed by `Composer.tsx` (see `composerSlashMenuPosition` in
|
|
39
|
+
* `composer-discovery.ts`) — same escape-the-ancestor-clip mechanism as
|
|
40
|
+
* {@link ComposerDiscoveryMenuProps.style}. */
|
|
41
|
+
style?: CSSProperties | undefined;
|
|
42
|
+
}
|
|
43
|
+
/** Keyboard navigation is owned by Composer so focus stays in the textarea. */
|
|
44
|
+
export declare function ComposerSlashMenu(props: ComposerSlashMenuProps): import("react").JSX.Element | null;
|
|
45
|
+
export {};
|
|
46
|
+
//# sourceMappingURL=ComposerDiscovery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ComposerDiscovery.d.ts","sourceRoot":"","sources":["../../../src/react/components/ComposerDiscovery.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEnE,OAAO,KAAK,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACjF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAEtE,UAAU,gBAAgB;IACxB,OAAO,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACjD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,0BAA0B;IACzC,MAAM,EAAE,SAAS,sBAAsB,EAAE,CAAC;IAC1C,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;IAClB,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,kBAAkB,EAAE,SAAS,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAC;IACvD,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,EAAE,CAAC,IAAI,EAAE,qBAAqB,KAAK,IAAI,CAAC;IAChD,kBAAkB,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IACnE,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC;IAC3B;;;;qEAIiE;IACjE,KAAK,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;CACnC;AAED,8EAA8E;AAC9E,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,0BAA0B,sCA8FtE;AAED,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,SAAS,sBAAsB,EAAE,CAAC;IAC3C,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,CAAC,IAAI,EAAE,qBAAqB,KAAK,IAAI,CAAC;IAChD;;uEAEmE;IACnE,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC;IAC3B;;oDAEgD;IAChD,KAAK,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;CACnC;AAED,+EAA+E;AAC/E,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,sCAuD9D"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { RemixIcon } from '@jini-ai/ui';
|
|
3
|
+
/** Generic grouped add-menu; the host owns all inventory labels and items. */
|
|
4
|
+
export function ComposerDiscoveryMenu(props) {
|
|
5
|
+
const hasItems = props.groups.some((group) => group.items.length > 0);
|
|
6
|
+
if (!hasItems)
|
|
7
|
+
return null;
|
|
8
|
+
return (_jsxs("div", { className: "jini-composer-discovery", onKeyDown: (event) => {
|
|
9
|
+
if (event.key !== 'Escape' || !props.open)
|
|
10
|
+
return;
|
|
11
|
+
event.preventDefault();
|
|
12
|
+
props.onClose();
|
|
13
|
+
}, children: [props.attachmentPicker ? (_jsx("input", { ref: props.attachmentInputRef, className: "jini-composer-file-input", "data-testid": "composer-attachment-input", type: "file", multiple: true, "aria-label": props.t('Attach files'), accept: props.attachmentPicker.accept, disabled: props.disabled || props.attachmentPicker.uploading, onChange: props.onAttachmentChange })) : null, _jsx("button", { type: "button", className: "jini-composer-attach", disabled: props.disabled, onClick: props.onToggle, "aria-expanded": props.open, "aria-haspopup": "menu", title: props.t('Add context'), "aria-label": props.t('Add context'), children: _jsx(RemixIcon, { name: "add-line", size: 20 }) }), props.open ? (_jsxs("div", { className: "jini-composer-discovery-menu", style: props.style, role: "menu", "aria-label": props.t('Add context'), children: [props.attachmentPicker ? (_jsxs("div", { className: "jini-composer-discovery-group", role: "group", "aria-label": props.t('Files'), children: [_jsx("span", { className: "jini-composer-discovery-group-label", children: props.t('Files') }), _jsx("button", { type: "button", role: "menuitem", className: "jini-composer-discovery-item", disabled: props.disabled || props.attachmentPicker.uploading, onClick: () => {
|
|
14
|
+
props.onClose();
|
|
15
|
+
props.attachmentInputRef.current?.click();
|
|
16
|
+
}, children: props.t(props.attachmentPicker.uploading ? 'Attaching files…' : 'Attach files') })] })) : null, props.groups.map((group) => group.items.length > 0 ? (_jsxs("div", { className: "jini-composer-discovery-group", role: "group", "aria-label": props.t(group.label), children: [_jsx("span", { className: "jini-composer-discovery-group-label", children: props.t(group.label) }), group.items.map((item) => {
|
|
17
|
+
const description = item.description ? props.t(item.description) : undefined;
|
|
18
|
+
const descriptionId = description ? `jini-composer-discovery-desc-${item.id}` : undefined;
|
|
19
|
+
return (_jsxs("button", { type: "button", role: "menuitem", className: "jini-composer-discovery-item", "aria-describedby": descriptionId, onClick: () => props.onSelect(item), children: [_jsx("span", { children: props.t(item.label) }), description ? (_jsx("small", { id: descriptionId, className: "jini-composer-discovery-description", children: description })) : null] }, item.id));
|
|
20
|
+
})] }, group.id)) : null)] })) : null] }));
|
|
21
|
+
}
|
|
22
|
+
/** Keyboard navigation is owned by Composer so focus stays in the textarea. */
|
|
23
|
+
export function ComposerSlashMenu(props) {
|
|
24
|
+
if (props.matches.length === 0)
|
|
25
|
+
return null;
|
|
26
|
+
return (_jsxs("div", { id: "jini-composer-slash-menu", className: "jini-composer-slash-menu", style: props.style, role: "listbox", "aria-label": props.t('Composer commands'), children: [props.showFilterHint ? (
|
|
27
|
+
// `role="presentation"` opts this out of the listbox's own "children are options" ARIA
|
|
28
|
+
// expectation explicitly, rather than leaving an unmarked stray `<div>` for assistive tech
|
|
29
|
+
// to guess about — same escape hatch real combobox implementations use for a "no results"
|
|
30
|
+
// row. Reuses `.jini-composer-discovery-group-label`'s existing look (faint, small,
|
|
31
|
+
// uppercase) instead of introducing a new visual style for one hint line.
|
|
32
|
+
_jsx("div", { className: "jini-composer-discovery-group-label", role: "presentation", children: props.t('Keep typing to narrow the list') })) : null, props.matches.map((match, index) => {
|
|
33
|
+
const description = props.t(match.item.description ?? match.groupLabel);
|
|
34
|
+
const descriptionId = `jini-composer-slash-option-${index}-desc`;
|
|
35
|
+
return (_jsxs("button", { id: `jini-composer-slash-option-${index}`, type: "button", role: "option", "aria-selected": index === props.activeIndex, "aria-describedby": descriptionId, className: `jini-composer-discovery-item${index === props.activeIndex ? ' is-active' : ''}`, onMouseDown: (event) => event.preventDefault(), onClick: () => props.onSelect(match.item), children: [_jsxs("span", { children: [props.t(match.item.label), match.item.argument ? (_jsxs("code", { className: "jini-composer-slash-argument", children: [" ", match.item.argument.placeholder] })) : null, match.item.needsConfirmation ? (_jsxs("small", { className: "jini-composer-slash-confirm-badge", children: [" ", props.t('Confirm')] })) : null] }), _jsx("small", { id: descriptionId, className: "jini-composer-discovery-description", children: description })] }, `${match.groupId}:${match.item.id}`));
|
|
36
|
+
})] }));
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=ComposerDiscovery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|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I,CAAC,QAAQ,CAAC,WAAW,IAAQ,CACzF,CAAC,CAAC,CAAC,IAAI,EACP,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAC9B,iBAAO,SAAS,EAAC,mCAAmC,kBAAG,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,IAAS,CACnF,CAAC,CAAC,CAAC,IAAI,IACH,EAGP,gBAAO,EAAE,EAAE,aAAa,EAAE,SAAS,EAAC,qCAAqC,YACtE,WAAW,GACN,KAvBH,GAAG,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,CAwBjC,CACV,CAAC;YACJ,CAAC,CAAC,IACE,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/** The minimum a row needs to render. Mirrors `@jini-ai/chat/core`'s `ChatConversation`. */
|
|
2
|
+
export interface ConversationListItem {
|
|
3
|
+
id: string;
|
|
4
|
+
title: string | null;
|
|
5
|
+
messageCount?: number;
|
|
6
|
+
updatedAt?: number;
|
|
7
|
+
}
|
|
8
|
+
export interface ConversationListProps {
|
|
9
|
+
conversations: ConversationListItem[];
|
|
10
|
+
activeConversationId: string | null;
|
|
11
|
+
onSelect: (id: string) => void;
|
|
12
|
+
onCreate: () => void | Promise<void>;
|
|
13
|
+
onDelete: (id: string) => void | Promise<void>;
|
|
14
|
+
onRename: (id: string, title: string) => void | Promise<void>;
|
|
15
|
+
/**
|
|
16
|
+
* Server-backed search. Omit for the built-in client filter.
|
|
17
|
+
*
|
|
18
|
+
* **Required once the list is paginated** — see this module's header.
|
|
19
|
+
*/
|
|
20
|
+
onSearch?: (query: string) => Promise<ConversationListItem[]>;
|
|
21
|
+
/**
|
|
22
|
+
* Confirm before deleting. Defaults to `window.confirm`; pass a custom dialog, or
|
|
23
|
+
* `() => Promise.resolve(true)` to delete without asking.
|
|
24
|
+
*/
|
|
25
|
+
confirmDelete?: (item: ConversationListItem) => boolean | Promise<boolean>;
|
|
26
|
+
/** Disables the "New" action — e.g. while the current conversation is still empty. */
|
|
27
|
+
createDisabled?: boolean;
|
|
28
|
+
emptyState?: React.ReactNode;
|
|
29
|
+
}
|
|
30
|
+
export declare function ConversationList({ conversations, activeConversationId, onSelect, onCreate, onDelete, onRename, onSearch, confirmDelete, createDisabled, emptyState, }: ConversationListProps): import("react").JSX.Element;
|
|
31
|
+
//# sourceMappingURL=ConversationList.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConversationList.d.ts","sourceRoot":"","sources":["../../../src/react/components/ConversationList.tsx"],"names":[],"mappings":"AAmCA,4FAA4F;AAC5F,MAAM,WAAW,oBAAoB;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,qBAAqB;IACpC,aAAa,EAAE,oBAAoB,EAAE,CAAC;IACtC,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,QAAQ,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACrC,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/C,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9D;;;;OAIG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,oBAAoB,EAAE,CAAC,CAAC;IAC9D;;;OAGG;IACH,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,oBAAoB,KAAK,OAAO,GAAG,OAAO,CAA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