Files
goodbuddy/src/shared/runtime-checklist.ts
T
mesalogo c7a93803c9 feat: show runtime checklists and support remote Continue
Display native OpenCode and Continue checklists alongside scheduled tasks, preserving request ownership, explicit clears and saved progress. Bundle both remote runtimes and support managed Continue installation, model routing, cancellation and restart continuation.

Validation: real local and Linux remote model checks, full Electron remote Continue flows, typecheck and lint passed. Full suite: 4707 passed, 67 skipped, one OpenCode compaction failure passed targeted rerun.

Release note: Display native execution checklists above conversations and support managed remote Continue projects with saved progress and cancellation recovery.
2026-09-19 10:47:27 +08:00

32 lines
1.2 KiB
TypeScript

import { z } from 'zod'
export const runtimeChecklistSchema = z.object({
source: z.enum(['opencode', 'continue']),
items: z.array(z.object({
content: z.string().trim().min(1),
status: z.enum(['pending', 'in_progress', 'completed', 'cancelled']),
priority: z.enum(['low', 'medium', 'high']).optional()
}).strict())
}).strict()
export type RuntimeChecklist = z.infer<typeof runtimeChecklistSchema>
// Only the native Checklist argument uses this syntax. Invalid input is not a clear.
export function parseContinueChecklist(name: string, input: unknown): RuntimeChecklist | undefined {
if (name !== 'Checklist') return undefined
try {
const args = typeof input === 'string' ? JSON.parse(input) : input
if (!args || typeof args.checklist !== 'string') return undefined
const items: RuntimeChecklist['items'] = []
for (const line of args.checklist.split(/\r?\n/u)) {
if (!line.trim()) continue
const match = /^\s*- \[([ xX])\]\s+(.+?)\s*$/u.exec(line)
if (!match || !match[2]?.trim()) return undefined
items.push({ content: match[2]!, status: match[1] === ' ' ? 'pending' : 'completed' })
}
return { source: 'continue', items }
} catch {
return undefined
}
}