πŸ“„ File detail

services/autoDream/config.ts

🧩 .tsπŸ“ 22 linesπŸ’Ύ 892 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 isAutoDreamEnabled β€” mainly functions, hooks, or classes. It composes internal code from utils and analytics (relative imports). What the file header says: Leaf config module β€” intentionally minimal imports so UI components can read the auto-dream enabled state without dragging in the forked agent / task registry / message builder chain that autoDream.ts pulls in.

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

🧠 Inline summary

Leaf config module β€” intentionally minimal imports so UI components can read the auto-dream enabled state without dragging in the forked agent / task registry / message builder chain that autoDream.ts pulls in.

πŸ“€ Exports (heuristic)

  • isAutoDreamEnabled

πŸ–₯️ Source preview

// Leaf config module β€” intentionally minimal imports so UI components
// can read the auto-dream enabled state without dragging in the forked
// agent / task registry / message builder chain that autoDream.ts pulls in.

import { getInitialSettings } from '../../utils/settings/settings.js'
import { getFeatureValue_CACHED_MAY_BE_STALE } from '../analytics/growthbook.js'

/**
 * Whether background memory consolidation should run. User setting
 * (autoDreamEnabled in settings.json) overrides the GrowthBook default
 * when explicitly set; otherwise falls through to tengu_onyx_plover.
 */
export function isAutoDreamEnabled(): boolean {
  const setting = getInitialSettings().autoDreamEnabled
  if (setting !== undefined) return setting
  const gb = getFeatureValue_CACHED_MAY_BE_STALE<{ enabled?: unknown } | null>(
    'tengu_onyx_plover',
    null,
  )
  return gb?.enabled === true
}