@adhdev/daemon-core 0.9.82-rc.202 → 0.9.82-rc.203

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -26682,7 +26682,8 @@ function extractModal(state, sections, fullScreen, title, trace) {
26682
26682
  }
26683
26683
  function evaluate(spec, screenText, cursor) {
26684
26684
  const trace = [];
26685
- const lines = screenText.split("\n");
26685
+ const lines = screenText.split("\n").map((l) => l.endsWith("\r") ? l.slice(0, -1) : l);
26686
+ const cleanScreen = lines.join("\n");
26686
26687
  const sections = resolveSections(spec, lines);
26687
26688
  for (const s of sections) {
26688
26689
  trace.push({ kind: "section", text: `section[${s.id}] lines [${s.fromLine}, ${s.toLine}) (${s.toLine - s.fromLine} lines)` });
@@ -26693,9 +26694,9 @@ function evaluate(spec, screenText, cursor) {
26693
26694
  let activeState = null;
26694
26695
  let modal = null;
26695
26696
  for (const st of spec.states) {
26696
- const { matched, title } = matchState(st, sections, screenText, trace, cursor);
26697
+ const { matched, title } = matchState(st, sections, cleanScreen, trace, cursor);
26697
26698
  if (!matched) continue;
26698
- const extractedModal = extractModal(st, sections, screenText, title, trace);
26699
+ const extractedModal = extractModal(st, sections, cleanScreen, title, trace);
26699
26700
  if (st.modal_buttons && !extractedModal) {
26700
26701
  trace.push({ kind: "state_skip", text: `state[${st.id}] matched but modal_buttons extraction failed \u2014 not promoting` });
26701
26702
  continue;