feat: Extend AgentInfo with exitCode + add getAgentInputFiles/getAgentPrompt tRPC procedures

Adds exitCode to AgentInfo type and propagates it through all toAgentInfo()
implementations. Enhances getAgent to also return taskName and initiativeName
from their respective repositories. Adds two new filesystem-reading tRPC
procedures for the Agent Details tab: getAgentInputFiles (reads .cw/input/
files with binary detection, 500 KB cap, sorted) and getAgentPrompt (reads
.cw/agent-logs/<name>/PROMPT.md with 1 MB cap and structured ENOENT handling).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Lukas May
2026-03-05 21:39:29 +01:00
parent 573e1b40d2
commit 269a2d2616
9 changed files with 421 additions and 3 deletions

View File

@@ -18,6 +18,7 @@ export interface AgentInfo {
status: string;
initiativeId?: string | null;
worktreeId: string;
exitCode?: number | null;
}
export interface CleanupStrategy {

View File

@@ -353,6 +353,7 @@ export class AgentLifecycleController {
status: agent.status,
initiativeId: agent.initiativeId,
worktreeId: agent.worktreeId,
exitCode: agent.exitCode ?? null,
};
}
}