java.lang.Object
com.github.copilot.rpc.PostToolUseFailureHookInput
Input for a post-tool-use-failure hook.
Fires after a tool execution whose result was "failure". The CLI extracts the
failure message from the tool result and passes it as the getError()
field (rather than passing the full result object).
- Since:
- 1.3.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetCwd()Gets the current working directory.getError()Gets the failure message extracted from the tool's result.Gets the runtime session ID of the session that triggered the hook.longGets the timestamp of the hook invocation.com.fasterxml.jackson.databind.JsonNodeGets the arguments passed to the tool.Gets the name of the tool that failed.Sets the current working directory.Sets the failure message extracted from the tool's result.setSessionId(String sessionId) Sets the runtime session ID of the session that triggered the hook.setTimestamp(long timestamp) Sets the timestamp of the hook invocation.setToolArgs(com.fasterxml.jackson.databind.JsonNode toolArgs) Sets the arguments passed to the tool.setToolName(String toolName) Sets the name of the tool that failed.
-
Constructor Details
-
PostToolUseFailureHookInput
public PostToolUseFailureHookInput()
-
-
Method Details
-
getSessionId
Gets the runtime session ID of the session that triggered the hook.- Returns:
- the session ID
-
setSessionId
Sets the runtime session ID of the session that triggered the hook.- Parameters:
sessionId- the session ID- Returns:
- this instance for method chaining
-
getTimestamp
public long getTimestamp()Gets the timestamp of the hook invocation.- Returns:
- the timestamp in milliseconds
-
setTimestamp
Sets the timestamp of the hook invocation.- Parameters:
timestamp- the timestamp in milliseconds- Returns:
- this instance for method chaining
-
getCwd
Gets the current working directory.- Returns:
- the working directory path
-
setCwd
Sets the current working directory.- Parameters:
cwd- the working directory path- Returns:
- this instance for method chaining
-
getToolName
Gets the name of the tool that failed.- Returns:
- the tool name
-
setToolName
Sets the name of the tool that failed.- Parameters:
toolName- the tool name- Returns:
- this instance for method chaining
-
getToolArgs
public com.fasterxml.jackson.databind.JsonNode getToolArgs()Gets the arguments passed to the tool.- Returns:
- the tool arguments as a JSON node
-
setToolArgs
Sets the arguments passed to the tool.- Parameters:
toolArgs- the tool arguments as a JSON node- Returns:
- this instance for method chaining
-
getError
Gets the failure message extracted from the tool's result.- Returns:
- the error message
-
setError
Sets the failure message extracted from the tool's result.- Parameters:
error- the error message- Returns:
- this instance for method chaining
-