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

Method onTask

src/a2a-mock.ts:62–69  ·  view source on GitHub ↗
(agentName: string, pattern: string | RegExp, artifacts: A2AArtifact[])

Source from the content-addressed store, hash-verified

60 }
61
62 onTask(agentName: string, pattern: string | RegExp, artifacts: A2AArtifact[]): this {
63 const agent = this.agents.get(agentName);
64 if (!agent) {
65 throw new Error(`Agent "${agentName}" not registered`);
66 }
67 agent.patterns.push({ kind: "task", pattern, agentName, artifacts });
68 return this;
69 }
70
71 onStreamingTask(
72 agentName: string,

Callers 2

startFromConfigFunction · 0.95
a2a-mock.test.tsFile · 0.80

Calls 1

getMethod · 0.45

Tested by

no test coverage detected