Skip to content

Commit ceb360e

Browse files
committed
Merge branch 'main' of github.com:MolloKhan/SymfonyAi into pinecone-managed-store
2 parents 92f2bae + 92b5cb7 commit ceb360e

File tree

861 files changed

+31275
-6395
lines changed

Some content is hidden

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

861 files changed

+31275
-6395
lines changed

.doctor-rst.yaml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ rules:
2525
ensure_exactly_one_space_between_link_definition_and_link: ~
2626
ensure_link_definition_contains_valid_url: ~
2727
ensure_order_of_code_blocks_in_configuration_block: ~
28+
ensure_php_reference_syntax: ~
2829
extend_abstract_admin: ~
2930
extend_abstract_controller: ~
30-
# extend_controller: ~
3131
extension_xlf_instead_of_xliff: ~
3232
# filename_uses_dashes_only: ~
3333
# filename_uses_underscores_only: ~
@@ -38,7 +38,6 @@ rules:
3838
- '.. index::'
3939
indention: ~
4040
kernel_instead_of_app_kernel: ~
41-
# line_length: ~
4241
lowercase_as_in_use_statements: ~
4342
max_blank_lines:
4443
max: 2
@@ -82,7 +81,6 @@ rules:
8281
typo: ~
8382
unused_links: ~
8483
use_deprecated_directive_instead_of_versionadded: ~
85-
use_https_xsd_urls: ~
8684
# use_named_constructor_without_new_keyword_rule: ~
8785
valid_inline_highlighted_namespaces: ~
8886
valid_use_statements: ~
@@ -92,5 +90,3 @@ rules:
9290
min_version: '2.0'
9391
versionadded_directive_should_have_version: ~
9492
yaml_instead_of_yml_suffix: ~
95-
yarn_dev_option_at_the_end: ~
96-
# yarn_dev_option_not_at_the_end: ~

.github/CODEOWNERS

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
ai.symfony.com @javiereguiluz
12
demo @chr-hertel @OskarStark
23
examples @chr-hertel @OskarStark
34
fixtures @chr-hertel @OskarStark
4-
src @chr-hertel @Nyholm @OskarStark
5+
src @chr-hertel @OskarStark
6+
src/mcp-bundle @chr-hertel @Nyholm

.github/build-packages.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
use Symfony\Component\Finder\Finder;
1010

1111
$finder = (new Finder())
12-
->in([__DIR__.'/../src/*/', __DIR__.'/../examples/', __DIR__.'/../demo/'])
12+
->in([__DIR__.'/../src/*/', __DIR__.'/../src/*/src/Bridge/*/', __DIR__.'/../examples/', __DIR__.'/../demo/'])
1313
->depth(0)
1414
->name('composer.json')
1515
;
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
#!/bin/bash
2+
#
3+
# Validates bridge naming conventions for Symfony AI components.
4+
#
5+
# Usage: validate-bridge-naming.sh <bridge_type> [component] [options_file]
6+
#
7+
# Arguments:
8+
# bridge_type Type of bridge (e.g., "store", "tool") - used in output messages and package suffix
9+
# component Name of the parent component (e.g., agent, platform, store)
10+
# If not provided, defaults to bridge_type
11+
# options_file Optional: Path to options.php file for config key validation (only needed for stores)
12+
#
13+
# Example:
14+
# validate-bridge-naming.sh store
15+
# validate-bridge-naming.sh store store src/ai-bundle/config/options.php
16+
# validate-bridge-naming.sh tool agent
17+
#
18+
# The script builds the bridge path internally as: src/${component}/src/Bridge/*
19+
20+
set -e
21+
22+
BRIDGE_TYPE="${1:?Bridge type is required (e.g., store, tool)}"
23+
COMPONENT="${2:-$BRIDGE_TYPE}"
24+
BRIDGE_PATH="src/${COMPONENT}/src/Bridge/*"
25+
OPTIONS_FILE="${3:-}"
26+
27+
ERRORS=0
28+
29+
# Find all bridges with composer.json
30+
for composer_file in ${BRIDGE_PATH}/composer.json; do
31+
if [[ ! -f "$composer_file" ]]; then
32+
continue
33+
fi
34+
35+
# Get the bridge directory name (e.g., ChromaDb)
36+
bridge_dir=$(dirname "$composer_file")
37+
bridge_name=$(basename "$bridge_dir")
38+
39+
# Get the package name from composer.json
40+
package_name=$(jq -r '.name' "$composer_file")
41+
42+
# Expected package name format: symfony/ai-{lowercase-with-dashes}-{type}
43+
# Convert PascalCase to kebab-case (e.g., ChromaDb -> chroma-db)
44+
expected_kebab=$(echo "$bridge_name" | sed 's/\([a-z]\)\([A-Z]\)/\1-\2/g' | tr '[:upper:]' '[:lower:]')
45+
expected_package="symfony/ai-${expected_kebab}-${BRIDGE_TYPE}"
46+
47+
if [[ "$package_name" != "$expected_package" ]]; then
48+
echo "::error file=$composer_file::Package name '$package_name' does not match expected '$expected_package' for bridge '$bridge_name'"
49+
ERRORS=$((ERRORS + 1))
50+
else
51+
echo "$bridge_name: package name '$package_name' is correct"
52+
fi
53+
54+
# Check options.php for the config key if options file is provided
55+
if [[ -n "$OPTIONS_FILE" && -f "$OPTIONS_FILE" ]]; then
56+
# Expected config key should be lowercase without dashes/underscores
57+
expected_config_key=$(echo "$bridge_name" | tr '[:upper:]' '[:lower:]')
58+
59+
# Look for ->arrayNode('configkey') in the options file
60+
if ! grep -q -- "->arrayNode('$expected_config_key')" "$OPTIONS_FILE"; then
61+
echo "::error file=$OPTIONS_FILE::Missing or incorrect config key for bridge '$bridge_name'. Expected '->arrayNode('$expected_config_key')' in ${BRIDGE_TYPE} configuration"
62+
ERRORS=$((ERRORS + 1))
63+
else
64+
echo "$bridge_name: config key '$expected_config_key' found in options.php"
65+
fi
66+
fi
67+
done
68+
69+
if [[ $ERRORS -gt 0 ]]; then
70+
echo ""
71+
echo "::error::Found $ERRORS naming convention violation(s)"
72+
exit 1
73+
fi
74+
75+
echo ""
76+
echo "All ${BRIDGE_TYPE} bridge naming conventions are valid!"
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
#!/bin/bash
2+
#
3+
# Validates that all bridge directories are configured in splitsh.json.
4+
#
5+
# Usage: validate-bridge-splitsh.sh <bridge_type> [component]
6+
#
7+
# Arguments:
8+
# bridge_type Type of bridge (e.g., "store", "tool") - used in output messages
9+
# component Name of the parent component (e.g., agent, platform, store)
10+
# If not provided, defaults to bridge_type
11+
#
12+
# Example:
13+
# validate-bridge-splitsh.sh store
14+
# validate-bridge-splitsh.sh tool agent
15+
#
16+
# The script builds the bridge path internally as: src/${component}/src/Bridge/*
17+
18+
set -e
19+
20+
BRIDGE_TYPE="${1:?Bridge type is required (e.g., store, tool)}"
21+
COMPONENT="${2:-$BRIDGE_TYPE}"
22+
BRIDGE_PATH="src/${COMPONENT}/src/Bridge/*"
23+
24+
SPLITSH_FILE="splitsh.json"
25+
26+
if [[ ! -f "$SPLITSH_FILE" ]]; then
27+
echo "::error::splitsh.json not found"
28+
exit 1
29+
fi
30+
31+
ERRORS=0
32+
33+
echo "Validating ${BRIDGE_TYPE} bridges (${BRIDGE_PATH})..."
34+
for bridge_dir in ${BRIDGE_PATH}/; do
35+
if [[ ! -d "$bridge_dir" ]]; then
36+
continue
37+
fi
38+
39+
bridge_name=$(basename "$bridge_dir")
40+
# Remove trailing /* from bridge_path and append bridge_name
41+
base_path="${BRIDGE_PATH%/*}"
42+
expected_path="${base_path}/${bridge_name}"
43+
44+
# Check if the path exists in splitsh.json
45+
if ! jq -e --arg path "$expected_path" 'any(.subtrees[]; . == $path or (type == "object" and .prefixes[0].from == $path))' "$SPLITSH_FILE" > /dev/null 2>&1; then
46+
echo "::error file=$SPLITSH_FILE::${BRIDGE_TYPE} bridge '$bridge_name' at '$expected_path' is not configured in splitsh.json"
47+
ERRORS=$((ERRORS + 1))
48+
else
49+
echo "$bridge_name: configured in splitsh.json"
50+
fi
51+
done
52+
53+
if [[ $ERRORS -gt 0 ]]; then
54+
echo ""
55+
echo "::error::Found $ERRORS ${BRIDGE_TYPE} bridge(s) missing from splitsh.json"
56+
exit 1
57+
fi
58+
59+
echo ""
60+
echo "All ${BRIDGE_TYPE} bridges are correctly configured in splitsh.json!"

.github/workflows/code-quality.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,18 @@ jobs:
2121
strategy:
2222
fail-fast: false
2323
matrix:
24-
php-version: [ '8.4' ]
24+
php-version: [ '8.5' ]
2525
steps:
2626
- name: Checkout
27-
uses: actions/checkout@v5
27+
uses: actions/checkout@v6
2828

2929
- name: Configure environment
3030
run: |
3131
echo COLUMNS=120 >> $GITHUB_ENV
3232
echo COMPOSER_UP='composer update --no-progress --no-interaction --no-scripts --ansi --ignore-platform-req=ext-mongodb' >> $GITHUB_ENV
3333
echo PHPSTAN='vendor/bin/phpstan' >> $GITHUB_ENV
3434
35-
PACKAGES=$(find src/ -mindepth 2 -type f -name composer.json -not -path "*/vendor/*" -printf '%h\n' | sed 's/^src\///' | grep -Ev "examples" | sort | tr '\n' ' ')
35+
PACKAGES=$(find src/ -mindepth 2 -type f -name composer.json -not -path "*/vendor/*" -not -path "*/Bridge/*" -printf '%h\n' | sed 's/^src\///' | grep -Ev "examples" | sort | tr '\n' ' ')
3636
echo "Packages: $PACKAGES"
3737
echo "PACKAGES=$PACKAGES" >> $GITHUB_ENV
3838

.github/workflows/deptrac.yaml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: deptrac
2+
3+
on:
4+
push:
5+
paths-ignore:
6+
- 'src/*/doc/**'
7+
- 'src/**/*.md'
8+
pull_request:
9+
paths-ignore:
10+
- 'src/*/doc/**'
11+
- 'src/**/*.md'
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
deptrac:
19+
name: deptrac
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v6
24+
25+
- name: Configure environment
26+
run: |
27+
echo COLUMNS=120 >> $GITHUB_ENV
28+
echo COMPOSER_UP='composer update --prefer-lowest --no-progress --no-interaction --ansi --ignore-platform-req=ext-mongodb' >> $GITHUB_ENV
29+
30+
- name: Setup PHP
31+
uses: shivammathur/setup-php@v2
32+
with:
33+
php-version: '8.5'
34+
35+
- name: Get composer cache directory
36+
id: composer-cache
37+
run: |
38+
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
39+
40+
- name: Cache packages dependencies
41+
uses: actions/cache@v4
42+
with:
43+
path: ${{ steps.composer-cache.outputs.dir }}
44+
key: ${{ runner.os }}-composer-packages-${{ hashFiles('src/**/composer.json') }}
45+
restore-keys: |
46+
${{ runner.os }}-composer-packages
47+
48+
- name: Install root dependencies
49+
uses: ramsey/composer-install@v3
50+
51+
- name: Build root packages
52+
run: php .github/build-packages.php
53+
54+
- name: Run deptrac/deptrac
55+
run: $COMPOSER_UP && vendor/bin/deptrac

.github/workflows/doctor-rst.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,20 @@ on:
55
paths:
66
- '**.rst'
77
- 'docs/**'
8+
- '.github/workflows/doctor-rst.yaml'
89
pull_request:
910
paths:
1011
- '**.rst'
1112
- 'docs/**'
13+
- '.github/workflows/doctor-rst.yaml'
1214

1315
jobs:
1416
doctor-rst:
1517
name: DOCtor-RST
1618
runs-on: ubuntu-latest
1719
steps:
1820
- name: Checkout
19-
uses: actions/checkout@v5
21+
uses: actions/checkout@v6
2022

2123
- name: Create cache dir
2224
run: mkdir .cache
@@ -32,6 +34,6 @@ jobs:
3234
key: doctor-rst-${{ steps.extract_base_branch.outputs.branch }}
3335

3436
- name: DOCtor-RST
35-
uses: docker://oskarstark/doctor-rst
37+
uses: docker://oskarstark/doctor-rst:1.72.0
3638
with:
3739
args: --short --error-format=github --cache-file=/github/workspace/.cache/doctor-rst.cache

.github/workflows/integration-tests.yaml

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
strategy:
2424
fail-fast: false
2525
matrix:
26-
php-version: ['8.2', '8.3', '8.4']
26+
php-version: ['8.2', '8.5']
2727
dependency-version: ['']
2828
symfony-version: ['']
2929
include:
@@ -35,10 +35,10 @@ jobs:
3535
symfony-version: '7.4.*'
3636

3737
env:
38-
SYMFONY_REQUIRE: ${{ matrix.symfony-version || '>=7.3' }}
38+
SYMFONY_REQUIRE: ${{ matrix.symfony-version || '>=7.4' }}
3939

4040
steps:
41-
- uses: actions/checkout@v5
41+
- uses: actions/checkout@v6
4242

4343
- name: Up the examples services
4444
working-directory: examples
@@ -65,25 +65,25 @@ jobs:
6565
- name: Install root dependencies
6666
uses: ramsey/composer-install@v3
6767

68-
- name: Install examples dependencies
68+
- name: Build root packages
69+
run: php .github/build-packages.php
70+
71+
- name: Install root dependencies
6972
uses: ramsey/composer-install@v3
7073
with:
7174
working-directory: examples
7275

73-
- name: Link examples
74-
working-directory: examples
75-
run: ../link
76-
7776
- name: Run commands examples
77+
working-directory: examples
7878
run: |
79-
php examples/commands/stores.php
80-
php examples/commands/message-stores.php
79+
php commands/stores.php
80+
php commands/message-stores.php
8181
8282
demo:
8383
runs-on: ubuntu-latest
8484

8585
steps:
86-
- uses: actions/checkout@v5
86+
- uses: actions/checkout@v6
8787

8888
- name: Setup PHP
8989
uses: shivammathur/setup-php@v2
@@ -95,13 +95,16 @@ jobs:
9595
- name: Install root dependencies
9696
uses: ramsey/composer-install@v3
9797

98+
- name: Build root packages
99+
run: php .github/build-packages.php
100+
98101
- name: Install demo dependencies
99102
uses: ramsey/composer-install@v3
100103
with:
101104
composer-options: "--no-scripts"
102105
working-directory: demo
103106

104-
- name: Link demo
107+
- name: Link local packages
105108
working-directory: demo
106109
run: ../link
107110

0 commit comments

Comments
 (0)