kin: auto-commit after pipeline
This commit is contained in:
parent
40e1001cea
commit
62f0ccc292
3 changed files with 193 additions and 0 deletions
|
|
@ -37,6 +37,11 @@ const rejectReason = ref('')
|
|||
const showRevise = ref(false)
|
||||
const reviseComment = ref('')
|
||||
|
||||
const parsedSelectedOutput = computed<ParsedAgentOutput | null>(() => {
|
||||
if (!selectedStep.value) return null
|
||||
return parseAgentOutput(selectedStep.value.output_summary)
|
||||
})
|
||||
|
||||
// Auto/Review mode (per-task, persisted in DB; falls back to localStorage per project)
|
||||
const autoMode = ref(false)
|
||||
|
||||
|
|
@ -135,6 +140,28 @@ function formatOutput(text: string | null): string {
|
|||
}
|
||||
}
|
||||
|
||||
interface ParsedAgentOutput {
|
||||
verdict: string | null
|
||||
details: string | null
|
||||
raw: string
|
||||
}
|
||||
|
||||
function parseAgentOutput(text: string | null): ParsedAgentOutput {
|
||||
if (!text) return { verdict: null, details: null, raw: '' }
|
||||
const verdictMatch = text.match(/##\s*Verdict\s*\n([\s\S]*?)(?=##\s*Details|$)/m)
|
||||
const detailsJsonMatch = text.match(/##\s*Details[\s\S]*?```json\n([\s\S]*?)```/)
|
||||
const verdict = verdictMatch ? verdictMatch[1].trim() : null
|
||||
let details: string | null = null
|
||||
if (detailsJsonMatch) {
|
||||
try {
|
||||
details = JSON.stringify(JSON.parse(detailsJsonMatch[1].trim()), null, 2)
|
||||
} catch {
|
||||
details = detailsJsonMatch[1].trim()
|
||||
}
|
||||
}
|
||||
return { verdict, details, raw: text }
|
||||
}
|
||||
|
||||
async function approve() {
|
||||
if (!task.value) return
|
||||
approveLoading.value = true
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue