MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / toAppTask

Function toAppTask

apps/kimi-web/src/api/daemon/mappers.ts:367–390  ·  view source on GitHub ↗
(wire: WireBackgroundTask)

Source from the content-addressed store, hash-verified

365// ---------------------------------------------------------------------------
366
367export function toAppTask(wire: WireBackgroundTask): AppTask {
368 return {
369 id: wire.id,
370 sessionId: wire.session_id,
371 kind: wire.kind,
372 description: wire.description,
373 status: wire.status as AppTaskStatus,
374 command: wire.command,
375 createdAt: wire.created_at,
376 startedAt: wire.started_at,
377 completedAt: wire.completed_at,
378 outputPreview: wire.output_preview,
379 outputBytes: wire.output_bytes,
380 subagentPhase: wire.subagent_phase,
381 subagentType: wire.subagent_type,
382 parentToolCallId: wire.parent_tool_call_id,
383 suspendedReason: wire.suspended_reason,
384 swarmIndex: wire.swarm_index,
385 // The background task store only holds detached tasks, so any subagent it
386 // returns is a background subagent (foreground ones never persist here).
387 runInBackground: wire.kind === 'subagent' ? true : undefined,
388 // outputLines starts undefined; populated by eventReducer via task.progress events
389 };
390}
391
392// ---------------------------------------------------------------------------
393// FsEntry mapper

Callers 2

getTaskMethod · 0.90
toAppEventFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected