fix: deep focus mode — single-problem context for Timmy (#409)

Co-authored-by: Kimi Agent <kimi@timmy.local>
Co-committed-by: Kimi Agent <kimi@timmy.local>
This commit is contained in:
2026-03-19 02:54:19 -04:00
committed by hermes
parent b67dbe922f
commit 4b617cfcd0
5 changed files with 276 additions and 0 deletions

View File

@@ -416,5 +416,40 @@ def route(
typer.echo("→ orchestrator (no pattern match)")
@app.command()
def focus(
topic: str | None = typer.Argument(
None, help='Topic to focus on (e.g. "three-phase loop"). Omit to show current focus.'
),
clear: bool = typer.Option(False, "--clear", "-c", help="Clear focus and return to broad mode"),
):
"""Set deep-focus mode on a single problem.
When focused, Timmy prioritizes the active topic in all responses
and deprioritizes unrelated context. Focus persists across sessions.
Examples:
timmy focus "three-phase loop" # activate deep focus
timmy focus # show current focus
timmy focus --clear # return to broad mode
"""
from timmy.focus import focus_manager
if clear:
focus_manager.clear()
typer.echo("Focus cleared — back to broad mode.")
return
if topic:
focus_manager.set_topic(topic)
typer.echo(f'Deep focus activated: "{topic}"')
else:
# Show current focus status
if focus_manager.is_focused():
typer.echo(f'Deep focus: "{focus_manager.get_topic()}"')
else:
typer.echo("No active focus (broad mode).")
def main():
app()