Package com.tnsai.hooks.events
Record Class AgentInit
java.lang.Object
java.lang.Record
com.tnsai.hooks.events.AgentInit
- Record Components:
eventId- ULID-shaped correlation idtimestamp- whenbuild()completedcontext- surrounding hook context
- All Implemented Interfaces:
AgentHookEvent,HookEvent
public record AgentInit(String eventId, Instant timestamp, HookContext context)
extends Record
implements AgentHookEvent
Fires once when
AgentBuilder.build() completes, before the
first chat() call (issue #60). Intended for one-time
setup — resource allocation, state hydration, metric registration.
The issue's original spec included an AgentBuilderSnapshot
field (full builder state at the moment of init). That snapshot is
a cross-module concern — the builder lives in tnsai-core.agents,
spans many optional features (roles, LLM, knowledge base, planner),
and a useful snapshot type is non-trivial. The foundation slice omits
it. Consumers today read identity from HookContext
(agentId / agentClass / role / capabilities); a follow-up can add a
typed snapshot without breaking this record's shape.
- Since:
- 0.5.0 (issue #60)
-
Constructor Summary
ConstructorsConstructorDescriptionAgentInit(String eventId, Instant timestamp, HookContext context) Creates an instance of aAgentInitrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncontext()Returns the value of thecontextrecord component.final booleanIndicates whether some other object is "equal to" this one.eventId()Returns the value of theeventIdrecord component.Short stable string identifier of the event kind, e.g.final inthashCode()Returns a hash code value for this object.Returns the value of thetimestamprecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
eventType
Description copied from interface:HookEventShort stable string identifier of the event kind, e.g."PreToolUse". Default implementation derives it from the concrete record's simple class name; concrete records may override if a different naming is desirable. -
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. All components in this record class are compared withObjects::equals(Object,Object). -
eventId
Returns the value of theeventIdrecord component. -
timestamp
Returns the value of thetimestamprecord component. -
context
Returns the value of thecontextrecord component.
-