| 1 |
<?php |
| 2 |
declare(strict_types=1); |
| 3 |
|
| 4 |
namespace Imagify\Abilities; |
| 5 |
|
| 6 |
/** |
| 7 |
* Contract for MCP abilities that spend Imagify quota. |
| 8 |
* |
| 9 |
* Implementing this interface opts an ability into |
| 10 |
* `AbstractAbility::guard_credit_confirmation()`, the shared pre-flight |
| 11 |
* quota/confirmation gate. |
| 12 |
* |
| 13 |
* @since 2.4.0 |
| 14 |
*/ |
| 15 |
interface CreditConsumingAbilityInterface { |
| 16 |
|
| 17 |
/** |
| 18 |
* Returns a small associative array describing what the call is about to do. |
| 19 |
* |
| 20 |
* Used by `AbstractAbility::guard_credit_confirmation()` to build the |
| 21 |
* `confirmation_required` response so the caller/AI can see the impact |
| 22 |
* before confirming. |
| 23 |
* |
| 24 |
* @param array $args Raw input arguments passed to execute(). |
| 25 |
* @return array{unit: string, count: int, total?: int, label: string} |
| 26 |
*/ |
| 27 |
public function get_impact_estimate( array $args ): array; |
| 28 |
} |
| 29 |
|