from flask import Flask, request, jsonify

app = Flask(__name__)

@app.route("/n8n-action-suggester", methods=["POST"])
def n8n_action_suggester():
    data = request.get_json(force=True)

    role = data.get("role")
    start_statement = data.get("start_statement")
    timeline = data.get("timeline", [])
    constraints = data.get("constraints", [])

    # Here you’d run your prompt builder + LLM call logic
    # For demo, return a static sample

    response = [
        {
            "type": "experiment",
            "description": "Run compatibility tests for Library X",
            "assignee": "engineering",
            "confidence": 0.85,
        },
        {
            "type": "escalate",
            "description": "Review licensing risk with legal team",
            "assignee": "legal",
            "confidence": 0.9,
        },
    ]

    return jsonify(response)
