Files
DeepSeek-TUI/web/lib/facts.generated.ts
Hunter Bown 55b53b6c31 feat(providers): Concentrate as a first-class opt-in BYOK Responses gateway (#5725)
* feat(providers): Concentrate as a first-class opt-in BYOK Responses gateway

Adds `concentrate` (aliases `concentrate-ai`, `concentrate_ai`,
`concentrateai`) inside the existing provider authorities — no parallel
secret store, router, or runtime:

- Identity/metadata: `ProviderKind::Concentrate`, hand-written
  `impl Provider` with `WirePolicy::Fixed(WireFormat::Responses)` (the
  gateway documents the Responses API as its production surface),
  default base URL `https://api.concentrate.ai/v1`, default model
  `deepseek-v4-pro`, env `CONCENTRATE_API_KEY` (+ `CONCENTRATE_BASE_URL`,
  `CONCENTRATE_MODEL`), its own secret-store slot, credential help.
- Routing: aggregator-class pass-through. A plain catalog id lets the
  gateway choose the upstream provider, `provider/model` pins one, and
  only the gateway's own `concentrate/` namespace is stripped so
  `concentrate/auto` reaches its `auto` router while Codewhale's bare
  `auto` stays the resolver sentinel (provider default).
- Wire: the Responses body carries only documented fields — `model`,
  `input`, `stream`, `max_output_tokens`, `tools`/`tool_choice`/
  `parallel_tool_calls`, `reasoning.effort` — with the system prompt as a
  leading `system` input item (`instructions`, `store`, `include`, and
  `reasoning.summary` are absent from the gateway's parameter reference).
  Streaming rides the existing typed `response.*` SSE parser and ends on
  `response.completed` without a `[DONE]` sentinel.
- Catalog: the unauthenticated `GET /v1/models` (OpenAI list shape) joins
  the named-gateway live-catalog path; rows stay provider-scoped and
  unclaimed.
- Errors (provider-neutral): a 402 "insufficient credits/funds" body now
  classifies as quota (RateLimit) instead of falling through, and a flat
  `{"error":"<class>","message":"<detail>"}` body surfaces both halves
  in the TUI sanitizer instead of the class alone.
- Registry parity: `ProviderKind::ALL` 42→43, registry 47→48, golden
  route ids + providers-export golden regenerated,
  `scripts/check-provider-registry.py` manual-impl allowlist, web facts
  label maps + `facts.generated.ts` (providers 45→46), docs rows in
  PROVIDERS.md (+ a Concentrate Notes section) and CONFIGURATION.md,
  CHANGELOG.

Commercial boundary, preserved in code and docs: BYOK only. Concentrate's
Terms of Service forbid resale, white-label, and service-bureau use
without written consent and its AUP forbids key sharing, so there is no
Codewhale-owned key, no stored customer key, no default or managed
routing, and no markup; any hosted lane is gated on written consent,
terms, and billing approval (ops evidence
concentrate-gateway-20260829/CHECKLIST.md). A saved or environment
Concentrate key is bound to the official base URL and is never sent to
any other endpoint — a custom endpoint receives a key only when
`base_url` and `api_key` are both written into `[providers.concentrate]`.

Keyless dogfood: `scripts/concentrate-selftest.sh` boots
`scripts/concentrate-stub.py` (the documented contract on loopback:
`/v1/responses/health`, unauthenticated `/v1/models`, typed-SSE
`/v1/responses`, documented error bodies) and drives the real
`codewhale exec --auto --output-format stream-json` path through it,
asserting the URL, bearer header, verbatim model, only-documented fields,
system item first, the completed-turn receipt, and the wrong-key 401.
No network call leaves the machine; no account exists in the loop.

Contract sources (fetched 2026-08-29):
https://concentrate.ai/docs/api-reference/introduction
https://concentrate.ai/docs/api-reference/endpoint/request-parameters
https://concentrate.ai/docs/api-reference/endpoint/streaming
https://concentrate.ai/docs/api-reference/endpoint/errors
https://concentrate.ai/docs/api-reference/endpoint/list-models
https://concentrate.ai/docs/legal/terms-of-service

Verification: local, this host, CI flags (RUSTFLAGS=-Dwarnings, RUST_MIN_STACK=16MiB,
nextest --profile ci, --all-features, --locked): fmt clean; codewhale-config
624 run / 624 passed / 1 skipped (incl. new concentrate_resolves_… and
concentrate_passes_ids_through_and_strips_only_its_own_namespace, regenerated
goldens); codewhale-secrets 62/62; codewhale-tui focused (concentrate +
error_taxonomy + client::responses + llm_client + provider config + catalog
filters) 440 run / 440 passed; debug CLI built; scripts/concentrate-selftest.sh
PASS ×3 (concentrate/auto → wire `auto`, openai/gpt-5.6-sol, deepseek-v4-pro);
scripts/check-provider-registry.py PASS; clippy config+secrets and tui
(--all-targets --all-features, CI allow list) clean; web facts regenerated
(providers 46) + check-facts OK; dead-code budget PASS; git diff --check
clean.

Not done: no live Concentrate canary (needs a key and founder-gated spend);
Windows-target compile is hosted-CI-only on this host.

No-Issue: provider addition requested by the founder; no tracking issue exists.

Signed-off-by: CodeWhale Bot <bot@codewhale.net>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* test(cli): bump the provider registry counts for Concentrate (48 / 43)

Hosted `Test (ubuntu-latest)` on #5725 failed exactly one test out of
13,958: `cli_provider_helpers_follow_config_metadata` still asserted the
pre-Concentrate registry sizes (47 full / 42 catalog). The config crate's
twin assertion was updated in the parent commit; this mirrors it. The rest
of the test (env vars and secret-store slot per registry kind) already held
for `concentrate`. Local: codewhale-cli 276 run / 276 passed.

Signed-off-by: CodeWhale Bot <bot@codewhale.net>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(providers): Concentrate review leftovers — alias, unauth 2xx, selftest

[providers.concentrateai] was silently ignored on both config tables.
GET /v1/models is unauthenticated, so a 2xx must not count as key proof —
the probe is unobserved and health_check issues no request. Missing stub
reply text now fails the selftest instead of exiting 0. Duplicate
CONCENTRATE_BASE_URL assignment removed; retired launch_screen row dropped
after the main merge.

Proven: concentrate_resolves_named_responses_gateway_and_environment_overrides
1 passed; concentrate_health_check_does_not_treat_unauthenticated_models_as_key_proof
plus two sibling Concentrate tests 3 passed; 0 failed.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Signed-off-by: CodeWhale Bot <bot@codewhale.net>
Co-authored-by: CodeWhale Bot <bot@codewhale.net>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-01 11:34:24 -07:00

304 lines
6.8 KiB
TypeScript

// AUTO-GENERATED by web/scripts/derive-facts.mjs at prebuild.
// DO NOT EDIT — re-run `npm run prebuild` (or just `npm run build`) after changing the parent repo.
// Runtime KV snapshots must use this shape and include exact source provenance.
export interface ProviderFact { id: string; label: string; env: string }
export interface PublishedReleaseFact {
tag: string;
version: string;
publishedAt: string;
url: string;
}
export interface RepoFacts {
generatedAt: string;
sourceRevision: string | null;
sourceCommittedAt: string | null;
version: string | null;
crates: string[];
sandboxBackends: string[];
providers: ProviderFact[];
defaultModel: string | null;
nodeEngines: string | null;
toolCount: number | null;
license: string | null;
latestPublishedRelease: PublishedReleaseFact | null;
}
export const FACTS: RepoFacts = {
"generatedAt": "2026-08-29T23:20:31.411Z",
"sourceRevision": null,
"sourceCommittedAt": null,
"version": "0.9.11",
"crates": [
"agent",
"app-server",
"build-support",
"cli",
"command-contract",
"config",
"core",
"execpolicy",
"hooks",
"lane",
"mcp",
"paths",
"protocol",
"release",
"secrets",
"state",
"telemetry",
"tools",
"tui",
"workflow",
"workflow-js"
],
"sandboxBackends": [
"seatbelt (macOS, when available)",
"bubblewrap (Linux, opt-in when installed)"
],
"providers": [
{
"id": "deepseek",
"label": "DeepSeek",
"env": "DEEPSEEK_API_KEY"
},
{
"id": "deepseek-anthropic",
"label": "DeepSeek Anthropic",
"env": "DEEPSEEK_API_KEY / ANTHROPIC_API_KEY"
},
{
"id": "nvidia-nim",
"label": "NVIDIA NIM",
"env": "NVIDIA_API_KEY / NVIDIA_NIM_API_KEY"
},
{
"id": "openai",
"label": "OpenAI-compatible",
"env": "OPENAI_API_KEY"
},
{
"id": "atlascloud",
"label": "AtlasCloud",
"env": "ATLASCLOUD_API_KEY"
},
{
"id": "wanjie-ark",
"label": "Wanjie Ark",
"env": "WANJIE_ARK_API_KEY / WANJIE_API_KEY / WANJIE_MAAS_API_KEY"
},
{
"id": "volcengine",
"label": "Volcengine Ark",
"env": "VOLCENGINE_API_KEY / VOLCENGINE_ARK_API_KEY / ARK_API_KEY"
},
{
"id": "openrouter",
"label": "OpenRouter",
"env": "OPENROUTER_API_KEY"
},
{
"id": "orcarouter",
"label": "OrcaRouter",
"env": "ORCAROUTER_API_KEY"
},
{
"id": "xiaomi-mimo",
"label": "Xiaomi MiMo",
"env": "XIAOMI_MIMO_TOKEN_PLAN_API_KEY / MIMO_TOKEN_PLAN_API_KEY / XIAOMI_MIMO_API_KEY / XIAOMI_API_KEY / MIMO_API_KEY"
},
{
"id": "novita",
"label": "Novita AI",
"env": "NOVITA_API_KEY"
},
{
"id": "fireworks",
"label": "Fireworks AI",
"env": "FIREWORKS_API_KEY"
},
{
"id": "siliconflow",
"label": "SiliconFlow",
"env": "SILICONFLOW_API_KEY"
},
{
"id": "siliconflow-CN",
"label": "SiliconFlow CN",
"env": "SILICONFLOW_API_KEY"
},
{
"id": "arcee",
"label": "Arcee AI",
"env": "ARCEE_API_KEY"
},
{
"id": "moonshot",
"label": "Moonshot/Kimi",
"env": "MOONSHOT_API_KEY / KIMI_API_KEY"
},
{
"id": "sglang",
"label": "SGLang",
"env": "SGLANG_API_KEY"
},
{
"id": "vllm",
"label": "vLLM",
"env": "VLLM_API_KEY"
},
{
"id": "ollama",
"label": "Ollama",
"env": "OLLAMA_API_KEY"
},
{
"id": "ollama-cloud",
"label": "Ollama Cloud",
"env": "OLLAMA_CLOUD_API_KEY / OLLAMA_API_KEY"
},
{
"id": "huggingface",
"label": "Hugging Face",
"env": "HUGGINGFACE_API_KEY / HF_TOKEN"
},
{
"id": "together",
"label": "Together AI",
"env": "TOGETHER_API_KEY"
},
{
"id": "qianfan",
"label": "Baidu Qianfan",
"env": "QIANFAN_API_KEY / BAIDU_QIANFAN_API_KEY"
},
{
"id": "openai-codex",
"label": "OpenAI Codex",
"env": "ChatGPT/Codex OAuth via `codex login` (OPENAI_CODEX_ACCESS_TOKEN / CODEX_ACCESS_TOKEN override)"
},
{
"id": "anthropic",
"label": "Anthropic",
"env": "ANTHROPIC_API_KEY"
},
{
"id": "openmodel",
"label": "OpenModel",
"env": "OPENMODEL_API_KEY"
},
{
"id": "zai",
"label": "Z.ai",
"env": "ZAI_API_KEY / Z_AI_API_KEY"
},
{
"id": "stepfun",
"label": "StepFun",
"env": "STEPFUN_API_KEY / STEP_API_KEY"
},
{
"id": "minimax",
"label": "MiniMax",
"env": "MINIMAX_API_KEY"
},
{
"id": "minimax-anthropic",
"label": "MiniMax (Anthropic-compatible)",
"env": "MINIMAX_API_KEY"
},
{
"id": "deepinfra",
"label": "DeepInfra",
"env": "DEEPINFRA_API_KEY / DEEPINFRA_TOKEN"
},
{
"id": "sakana",
"label": "Sakana AI",
"env": "FUGU_API_KEY / SAKANA_API_KEY"
},
{
"id": "longcat",
"label": "Meituan LongCat",
"env": "LONGCAT_API_KEY"
},
{
"id": "opencode-go",
"label": "OpenCode Go",
"env": "OPENCODE_GO_API_KEY"
},
{
"id": "opencode-zen",
"label": "OpenCode Zen",
"env": "OPENCODE_ZEN_API_KEY / OPENCODE_API_KEY"
},
{
"id": "meta",
"label": "Meta Model API",
"env": "META_MODEL_API_KEY / MODEL_API_KEY"
},
{
"id": "xai",
"label": "xAI",
"env": "XAI_API_KEY"
},
{
"id": "mistral",
"label": "Mistral AI",
"env": "MISTRAL_API_KEY"
},
{
"id": "google",
"label": "Google Gemini",
"env": "GOOGLE_API_KEY / GEMINI_API_KEY"
},
{
"id": "telecomjs",
"label": "TelecomJS TokenHub",
"env": "TELECOMJS_API_KEY"
},
{
"id": "edenai",
"label": "Eden AI",
"env": "EDENAI_API_KEY"
},
{
"id": "concentrate",
"label": "Concentrate",
"env": "CONCENTRATE_API_KEY"
},
{
"id": "modelstudio-token-plan",
"label": "Model Studio Token Plan",
"env": "MODELSTUDIO_API_KEY"
},
{
"id": "modelstudio-token-plan-anthropic",
"label": "Model Studio Token Plan (Anthropic-compatible)",
"env": "MODELSTUDIO_API_KEY"
},
{
"id": "modelstudio-coding-plan",
"label": "Model Studio Coding Plan",
"env": "MODELSTUDIO_API_KEY"
},
{
"id": "modelstudio-coding-plan-anthropic",
"label": "Model Studio Coding Plan (Anthropic-compatible)",
"env": "MODELSTUDIO_API_KEY"
}
],
"defaultModel": "deepseek-v4-pro",
"nodeEngines": ">=18",
"toolCount": 75,
"license": "MIT",
"latestPublishedRelease": {
"tag": "v0.9.11",
"version": "0.9.11",
"publishedAt": "2026-08-23T17:39:46Z",
"url": "https://github.com/Hmbown/CodeWhale/releases/tag/v0.9.11"
}
};