6 Commits

Author SHA1 Message Date
open-agents-bot[bot]
1ea5e85153
chore: shared formatTokens util (#664)
* refactor: shared formatTokens util

* style: remove extra blank lines between functions

* test: fix token formatting edge cases and add rounding boundary tests

---------

Co-authored-by: willsather <56037657+willsather@users.noreply.github.com>
2026-04-10 17:37:01 +00:00
Nico Albanese
6d19dd850e
tui: migrate to OpenTUI and update gateway proxy (#130)
* tui: migrate from Ink to OpenTUI for improved input performance

Replace Ink with OpenTUI (@opentui/core, @opentui/react) to fix input lag
issues that were noticeable in long conversations.

Key changes:
- Add ink-shim.tsx compatibility layer to minimize component rewrites
- Replace manual chalk/marked markdown rendering with native <Markdown>
- Use TreeSitter-based syntax highlighting via OpenTUI
- Add ScrollBox with sticky scroll for better chat UX
- Refactor text-input to use segment-based rendering with attributes
- Update renderer initialization to use OpenTUI's createCliRenderer

The shim layer preserves Ink's API surface (Box, Text, useInput, useApp)
while using OpenTUI's renderer underneath. This enables incremental
migration to native OpenTUI patterns in follow-up work.

Removed dependencies: ink, ink-spinner, ink-text-input, cli-highlight
Added dependencies: @opentui/core, @opentui/react

* tui: align layout rows and centralize primary color

* tui: keep tool output readable in narrow terminals

* tui: align assistant text and show copy feedback

* tui: refine input shortcuts and mouse filtering

* tui: chunk stream output by line

* web: format avatar and dropdown menu components

* db: format migration metadata

* tui: use OpenTUI diff and code previews

* tui: refine clipboard toast styling

* fix: fetch models via web api

* feat: surface model context limits

* tui: improve interruption and question flow readability

* fix tui auto-submit after abort

* tui: keep input visible on typing

* chore: add ci script for core checks

* docs: note ci script in agent guide

* fix: use authenticated gateway models

* fix: enrich gateway models with context limits

* update lock

* update agents md
2026-01-30 10:51:52 +00:00
Nico Albanese
805e793967
Display token usage for task tool executions (#103)
* Add token usage reporting for subagents

Display input tokens inline in task views next to tool count and duration.
Shows tokens while streaming and final count on completion.

Changes:
- Add messageMetadata callback to task tool to attach usage data
- Add token display to TUI and web task-group-view components
- Add tokens to task-renderer completion views
- Refactor web task-renderer to use proper types instead of casts
- Switch tool-call.tsx to narrow on part.type instead of derived string
- Add SubagentUIMessage type for proper typing of subagent output

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Consolidate formatTokens and improve type safety

- Move formatTokens to shared package to eliminate duplication across 4 files
- Add getToolSummary helper with proper type narrowing (replaces unsafe cast)
- Simplify IIFE patterns to ternary expressions in task renderers

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Fix tool-write and tool-edit summaries in task renderers

The getToolSummary function was missing cases for tool-write and tool-edit,
causing file paths to not display for executor subagent operations. Updated
SubagentUIMessage to be a union of both explorer and executor types so
TypeScript recognizes these tool types.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Refactor token usage metadata to track last step and total usage separately

Changes metadata from { usage } to { lastStepUsage, totalMessageUsage } to
distinguish between context window utilization (last step) and cumulative
token usage across all steps in a message.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Fix type safety in CLI task renderer

Replace loose typing and unsafe casts with proper SubagentMessagePart
type derived from SubagentUIMessage. Add getToolSummary function that
uses discriminated union narrowing for type-safe tool input access.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 18:16:45 +00:00
Nico Albanese
eca30906a8
Remove .js extensions from all imports across monorepo (#97)
* Remove .js extensions from all imports across the monorepo

Aligns import style by removing .js extensions from all packages,
not just those consumed by the web app. Updates AGENTS.md to reflect
the consistent rule and marks the tech debt item as completed.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix formatting

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 15:31:59 +00:00
Nico Albanese
beecf158e1
Add web app with Next.js UI and shared tool utilities (#62)
* initial web app scaffold

* update styles

* add streamdown

* update

* add deep agent and sandbox

* add renderers for tools

* add shared-context

* update agents md

* migrate to vercel sandbox

* update

* fix version mismatches

* update todos and better focusing

* update agents md

* update sandbox id storage for tool execution approval bug

* add abort

* update support for interruptions

* add support for expanding commands

* update agents md

* handle read tool approval

* code review suggested fixes

* suggested cc review fixes

* cc suggested fix
2026-01-11 17:16:56 +00:00
Nico Albanese
f87c41920b
refacotr shared utils from tui to package (#59)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-10 11:51:59 +01:00