package fakeclaude import ( "regexp" "strconv" "strings" ) // StepMarkerText decodes quoted prompt values for fake CLI fixture markers. Decode // those values without stripping literal quotes from an edit's replacement. func StepMarkerText(prompt string) string { for range 4 { lines := strings.Split(prompt, "\n") changed := false for i, line := range lines { at := strings.IndexByte(line, '"') if at < 0 { continue } prefix := strings.TrimSpace(line[:at]) if prefix != "" && prefix != "-" && !strings.HasSuffix(prefix, ":") { continue } if value, err := strconv.Unquote(strings.TrimSpace(line[at:])); err == nil { lines[i], changed = line[:at]+value, true } } prompt = strings.Join(lines, "\n") if !changed { break } } return prompt } // DistinctStepMarkers runs one fixture directive once even when the prompt // carries it in both the person's original words and the coordinator's brief. func DistinctStepMarkers(pattern *regexp.Regexp, prompt string) [][]string { seen := map[string]bool{} var out [][]string for _, match := range pattern.FindAllStringSubmatch(prompt, -1) { if !seen[match[0]] { out = append(out, match) seen[match[0]] = true } } return out }