MCPcopy Create free account
hub / github.com/CopilotKit/aimock / onMessage

Method onMessage

src/a2a-mock.ts:53–60  ·  view source on GitHub ↗
(agentName: string, pattern: string | RegExp, parts: A2APart[])

Source from the content-addressed store, hash-verified

51 // ---- Pattern registration ----
52
53 onMessage(agentName: string, pattern: string | RegExp, parts: A2APart[]): this {
54 const agent = this.agents.get(agentName);
55 if (!agent) {
56 throw new Error(`Agent "${agentName}" not registered`);
57 }
58 agent.patterns.push({ kind: "message", pattern, agentName, parts });
59 return this;
60 }
61
62 onTask(agentName: string, pattern: string | RegExp, artifacts: A2AArtifact[]): this {
63 const agent = this.agents.get(agentName);

Callers 1

startFromConfigFunction · 0.95

Calls 1

getMethod · 0.45

Tested by

no test coverage detected