You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(tui): simplify tool factory and consolidate render helpers
Reduce boilerplate and surface area in pkg/tui/components/tool
without changing behavior. Build, lint, and the full test suite
still pass.
- tool: collapse the Registry+Factory abstraction into a single
package-level lookup table in factory.go and delete registry.go.
The previous types (Registry, Factory, Registration, NewRegistry,
NewFactory, the RWMutex) were never instantiated externally and
added indirection for a static map. Resulting tool.New is the
same API as before.
- toolcommon: introduce NoArgsRenderer for tools that only need
the "icon + name" header (user_prompt, todo_*). userprompt and
todotool/component.go now collapse to a one-line New().
- toolcommon: add Pluralize helper and use it from listdirectory,
directorytree, and searchfilescontent (each had its own
copy/variant). The unit test moves to toolcommon alongside the
helper.
- toolcommon: drop the unused Base getters (Message, SessionState,
Width, Height, Spinner). All renderers receive these directly via
the Renderer signature.
Assisted-By: docker-agent
0 commit comments