chore: 移除 bootstrap/state.ts 中 4 个未引用的 export

- clearRegisteredHooks(STATE.registeredHooks 仍由其他函数管理)
- getInvokedSkills(getInvokedSkillsForAgent 是活跃入口)
- getSessionSource(setSessionSource 仍活跃,sessionSource state 字段保留)
- markScrollActivity(scrollDraining/getIsScrollDraining/waitForScrollDrain 仍活跃)

仅删除孤儿访问器,不动模块级 state 副作用。

Co-Authored-By: glm-5.2 <zai-org@claude-code-best.win>
This commit is contained in:
claude-code-best
2026-06-20 11:37:55 +08:00
parent 071895ee53
commit d0414a0a5c

View File

@@ -787,18 +787,6 @@ let scrollDraining = false
let scrollDrainTimer: ReturnType<typeof setTimeout> | undefined
const SCROLL_DRAIN_IDLE_MS = 150
/** Mark that a scroll event just happened. Background intervals gate on
* getIsScrollDraining() and skip their work until the debounce clears. */
export function markScrollActivity(): void {
scrollDraining = true
if (scrollDrainTimer) clearTimeout(scrollDrainTimer)
scrollDrainTimer = setTimeout(() => {
scrollDraining = false
scrollDrainTimer = undefined
}, SCROLL_DRAIN_IDLE_MS)
scrollDrainTimer.unref?.()
}
/** True while scroll is actively draining (within 150ms of last event).
* Intervals should early-return when this is set — the work picks up next
* tick after scroll settles. */
@@ -1103,10 +1091,6 @@ export function setUserMsgOptIn(value: boolean): void {
STATE.userMsgOptIn = value
}
export function getSessionSource(): string | undefined {
return STATE.sessionSource
}
export function setSessionSource(source: string): void {
STATE.sessionSource = source
}
@@ -1433,10 +1417,6 @@ export function getRegisteredHooks(): Partial<
return STATE.registeredHooks
}
export function clearRegisteredHooks(): void {
STATE.registeredHooks = null
}
export function clearRegisteredPluginHooks(): void {
if (!STATE.registeredHooks) {
return
@@ -1527,10 +1507,6 @@ export function addInvokedSkill(
})
}
export function getInvokedSkills(): Map<string, InvokedSkillInfo> {
return STATE.invokedSkills
}
export function getInvokedSkillsForAgent(
agentId: string | undefined | null,
): Map<string, InvokedSkillInfo> {