#include "MCPServer.h" #include static int p=0,f=0; #define T(n) { std::cout<<" "<<#n<<"... "; } #define P() { std::cout<<"PASS\n"; ++p; } #define F(m) { std::cout<<"FAIL: "<()); C(!j["success"].get(),"f"); P();} void t3(){T(success); MCPServer s; auto r=s.handleRequest({{"jsonrpc","2.0"},{"id",1},{"method","tools/call"},{"params",{{"name","whetstone_get_authoring_mode"},{"arguments",{{"workspaceId","ws1"}}}}}}); auto j=nlohmann::json::parse(r["result"]["content"][0]["text"].get()); C(j["success"].get(),"s"); P();} void t4(){T(mode_default); MCPServer s; auto r=s.handleRequest({{"jsonrpc","2.0"},{"id",1},{"method","tools/call"},{"params",{{"name","whetstone_get_authoring_mode"},{"arguments",{{"workspaceId","ws1"}}}}}}); auto j=nlohmann::json::parse(r["result"]["content"][0]["text"].get()); C(j["data"]["mode"]=="text_first","m"); P();} void t5(){T(workspace_echo); MCPServer s; auto r=s.handleRequest({{"jsonrpc","2.0"},{"id",1},{"method","tools/call"},{"params",{{"name","whetstone_get_authoring_mode"},{"arguments",{{"workspaceId","ws1"}}}}}}); auto j=nlohmann::json::parse(r["result"]["content"][0]["text"].get()); C(j["workspaceId"]=="ws1","w"); P();} void t6(){T(available_modes); MCPServer s; auto r=s.handleRequest({{"jsonrpc","2.0"},{"id",1},{"method","tools/call"},{"params",{{"name","whetstone_get_authoring_mode"},{"arguments",{{"workspaceId","ws1"}}}}}}); auto j=nlohmann::json::parse(r["result"]["content"][0]["text"].get()); C(j["data"]["available_modes"].size()==3,"a"); P();} void t7(){T(language_default_cpp); MCPServer s; auto r=s.handleRequest({{"jsonrpc","2.0"},{"id",1},{"method","tools/call"},{"params",{{"name","whetstone_get_authoring_mode"},{"arguments",{{"workspaceId","ws1"}}}}}}); auto j=nlohmann::json::parse(r["result"]["content"][0]["text"].get()); C(j["data"]["language_default"]=="cpp","l"); P();} void t8(){T(deterministic); MCPServer s; auto r1=s.handleRequest({{"jsonrpc","2.0"},{"id",1},{"method","tools/call"},{"params",{{"name","whetstone_get_authoring_mode"},{"arguments",{{"workspaceId","ws1"}}}}}}); auto r2=s.handleRequest({{"jsonrpc","2.0"},{"id",2},{"method","tools/call"},{"params",{{"name","whetstone_get_authoring_mode"},{"arguments",{{"workspaceId","ws1"}}}}}}); auto j1=nlohmann::json::parse(r1["result"]["content"][0]["text"].get()); auto j2=nlohmann::json::parse(r2["result"]["content"][0]["text"].get()); C(j1["data"].dump()==j2["data"].dump(),"d"); P();} int main(){ std::cout<<"Step 1653: `whetstone_get_authoring_mode` MCP tool\n"; t1();t2();t3();t4();t5();t6();t7();t8(); std::cout<<"\nResults: "<