πŸ“„ File detail

services/compact/compactWarningState.ts

🧩 .tsπŸ“ 19 linesπŸ’Ύ 693 bytesπŸ“ text
← Back to All Files

🎯 Use case

This file lives under β€œservices/”, which covers long-lived services (LSP, MCP, OAuth, tool execution, memory, compaction, voice, settings sync, …). On the API surface it exposes compactWarningStore, suppressCompactWarning, and clearCompactWarningSuppression β€” mainly functions, hooks, or classes. It composes internal code from state (relative imports).

Generated from folder role, exports, dependency roots, and inline comments β€” not hand-reviewed for every path.

🧠 Inline summary

import { createStore } from '../../state/store.js' /** * Tracks whether the "context left until autocompact" warning should be suppressed. * We suppress immediately after successful compaction since we don't have accurate

πŸ“€ Exports (heuristic)

  • compactWarningStore
  • suppressCompactWarning
  • clearCompactWarningSuppression

πŸ–₯️ Source preview

import { createStore } from '../../state/store.js'

/**
 * Tracks whether the "context left until autocompact" warning should be suppressed.
 * We suppress immediately after successful compaction since we don't have accurate
 * token counts until the next API response.
 */
export const compactWarningStore = createStore<boolean>(false)

/** Suppress the compact warning. Call after successful compaction. */
export function suppressCompactWarning(): void {
  compactWarningStore.setState(() => true)
}

/** Clear the compact warning suppression. Called at start of new compact attempt. */
export function clearCompactWarningSuppression(): void {
  compactWarningStore.setState(() => false)
}