1- # AGENTS.md — Eyrie
1+ # AGENTS.md — Flux
22
33Universal LLM provider runtime. One interface for every model. Authentication, routing, streaming, retries, caching — handled.
44
@@ -9,7 +9,7 @@ When starting any new work (feature, fix, refactor, chore), always create a feat
99## Design Principles
1010
1111- ** Model-agnostic** — single interface for 75+ LLM providers
12- - ** Host-neutral engine** — Eyrie owns provider routing, transport, caching,
12+ - ** Host-neutral engine** — Flux owns provider routing, transport, caching,
1313 retry/fallback, and normalized telemetry; hosts own product UX and semantics
1414- ** Streaming-first** — all responses are streamed; blocking is opt-in
1515
@@ -59,34 +59,34 @@ make ci # Full CI suite
5959 consumers; preserve its method set and the facade's type identity
6060- Streaming tests need careful goroutine management
6161- ` go.work ` here should stay minimal; the parent ` graycode-eco/go.work `
62- connects this independent ` eyrie ` checkout beside Hawk for local development.
62+ connects this independent ` flux ` checkout beside Hawk for local development.
6363 Do not add extra local ` replace ` directives here without coordinating with
6464 the parent workspace.
6565
6666## Naming Conventions
6767
6868- ** Provider interface** : ` client.Provider ` with ` Chat() ` , ` StreamChat() ` , ` Ping() ` , ` Name() ` — implemented per LLM vendor
69- - ** Client types** : ` EyrieClient ` , ` EyrieMessage ` , ` EyrieResponse ` , ` EyrieTool ` , ` EyrieUsage ` — ` Eyrie ` prefix for public types
70- - ** Config struct** : ` EyrieConfig ` with ` Provider ` , ` APIKey ` , ` BaseURL ` , ` Model ` , ` MaxRetries ` fields
69+ - ** Client types** : ` FluxClient ` , ` FluxMessage ` , ` FluxResponse ` , ` FluxTool ` , ` FluxUsage ` — ` Flux ` prefix for public types
70+ - ** Config struct** : ` FluxConfig ` with ` Provider ` , ` APIKey ` , ` BaseURL ` , ` Model ` , ` MaxRetries ` fields
7171- ** Provider implementations** : ` AnthropicClient ` , ` OpenAIClient ` , ` GeminiClient ` , ` BedrockClient ` , etc. — in ` client/ ` package
7272- ** Compatibility configs** : ` OpenAICompat ` , ` GrokCompat ` , ` OpenRouterCompat ` — ` Compat ` suffix for provider quirks
73- - ** Error type** : ` EyrieError ` with ` Provider ` , ` Op ` , ` StatusCode ` , ` RequestID ` , ` Message ` , ` Err ` fields
73+ - ** Error type** : ` FluxError ` with ` Provider ` , ` Op ` , ` StatusCode ` , ` RequestID ` , ` Message ` , ` Err ` fields
7474- ** Stream types** : ` StreamResult ` , ` SSEEvent ` , ` StreamEvent ` — streaming is SSE-based
7575- ** Retry config** : ` RetryConfig ` embeds ` types.RetryConfig ` + adds ` RetryOn []int ` for HTTP status codes
7676- ** Version wiring** : ` client.Version ` set via ` SetVersion() ` from root package — avoids circular import
7777
7878## API Patterns
7979
8080- ** Provider auto-detection** : ` DetectProvider() ` checks env vars in priority order (ANTHROPIC_API_KEY, OPENAI_API_KEY, etc.)
81- - ** Client creation** : ` client.NewEyrieClient(&EyrieConfig {...}) ` or ` client.Client(&EyrieConfig {...}) ` — both work
82- - ** Chat method** : ` c.Chat(ctx, messages, opts) ` — non-streaming, returns ` *EyrieResponse `
81+ - ** Client creation** : ` client.NewFluxClient(&FluxConfig {...}) ` or ` client.Client(&FluxConfig {...}) ` — both work
82+ - ** Chat method** : ` c.Chat(ctx, messages, opts) ` — non-streaming, returns ` *FluxResponse `
8383- ** Stream method** : ` c.StreamChat(ctx, messages, opts) ` — returns ` *StreamResult ` , caller must ` defer sr.Close() `
8484- ** Auto-continuation** : ` StreamChatContinue() ` transparently retries when ` stop_reason == max_tokens `
8585- ** Provider fallback** : ` fallback.go ` implements fallback chains across providers
8686- ** Rate limiting** : ` ratelimit.go ` implements token bucket per provider — prevents hitting API limits
8787- ** Semantic caching** : ` semantic_cache.go ` caches similar prompts — optional, configurable TTL
8888- ** Retry with backoff** : ` retry.go ` — exponential backoff + jitter, respects ` Retry-After ` header, retries on 429/500/502/503/529
89- - ** Error hierarchy** : ` EyrieError ` has ` IsRetriable() ` , ` IsAuthError() ` , ` IsRateLimited() ` methods for programmatic handling
89+ - ** Error hierarchy** : ` FluxError ` has ` IsRetriable() ` , ` IsAuthError() ` , ` IsRateLimited() ` methods for programmatic handling
9090- ** SSE parsing** : ` parseSSEStream() ` reads ` bufio.Scanner ` with 2MB buffer, emits ` SSEEvent ` to channel
9191
9292## Testing Patterns
@@ -109,17 +109,17 @@ make ci # Full CI suite
109109- ** Safe to refactor** : ` fallback.go ` , ` weighted.go ` — routing strategies, extend with new strategies
110110- ** Safe to refactor** : ` cost_estimator.go ` , ` cache_analytics.go ` — metrics and tracking
111111- ** Do not touch** : ` Provider ` interface (` Chat ` , ` StreamChat ` , ` Ping ` , ` Name ` ) — breaking change for all implementations
112- - ** Do not touch** : ` EyrieMessage ` , ` EyrieResponse ` , ` ChatOptions ` struct field names — serialization contract
113- - ** Do not touch** : ` EyrieError ` struct — used by consumers for error type assertions
114- - ** Do not touch** : ` client.EyrieConfig ` — constructor contract for all consumers
112+ - ** Do not touch** : ` FluxMessage ` , ` FluxResponse ` , ` ChatOptions ` struct field names — serialization contract
113+ - ** Do not touch** : ` FluxError ` struct — used by consumers for error type assertions
114+ - ** Do not touch** : ` client.FluxConfig ` — constructor contract for all consumers
115115- ** Safe to extend** : add new provider implementations, new SSE event types, new cache strategies
116116- ** When adding a provider** : create ` client/<provider>.go ` , implement ` Provider ` interface, register in ` provider_registry.go `
117117
118118## Key File Locations
119119
120120| What | Where |
121121| ---| ---|
122- | Provider interface | ` client/client.go ` (` Provider ` , ` EyrieConfig ` , ` EyrieMessage ` , ` ContentPart ` ) |
122+ | Provider interface | ` client/client.go ` (` Provider ` , ` FluxConfig ` , ` FluxMessage ` , ` ContentPart ` ) |
123123| Chat implementation | ` client/chat.go ` (` Chat() ` , ` StreamChat() ` , ` StreamChatContinue() ` ) |
124124| Host-facing engine facade | ` engine/ ` |
125125| Provider-neutral core | ` client/core/ ` |
@@ -137,7 +137,7 @@ make ci # Full CI suite
137137| Caching | ` client/cache.go ` , ` client/semantic_cache.go ` , ` client/cache_analytics.go ` |
138138| Fallback chains | ` client/fallback.go ` |
139139| Auto-continuation | ` client/continuation.go ` |
140- | Error types | ` client/errors.go ` (` EyrieError ` , ` IsRetriable() ` , ` IsAuthError() ` ) |
140+ | Error types | ` client/errors.go ` (` FluxError ` , ` IsRetriable() ` , ` IsAuthError() ` ) |
141141| Error constants | ` errors/errors.go ` (API error messages, prompt-too-long parsing) |
142142| Model catalog | ` catalog/ ` (pricing, context windows, capabilities per provider) |
143143| Credentials | ` credentials/ ` (key storage, env detection, scrubbing) — ` HasSecret ` is silent on miss (boolean predicate); ` LookupSecret ` logs ` Debug ` on ` ErrNotFound ` and ` Warn ` on real backend errors |
@@ -146,6 +146,6 @@ make ci # Full CI suite
146146| Linter config | ` .golangci.yml ` (govet, ineffassign, misspell — minimal) |
147147
148148This is an independent repository consumed by Hawk. In the local
149- ` graycode-eco ` parent workspace it is checked out beside ` hawk ` as ` ../eyrie `
149+ ` graycode-eco ` parent workspace it is checked out beside ` hawk ` as ` ../flux `
150150and connected through the parent ` go.work ` ; publish changes here, then update
151151Hawk's module pin through a separate PR.
0 commit comments