Skip to content

Introduce a Runtime abstraction for local development environments #768

@jormeijer

Description

@jormeijer

Laravel Boost has first-class support for one local runtime (Sail) and a side-path for another (WSL), both wired in by type checks and environment sniffing spread across the project. This request proposes extracting a small Runtime abstraction so Boost can treat local-dev environments uniformly, clean up a handful of conditionals, and open the door for community-contributed runtimes.

Right now the codebase is riddled with things like:

  • if ($sail instanceof Sail)
  • isRunningInsideWsl()
  • $this->config->usesSail
  • GuidelineConfig::$usesSail
  • InstallCommand::shouldConfigureSail()

Every new runtime currently costs a copy of all of this. That's both a maintenance tax and a barrier to supporting setups you don't want to own directly.

Proposal
Introduce Laravel\Boost\Install\Runtime\Runtime as a small contract:

interface Runtime
{
    public function name(): string;
    public function displayName(): string;
    public function isInstalled(): bool;
    public function isActive(): bool;
    public function wrap(string $binary, string $command): string;
    public function buildMcpCommand(string $serverName): array;
    public function guidelinePath(): ?string;
}

With a RuntimeRegistry that ships with the existing runtimes as implementations and allows third-party packages to register their own.

Backwards compatibility

  • Keep GuidelineConfig::$usesSail as a computed getter for one release
  • Config sail: true reads as runtime: sail

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions