MCPcopy Index your code
hub / github.com/cursor/cookbook / createAgent

Method createAgent

sdk/coding-agent-cli/src/agent.ts:195–222  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

193 }
194
195 private createAgent() {
196 const options = {
197 apiKey: this.apiKey,
198 name: "Lightweight coding agent",
199 model: this.modelSelection,
200 }
201
202 if (this.mode === "cloud") {
203 const repository = detectCloudRepository(this.cwd)
204 this.cloudRepository = repository
205
206 return Agent.create({
207 ...options,
208 cloud: {
209 repos: [repository],
210 },
211 })
212 }
213
214 this.cloudRepository = null
215
216 return Agent.create({
217 ...options,
218 local: {
219 cwd: this.cwd,
220 },
221 })
222 }
223
224 private async ensureAgentFresh() {
225 if (this.agentKey !== this.currentAgentKey()) {

Callers 2

constructorMethod · 0.95
replaceAgentMethod · 0.95

Calls 1

detectCloudRepositoryFunction · 0.85

Tested by

no test coverage detected