Improve pi-hypa tool UI rendering#25
Merged
matt-gribben merged 2 commits intoJul 1, 2026
Merged
Conversation
Collaborator
|
@RunMintOn Will review your issue and then review this code and come back to you. Thanks for your contribution. |
Make the pi-hypa package build resolve @earendil-works/pi-tui in its own dependency graph so the UI rendering changes compile in package builds. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Collaborator
|
I addressed the package-build integration issue behind #24 by declaring |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves the Pi extension UX for the @hypabolic/pi-hypa tools by adding custom rendering for tool calls/results, including argument-aware call headers and collapsed previews for long outputs.
Changes:
- Adds
renderCall(...)implementations so tool invocations display their actual input arguments. - Adds
renderResult(...)with a collapsed preview for multi-line tool output plus an expand hint. - Introduces a direct dependency on
@earendil-works/pi-tuito support TUI rendering components.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| packages/pi-hypa/extensions/tools.ts | Adds call/result renderers and preview logic for hypa_shell, hypa_read, hypa_grep, hypa_find, hypa_ls. |
| packages/pi-hypa/package.json | Adds @earendil-works/pi-tui dependency for the new UI rendering. |
| packages/pi-hypa/package-lock.json | Locks @earendil-works/pi-tui (and transitive deps) and updates platform metadata. |
Files not reviewed (1)
- packages/pi-hypa/package-lock.json: Generated file
Comment on lines
383
to
385
| const command = buildReadCommand(params.path, params.offset, params.limit); | ||
| const timeoutMs = params.maxTokens ? undefined : undefined; | ||
| const result = await runHypaCommand(pi, config, command, timeoutMs, false, signal); |
Comment on lines
+315
to
+317
| const preview = styleOutput(lines.slice(0, 12).join("\n")); | ||
| const hint = `\n${theme.fg("muted", `... (${lines.length - 12} more lines, Ctrl+O to expand)`)}`; | ||
| return new Text(`${preview}${hint}`, 0, 0); |
Comment on lines
33
to
36
| "dependencies": { | ||
| "@earendil-works/pi-tui": "^0.79.8", | ||
| "@hypabolic/hypa": "0.1.3" | ||
| }, |
Comment on lines
+291
to
+294
| function previewResultText(result: any, options: { expanded?: boolean; isPartial?: boolean }, theme: any, pendingText: string) { | ||
| if (options?.isPartial) { | ||
| return new Text(theme.fg("muted", pendingText), 0, 0); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds minimal UI-only rendering improvements for:
hypa_shellhypa_readhypa_grephypa_findhypa_lsChanges
renderCall(...)so tool invocations show their actual input argumentsrenderResult(...)so long tool output is previewed in collapsed formNon-goals
This PR does not change:
Note
This branch works in the installed Pi runtime environment used for local testing.
However, syncing the same implementation back into the package source currently exposes an extension integration issue around directly importing Pi TUI components from
pi-hypapackage source. A separate issue is linked for that discussion.Related issue: #24