MCPcopy Create free account
hub / github.com/codeaashu/claude-code / isRecordableMessage

Function isRecordableMessage

src/tools/AgentTool/runAgent.ts:231–246  ·  view source on GitHub ↗

* Type guard to check if a message from query() is a recordable Message type. * Matches the types we want to record: assistant, user, progress, or system compact_boundary.

(
  msg: QueryMessage,
)

Source from the content-addressed store, hash-verified

229 * Matches the types we want to record: assistant, user, progress, or system compact_boundary.
230 */
231function isRecordableMessage(
232 msg: QueryMessage,
233): msg is
234 | AssistantMessage
235 | UserMessage
236 | ProgressMessage
237 | SystemCompactBoundaryMessage {
238 return (
239 msg.type === 'assistant' ||
240 msg.type === 'user' ||
241 msg.type === 'progress' ||
242 (msg.type === 'system' &&
243 'subtype' in msg &&
244 msg.subtype === 'compact_boundary')
245 )
246}
247
248export async function* runAgent({
249 agentDefinition,

Callers 1

runAgentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected