INNER CODE UNIT · TypeScript
progressFor
Core-Mate/OpenGUI · deepseek-harness-plugin/src/index.ts:314
function progressFor(
parent: CommandInvocation['agent'],
presentation: CoremateTaskPresentation,
): ForegroundProgress | undefined {
if (presentation === 'result-only') return undefined
if (presentation === 'parent-chat') return { parent }
return { parent, nestedUnderCallId: presentation.nestedUnderCallId }
}
async function settleForeground(run: SubagentRun, progress?: ForegroundProgress): Promise<CoremateTaskResult> {
let failure: unknown
let stopProgress: (() => void) | undefined
let sourceEventSeq: (() => number | undefined) | undefined
try {
if (progress !== undefined) {
const child = run.localAgent
if (child === undefined) {
throw new Error('coremate-mobile: direct commands require a local OpenGUI agent for live chat progress')