MCPcopy
hub / github.com/CopilotKit/CopilotKit / _cloneImpl

Method _cloneImpl

packages/core/src/__tests__/test-utils.ts:104–118  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

102 }
103
104 private _cloneImpl(): MockAgent {
105 const cloned = new MockAgent({
106 messages: [...this.messages],
107 newMessages: [...this.newMessages],
108 error: this.error,
109 runAgentDelay: this.runAgentDelay,
110 runAgentCallback: this.runAgentCallback,
111 agentId: this.agentId,
112 threadId: this.threadId,
113 state: JSON.parse(JSON.stringify(this.state)),
114 });
115 // Link the clone back to the parent so calls are visible
116 cloned._parentAgent = this;
117 return cloned;
118 }
119
120 // Provide a no-op subscribe API so core can attach state listeners
121 // without errors during tests.

Callers 1

MockAgentClass · 0.95

Calls 1

parseMethod · 0.80

Tested by

no test coverage detected