agent-afk 5.39.0 → 5.41.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -139,11 +139,14 @@ afk chat "refactor this" --model gpt-5.5
139
139
  | Slot | Default | Notes |
140
140
  |---|---|---|
141
141
  | `local` | *(empty — you configure)* | Point at Ollama, LM Studio, or any OpenAI-compatible shim via `AFK_MODEL_LOCAL` + `AFK_MODEL_LOCAL_BASE_URL` |
142
- | `small` | `claude-haiku-4-5-20251001` | Cheapest/fastest Anthropic tier; `haiku` alias |
143
- | `medium` | `claude-sonnet-5` | General-use default; `sonnet` alias |
144
- | `large` | `claude-opus-4-8` | Most capable; `opus` alias |
145
-
146
- See [`docs/model-slots.md`](docs/model-slots.md) for the full configuration reference.
142
+ | `small` | `claude-haiku-4-5-20251001` | Cheapest/fastest Anthropic tier |
143
+ | `medium` | `claude-sonnet-5` | General-use default |
144
+ | `large` | `claude-opus-4-8` | Most capable |
145
+
146
+ The `haiku`/`sonnet`/`opus`/`fable` handles are **fixed identities**, not tier
147
+ aliases: they always resolve to their Claude model even after you rebind a tier
148
+ (so rebinding `medium` to an OpenAI model won't hijack `sonnet`). See
149
+ [`docs/model-slots.md`](docs/model-slots.md) for the full configuration reference.
147
150
 
148
151
  MCP servers (tool-providing plugins over stdio/HTTP) — see [`docs/mcp.md`](docs/mcp.md) for config, transports, OAuth, and security notes.
149
152
 
@@ -1,4 +1,4 @@
1
- export type OpenAIAuthSource = 'config' | 'env' | 'codex-cli' | 'chatgpt-oauth' | 'no-usable-auth' | 'no-usable-auth-codex-oauth';
1
+ export type OpenAIAuthSource = 'config' | 'env' | 'codex-cli' | 'chatgpt-oauth' | 'no-usable-auth' | 'no-usable-auth-codex-oauth' | 'no-usable-auth-forced-chatgpt-oauth';
2
2
  export interface OpenAIAuthResolution {
3
3
  apiKey: string | null;
4
4
  source: OpenAIAuthSource;
@@ -12,7 +12,7 @@ export interface AuthResolverDeps {
12
12
  homedir?: () => string;
13
13
  readFile?: (path: string) => string | null;
14
14
  }
15
- export declare function resolveOpenAIAuth(explicitConfigKey: string | undefined, deps?: AuthResolverDeps): OpenAIAuthResolution;
15
+ export declare function resolveOpenAIAuth(explicitConfigKey: string | undefined, deps?: AuthResolverDeps, forceChatgptOAuth?: boolean): OpenAIAuthResolution;
16
16
  type CodexAuthParse = {
17
17
  kind: 'apikey';
18
18
  apiKey: string;
@@ -0,0 +1,11 @@
1
+ export declare const DEFAULT_MODEL_TTFB_TIMEOUT_MS = 180000;
2
+ export declare function resolveTtfbTimeoutMs(): number;
3
+ export declare const TTFB_TIMEOUT_MESSAGE = "model_ttfb_timeout";
4
+ export declare function isTtfbTimeoutError(err: unknown): boolean;
5
+ export interface FirstByteTimeoutHandle {
6
+ readonly signal: AbortSignal;
7
+ timedOut(): boolean;
8
+ firstByteSeen(): void;
9
+ dispose(): void;
10
+ }
11
+ export declare function armFirstByteTimeout(baseSignal: AbortSignal, timeoutMs: number): FirstByteTimeoutHandle;
@@ -1,6 +1,6 @@
1
1
  export type SlotName = 'local' | 'small' | 'medium' | 'large';
2
2
  export declare const SLOT_NAMES: readonly SlotName[];
3
- export type SlotProvider = 'anthropic' | 'openai';
3
+ export type SlotProvider = 'anthropic' | 'openai' | 'chatgpt-oauth';
4
4
  export interface ModelSlotBinding {
5
5
  id: string;
6
6
  name?: string;
@@ -9,10 +9,14 @@ export interface ModelSlotBinding {
9
9
  apiKey?: string;
10
10
  }
11
11
  export type ModelSlots = Record<SlotName, ModelSlotBinding>;
12
+ export declare const CLAUDE_HAIKU_ID = "claude-haiku-4-5-20251001";
13
+ export declare const CLAUDE_SONNET_ID = "claude-sonnet-5";
14
+ export declare const CLAUDE_OPUS_ID = "claude-opus-4-8";
15
+ export declare const CLAUDE_FABLE_5_ID = "claude-fable-5";
12
16
  export declare const DEFAULT_SLOT_BINDINGS: ModelSlots;
13
17
  export declare const AUTO_SENTINEL = "auto";
14
- export declare const CLAUDE_FABLE_5_ID = "claude-fable-5";
15
18
  export declare const DIRECT_MODEL_ALIASES: Readonly<Record<string, string>>;
19
+ export declare const MODEL_ALIASES_HINT: readonly string[];
16
20
  export declare function setSlotBindings(bindings: ModelSlots | undefined): void;
17
21
  export declare function resetSlotBindings(): void;
18
22
  export declare function computeSlotBindings(fileOverrides?: Partial<Record<SlotName, ModelSlotBinding>>): ModelSlots;
@@ -4,5 +4,6 @@ export interface SlotCredentialTarget {
4
4
  apiKey?: string;
5
5
  baseUrl?: string;
6
6
  openaiBaseUrl?: string;
7
+ forceChatgptOAuth?: boolean;
7
8
  }
8
9
  export declare function applySlotCredentials(config: SlotCredentialTarget, bindings?: ModelSlots): void;
@@ -25,6 +25,7 @@ export interface AgentConfig {
25
25
  apiKey?: string;
26
26
  baseUrl?: string;
27
27
  openaiBaseUrl?: string;
28
+ forceChatgptOAuth?: boolean;
28
29
  maxTurns?: number;
29
30
  maxToolUseIterations?: number;
30
31
  thinking?: ThinkingConfig;