lx_78654 asked on Discord: "agents能否加一个raycast".
Raycast AI takes models of the user's own as Custom Providers (Raycast
Pro, "Available on: Mac, Windows"), from ~/.config/raycast/ai/
providers.yaml in the user's folder on both systems
(https://manual.raycast.com/ai/custom-providers). Raycast watches the file,
so no restart notice.
What changed:
- internal/agent/raycast.go: a new agent, "raycast". One field, provider:
connecting adds an entry, id magpie, to the providers list: the gateway's
/v1 (OpenAI compatible, no /chat/completions), an api_keys alias holding
magpie-raycast (Raycast's User-Agent isn't known, so its key tells it
apart), and one model per magpie model with name, context and all five
abilities said (Raycast assumes tools and vision off when left out):
tools and system_message on, vision for a model taking images,
temperature off for one that refuses it, reasoning_effort for one with
effort levels. ListsModels: the model is picked in Raycast.
- The list is edited as a yaml node, so the user's other providers, the
top-level tools block (anchors too) and comments stay.
- A key the user adds to magpie's entry or to one of its models
(include_user_email, a description) is kept on a sync; a model gone
from the catalog leaves the list. A sync with nothing to change
doesn't write.
- Disconnect takes the entry out, the list when it was the only one, and
a file left with nothing in it (Raycast's providers.template.yaml is
never touched). A providers key that isn't a list is refused and the
file left as it is.
- Detected by Raycast.app (com.raycast.macos) or the ~/.config/raycast
folder.
- agents.go: registers it.
- icons/raycast.svg: Raycast's mark from Simple Icons (CC0), currentColor.
- docs/reference.md, docs/subsystems/agent-wiring.md, README.md,
README.zh-CN.md: Raycast's row and its place in the agent list.
What was run:
- go test -p 1 -tags nogui ./internal/agent -run '^TestRaycast' in a
sandbox HOME: ok. The fixture is the manual's LM Studio and tools
examples, with comments and an anchor; the result is decoded strictly
(KnownFields) into the manual's schema. Red by hand when I:
- turned off the no-op check ("a sync with nothing to change wrote");
- replaced the merge with magpie's entry alone (the user's
include_user_email and a model's description gone).
- go test -p 1 -tags nogui ./internal/agentenv: ok.
- The whole ./internal/agent package didn't finish here: the first run hit
the 10m default timeout at TestInstalledVersion with the machine at load
~110 (other sessions' suites), the second (-timeout 40m) ran 20 minutes
with no FAIL and then stopped on "no space left on device" when the disk
filled (0 GB free, not this run's files). It needs a run on CI.
- gofmt -l; GOOS={darwin,linux,windows} go vet -tags nogui ./internal/agent: ok.
Not tried with a real Raycast. On Windows it is found by the
~/.config/raycast folder only (its install path isn't verified). WSL isn't
covered.
Full suite: SUITE_LINE