Skip to content

Commit 59fd4bf

Browse files
committed
refactor(plugin-chatbot)!: retire eight zero-consumer entry exports
The plugin-chatbot entry stops publishing useFloatingChatbot with its FloatingChatbotState, FloatingChatbotActions and FloatingChatbotContextValue types, ChatMessageProps, toRuntimeToolInvocation, unwrapToolResult and summarizeChatError. Each name had zero hits outside the package (workspace and hotcrm); every module stays. Claude-Session: https://claude.ai/code/session_01L6bhgTj6bWX8Rq5fpUGNv7 Co-authored-by: Claude <noreply@anthropic.com>
1 parent 48b3ae6 commit 59fd4bf

2 files changed

Lines changed: 30 additions & 18 deletions

File tree

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
'@object-ui/plugin-chatbot': patch
3+
---
4+
5+
refactor(plugin-chatbot)!: retire eight zero-consumer exports (the floating chatbot context hook and its three types, the message item props, one adapter helper and two display helpers)
6+
7+
Clause-②: no (narrowing)
8+
Metadata-protocol: none
9+
10+
<!-- adr-0087: not-required (runtime-export-retired @object-ui/plugin-chatbot#useFloatingChatbot, @object-ui/plugin-chatbot#FloatingChatbotState, @object-ui/plugin-chatbot#FloatingChatbotActions, @object-ui/plugin-chatbot#FloatingChatbotContextValue, @object-ui/plugin-chatbot#ChatMessageProps, @object-ui/plugin-chatbot#toRuntimeToolInvocation, @object-ui/plugin-chatbot#unwrapToolResult, @object-ui/plugin-chatbot#summarizeChatError) the retired operands are a React context hook with its state, actions and context-value types, the props interface of an internal message row, one authored-to-runtime tool-invocation converter and two tool-call display helpers; nothing in the workspace or in hotcrm imports any of them from the package entry, and no packages/spec schema, registered node type, conversion surface or stored shape names them, so there is nothing for `objectstack migrate meta` to rewrite -->
11+
12+
**BREAKING** for a host that imports any of these eight names from `@object-ui/plugin-chatbot`. None had an importer anywhere in the workspace or in hotcrm, so the Console and every `@object-ui/*` package are unaffected. Every module stays in the package: `FloatingChatbotTrigger` and `FloatingChatbotPanel` keep reading the floating state through the hook, `toRuntimeMessages` keeps converting tool invocations, and `ChatbotEnhanced` keeps rendering tool results and error summaries with the two helpers. Only the entry stops publishing them. `FloatingChatbot`, `FloatingChatbotProvider`, `FloatingChatbotTrigger`, `FloatingChatbotPanel` and their `…Props` types, `toRuntimeMessages`, `authoredToRuntimeMessage`, `toRuntimeRole`, `toRuntimeTimestamp`, `toRuntimeToolState`, `humanizeToolName`, `TypingIndicator`, `emitAiUsageRefresh` and `AGENT_ALIAS_GROUPS` stay exported unchanged.
13+
14+
What leaves, and what to write instead:
15+
16+
- FROM `useFloatingChatbot`, `FloatingChatbotState`, `FloatingChatbotActions`, `FloatingChatbotContextValue` TO `FloatingChatbotTrigger` and `FloatingChatbotPanel` inside a `FloatingChatbotProvider`, which open, close and toggle the panel themselves; for a control of your own, hold the open state in your own component.
17+
- FROM `ChatMessageProps` TO `ChatbotProps`: `Chatbot` renders the message rows itself.
18+
- FROM `toRuntimeToolInvocation` TO `toRuntimeMessages` or `authoredToRuntimeMessage`, which convert every tool invocation of a message.
19+
- FROM `unwrapToolResult`, `summarizeChatError` TO no replacement: `ChatbotEnhanced` applies both itself; keep a local copy if your own chat surface needs them.

‎ui/packages/plugin-chatbot/src/index.tsx‎

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,8 @@ const Chatbot = React.forwardRef<HTMLDivElement, ChatbotProps>(
141141
)
142142
Chatbot.displayName = "Chatbot"
143143

144-
// Individual message component
145-
export interface ChatMessageProps {
144+
// Individual message component (its props are local: nothing outside the package named them)
145+
interface ChatMessageProps {
146146
message: ChatbotEnhancedMessage
147147
showTimestamp?: boolean
148148
userAvatarUrl?: string
@@ -284,13 +284,11 @@ export {
284284
// Export floating chatbot components
285285
export { FloatingChatbot } from './FloatingChatbot';
286286
export type { FloatingChatbotProps } from './FloatingChatbot';
287-
export { FloatingChatbotProvider, useFloatingChatbot } from './FloatingChatbotProvider';
288-
export type {
289-
FloatingChatbotProviderProps,
290-
FloatingChatbotState,
291-
FloatingChatbotActions,
292-
FloatingChatbotContextValue,
293-
} from './FloatingChatbotProvider';
287+
// `useFloatingChatbot` and its three state/action/context types left the entry
288+
// with zero importers outside the package; the trigger and panel read it from
289+
// the module.
290+
export { FloatingChatbotProvider } from './FloatingChatbotProvider';
291+
export type { FloatingChatbotProviderProps } from './FloatingChatbotProvider';
294292
export { FloatingChatbotTrigger } from './FloatingChatbotTrigger';
295293
export type { FloatingChatbotTriggerProps } from './FloatingChatbotTrigger';
296294
export { FloatingChatbotPanel } from './FloatingChatbotPanel';
@@ -385,7 +383,6 @@ export {
385383
toRuntimeMessages,
386384
toRuntimeRole,
387385
toRuntimeTimestamp,
388-
toRuntimeToolInvocation,
389386
toRuntimeToolState,
390387
} from './chatMessageAdapter';
391388

@@ -399,14 +396,10 @@ export {
399396
*/
400397
export type { SeamChatMessage, SeamToolInvocation } from './chatMessageAdapter';
401398

402-
// Display helpers used internally by ChatbotEnhanced. Exported so app
403-
// authors composing their own chat surface get the same pretty tool-call
404-
// rendering and friendly error summaries for free.
405-
export {
406-
humanizeToolName,
407-
unwrapToolResult,
408-
summarizeChatError,
409-
} from './tool-display';
399+
// Display helper used internally by ChatbotEnhanced, exported for app authors
400+
// composing their own chat surface. `unwrapToolResult` and `summarizeChatError`
401+
// left the entry with zero importers outside the package.
402+
export { humanizeToolName } from './tool-display';
410403

411404
// HITL (Human-In-The-Loop) pending-actions inbox. Talks to
412405
// `@objectstack/service-ai` at `/api/v1/ai/pending-actions/*`. Shared

0 commit comments

Comments
 (0)