forked from Rockachopa/Timmy-time-dashboard
This commit is contained in:
@@ -96,14 +96,10 @@ def _decide_autonomous(req, tool_name: str, tool_args: dict) -> None:
|
||||
logger.info("AUTO-APPROVED (allowlist): %s", tool_name)
|
||||
else:
|
||||
req.reject(note="Auto-rejected: not in allowlist")
|
||||
logger.info(
|
||||
"AUTO-REJECTED (not allowlisted): %s %s", tool_name, str(tool_args)[:100]
|
||||
)
|
||||
logger.info("AUTO-REJECTED (not allowlisted): %s %s", tool_name, str(tool_args)[:100])
|
||||
|
||||
|
||||
def _handle_tool_confirmation(
|
||||
agent, run_output, session_id: str, *, autonomous: bool = False
|
||||
):
|
||||
def _handle_tool_confirmation(agent, run_output, session_id: str, *, autonomous: bool = False):
|
||||
"""Prompt user to approve/reject dangerous tool calls.
|
||||
|
||||
When Agno pauses a run because a tool requires confirmation, this
|
||||
@@ -177,9 +173,7 @@ def think(
|
||||
):
|
||||
"""Ask Timmy to think carefully about a topic."""
|
||||
timmy = create_timmy(backend=backend, session_id=_CLI_SESSION_ID)
|
||||
timmy.print_response(
|
||||
f"Think carefully about: {topic}", stream=True, session_id=_CLI_SESSION_ID
|
||||
)
|
||||
timmy.print_response(f"Think carefully about: {topic}", stream=True, session_id=_CLI_SESSION_ID)
|
||||
|
||||
|
||||
def _read_message_input(message: list[str]) -> str:
|
||||
@@ -252,9 +246,7 @@ def chat(
|
||||
timmy = create_timmy(backend=backend, session_id=session_id)
|
||||
|
||||
run_output = timmy.run(message_str, stream=False, session_id=session_id)
|
||||
run_output = _handle_tool_confirmation(
|
||||
timmy, run_output, session_id, autonomous=autonomous
|
||||
)
|
||||
run_output = _handle_tool_confirmation(timmy, run_output, session_id, autonomous=autonomous)
|
||||
|
||||
content = run_output.content if hasattr(run_output, "content") else str(run_output)
|
||||
if content:
|
||||
@@ -308,9 +300,7 @@ def repl(
|
||||
break
|
||||
|
||||
try:
|
||||
response = loop.run_until_complete(
|
||||
chat(user_input, session_id=session_id)
|
||||
)
|
||||
response = loop.run_until_complete(chat(user_input, session_id=session_id))
|
||||
if response:
|
||||
typer.echo(response)
|
||||
typer.echo()
|
||||
@@ -373,9 +363,7 @@ def interview(
|
||||
|
||||
typer.echo("Starting interview...\n")
|
||||
transcript = run_interview(
|
||||
chat_fn=lambda msg: loop.run_until_complete(
|
||||
chat(msg, session_id="interview")
|
||||
),
|
||||
chat_fn=lambda msg: loop.run_until_complete(chat(msg, session_id="interview")),
|
||||
on_answer=_on_answer,
|
||||
)
|
||||
|
||||
@@ -396,9 +384,7 @@ def interview(
|
||||
@app.command()
|
||||
def up(
|
||||
dev: bool = typer.Option(False, "--dev", help="Enable hot-reload for development"),
|
||||
build: bool = typer.Option(
|
||||
True, "--build/--no-build", help="Rebuild images before starting"
|
||||
),
|
||||
build: bool = typer.Option(True, "--build/--no-build", help="Rebuild images before starting"),
|
||||
):
|
||||
"""Start Timmy Time in Docker (dashboard + agents)."""
|
||||
cmd = ["docker", "compose"]
|
||||
@@ -432,18 +418,14 @@ def voice(
|
||||
"-w",
|
||||
help="Whisper model: tiny.en, base.en, small.en, medium.en",
|
||||
),
|
||||
use_say: bool = typer.Option(
|
||||
False, "--say", help="Use macOS `say` instead of Piper TTS"
|
||||
),
|
||||
use_say: bool = typer.Option(False, "--say", help="Use macOS `say` instead of Piper TTS"),
|
||||
threshold: float = typer.Option(
|
||||
0.015,
|
||||
"--threshold",
|
||||
"-t",
|
||||
help="Mic silence threshold (RMS). Lower = more sensitive.",
|
||||
),
|
||||
silence: float = typer.Option(
|
||||
1.5, "--silence", help="Seconds of silence to end recording"
|
||||
),
|
||||
silence: float = typer.Option(1.5, "--silence", help="Seconds of silence to end recording"),
|
||||
backend: str | None = _BACKEND_OPTION,
|
||||
model_size: str | None = _MODEL_SIZE_OPTION,
|
||||
):
|
||||
@@ -487,9 +469,7 @@ def focus(
|
||||
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"
|
||||
),
|
||||
clear: bool = typer.Option(False, "--clear", "-c", help="Clear focus and return to broad mode"),
|
||||
):
|
||||
"""Set deep-focus mode on a single problem.
|
||||
|
||||
@@ -525,9 +505,7 @@ def healthcheck(
|
||||
verbose: bool = typer.Option(
|
||||
False, "--verbose", "-v", help="Show verbose output including issue details"
|
||||
),
|
||||
quiet: bool = typer.Option(
|
||||
False, "--quiet", "-q", help="Only show status line (no details)"
|
||||
),
|
||||
quiet: bool = typer.Option(False, "--quiet", "-q", help="Only show status line (no details)"),
|
||||
):
|
||||
"""Quick health snapshot before coding.
|
||||
|
||||
@@ -649,9 +627,7 @@ def learn(
|
||||
|
||||
typer.echo()
|
||||
typer.echo(typer.style("Autoresearch", bold=True) + f" — {target}")
|
||||
typer.echo(
|
||||
f" metric={metric} budget={budget}min max={max_experiments} tox={tox_env}"
|
||||
)
|
||||
typer.echo(f" metric={metric} budget={budget}min max={max_experiments} tox={tox_env}")
|
||||
if dry_run:
|
||||
typer.echo(" (dry-run — no changes will be made)")
|
||||
typer.echo()
|
||||
|
||||
Reference in New Issue
Block a user