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

Method get

packages/computer/src/shell.ts:209–220  ·  view source on GitHub ↗
(
    id: string,
    options: GetExecOptions<E> = {},
  )

Source from the content-addressed store, hash-verified

207 get(id: string, options: GetExecOptions<undefined>): Promise<ExecHandle<undefined>>;
208 get(id: string, options: GetExecOptions<"utf8">): Promise<ExecHandle<"utf8">>;
209 async get<E extends ExecEncoding>(
210 id: string,
211 options: GetExecOptions<E> = {},
212 ): Promise<ExecHandle<E>> {
213 const after = resumeToAfter(options.resume);
214 const envelope = await this.#shell.getExec({ id, after });
215 const events = disposeOnDone(envelope.events, () => maybeDispose(envelope));
216 // Reattach doesn't own the original push frame: pushed = 0.
217 // The post-drain pull still fires, scoped to whatever lands
218 // between reattach and the next drain.
219 return wrapHandle<E>(this.#shell, this.#sync, id, events, options.encoding, 0);
220 }
221
222 kill(id: string, signal?: KillSignal, _options: { backend?: string } = {}): Promise<void> {
223 return this.#shell.killExec({ id, signal });

Callers

nothing calls this directly

Calls 5

disposeOnDoneFunction · 0.85
wrapHandleFunction · 0.85
resumeToAfterFunction · 0.70
maybeDisposeFunction · 0.70
getExecMethod · 0.65

Tested by

no test coverage detected