Skip to content

Commit b94a54b

Browse files
authored
feat: agents (#9)
1 parent a77b5fc commit b94a54b

File tree

277 files changed

+19419
-4807
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

277 files changed

+19419
-4807
lines changed

.cursor/commands/fix-stan.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Use `composer stan --no-progress` to see the PHPStan failures, and then fix them.

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@
99
/testbench.yaml export-ignore
1010
/ecs.php export-ignore
1111
/tests export-ignore
12-
/cortex export-ignore
1312
/phpstan.neon export-ignore
13+
/workbench export-ignore
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: 'Setup PHP and Composer'
2+
description: 'Setup PHP and install Composer dependencies with caching'
3+
4+
inputs:
5+
php-version:
6+
description: 'PHP version to use'
7+
required: false
8+
default: '8.4'
9+
coverage:
10+
description: 'Coverage driver to use (none, xdebug, pcov)'
11+
required: false
12+
default: 'none'
13+
stability:
14+
description: 'Composer stability preference (prefer-stable, prefer-lowest)'
15+
required: false
16+
default: 'prefer-stable'
17+
18+
runs:
19+
using: 'composite'
20+
steps:
21+
- name: Setup PHP
22+
uses: shivammathur/setup-php@v2
23+
with:
24+
php-version: ${{ inputs.php-version }}
25+
coverage: ${{ inputs.coverage }}
26+
27+
- name: Get Composer Cache Directory
28+
id: composer-cache
29+
shell: bash
30+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
31+
32+
- name: Cache Composer dependencies
33+
uses: actions/cache@v5
34+
with:
35+
path: ${{ steps.composer-cache.outputs.dir }}
36+
key: ${{ runner.os }}-composer-${{ inputs.stability }}-${{ hashFiles('**/composer.lock') }}
37+
restore-keys: |
38+
${{ runner.os }}-composer-
39+
40+
- name: Install dependencies
41+
shell: bash
42+
run: |
43+
if [ "${{ inputs.stability }}" = "prefer-lowest" ]; then
44+
composer update --prefer-lowest --prefer-dist --no-interaction --no-progress
45+
else
46+
composer install --prefer-dist --no-interaction --no-progress
47+
fi
48+

.github/workflows/run-tests.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
fail-fast: true
1414
matrix:
1515
os: [ubuntu-latest]
16-
php: [8.3, 8.4]
16+
php: [8.4, 8.5]
1717
stability: [prefer-lowest, prefer-stable]
1818

1919
name: PHP${{ matrix.php }} - ${{ matrix.stability }} - ${{ matrix.os }}
@@ -22,20 +22,17 @@ jobs:
2222
- name: Checkout code
2323
uses: actions/checkout@v6
2424

25-
- name: Setup PHP
26-
uses: shivammathur/setup-php@v2
25+
- name: Setup PHP and Composer
26+
uses: ./.github/actions/setup-php-composer
2727
with:
2828
php-version: ${{ matrix.php }}
29-
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
3029
coverage: none
30+
stability: ${{ matrix.stability }}
3131

3232
- name: Setup problem matchers
3333
run: |
3434
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
3535
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
3636
37-
- name: Install dependencies
38-
run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction
39-
4037
- name: Execute tests
4138
run: vendor/bin/pest --colors=always

.github/workflows/static-analysis.yml

Lines changed: 28 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,8 @@ jobs:
1414
- name: Checkout code
1515
uses: actions/checkout@v6
1616

17-
- name: Setup PHP
18-
uses: shivammathur/setup-php@v2
19-
with:
20-
php-version: 8.3
21-
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
22-
23-
- name: Get Composer Cache Directory
24-
id: composer-cache
25-
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
26-
27-
- name: Cache Composer dependencies
28-
uses: actions/cache@v5
29-
with:
30-
path: ${{ steps.composer-cache.outputs.dir }}
31-
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
32-
restore-keys: |
33-
${{ runner.os }}-composer-
34-
35-
- name: Install dependencies
36-
run: composer install --prefer-dist --no-interaction --no-progress
17+
- name: Setup PHP and Composer
18+
uses: ./.github/actions/setup-php-composer
3719

3820
- name: Cache phpstan results
3921
uses: actions/cache@v5
@@ -52,26 +34,36 @@ jobs:
5234
- name: Checkout code
5335
uses: actions/checkout@v6
5436

55-
- name: Setup PHP
56-
uses: shivammathur/setup-php@v2
57-
with:
58-
php-version: 8.3
59-
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
37+
- name: Setup PHP and Composer
38+
uses: ./.github/actions/setup-php-composer
39+
40+
- name: Check type coverage
41+
run: vendor/bin/pest --type-coverage --min=100
42+
43+
format:
44+
runs-on: ubuntu-latest
45+
steps:
46+
- name: Checkout code
47+
uses: actions/checkout@v5
6048

61-
- name: Get Composer Cache Directory
62-
id: composer-cache
63-
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
49+
- name: Setup PHP and Composer
50+
uses: ./.github/actions/setup-php-composer
6451

65-
- name: Cache Composer dependencies
52+
- name: Cache rector results
6653
uses: actions/cache@v5
6754
with:
68-
path: ${{ steps.composer-cache.outputs.dir }}
69-
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
55+
path: /tmp/rector
56+
key: "rector-cache-${{ github.run_id }}" # always write a new cache
7057
restore-keys: |
71-
${{ runner.os }}-composer-
58+
rector-cache-
7259
73-
- name: Install dependencies
74-
run: composer install --prefer-dist --no-interaction --no-progress
60+
- name: Cache ecs results
61+
uses: actions/cache@v5
62+
with:
63+
path: /tmp/ecs
64+
key: "ecs-cache-${{ github.run_id }}" # always write a new cache
65+
restore-keys: |
66+
ecs-cache-
7567
76-
- name: Check type coverage
77-
run: vendor/bin/pest --type-coverage --min=100
68+
- name: Run format checks
69+
run: composer format --no-progress-bar

composer.json

Lines changed: 31 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,19 @@
1111
"authors": [
1212
{
1313
"name": "Sean Tymon",
14-
"email": "tymon148@gmail.com",
14+
"email": "sean@tymon.dev",
1515
"role": "Developer"
1616
}
1717
],
1818
"require": {
19-
"php": "^8.3",
19+
"php": "^8.4",
2020
"adhocore/json-fixer": "^1.0",
21-
"cortexphp/json-schema": "^0.6",
21+
"cortexphp/json-schema": "dev-main",
2222
"cortexphp/model-info": "^0.3",
23-
"illuminate/collections": "^11.23",
23+
"illuminate/collections": "^12.0",
24+
"laravel/prompts": "^0.3.8",
2425
"mozex/anthropic-php": "^1.1",
25-
"openai-php/client": "^0.15",
26+
"openai-php/client": "^0.18",
2627
"php-mcp/client": "^1.0",
2728
"psr-discovery/cache-implementations": "^1.2",
2829
"psr-discovery/event-dispatcher-implementations": "^1.1",
@@ -34,24 +35,28 @@
3435
"hkulekci/qdrant": "^0.5.8",
3536
"league/event": "^3.0",
3637
"mockery/mockery": "^1.6",
37-
"orchestra/testbench": "^9.8",
38-
"pestphp/pest": "^3.0",
39-
"pestphp/pest-plugin-type-coverage": "^3.4",
38+
"orchestra/testbench": "^10.6",
39+
"pestphp/pest": "^4.0",
40+
"pestphp/pest-plugin-type-coverage": "^4.0",
4041
"phpstan/phpstan": "^2.0",
4142
"rector/rector": "^2.0",
42-
"symplify/easy-coding-standard": "^12.5"
43+
"symplify/easy-coding-standard": "^13.0"
4344
},
4445
"autoload": {
4546
"psr-4": {
4647
"Cortex\\": "src/"
4748
},
4849
"files": [
49-
"src/Support/helpers.php"
50+
"src/Support/helpers.php",
51+
"src/Prompts/helpers.php"
5052
]
5153
},
5254
"autoload-dev": {
5355
"psr-4": {
54-
"Cortex\\Tests\\": "tests/"
56+
"Cortex\\Tests\\": "tests/",
57+
"Workbench\\App\\": "workbench/app/",
58+
"Workbench\\Database\\Factories\\": "workbench/database/factories/",
59+
"Workbench\\Database\\Seeders\\": "workbench/database/seeders/"
5560
}
5661
},
5762
"scripts": {
@@ -69,6 +74,18 @@
6974
"@test",
7075
"@stan",
7176
"@type-coverage"
77+
],
78+
"post-autoload-dump": [
79+
"@clear",
80+
"@prepare"
81+
],
82+
"clear": "@php vendor/bin/testbench package:purge-skeleton --ansi",
83+
"prepare": "@php vendor/bin/testbench package:discover --ansi",
84+
"build": "@php vendor/bin/testbench workbench:build --ansi",
85+
"serve": [
86+
"Composer\\Config::disableProcessTimeout",
87+
"@build",
88+
"@php vendor/bin/testbench serve --ansi"
7289
]
7390
},
7491
"config": {
@@ -79,9 +96,9 @@
7996
"php-http/discovery": true
8097
}
8198
},
82-
"extra" : {
83-
"laravel" : {
84-
"providers" : [
99+
"extra": {
100+
"laravel": {
101+
"providers": [
85102
"Cortex\\CortexServiceProvider"
86103
]
87104
}

0 commit comments

Comments
 (0)