@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,15 @@
|
|
|
1
|
+
import type { ChatMessage } from '../../core/index.js';
|
|
2
|
+
import { type MessageRowProps } from './MessageRow.js';
|
|
3
|
+
export interface MessageListProps extends Pick<MessageRowProps, 'projectFileNames' | 'onRequestOpenFile' | 'renderAttachment'> {
|
|
4
|
+
messages: ChatMessage[];
|
|
5
|
+
isStreaming?: boolean;
|
|
6
|
+
/** Mirrors `useConversation().scrollIntent` — when `true`, this component scrolls to the bottom on mount/update. */
|
|
7
|
+
scrollIntent?: boolean;
|
|
8
|
+
/** Called once the auto-scroll has run, mirroring `useConversation().acknowledgeScroll`. */
|
|
9
|
+
onScrolled?: () => void;
|
|
10
|
+
activeQuestionFormMessageId?: string | null;
|
|
11
|
+
questionFormSubmittedAnswersByMessageId?: Record<string, Record<string, string | string[]>>;
|
|
12
|
+
onQuestionFormSubmit?: (messageId: string, text: string, answers: Record<string, string | string[]>) => void;
|
|
13
|
+
}
|
|
14
|
+
export declare function MessageList({ messages, isStreaming, scrollIntent, onScrolled, activeQuestionFormMessageId, questionFormSubmittedAnswersByMessageId, onQuestionFormSubmit, projectFileNames, onRequestOpenFile, renderAttachment, }: MessageListProps): import("react").JSX.Element;
|
|
15
|
+
//# sourceMappingURL=MessageList.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MessageList.d.ts","sourceRoot":"","sources":["../../../src/react/components/MessageList.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEnE,MAAM,WAAW,gBAAiB,SAAQ,IAAI,CAAC,eAAe,EAAE,kBAAkB,GAAG,mBAAmB,GAAG,kBAAkB,CAAC;IAC5H,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,oHAAoH;IACpH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,4FAA4F;IAC5F,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,2BAA2B,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5C,uCAAuC,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC,CAAC;IAC5F,oBAAoB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,KAAK,IAAI,CAAC;CAC9G;AAUD,wBAAgB,WAAW,CAAC,EAC1B,QAAQ,EACR,WAAmB,EACnB,YAAoB,EACpB,UAAU,EACV,2BAAkC,EAClC,uCAAuC,EACvC,oBAAoB,EACpB,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,GACjB,EAAE,gBAAgB,+BAgFlB"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* @module MessageList
|
|
4
|
+
*
|
|
5
|
+
* Renders a conversation's messages via `<MessageRow>`, and — matching
|
|
6
|
+
* `useConversation`'s `scrollIntent` flag (see
|
|
7
|
+
* `ADS-memory/reports/jini-port/recon/r4b-webui-design.md` §4: "message array, optimistic
|
|
8
|
+
* user message, scroll-intent flag") — auto-scrolls to the newest content
|
|
9
|
+
* whenever `scrollIntent` is true, calling `onScrolled` once it has. Pure
|
|
10
|
+
* DOM scroll-anchoring via a ref lives here (a presentational component),
|
|
11
|
+
* not in the headless `useConversation` hook, per that hook's own
|
|
12
|
+
* "transport-agnostic hooks never touch DOM" contract.
|
|
13
|
+
*/
|
|
14
|
+
import { useEffect, useRef } from 'react';
|
|
15
|
+
import { isTerminalRunStatus } from '../../core/index.js';
|
|
16
|
+
import { MessageRow } from './MessageRow.js';
|
|
17
|
+
/** Slack, in px, for treating "close enough to the bottom" as "at the bottom" — a fractional
|
|
18
|
+
* scrollHeight/clientHeight rounding difference should not by itself stop the sticky-follow below. */
|
|
19
|
+
const AT_BOTTOM_THRESHOLD_PX = 4;
|
|
20
|
+
function isScrolledToBottom(el) {
|
|
21
|
+
return el.scrollHeight - el.scrollTop - el.clientHeight <= AT_BOTTOM_THRESHOLD_PX;
|
|
22
|
+
}
|
|
23
|
+
export function MessageList({ messages, isStreaming = false, scrollIntent = false, onScrolled, activeQuestionFormMessageId = null, questionFormSubmittedAnswersByMessageId, onQuestionFormSubmit, projectFileNames, onRequestOpenFile, renderAttachment, }) {
|
|
24
|
+
const containerRef = useRef(null);
|
|
25
|
+
// Whether the transcript was scrolled to its bottom as of the last user scroll or programmatic
|
|
26
|
+
// scroll-to-bottom — read by the ResizeObserver effect below, which only ever sees the DOM AFTER a
|
|
27
|
+
// resize already happened and so cannot recompute "was this at the bottom" from current values.
|
|
28
|
+
// Starts true: a freshly mounted pane opens on the latest turn, same as scrollIntent's own default.
|
|
29
|
+
const stickToBottomRef = useRef(true);
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
if (!scrollIntent)
|
|
32
|
+
return;
|
|
33
|
+
const el = containerRef.current;
|
|
34
|
+
// Gated on `stickToBottomRef`, same as the ResizeObserver effect below: `scrollIntent` turns
|
|
35
|
+
// true on EVERY streamed event (tool-call chatter included, not just a finished reply — see
|
|
36
|
+
// `useConversation.applyRunToAssistantMessage`), so scrolling unconditionally here yanked a user
|
|
37
|
+
// who had deliberately scrolled up to read history back to the bottom on the very next chunk
|
|
38
|
+
// (owner-reported, 2026-08-30). `stickToBottomRef` already reflects the user's own last scroll
|
|
39
|
+
// gesture via the `onScroll` handler below, captured BEFORE this content change, so it is safe
|
|
40
|
+
// to trust here.
|
|
41
|
+
if (el && stickToBottomRef.current) {
|
|
42
|
+
el.scrollTop = el.scrollHeight;
|
|
43
|
+
}
|
|
44
|
+
onScrolled?.();
|
|
45
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
46
|
+
}, [scrollIntent, messages]);
|
|
47
|
+
// Re-sticks to the bottom when a message ROW grows after mount with no accompanying `messages`
|
|
48
|
+
// change — the exact case an embedded MCP-UI/A2UI surface hits: it mounts at an initial guessed
|
|
49
|
+
// height (`preferredFrameSize` or `DEFAULT_INITIAL_HEIGHT`), then reports its real, often much
|
|
50
|
+
// taller content height asynchronously via `ui/notifications/size-changed`, entirely inside that
|
|
51
|
+
// surface's own React state (`McpUiHost`). The effect above never re-runs for that, so without this
|
|
52
|
+
// a surface which grows after the one-shot scroll leaves its own action buttons — or, once it
|
|
53
|
+
// resolves, the assistant's next reply — below the stale "bottom" with nothing to bring them back
|
|
54
|
+
// into view. Observes each direct child (one per message row) rather than the scroll container
|
|
55
|
+
// itself: the container's own box is held fixed by its flex/overflow layout, so only its CONTENT
|
|
56
|
+
// grows, which `ResizeObserver` only reports for the element whose box is actually changing.
|
|
57
|
+
// Re-created per `messages` change so a newly mounted row is observed too. Gated on
|
|
58
|
+
// `stickToBottomRef` so a human who scrolled up to read history is never yanked back down by an
|
|
59
|
+
// unrelated row resizing elsewhere in the transcript.
|
|
60
|
+
useEffect(() => {
|
|
61
|
+
const el = containerRef.current;
|
|
62
|
+
if (!el || typeof ResizeObserver !== 'function')
|
|
63
|
+
return;
|
|
64
|
+
const observer = new ResizeObserver(() => {
|
|
65
|
+
if (!stickToBottomRef.current)
|
|
66
|
+
return;
|
|
67
|
+
el.scrollTop = el.scrollHeight;
|
|
68
|
+
});
|
|
69
|
+
for (const child of Array.from(el.children))
|
|
70
|
+
observer.observe(child);
|
|
71
|
+
return () => observer.disconnect();
|
|
72
|
+
}, [messages]);
|
|
73
|
+
return (_jsx("div", { className: "jini-message-list", ref: containerRef, onScroll: (event) => {
|
|
74
|
+
stickToBottomRef.current = isScrolledToBottom(event.currentTarget);
|
|
75
|
+
}, "data-agent-element": "chat-transcript", "data-agent-role": "list", "data-agent-label": "The conversation transcript, oldest message first", children: messages.map((message) => {
|
|
76
|
+
const isLast = message.id === messages[messages.length - 1]?.id;
|
|
77
|
+
const runStreaming = isLast && isStreaming && !isTerminalRunStatus(message.runStatus);
|
|
78
|
+
return (_jsx(MessageRow, { message: message, runStreaming: runStreaming, runSucceeded: message.runStatus === 'succeeded', questionFormInteractive: message.id === activeQuestionFormMessageId, ...(questionFormSubmittedAnswersByMessageId?.[message.id] !== undefined ? { questionFormSubmittedAnswers: questionFormSubmittedAnswersByMessageId[message.id] } : {}), ...(onQuestionFormSubmit !== undefined ? { onQuestionFormSubmit: (text, answers) => onQuestionFormSubmit(message.id, text, answers) } : {}), ...(projectFileNames !== undefined ? { projectFileNames } : {}), ...(onRequestOpenFile !== undefined ? { onRequestOpenFile } : {}), ...(renderAttachment !== undefined ? { renderAttachment } : {}) }, message.id));
|
|
79
|
+
}) }));
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=MessageList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MessageList.js","sourceRoot":"","sources":["../../../src/react/components/MessageList.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAwB,MAAM,iBAAiB,CAAC;AAcnE;sGACsG;AACtG,MAAM,sBAAsB,GAAG,CAAC,CAAC;AAEjC,SAAS,kBAAkB,CAAC,EAAe;IACzC,OAAO,EAAE,CAAC,YAAY,GAAG,EAAE,CAAC,SAAS,GAAG,EAAE,CAAC,YAAY,IAAI,sBAAsB,CAAC;AACpF,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,EAC1B,QAAQ,EACR,WAAW,GAAG,KAAK,EACnB,YAAY,GAAG,KAAK,EACpB,UAAU,EACV,2BAA2B,GAAG,IAAI,EAClC,uCAAuC,EACvC,oBAAoB,EACpB,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,GACC;IACjB,MAAM,YA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AAC,gBAAgB,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,KAC5D,CAAC,iBAAiB,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,iBAAiB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,KAC9D,CAAC,gBAAgB,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,IAT3D,OAAO,CAAC,EAAE,CAUf,CACH,CAAC;QACJ,CAAC,CAAC,GACE,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module MessageRow
|
|
3
|
+
*
|
|
4
|
+
* Renders one `ChatMessage` — a dumb, props-in/JSX-out composition of this
|
|
5
|
+
* package's own leaves (`<Markdown>`, `<ToolCard>` via `useToolTimeline`,
|
|
6
|
+
* `<QuestionForm>` via `splitOnQuestionForms`). Unlike `ToolCard`/
|
|
7
|
+
* `QuestionForm`/`TodoCard`/`NextStepActions`, this component is NOT a
|
|
8
|
+
* direct port of an OD file: the two source branches this package was built
|
|
9
|
+
* from (`refactor/web-chat-pane-slice`, `refactor/web-chat-composer-slice-pr`)
|
|
10
|
+
* decompose `ChatPane.tsx`/`ChatComposer.tsx`, not `AssistantMessage.tsx`
|
|
11
|
+
* (3,317 lines) — that god-component's own vertical-slice extraction is a
|
|
12
|
+
* separate, not-yet-dispatched task (see
|
|
13
|
+
* `ADS-memory/reports/jini-port/recon/r4b-webui-design.md` §3's suggested "AssistantMessage
|
|
14
|
+
* first" ordering, which this task's sources don't cover). This is
|
|
15
|
+
* therefore a fresh, reasonable v1 composition of the already-ported leaves,
|
|
16
|
+
* not a byte-for-byte port — text and question-forms interleave in original
|
|
17
|
+
* order (via `splitOnQuestionForms`).
|
|
18
|
+
*
|
|
19
|
+
* Tool cards now interleave too (`../message-blocks.js`), which they did not in
|
|
20
|
+
* v1. That original deferral fused the text on either side of a tool call into
|
|
21
|
+
* one run — a message read as `"I'll look for a tool that changes the
|
|
22
|
+
* language.Done — the language is now English."`, two thoughts from before and
|
|
23
|
+
* after the call joined mid-sentence, with every card pooled at the bottom.
|
|
24
|
+
* `AssistantMessage.tsx`'s richer derivations (`deriveFileOps`/
|
|
25
|
+
* `stripTodoToolGroups`/etc.) remain a TODO for that god-component's own
|
|
26
|
+
* extraction task; plain ordering did not need to wait for them.
|
|
27
|
+
*
|
|
28
|
+
* `interleaveMessageBlocks` returns `null` when it cannot prove the
|
|
29
|
+
* reconstruction is lossless, and this component then renders exactly the flat
|
|
30
|
+
* layout it always did. Both paths are live, so the fallback is not dead code —
|
|
31
|
+
* see that module's header for the conditions.
|
|
32
|
+
*
|
|
33
|
+
* Both message roles also carry a per-message copy affordance
|
|
34
|
+
* (`CopyMessageButton` below), rendered inside a `.jini-message-actions` row.
|
|
35
|
+
* Assistant rows render that row as an extension seam: `branch`/thumbs-up/
|
|
36
|
+
* thumbs-down are meant to join `copy` there later, as siblings in the same
|
|
37
|
+
* row, once their backends (conversation branching, feedback storage) exist
|
|
38
|
+
* — see the seam comment at that row's call site. Copy always copies the raw
|
|
39
|
+
* markdown *source* — `message.content` (user) or `visibleContent`
|
|
40
|
+
* (assistant, post `stripArtifact`) — never a flattened read of the rendered
|
|
41
|
+
* DOM, so a table, fence, or `**bold**` marker survives the round trip.
|
|
42
|
+
*/
|
|
43
|
+
import React, { type ReactNode } from 'react';
|
|
44
|
+
import type { ChatAttachment, ChatMessage } from '../../core/index.js';
|
|
45
|
+
export interface MessageRowProps {
|
|
46
|
+
message: ChatMessage;
|
|
47
|
+
/** Whether this message's own run is still streaming. */
|
|
48
|
+
runStreaming?: boolean;
|
|
49
|
+
runSucceeded?: boolean;
|
|
50
|
+
/** Whether this message's question-form (if any) is still the active/answerable one. */
|
|
51
|
+
questionFormInteractive?: boolean;
|
|
52
|
+
questionFormSubmittedAnswers?: Record<string, string | string[]>;
|
|
53
|
+
onQuestionFormSubmit?: (text: string, answers: Record<string, string | string[]>) => void;
|
|
54
|
+
projectFileNames?: Set<string>;
|
|
55
|
+
onRequestOpenFile?: (name: string) => void;
|
|
56
|
+
/** Host-supplied renderer for a `ChatAttachment` chip. Falls back to a plain filename chip. */
|
|
57
|
+
renderAttachment?: (attachment: ChatAttachment) => ReactNode;
|
|
58
|
+
}
|
|
59
|
+
export declare function MessageRow({ message, runStreaming, runSucceeded, questionFormInteractive, questionFormSubmittedAnswers, onQuestionFormSubmit, projectFileNames, onRequestOpenFile, renderAttachment, }: MessageRowProps): React.JSX.Element;
|
|
60
|
+
//# sourceMappingURL=MessageRow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MessageRow.d.ts","sourceRoot":"","sources":["../../../src/react/components/MessageRow.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,OAAO,KAAK,EAAE,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC9C,OAAO,KAAK,EAAc,cAAc,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAcnF,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,WAAW,CAAC;IACrB,yDAAyD;IACzD,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,wFAAwF;IACxF,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,4BAA4B,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC;IACjE,oBAAoB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,KAAK,IAAI,CAAC;IAC1F,gBAAgB,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC/B,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,+FAA+F;IAC/F,gBAAgB,CAAC,EAAE,CAAC,UAAU,EAAE,cAAc,KAAK,SAAS,CAAC;CAC9D;AAoFD,wBAAgB,UAAU,CAAC,EACzB,OAAO,EACP,YAAoB,EACpB,YAAoB,EACpB,uBAA+B,EAC/B,4BAA4B,EAC5B,oBAAoB,EACpB,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,GACjB,EAAE,eAAe,qBAmKjB"}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* @module MessageRow
|
|
4
|
+
*
|
|
5
|
+
* Renders one `ChatMessage` — a dumb, props-in/JSX-out composition of this
|
|
6
|
+
* package's own leaves (`<Markdown>`, `<ToolCard>` via `useToolTimeline`,
|
|
7
|
+
* `<QuestionForm>` via `splitOnQuestionForms`). Unlike `ToolCard`/
|
|
8
|
+
* `QuestionForm`/`TodoCard`/`NextStepActions`, this component is NOT a
|
|
9
|
+
* direct port of an OD file: the two source branches this package was built
|
|
10
|
+
* from (`refactor/web-chat-pane-slice`, `refactor/web-chat-composer-slice-pr`)
|
|
11
|
+
* decompose `ChatPane.tsx`/`ChatComposer.tsx`, not `AssistantMessage.tsx`
|
|
12
|
+
* (3,317 lines) — that god-component's own vertical-slice extraction is a
|
|
13
|
+
* separate, not-yet-dispatched task (see
|
|
14
|
+
* `ADS-memory/reports/jini-port/recon/r4b-webui-design.md` §3's suggested "AssistantMessage
|
|
15
|
+
* first" ordering, which this task's sources don't cover). This is
|
|
16
|
+
* therefore a fresh, reasonable v1 composition of the already-ported leaves,
|
|
17
|
+
* not a byte-for-byte port — text and question-forms interleave in original
|
|
18
|
+
* order (via `splitOnQuestionForms`).
|
|
19
|
+
*
|
|
20
|
+
* Tool cards now interleave too (`../message-blocks.js`), which they did not in
|
|
21
|
+
* v1. That original deferral fused the text on either side of a tool call into
|
|
22
|
+
* one run — a message read as `"I'll look for a tool that changes the
|
|
23
|
+
* language.Done — the language is now English."`, two thoughts from before and
|
|
24
|
+
* after the call joined mid-sentence, with every card pooled at the bottom.
|
|
25
|
+
* `AssistantMessage.tsx`'s richer derivations (`deriveFileOps`/
|
|
26
|
+
* `stripTodoToolGroups`/etc.) remain a TODO for that god-component's own
|
|
27
|
+
* extraction task; plain ordering did not need to wait for them.
|
|
28
|
+
*
|
|
29
|
+
* `interleaveMessageBlocks` returns `null` when it cannot prove the
|
|
30
|
+
* reconstruction is lossless, and this component then renders exactly the flat
|
|
31
|
+
* layout it always did. Both paths are live, so the fallback is not dead code —
|
|
32
|
+
* see that module's header for the conditions.
|
|
33
|
+
*
|
|
34
|
+
* Both message roles also carry a per-message copy affordance
|
|
35
|
+
* (`CopyMessageButton` below), rendered inside a `.jini-message-actions` row.
|
|
36
|
+
* Assistant rows render that row as an extension seam: `branch`/thumbs-up/
|
|
37
|
+
* thumbs-down are meant to join `copy` there later, as siblings in the same
|
|
38
|
+
* row, once their backends (conversation branching, feedback storage) exist
|
|
39
|
+
* — see the seam comment at that row's call site. Copy always copies the raw
|
|
40
|
+
* markdown *source* — `message.content` (user) or `visibleContent`
|
|
41
|
+
* (assistant, post `stripArtifact`) — never a flattened read of the rendered
|
|
42
|
+
* DOM, so a table, fence, or `**bold**` marker survives the round trip.
|
|
43
|
+
*/
|
|
44
|
+
import React, {} from 'react';
|
|
45
|
+
import { splitOnQuestionForms, stripArtifact } from '../../core/index.js';
|
|
46
|
+
import { useToolTimeline } from '../hooks/useToolTimeline.js';
|
|
47
|
+
import { useExtEventGroups } from '../hooks/useExtEventGroups.js';
|
|
48
|
+
import { useCopyToClipboard } from '../hooks/useCopyToClipboard.js';
|
|
49
|
+
import { interleaveMessageBlocks } from '../message-blocks.js';
|
|
50
|
+
import { useT } from '../hooks/context.js';
|
|
51
|
+
import { getExtEventRenderer } from '../ext-event-renderer-registry.js';
|
|
52
|
+
import { ExtEventErrorBoundary } from './ExtEventErrorBoundary.js';
|
|
53
|
+
import { Icon } from './Icon.js';
|
|
54
|
+
import { Markdown } from './Markdown.js';
|
|
55
|
+
import { ToolCard } from './ToolCard.js';
|
|
56
|
+
import { QuestionForm } from './QuestionForm.js';
|
|
57
|
+
function formatDuration(ms) {
|
|
58
|
+
const totalSeconds = Math.round(ms / 1000);
|
|
59
|
+
const minutes = Math.floor(totalSeconds / 60);
|
|
60
|
+
const seconds = totalSeconds % 60;
|
|
61
|
+
return minutes > 0 ? `${minutes}m ${seconds}s` : `${seconds}s`;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* True while an assistant message is still fully pending — no visible text
|
|
65
|
+
* and no tool rows have arrived yet. Shared by the "Thinking…" placeholder
|
|
66
|
+
* and the action row's own visibility below, since the two are mutually
|
|
67
|
+
* exclusive by construction: a message with nothing to show yet has nothing
|
|
68
|
+
* worth a copy/branch/feedback row either. Pulled out of `MessageRow` itself
|
|
69
|
+
* (rather than inlined at each call site, as it was before this row existed)
|
|
70
|
+
* so the condition is asserted once instead of duplicated.
|
|
71
|
+
* @param message - The message being rendered.
|
|
72
|
+
* @param visibleContent - `message.content` with any `<artifact>` block stripped.
|
|
73
|
+
* @param toolRowCount - `useToolTimeline(...).rows.length` for this message.
|
|
74
|
+
* @complexity O(1) — three comparisons, no loops or recursion.
|
|
75
|
+
*/
|
|
76
|
+
function isPendingWithNoContent(message, visibleContent, toolRowCount) {
|
|
77
|
+
return message.runStatus === 'running' && !visibleContent.trim() && toolRowCount === 0;
|
|
78
|
+
}
|
|
79
|
+
/** One "Done · 6m 29s · 2612 out · $0.4028" summary line, from the run's own `kind:'usage'` event — never estimated client-side. Renders only the fields the event actually carries, so a transport that supplies partial usage data degrades gracefully instead of showing fabricated zeros. */
|
|
80
|
+
function UsageSummary({ usage }) {
|
|
81
|
+
const t = useT();
|
|
82
|
+
const parts = [];
|
|
83
|
+
if (usage.durationMs !== undefined)
|
|
84
|
+
parts.push(formatDuration(usage.durationMs));
|
|
85
|
+
if (usage.outputTokens !== undefined)
|
|
86
|
+
parts.push(t('{n} out', { n: usage.outputTokens }));
|
|
87
|
+
if (usage.costUsd !== undefined)
|
|
88
|
+
parts.push(`$${usage.costUsd.toFixed(4)}`);
|
|
89
|
+
if (parts.length === 0)
|
|
90
|
+
return null;
|
|
91
|
+
return (_jsxs("div", { className: "jini-message-usage", children: [_jsx("span", { className: "jini-message-usage-dot", "aria-hidden": true, children: "\u25CF" }), t('Done'), " \u00B7 ", parts.join(' · ')] }));
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Quiet, icon-only copy affordance shared by the user- and assistant-message
|
|
95
|
+
* action rows below. Delegates the actual clipboard write (and its
|
|
96
|
+
* secure-context fallback) to `useCopyToClipboard`; this component only owns
|
|
97
|
+
* the icon swap and the accessible announcement of the transient state.
|
|
98
|
+
* @param props.text - Exact string to copy, verbatim.
|
|
99
|
+
* @param props.label - Idle accessible name (already translated by the caller).
|
|
100
|
+
* @complexity O(1) — one child hook call, no branching beyond the copied-state read.
|
|
101
|
+
*/
|
|
102
|
+
function CopyMessageButton({ text, label }) {
|
|
103
|
+
const t = useT();
|
|
104
|
+
const { copied, copy } = useCopyToClipboard();
|
|
105
|
+
return (_jsxs(_Fragment, { children: [_jsx("button", { type: "button", className: "jini-message-action-btn", "aria-label": copied ? t('Copied') : label, onClick: () => {
|
|
106
|
+
void copy(text);
|
|
107
|
+
}, children: _jsx(Icon, { name: copied ? 'check' : 'copy' }) }), _jsx("span", { className: "jini-message-copy-status", "aria-live": "polite", children: copied ? t('Copied to clipboard') : '' })] }));
|
|
108
|
+
}
|
|
109
|
+
export function MessageRow({ message, runStreaming = false, runSucceeded = false, questionFormInteractive = false, questionFormSubmittedAnswers, onQuestionFormSubmit, projectFileNames, onRequestOpenFile, renderAttachment, }) {
|
|
110
|
+
const t = useT();
|
|
111
|
+
const timeline = useToolTimeline(message.events, { runStreaming, runSucceeded });
|
|
112
|
+
const extGroups = useExtEventGroups(message.events);
|
|
113
|
+
if (message.role === 'user') {
|
|
114
|
+
return (_jsxs("div", { className: "jini-message jini-message-user", "data-message-id": message.id, "data-agent-element": `chat-message-${message.id}`, "data-agent-role": "region", "data-agent-label": "A message from the user", children: [message.attachments && message.attachments.length > 0 ? (_jsx("div", { className: "jini-message-attachments", children: message.attachments.map((a) => (_jsx("span", { className: "jini-message-attachment-chip", children: renderAttachment ? renderAttachment(a) : a.name }, a.path))) })) : null, _jsx("div", { className: "jini-message-content", children: message.content }), _jsx("div", { className: "jini-message-actions jini-message-actions--user", children: _jsx(CopyMessageButton, { text: message.content, label: t('Copy message') }) })] }));
|
|
115
|
+
}
|
|
116
|
+
const visibleContent = stripArtifact(message.content);
|
|
117
|
+
const segments = splitOnQuestionForms(visibleContent);
|
|
118
|
+
const usageEvent = message.events?.filter((ev) => ev.kind === 'usage').pop();
|
|
119
|
+
// Interleaving is skipped outright when an artifact was stripped. `stripArtifact` operates on the
|
|
120
|
+
// whole string and trims, so the surviving text no longer lines up with the per-run offsets the
|
|
121
|
+
// event walk produces, and an artifact block could legitimately span a tool call. Rather than
|
|
122
|
+
// reason about partial overlaps, an artifact-bearing message keeps the flat layout — those
|
|
123
|
+
// messages are dominated by the artifact panel anyway, so the ordering matters least there.
|
|
124
|
+
const blocks = visibleContent === message.content ? interleaveMessageBlocks(message.events, message.content, timeline.rows) : null;
|
|
125
|
+
const pending = isPendingWithNoContent(message, visibleContent, timeline.rows.length);
|
|
126
|
+
const renderToolCard = (row) => (_jsx(ToolCard, { use: row.use, result: row.result, runStreaming: runStreaming, runSucceeded: runSucceeded, ...(projectFileNames !== undefined ? { projectFileNames } : {}), ...(onRequestOpenFile !== undefined ? { onRequestOpenFile } : {}) }, row.id));
|
|
127
|
+
const renderExtGroup = (group) => {
|
|
128
|
+
const renderer = getExtEventRenderer(group.name);
|
|
129
|
+
if (!renderer)
|
|
130
|
+
return null;
|
|
131
|
+
const node = renderer({ name: group.name, events: group.events, runStreaming, runSucceeded, runId: message.runId });
|
|
132
|
+
if (!node)
|
|
133
|
+
return null;
|
|
134
|
+
return (
|
|
135
|
+
// `key` includes the event count so a group that failed on an earlier, shorter event list
|
|
136
|
+
// gets a fresh boundary instance (not the still-tripped one) once a new event actually
|
|
137
|
+
// arrives for it, instead of staying tombstoned for the message's whole lifetime.
|
|
138
|
+
_jsx(ExtEventErrorBoundary, { name: group.name, children: _jsx("div", { children: node }) }, `${group.name}:${group.events.length}`));
|
|
139
|
+
};
|
|
140
|
+
const renderTextSegments = (text, keyPrefix) => splitOnQuestionForms(text).map((segment, i) => segment.kind === 'text' ? (segment.text.trim() ? (_jsx("div", { className: "jini-message-content", children: _jsx(Markdown, { children: segment.text }) }, `${keyPrefix}-${i}`)) : null) : (_jsx(QuestionForm, { form: segment.form, interactive: questionFormInteractive, ...(questionFormSubmittedAnswers !== undefined ? { submittedAnswers: questionFormSubmittedAnswers } : {}), ...(onQuestionFormSubmit !== undefined ? { onSubmit: onQuestionFormSubmit } : {}) }, `${keyPrefix}-${i}`)));
|
|
141
|
+
return (_jsxs("div", { className: "jini-message jini-message-assistant", "data-message-id": message.id, "data-run-status": message.runStatus, "data-agent-element": `chat-message-${message.id}`, "data-agent-role": "region", "data-agent-label": "A reply from the assistant", children: [message.agentName ? _jsx("div", { className: "jini-message-agent", children: message.agentName }) : null, blocks
|
|
142
|
+
? blocks.map((block) => {
|
|
143
|
+
if (block.kind === 'text') {
|
|
144
|
+
return _jsx(React.Fragment, { children: renderTextSegments(block.text, block.key) }, block.key);
|
|
145
|
+
}
|
|
146
|
+
if (block.kind === 'tools') {
|
|
147
|
+
return (_jsx("div", { className: "jini-message-tools", children: block.rows.map(renderToolCard) }, block.key));
|
|
148
|
+
}
|
|
149
|
+
const group = extGroups.find((g) => g.name === block.name);
|
|
150
|
+
if (!group)
|
|
151
|
+
return null;
|
|
152
|
+
return (_jsx("div", { className: "jini-message-ext-events", children: renderExtGroup(group) }, block.key));
|
|
153
|
+
})
|
|
154
|
+
: (_jsxs(_Fragment, { children: [segments.map((segment, i) => segment.kind === 'text' ? (segment.text.trim() ? (_jsx("div", { className: "jini-message-content", children: _jsx(Markdown, { children: segment.text }) }, i)) : null) : (_jsx(QuestionForm, { form: segment.form, interactive: questionFormInteractive, ...(questionFormSubmittedAnswers !== undefined ? { submittedAnswers: questionFormSubmittedAnswers } : {}), ...(onQuestionFormSubmit !== undefined ? { onSubmit: onQuestionFormSubmit } : {}) }, i))), timeline.rows.length > 0 ? (_jsx("div", { className: "jini-message-tools", children: timeline.rows.map(renderToolCard) })) : null, extGroups.length > 0 ? _jsx("div", { className: "jini-message-ext-events", children: extGroups.map(renderExtGroup) }) : null] })), usageEvent ? _jsx(UsageSummary, { usage: usageEvent }) : null, message.runStatus === 'failed' ? _jsx("div", { className: "jini-message-error", children: t('This turn failed.') }) : null, !pending ? (_jsx("div", { className: "jini-message-actions jini-message-actions--assistant", children: _jsx(CopyMessageButton, { text: visibleContent, label: t('Copy message') }) })) : null, pending ? (_jsx("div", { className: "jini-message-pending", "aria-live": "polite", children: t('Thinking…') })) : null] }));
|
|
155
|
+
}
|
|
156
|
+
//# sourceMappingURL=MessageRow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MessageRow.js","sourceRoot":"","sources":["../../../src/react/components/MessageRow.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,OAAO,KAAK,EAAE,EAAkB,MAAM,OAAO,CAAC;AAE9C,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAwB,MAAM,6BAA6B,CAAC;AACpF,OAAO,EAAE,iBAAiB,EAAsB,MAAM,+BAA+B,CAAC;AACtF,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAs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,CAAC,IAAI,EAC1G,CAAC,OAAO,CAAC,CAAC,CAAC,CACV,cAAK,SAAS,EAAC,sDAAsD,YACnE,KAAC,iBAAiB,IAAC,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,CAAC,CAAC,cAAc,CAAC,GAAI,GAKjE,CACP,CAAC,CAAC,CAAC,IAAI,EACP,OAAO,CAAC,CAAC,CAAC,CACT,cAAK,SAAS,EAAC,sBAAsB,eAAW,QAAQ,YACrD,CAAC,CAAC,WAAW,CAAC,GACX,CACP,CAAC,CAAC,CAAC,IAAI,IACJ,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module NextStepActions
|
|
3
|
+
*
|
|
4
|
+
* A generic row of "what next" suggestion buttons rendered after a
|
|
5
|
+
* completed assistant turn. Heavily pruned from OD's
|
|
6
|
+
* `components/NextStepActions.tsx` (1,069 lines) per
|
|
7
|
+
* `ADS-memory/reports/jini-port/recon/r4b-webui-design.md` §1's explicit directive for
|
|
8
|
+
* this file ("prune OD actions"): the OD original hardcodes ~20 product-
|
|
9
|
+
* specific prompt catalogs (design-system refine/audit, brand-extraction
|
|
10
|
+
* continue/AI-optimize, plan-generate-from-doc, project-continue, ...), a
|
|
11
|
+
* design-toolbox action registry, and PostHog click tracking. None of that
|
|
12
|
+
* is generic — every OD prompt catalog is a host concern now: a host
|
|
13
|
+
* supplies its own `NextStepAction[]` (e.g. OD's adapter in
|
|
14
|
+
* `foundry/integrations/open-design/` re-hosts its exact prompt catalogs against
|
|
15
|
+
* this same component). className/structure kept close to the original's
|
|
16
|
+
* action-row shape; every user-facing string wrapped in `useT()`.
|
|
17
|
+
*/
|
|
18
|
+
import type { ReactNode } from 'react';
|
|
19
|
+
export interface NextStepAction {
|
|
20
|
+
id: string;
|
|
21
|
+
label: string;
|
|
22
|
+
description?: string;
|
|
23
|
+
icon?: ReactNode;
|
|
24
|
+
/** Disables the action and swaps its label for `busyLabel` while a host-tracked operation for this action is in flight. */
|
|
25
|
+
busy?: boolean;
|
|
26
|
+
busyLabel?: string;
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
}
|
|
29
|
+
export interface NextStepActionsProps {
|
|
30
|
+
actions: NextStepAction[];
|
|
31
|
+
onSelect: (actionId: string) => void;
|
|
32
|
+
}
|
|
33
|
+
export declare function NextStepActions({ actions, onSelect }: NextStepActionsProps): import("react").JSX.Element | null;
|
|
34
|
+
//# sourceMappingURL=NextStepActions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NextStepActions.d.ts","sourceRoot":"","sources":["../../../src/react/components/NextStepActions.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,2HAA2H;IAC3H,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;CACtC;AAED,wBAAgB,eAAe,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,oBAAoB,sCAoB1E"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useT } from '../hooks/context.js';
|
|
3
|
+
export function NextStepActions({ actions, onSelect }) {
|
|
4
|
+
const t = useT();
|
|
5
|
+
if (actions.length === 0)
|
|
6
|
+
return null;
|
|
7
|
+
return (_jsx("div", { className: "next-step-actions", children: actions.map((action) => (_jsxs("button", { type: "button", className: "next-step-action", disabled: action.disabled || action.busy, onClick: () => onSelect(action.id), children: [action.icon ? (_jsx("span", { className: "next-step-action-icon", "aria-hidden": true, children: action.icon })) : null, _jsxs("span", { className: "next-step-action-body", children: [_jsx("span", { className: "next-step-action-title", children: action.busy && action.busyLabel ? t(action.busyLabel) : t(action.label) }), action.description ? _jsx("span", { className: "next-step-action-desc", children: t(action.description) }) : null] })] }, action.id))) }));
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=NextStepActions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NextStepActions.js","sourceRoot":"","sources":["../../../src/react/components/NextStepActions.tsx"],"names":[],"mappings":";AAkBA,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAkB3C,MAAM,UAAU,eAAe,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAwB;IACzE,MAAM,CAAC,GAAG,IAAI,EAAE,CAAC;IACjB,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACtC,OAAO,CACL,cAAK,SAAS,EAAC,mBAAmB,YAC/B,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CACvB,kBAAwB,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAC,kBAAkB,EAAC,QAAQ,EAAE,MAAM,CAAC,QAAQ,IAAI,MAAM,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,aAC5I,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CACb,eAAM,SAAS,EAAC,uBAAuB,iCACpC,MAAM,CAAC,IAAI,GACP,CACR,CAAC,CAAC,CAAC,IAAI,EACR,gBAAM,SAAS,EAAC,uBAAuB,aACrC,eAAM,SAAS,EAAC,wBAAwB,YAAE,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,GAAQ,EACxH,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,eAAM,SAAS,EAAC,uBAAuB,YAAE,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,GAAQ,CAAC,CAAC,CAAC,IAAI,IAC9F,KATI,MAAM,CAAC,EAAE,CAUb,CACV,CAAC,GACE,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { QuestionForm as QuestionFormType } from '../../core/index.js';
|
|
2
|
+
export interface QuestionFormFileSubmission {
|
|
3
|
+
questionId: string;
|
|
4
|
+
questionLabel: string;
|
|
5
|
+
files: File[];
|
|
6
|
+
}
|
|
7
|
+
export interface QuestionFormHandle {
|
|
8
|
+
submit: () => void;
|
|
9
|
+
/** Submit with no answers — every question is optional, so this records each as "(skipped)" and moves on. */
|
|
10
|
+
skipAll: () => void;
|
|
11
|
+
}
|
|
12
|
+
export interface QuestionFormProps {
|
|
13
|
+
form: QuestionFormType;
|
|
14
|
+
/** Whether the user can still submit answers — the host disables this once the turn is no longer the most recent one. */
|
|
15
|
+
interactive: boolean;
|
|
16
|
+
submittedAnswers?: Record<string, string | string[]>;
|
|
17
|
+
/** When a host's own Continue button owns the submit, hide this form's footer button and report ready-state via `onReadyChange`. */
|
|
18
|
+
hideInternalSubmit?: boolean;
|
|
19
|
+
draftAnswers?: Record<string, string | string[]>;
|
|
20
|
+
onReadyChange?: (ready: boolean) => void;
|
|
21
|
+
onDraftChange?: (answers: Record<string, string | string[]>) => void;
|
|
22
|
+
onAnswerChange?: (questionId: string, value: string | string[]) => void;
|
|
23
|
+
onSubmit?: (text: string, answers: Record<string, string | string[]>, files?: QuestionFormFileSubmission[]) => void;
|
|
24
|
+
}
|
|
25
|
+
export declare const QuestionForm: import("react").ForwardRefExoticComponent<QuestionFormProps & import("react").RefAttributes<QuestionFormHandle>>;
|
|
26
|
+
//# sourceMappingURL=QuestionForm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QuestionForm.d.ts","sourceRoot":"","sources":["../../../src/react/components/QuestionForm.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAA6B,YAAY,IAAI,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAIvG,MAAM,WAAW,0BAA0B;IACzC,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,IAAI,EAAE,CAAC;CACf;AAED,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,6GAA6G;IAC7G,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,gBAAgB,CAAC;IACvB,yHAAyH;IACzH,WAAW,EAAE,OAAO,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC;IACrD,oIAAoI;IACpI,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC;IACjD,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,KAAK,IAAI,CAAC;IACrE,cAAc,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,KAAK,IAAI,CAAC;IACxE,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,MA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