Several public methods that form the SDK's main surface throw typed ARCP exceptions or transport exceptions but do not declare them in PHPDoc. Examples include ARCPClient::open(), ARCPClient::invokeTool(), ARCPClient::subscribe(), ARCPClient::listJobs(), ARCPClient::fetchArtifact(), ARCPClient::ping(), ARCPClient::putArtifact(), ARCPRuntime::setDefaultToolVersion(), JobContext::requestHumanInput(), JobContext::requestHumanChoice(), and JobContext::requestPermission(). The Transport interface explains failures in prose but also omits concrete @throws tags on send() and receive().
Native return and parameter types are strong, but callers still need PHPDoc for the exception contract because PHP cannot express checked exceptions. The class-level note on ARCPClient says every command returns a typed response or raises a typed ARCP exception, yet individual methods do not tell users which exceptions to catch or when transport and cancellation failures can escape.
Fix prompt: Add precise @throws tags to the public API methods and interfaces, using the narrowest meaningful exception types where possible and ARCPExceptionInterface where the method maps protocol errors broadly. Keep existing native type declarations, preserve array-shape PHPDoc, and add or adjust documentation tests or static analysis rules so future public throwing methods do not omit exception documentation.
Several public methods that form the SDK's main surface throw typed ARCP exceptions or transport exceptions but do not declare them in PHPDoc. Examples include
ARCPClient::open(),ARCPClient::invokeTool(),ARCPClient::subscribe(),ARCPClient::listJobs(),ARCPClient::fetchArtifact(),ARCPClient::ping(),ARCPClient::putArtifact(),ARCPRuntime::setDefaultToolVersion(),JobContext::requestHumanInput(),JobContext::requestHumanChoice(), andJobContext::requestPermission(). TheTransportinterface explains failures in prose but also omits concrete@throwstags onsend()andreceive().Native return and parameter types are strong, but callers still need PHPDoc for the exception contract because PHP cannot express checked exceptions. The class-level note on
ARCPClientsays every command returns a typed response or raises a typed ARCP exception, yet individual methods do not tell users which exceptions to catch or when transport and cancellation failures can escape.Fix prompt: Add precise
@throwstags to the public API methods and interfaces, using the narrowest meaningful exception types where possible andARCPExceptionInterfacewhere the method maps protocol errors broadly. Keep existing native type declarations, preserve array-shape PHPDoc, and add or adjust documentation tests or static analysis rules so future public throwing methods do not omit exception documentation.