:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
import { PlanningStep, PlanningStepStatus } from '~/queries/schema/schema-assistant-messages'
import { EnhancedToolCall } from '../max-constants'
export const PLAN_STEP_STATUS: Record<string, 'pending' | 'active' | 'done' | 'failed'> = {
completed: 'done',
in_progress: 'active',
failed: 'failed',
}
/** The steps of a `todo_write` call, whose `todos` arg holds `{ content, status, activeForm }` items. */
export function parsePlanningSteps(toolCall: EnhancedToolCall): PlanningStep[] {
if (!Array.isArray(toolCall.args.todos)) {
return []
}
return (toolCall.args.todos as Array<{ content: string; status: string; activeForm: string }>).map((todo) => ({
description: todo.content,
status: todo.status as PlanningStepStatus,
}))
}