MCPcopy Create free account
hub / github.com/cloudflare/agents / applyEdits

Method applyEdits

packages/shell/src/memory.ts:416–434  ·  view source on GitHub ↗
(
    edits: StateEdit[],
    options?: StateApplyEditsOptions
  )

Source from the content-addressed store, hash-verified

414 }
415
416 async applyEdits(
417 edits: StateEdit[],
418 options?: StateApplyEditsOptions
419 ): Promise<StateApplyEditsResult> {
420 return applyTextEdits(
421 edits,
422 async (path) => {
423 try {
424 return await this.readFile(path);
425 } catch (error) {
426 if (isEnoent(error)) return null;
427 throw error;
428 }
429 },
430 this.writeFile.bind(this),
431 this.deleteFile.bind(this),
432 options
433 );
434 }
435
436 // ── Private helpers ───────────────────────────────────────────────
437

Callers 1

applyEditPlanMethod · 0.95

Calls 3

readFileMethod · 0.95
applyTextEditsFunction · 0.90
isEnoentFunction · 0.85

Tested by

no test coverage detected