Variable: AgentSchemas
Makaio Framework / contracts / AgentSchemas
Variable: AgentSchemas
Section titled “Variable: AgentSchemas”
constAgentSchemas:object
Defined in: ../../../packages/contracts/src/agent/schemas.ts:62
Agent domain schemas.
Subjects for agent-related bus communication.
Each key becomes a subject identifier as: agent.{key}
Dotted keys become nested properties:
Schema keys with dots (e.g., 'tool.use') are transformed into nested
subject accessors. Use dot notation to access them:
Type Declaration
Section titled “Type Declaration”complete
Section titled “complete”complete:
ZodObject<{adapterId:ZodString;adapterName:ZodString;adapterSessionId:ZodString;agentId:ZodString;clientId:ZodOptional<ZodString>;error:ZodOptional<ZodString>;errorCategory:ZodOptional<ZodEnum<{auth:"auth";model_unavailable:"model_unavailable";quota_exceeded:"quota_exceeded";rate_limit:"rate_limit"; }>>;message:ZodOptional<ZodString>;messageId:ZodString;occurredAt:ZodOptional<ZodNumber>;outcome:ZodOptional<ZodEnum<{cancelled:"cancelled";completed:"completed";error:"error";merged:"merged";rejected:"rejected";superseded:"superseded"; }>>;providerConfigId:ZodOptional<ZodString>;sessionId:ZodOptional<ZodString>;turnId:ZodOptional<ZodString>; },$strip> =CompleteSchema
contextWindow.updated
Section titled “contextWindow.updated”contextWindow.updated:
ZodObject<{adapterId:ZodString;adapterName:ZodString;adapterSessionId:ZodString;agentId:ZodString;cachedTokens:ZodOptional<ZodNumber>;clientId:ZodOptional<ZodString>;currentTokens:ZodNumber;level:ZodEnum<{critical:"critical";ok:"ok";warn:"warn"; }>;maxTokens:ZodNumber;messageId:ZodOptional<ZodString>;occurredAt:ZodOptional<ZodNumber>;percentage:ZodNumber;providerConfigId:ZodOptional<ZodString>;sessionId:ZodOptional<ZodString>;turnId:ZodOptional<ZodString>; },$strip> =ContextWindowUpdatedSchema
credential.change
Section titled “credential.change”credential.change:
object=CredentialChangeSchema
credential.change.request
Section titled “credential.change.request”request:
ZodObject<{adapterId:ZodString;adapterName:ZodString;adapterSessionId:ZodOptional<ZodString>;agentId:ZodString;changeSequence:ZodNumber;clientId:ZodOptional<ZodString>;credentialRefs:ZodRecord<ZodString,$ZodBranded<ZodString,"CredentialRef","out">>;definitionId:ZodString;messageId:ZodOptional<ZodString>;occurredAt:ZodOptional<ZodNumber>;providerConfigId:ZodString;sessionId:ZodOptional<ZodString>;turnId:ZodOptional<ZodString>; },$strip>
credential.change.response
Section titled “credential.change.response”response:
ZodDiscriminatedUnion<[ZodObject<{success:ZodLiteral<true>;swapped:ZodLiteral<true>; },$strip>,ZodObject<{reason:ZodString;success:ZodLiteral<false>; },$strip>],"success">
cwd.change
Section titled “cwd.change”cwd.change:
object=CwdChangeSchema
cwd.change.request
Section titled “cwd.change.request”request:
ZodObject<{adapterId:ZodString;adapterName:ZodString;adapterSessionId:ZodString;agentId:ZodString;clientId:ZodOptional<ZodString>;messageId:ZodOptional<ZodString>;newCwd:ZodString;occurredAt:ZodOptional<ZodNumber>;providerConfigId:ZodOptional<ZodString>;sessionId:ZodOptional<ZodString>;skipWarning:ZodOptional<ZodBoolean>;turnId:ZodOptional<ZodString>; },$strip>
cwd.change.response
Section titled “cwd.change.response”response:
ZodObject<{previousCwd:ZodOptional<ZodString>;reason:ZodOptional<ZodString>;success:ZodBoolean; },$strip>
cwd.changed
Section titled “cwd.changed”cwd.changed:
ZodObject<{adapterId:ZodString;adapterName:ZodString;adapterSessionId:ZodString;agentId:ZodString;clientId:ZodOptional<ZodString>;messageId:ZodOptional<ZodString>;newCwd:ZodString;occurredAt:ZodOptional<ZodNumber>;previousCwd:ZodString;providerConfigId:ZodOptional<ZodString>;sessionId:ZodOptional<ZodString>;turnId:ZodOptional<ZodString>; },$strip> =CwdChangedSchema
getCapabilities
Section titled “getCapabilities”getCapabilities:
object=AgentGetCapabilitiesSchema
getCapabilities.request
Section titled “getCapabilities.request”request:
ZodObject<{agentId:ZodString; },$strip>
getCapabilities.response
Section titled “getCapabilities.response”response:
ZodObject<{capabilities:ZodArray<ZodString>;model:ZodOptional<ZodString>;nativeTools:ZodArray<ZodString>; },$strip>
idle:
ZodObject<{adapterId:ZodString;adapterName:ZodString;adapterSessionId:ZodString;agentId:ZodString;clientId:ZodOptional<ZodString>;messageId:ZodOptional<ZodString>;occurredAt:ZodOptional<ZodNumber>;providerConfigId:ZodOptional<ZodString>;sessionId:ZodOptional<ZodString>;turnId:ZodOptional<ZodString>; },$strip> =IdleSchema
message
Section titled “message”message:
ZodObject<{adapterId:ZodString;adapterName:ZodString;adapterSessionId:ZodString;agentId:ZodString;clientId:ZodOptional<ZodString>;content:ZodString;messageId:ZodOptional<ZodString>;occurredAt:ZodOptional<ZodNumber>;providerConfigId:ZodOptional<ZodString>;sessionId:ZodOptional<ZodString>;turnId:ZodOptional<ZodString>; },$strip> =MessageSchema
message_delta
Section titled “message_delta”message_delta:
ZodObject<{adapterId:ZodString;adapterName:ZodString;adapterSessionId:ZodString;agentId:ZodString;clientId:ZodOptional<ZodString>;messageId:ZodOptional<ZodString>;occurredAt:ZodOptional<ZodNumber>;providerConfigId:ZodOptional<ZodString>;sessionId:ZodOptional<ZodString>;text:ZodString;turnId:ZodOptional<ZodString>; },$strip> =MessageDeltaSchema
model.change
Section titled “model.change”model.change:
object=ModelChangeSchema
model.change.request
Section titled “model.change.request”request:
ZodObject<{adapterId:ZodString;adapterName:ZodString;adapterSessionId:ZodString;agentId:ZodString;clientId:ZodOptional<ZodString>;messageId:ZodOptional<ZodString>;newModel:ZodOptional<ZodString>;occurredAt:ZodOptional<ZodNumber>;providerConfigId:ZodOptional<ZodString>;providerContext:ZodOptional<ZodObject<{credentialEnvVars:ZodOptional<ZodRecord<ZodString,ZodString>>;credentialRefs:ZodRecord<ZodString,$ZodBranded<ZodString,"CredentialRef","out">>;definitionId:ZodString;endpointOverrides:ZodOptional<ZodObject<{anthropic:ZodOptional<…>;openai:ZodOptional<…>; },$strip>>;providerConfigId:ZodString; },$strip>>;reasoningEffort:ZodOptional<ZodEnum<{extra-high:"extra-high";high:"high";low:"low";medium:"medium";none:"none"; }>>;sessionId:ZodOptional<ZodString>;skipWarning:ZodOptional<ZodBoolean>;turnId:ZodOptional<ZodString>; },$strip>
model.change.response
Section titled “model.change.response”response:
ZodObject<{appliedReasoningEffort:ZodOptional<ZodEnum<{extra-high:"extra-high";high:"high";low:"low";medium:"medium";none:"none"; }>>;model:ZodOptional<ZodString>;reason:ZodOptional<ZodString>;success:ZodBoolean;supportedReasoningLevels:ZodOptional<ZodObject<{extra-high:ZodOptional<ZodUnion<readonly [ZodNumber,ZodString]>>;high:ZodOptional<ZodUnion<readonly [ZodNumber,ZodString]>>;low:ZodOptional<ZodUnion<readonly [ZodNumber,ZodString]>>;medium:ZodOptional<ZodUnion<readonly [ZodNumber,ZodString]>>;none:ZodOptional<ZodUnion<readonly [ZodNumber,ZodString]>>; },$strip>>;swapped:ZodOptional<ZodBoolean>; },$strip>
model.changed
Section titled “model.changed”model.changed:
ZodObject<{adapterId:ZodString;adapterName:ZodString;adapterSessionId:ZodString;agentId:ZodString;clientId:ZodOptional<ZodString>;messageId:ZodOptional<ZodString>;newModel:ZodString;newReasoningEffort:ZodOptional<ZodEnum<{extra-high:"extra-high";high:"high";low:"low";medium:"medium";none:"none"; }>>;occurredAt:ZodOptional<ZodNumber>;previousModel:ZodString;previousReasoningEffort:ZodOptional<ZodEnum<{extra-high:"extra-high";high:"high";low:"low";medium:"medium";none:"none"; }>>;providerConfigId:ZodOptional<ZodString>;sessionId:ZodOptional<ZodString>;turnId:ZodOptional<ZodString>; },$strip> =ModelChangedSchema
reasoning
Section titled “reasoning”reasoning:
ZodObject<{adapterId:ZodString;adapterName:ZodString;adapterSessionId:ZodString;agentId:ZodString;clientId:ZodOptional<ZodString>;content:ZodString;messageId:ZodOptional<ZodString>;occurredAt:ZodOptional<ZodNumber>;providerConfigId:ZodOptional<ZodString>;sessionId:ZodOptional<ZodString>;turnId:ZodOptional<ZodString>; },$strip> =ReasoningSchema
reasoning_delta
Section titled “reasoning_delta”reasoning_delta:
ZodObject<{adapterId:ZodString;adapterName:ZodString;adapterSessionId:ZodString;agentId:ZodString;clientId:ZodOptional<ZodString>;content:ZodString;messageId:ZodOptional<ZodString>;occurredAt:ZodOptional<ZodNumber>;providerConfigId:ZodOptional<ZodString>;sessionId:ZodOptional<ZodString>;turnId:ZodOptional<ZodString>; },$strip> =ReasoningDeltaSchema
sendMessage
Section titled “sendMessage”sendMessage:
object=SendMessageSchema
sendMessage.request
Section titled “sendMessage.request”request:
ZodObject<{adapterId:ZodString;agentId:ZodString;deliveryMode:ZodOptional<ZodEnum<{enqueue:"enqueue";immediate:"immediate"; }>>;message:ZodUnion<readonly [ZodString,ZodObject<{blocks:ZodUnion<readonly [ZodDiscriminatedUnion<…, …>,ZodArray<…>]>;role:ZodOptional<ZodEnum<{assistant: …;system: …;user: …; }>>; },$strip>]>;messageId:ZodOptional<ZodString>;responseSchema:ZodOptional<ZodRecord<ZodString,ZodUnknown>>;sessionContext:ZodOptional<ZodObject<{extractedContext:ZodOptional<ZodUnknown>;hasCompression:ZodOptional<ZodBoolean>;hasConnectorSwap:ZodOptional<ZodBoolean>;hasNewTransforms:ZodOptional<ZodBoolean>;isFirstTurn:ZodOptional<ZodBoolean>;messageHistory:ZodOptional<ZodArray<ZodObject<{blocks: …;role: …; },$strip>>>;turnContext:ZodOptional<ZodRecord<ZodString,ZodType<JsonValue,unknown,$ZodTypeInternals<…, …>>>>; },$strip>>;sessionId:ZodOptional<ZodString>;turnId:ZodOptional<ZodString>; },$strip>
sendMessage.response
Section titled “sendMessage.response”response:
ZodObject<{messageId:ZodString; },$strip>
session.closed
Section titled “session.closed”session.closed:
ZodObject<{adapterId:ZodString;adapterName:ZodString;adapterSessionId:ZodString;agentId:ZodString;clientId:ZodOptional<ZodString>;messageId:ZodOptional<ZodString>;occurredAt:ZodOptional<ZodNumber>;providerConfigId:ZodOptional<ZodString>;reason:ZodOptional<ZodString>;sessionId:ZodOptional<ZodString>;turnId:ZodOptional<ZodString>; },$strip> =SessionClosedSchema
started
Section titled “started”started:
ZodObject<{adapterId:ZodString;adapterName:ZodString;adapterSessionId:ZodString;agentId:ZodString;clientId:ZodOptional<ZodString>;cwd:ZodNullable<ZodString>;messageId:ZodOptional<ZodString>;model:ZodNullable<ZodString>;occurredAt:ZodOptional<ZodNumber>;providerConfigId:ZodOptional<ZodString>;sessionId:ZodOptional<ZodString>;turnId:ZodOptional<ZodString>; },$strip> =StartedSchema
step.finished
Section titled “step.finished”step.finished:
ZodObject<{adapterId:ZodString;adapterName:ZodString;adapterSessionId:ZodString;agentId:ZodString;blockIndex:ZodNumber;clientId:ZodOptional<ZodString>;content:ZodDiscriminatedUnion<[ZodObject<{content:ZodString;type:ZodLiteral<"text">; },$strip>,ZodObject<{source:ZodDiscriminatedUnion<[ZodObject<{data: …;mimeType: …;type: …; },$strip>,ZodObject<{mimeType: …;type: …;url: …; },$strip>],"type">;type:ZodLiteral<"image">; },$strip>,ZodObject<{source:ZodDiscriminatedUnion<[ZodObject<{data: …;mimeType: …;type: …; },$strip>,ZodObject<{mimeType: …;type: …;url: …; },$strip>],"type">;type:ZodLiteral<"document">; },$strip>,ZodObject<{attachmentType:ZodEnum<{directory:"directory";file:"file"; }>;displayName:ZodOptional<ZodString>;fileName:ZodString;filePath:ZodString;source:ZodDiscriminatedUnion<[ZodObject<{data: …;mimeType: …;type: …; },$strip>,ZodObject<{mimeType: …;type: …;url: …; },$strip>],"type">;type:ZodLiteral<"attachment">; },$strip>],"type">;messageId:ZodOptional<ZodString>;occurredAt:ZodOptional<ZodNumber>;providerConfigId:ZodOptional<ZodString>;sessionId:ZodOptional<ZodString>;stepType:ZodEnum<{reasoning:"reasoning";text:"text";tool_use:"tool_use"; }>;turnId:ZodOptional<ZodString>; },$strip> =StepFinishedSchema
step.started
Section titled “step.started”step.started:
ZodObject<{adapterId:ZodString;adapterName:ZodString;adapterSessionId:ZodString;agentId:ZodString;blockData:ZodOptional<ZodDiscriminatedUnion<[ZodObject<{toolCallId:ZodString;toolName:ZodString;type:ZodLiteral<"tool_use">; },$strip>,ZodObject<{type:ZodLiteral<"reasoning">; },$strip>,ZodObject<{type:ZodLiteral<"text">; },$strip>],"type">>;blockIndex:ZodNumber;clientId:ZodOptional<ZodString>;content:ZodOptional<ZodDiscriminatedUnion<[ZodObject<{content:ZodString;type:ZodLiteral<"text">; },$strip>,ZodObject<{source:ZodDiscriminatedUnion<[ZodObject<…, …>,ZodObject<…, …>],"type">;type:ZodLiteral<"image">; },$strip>,ZodObject<{source:ZodDiscriminatedUnion<[ZodObject<…, …>,ZodObject<…, …>],"type">;type:ZodLiteral<"document">; },$strip>,ZodObject<{attachmentType:ZodEnum<{directory:"directory";file:"file"; }>;displayName:ZodOptional<ZodString>;fileName:ZodString;filePath:ZodString;source:ZodDiscriminatedUnion<[ZodObject<…, …>,ZodObject<…, …>],"type">;type:ZodLiteral<"attachment">; },$strip>],"type">>;messageId:ZodOptional<ZodString>;occurredAt:ZodOptional<ZodNumber>;providerConfigId:ZodOptional<ZodString>;sessionId:ZodOptional<ZodString>;stepType:ZodEnum<{reasoning:"reasoning";text:"text";tool_use:"tool_use"; }>;turnId:ZodOptional<ZodString>; },$strip> =StepStartedSchema
tool.completed
Section titled “tool.completed”tool.completed:
ZodObject<{adapterId:ZodString;adapterName:ZodString;adapterSessionId:ZodString;agentId:ZodString;args:ZodOptional<ZodRecord<ZodString,ZodUnknown>>;clientId:ZodOptional<ZodString>;messageId:ZodOptional<ZodString>;occurredAt:ZodOptional<ZodNumber>;providerConfigId:ZodOptional<ZodString>;result:ZodUnion<[ZodUnion<[ZodRecord<ZodString,ZodUnknown>,ZodString]>,ZodArray<ZodRecord<ZodString,ZodUnknown>>]>;sessionId:ZodOptional<ZodString>;success:ZodOptional<ZodBoolean>;toolCallId:ZodString;toolName:ZodString;turnId:ZodOptional<ZodString>; },$strip> =ToolCompletedSchema
tool.output
Section titled “tool.output”tool.output:
ZodObject<{adapterId:ZodString;adapterName:ZodString;adapterSessionId:ZodString;agentId:ZodString;args:ZodOptional<ZodRecord<ZodString,ZodUnknown>>;clientId:ZodOptional<ZodString>;messageId:ZodOptional<ZodString>;occurredAt:ZodOptional<ZodNumber>;output:ZodString;providerConfigId:ZodOptional<ZodString>;sessionId:ZodOptional<ZodString>;toolCallId:ZodString;toolName:ZodOptional<ZodString>;turnId:ZodOptional<ZodString>; },$strip> =ToolOutputSchema
tool.started
Section titled “tool.started”tool.started:
ZodObject<{adapterId:ZodString;adapterName:ZodString;adapterSessionId:ZodString;agentId:ZodString;clientId:ZodOptional<ZodString>;messageId:ZodOptional<ZodString>;occurredAt:ZodOptional<ZodNumber>;providerConfigId:ZodOptional<ZodString>;sessionId:ZodOptional<ZodString>;toolCallId:ZodString;toolName:ZodString;turnId:ZodOptional<ZodString>; },$strip> =ToolStartedSchema
tool.use
Section titled “tool.use”tool.use:
ZodObject<{adapterId:ZodString;adapterName:ZodString;adapterSessionId:ZodString;agentId:ZodString;args:ZodOptional<ZodRecord<ZodString,ZodUnknown>>;clientId:ZodOptional<ZodString>;messageId:ZodOptional<ZodString>;occurredAt:ZodOptional<ZodNumber>;providerConfigId:ZodOptional<ZodString>;sessionId:ZodOptional<ZodString>;toolCallId:ZodString;toolName:ZodString;turnId:ZodOptional<ZodString>; },$strip> =ToolUseSchema
toolApprove
Section titled “toolApprove”toolApprove:
object=AgentToolApproveSchema
toolApprove.request
Section titled “toolApprove.request”request:
ZodObject<{adapterId:ZodString;adapterName:ZodString;adapterSessionId:ZodString;agentId:ZodString;args:ZodOptional<ZodRecord<ZodString,ZodUnknown>>;clientId:ZodOptional<ZodString>;messageId:ZodOptional<ZodString>;occurredAt:ZodOptional<ZodNumber>;providerConfigId:ZodOptional<ZodString>;reasoning:ZodOptional<ZodString>;sessionId:ZodString;toolCallId:ZodString;toolName:ZodOptional<ZodString>;turnId:ZodOptional<ZodString>; },$strip>
toolApprove.response
Section titled “toolApprove.response”response:
ZodDiscriminatedUnion<[ZodObject<{action:ZodLiteral<"allow">;updatedInput:ZodOptional<ZodRecord<ZodString,ZodUnknown>>;updatedPermissions:ZodOptional<ZodArray<ZodUnknown>>; },$strip>,ZodObject<{action:ZodLiteral<"deny">;message:ZodString;shouldAbort:ZodOptional<ZodBoolean>; },$strip>],"action">
turn.completed
Section titled “turn.completed”turn.completed:
ZodObject<{adapterId:ZodString;adapterName:ZodString;adapterSessionId:ZodString;agentId:ZodString;clientId:ZodOptional<ZodString>;error:ZodOptional<ZodString>;message:ZodOptional<ZodString>;messageId:ZodString;occurredAt:ZodOptional<ZodNumber>;outcome:ZodEnum<{cancelled:"cancelled";completed:"completed";error:"error";merged:"merged";rejected:"rejected";superseded:"superseded"; }>;providerConfigId:ZodOptional<ZodString>;sessionId:ZodOptional<ZodString>;turnId:ZodOptional<ZodString>; },$strip> =TurnCompletedSchema
turn.started
Section titled “turn.started”turn.started:
ZodObject<{adapterId:ZodString;adapterName:ZodString;adapterSessionId:ZodString;agentId:ZodString;clientId:ZodOptional<ZodString>;content:ZodObject<{blocks:ZodArray<ZodDiscriminatedUnion<[ZodObject<{content:ZodString;type:ZodLiteral<…>; },$strip>,ZodObject<{source:ZodDiscriminatedUnion<…, …>;type:ZodLiteral<…>; },$strip>,ZodObject<{source:ZodDiscriminatedUnion<…, …>;type:ZodLiteral<…>; },$strip>,ZodObject<{attachmentType:ZodEnum<…>;displayName:ZodOptional<…>;fileName:ZodString;filePath:ZodString;source:ZodDiscriminatedUnion<…, …>;type:ZodLiteral<…>; },$strip>],"type">>;message:ZodOptional<ZodString>;role:ZodEnum<{assistant:"assistant";system:"system";user:"user"; }>; },$strip>;mergedFrom:ZodOptional<ZodArray<ZodString>>;messageId:ZodString;occurredAt:ZodOptional<ZodNumber>;providerConfigId:ZodOptional<ZodString>;sessionId:ZodOptional<ZodString>;turnId:ZodOptional<ZodString>; },$strip> =TurnStartedSchema
usage:
ZodObject<{adapterId:ZodString;adapterName:ZodString;adapterSessionId:ZodString;agentId:ZodString;audioInputTokens:ZodOptional<ZodNumber>;audioOutputTokens:ZodOptional<ZodNumber>;cacheWriteTokens:ZodOptional<ZodNumber>;clientId:ZodOptional<ZodString>;contextWindow:ZodOptional<ZodNumber>;cost:ZodOptional<ZodNumber>;costUnits:ZodNumber;costUnitType:ZodEnum<{requests:"requests";tokens:"tokens"; }>;currency:ZodOptional<ZodString>;duration:ZodOptional<ZodNumber>;inputCachedTokens:ZodNumber;inputTokens:ZodNumber;messageId:ZodOptional<ZodString>;model:ZodString;occurredAt:ZodOptional<ZodNumber>;outputTokens:ZodNumber;provider:ZodString;providerConfigId:ZodOptional<ZodString>;quota:ZodOptional<ZodObject<{limit:ZodNumber;overage:ZodNumber;resetDate:ZodOptional<ZodString>;type:ZodString;used:ZodNumber; },$strip>>;reasoningTokens:ZodNumber;serviceTier:ZodOptional<ZodString>;sessionId:ZodOptional<ZodString>;totalTokens:ZodNumber;turnId:ZodOptional<ZodString>; },$strip> =UsageSchema
user_message.acknowledged
Section titled “user_message.acknowledged”user_message.acknowledged:
ZodObject<{adapterId:ZodString;adapterName:ZodString;adapterSessionId:ZodString;agentId:ZodString;clientId:ZodOptional<ZodString>;mergedFrom:ZodOptional<ZodArray<ZodString>>;messageId:ZodString;occurredAt:ZodOptional<ZodNumber>;providerConfigId:ZodOptional<ZodString>;sessionId:ZodOptional<ZodString>;turnId:ZodOptional<ZodString>; },$strip> =UserMessageAcknowledgedSchema
user_message.completed
Section titled “user_message.completed”user_message.completed:
ZodObject<{adapterId:ZodString;adapterName:ZodString;adapterSessionId:ZodString;agentId:ZodString;clientId:ZodOptional<ZodString>;error:ZodOptional<ZodString>;mergedInto:ZodOptional<ZodString>;messageId:ZodString;occurredAt:ZodOptional<ZodNumber>;outcome:ZodEnum<{cancelled:"cancelled";completed:"completed";error:"error";merged:"merged";rejected:"rejected";superseded:"superseded"; }>;providerConfigId:ZodOptional<ZodString>;sessionId:ZodOptional<ZodString>;supersededBy:ZodOptional<ZodString>;turnId:ZodOptional<ZodString>; },$strip> =UserMessageCompletedSchema
user_message.sent
Section titled “user_message.sent”user_message.sent:
ZodObject<{adapterId:ZodString;adapterName:ZodString;adapterSessionId:ZodString;agentId:ZodString;clientId:ZodOptional<ZodString>;content:ZodObject<{blocks:ZodArray<ZodDiscriminatedUnion<[ZodObject<{content:ZodString;type:ZodLiteral<…>; },$strip>,ZodObject<{source:ZodDiscriminatedUnion<…, …>;type:ZodLiteral<…>; },$strip>,ZodObject<{source:ZodDiscriminatedUnion<…, …>;type:ZodLiteral<…>; },$strip>,ZodObject<{attachmentType:ZodEnum<…>;displayName:ZodOptional<…>;fileName:ZodString;filePath:ZodString;source:ZodDiscriminatedUnion<…, …>;type:ZodLiteral<…>; },$strip>],"type">>;message:ZodOptional<ZodString>;role:ZodEnum<{assistant:"assistant";system:"system";user:"user"; }>; },$strip>;deliveryMode:ZodEnum<{enqueue:"enqueue";immediate:"immediate";replace:"replace"; }>;messageId:ZodString;occurredAt:ZodOptional<ZodNumber>;providerConfigId:ZodOptional<ZodString>;sessionId:ZodOptional<ZodString>;turnId:ZodOptional<ZodString>; },$strip> =UserMessageSentSchema
validateModelChange
Section titled “validateModelChange”validateModelChange:
object=ValidateModelChangeSchema
validateModelChange.request
Section titled “validateModelChange.request”request:
ZodObject<{agentId:ZodString;currentModel:ZodString;nextModel:ZodString; },$strip>
validateModelChange.response
Section titled “validateModelChange.response”response:
ZodObject<{proceed:ZodBoolean;requestEditHistory:ZodOptional<ZodBoolean>; },$strip>
Example
Section titled “Example”// Schema key: 'tool.use' → Access as: AgentSubjects.tool.usebus.emit(AgentSubjects.tool.use, { toolName: 'read', ... });
// Schema key: 'user_message.sent' → Access as: AgentSubjects.user_message.sentbus.on(AgentSubjects.user_message.sent, (ctx) => { ... });
// Schema key: 'session.closed' → Access as: AgentSubjects.session.closedbus.on(AgentSubjects.session.closed, (ctx) => { ... });
// Non-dotted keys remain flatbus.emit(AgentSubjects.started, { model: 'claude-3' });bus.emit(AgentSubjects.complete, { messageId: '...' });