feat(FN-1229): add node mesh CLI commands for node and mesh management

- Add fn node list command to list all registered nodes with status and URL
- Add fn node show command to display detailed node information including system metrics
- Add fn node health-check command to trigger and verify node health status
- Add fn node remove command to unregister nodes from the mesh
- Add fn mesh status command to show mesh topology with peer connections
- Add comprehensive tests for all node and mesh CLI commands
- Update bin.ts to wire up new node and mesh subcommands
- Update memory with CLI mock pattern for testing
This commit is contained in:
gsxdsm
2026-04-09 12:54:16 -07:00
parent 3ef12726d1
commit 3ea53f1aa2
7 changed files with 952 additions and 105 deletions

View File

@@ -61,10 +61,14 @@ const commandMocks = vi.hoisted(() => ({
runProjectDetect: vi.fn(),
runNodeList: vi.fn(),
runNodeAdd: vi.fn(),
runNodeRemove: vi.fn(),
runNodeConnect: vi.fn(),
runNodeDisconnect: vi.fn(),
runNodeShow: vi.fn(),
runNodeHealth: vi.fn(),
runMeshStatus: vi.fn(),
// Legacy aliases
runNodeAdd: vi.fn(),
runNodeRemove: vi.fn(),
runAgentStop: vi.fn(),
runAgentStart: vi.fn(),
@@ -151,10 +155,14 @@ vi.mock("./commands/project.js", () => ({
vi.mock("./commands/node.js", () => ({
runNodeList: commandMocks.runNodeList,
runNodeAdd: commandMocks.runNodeAdd,
runNodeRemove: commandMocks.runNodeRemove,
runNodeConnect: commandMocks.runNodeConnect,
runNodeDisconnect: commandMocks.runNodeDisconnect,
runNodeShow: commandMocks.runNodeShow,
runNodeHealth: commandMocks.runNodeHealth,
runMeshStatus: commandMocks.runMeshStatus,
// Legacy aliases
runNodeAdd: commandMocks.runNodeAdd,
runNodeRemove: commandMocks.runNodeRemove,
}));
vi.mock("./commands/agent.js", () => ({
@@ -435,7 +443,7 @@ describe("bin command routing and fallbacks", () => {
"4",
]);
expect(commandMocks.runNodeAdd).toHaveBeenCalledWith("worker-a", {
expect(commandMocks.runNodeConnect).toHaveBeenCalledWith("worker-a", {
url: "http://x",
apiKey: "key",
maxConcurrent: 4,