Record Class UserPromptSubmittedHookInput
java.lang.Object
java.lang.Record
com.github.copilot.rpc.UserPromptSubmittedHookInput
- Record Components:
sessionId- the runtime session ID of the session that triggered the hooktimestamp- the timestamp in milliseconds since epoch when the prompt was submittedcwd- the current working directoryprompt- the user's prompt textagentId- optional subagent identity, absent for root hooks and older runtimesagentType- optional subagent identity, absent for root hooks and older runtimesparentAgentId- optional subagent identity, absent for root hooks and older runtimes
public record UserPromptSubmittedHookInput(String sessionId, long timestamp, String cwd, String prompt, String agentId, String agentType, String parentAgentId)
extends Record
Input for a user-prompt-submitted hook.
This hook is invoked when the user submits a prompt, allowing you to intercept and modify the prompt before it is processed.
- Since:
- 1.0.7
-
Constructor Summary
ConstructorsConstructorDescriptionUserPromptSubmittedHookInput(String sessionId, long timestamp, String cwd, String prompt) UserPromptSubmittedHookInput(String sessionId, long timestamp, String cwd, String prompt, String agentId, String agentType, String parentAgentId) Creates an instance of aUserPromptSubmittedHookInputrecord class. -
Method Summary
Modifier and TypeMethodDescriptionagentId()Returns the value of theagentIdrecord component.Returns the value of theagentTyperecord component.cwd()Returns the value of thecwdrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theparentAgentIdrecord component.prompt()Returns the value of thepromptrecord component.Returns the value of thesessionIdrecord component.longReturns the value of thetimestamprecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
UserPromptSubmittedHookInput
-
UserPromptSubmittedHookInput
public UserPromptSubmittedHookInput(String sessionId, long timestamp, String cwd, String prompt, String agentId, String agentType, String parentAgentId) Creates an instance of aUserPromptSubmittedHookInputrecord class.- Parameters:
sessionId- the value for thesessionIdrecord componenttimestamp- the value for thetimestamprecord componentcwd- the value for thecwdrecord componentprompt- the value for thepromptrecord componentagentId- the value for theagentIdrecord componentagentType- the value for theagentTyperecord componentparentAgentId- the value for theparentAgentIdrecord component
-
-
Method Details
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
sessionId
-
timestamp
-
cwd
-
prompt
-
agentId
-
agentType
-
parentAgentId
Returns the value of theparentAgentIdrecord component.- Returns:
- the value of the
parentAgentIdrecord component
-