* Async version of ingestResponse using MarrowScript Feature #3 (extract_plan). * Tries the compiled LLM extractor first — handles plans embedded in prose. * Falls back to the regex parsePlan() on failure.
(text)
| 171 | * Falls back to the regex parsePlan() on failure. |
| 172 | */ |
| 173 | async ingestResponseAsync(text) { |
| 174 | if (!this.shouldInject || this.plan) return false; |
| 175 | // Try LLM extractor first |
| 176 | try { |
| 177 | const { extractPlanSteps } = require('../bin/features_adapter'); |
| 178 | const steps = await extractPlanSteps(text); |
| 179 | if (steps && steps.length >= DEFAULT_MIN_STEPS) { |
| 180 | this.plan = steps.slice(0, DEFAULT_MAX_STEPS); |
| 181 | this.currentStep = 0; |
| 182 | return true; |
| 183 | } |
| 184 | } catch {} |
| 185 | // Fallback to regex |
| 186 | return this.ingestResponse(text); |
| 187 | } |
| 188 | |
| 189 | /** Mark step N (0-indexed) as complete. */ |
| 190 | completeStep(n) { |
no test coverage detected