feat(project): command-line-only screens for project commands without a TUI - #2177
Conversation
|
Claude Security Review: no high-confidence findings. (run) |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## refactor #2177 +/- ##
============================================
+ Coverage 97.13% 97.15% +0.01%
============================================
Files 541 542 +1
Lines 37618 37726 +108
============================================
+ Hits 36542 36651 +109
+ Misses 1076 1075 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
AgentCore Harness Review
Verdict: Looks good
This is a substantial, well-structured change and I did not find any blocking issues.
Notes I looked into but don't think need changes:
ConfirmActionimmediate-trigger auto-run: theuseEffectthat firesrun()whenphase.kind === "idle" && !isPending && !errorrelies onsetPhase({ kind: "running" })insiderunto prevent re-entry. Under React Strict Mode (double-invoked effects) this could theoretically fireruntwice before the state update flushes, but Ink doesn't enable Strict Mode, so this is fine in practice.useProjectre-keys onprocess.cwd(): because the query key includesfrom = process.cwd()read on every render, a mid-sessionprocess.chdirwould produce a new query missinginitialData. Screens don't chdir mid-session; the tests explicitly chdir before mount. Reasonable as-is.applyProgressEventreturns a fresh array for stray output events:driveProgresswill still callonChangewith a new (identical) task list, causing an extrasetStatein React consumers. Minor, not worth changing.- Telemetry: the referenced
src/cli/telemetry/README.mddoesn't exist in the tree, and telemetry is wired at the CLI wrapper (withCommandRun) rather than inside handlers/screens. So these new TUI screens are on the same footing as the existing ones — no gap introduced. - Test approach: tests use real temp directories,
createRootHandlerto scaffold a project, and stub onlyProjectBackend(a legitimate boundary). Monkey-patchingcore.projectManager.listTargetsto inject a failure is a targeted seam, not excessive mocking.
The refactor of runWithProgress into applyProgressEvent / settleProgress / driveProgress is a nice cleanup and the shared TaskList between CLI and TUI progress is a real win.
…thout a TUI Selecting a project command that has no screen used to tear the TUI down with NotImplementedError. It now opens a screen that says the command runs from the command line and shows its help — usage, arguments, options and the "Parameter details" `--help` appends — from the same Commander help the CLI prints. Groups (`add`, `export`) open their menu, so every resource beneath them is reachable the same way. The body scrolls, clamped to the last full page and re-clamped on resize. The project menu lists the four screen-backed commands first, then a "command line only" divider, then the rest, dimmed. Built on what exists: the project Router declares its screen-backed children with the same supportedTuiCommands eval and identity use, so isTuiCommandSupported answers for any node and compile() propagates the answer to nested commands; RouterScreen partitions on it instead of filtering (opt-in via showCliOnly); one wildcard route under agentcore/project replaces Root's hand-written list and ProjectCommandNotImplementedScreen. Options render through KeyValueTable, which now lays keys and values out as two boxes so a wrapped value continues under itself, caps the key column at half the width in layout, and keeps a gap inside the cap.
…fake The fake backend in buildDeploy.screen.test.tsx predates resolveProjectResources landing on refactor, so tsc fails on the base branch. Add the stub the interface now requires.
ac2b2ca to
24a3bf6
Compare
|
Claude Security Review: no high-confidence findings. (run) |
|
flaky unit test i just reran it and it passed |
What
Every
projectcommand without a TUI screen now opens a command-line-only screen instead of tearing the TUI down with an error. It says so, and shows the command's help — usage, options, arguments, and the "Parameter details" that--helpappends — read from the same Commander help the CLI prints. Groups (add,export) open their menu, so every resource beneath them is reachable the same way. Esc returns to the parent menu.The project menu lists screen-backed commands first, then a
command line onlydivider, then the rest:How
projectRouter declares its screen-backed children via the existingsupportedTuiCommands(...)(whateval/identityuse);compile()propagates it to nested commands.RouterScreenpartitions onisTuiCommandSupportedinstead of filtering, behind ashowCliOnlyprop. Other menus are unchanged.CliOnlyScreen(Layout+KeyValueTable+ScrollView, overcommand.createHelp()), and one wildcard routeagentcore/project/*replacing Root's hand-written list andProjectCommandNotImplementedScreen.KeyValueTablewraps values under themselves and caps the key column at 50%.devis CLI-only here; a TUI screen for it is a follow-up.Formerly stacked on #2172; rebased onto
refactornow that it has merged, so this PR is the single feature commit plus one small fix:fix(project): satisfy ProjectBackend in the build/deploy screen test fake—buildDeploy.screen.test.tsxonrefactorpredatesresolveProjectResourceslanding on theProjectBackendinterface, sotsc --noEmitfails on the base branch today. The fake gets the stub the interface requires.Also resolved the CodeQL
js/bad-tag-filterfinding on the test regex (it is a terminal-layout assertion, not an HTML filter; made it case-insensitive so the rule is satisfied).Testing
bun test2848 pass;tsc,oxlint,prettierclean. Tests read the CLI-only commands off the Commander tree and assert each shows its usage and every option; plus divider order,add → gatewaydrill-down, scrolling to the parameter details, a small-terminal sweep, and resize-after-scroll.