Repository navigation
Sync upstream updates: framework, MCP, embeddings and Inertia #721
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+3,648
−674
Merged
Changes from all commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
6483087
Cover atomic configuration, event and route cache publication
binaryfire 5ac328c
Preserve database transactions when acquiring existing cache locks
binaryfire ebbe8d3
Retry unrestorable jobs and distinguish string-job data from object m…
binaryfire 31f71cd
Clear the current route before each coroutine-local dispatch
binaryfire 2a0c7c0
Cover Redis tag pruning with SCAN_PREFIX
binaryfire 10156b9
Add the session garbage collection command
binaryfire 9f8892c
Update the shared Vite toolchain and rebuild frontend assets
binaryfire 35e9c84
Forward after-response dispatch settings through BusFake
binaryfire e604bcd
Complete relationship creation, pivot constraints and pagination totals
binaryfire e53615b
Cover database queue reservation concurrency failures
binaryfire 1fad9b9
Use weak references to validate memoized object identities
binaryfire 6a02d85
Validate associative values against plain anyOf rule lists
binaryfire 1310e8a
Resolve middleware exclusions with parameters and closure aliases
binaryfire 20583bb
Reject foreign PHAR paths while allowing the running archive
binaryfire 2006cb7
Avoid embedding images twice in Markdown notifications
binaryfire 3b0423b
Cover raw, HTML and plain messages on MailFake
binaryfire d2060b8
Cover remember cookies with empty tokens
binaryfire 13acc4b
Validate password confirmation input before checking credentials
binaryfire 05798e3
Validate MCP OAuth advertisements and bound registration and responses
binaryfire 69ab4a9
Show the validated full MCP OAuth redirect URI
binaryfire a5d954f
Prevent framing of MCP authorization and device pages
binaryfire 2acc04e
Preserve batch embedding input order across indexed providers
binaryfire c53d45d
Preserve all Vary values on Inertia and precognitive responses
binaryfire 8469e1d
Invalidate cached Inertia SSR results when the page changes
binaryfire 1d14982
Allow SSR startup without stopping an existing server
binaryfire cacc510
Prevent MCP custom headers from leaking across redirect origins
binaryfire e89b060
Preserve AnyOf field values and reject nested exists candidates
binaryfire e6836a1
Validate and order indexed embedding responses in one shared parser
binaryfire 195277f
Reuse existing pivot links when createOrFirst recovers a model
binaryfire 4b5771f
Retain retry options when object payloads omit commandName
binaryfire 3c49a5c
Clear current route before listeners and direct route dispatch
binaryfire 820c414
Return failure when session garbage collection fails
binaryfire 909f1f5
Clarify shared after-response settings and commit timing
binaryfire 7681730
Preserve numeric AnyOf fields and null wildcard values
binaryfire 64fcd6c
Reject non-stringable array values in exists and in validation
binaryfire 951f902
Reset route state at request dispatch boundaries
binaryfire File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| namespace Hypervel\Ai\Gateway\Concerns; | ||
|
|
||
| use Hypervel\Ai\Exceptions\AiException; | ||
|
|
||
| trait ParsesIndexedEmbeddings | ||
| { | ||
| /** | ||
| * Return embedding values in input order without accepting ambiguous indices. | ||
| * | ||
| * @param array<array-key, mixed> $records | ||
| * @return list<mixed> | ||
| */ | ||
| protected function parseIndexedEmbeddings(array $records, int $expectedCount, string $providerName): array | ||
| { | ||
| if (count($records) !== $expectedCount) { | ||
| throw new AiException("{$providerName} Error: [invalid_response] The response did not contain the expected number of embeddings."); | ||
| } | ||
|
|
||
| $ordered = array_fill(0, $expectedCount, null); | ||
|
|
||
| foreach ($records as $position => $record) { | ||
| // Some compatible servers omit indices; retain their response order. | ||
| $index = is_array($record) ? ($record['index'] ?? $position) : null; | ||
|
|
||
| if (! is_int($index) || $index < 0 || $index >= $expectedCount || $ordered[$index] !== null) { | ||
| throw new AiException("{$providerName} Error: [invalid_response] The response contained invalid embedding indices."); | ||
| } | ||
|
|
||
| $ordered[$index] = $record; | ||
| } | ||
|
|
||
| // Matching counts and unique in-range indices ensure every slot contains a record. | ||
| /** @var list<array<string, mixed>> $ordered */ | ||
| return array_map(static fn (array $record): mixed => $record['embedding'] ?? null, $ordered); | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.