Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions config/boost.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
'composer' => env('BOOST_COMPOSER_EXECUTABLE_PATH'),
'npm' => env('BOOST_NPM_EXECUTABLE_PATH'),
'vendor_bin' => env('BOOST_VENDOR_BIN_EXECUTABLE_PATH'),
'current_directory' => env('BOOST_CURRENT_DIRECTORY_EXECUTABLE_PATH', base_path()),
],

];
2 changes: 1 addition & 1 deletion src/Install/Agents/Codex.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public function mcpServerConfig(string $command, array $args = [], array $env =
return collect([
'command' => $command,
'args' => $args,
'cwd' => base_path(),
'cwd' => config('boost.executable_paths.current_directory', base_path()),
'env' => $env,
])->filter(fn ($value): bool => ! in_array($value, [[], null, ''], true))
->toArray();
Expand Down
2 changes: 1 addition & 1 deletion src/Install/SkillWriter.php
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ protected function directoryContainsBladeFiles(string $path): bool
);

foreach ($files as $file) {
if ($file->isFile() && str_ends_with($file->getFilename(), '.blade.php')) {
if ($file->isFile() && str_ends_with((string) $file->getFilename(), '.blade.php')) {
return true;
}
}
Expand Down
27 changes: 26 additions & 1 deletion tests/Unit/Install/Agents/CodexTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,34 @@

expect($config)->toHaveKey('command', 'php')
->toHaveKey('args', ['artisan', 'boost:mcp'])
->toHaveKey('cwd');
->toHaveKey('cwd', base_path());
});

test('builds MCP server config with config "boost.executable_paths.current_directory" override', function (): void {
config()->set('boost.executable_paths.current_directory', '/Users/developer/projects/app');

$codex = new Codex($this->strategyFactory);

$config = $codex->mcpServerConfig('php', ['artisan', 'boost:mcp']);

expect($config)->toHaveKey('command', 'php')
->toHaveKey('args', ['artisan', 'boost:mcp'])
->toHaveKey('cwd', '/Users/developer/projects/app');
});

test('builds MCP server config with BOOST_CURRENT_DIRECTORY_EXECUTABLE_PATH env override', function (): void {
putenv('BOOST_CURRENT_DIRECTORY_EXECUTABLE_PATH=/Users/developer/projects/app');
config()->set('boost.executable_paths.current_directory', env('BOOST_CURRENT_DIRECTORY_EXECUTABLE_PATH', base_path()));

$codex = new Codex($this->strategyFactory);

$config = $codex->mcpServerConfig('php', ['artisan', 'boost:mcp']);

expect($config)->toHaveKey('command', 'php')
->toHaveKey('args', ['artisan', 'boost:mcp'])
->toHaveKey('cwd', '/Users/developer/projects/app');
})->after(fn () => putenv('BOOST_CURRENT_DIRECTORY_EXECUTABLE_PATH'));

test('builds MCP server config with env when provided', function (): void {
$codex = new Codex($this->strategyFactory);

Expand Down
Loading