/*
 * Copyright 2008-2026 Async-IO.org
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */
package {{agent.packageName}};

import org.atmosphere.agent.annotation.Agent;
import org.atmosphere.ai.StreamingSession;
import org.atmosphere.ai.annotation.AiTool;
import org.atmosphere.ai.annotation.Param;
import org.atmosphere.ai.annotation.Prompt;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * {{agent.description}}
 *
 * <p>The skill file at {@code prompts/skill.md} defines this agent's personality,
 * capabilities, and guardrails. The {@code @Prompt} method delegates to the
 * configured AI runtime, which uses the skill file as the system prompt.</p>
 */
@Agent(name = "{{agent.name}}",
       skillFile = "prompts/skill.md",
       description = "{{agent.description}}",
       headless = true)
public class {{agent.className}} {

    private static final Logger logger = LoggerFactory.getLogger({{agent.className}}.class);

    @Prompt
    public void onMessage(String message, StreamingSession session) {
        logger.info("{}: received prompt: {}", "{{agent.name}}", message);
        session.stream(message);
    }
{{#agent.hasTools}}

{{#agent.tools}}
    @AiTool(name = "{{name}}", description = "{{description}}")
    public String {{methodName}}(@Param("input") String input) {
        logger.info("{}: {{name}} called with: {}", "{{agent.name}}", input);
        // TODO: implement real logic
        return "{{name}} result for: " + input;
    }

{{/agent.tools}}
{{/agent.hasTools}}
}
