MCPcopy Create free account
hub / github.com/cloudflare/computer / push

Function push

packages/computer/src/workspace.test.ts:57–78  ·  view source on GitHub ↗
(input)

Source from the content-addressed store, hash-verified

55
56 return {
57 async push(input) {
58 const reader = input.changes.getReader();
59 try {
60 while (true) {
61 const { value, done } = await reader.read();
62 if (done) break;
63 if (value.kind === "file") {
64 files.set(value.path, {
65 mode: value.mode,
66 mtime: value.mtime,
67 size: value.size,
68 chunks: value.chunks,
69 });
70 } else if (value.kind === "delete") {
71 files.delete(value.path);
72 }
73 }
74 } finally {
75 reader.releaseLock();
76 }
77 return { rev: 0, appliedPushCursor: { rev: input.senderRev, path: null } };
78 },
79 async fetchChanges() {
80 return {
81 currentCursor: { rev: 0, path: null },

Callers

nothing calls this directly

Calls 4

getReaderMethod · 0.65
readMethod · 0.65
setMethod · 0.65
deleteMethod · 0.65

Tested by

no test coverage detected