Repository navigation
Commit 3b8b23c
refactor(plugin-chatbot)!: retire eight zero-consumer entry exports (#30576)
<!-- claude-projects-attribution: {"github_login":"os-sales"} -->
_Requested by **Sales** · [project
thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4UuDadpmv8nuw2HbLjjF77YBK)_
Part of #25921. The umbrella stays open; this is the second barrel batch
of claim 6660204183 (amendment 6661865751, seat `domain:ui#6`). The
first batch was #30541.
Clause-②: no (narrowing)
Metadata-protocol: none
## 维护者速读
- 改了什么:`@object-ui/plugin-chatbot` 的包入口不再导出 8 个名字:浮动聊天的上下文钩子
`useFloatingChatbot` 及其三个状态/动作/上下文类型、内部消息行的
`ChatMessageProps`、一个工具调用转换函数、两个工具结果展示辅助函数。模块全部保留,行为不变。
- 为什么改:这 8 个名字在仓内(包外)与 hotcrm 均零引用;本卡逐包收窄无人使用的公开导出。
- 风险与回滚:对外是 breaking 收窄,只影响直接从包入口 import 这些名字的外部宿主;控制台与所有 `@object-ui/*`
包不受影响。回滚即 revert 本 PR。
-
先看:`ui/packages/plugin-chatbot/src/index.tsx`(四处导出改写)、`.changeset/25921-plugin-chatbot-zero-consumer-exports.md`(迁移说明)。
- 两分钟验证:`git grep -l -w -e useFloatingChatbot -e unwrapToolResult -e
summarizeChatError -e toRuntimeToolInvocation --
':!ui/packages/plugin-chatbot' ':!**/CHANGELOG.md'` 应只命中本 PR 的
changeset。
- 需要你做的:无,席位落地。
## What changes
- `ui/packages/plugin-chatbot/src/index.tsx`:
- the entry stops exporting `useFloatingChatbot` and the types
`FloatingChatbotState`, `FloatingChatbotActions`,
`FloatingChatbotContextValue` (`FloatingChatbotProvider` and
`FloatingChatbotProviderProps` stay);
- `ChatMessageProps`, the props of the internal `ChatMessageItem` row,
becomes a local interface;
- `toRuntimeToolInvocation` leaves the adapter export list
(`toRuntimeMessages`, `authoredToRuntimeMessage`, `toRuntimeRole`,
`toRuntimeTimestamp`, `toRuntimeToolState` stay; the README teaches the
last three and `toRuntimeMessages`);
- `unwrapToolResult` and `summarizeChatError` leave the display-helper
export (`humanizeToolName` stays).
- One new changeset,
`.changeset/25921-plugin-chatbot-zero-consumer-exports.md`: patch level,
`!` title, BREAKING paragraph, FROM/TO lines for every retired name,
ADR-0087 marker `not-required (runtime-export-retired …)` naming all
eight operands.
- No module file is deleted and no test moves: no test imported a
retired name from the entry. `FloatingChatbotTrigger` and
`FloatingChatbotPanel` read the hook from its module,
`toRuntimeMessages` calls `toRuntimeToolInvocation`, and
`ChatbotEnhanced` calls the two display helpers.
## Tests
Census on `origin/main` 75bbebb, re-read at this head on top of
48b3ae6 (same counts), with batch 1's method: the entry's 102 export
names from the TypeScript checker; per name `git grep -o -w -F` outside
`ui/packages/plugin-chatbot`, minus `**/CHANGELOG.md`, lockfiles and
`.changeset/**`; the package README; keep rule 3 (a kept export's
declared type reaches it, by a checker walk); hotcrm `6961ab1`. 44 names
had zero outside hits: 2 are README-taught, 29 are reached by a kept
export's declared type, 8 are retired here, and 5 are kept for a reason:
| Name | Outside hits | hotcrm | Verdict |
|:--|--:|--:|:--|
| `useFloatingChatbot`, `FloatingChatbotState`,
`FloatingChatbotActions`, `FloatingChatbotContextValue` | 0 each | 0 |
retired |
| `ChatMessageProps` | 0 | 0 | retired (now a local interface) |
| `toRuntimeToolInvocation` | 0 | 0 | retired |
| `unwrapToolResult`, `summarizeChatError` | 0 each | 0 | retired |
| `TypingIndicator` | 0 | | kept: `TypingIndicatorProps` is named in a
`plugin-dashboard` comment (prose counts), and the component and its
props go together |
| `emitAiUsageRefresh`, `AGENT_ALIAS_GROUPS` | 0 each | | kept: also
published on the `./core` subpath entry, outside this claim's surface |
| `authoredToRuntimeMessage`, `toRuntimeTimestamp` | 0 each | | kept:
README-taught |
| controls | `ChatbotEnhanced` 51, `humanizeToolName` 10,
`FloatingChatbot` 8, `toRuntimeMessages` 3, `FloatingChatbotProvider` 1;
hotcrm `ListView` 7 | | |
Readings on the batch commit 94dc257f (cut from 75bbebb), before the
move onto this branch:
- `turbo run type-check` for `@object-ui/plugin-chatbot`,
`@object-ui/app-shell`, `@object-ui/console` with their `^build`
closure: 76 of 76 tasks; `vitest run packages/plugin-chatbot/`: Test
Files 95 passed (95), Tests 880 passed (880); one lock VERDICT
command-exit 0.
- `vitest run scripts/` (ui): Test Files 170 passed, 2 skipped (172);
Tests 4985 passed, 2 skipped (4987); VERDICT command-exit 0.
- Reverse check on the rebuilt `.d.ts`: a temporary app-shell probe
importing the eight retired names plus `FloatingChatbotProvider`,
`FloatingChatbotProviderProps`, `toRuntimeMessages`, `humanizeToolName`
and `TypingIndicator` gave exactly eight errors (`TS2305` / `TS2724 …
has no exported member`), one per retired name; the controls resolved.
Probe deleted; `git status` clean.
- `check:readme-exports`: `0 fabricated, 0 stale omission(s)`; exit 1
only on the known `packages/cli` unbuilt prerequisite.
`check-platform-checklist --changed-from origin/main`: exit 0, 0
anchored files.
- Dogfood battery (closure plus `pnpm --filter @objectstack/dogfood
test` under the lock): Test Files 420 passed, 3 skipped (423); Tests
3496 passed, 36 skipped (3532); VERDICT command-exit 0.
- No ablation: export lines removed, no tested behaviour changed.
The re-run on this branch's head 59fd4bf (the cherry-pick onto
48b3ae6) is recorded in the os-dev-report on #25921.
## Acceptance notes
- `emitAiUsageRefresh` and `AGENT_ALIAS_GROUPS` have zero outside hits
on both entries; retiring them means editing `src/core.ts` (the `./core`
subpath), which a later batch can take.
- Branch name is the platform-assigned `claude/project-thread-h719zv`
(batch 1's branch, restarted from `main` after #30541 merged), not
`claude/issue-25921-*`.
- A contract-review-tier review is owed before the queue (narrowing
batch); the seat runs it.
## Verification
Derived gates and the head re-run are in the os-dev-report on #25921; CI
check-runs on this PR are the record for every family CI runs.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01L6bhgTj6bWX8Rq5fpUGNv7)_
Co-authored-by: Claude <noreply@anthropic.com>1 parent 062236c commit 3b8b23c
2 files changed
Lines changed: 30 additions & 18 deletions
File tree
- .changeset
- ui/packages/plugin-chatbot/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
144 | | - | |
145 | | - | |
| 144 | + | |
| 145 | + | |
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
| |||
284 | 284 | | |
285 | 285 | | |
286 | 286 | | |
287 | | - | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
294 | 292 | | |
295 | 293 | | |
296 | 294 | | |
| |||
385 | 383 | | |
386 | 384 | | |
387 | 385 | | |
388 | | - | |
389 | 386 | | |
390 | 387 | | |
391 | 388 | | |
| |||
399 | 396 | | |
400 | 397 | | |
401 | 398 | | |
402 | | - | |
403 | | - | |
404 | | - | |
405 | | - | |
406 | | - | |
407 | | - | |
408 | | - | |
409 | | - | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
410 | 403 | | |
411 | 404 | | |
412 | 405 | | |
| |||
0 commit comments