diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 8e1e830..cc712c3 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -35,7 +35,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.4' + php-version: '8.3' coverage: none - name: Install dependencies diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7b80816..8b98f7e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -17,7 +17,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.4' + php-version: '8.3' coverage: none - name: Install dependencies diff --git a/README.md b/README.md index 3571c8f..7c2dcc9 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ Watch a quick demo of Intercept in action. ## Requirements > [!Important] -> Requires PHP 8.4+ and `laravel/ai`. +> Requires PHP 8.3+ and `laravel/ai`. ## AI Agent Middleware collection diff --git a/composer.json b/composer.json index fbe6162..753b45b 100644 --- a/composer.json +++ b/composer.json @@ -28,18 +28,18 @@ } ], "require": { - "php": "^8.4.0", + "php": "^8.3", "laravel/ai": "*" }, "require-dev": { "laravel/pint": "^1.29.1", "mrpunyapal/rector-pest": "^0.2.15", - "orchestra/testbench": "^10.0|^11.0", - "pestphp/pest": "^5.0.0", - "pestphp/pest-plugin-type-coverage": "^5.0.0", - "phpstan/phpstan": "^2.1.54", + "orchestra/testbench": "^10.6|^11.0", + "pestphp/pest": "^3.0|^4.0|^5.0.0", + "pestphp/pest-plugin-type-coverage": "^3.0|^4.0|^5.0.0", + "phpstan/phpstan": "^2.1", "rector/rector": "^2.4.2", - "symfony/var-dumper": "^8.0.8" + "symfony/var-dumper": "^7.0|^8.0.8" }, "replace": { "promptphp/intercept-injection-guard": "self.version", diff --git a/docs/quickstart.mdx b/docs/quickstart.mdx index b5a65d2..47aa44f 100644 --- a/docs/quickstart.mdx +++ b/docs/quickstart.mdx @@ -8,7 +8,7 @@ This guide shows the fastest way to install Intercept and add middleware to a La ## Requirements -Requires PHP 8.4+ and `laravel/ai`. +Requires PHP 8.3+ and `laravel/ai`. ## Installation diff --git a/src/InjectionGuard/composer.json b/src/InjectionGuard/composer.json index 8ff397b..c2a331f 100644 --- a/src/InjectionGuard/composer.json +++ b/src/InjectionGuard/composer.json @@ -14,7 +14,7 @@ } ], "require": { - "php": "^8.4.0", + "php": "^8.3", "laravel/ai": "*", "promptphp/intercept-support": "*" }, diff --git a/src/InjectionGuard/tests/Fixtures/PromptInjectionGuardTestAgent.php b/src/InjectionGuard/tests/Fixtures/PromptInjectionGuardTestAgent.php index 41fb712..57fdf0b 100644 --- a/src/InjectionGuard/tests/Fixtures/PromptInjectionGuardTestAgent.php +++ b/src/InjectionGuard/tests/Fixtures/PromptInjectionGuardTestAgent.php @@ -5,6 +5,7 @@ namespace PromptPHP\Intercept\InjectionGuard\Tests\Fixtures; use Illuminate\Broadcasting\Channel; +use Laravel\Ai\Approvals\Decisions; use Laravel\Ai\Contracts\Agent; use Laravel\Ai\Enums\Lab; use Laravel\Ai\Responses\AgentResponse; @@ -14,13 +15,19 @@ final class PromptInjectionGuardTestAgent implements Agent { + /** + * {@inheritDoc} + */ public function instructions(): string { return 'You are a test agent.'; } + /** + * {@inheritDoc} + */ public function prompt( - string $prompt, + Decisions|string $prompt, array $attachments = [], Lab|array|string|null $provider = null, ?string $model = null, @@ -29,8 +36,11 @@ public function prompt( throw new RuntimeException('Not used in this test.'); } + /** + * {@inheritDoc} + */ public function stream( - string $prompt, + Decisions|string $prompt, array $attachments = [], Lab|array|string|null $provider = null, ?string $model = null, @@ -39,42 +49,54 @@ public function stream( throw new RuntimeException('Not used in this test.'); } + /** + * {@inheritDoc} + */ public function queue( - string $prompt, + Decisions|string $prompt, array $attachments = [], Lab|array|string|null $provider = null, - ?string $model = null, + ?string $model = null ): QueuedAgentResponse { throw new RuntimeException('Not used in this test.'); } + /** + * {@inheritDoc} + */ public function broadcast( - string $prompt, + Decisions|string $prompt, Channel|array $channels, array $attachments = [], bool $now = false, Lab|array|string|null $provider = null, - ?string $model = null, + ?string $model = null ): StreamableAgentResponse { throw new RuntimeException('Not used in this test.'); } + /** + * {@inheritDoc} + */ public function broadcastNow( - string $prompt, + Decisions|string $prompt, Channel|array $channels, array $attachments = [], Lab|array|string|null $provider = null, - ?string $model = null, + ?string $model = null ): StreamableAgentResponse { throw new RuntimeException('Not used in this test.'); } + /** + * {@inheritDoc} + */ public function broadcastOnQueue( - string $prompt, + Decisions|string $prompt, Channel|array $channels, array $attachments = [], Lab|array|string|null $provider = null, - ?string $model = null, + ?string $model = null ): QueuedAgentResponse { throw new RuntimeException('Not used in this test.'); } diff --git a/src/PIIRedactor/composer.json b/src/PIIRedactor/composer.json index 49d9c8e..9cf5083 100644 --- a/src/PIIRedactor/composer.json +++ b/src/PIIRedactor/composer.json @@ -14,7 +14,7 @@ } ], "require": { - "php": "^8.4", + "php": "^8.3", "laravel/ai": "*", "promptphp/intercept-support": "*" }, diff --git a/src/PIIRedactor/tests/Fixtures/PIIRedactorTestAgent.php b/src/PIIRedactor/tests/Fixtures/PIIRedactorTestAgent.php index 8bf025e..f3350b7 100644 --- a/src/PIIRedactor/tests/Fixtures/PIIRedactorTestAgent.php +++ b/src/PIIRedactor/tests/Fixtures/PIIRedactorTestAgent.php @@ -5,6 +5,7 @@ namespace PromptPHP\Intercept\PIIRedactor\Tests\Fixtures; use Illuminate\Broadcasting\Channel; +use Laravel\Ai\Approvals\Decisions; use Laravel\Ai\Contracts\Agent; use Laravel\Ai\Enums\Lab; use Laravel\Ai\Responses\AgentResponse; @@ -14,13 +15,19 @@ final class PIIRedactorTestAgent implements Agent { + /** + * {@inheritDoc} + */ public function instructions(): string { return 'You are a test agent.'; } + /** + * {@inheritDoc} + */ public function prompt( - string $prompt, + Decisions|string $prompt, array $attachments = [], Lab|array|string|null $provider = null, ?string $model = null, @@ -29,8 +36,11 @@ public function prompt( throw new RuntimeException('Not used in this test.'); } + /** + * {@inheritDoc} + */ public function stream( - string $prompt, + Decisions|string $prompt, array $attachments = [], Lab|array|string|null $provider = null, ?string $model = null, @@ -39,42 +49,54 @@ public function stream( throw new RuntimeException('Not used in this test.'); } + /** + * {@inheritDoc} + */ public function queue( - string $prompt, + Decisions|string $prompt, array $attachments = [], Lab|array|string|null $provider = null, - ?string $model = null, + ?string $model = null ): QueuedAgentResponse { throw new RuntimeException('Not used in this test.'); } + /** + * {@inheritDoc} + */ public function broadcast( - string $prompt, + Decisions|string $prompt, Channel|array $channels, array $attachments = [], bool $now = false, Lab|array|string|null $provider = null, - ?string $model = null, + ?string $model = null ): StreamableAgentResponse { throw new RuntimeException('Not used in this test.'); } + /** + * {@inheritDoc} + */ public function broadcastNow( - string $prompt, + Decisions|string $prompt, Channel|array $channels, array $attachments = [], Lab|array|string|null $provider = null, - ?string $model = null, + ?string $model = null ): StreamableAgentResponse { throw new RuntimeException('Not used in this test.'); } + /** + * {@inheritDoc} + */ public function broadcastOnQueue( - string $prompt, + Decisions|string $prompt, Channel|array $channels, array $attachments = [], Lab|array|string|null $provider = null, - ?string $model = null, + ?string $model = null ): QueuedAgentResponse { throw new RuntimeException('Not used in this test.'); } diff --git a/src/Support/composer.json b/src/Support/composer.json index fb302c8..6b5683d 100644 --- a/src/Support/composer.json +++ b/src/Support/composer.json @@ -14,7 +14,7 @@ } ], "require": { - "php": "^8.4", + "php": "^8.3", "illuminate/support": "^12.0|^13.0" }, "autoload": {