Skip to content

feat: provider detection — ProviderSet.detect() probes environment #264

@justrach

Description

@justrach

Parent: #257 — Layer 0 (Plumbing)

What

ProviderSet.detect(alloc) probes the environment and reports what's available. Detection only — no preferences, no routing decisions.

Probes:

  • PATH for claude, codex binaries
  • PATH for zig* tools (zigrep, zigread, zigpatch, etc.)
  • PATH for fallback tools (rg, fd, git, sed)
  • Loads config from .codedb/config.toml (repo) > ~/.config/devswarm/config.toml (global) > defaults

Returns:

const ProviderSet = struct {
    has_claude: bool,
    has_codex: bool,
    has_local: bool,          // future: ollama etc.
    config: ProviderConfig,   // parsed from config.toml
    tools: ToolAvailability,  // which file I/O tools are available
};

const ToolAvailability = struct {
    search: enum { zigrep, rg, grep },
    read: enum { zigread, cat },
    edit: enum { zigpatch, sed },
    diff: enum { zigdiff, git_diff, diff },
    find: enum { zigrep_f, fd, find },
    batch: enum { zigpar, sequential },
};

No preferredBackend() — that decision belongs to resolve().

Depends on

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions