@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,215 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module slots
|
|
3
|
+
*
|
|
4
|
+
* The slot/adapter interfaces a host injects into `<JiniChatProvider>` (or
|
|
5
|
+
* passes directly to a headless hook) to supply everything this package
|
|
6
|
+
* deliberately does not own: project/workspace file access, model/agent
|
|
7
|
+
* optional picker overrides, composer extension points, attachment rendering,
|
|
8
|
+
* analytics, and i18n. Every OD-domain widget (OdCard, design-toolbox, brand-browser,
|
|
9
|
+
* plugin folders, sketch preview, comments/annotation, AMR billing,
|
|
10
|
+
* model/agent picker, file preview) is a host concern reached through one of
|
|
11
|
+
* these slots — see `ADS-memory/reports/jini-port/recon/r4b-webui-design.md` §2, which
|
|
12
|
+
* this module implements field-for-field.
|
|
13
|
+
*
|
|
14
|
+
* Only `import type { ReactNode }` is used here (no JSX, no React runtime
|
|
15
|
+
* value import), so this file stays at the package's top level per the
|
|
16
|
+
* react-layout policy in `ADS-memory/reports/jini-port/god-components-extraction-plan.md`
|
|
17
|
+
* — everything that actually renders (hooks, components) lives under
|
|
18
|
+
* `react/`.
|
|
19
|
+
*/
|
|
20
|
+
import type { ReactNode } from 'react';
|
|
21
|
+
import type { ChatAttachment } from '../core/index.js';
|
|
22
|
+
import type { ArtifactFile } from './artifact-types.js';
|
|
23
|
+
import type { FeedbackChange, OnFeedback } from '../core/index.js';
|
|
24
|
+
export type { FeedbackChange, OnFeedback };
|
|
25
|
+
/**
|
|
26
|
+
* Replaces OD's threaded `Project`/`ProjectFile`/`Workspace` props
|
|
27
|
+
* (`providers/registry.projectFileUrl`/`projectRawUrl`) with one injected
|
|
28
|
+
* value a host supplies once, high in its tree.
|
|
29
|
+
*/
|
|
30
|
+
export interface ProjectContextValue {
|
|
31
|
+
projectId: string | null;
|
|
32
|
+
files: ArtifactFile[];
|
|
33
|
+
resolveFileUrl: (path: string) => string;
|
|
34
|
+
resolveRawUrl: (path: string) => string;
|
|
35
|
+
uploadFiles?: (files: File[]) => Promise<ChatAttachment[]>;
|
|
36
|
+
linkedDirs?: string[];
|
|
37
|
+
}
|
|
38
|
+
/** One selectable agent/model entry a host's picker UI lists. */
|
|
39
|
+
export interface AgentOption {
|
|
40
|
+
id: string;
|
|
41
|
+
label: string;
|
|
42
|
+
description?: string;
|
|
43
|
+
models?: string[];
|
|
44
|
+
}
|
|
45
|
+
export interface AgentSelection {
|
|
46
|
+
agentId: string;
|
|
47
|
+
model?: string;
|
|
48
|
+
sessionMode?: string;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Optional custom model/agent picker slot for lower-level Composer consumers.
|
|
52
|
+
* The self-contained `ChatPane` exports its own default `AgentRuntimePicker`;
|
|
53
|
+
* this slot remains useful when composing the headless primitives directly.
|
|
54
|
+
*/
|
|
55
|
+
export interface ModelAgentPickerSlot {
|
|
56
|
+
value: AgentSelection;
|
|
57
|
+
onChange: (next: AgentSelection) => void;
|
|
58
|
+
render?: (props: {
|
|
59
|
+
value: AgentSelection;
|
|
60
|
+
onChange: (next: AgentSelection) => void;
|
|
61
|
+
agents: AgentOption[];
|
|
62
|
+
}) => ReactNode;
|
|
63
|
+
}
|
|
64
|
+
/** Generalizes `ComposerPlusMenu`/`LibraryPicker`/Figma-import/plugin entries. */
|
|
65
|
+
export interface ComposerPlusItem {
|
|
66
|
+
id: string;
|
|
67
|
+
label: string;
|
|
68
|
+
icon?: ReactNode;
|
|
69
|
+
onSelect: () => void | Promise<ChatAttachment | null>;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Declares that a `ComposerDiscoveryItem` accepts a trailing argument, e.g. `/mcp <server-id>`.
|
|
73
|
+
* Read only for its PRESENCE and `required` flag — never a typed value, never a host taxonomy,
|
|
74
|
+
* same law as `kind` below. `placeholder` is menu chrome (e.g. `<query>`); `required` only gates
|
|
75
|
+
* whether Enter/Tab may invoke with an empty argument, never what the argument means.
|
|
76
|
+
*/
|
|
77
|
+
export interface ComposerDiscoveryArgument {
|
|
78
|
+
placeholder: string;
|
|
79
|
+
required?: boolean;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* One provider-neutral resource the host wants the composer to expose.
|
|
83
|
+
*
|
|
84
|
+
* `kind` is intentionally an open string: Jini filters and renders the value but never switches
|
|
85
|
+
* on a host-owned taxonomy such as "plugin" or "skill". `insertText` is the text Jini places in
|
|
86
|
+
* the draft when the item is selected; hosts that need a side effect can use
|
|
87
|
+
* `onDiscoverySelect` without coupling the package to an inventory provider.
|
|
88
|
+
*/
|
|
89
|
+
export interface ComposerDiscoveryItem {
|
|
90
|
+
id: string;
|
|
91
|
+
label: string;
|
|
92
|
+
description?: string;
|
|
93
|
+
kind?: string;
|
|
94
|
+
keywords?: readonly string[];
|
|
95
|
+
insertText?: string;
|
|
96
|
+
/**
|
|
97
|
+
* Stable, untranslated word matched against typed input after `/`, e.g. `"mcp"` for `/mcp`.
|
|
98
|
+
* An item with no `command` never participates in slash-argument grammar — it keeps today's
|
|
99
|
+
* macro behavior exactly (plus-menu and fuzzy label/description/kind/keyword matching only).
|
|
100
|
+
* Kept separate from `label`, which is translated at render time and therefore unsafe as a
|
|
101
|
+
* match key the instant a second locale exists.
|
|
102
|
+
*/
|
|
103
|
+
command?: string;
|
|
104
|
+
/** See {@link ComposerDiscoveryArgument}. Absent for a command with no trailing argument. */
|
|
105
|
+
argument?: ComposerDiscoveryArgument;
|
|
106
|
+
/**
|
|
107
|
+
* Presence-only signal that the host treats this item's effect as consequential enough to
|
|
108
|
+
* warrant confirmation before it commits. Jini never disables or gates selection on this — it
|
|
109
|
+
* is the host's own concern once `onDiscoverySelect` runs; the package may render it as a cue.
|
|
110
|
+
*/
|
|
111
|
+
needsConfirmation?: boolean;
|
|
112
|
+
}
|
|
113
|
+
/** A labelled group in the composer's add menu and slash autocomplete. */
|
|
114
|
+
export interface ComposerDiscoveryGroup {
|
|
115
|
+
id: string;
|
|
116
|
+
label: string;
|
|
117
|
+
items: readonly ComposerDiscoveryItem[];
|
|
118
|
+
}
|
|
119
|
+
export interface ComposerDiscoverySelection {
|
|
120
|
+
item: ComposerDiscoveryItem;
|
|
121
|
+
source: 'plus' | 'slash';
|
|
122
|
+
/**
|
|
123
|
+
* Present only when `item.command` is set and a selection was resolved past the "still
|
|
124
|
+
* completing the command word" stage (see `resolveComposerSlashInvocation` in
|
|
125
|
+
* `composer-discovery.ts`): `null` when no separator was typed (`/mcp`), `''` when a separator
|
|
126
|
+
* was typed with nothing after it (`/mcp `), otherwise the verbatim trailing text.
|
|
127
|
+
*/
|
|
128
|
+
argument?: string | null;
|
|
129
|
+
}
|
|
130
|
+
/** A host effect's synchronous or resolved return value. Absent/`void` leaves the draft untouched. */
|
|
131
|
+
export interface ComposerDiscoveryOutcome {
|
|
132
|
+
/** Replace the draft only when the host explicitly supplies this property. */
|
|
133
|
+
draft?: string;
|
|
134
|
+
}
|
|
135
|
+
/** One `@`-mention entry an OD skill/file/plugin picker (or any host source) supplies. */
|
|
136
|
+
export interface MentionResult {
|
|
137
|
+
id: string;
|
|
138
|
+
label: string;
|
|
139
|
+
description?: string;
|
|
140
|
+
insertText?: string;
|
|
141
|
+
}
|
|
142
|
+
export interface MentionSource {
|
|
143
|
+
id: string;
|
|
144
|
+
label: string;
|
|
145
|
+
/** Trigger character(s), e.g. `'@'`. Defaults to `'@'` when omitted. */
|
|
146
|
+
trigger?: string;
|
|
147
|
+
search: (query: string) => MentionResult[] | Promise<MentionResult[]>;
|
|
148
|
+
}
|
|
149
|
+
export interface ComposerSlots {
|
|
150
|
+
plusMenuItems?: ComposerPlusItem[];
|
|
151
|
+
/** Data-only host inventory rendered by the generic grouped add and slash primitives. */
|
|
152
|
+
discoveryGroups?: readonly ComposerDiscoveryGroup[];
|
|
153
|
+
/**
|
|
154
|
+
* Optional host effect invoked after Jini applies the selected item's draft insertion (for a
|
|
155
|
+
* plain macro item) or, for a `command`-bearing item, once an invocation is resolved (see
|
|
156
|
+
* `ComposerDiscoverySelection.argument`). The host may return a {@link ComposerDiscoveryOutcome}
|
|
157
|
+
* to set the final draft — e.g. replacing `/search cats` with the composed instruction text a
|
|
158
|
+
* tool call produced — without owning any part of the trigger/filter/keyboard mechanism.
|
|
159
|
+
*/
|
|
160
|
+
onDiscoverySelect?: (selection: ComposerDiscoverySelection) => void | ComposerDiscoveryOutcome | Promise<void | ComposerDiscoveryOutcome>;
|
|
161
|
+
mentionSources?: MentionSource[];
|
|
162
|
+
/**
|
|
163
|
+
* The composer's pinned-context zone: whatever a host wants pinned above the input — a
|
|
164
|
+
* SessionModeToggle/DesignSystemSwitchPicker-equivalent, selected plugins, MCP servers, or
|
|
165
|
+
* anything else a future host adds. Deliberately not typed or named after any one of those; this
|
|
166
|
+
* package renders and animates the zone (see `CHAT_PANE_STYLES`'s `.jini-composer-leading`
|
|
167
|
+
* rules) without knowing what a "plugin" or "MCP" is. `undefined`/`null`/absent renders nothing
|
|
168
|
+
* — no reserved space, no seam, no motion — so an idle composer looks exactly like one with no
|
|
169
|
+
* such prop at all.
|
|
170
|
+
*
|
|
171
|
+
* `ChatPane` consumers: read this through its own top-level `leadingAccessory` prop instead —
|
|
172
|
+
* `ChatPaneProps['composerSlots']` excludes this key (see that type's doc) because `ChatPane`
|
|
173
|
+
* always assembles this slot from that prop alone.
|
|
174
|
+
*/
|
|
175
|
+
leadingAccessories?: ReactNode;
|
|
176
|
+
/** Host controls rendered before the send action, such as an agent/model picker. */
|
|
177
|
+
footerAccessories?: ReactNode;
|
|
178
|
+
onAttach?: (a: ChatAttachment) => void;
|
|
179
|
+
annotationAdapter?: AnnotationAdapter;
|
|
180
|
+
}
|
|
181
|
+
export interface AttachmentTraySlot {
|
|
182
|
+
attachments: ChatAttachment[];
|
|
183
|
+
onRemove: (id: string) => void;
|
|
184
|
+
/** Host renders exotic attachment kinds it knows about; falls back to the built-in chip. */
|
|
185
|
+
renderItem?: (a: ChatAttachment) => ReactNode;
|
|
186
|
+
}
|
|
187
|
+
/** Optional comment/annotation bridge (OD's `comments.ts` + `PreviewDrawOverlay`). */
|
|
188
|
+
export interface AnnotationAdapter {
|
|
189
|
+
enabled: boolean;
|
|
190
|
+
toAttachment: (selection: unknown) => ChatAttachment;
|
|
191
|
+
displayName: (a: ChatAttachment) => string;
|
|
192
|
+
}
|
|
193
|
+
/** Host-supplied file-preview UI (OD's `FileViewer`/`FileWorkspace` are product-specific). */
|
|
194
|
+
export interface FilePreviewSlot {
|
|
195
|
+
render: (props: {
|
|
196
|
+
file: ArtifactFile;
|
|
197
|
+
onClose?: () => void;
|
|
198
|
+
}) => ReactNode;
|
|
199
|
+
}
|
|
200
|
+
/** Default no-op; a host wires its own analytics provider through this shape. */
|
|
201
|
+
export interface AnalyticsAdapter {
|
|
202
|
+
track: (event: string, props?: Record<string, unknown>) => void;
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Default passthrough (`t(key)` returns `key`); a host supplies a real
|
|
206
|
+
* dictionary-backed translator. Every user-facing string in this package's
|
|
207
|
+
* components is wrapped in `useT()`'s `t()` — the English string itself is
|
|
208
|
+
* the key, per the i18n policy in
|
|
209
|
+
* `ADS-memory/reports/jini-port/god-components-extraction-plan.md`.
|
|
210
|
+
*/
|
|
211
|
+
export interface I18nAdapter {
|
|
212
|
+
t: (key: string, vars?: Record<string, string | number>) => string;
|
|
213
|
+
locale: string;
|
|
214
|
+
}
|
|
215
|
+
//# sourceMappingURL=slots.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slots.d.ts","sourceRoot":"","sources":["../../src/react/slots.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slots.js","sourceRoot":"","sources":["../../src/react/slots.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jini-ai/chat-react reference stylesheet — structural layout only.
|
|
3
|
+
*
|
|
4
|
+
* NOT applied by default and not exported by package.json — see this package's README for why.
|
|
5
|
+
* Kept here as a documented starting point for a host writing their own CSS against this
|
|
6
|
+
* package's `jini-*` class names, not as something to `import` as-is.
|
|
7
|
+
*
|
|
8
|
+
* Every rule here exists because, without it, a plain-HTML default (inline elements that don't
|
|
9
|
+
* stack, an inline-block that doesn't shrink to fit a narrow parent, a block box that forces a
|
|
10
|
+
* line break next to a sibling) produces a visibly broken layout — not because it looks nicer.
|
|
11
|
+
* No colors, fonts, borders, or spacing/gap values: that stays a host decision. Selectors are
|
|
12
|
+
* flat single classes with no `.jini-chat-pane` nesting, so they apply whether these components
|
|
13
|
+
* are composed directly (this package's own README usage example) or through the
|
|
14
|
+
* batteries-included `<ChatPane>`.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/* ---- Composer (react/components/Composer.tsx) ---- */
|
|
18
|
+
|
|
19
|
+
/* A bare <textarea> has an intrinsic ~20-character width (the `cols` default) and sits as an
|
|
20
|
+
inline-block box between its block siblings — without this it renders far narrower than its
|
|
21
|
+
container, not full width. */
|
|
22
|
+
.jini-composer-input {
|
|
23
|
+
display: block;
|
|
24
|
+
box-sizing: border-box;
|
|
25
|
+
width: 100%;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/* The footer's children (.jini-composer-attachment-picker, .jini-composer-footer-accessories,
|
|
29
|
+
.jini-composer-plus-menu are <div>s; .jini-composer-send is a <button>) are a mix of block and
|
|
30
|
+
inline-block boxes — without flex, the block ones each force their own line, stacking the
|
|
31
|
+
footer into several rows instead of one. */
|
|
32
|
+
.jini-composer-footer {
|
|
33
|
+
display: flex;
|
|
34
|
+
align-items: center;
|
|
35
|
+
flex-wrap: wrap;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/* Lets a long agent name inside (e.g. an AgentRuntimePicker trigger) shrink and ellipsis instead
|
|
39
|
+
of forcing the row wider — flex items default to min-width:auto, which blocks shrinking below
|
|
40
|
+
content size unless every ancestor in the chain opts out. Docked into a narrow sidebar (< 400px)
|
|
41
|
+
is exactly where this stops being cosmetic. */
|
|
42
|
+
.jini-composer-footer-accessories {
|
|
43
|
+
min-width: 0;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/* The grouped add menu and slash autocomplete anchor to the composer rather than escaping the
|
|
47
|
+
host's layout. Visual tokens remain the host's responsibility. */
|
|
48
|
+
.jini-composer,
|
|
49
|
+
.jini-composer-discovery {
|
|
50
|
+
position: relative;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.jini-composer-discovery-menu,
|
|
54
|
+
.jini-composer-slash-menu {
|
|
55
|
+
position: absolute;
|
|
56
|
+
z-index: 1;
|
|
57
|
+
display: flex;
|
|
58
|
+
flex-direction: column;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.jini-composer-discovery-menu { inset-inline-start: 0; bottom: 100%; }
|
|
62
|
+
.jini-composer-slash-menu { inset-inline: 0; bottom: 100%; }
|
|
63
|
+
.jini-composer-discovery-group { display: flex; flex-direction: column; }
|
|
64
|
+
.jini-composer-discovery-item { display: flex; flex-direction: column; align-items: flex-start; }
|
|
65
|
+
.jini-composer-discovery-item.is-active {
|
|
66
|
+
font-weight: 600;
|
|
67
|
+
outline: 1px solid currentColor;
|
|
68
|
+
outline-offset: -1px;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/* Stays in the DOM (not display:none) so the button that triggers it via ref.click() keeps
|
|
72
|
+
working, but hidden the same way any visually-hidden-but-functional control is — never with
|
|
73
|
+
opacity/visibility alone — so the browser's native file-input chrome never paints over the
|
|
74
|
+
custom attach button. */
|
|
75
|
+
.jini-composer-file-input {
|
|
76
|
+
position: absolute;
|
|
77
|
+
width: 1px;
|
|
78
|
+
height: 1px;
|
|
79
|
+
overflow: hidden;
|
|
80
|
+
clip: rect(0, 0, 0, 0);
|
|
81
|
+
white-space: nowrap;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/* Without this, "still uploading"/"still scanning" never visibly spins — the element just sits
|
|
85
|
+
static, which defeats the one thing a spinner icon exists to communicate. */
|
|
86
|
+
.jini-composer-spinner,
|
|
87
|
+
.jini-runtime-spinner,
|
|
88
|
+
.jini-icon-spin {
|
|
89
|
+
animation: jini-chat-react-spin 0.8s linear infinite;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
@keyframes jini-chat-react-spin {
|
|
93
|
+
to {
|
|
94
|
+
transform: rotate(360deg);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/* ---- AttachmentTray (react/components/AttachmentTray.tsx) ---- */
|
|
99
|
+
|
|
100
|
+
/* Each chip is a <div> (block) — without flex, chips stack one per line instead of forming a row. */
|
|
101
|
+
.jini-attachment-tray {
|
|
102
|
+
display: flex;
|
|
103
|
+
flex-wrap: wrap;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/* Once .jini-attachment-chip-body below becomes a flex container, its outer display becomes
|
|
107
|
+
block; without flex here too, that now-block body forces the remove button onto a separate
|
|
108
|
+
line instead of sitting beside it. */
|
|
109
|
+
.jini-attachment-chip {
|
|
110
|
+
display: flex;
|
|
111
|
+
align-items: center;
|
|
112
|
+
min-width: 0;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.jini-attachment-remove,
|
|
116
|
+
.jini-attachment-chip-icon {
|
|
117
|
+
flex: 0 0 auto;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/* chip-body is a <span> wrapping an icon <span> and a copy <span> — both inline by default, so
|
|
121
|
+
without flex here the (post-fix, block-level) copy element drops to its own line under the
|
|
122
|
+
icon instead of sitting beside it. */
|
|
123
|
+
.jini-attachment-chip-body {
|
|
124
|
+
display: flex;
|
|
125
|
+
align-items: center;
|
|
126
|
+
min-width: 0;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/* The name/size pair are sibling inline elements (<span>/<small>) — without flex-direction:
|
|
130
|
+
column they render on the same line ("filename.png 24 KB") instead of stacked. */
|
|
131
|
+
.jini-attachment-chip-copy {
|
|
132
|
+
display: flex;
|
|
133
|
+
flex-direction: column;
|
|
134
|
+
min-width: 0;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.jini-attachment-chip-name,
|
|
138
|
+
.jini-attachment-chip-size {
|
|
139
|
+
overflow: hidden;
|
|
140
|
+
text-overflow: ellipsis;
|
|
141
|
+
white-space: nowrap;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/* ---- MessageList (react/components/MessageList.tsx) ---- */
|
|
145
|
+
|
|
146
|
+
/* The intended scrollback region; min-height:0 relaxes the default min-height:auto that would
|
|
147
|
+
otherwise block it from shrinking inside a flex/grid parent instead of scrolling. */
|
|
148
|
+
.jini-message-list {
|
|
149
|
+
overflow-y: auto;
|
|
150
|
+
min-height: 0;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/* ---- ChatPane (features/chat-pane/react/components/ChatPane.tsx) ---- */
|
|
154
|
+
|
|
155
|
+
/*
|
|
156
|
+
* The two traps from tovu-learnings.md §7:
|
|
157
|
+
*
|
|
158
|
+
* __controls wraps the suggestions row, status banners, and composer area (via
|
|
159
|
+
* ChatPaneComposerArea's fragment) as siblings. It renders with no inline style at all, so a
|
|
160
|
+
* consumer who reasonably adds `display: flex` for gap/alignment (a natural first guess for a
|
|
161
|
+
* composer-area wrapper) gets the browser's row default — suggestions and the composer end up
|
|
162
|
+
* side by side, squeezing the composer into a sliver. Column is the direction the actual content
|
|
163
|
+
* needs regardless of who styles it.
|
|
164
|
+
*
|
|
165
|
+
* __drop-target (the file-drag-drop wrapper the composer renders inside,
|
|
166
|
+
* data-testid="chat-pane-file-drop-target") is a flex child of __controls once the above is
|
|
167
|
+
* fixed. Without flex:1 it shrink-wraps to its content's intrinsic width instead of filling the
|
|
168
|
+
* row — invisible in a full-width page layout (enough slack that shrink-to-content and
|
|
169
|
+
* fill-available look the same), real once the pane is docked into a narrower container (e.g. a
|
|
170
|
+
* 380px sidebar panel).
|
|
171
|
+
*/
|
|
172
|
+
.jini-chat-pane__controls {
|
|
173
|
+
display: flex;
|
|
174
|
+
flex-direction: column;
|
|
175
|
+
min-width: 0;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.jini-chat-pane__drop-target {
|
|
179
|
+
display: flex;
|
|
180
|
+
flex-direction: column;
|
|
181
|
+
flex: 1;
|
|
182
|
+
min-width: 0;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/* .jini-chat-pane__heading is a <div> (block), .jini-chat-pane__new-thread is a <button>
|
|
186
|
+
(inline-block) — without flex the heading forces the button onto its own line below it. */
|
|
187
|
+
.jini-chat-pane__header {
|
|
188
|
+
display: flex;
|
|
189
|
+
align-items: center;
|
|
190
|
+
justify-content: space-between;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.jini-chat-pane__heading {
|
|
194
|
+
min-width: 0;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.jini-chat-pane__title {
|
|
198
|
+
overflow: hidden;
|
|
199
|
+
text-overflow: ellipsis;
|
|
200
|
+
white-space: nowrap;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/* The plain-text fallback branch (no working-directory picker slot) renders a <strong>/<code>
|
|
204
|
+
pair; flex + min-width:0 on the row and flex:1 + min-width:0 on the code element are what let
|
|
205
|
+
a long path actually ellipsis instead of overflowing once the pane narrows. */
|
|
206
|
+
.jini-chat-pane__workdir {
|
|
207
|
+
display: flex;
|
|
208
|
+
align-items: center;
|
|
209
|
+
min-width: 0;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.jini-chat-pane__workdir code {
|
|
213
|
+
flex: 1;
|
|
214
|
+
min-width: 0;
|
|
215
|
+
overflow: hidden;
|
|
216
|
+
text-overflow: ellipsis;
|
|
217
|
+
white-space: nowrap;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/* ---- AgentRuntimePicker (features/chat-pane/react/components/AgentRuntimePicker.tsx) ---- */
|
|
221
|
+
|
|
222
|
+
/* An inline-flex element shrink-wraps its content by default and does not shrink to fit a
|
|
223
|
+
narrower parent on its own (unlike a flex item, which min-width:0 already covers elsewhere in
|
|
224
|
+
this file) — max-width:100% is what stops the trigger from overflowing .jini-runtime-picker
|
|
225
|
+
once the agent name + model name are wider than the space available, the same "docked into a
|
|
226
|
+
380px sidebar" scenario the two named traps above describe. */
|
|
227
|
+
.jini-runtime-picker {
|
|
228
|
+
min-width: 0;
|
|
229
|
+
max-width: 100%;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
.jini-runtime-trigger {
|
|
233
|
+
display: inline-flex;
|
|
234
|
+
align-items: center;
|
|
235
|
+
min-width: 0;
|
|
236
|
+
max-width: 100%;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
/* Both wrap a sibling <strong>/<small> pair — inline by default, so without flex-direction:
|
|
240
|
+
column the agent name and model/status line render on the same line instead of stacked. */
|
|
241
|
+
.jini-runtime-trigger__copy,
|
|
242
|
+
.jini-runtime-agent__copy {
|
|
243
|
+
display: flex;
|
|
244
|
+
flex-direction: column;
|
|
245
|
+
min-width: 0;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
.jini-runtime-agent__copy {
|
|
249
|
+
flex: 1;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
.jini-runtime-trigger__copy strong,
|
|
253
|
+
.jini-runtime-trigger__copy small,
|
|
254
|
+
.jini-runtime-agent__copy strong,
|
|
255
|
+
.jini-runtime-agent__copy small {
|
|
256
|
+
overflow: hidden;
|
|
257
|
+
text-overflow: ellipsis;
|
|
258
|
+
white-space: nowrap;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
.jini-runtime-agent-icon,
|
|
262
|
+
.jini-runtime-trigger__chevron,
|
|
263
|
+
.jini-runtime-check {
|
|
264
|
+
flex: 0 0 auto;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/* Each is a <button> (inline-block) holding an icon + label(s) as inline siblings — flex gives
|
|
268
|
+
it both a full-width row (so a list of these reads as uniform rows, not content-sized buttons
|
|
269
|
+
sitting side by side) and lays out its own icon/label/meta children in a line. */
|
|
270
|
+
.jini-runtime-mode,
|
|
271
|
+
.jini-runtime-agent,
|
|
272
|
+
.jini-runtime-rescan {
|
|
273
|
+
display: flex;
|
|
274
|
+
align-items: center;
|
|
275
|
+
width: 100%;
|
|
276
|
+
box-sizing: border-box;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
.jini-runtime-mode__meta,
|
|
280
|
+
.jini-runtime-agent__status {
|
|
281
|
+
flex: 0 0 auto;
|
|
282
|
+
margin-left: auto;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
/* Sibling <strong>/<span> pair — inline by default, needs flex-direction:column to stack. */
|
|
286
|
+
.jini-runtime-popover__head {
|
|
287
|
+
display: flex;
|
|
288
|
+
flex-direction: column;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
/* A <label> wrapping a <span> and a <select> — <label> is inline by default, so without
|
|
292
|
+
flex-direction:column the "Model"/"Reasoning" text and the dropdown render on the same line
|
|
293
|
+
instead of label-above-input; multiple sibling <label>s also need this to stack as separate
|
|
294
|
+
rows rather than flow inline next to each other. */
|
|
295
|
+
.jini-runtime-select {
|
|
296
|
+
display: flex;
|
|
297
|
+
flex-direction: column;
|
|
298
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module tool-renderer-registry
|
|
3
|
+
*
|
|
4
|
+
* Per-tool renderer registry — ships "as-is" per
|
|
5
|
+
* `ADS-memory/reports/jini-port/recon/r4b-webui-design.md` §2 ("SHIP AS-IS, runtime/tool-renderers.ts").
|
|
6
|
+
* Origin: `apps/web/src/runtime/tool-renderers.ts`'s registration mechanism
|
|
7
|
+
* (verified 0 OD product references — the pure `deriveToolStatus`/
|
|
8
|
+
* `toRenderProps` half of that file already lives in `@jini-ai/chat/core`'s
|
|
9
|
+
* `tools.ts`; this module is only the React-typed registry half chat-core
|
|
10
|
+
* deliberately did not port).
|
|
11
|
+
*
|
|
12
|
+
* The open-design analogue of CopilotKit's `useCopilotAction({ render })`
|
|
13
|
+
* and AG-UI's tool render-prop contract. `<ToolCard>` consults this registry
|
|
14
|
+
* before its own built-in family cards, so a host (or a skill/plugin) can
|
|
15
|
+
* override or extend tool rendering without forking the component.
|
|
16
|
+
*/
|
|
17
|
+
import type { ReactNode } from 'react';
|
|
18
|
+
import type { ToolRenderProps } from '../core/index.js';
|
|
19
|
+
/**
|
|
20
|
+
* Tool render callback. Mirrors AG-UI's `({ status, args, result, ... })`
|
|
21
|
+
* render-prop shape.
|
|
22
|
+
*
|
|
23
|
+
* The callback runs inside `<ToolCard>`'s render — it is not mounted as its
|
|
24
|
+
* own component, so it must be hook-free. If you need hooks, return a
|
|
25
|
+
* component element instead: `(props) => <MyHookfulCard {...props} />`.
|
|
26
|
+
*
|
|
27
|
+
* Returning `null`/`undefined`/`false` defers to `<ToolCard>`'s next lookup
|
|
28
|
+
* step (a built-in family card, then the generic fallback).
|
|
29
|
+
*/
|
|
30
|
+
export type ToolRenderer = (props: ToolRenderProps) => ReactNode;
|
|
31
|
+
/**
|
|
32
|
+
* Register a renderer for a tool name. Returns an unregister handle so
|
|
33
|
+
* tests / hot-reloads can dispose cleanly. Names are matched case-sensitively
|
|
34
|
+
* against `tool_use.name`. Re-registering the same name overwrites — last
|
|
35
|
+
* writer wins.
|
|
36
|
+
*/
|
|
37
|
+
export declare function registerToolRenderer(name: string, renderer: ToolRenderer): () => void;
|
|
38
|
+
export declare function getToolRenderer(name: string): ToolRenderer | undefined;
|
|
39
|
+
/** Visible mainly for tests. */
|
|
40
|
+
export declare function clearToolRenderers(): void;
|
|
41
|
+
//# sourceMappingURL=tool-renderer-registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-renderer-registry.d.ts","sourceRoot":"","sources":["../../src/react/tool-renderer-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAExD;;;;;;;;;;GAUG;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,KAAK,EAAE,eAAe,KAAK,SAAS,CAAC;AAIjE;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,YAAY,GAAG,MAAM,IAAI,CAKrF;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CAEtE;AAED,gCAAgC;AAChC,wBAAgB,kBAAkB,IAAI,IAAI,CAEzC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
const renderers = new Map();
|
|
2
|
+
/**
|
|
3
|
+
* Register a renderer for a tool name. Returns an unregister handle so
|
|
4
|
+
* tests / hot-reloads can dispose cleanly. Names are matched case-sensitively
|
|
5
|
+
* against `tool_use.name`. Re-registering the same name overwrites — last
|
|
6
|
+
* writer wins.
|
|
7
|
+
*/
|
|
8
|
+
export function registerToolRenderer(name, renderer) {
|
|
9
|
+
renderers.set(name, renderer);
|
|
10
|
+
return () => {
|
|
11
|
+
if (renderers.get(name) === renderer)
|
|
12
|
+
renderers.delete(name);
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export function getToolRenderer(name) {
|
|
16
|
+
return renderers.get(name);
|
|
17
|
+
}
|
|
18
|
+
/** Visible mainly for tests. */
|
|
19
|
+
export function clearToolRenderers() {
|
|
20
|
+
renderers.clear();
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=tool-renderer-registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-renderer-registry.js","sourceRoot":"","sources":["../../src/react/tool-renderer-registry.ts"],"names":[],"mappings":"AAgCA,MAAM,SAAS,GAAG,IAAI,GAAG,EAAwB,CAAC;AAElD;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAAY,EAAE,QAAsB;IACvE,SAAS,CAAC,GAAG,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IAC9B,OAAO,GAAG,EAAE;QACV,IAAI,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,QAAQ;YAAE,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC/D,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,IAAY;IAC1C,OAAO,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AAC7B,CAAC;AAED,gCAAgC;AAChC,MAAM,UAAU,kBAAkB;IAChC,SAAS,CAAC,KAAK,EAAE,CAAC;AACpB,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Drops keys whose value is `undefined`, preserving required keys as required.
|
|
3
|
+
*
|
|
4
|
+
* `tsconfig.base.json` sets `exactOptionalPropertyTypes: true`, so `{ placeholder: undefined }` is
|
|
5
|
+
* NOT assignable to `{ placeholder?: string }` — the property has to be absent, not present-and-
|
|
6
|
+
* undefined. Forwarding a handful of optional props therefore costs one
|
|
7
|
+
* `...(x === undefined ? {} : { x })` ternary each, and those ternaries were the single largest
|
|
8
|
+
* contributor to this feature's complexity scores (14 of `ChatPane`'s 52 cyclomatic points, 10 of
|
|
9
|
+
* `useChatPane`'s 15). This collapses all of them into one branch, here.
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* `T` with `undefined` removed from every value type, and only the keys that admitted `undefined`
|
|
13
|
+
* made optional. Keys that never admitted it stay required, so a caller cannot accidentally launder
|
|
14
|
+
* a required prop into an optional one by routing it through {@link definedProps}.
|
|
15
|
+
*/
|
|
16
|
+
export type DefinedProps<T> = {
|
|
17
|
+
[K in keyof T as undefined extends T[K] ? never : K]: T[K];
|
|
18
|
+
} & {
|
|
19
|
+
[K in keyof T as undefined extends T[K] ? K : never]?: Exclude<T[K], undefined>;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Returns `source` without its `undefined`-valued keys.
|
|
23
|
+
*
|
|
24
|
+
* `null` is preserved — it is a meaningful value for props like `workingDirectory`, where `null`
|
|
25
|
+
* means "explicitly none" and `undefined` means "not supplied". Collapsing the two would silently
|
|
26
|
+
* change which of a controlled/uncontrolled pair wins.
|
|
27
|
+
*
|
|
28
|
+
* @complexity Time: O(n) in the key count; space: O(n) for the returned object.
|
|
29
|
+
*/
|
|
30
|
+
export declare function definedProps<T extends object>(source: T): DefinedProps<T>;
|
|
31
|
+
//# sourceMappingURL=defined-props.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defined-props.d.ts","sourceRoot":"","sources":["../../../src/react/util/defined-props.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH;;;;GAIG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,IACtB;KAAG,CAAC,IAAI,MAAM,CAAC,IAAI,SAAS,SAAS,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAE,GAC9D;KAAG,CAAC,IAAI,MAAM,CAAC,IAAI,SAAS,SAAS,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC;CAAE,CAAC;AAExF;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,MAAM,EAAE,MAAM,EAAE,CAAC,GAAG,YAAY,CAAC,CAAC,CAAC,CAMzE"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Drops keys whose value is `undefined`, preserving required keys as required.
|
|
3
|
+
*
|
|
4
|
+
* `tsconfig.base.json` sets `exactOptionalPropertyTypes: true`, so `{ placeholder: undefined }` is
|
|
5
|
+
* NOT assignable to `{ placeholder?: string }` — the property has to be absent, not present-and-
|
|
6
|
+
* undefined. Forwarding a handful of optional props therefore costs one
|
|
7
|
+
* `...(x === undefined ? {} : { x })` ternary each, and those ternaries were the single largest
|
|
8
|
+
* contributor to this feature's complexity scores (14 of `ChatPane`'s 52 cyclomatic points, 10 of
|
|
9
|
+
* `useChatPane`'s 15). This collapses all of them into one branch, here.
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Returns `source` without its `undefined`-valued keys.
|
|
13
|
+
*
|
|
14
|
+
* `null` is preserved — it is a meaningful value for props like `workingDirectory`, where `null`
|
|
15
|
+
* means "explicitly none" and `undefined` means "not supplied". Collapsing the two would silently
|
|
16
|
+
* change which of a controlled/uncontrolled pair wins.
|
|
17
|
+
*
|
|
18
|
+
* @complexity Time: O(n) in the key count; space: O(n) for the returned object.
|
|
19
|
+
*/
|
|
20
|
+
export function definedProps(source) {
|
|
21
|
+
const result = {};
|
|
22
|
+
for (const [key, value] of Object.entries(source)) {
|
|
23
|
+
if (value !== undefined)
|
|
24
|
+
result[key] = value;
|
|
25
|
+
}
|
|
26
|
+
return result;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=defined-props.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defined-props.js","sourceRoot":"","sources":["../../../src/react/util/defined-props.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAWH;;;;;;;;GAQG;AACH,MAAM,UAAU,YAAY,CAAmB,MAAS;IACtD,MAAM,MAAM,GAA4B,EAAE,CAAC;IAC3C,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAClD,IAAI,KAAK,KAAK,SAAS;YAAE,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;IAC/C,CAAC;IACD,OAAO,MAAyB,CAAC;AACnC,CAAC"}
|