Package com.github.copilot.sdk.json
Record Class SessionStartHookInput
java.lang.Object
java.lang.Record
com.github.copilot.sdk.json.SessionStartHookInput
- Record Components:
timestamp- the timestamp in milliseconds since epoch when the session startedcwd- the current working directorysource- the source: "startup", "resume", or "new"initialPrompt- the initial prompt, ornull
public record SessionStartHookInput(long timestamp, String cwd, String source, String initialPrompt)
extends Record
Input for a session-start hook.
This hook is invoked when a session starts, allowing you to perform initialization or modify the session configuration.
- Since:
- 1.0.7
-
Constructor Summary
ConstructorsConstructorDescriptionSessionStartHookInput(long timestamp, String cwd, String source, String initialPrompt) Creates an instance of aSessionStartHookInputrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncwd()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 theinitialPromptrecord component.source()Returns the value of thesourcerecord component.longReturns the value of thetimestamprecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
SessionStartHookInput
Creates an instance of aSessionStartHookInputrecord class.- Parameters:
timestamp- the value for thetimestamprecord componentcwd- the value for thecwdrecord componentsource- the value for thesourcerecord componentinitialPrompt- the value for theinitialPromptrecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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 '=='. -
timestamp
public long timestamp()Returns the value of thetimestamprecord component.- Returns:
- the value of the
timestamprecord component
-
cwd
Returns the value of thecwdrecord component.- Returns:
- the value of the
cwdrecord component
-
source
Returns the value of thesourcerecord component.- Returns:
- the value of the
sourcerecord component
-
initialPrompt
Returns the value of theinitialPromptrecord component.- Returns:
- the value of the
initialPromptrecord component
-