omp packages

pi-conversation-timer1.2.2

Active task timer extension for Pi coding agent

cyrenexus Published 1 month ago MIT ~973 downloads/mo

Untested on omp

This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.

Did it work for you?

Result

One report per person. A new report replaces your old one.

Reports 0

No reports yet.

Readme

pi-conversation-timer

Active task timer and statusline extension for Pi Coding Agent.

pi-conversation-timer tracks pure active task execution time across prompt submission to full settlement (agent_settled), keeping time static when idle.

✨ Features

  • Zero-drift active tracking: Only counts active work duration while Pi is processing, calling tools, and generating responses. Time stays completely static when waiting for user input.
  • Smart human-in-the-loop compensation: Automatically pauses the work timer when interactive confirmation dialogs (ui_prompt_start) appear, ensuring user decision time is not counted as AI execution time.
  • Whole-task lifecycle accounting: Accurately tracks the entire duration from prompt submission (before_agent_start) to final completion (agent_settled), across multiple tool turns and iterations.
  • Real provider-authoritative token speed: Exclusively relies on official provider API usage reports (usage.output) and pure emission time (Time-To-First-Token to Last-Token), completely eliminating inaccurate local character heuristics or tool execution interference.
  • Clean integer seconds & multi-scale time: Output format strictly uses integer seconds (e.g. 12s, 45s, 1m 20s, 2h 15m, 1d 2h), avoiding confusing decimals.
  • Theme-aware statusline: Native TUI integration using ctx.ui.setStatus with current theme coloring.
  • Compaction & reload safety: Full session-scoped state persistence via pi.appendEntry and bounded LRU local cache so timing and speeds are never lost across /reload or session compaction.
  • Detailed statistics & reset: /chat-time displays complete session metrics including total active time, task counts, token outputs, and average speed; /chat-time reset resets the current session counters on demand.

📦 Install

pi install npm:pi-conversation-timer

Or install from git:

pi install git:github.com/Agonieler/pi-conversation-timer

Restart Pi or run /reload after installation.

🚀 Usage

Once loaded, the timer appears automatically in the bottom statusline:

  • Idle state:
    ⏱ 累计 45s · 上轮 12s · 68 t/s
    
  • Working state:
    ⏱ 累计 52s · 工作中 7s · 62 t/s
    

Commands

| /chat-time | View detailed active time breakdown, token throughput, and task statistics in a popup | | /chat-time reset | Reset timer and token metrics for the current session | | /dialogue-time | Alias for /chat-time |

📄 License

MIT