"""Template for a Sentinel tool file.

Copy this, rename it, and replace the functions. Each top-level function you expose in the
Sentinel web UI becomes an approval-gated agent tool. Rules (see README.md):
  - the docstring is the tool description the model reads
  - annotate every parameter (str/int/float/bool/list/dict)
  - params without a default are required
  - return a string (or str()-friendly value)
  - DO NOT add a marker block yourself; Sentinel appends its own managed marker on upload

Requirements: none (standard library only). If you add a third-party import, Sentinel
detects it and offers a one-click leashed install.
"""
from __future__ import annotations


def greet(name: str, excited: bool = False) -> str:
    """Return a friendly greeting for `name`. Set `excited` to true for extra enthusiasm.

    Use this as a minimal example of the tool shape — one required string arg (`name`)
    and one optional boolean (`excited`)."""
    hello = f"Hello, {name}"
    return hello + ("!!!" if excited else ".")


def repeat(text: str, times: int = 1) -> str:
    """Repeat `text` `times` times (joined by newlines). `times` defaults to 1.

    Shows an integer parameter with a default (so it's optional in the tool schema)."""
    n = max(1, times)
    return "\n".join([text] * n)
