Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 23 additions & 2 deletions src/components/CliOnlyScreen.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,31 @@ describe("menus list command-line-only subcommands below a divider", () => {
r.unmount();
});

test("the divider is omitted when nothing is command line only", async () => {
test("the harness menu", async () => {
const r = renderScreen("/agentcore/harness");

await waitForText(r.lastFrame, "manage AgentCore harnesses");
await waitForText(r.lastFrame, "command line only");
expect(menuEntries(r.lastFrame()!)).toEqual({
screens: [
"create",
"get",
"list",
"update",
"delete",
"invoke",
"exec",
"endpoint",
"version",
],
cliOnly: ["logs", "traces"],
});
r.unmount();
});

test("the divider is omitted when nothing is command line only", async () => {
const r = renderScreen("/agentcore/harness/endpoint");

await waitForText(r.lastFrame, "manage harness endpoints");
expect(r.lastFrame()).not.toContain("command line only");
r.unmount();
});
Expand Down
11 changes: 11 additions & 0 deletions src/handlers/harness/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,17 @@ export function createHarnessHandler(core: Core, io: AppIO): Router {
harness.use(withTuiOnEmptyFlagsAndArgs(core, io));
// Open the TUI at this root, i.e., `agentcore harness`
harness.default(renderTui(core, io));
harness.supportedTuiCommands(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i too was bitten by the default behavior here being that all commands are tui supported :/

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm should it be the other way around? I can make that change if we need it

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can do an include / exclude set up. Callers can choose the more sensible of the two

"create",
"get",
"list",
"update",
"delete",
"invoke",
"exec",
"endpoint",
"version",
);

// Register handlers
harness.handler(createCreateHarnessHandler(core));
Expand Down
Loading