MCPcopy Index your code
hub / github.com/coder/mux / listBackgroundProcesses

Method listBackgroundProcesses

src/node/services/workspaceService.ts:8758–8793  ·  view source on GitHub ↗

* List background processes for a workspace. * Returns process info suitable for UI display (excludes handle).

(workspaceId: string)

Source from the content-addressed store, hash-verified

8756 * Returns process info suitable for UI display (excludes handle).
8757 */
8758 async listBackgroundProcesses(workspaceId: string): Promise<
8759 Array<{
8760 id: string;
8761 pid: number;
8762 script: string;
8763 displayName?: string;
8764 startTime: number;
8765 status: "running" | "exited" | "killed" | "failed";
8766 monitor?: {
8767 filter: string;
8768 filter_exclude: boolean;
8769 cooldown_ms: number;
8770 max_events?: number;
8771 totalMatches: number;
8772 droppedLines: number;
8773 lastLines: string[];
8774 stopped: boolean;
8775 };
8776 exitCode?: number;
8777 }>
8778 > {
8779 const processes = await this.backgroundProcessManager.list(workspaceId);
8780 return processes.map((p) => {
8781 const monitor = this.backgroundProcessManager.getMonitorSnapshot(p);
8782 return {
8783 id: p.id,
8784 pid: p.pid,
8785 script: p.script,
8786 displayName: p.displayName,
8787 startTime: p.startTime,
8788 status: p.status,
8789 ...(monitor != null ? { monitor } : {}),
8790 exitCode: p.exitCode,
8791 };
8792 });
8793 }
8794
8795 /**
8796 * Terminate a background process by ID.

Callers 1

getStateFunction · 0.80

Calls 2

getMonitorSnapshotMethod · 0.80
listMethod · 0.45

Tested by

no test coverage detected