feat: add a ui to manage running Terminal (Executor) processes#2333
Conversation
Greptile SummaryThis PR adds a new "Running Processes" UI page that lists all OS-level processes under the app's UID, enriches managed terminal/background-executor entries with service metadata, and provides per-process kill actions. It introduces
Confidence Score: 4/5Safe to merge with the TypeScript declaration gaps addressed; the runtime behavior of the new page is functional and the Java kill path is correctly guarded. The new src/index.d.ts — the Executor interface and a new OsProcess type need updating before TypeScript consumers can use the new APIs. Important Files Changed
Sequence Diagram%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
participant UI as RunningProcesses (JS)
participant Ex as Executor (JS)
participant EJ as Executor.java
participant BE as BackgroundExecutor.java
participant TS as TerminalService
participant PU as ProcessUtils
UI->>Ex: listAllProcesses()
Ex->>EJ: cordova exec "listAllProcesses"
EJ->>PU: getAllProcesses()
PU-->>EJ: JSONArray (pid, ppid, name, cmd, mem, isSelf, startedAt)
EJ-->>UI: OsProcess[]
UI->>Ex: listProcesses()
Ex->>TS: MSG_LIST_PROCESSES
TS-->>UI: ProcessDetails[] (id, pid, cmd, alpine, startedAt)
UI->>Ex: BackgroundExecutor.listProcesses()
Ex->>BE: cordova exec "listProcesses"
BE-->>UI: ProcessDetails[] (id, pid, cmd, alpine, startedAt)
Note over UI: merge managedMap → enrich allProcesses
UI->>UI: renderList() / renderSearch()
alt user clicks kill (managed)
UI->>Ex: stop(managedId)
Ex->>TS: MSG_STOP_PROCESS
TS->>PU: killProcessTree(process)
else user clicks kill (unmanaged)
UI->>Ex: killProcess(pid)
Ex->>EJ: cordova exec "killProcess"
EJ->>PU: killProcess(pid)
PU-->>EJ: exit code check / throws on failure
end
UI->>UI: refresh() → update display
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
participant UI as RunningProcesses (JS)
participant Ex as Executor (JS)
participant EJ as Executor.java
participant BE as BackgroundExecutor.java
participant TS as TerminalService
participant PU as ProcessUtils
UI->>Ex: listAllProcesses()
Ex->>EJ: cordova exec "listAllProcesses"
EJ->>PU: getAllProcesses()
PU-->>EJ: JSONArray (pid, ppid, name, cmd, mem, isSelf, startedAt)
EJ-->>UI: OsProcess[]
UI->>Ex: listProcesses()
Ex->>TS: MSG_LIST_PROCESSES
TS-->>UI: ProcessDetails[] (id, pid, cmd, alpine, startedAt)
UI->>Ex: BackgroundExecutor.listProcesses()
Ex->>BE: cordova exec "listProcesses"
BE-->>UI: ProcessDetails[] (id, pid, cmd, alpine, startedAt)
Note over UI: merge managedMap → enrich allProcesses
UI->>UI: renderList() / renderSearch()
alt user clicks kill (managed)
UI->>Ex: stop(managedId)
Ex->>TS: MSG_STOP_PROCESS
TS->>PU: killProcessTree(process)
else user clicks kill (unmanaged)
UI->>Ex: killProcess(pid)
Ex->>EJ: cordova exec "killProcess"
EJ->>PU: killProcess(pid)
PU-->>EJ: exit code check / throws on failure
end
UI->>UI: refresh() → update display
Reviews (6): Last reviewed commit: "fix" | Re-trigger Greptile |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as off-topic.
This comment was marked as off-topic.
|
Everything is good but I think it can't detect processes that are not started by Executor like child processes maybe you could read |
This is already implemented. |
Closes: #1773