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

Method get

packages/computerd/src/exec/runner.ts:271–285  ·  view source on GitHub ↗
(id: string, options: { after?: number | "tail" } = {})

Source from the content-addressed store, hash-verified

269 }
270
271 get(id: string, options: { after?: number | "tail" } = {}): ExecHandle {
272 const after = options.after ?? 0;
273 const record = this.records.get(id);
274 if (record?.live) {
275 // Live reattach: seed with whatever's already in the log
276 // past `after`, then continue with live events.
277 return { id, events: this.makeLiveStream(record, after === "tail" ? -1 : after) };
278 }
279 const log =
280 record?.log ?? openLog(this.db, id, { maxBytes: this.opts.logMaxBytes, now: this.opts.now });
281 if (log === undefined) {
282 throw new ExecError("ENOENT", `no exec record for id ${id}`);
283 }
284 return { id, events: replayToStream(log, after) };
285 }
286
287 kill(id: string, signal: NodeJS.Signals = "SIGTERM"): void {
288 const record = this.records.get(id);

Callers

nothing calls this directly

Calls 4

makeLiveStreamMethod · 0.95
openLogFunction · 0.85
replayToStreamFunction · 0.85
getMethod · 0.65

Tested by

no test coverage detected