Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c56660fe07 | ||
|
|
3bde7fe851 | ||
|
|
793b93b74d | ||
|
|
c9855c4bb6 | ||
|
|
c4ef8a3779 |
No files matched your search
@@ -415,15 +415,17 @@ client-side, no backend surface.
|
||||
carries the thinking level. NO websocket, NO base_instructions.
|
||||
CATALOG is HARDCODED (`PlatformId::hardcoded_catalog` →
|
||||
`openai_codex_wire_models`, mapped through the SAME
|
||||
`platform_wire_model_to_entry` output): the 7 `visibility=list` &&
|
||||
`supported_in_api=true` models the backend served on 2026-09-22
|
||||
(`gpt-6-astra/sol/luna`, `gpt-5.6-sol/terra/luna`, `gpt-5.5`, ctx 272000,
|
||||
per-model efforts) — NO live `/models` fetch, NO codex-CLI / `~/.codex`
|
||||
`platform_wire_model_to_entry` output): the 8 `visibility=list` &&
|
||||
`supported_in_api=true` models the backend served on 2026-09-29
|
||||
(`gpt-6.1-sol`, `gpt-6-astra/sol/luna`, `gpt-5.6-sol/terra/luna`,
|
||||
`gpt-5.5`, ctx 272000, per-model efforts) — NO live `/models` fetch, NO codex-CLI / `~/.codex`
|
||||
dependency; the hidden `gpt-reserve` and `codex-auto-review` are
|
||||
EXCLUDED. Refresh the table by reading
|
||||
`GET {base}/models?client_version=<a current codex release>` with a
|
||||
ChatGPT bearer: an old `client_version` is answered with a truncated
|
||||
list, so a stale version reads as "the model does not exist".
|
||||
`CODEX_USER_AGENT` (`codex_cli_rs/0.159.0`) moves with the release used
|
||||
for that read.
|
||||
- `OAuthFlow::GithubDeviceCopilot` → `auth::github_copilot` (TWO-STAGE).
|
||||
Provider: `github-copilot` (`scope_key oauth/github-copilot`, base
|
||||
`api.individual.githubcopilot.com`, ChatCompletions wire). Stage 1 is an
|
||||
@@ -457,6 +459,39 @@ client-side, no backend surface.
|
||||
token (`resolve_generic_oauth_tokens`, refreshed on expiry) and routes
|
||||
`platform.oauth().is_some()` → `platform.base_url()` (kimi-code alone →
|
||||
`proxy_url()`). Tokens/codes/verifiers are NEVER logged.
|
||||
- CUSTOM PROVIDERS (0.1.19): `[platforms.<name>]` with `base_url` and `api =
|
||||
"openai" | "anthropic"` declares a provider outside the closed registry.
|
||||
`kigi-models/src/custom.rs` owns the validated type (name `[a-z0-9][a-z0-9_-]{0,31}`,
|
||||
never a registry id; base URL `http(s)://host[/path]`, no userinfo, query or
|
||||
fragment); `kigi-shell/src/agent/custom_providers/` owns the rest. Key order:
|
||||
auth.json scope `<name>`, then the table's `api_key`; a key is REQUIRED (a
|
||||
keyless declaration is inert). Wires: openai = `/chat/completions`, Bearer,
|
||||
`GET {base}/models`; anthropic = `/messages`, `x-api-key`,
|
||||
`GET {base}/models?limit=1000`. Catalog keys are `<name>/<model>`; the entry's
|
||||
`description` carries the provider name for the picker. Entries reach the disk
|
||||
cache without a key; `stamp_credentials` stamps `api_key` in memory, only onto
|
||||
entries still on the provider's own host, and `drop_orphans` removes fetched
|
||||
entries of a provider that is gone or keyless BEFORE the prefetched map replaces
|
||||
the catalog (a stale unkeyed entry would fall through to the house key).
|
||||
CREDENTIAL RULE: `EndpointsConfig.custom_provider_bases` (derived from
|
||||
`[platforms.*]` in `Config::new_from_toml_cfg` and `from_config_value`, never
|
||||
serialized) makes `CredentialAuthority::is_session_coding_endpoint` false for a
|
||||
declared base, loopback included — without it an Ollama-style provider on
|
||||
localhost classifies `Primary` and the Kimi bearer replaces its key. Every
|
||||
authority is built from the models manager's config, so the field reaches all of
|
||||
them. Turns and subagents read `auth_scheme` and BYOK status from the LIVE
|
||||
catalog entry (`auth_facts_of`), not from a disk reload: fetched entries never
|
||||
live on disk, and the reload sent fetched Messages models out with `Bearer`
|
||||
instead of `x-api-key` (this also repaired `anthropic` and `minimax`).
|
||||
Login: picker rows `custom-openai` / `custom-anthropic` are not loginable
|
||||
(`AuthMethodKind::Unknown`); the TUI asks base URL, name (default from the
|
||||
host), key, then `save_custom_provider` writes config.toml (through
|
||||
`config_write_dest`) and auth.json, and `authenticate("custom:<name>")`
|
||||
validates `GET {base}/models` (401/403 = rejected key, other non-2xx and network
|
||||
errors surface). Limits: context window 256K unless the listing serves
|
||||
`context_length` (Anthropic: `max_input_tokens`); no models.dev enrichment; a
|
||||
failed key check leaves the saved definition (login again with the same name to
|
||||
overwrite); no delete UI, edit config.toml and auth.json.
|
||||
- A stored subscription-OAuth session IS a catalog fetch source. Every
|
||||
fetch-PLAN decision that cannot afford real token resolution — the startup
|
||||
prefetch arming gate, `on_auth_changed`'s wipe guard
|
||||
|
||||
Generated
+62
-62
@@ -5442,7 +5442,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kigi-acp-lib"
|
||||
version = "0.1.18"
|
||||
version = "0.1.19"
|
||||
dependencies = [
|
||||
"agent-client-protocol",
|
||||
"async-trait",
|
||||
@@ -5456,7 +5456,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kigi-agent"
|
||||
version = "0.1.18"
|
||||
version = "0.1.19"
|
||||
dependencies = [
|
||||
"chrono",
|
||||
"dirs 6.0.0",
|
||||
@@ -5486,7 +5486,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kigi-agent-lifecycle"
|
||||
version = "0.1.18"
|
||||
version = "0.1.19"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"tokio",
|
||||
@@ -5495,7 +5495,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kigi-auth"
|
||||
version = "0.1.18"
|
||||
version = "0.1.19"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"http 1.4.2",
|
||||
@@ -5508,7 +5508,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kigi-bin"
|
||||
version = "0.1.18"
|
||||
version = "0.1.19"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"clap",
|
||||
@@ -5543,7 +5543,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kigi-chat-state"
|
||||
version = "0.1.18"
|
||||
version = "0.1.19"
|
||||
dependencies = [
|
||||
"indexmap",
|
||||
"kigi-compaction",
|
||||
@@ -5560,7 +5560,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kigi-codebase-graph"
|
||||
version = "0.1.18"
|
||||
version = "0.1.19"
|
||||
dependencies = [
|
||||
"ahash",
|
||||
"clap",
|
||||
@@ -5596,7 +5596,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kigi-compaction"
|
||||
version = "0.1.18"
|
||||
version = "0.1.19"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"async-trait",
|
||||
@@ -5609,7 +5609,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kigi-config"
|
||||
version = "0.1.18"
|
||||
version = "0.1.19"
|
||||
dependencies = [
|
||||
"base64",
|
||||
"blake3",
|
||||
@@ -5632,7 +5632,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kigi-config-types"
|
||||
version = "0.1.18"
|
||||
version = "0.1.19"
|
||||
dependencies = [
|
||||
"agent-client-protocol",
|
||||
"indexmap",
|
||||
@@ -5646,7 +5646,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kigi-crash-handler"
|
||||
version = "0.1.18"
|
||||
version = "0.1.19"
|
||||
dependencies = [
|
||||
"backtrace",
|
||||
"libc",
|
||||
@@ -5657,7 +5657,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kigi-env"
|
||||
version = "0.1.18"
|
||||
version = "0.1.19"
|
||||
dependencies = [
|
||||
"tracing",
|
||||
"url",
|
||||
@@ -5665,7 +5665,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kigi-fast-worktree"
|
||||
version = "0.1.18"
|
||||
version = "0.1.19"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"bytes",
|
||||
@@ -5697,7 +5697,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kigi-file-utils"
|
||||
version = "0.1.18"
|
||||
version = "0.1.19"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"aws-config",
|
||||
@@ -5721,7 +5721,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kigi-fsnotify"
|
||||
version = "0.1.18"
|
||||
version = "0.1.19"
|
||||
dependencies = [
|
||||
"criterion",
|
||||
"dunce",
|
||||
@@ -5742,7 +5742,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kigi-gix-status"
|
||||
version = "0.1.18"
|
||||
version = "0.1.19"
|
||||
dependencies = [
|
||||
"gix",
|
||||
"kigi-test-utils",
|
||||
@@ -5752,7 +5752,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kigi-hooks"
|
||||
version = "0.1.18"
|
||||
version = "0.1.19"
|
||||
dependencies = [
|
||||
"fastrand",
|
||||
"kigi-config",
|
||||
@@ -5771,7 +5771,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kigi-hooks-plugins-types"
|
||||
version = "0.1.18"
|
||||
version = "0.1.19"
|
||||
dependencies = [
|
||||
"serde",
|
||||
"serde_json",
|
||||
@@ -5779,7 +5779,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kigi-http"
|
||||
version = "0.1.18"
|
||||
version = "0.1.19"
|
||||
dependencies = [
|
||||
"kigi-auth",
|
||||
"kigi-log",
|
||||
@@ -5794,7 +5794,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kigi-hunk-tracker"
|
||||
version = "0.1.18"
|
||||
version = "0.1.19"
|
||||
dependencies = [
|
||||
"chrono",
|
||||
"dunce",
|
||||
@@ -5815,14 +5815,14 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kigi-interjection-core"
|
||||
version = "0.1.18"
|
||||
version = "0.1.19"
|
||||
dependencies = [
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "kigi-log"
|
||||
version = "0.1.18"
|
||||
version = "0.1.19"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"chrono",
|
||||
@@ -5840,7 +5840,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kigi-markdown"
|
||||
version = "0.1.18"
|
||||
version = "0.1.19"
|
||||
dependencies = [
|
||||
"anstyle",
|
||||
"anstyle-lossy",
|
||||
@@ -5864,14 +5864,14 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kigi-markdown-core"
|
||||
version = "0.1.18"
|
||||
version = "0.1.19"
|
||||
dependencies = [
|
||||
"pulldown-cmark",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "kigi-mcp"
|
||||
version = "0.1.18"
|
||||
version = "0.1.19"
|
||||
dependencies = [
|
||||
"agent-client-protocol",
|
||||
"async-trait",
|
||||
@@ -5908,7 +5908,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kigi-memory"
|
||||
version = "0.1.18"
|
||||
version = "0.1.19"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"arc-swap",
|
||||
@@ -5942,7 +5942,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kigi-mermaid"
|
||||
version = "0.1.18"
|
||||
version = "0.1.19"
|
||||
dependencies = [
|
||||
"fontdb",
|
||||
"image",
|
||||
@@ -5960,7 +5960,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kigi-models"
|
||||
version = "0.1.18"
|
||||
version = "0.1.19"
|
||||
dependencies = [
|
||||
"kigi-env",
|
||||
"serde",
|
||||
@@ -5970,7 +5970,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kigi-pager-minimal"
|
||||
version = "0.1.18"
|
||||
version = "0.1.19"
|
||||
dependencies = [
|
||||
"chrono",
|
||||
"crossterm",
|
||||
@@ -5987,7 +5987,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kigi-pager-pty-harness"
|
||||
version = "0.1.18"
|
||||
version = "0.1.19"
|
||||
dependencies = [
|
||||
"alacritty_terminal",
|
||||
"anyhow",
|
||||
@@ -6012,7 +6012,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kigi-pager-render"
|
||||
version = "0.1.18"
|
||||
version = "0.1.19"
|
||||
dependencies = [
|
||||
"agent-client-protocol",
|
||||
"anstyle",
|
||||
@@ -6064,7 +6064,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kigi-paths"
|
||||
version = "0.1.18"
|
||||
version = "0.1.19"
|
||||
dependencies = [
|
||||
"camino",
|
||||
"serde",
|
||||
@@ -6074,7 +6074,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kigi-prompt-queue"
|
||||
version = "0.1.18"
|
||||
version = "0.1.19"
|
||||
dependencies = [
|
||||
"serde",
|
||||
"serde_json",
|
||||
@@ -6082,7 +6082,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kigi-proto-build"
|
||||
version = "0.1.18"
|
||||
version = "0.1.19"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"pbjson-build",
|
||||
@@ -6093,7 +6093,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kigi-ratatui-inline"
|
||||
version = "0.1.18"
|
||||
version = "0.1.19"
|
||||
dependencies = [
|
||||
"ansi-width",
|
||||
"anstyle-parse 0.2.7",
|
||||
@@ -6110,7 +6110,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kigi-ratatui-textarea"
|
||||
version = "0.1.18"
|
||||
version = "0.1.19"
|
||||
dependencies = [
|
||||
"arboard",
|
||||
"chrono",
|
||||
@@ -6131,7 +6131,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kigi-sampler"
|
||||
version = "0.1.18"
|
||||
version = "0.1.19"
|
||||
dependencies = [
|
||||
"async-openai",
|
||||
"async-stream",
|
||||
@@ -6155,7 +6155,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kigi-sampling-types"
|
||||
version = "0.1.18"
|
||||
version = "0.1.19"
|
||||
dependencies = [
|
||||
"assert_matches",
|
||||
"async-openai",
|
||||
@@ -6172,7 +6172,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kigi-sandbox"
|
||||
version = "0.1.18"
|
||||
version = "0.1.19"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"chrono",
|
||||
@@ -6194,7 +6194,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kigi-secrets"
|
||||
version = "0.1.18"
|
||||
version = "0.1.19"
|
||||
dependencies = [
|
||||
"regex",
|
||||
"serde_json",
|
||||
@@ -6232,7 +6232,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kigi-shell"
|
||||
version = "0.1.18"
|
||||
version = "0.1.19"
|
||||
dependencies = [
|
||||
"agent-client-protocol",
|
||||
"anyhow",
|
||||
@@ -6370,7 +6370,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kigi-shell-base"
|
||||
version = "0.1.18"
|
||||
version = "0.1.19"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"chrono",
|
||||
@@ -6395,7 +6395,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kigi-sqlite-journal"
|
||||
version = "0.1.18"
|
||||
version = "0.1.19"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"rusqlite",
|
||||
@@ -6406,7 +6406,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kigi-subagent-resolution"
|
||||
version = "0.1.18"
|
||||
version = "0.1.19"
|
||||
dependencies = [
|
||||
"kigi-sampling-types",
|
||||
"kigi-tool-types",
|
||||
@@ -6421,7 +6421,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kigi-system-power"
|
||||
version = "0.1.18"
|
||||
version = "0.1.19"
|
||||
dependencies = [
|
||||
"windows-sys 0.59.0",
|
||||
"zbus",
|
||||
@@ -6429,7 +6429,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kigi-test-support"
|
||||
version = "0.1.18"
|
||||
version = "0.1.19"
|
||||
dependencies = [
|
||||
"agent-client-protocol",
|
||||
"anyhow",
|
||||
@@ -6451,7 +6451,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kigi-test-utils"
|
||||
version = "0.1.18"
|
||||
version = "0.1.19"
|
||||
dependencies = [
|
||||
"runfiles",
|
||||
"tracing",
|
||||
@@ -6460,11 +6460,11 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kigi-token-estimation"
|
||||
version = "0.1.18"
|
||||
version = "0.1.19"
|
||||
|
||||
[[package]]
|
||||
name = "kigi-tool-protocol"
|
||||
version = "0.1.18"
|
||||
version = "0.1.19"
|
||||
dependencies = [
|
||||
"kigi-tool-types",
|
||||
"serde",
|
||||
@@ -6475,7 +6475,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kigi-tool-runtime"
|
||||
version = "0.1.18"
|
||||
version = "0.1.19"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"async-trait",
|
||||
@@ -6493,7 +6493,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kigi-tool-types"
|
||||
version = "0.1.18"
|
||||
version = "0.1.19"
|
||||
dependencies = [
|
||||
"minijinja",
|
||||
"schemars 1.2.1",
|
||||
@@ -6503,7 +6503,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kigi-tools"
|
||||
version = "0.1.18"
|
||||
version = "0.1.19"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"arc-swap",
|
||||
@@ -6580,7 +6580,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kigi-tools-api"
|
||||
version = "0.1.18"
|
||||
version = "0.1.19"
|
||||
dependencies = [
|
||||
"kigi-proto-build",
|
||||
"kigi-tool-protocol",
|
||||
@@ -6593,11 +6593,11 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kigi-tracing-macros"
|
||||
version = "0.1.18"
|
||||
version = "0.1.19"
|
||||
|
||||
[[package]]
|
||||
name = "kigi-tty-utils"
|
||||
version = "0.1.18"
|
||||
version = "0.1.19"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"nix 0.30.1",
|
||||
@@ -6607,7 +6607,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kigi-tui"
|
||||
version = "0.1.18"
|
||||
version = "0.1.19"
|
||||
dependencies = [
|
||||
"agent-client-protocol",
|
||||
"ansi-to-tui",
|
||||
@@ -6694,7 +6694,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kigi-update"
|
||||
version = "0.1.18"
|
||||
version = "0.1.19"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"dunce",
|
||||
@@ -6723,14 +6723,14 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kigi-version"
|
||||
version = "0.1.18"
|
||||
version = "0.1.19"
|
||||
dependencies = [
|
||||
"semver",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "kigi-workspace"
|
||||
version = "0.1.18"
|
||||
version = "0.1.19"
|
||||
dependencies = [
|
||||
"agent-client-protocol",
|
||||
"anyhow",
|
||||
@@ -6809,7 +6809,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kigi-workspace-types"
|
||||
version = "0.1.18"
|
||||
version = "0.1.19"
|
||||
dependencies = [
|
||||
"base64",
|
||||
"chrono",
|
||||
@@ -8843,7 +8843,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "ptyctl"
|
||||
version = "0.1.18"
|
||||
version = "0.1.19"
|
||||
dependencies = [
|
||||
"alacritty_terminal",
|
||||
"anyhow",
|
||||
@@ -8861,7 +8861,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "ptyctl-cli"
|
||||
version = "0.1.18"
|
||||
version = "0.1.19"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"axum",
|
||||
|
||||
+1
-1
@@ -76,7 +76,7 @@ members = [
|
||||
]
|
||||
|
||||
[workspace.package]
|
||||
version = "0.1.18"
|
||||
version = "0.1.19"
|
||||
edition = "2024"
|
||||
license = "Apache-2.0"
|
||||
|
||||
|
||||
@@ -86,8 +86,8 @@ On by default. `KIGI_GRAPH=0` turns it off; `KIGI_GRAPH_CONCURRENCY` (default
|
||||
|
||||
## Providers and API keys
|
||||
|
||||
29 platforms ship compiled in: 5 you sign into, 24 you hand a key. Nothing is
|
||||
registered at runtime — if it's not in this list, it's not there.
|
||||
29 platforms ship compiled in: 5 you sign into, 24 you hand a key. Anything
|
||||
else is an endpoint you declare yourself ([your own endpoint](#your-own-endpoint)).
|
||||
|
||||
**Sign in with a subscription you already pay for.** Run `kigi login` and pick.
|
||||
Each provider's token is stored under its own key, and one provider's
|
||||
@@ -149,6 +149,28 @@ api_key = "sk-..."
|
||||
api_key = "xai-..."
|
||||
```
|
||||
|
||||
### Your own endpoint
|
||||
|
||||
Anything that speaks the OpenAI Chat Completions API or the Anthropic Messages
|
||||
API works: a gateway, a proxy, Ollama, LM Studio, vLLM. In `kigi`, open `/login`
|
||||
(or the welcome login screen) and pick **Custom provider (OpenAI compatible)**
|
||||
or **(Anthropic compatible)**, then enter a base URL, a name, and an API key.
|
||||
Kigi saves the provider,
|
||||
checks the key against `GET {base}/models`, and `/model` lists what the endpoint
|
||||
serves as `name/model`.
|
||||
|
||||
```toml
|
||||
# ~/.kigi/config.toml
|
||||
[platforms.my-gateway]
|
||||
base_url = "https://gateway.example.com/v1" # include /v1 when the API lives there
|
||||
api = "openai" # or "anthropic"
|
||||
api_key = "sk-..." # or store it in ~/.kigi/auth.json under "my-gateway"
|
||||
```
|
||||
|
||||
A key is required. A local server that ignores auth takes any value. The
|
||||
context window is 256K unless the endpoint reports one. To remove a provider,
|
||||
delete its table and its `auth.json` entry.
|
||||
|
||||
Model lists sync on startup. Pick one with `/model`, set its thinking level
|
||||
with `/effort`.
|
||||
|
||||
|
||||
+62
-62
@@ -16436,68 +16436,68 @@ limitations under the License.
|
||||
|
||||
Applies to:
|
||||
|
||||
- [kigi-proto-build 0.1.18](https://crates.io/crates/kigi-proto-build)
|
||||
- [kigi-acp-lib 0.1.18](https://crates.io/crates/kigi-acp-lib)
|
||||
- [kigi-agent 0.1.18](https://crates.io/crates/kigi-agent)
|
||||
- [kigi-agent-lifecycle 0.1.18](https://crates.io/crates/kigi-agent-lifecycle)
|
||||
- [kigi-auth 0.1.18](https://crates.io/crates/kigi-auth)
|
||||
- [kigi-bin 0.1.18](https://crates.io/crates/kigi-bin)
|
||||
- [kigi-chat-state 0.1.18](https://crates.io/crates/kigi-chat-state)
|
||||
- [kigi-codebase-graph 0.1.18](https://crates.io/crates/kigi-codebase-graph)
|
||||
- [kigi-config 0.1.18](https://crates.io/crates/kigi-config)
|
||||
- [kigi-config-types 0.1.18](https://crates.io/crates/kigi-config-types)
|
||||
- [kigi-crash-handler 0.1.18](https://crates.io/crates/kigi-crash-handler)
|
||||
- [kigi-env 0.1.18](https://crates.io/crates/kigi-env)
|
||||
- [kigi-fast-worktree 0.1.18](https://crates.io/crates/kigi-fast-worktree)
|
||||
- [kigi-file-utils 0.1.18](https://crates.io/crates/kigi-file-utils)
|
||||
- [kigi-fsnotify 0.1.18](https://crates.io/crates/kigi-fsnotify)
|
||||
- [kigi-gix-status 0.1.18](https://crates.io/crates/kigi-gix-status)
|
||||
- [kigi-hooks 0.1.18](https://crates.io/crates/kigi-hooks)
|
||||
- [kigi-hooks-plugins-types 0.1.18](https://crates.io/crates/kigi-hooks-plugins-types)
|
||||
- [kigi-http 0.1.18](https://crates.io/crates/kigi-http)
|
||||
- [kigi-hunk-tracker 0.1.18](https://crates.io/crates/kigi-hunk-tracker)
|
||||
- [kigi-log 0.1.18](https://crates.io/crates/kigi-log)
|
||||
- [kigi-markdown 0.1.18](https://crates.io/crates/kigi-markdown)
|
||||
- [kigi-markdown-core 0.1.18](https://crates.io/crates/kigi-markdown-core)
|
||||
- [kigi-mcp 0.1.18](https://crates.io/crates/kigi-mcp)
|
||||
- [kigi-memory 0.1.18](https://crates.io/crates/kigi-memory)
|
||||
- [kigi-models 0.1.18](https://crates.io/crates/kigi-models)
|
||||
- [kigi-pager-minimal 0.1.18](https://crates.io/crates/kigi-pager-minimal)
|
||||
- [kigi-pager-pty-harness 0.1.18](https://crates.io/crates/kigi-pager-pty-harness)
|
||||
- [kigi-pager-render 0.1.18](https://crates.io/crates/kigi-pager-render)
|
||||
- [kigi-paths 0.1.18](https://crates.io/crates/kigi-paths)
|
||||
- [kigi-prompt-queue 0.1.18](https://crates.io/crates/kigi-prompt-queue)
|
||||
- [kigi-ratatui-inline 0.1.18](https://crates.io/crates/kigi-ratatui-inline)
|
||||
- [kigi-ratatui-textarea 0.1.18](https://crates.io/crates/kigi-ratatui-textarea)
|
||||
- [kigi-sampler 0.1.18](https://crates.io/crates/kigi-sampler)
|
||||
- [kigi-sampling-types 0.1.18](https://crates.io/crates/kigi-sampling-types)
|
||||
- [kigi-sandbox 0.1.18](https://crates.io/crates/kigi-sandbox)
|
||||
- [kigi-secrets 0.1.18](https://crates.io/crates/kigi-secrets)
|
||||
- [kigi-proto-build 0.1.19](https://crates.io/crates/kigi-proto-build)
|
||||
- [kigi-acp-lib 0.1.19](https://crates.io/crates/kigi-acp-lib)
|
||||
- [kigi-agent 0.1.19](https://crates.io/crates/kigi-agent)
|
||||
- [kigi-agent-lifecycle 0.1.19](https://crates.io/crates/kigi-agent-lifecycle)
|
||||
- [kigi-auth 0.1.19](https://crates.io/crates/kigi-auth)
|
||||
- [kigi-bin 0.1.19](https://crates.io/crates/kigi-bin)
|
||||
- [kigi-chat-state 0.1.19](https://crates.io/crates/kigi-chat-state)
|
||||
- [kigi-codebase-graph 0.1.19](https://crates.io/crates/kigi-codebase-graph)
|
||||
- [kigi-config 0.1.19](https://crates.io/crates/kigi-config)
|
||||
- [kigi-config-types 0.1.19](https://crates.io/crates/kigi-config-types)
|
||||
- [kigi-crash-handler 0.1.19](https://crates.io/crates/kigi-crash-handler)
|
||||
- [kigi-env 0.1.19](https://crates.io/crates/kigi-env)
|
||||
- [kigi-fast-worktree 0.1.19](https://crates.io/crates/kigi-fast-worktree)
|
||||
- [kigi-file-utils 0.1.19](https://crates.io/crates/kigi-file-utils)
|
||||
- [kigi-fsnotify 0.1.19](https://crates.io/crates/kigi-fsnotify)
|
||||
- [kigi-gix-status 0.1.19](https://crates.io/crates/kigi-gix-status)
|
||||
- [kigi-hooks 0.1.19](https://crates.io/crates/kigi-hooks)
|
||||
- [kigi-hooks-plugins-types 0.1.19](https://crates.io/crates/kigi-hooks-plugins-types)
|
||||
- [kigi-http 0.1.19](https://crates.io/crates/kigi-http)
|
||||
- [kigi-hunk-tracker 0.1.19](https://crates.io/crates/kigi-hunk-tracker)
|
||||
- [kigi-log 0.1.19](https://crates.io/crates/kigi-log)
|
||||
- [kigi-markdown 0.1.19](https://crates.io/crates/kigi-markdown)
|
||||
- [kigi-markdown-core 0.1.19](https://crates.io/crates/kigi-markdown-core)
|
||||
- [kigi-mcp 0.1.19](https://crates.io/crates/kigi-mcp)
|
||||
- [kigi-memory 0.1.19](https://crates.io/crates/kigi-memory)
|
||||
- [kigi-models 0.1.19](https://crates.io/crates/kigi-models)
|
||||
- [kigi-pager-minimal 0.1.19](https://crates.io/crates/kigi-pager-minimal)
|
||||
- [kigi-pager-pty-harness 0.1.19](https://crates.io/crates/kigi-pager-pty-harness)
|
||||
- [kigi-pager-render 0.1.19](https://crates.io/crates/kigi-pager-render)
|
||||
- [kigi-paths 0.1.19](https://crates.io/crates/kigi-paths)
|
||||
- [kigi-prompt-queue 0.1.19](https://crates.io/crates/kigi-prompt-queue)
|
||||
- [kigi-ratatui-inline 0.1.19](https://crates.io/crates/kigi-ratatui-inline)
|
||||
- [kigi-ratatui-textarea 0.1.19](https://crates.io/crates/kigi-ratatui-textarea)
|
||||
- [kigi-sampler 0.1.19](https://crates.io/crates/kigi-sampler)
|
||||
- [kigi-sampling-types 0.1.19](https://crates.io/crates/kigi-sampling-types)
|
||||
- [kigi-sandbox 0.1.19](https://crates.io/crates/kigi-sandbox)
|
||||
- [kigi-secrets 0.1.19](https://crates.io/crates/kigi-secrets)
|
||||
- [kigi-shared 0.0.0](https://crates.io/crates/kigi-shared)
|
||||
- [kigi-shell 0.1.18](https://crates.io/crates/kigi-shell)
|
||||
- [kigi-shell-base 0.1.18](https://crates.io/crates/kigi-shell-base)
|
||||
- [kigi-sqlite-journal 0.1.18](https://crates.io/crates/kigi-sqlite-journal)
|
||||
- [kigi-subagent-resolution 0.1.18](https://crates.io/crates/kigi-subagent-resolution)
|
||||
- [kigi-system-power 0.1.18](https://crates.io/crates/kigi-system-power)
|
||||
- [kigi-test-support 0.1.18](https://crates.io/crates/kigi-test-support)
|
||||
- [kigi-token-estimation 0.1.18](https://crates.io/crates/kigi-token-estimation)
|
||||
- [kigi-tools 0.1.18](https://crates.io/crates/kigi-tools)
|
||||
- [kigi-tools-api 0.1.18](https://crates.io/crates/kigi-tools-api)
|
||||
- [kigi-tracing-macros 0.1.18](https://crates.io/crates/kigi-tracing-macros)
|
||||
- [kigi-tty-utils 0.1.18](https://crates.io/crates/kigi-tty-utils)
|
||||
- [kigi-tui 0.1.18](https://crates.io/crates/kigi-tui)
|
||||
- [kigi-update 0.1.18](https://crates.io/crates/kigi-update)
|
||||
- [kigi-version 0.1.18](https://crates.io/crates/kigi-version)
|
||||
- [kigi-workspace 0.1.18](https://crates.io/crates/kigi-workspace)
|
||||
- [kigi-workspace-types 0.1.18](https://crates.io/crates/kigi-workspace-types)
|
||||
- [ptyctl 0.1.18](https://crates.io/crates/ptyctl)
|
||||
- [ptyctl-cli 0.1.18](https://crates.io/crates/ptyctl-cli)
|
||||
- [kigi-compaction 0.1.18](https://crates.io/crates/kigi-compaction)
|
||||
- [kigi-interjection-core 0.1.18](https://crates.io/crates/kigi-interjection-core)
|
||||
- [kigi-test-utils 0.1.18](https://crates.io/crates/kigi-test-utils)
|
||||
- [kigi-tool-protocol 0.1.18](https://crates.io/crates/kigi-tool-protocol)
|
||||
- [kigi-tool-runtime 0.1.18](https://crates.io/crates/kigi-tool-runtime)
|
||||
- [kigi-tool-types 0.1.18](https://crates.io/crates/kigi-tool-types)
|
||||
- [kigi-shell 0.1.19](https://crates.io/crates/kigi-shell)
|
||||
- [kigi-shell-base 0.1.19](https://crates.io/crates/kigi-shell-base)
|
||||
- [kigi-sqlite-journal 0.1.19](https://crates.io/crates/kigi-sqlite-journal)
|
||||
- [kigi-subagent-resolution 0.1.19](https://crates.io/crates/kigi-subagent-resolution)
|
||||
- [kigi-system-power 0.1.19](https://crates.io/crates/kigi-system-power)
|
||||
- [kigi-test-support 0.1.19](https://crates.io/crates/kigi-test-support)
|
||||
- [kigi-token-estimation 0.1.19](https://crates.io/crates/kigi-token-estimation)
|
||||
- [kigi-tools 0.1.19](https://crates.io/crates/kigi-tools)
|
||||
- [kigi-tools-api 0.1.19](https://crates.io/crates/kigi-tools-api)
|
||||
- [kigi-tracing-macros 0.1.19](https://crates.io/crates/kigi-tracing-macros)
|
||||
- [kigi-tty-utils 0.1.19](https://crates.io/crates/kigi-tty-utils)
|
||||
- [kigi-tui 0.1.19](https://crates.io/crates/kigi-tui)
|
||||
- [kigi-update 0.1.19](https://crates.io/crates/kigi-update)
|
||||
- [kigi-version 0.1.19](https://crates.io/crates/kigi-version)
|
||||
- [kigi-workspace 0.1.19](https://crates.io/crates/kigi-workspace)
|
||||
- [kigi-workspace-types 0.1.19](https://crates.io/crates/kigi-workspace-types)
|
||||
- [ptyctl 0.1.19](https://crates.io/crates/ptyctl)
|
||||
- [ptyctl-cli 0.1.19](https://crates.io/crates/ptyctl-cli)
|
||||
- [kigi-compaction 0.1.19](https://crates.io/crates/kigi-compaction)
|
||||
- [kigi-interjection-core 0.1.19](https://crates.io/crates/kigi-interjection-core)
|
||||
- [kigi-test-utils 0.1.19](https://crates.io/crates/kigi-test-utils)
|
||||
- [kigi-tool-protocol 0.1.19](https://crates.io/crates/kigi-tool-protocol)
|
||||
- [kigi-tool-runtime 0.1.19](https://crates.io/crates/kigi-tool-runtime)
|
||||
- [kigi-tool-types 0.1.19](https://crates.io/crates/kigi-tool-types)
|
||||
- [agent-client-protocol 0.10.4](https://github.com/agentclientprotocol/rust-sdk)
|
||||
- [allocator-api2 0.2.21](https://github.com/zakarumych/allocator-api2)
|
||||
- [anes 0.1.6](https://github.com/zrzka/anes-rs)
|
||||
@@ -16772,7 +16772,7 @@ limitations under the License.
|
||||
|
||||
Applies to:
|
||||
|
||||
- [kigi-mermaid 0.1.18](https://crates.io/crates/kigi-mermaid)
|
||||
- [kigi-mermaid 0.1.19](https://crates.io/crates/kigi-mermaid)
|
||||
|
||||
```
|
||||
Roboto-Regular.ttf
|
||||
|
||||
@@ -165,7 +165,7 @@ pub fn normalize_base_url(raw: &str) -> Result<String, CustomProviderError> {
|
||||
Ok(url.to_owned())
|
||||
}
|
||||
|
||||
/// A valid provider name from a base URL's host, for a login default.
|
||||
/// A valid provider name derived from a host.
|
||||
pub fn default_name(base_url: &str) -> String {
|
||||
let host = base_url
|
||||
.split("://")
|
||||
|
||||
@@ -599,7 +599,7 @@ mod tests {
|
||||
);
|
||||
}
|
||||
|
||||
/// `custom:<name>` is an API-key login; the picker rows are not loginable.
|
||||
/// `custom:<name>` logs in; picker rows cannot.
|
||||
#[test]
|
||||
fn custom_provider_method_ids_classify_as_api_key() {
|
||||
let kind = AuthMethodKind::from_id(&acp::AuthMethodId::new("custom:my-proxy"));
|
||||
|
||||
@@ -3960,8 +3960,7 @@ pub fn resolve_model_auth_facts(model_id: &str) -> ModelAuthFacts {
|
||||
},
|
||||
})
|
||||
}
|
||||
/// Auth facts of a catalog entry the caller already holds. A fetched entry
|
||||
/// exists only in the live catalog, never in a disk reload.
|
||||
/// Auth facts of a held live-catalog entry.
|
||||
pub(crate) fn auth_facts_of(entry: &ModelEntry) -> ModelAuthFacts {
|
||||
ModelAuthFacts {
|
||||
byok: if entry.has_own_credentials() {
|
||||
@@ -5286,7 +5285,7 @@ reasoning_effort = "low"
|
||||
auth_scheme: Default::default(),
|
||||
}
|
||||
}
|
||||
/// A fetched entry's scheme and BYOK status come from the entry itself.
|
||||
/// Scheme and BYOK status come from the entry.
|
||||
#[test]
|
||||
fn auth_facts_come_from_the_held_entry() {
|
||||
let mut model = test_model_entry("claude-x", "https://gw.example/v1", None, None, None);
|
||||
|
||||
@@ -9,7 +9,7 @@ const PICKER_PREFIX: &str = "custom-";
|
||||
const LOGIN_PREFIX: &str = "custom:";
|
||||
const ALL_APIS: [CustomApi; 2] = [CustomApi::OpenAi, CustomApi::Anthropic];
|
||||
|
||||
/// The picker row that starts the custom provider flow for one wire.
|
||||
/// The picker row for one wire.
|
||||
pub fn picker_method(api: CustomApi) -> acp::AuthMethod {
|
||||
acp::AuthMethod::Agent(
|
||||
acp::AuthMethodAgent::new(
|
||||
@@ -41,7 +41,7 @@ pub fn login_provider_name(id: &str) -> Option<&str> {
|
||||
id.strip_prefix(LOGIN_PREFIX)
|
||||
}
|
||||
|
||||
/// Probes the listing endpoint with the key; the error text never holds the key.
|
||||
/// Probes the listing endpoint; errors never hold the key.
|
||||
pub(crate) async fn validate_key(credentialed: &CredentialedProvider) -> Result<(), String> {
|
||||
let provider = &credentialed.provider;
|
||||
let url = provider.models_url();
|
||||
|
||||
@@ -553,7 +553,7 @@ impl MvpAgent {
|
||||
tracing::warn!(provider = name, %message, "custom provider login failed");
|
||||
emit_login_span(
|
||||
false,
|
||||
"custom-provider",
|
||||
method_id.0.as_ref(),
|
||||
None,
|
||||
Some("custom_provider_invalid_or_missing"),
|
||||
);
|
||||
@@ -561,7 +561,7 @@ impl MvpAgent {
|
||||
}
|
||||
Ok(self.finish_api_key_login(method_id).await)
|
||||
}
|
||||
/// Shared tail of an API-key login: reload config, refresh the catalog.
|
||||
/// Shared tail of an API-key login.
|
||||
async fn finish_api_key_login(&self, method_id: acp::AuthMethodId) -> AuthenticateResponse {
|
||||
// Rebuild the catalog from the on-disk config: the rebuild freshly
|
||||
// resolves platform keys (env > auth.json > config), so the key just
|
||||
|
||||
@@ -879,6 +879,20 @@ fn log_subagent_model_resolution(
|
||||
)),
|
||||
);
|
||||
}
|
||||
/// The parent model's auth scheme from the live catalog.
|
||||
fn parent_auth_scheme(
|
||||
available: &indexmap::IndexMap<String, crate::agent::config::ModelEntry>,
|
||||
catalog_id: &acp::ModelId,
|
||||
slug: &str,
|
||||
) -> kigi_sampler::AuthScheme {
|
||||
crate::agent::models::entry_for_slug(available, Some(catalog_id.0.as_ref()), slug)
|
||||
.map(|entry| crate::agent::config::auth_facts_of(entry).auth_scheme)
|
||||
.or_else(|| {
|
||||
crate::agent::config::try_resolve_model_credentials(slug, None).map(|r| r.auth_scheme)
|
||||
})
|
||||
.unwrap_or_default()
|
||||
}
|
||||
|
||||
/// Read the parent session's actual current sampling config.
|
||||
///
|
||||
/// Prefers the live state from `ChatStateHandle` (authoritative). Falls back
|
||||
@@ -897,17 +911,7 @@ async fn read_parent_sampling_config(
|
||||
creds.alpha_test_key.as_deref(),
|
||||
&cfg.base_url,
|
||||
);
|
||||
let auth_scheme = crate::agent::models::entry_for_slug(
|
||||
&ctx.available_models,
|
||||
Some(ctx.model_id.0.as_ref()),
|
||||
&cfg.model,
|
||||
)
|
||||
.map(|entry| crate::agent::config::auth_facts_of(entry).auth_scheme)
|
||||
.or_else(|| {
|
||||
crate::agent::config::try_resolve_model_credentials(&cfg.model, None)
|
||||
.map(|r| r.auth_scheme)
|
||||
})
|
||||
.unwrap_or_default();
|
||||
let auth_scheme = parent_auth_scheme(&ctx.available_models, &ctx.model_id, &cfg.model);
|
||||
// Claude Pro/Max OAuth Messages adaptation inherits from the parent
|
||||
// model's platform (claude-pro-max → true); every other platform,
|
||||
// and BYOK, → false, so the API-key paths stay byte-identical.
|
||||
|
||||
@@ -3322,3 +3322,24 @@ async fn parent_ack_is_bounded_when_the_parent_never_answers() {
|
||||
.expect("parent acks must complete in bounded time");
|
||||
assert!(!acked, "an unanswered ack must report a miss");
|
||||
}
|
||||
/// A fetched Messages model exists only in the live catalog.
|
||||
#[test]
|
||||
fn a_fetched_entry_gives_its_own_scheme_to_the_child() {
|
||||
let wire: kigi_models::WireModel =
|
||||
serde_json::from_value(serde_json::json!({ "id": "claude-x" })).unwrap();
|
||||
let cfg = crate::agent::models_fetch::wire_model_to_entry(
|
||||
"gw/claude-x".into(),
|
||||
kigi_models::PlatformWireApi::Messages,
|
||||
kigi_models::PlatformKeyHeader::XApiKey,
|
||||
None,
|
||||
true,
|
||||
wire,
|
||||
"https://gw.example/v1",
|
||||
);
|
||||
let available = indexmap::IndexMap::from([(
|
||||
"gw/claude-x".to_owned(),
|
||||
crate::agent::config::ModelEntry::from_config_entry(&cfg),
|
||||
)]);
|
||||
let scheme = parent_auth_scheme(&available, &acp::ModelId::new("gw/claude-x"), "claude-x");
|
||||
assert_eq!(scheme, kigi_sampler::AuthScheme::XApiKey);
|
||||
}
|
||||
@@ -570,9 +570,9 @@ pub enum Action {
|
||||
/// under the platform-id scope, then authenticate with the platform's
|
||||
/// method id. The key must never be logged.
|
||||
SubmitPlatformApiKey(String),
|
||||
/// A custom provider row was picked: start the URL, name, key steps.
|
||||
/// Custom provider row picked: open the URL step.
|
||||
BeginCustomProviderEntry(kigi_shell::models::custom::CustomApi),
|
||||
/// Enter in a custom provider step, with the trimmed input.
|
||||
/// Enter in a custom provider step.
|
||||
SubmitCustomProviderInput(String),
|
||||
/// Copy the auth URL to the clipboard during authentication.
|
||||
CopyAuthUrl,
|
||||
@@ -1618,8 +1618,7 @@ pub enum Effect {
|
||||
target: crate::app::app_view::PlatformLogin,
|
||||
key: String,
|
||||
},
|
||||
/// Save a custom provider (config.toml and auth.json), then send
|
||||
/// AuthenticateRequest with `custom:<name>`. SECURITY: never log the key.
|
||||
/// Saves the provider, then authenticates; never log the key.
|
||||
PersistCustomProviderAndAuthenticate {
|
||||
request_seq: u64,
|
||||
provider: kigi_shell::models::custom::CustomProvider,
|
||||
|
||||
@@ -262,7 +262,7 @@ pub enum AuthMode {
|
||||
/// Open-platform API-key entry: paste box for a Moonshot key selected
|
||||
/// from the welcome login picker. Esc returns to the picker (no quit).
|
||||
ApiKeyEntry(PlatformLogin),
|
||||
/// Custom provider login: one field per step; Esc returns to the picker.
|
||||
/// Custom provider login, one field per step.
|
||||
CustomProviderEntry(crate::app::custom_entry::CustomEntryStep),
|
||||
}
|
||||
/// API-key platform login target, selected from the welcome picker. Wraps a
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//! The base URL, name, and key steps of the custom provider login.
|
||||
//! Custom provider login steps: base URL, name, key.
|
||||
|
||||
use kigi_shell::models::custom::{
|
||||
CustomApi, CustomProvider, default_name, normalize_base_url, validate_name,
|
||||
@@ -26,7 +26,7 @@ impl CustomEntryStep {
|
||||
}
|
||||
}
|
||||
|
||||
/// Only the key is a secret; URL and name show as typed.
|
||||
/// Only the key is masked.
|
||||
pub fn masks_input(self) -> bool {
|
||||
self.field == CustomEntryField::Key
|
||||
}
|
||||
@@ -43,9 +43,9 @@ impl CustomEntryStep {
|
||||
/// What one Enter press did.
|
||||
#[derive(Debug, PartialEq, Eq)]
|
||||
pub enum CustomEntryOutcome {
|
||||
/// The input stays; `CustomEntryDraft::error` says why, if it does.
|
||||
/// The input stays; the draft error says why.
|
||||
Stay,
|
||||
/// Move to the next field with this text in the box.
|
||||
/// Next field, with this text in the box.
|
||||
Next {
|
||||
field: CustomEntryField,
|
||||
prefill: String,
|
||||
|
||||
@@ -326,7 +326,7 @@ pub(super) fn dispatch_begin_platform_key_entry(
|
||||
vec![]
|
||||
}
|
||||
|
||||
/// A custom provider row was selected: open the first step (base URL).
|
||||
/// Custom provider row selected: open the URL step.
|
||||
pub(super) fn dispatch_begin_custom_provider_entry(
|
||||
app: &mut AppView,
|
||||
api: kigi_shell::models::custom::CustomApi,
|
||||
@@ -344,7 +344,7 @@ pub(super) fn dispatch_begin_custom_provider_entry(
|
||||
vec![]
|
||||
}
|
||||
|
||||
/// Enter in a custom provider step: advance, stay with a reason, or save.
|
||||
/// Enter in a custom provider step.
|
||||
pub(super) fn dispatch_submit_custom_provider_input(
|
||||
app: &mut AppView,
|
||||
input: String,
|
||||
|
||||
@@ -582,8 +582,7 @@ fn custom_field(app: &AppView) -> crate::app::custom_entry::CustomEntryField {
|
||||
}
|
||||
}
|
||||
|
||||
/// The custom provider flow: URL, then name (prefilled from the host), then
|
||||
/// key; the last Enter emits ONE persist+authenticate effect for the provider.
|
||||
/// URL, name, key; the last Enter emits one persist effect.
|
||||
#[test]
|
||||
fn custom_provider_steps_end_in_one_persist_effect() {
|
||||
use crate::app::custom_entry::CustomEntryField;
|
||||
@@ -649,7 +648,7 @@ fn custom_provider_steps_end_in_one_persist_effect() {
|
||||
assert!(app.auth_code_input.is_empty());
|
||||
}
|
||||
|
||||
/// A refused field keeps the user on it and does not emit an effect.
|
||||
/// A refused field keeps the user on it.
|
||||
#[test]
|
||||
fn custom_provider_refusals_stay_on_the_field() {
|
||||
use crate::app::custom_entry::CustomEntryField;
|
||||
@@ -687,7 +686,7 @@ fn custom_provider_refusals_stay_on_the_field() {
|
||||
assert!(app.custom_entry.error.is_some());
|
||||
}
|
||||
|
||||
/// Esc at any step returns to the picker and drops the draft.
|
||||
/// Esc returns to the picker and drops the draft.
|
||||
#[test]
|
||||
fn cancel_custom_provider_entry_returns_to_picker() {
|
||||
use kigi_shell::models::custom::CustomApi;
|
||||
|
||||
@@ -1294,7 +1294,7 @@ fn render_welcome_authenticating(
|
||||
}
|
||||
|
||||
AuthMode::ApiKeyEntry(target) => {
|
||||
// Platform API-key paste box: the key comes from the platform console.
|
||||
// Platform API-key paste box.
|
||||
let instruction = format!(
|
||||
"Paste your {} API key (from {})",
|
||||
target.vendor(),
|
||||
@@ -1938,8 +1938,7 @@ pub(crate) fn render_session_picker(
|
||||
)
|
||||
}
|
||||
|
||||
/// Render the auth token input box (loopback mode).
|
||||
/// One text field under the logo: instruction, optional error, input box, hints.
|
||||
/// One text field under the logo.
|
||||
struct EntryBox<'a> {
|
||||
instruction: &'a str,
|
||||
error: Option<&'a str>,
|
||||
@@ -2035,6 +2034,7 @@ fn render_entry_box(
|
||||
Paragraph::new(hints).render(hint_area, buf);
|
||||
}
|
||||
|
||||
/// Render the auth token input box (loopback mode).
|
||||
fn render_auth_input_box(
|
||||
area: Rect,
|
||||
buf: &mut Buffer,
|
||||
@@ -2393,8 +2393,6 @@ mod tests {
|
||||
assert!(!text.contains("Moonshot"), "{text}");
|
||||
}
|
||||
|
||||
/// The Moonshot API-key entry arm renders the platform copy, the paste
|
||||
/// box, and the esc-back hint — and no OAuth-URL affordances.
|
||||
fn render_custom_entry(
|
||||
step: crate::app::custom_entry::CustomEntryStep,
|
||||
draft: &crate::app::custom_entry::CustomEntryDraft,
|
||||
@@ -2417,7 +2415,7 @@ mod tests {
|
||||
buffer_text(&buf)
|
||||
}
|
||||
|
||||
/// The URL and name steps show typed text; only the key step masks it.
|
||||
/// Only the key step masks its input.
|
||||
#[test]
|
||||
fn custom_entry_arm_masks_only_the_key() {
|
||||
use crate::app::custom_entry::{CustomEntryDraft, CustomEntryField, CustomEntryStep};
|
||||
@@ -2447,7 +2445,7 @@ mod tests {
|
||||
assert!(empty.contains("provider name"), "{empty}");
|
||||
}
|
||||
|
||||
/// A refusal shows under the instruction so the user sees what to fix.
|
||||
/// A refusal shows under the instruction.
|
||||
#[test]
|
||||
fn custom_entry_arm_shows_the_refusal() {
|
||||
use crate::app::custom_entry::{CustomEntryDraft, CustomEntryStep};
|
||||
@@ -2460,6 +2458,8 @@ mod tests {
|
||||
assert!(text.contains("must start with http"), "{text}");
|
||||
}
|
||||
|
||||
/// The Moonshot API-key entry arm renders the platform copy, the paste
|
||||
/// box, and the esc-back hint — and no OAuth-URL affordances.
|
||||
#[test]
|
||||
fn api_key_entry_arm_shows_platform_copy_and_paste_box() {
|
||||
let area = Rect::new(0, 0, 80, 40);
|
||||
|
||||
@@ -57,10 +57,7 @@ async fn run_turn(content: &ContentController) -> PtyHarness {
|
||||
harness
|
||||
}
|
||||
|
||||
/// A declared OpenAI-compatible provider supplies the catalog and the turn:
|
||||
/// the request goes to `/chat/completions` for the fetched model with the
|
||||
/// provider's own key. The house key, which is set in this environment on the
|
||||
/// same loopback URL as the session's coding endpoint, never rides it.
|
||||
/// An OpenAI provider lists models and uses its own key.
|
||||
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
|
||||
#[ignore]
|
||||
async fn custom_openai_provider_lists_models_and_uses_its_own_key() {
|
||||
@@ -94,8 +91,7 @@ async fn custom_openai_provider_lists_models_and_uses_its_own_key() {
|
||||
harness.quit().expect("clean quit");
|
||||
}
|
||||
|
||||
/// An Anthropic-compatible provider is reached on `/messages` with
|
||||
/// `x-api-key` and `anthropic-version`, and no Bearer header.
|
||||
/// An Anthropic provider uses `/messages` with `x-api-key`.
|
||||
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
|
||||
#[ignore]
|
||||
async fn custom_anthropic_provider_uses_messages_and_x_api_key() {
|
||||
@@ -127,3 +123,37 @@ async fn custom_anthropic_provider_uses_messages_and_x_api_key() {
|
||||
}
|
||||
harness.quit().expect("clean quit");
|
||||
}
|
||||
|
||||
/// A saved provider alone is a complete login.
|
||||
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
|
||||
#[ignore]
|
||||
async fn custom_provider_alone_authenticates_at_startup() {
|
||||
let content = ContentController::start_with_models(vec![MockModel::new("custom-m1")])
|
||||
.await
|
||||
.expect("start content");
|
||||
declare_provider(&content, "openai");
|
||||
content.set_response(format!(
|
||||
"{MOCK_RESPONSE_SENTINEL} from the custom provider."
|
||||
));
|
||||
let env: Vec<(String, String)> = content
|
||||
.env_for_pager()
|
||||
.into_iter()
|
||||
.filter(|(name, _)| name != "KIGI_API_KEY")
|
||||
.collect();
|
||||
let env_refs: Vec<(&str, &str)> = env.iter().map(|(k, v)| (k.as_str(), v.as_str())).collect();
|
||||
let binary = pager_binary().expect("resolve pager binary");
|
||||
let mut harness =
|
||||
PtyHarness::new_in_dir(&binary, DEFAULT_ROWS, DEFAULT_COLS, &[], &env_refs, None)
|
||||
.expect("spawn pager without a house key");
|
||||
|
||||
harness
|
||||
.wait_for_text(WELCOME_SCREEN_SENTINEL, WELCOME_TIMEOUT)
|
||||
.expect("welcome text");
|
||||
harness
|
||||
.inject_keys(format!("{PROMPT}\r").as_bytes())
|
||||
.expect("submit prompt");
|
||||
harness
|
||||
.wait_for_text(MOCK_RESPONSE_SENTINEL, Duration::from_secs(30))
|
||||
.expect("the turn reaches the custom provider without a login screen");
|
||||
harness.quit().expect("clean quit");
|
||||
}
|
||||
Reference in new issue
Block a user