@botiverse/raft-daemon 0.63.6-play.20260624140611 → 0.63.7

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.
@@ -11,579 +11,6 @@ function makeIsMember(members) {
11
11
  return (value) => typeof value === "string" && set.has(value);
12
12
  }
13
13
 
14
- // ../shared/src/piBuiltinModels.generated.ts
15
- var PI_BUILTIN_PROVIDER_MODELS_GENERATED = {
16
- "deepseek": [
17
- { id: "deepseek/deepseek-v4-pro", label: "DeepSeek V4 Pro" },
18
- { id: "deepseek/deepseek-v4-flash", label: "DeepSeek V4 Flash" }
19
- ],
20
- "minimax": [
21
- { id: "minimax/MiniMax-M2.7", label: "MiniMax-M2.7" },
22
- { id: "minimax/MiniMax-M2.7-highspeed", label: "MiniMax-M2.7-highspeed" },
23
- { id: "minimax/MiniMax-M3", label: "MiniMax-M3" }
24
- ],
25
- "minimax-cn": [
26
- { id: "minimax-cn/MiniMax-M2.7", label: "MiniMax-M2.7" },
27
- { id: "minimax-cn/MiniMax-M2.7-highspeed", label: "MiniMax-M2.7-highspeed" },
28
- { id: "minimax-cn/MiniMax-M3", label: "MiniMax-M3" }
29
- ],
30
- "zai": [
31
- { id: "zai/glm-5.1", label: "GLM-5.1" },
32
- { id: "zai/glm-4.5-air", label: "GLM-4.5-Air" },
33
- { id: "zai/glm-4.7", label: "GLM-4.7" },
34
- { id: "zai/glm-5-turbo", label: "GLM-5-Turbo" },
35
- { id: "zai/glm-5.2", label: "GLM-5.2" },
36
- { id: "zai/glm-5v-turbo", label: "GLM-5V-Turbo" }
37
- ],
38
- "zai-coding-cn": [
39
- { id: "zai-coding-cn/glm-5.1", label: "GLM-5.1" },
40
- { id: "zai-coding-cn/glm-4.5-air", label: "GLM-4.5-Air" },
41
- { id: "zai-coding-cn/glm-4.7", label: "GLM-4.7" },
42
- { id: "zai-coding-cn/glm-5-turbo", label: "GLM-5-Turbo" },
43
- { id: "zai-coding-cn/glm-5.2", label: "GLM-5.2" },
44
- { id: "zai-coding-cn/glm-5v-turbo", label: "GLM-5V-Turbo" }
45
- ],
46
- "kimi-coding": [
47
- { id: "kimi-coding/kimi-for-coding", label: "Kimi For Coding" },
48
- { id: "kimi-coding/k2p7", label: "Kimi K2.7 Code" },
49
- { id: "kimi-coding/kimi-k2-thinking", label: "Kimi K2 Thinking" }
50
- ],
51
- "moonshotai-cn": [
52
- { id: "moonshotai-cn/kimi-k2.6", label: "Kimi K2.6" },
53
- { id: "moonshotai-cn/kimi-k2-0711-preview", label: "Kimi K2 0711" },
54
- { id: "moonshotai-cn/kimi-k2-0905-preview", label: "Kimi K2 0905" },
55
- { id: "moonshotai-cn/kimi-k2-thinking", label: "Kimi K2 Thinking" },
56
- { id: "moonshotai-cn/kimi-k2-thinking-turbo", label: "Kimi K2 Thinking Turbo" },
57
- { id: "moonshotai-cn/kimi-k2-turbo-preview", label: "Kimi K2 Turbo" },
58
- { id: "moonshotai-cn/kimi-k2.5", label: "Kimi K2.5" },
59
- { id: "moonshotai-cn/kimi-k2.7-code", label: "Kimi K2.7 Code" },
60
- { id: "moonshotai-cn/kimi-k2.7-code-highspeed", label: "Kimi K2.7 Code HighSpeed" }
61
- ],
62
- "moonshotai": [
63
- { id: "moonshotai/kimi-k2.6", label: "Kimi K2.6" },
64
- { id: "moonshotai/kimi-k2-0711-preview", label: "Kimi K2 0711" },
65
- { id: "moonshotai/kimi-k2-0905-preview", label: "Kimi K2 0905" },
66
- { id: "moonshotai/kimi-k2-thinking", label: "Kimi K2 Thinking" },
67
- { id: "moonshotai/kimi-k2-thinking-turbo", label: "Kimi K2 Thinking Turbo" },
68
- { id: "moonshotai/kimi-k2-turbo-preview", label: "Kimi K2 Turbo" },
69
- { id: "moonshotai/kimi-k2.5", label: "Kimi K2.5" },
70
- { id: "moonshotai/kimi-k2.7-code", label: "Kimi K2.7 Code" },
71
- { id: "moonshotai/kimi-k2.7-code-highspeed", label: "Kimi K2.7 Code HighSpeed" }
72
- ],
73
- "openai": [
74
- { id: "openai/gpt-5.4", label: "GPT-5.4" },
75
- { id: "openai/gpt-4", label: "GPT-4" },
76
- { id: "openai/gpt-4-turbo", label: "GPT-4 Turbo" },
77
- { id: "openai/gpt-4.1", label: "GPT-4.1" },
78
- { id: "openai/gpt-4.1-mini", label: "GPT-4.1 mini" },
79
- { id: "openai/gpt-4.1-nano", label: "GPT-4.1 nano" },
80
- { id: "openai/gpt-4o", label: "GPT-4o" },
81
- { id: "openai/gpt-4o-2024-05-13", label: "GPT-4o (2024-05-13)" },
82
- { id: "openai/gpt-4o-2024-08-06", label: "GPT-4o (2024-08-06)" },
83
- { id: "openai/gpt-4o-2024-11-20", label: "GPT-4o (2024-11-20)" },
84
- { id: "openai/gpt-4o-mini", label: "GPT-4o mini" },
85
- { id: "openai/gpt-5", label: "GPT-5" },
86
- { id: "openai/gpt-5-chat-latest", label: "GPT-5 Chat Latest" },
87
- { id: "openai/gpt-5-codex", label: "GPT-5-Codex" },
88
- { id: "openai/gpt-5-mini", label: "GPT-5 Mini" },
89
- { id: "openai/gpt-5-nano", label: "GPT-5 Nano" },
90
- { id: "openai/gpt-5-pro", label: "GPT-5 Pro" },
91
- { id: "openai/gpt-5.1", label: "GPT-5.1" },
92
- { id: "openai/gpt-5.1-chat-latest", label: "GPT-5.1 Chat" },
93
- { id: "openai/gpt-5.1-codex", label: "GPT-5.1 Codex" },
94
- { id: "openai/gpt-5.1-codex-max", label: "GPT-5.1 Codex Max" },
95
- { id: "openai/gpt-5.1-codex-mini", label: "GPT-5.1 Codex mini" },
96
- { id: "openai/gpt-5.2", label: "GPT-5.2" },
97
- { id: "openai/gpt-5.2-chat-latest", label: "GPT-5.2 Chat" },
98
- { id: "openai/gpt-5.2-codex", label: "GPT-5.2 Codex" },
99
- { id: "openai/gpt-5.2-pro", label: "GPT-5.2 Pro" },
100
- { id: "openai/gpt-5.3-chat-latest", label: "GPT-5.3 Chat (latest)" },
101
- { id: "openai/gpt-5.3-codex", label: "GPT-5.3 Codex" },
102
- { id: "openai/gpt-5.3-codex-spark", label: "GPT-5.3 Codex Spark" },
103
- { id: "openai/gpt-5.4-mini", label: "GPT-5.4 mini" },
104
- { id: "openai/gpt-5.4-nano", label: "GPT-5.4 nano" },
105
- { id: "openai/gpt-5.4-pro", label: "GPT-5.4 Pro" },
106
- { id: "openai/gpt-5.5", label: "GPT-5.5" },
107
- { id: "openai/gpt-5.5-pro", label: "GPT-5.5 Pro" },
108
- { id: "openai/o1", label: "o1" },
109
- { id: "openai/o1-pro", label: "o1-pro" },
110
- { id: "openai/o3", label: "o3" },
111
- { id: "openai/o3-deep-research", label: "o3-deep-research" },
112
- { id: "openai/o3-mini", label: "o3-mini" },
113
- { id: "openai/o3-pro", label: "o3-pro" },
114
- { id: "openai/o4-mini", label: "o4-mini" },
115
- { id: "openai/o4-mini-deep-research", label: "o4-mini-deep-research" }
116
- ],
117
- "anthropic": [
118
- { id: "anthropic/claude-opus-4-8", label: "Claude Opus 4.8" },
119
- { id: "anthropic/claude-3-5-haiku-20241022", label: "Claude Haiku 3.5" },
120
- { id: "anthropic/claude-3-5-haiku-latest", label: "Claude Haiku 3.5 (latest)" },
121
- { id: "anthropic/claude-3-5-sonnet-20240620", label: "Claude Sonnet 3.5" },
122
- { id: "anthropic/claude-3-5-sonnet-20241022", label: "Claude Sonnet 3.5 v2" },
123
- { id: "anthropic/claude-3-7-sonnet-20250219", label: "Claude Sonnet 3.7" },
124
- { id: "anthropic/claude-3-haiku-20240307", label: "Claude Haiku 3" },
125
- { id: "anthropic/claude-3-opus-20240229", label: "Claude Opus 3" },
126
- { id: "anthropic/claude-3-sonnet-20240229", label: "Claude Sonnet 3" },
127
- { id: "anthropic/claude-fable-5", label: "Claude Fable 5" },
128
- { id: "anthropic/claude-haiku-4-5", label: "Claude Haiku 4.5 (latest)" },
129
- { id: "anthropic/claude-haiku-4-5-20251001", label: "Claude Haiku 4.5" },
130
- { id: "anthropic/claude-opus-4-0", label: "Claude Opus 4 (latest)" },
131
- { id: "anthropic/claude-opus-4-1", label: "Claude Opus 4.1 (latest)" },
132
- { id: "anthropic/claude-opus-4-1-20250805", label: "Claude Opus 4.1" },
133
- { id: "anthropic/claude-opus-4-20250514", label: "Claude Opus 4" },
134
- { id: "anthropic/claude-opus-4-5", label: "Claude Opus 4.5 (latest)" },
135
- { id: "anthropic/claude-opus-4-5-20251101", label: "Claude Opus 4.5" },
136
- { id: "anthropic/claude-opus-4-6", label: "Claude Opus 4.6" },
137
- { id: "anthropic/claude-opus-4-7", label: "Claude Opus 4.7" },
138
- { id: "anthropic/claude-sonnet-4-0", label: "Claude Sonnet 4 (latest)" },
139
- { id: "anthropic/claude-sonnet-4-20250514", label: "Claude Sonnet 4" },
140
- { id: "anthropic/claude-sonnet-4-5", label: "Claude Sonnet 4.5 (latest)" },
141
- { id: "anthropic/claude-sonnet-4-5-20250929", label: "Claude Sonnet 4.5" },
142
- { id: "anthropic/claude-sonnet-4-6", label: "Claude Sonnet 4.6" }
143
- ],
144
- "google": [
145
- { id: "google/gemini-3.1-pro-preview", label: "Gemini 3.1 Pro Preview" },
146
- { id: "google/gemini-2.0-flash", label: "Gemini 2.0 Flash" },
147
- { id: "google/gemini-2.0-flash-lite", label: "Gemini 2.0 Flash-Lite" },
148
- { id: "google/gemini-2.5-flash", label: "Gemini 2.5 Flash" },
149
- { id: "google/gemini-2.5-flash-lite", label: "Gemini 2.5 Flash-Lite" },
150
- { id: "google/gemini-2.5-pro", label: "Gemini 2.5 Pro" },
151
- { id: "google/gemini-3-flash-preview", label: "Gemini 3 Flash Preview" },
152
- { id: "google/gemini-3-pro-preview", label: "Gemini 3 Pro Preview" },
153
- { id: "google/gemini-3.1-flash-lite", label: "Gemini 3.1 Flash Lite" },
154
- { id: "google/gemini-3.1-flash-lite-preview", label: "Gemini 3.1 Flash Lite Preview" },
155
- { id: "google/gemini-3.1-pro-preview-customtools", label: "Gemini 3.1 Pro Preview Custom Tools" },
156
- { id: "google/gemini-3.5-flash", label: "Gemini 3.5 Flash" },
157
- { id: "google/gemini-flash-latest", label: "Gemini Flash Latest" },
158
- { id: "google/gemini-flash-lite-latest", label: "Gemini Flash-Lite Latest" },
159
- { id: "google/gemma-4-26b-a4b-it", label: "Gemma 4 26B A4B IT" },
160
- { id: "google/gemma-4-31b-it", label: "Gemma 4 31B IT" },
161
- { id: "google/gemma-4-E2B-it", label: "Gemma 4 E2B IT" },
162
- { id: "google/gemma-4-E4B-it", label: "Gemma 4 E4B IT" }
163
- ],
164
- "xai": [
165
- { id: "xai/grok-4.20-0309-reasoning", label: "Grok 4.20 (Reasoning)" },
166
- { id: "xai/grok-3", label: "Grok 3" },
167
- { id: "xai/grok-3-fast", label: "Grok 3 Fast" },
168
- { id: "xai/grok-4.20-0309-non-reasoning", label: "Grok 4.20 (Non-Reasoning)" },
169
- { id: "xai/grok-4.3", label: "Grok 4.3" },
170
- { id: "xai/grok-build-0.1", label: "Grok Build 0.1" },
171
- { id: "xai/grok-code-fast-1", label: "Grok Code Fast 1" }
172
- ],
173
- "groq": [
174
- { id: "groq/openai/gpt-oss-120b", label: "GPT OSS 120B" },
175
- { id: "groq/llama-3.1-8b-instant", label: "Llama 3.1 8B" },
176
- { id: "groq/llama-3.3-70b-versatile", label: "Llama 3.3 70B" },
177
- { id: "groq/meta-llama/llama-4-scout-17b-16e-instruct", label: "Llama 4 Scout 17B 16E" },
178
- { id: "groq/openai/gpt-oss-20b", label: "GPT OSS 20B" },
179
- { id: "groq/openai/gpt-oss-safeguard-20b", label: "Safety GPT OSS 20B" },
180
- { id: "groq/qwen/qwen3-32b", label: "Qwen3-32B" }
181
- ],
182
- "mistral": [
183
- { id: "mistral/devstral-medium-latest", label: "Devstral 2 (latest)" },
184
- { id: "mistral/codestral-latest", label: "Codestral (latest)" },
185
- { id: "mistral/devstral-2512", label: "Devstral 2" },
186
- { id: "mistral/devstral-latest", label: "Devstral 2" },
187
- { id: "mistral/devstral-medium-2507", label: "Devstral Medium" },
188
- { id: "mistral/devstral-small-2505", label: "Devstral Small 2505" },
189
- { id: "mistral/devstral-small-2507", label: "Devstral Small" },
190
- { id: "mistral/labs-devstral-small-2512", label: "Devstral Small 2" },
191
- { id: "mistral/magistral-medium-latest", label: "Magistral Medium (latest)" },
192
- { id: "mistral/magistral-small", label: "Magistral Small" },
193
- { id: "mistral/ministral-3b-latest", label: "Ministral 3B (latest)" },
194
- { id: "mistral/ministral-8b-latest", label: "Ministral 8B (latest)" },
195
- { id: "mistral/mistral-large-2411", label: "Mistral Large 2.1" },
196
- { id: "mistral/mistral-large-2512", label: "Mistral Large 3" },
197
- { id: "mistral/mistral-large-latest", label: "Mistral Large (latest)" },
198
- { id: "mistral/mistral-medium-2505", label: "Mistral Medium 3" },
199
- { id: "mistral/mistral-medium-2508", label: "Mistral Medium 3.1" },
200
- { id: "mistral/mistral-medium-2604", label: "Mistral Medium 3.5" },
201
- { id: "mistral/mistral-medium-3.5", label: "Mistral Medium 3.5" },
202
- { id: "mistral/mistral-medium-latest", label: "Mistral Medium (latest)" },
203
- { id: "mistral/mistral-nemo", label: "Mistral Nemo" },
204
- { id: "mistral/mistral-small-2506", label: "Mistral Small 3.2" },
205
- { id: "mistral/mistral-small-2603", label: "Mistral Small 4" },
206
- { id: "mistral/mistral-small-latest", label: "Mistral Small (latest)" },
207
- { id: "mistral/open-mistral-7b", label: "Mistral 7B" },
208
- { id: "mistral/open-mistral-nemo", label: "Open Mistral Nemo" },
209
- { id: "mistral/open-mixtral-8x22b", label: "Mixtral 8x22B" },
210
- { id: "mistral/open-mixtral-8x7b", label: "Mixtral 8x7B" },
211
- { id: "mistral/pixtral-12b", label: "Pixtral 12B" },
212
- { id: "mistral/pixtral-large-latest", label: "Pixtral Large (latest)" }
213
- ],
214
- "fireworks": [
215
- { id: "fireworks/accounts/fireworks/models/kimi-k2p6", label: "Kimi K2.6" },
216
- { id: "fireworks/accounts/fireworks/models/deepseek-v4-flash", label: "DeepSeek V4 Flash" },
217
- { id: "fireworks/accounts/fireworks/models/deepseek-v4-pro", label: "DeepSeek V4 Pro" },
218
- { id: "fireworks/accounts/fireworks/models/glm-5p1", label: "GLM 5.1" },
219
- { id: "fireworks/accounts/fireworks/models/glm-5p2", label: "GLM 5.2" },
220
- { id: "fireworks/accounts/fireworks/models/gpt-oss-120b", label: "GPT OSS 120B" },
221
- { id: "fireworks/accounts/fireworks/models/gpt-oss-20b", label: "GPT OSS 20B" },
222
- { id: "fireworks/accounts/fireworks/models/kimi-k2p7-code", label: "Kimi K2.7 Code" },
223
- { id: "fireworks/accounts/fireworks/models/minimax-m2p7", label: "MiniMax-M2.7" },
224
- { id: "fireworks/accounts/fireworks/models/minimax-m3", label: "MiniMax-M3" },
225
- { id: "fireworks/accounts/fireworks/models/qwen3p7-plus", label: "Qwen 3.7 Plus" },
226
- { id: "fireworks/accounts/fireworks/routers/glm-5p1-fast", label: "GLM 5.1 Fast" },
227
- { id: "fireworks/accounts/fireworks/routers/kimi-k2p6-fast", label: "Kimi K2.6 Fast" },
228
- { id: "fireworks/accounts/fireworks/routers/kimi-k2p6-turbo", label: "Kimi K2.6 Turbo" },
229
- { id: "fireworks/accounts/fireworks/routers/kimi-k2p7-code-fast", label: "Kimi K2.7 Code Fast" }
230
- ],
231
- "together": [
232
- { id: "together/moonshotai/Kimi-K2.6", label: "Kimi K2.6" },
233
- { id: "together/MiniMaxAI/MiniMax-M2.7", label: "MiniMax-M2.7" },
234
- { id: "together/MiniMaxAI/MiniMax-M3", label: "MiniMax-M3" },
235
- { id: "together/Qwen/Qwen2.5-7B-Instruct-Turbo", label: "Qwen 2.5 7B Instruct Turbo" },
236
- { id: "together/Qwen/Qwen3-235B-A22B-Instruct-2507-tput", label: "Qwen3 235B A22B Instruct 2507 FP8" },
237
- { id: "together/Qwen/Qwen3.5-397B-A17B", label: "Qwen3.5 397B A17B" },
238
- { id: "together/Qwen/Qwen3.5-9B", label: "Qwen3.5 9B" },
239
- { id: "together/Qwen/Qwen3.6-Plus", label: "Qwen3.6 Plus" },
240
- { id: "together/Qwen/Qwen3.7-Max", label: "Qwen3.7 Max" },
241
- { id: "together/deepseek-ai/DeepSeek-V4-Pro", label: "DeepSeek V4 Pro" },
242
- { id: "together/essentialai/Rnj-1-Instruct", label: "Rnj-1 Instruct" },
243
- { id: "together/google/gemma-4-31B-it", label: "Gemma 4 31B Instruct" },
244
- { id: "together/meta-llama/Llama-3.3-70B-Instruct-Turbo", label: "Llama 3.3 70B" },
245
- { id: "together/moonshotai/Kimi-K2.7-Code", label: "Kimi K2.7 Code" },
246
- { id: "together/nvidia/nemotron-3-ultra-550b-a55b", label: "Nemotron 3 Ultra 550B A55B" },
247
- { id: "together/openai/gpt-oss-120b", label: "GPT OSS 120B" },
248
- { id: "together/openai/gpt-oss-20b", label: "GPT OSS 20B" },
249
- { id: "together/zai-org/GLM-5", label: "GLM-5" },
250
- { id: "together/zai-org/GLM-5.1", label: "GLM-5.1" }
251
- ],
252
- "openrouter": [
253
- { id: "openrouter/moonshotai/kimi-k2.6", label: "MoonshotAI: Kimi K2.6" },
254
- { id: "openrouter/ai21/jamba-large-1.7", label: "AI21: Jamba Large 1.7" },
255
- { id: "openrouter/amazon/nova-2-lite-v1", label: "Amazon: Nova 2 Lite" },
256
- { id: "openrouter/amazon/nova-lite-v1", label: "Amazon: Nova Lite 1.0" },
257
- { id: "openrouter/amazon/nova-micro-v1", label: "Amazon: Nova Micro 1.0" },
258
- { id: "openrouter/amazon/nova-premier-v1", label: "Amazon: Nova Premier 1.0" },
259
- { id: "openrouter/amazon/nova-pro-v1", label: "Amazon: Nova Pro 1.0" },
260
- { id: "openrouter/anthropic/claude-3-haiku", label: "Anthropic: Claude 3 Haiku" },
261
- { id: "openrouter/anthropic/claude-3.5-haiku", label: "Anthropic: Claude 3.5 Haiku" },
262
- { id: "openrouter/anthropic/claude-fable-5", label: "Anthropic: Claude Fable 5" },
263
- { id: "openrouter/anthropic/claude-haiku-4.5", label: "Anthropic: Claude Haiku 4.5" },
264
- { id: "openrouter/anthropic/claude-opus-4", label: "Anthropic: Claude Opus 4" },
265
- { id: "openrouter/anthropic/claude-opus-4.1", label: "Anthropic: Claude Opus 4.1" },
266
- { id: "openrouter/anthropic/claude-opus-4.5", label: "Anthropic: Claude Opus 4.5" },
267
- { id: "openrouter/anthropic/claude-opus-4.6", label: "Anthropic: Claude Opus 4.6" },
268
- { id: "openrouter/anthropic/claude-opus-4.6-fast", label: "Anthropic: Claude Opus 4.6 (Fast)" },
269
- { id: "openrouter/anthropic/claude-opus-4.7", label: "Anthropic: Claude Opus 4.7" },
270
- { id: "openrouter/anthropic/claude-opus-4.7-fast", label: "Anthropic: Claude Opus 4.7 (Fast)" },
271
- { id: "openrouter/anthropic/claude-opus-4.8", label: "Anthropic: Claude Opus 4.8" },
272
- { id: "openrouter/anthropic/claude-opus-4.8-fast", label: "Anthropic: Claude Opus 4.8 (Fast)" },
273
- { id: "openrouter/anthropic/claude-sonnet-4", label: "Anthropic: Claude Sonnet 4" },
274
- { id: "openrouter/anthropic/claude-sonnet-4.5", label: "Anthropic: Claude Sonnet 4.5" },
275
- { id: "openrouter/anthropic/claude-sonnet-4.6", label: "Anthropic: Claude Sonnet 4.6" },
276
- { id: "openrouter/arcee-ai/trinity-large-thinking", label: "Arcee AI: Trinity Large Thinking" },
277
- { id: "openrouter/arcee-ai/trinity-mini", label: "Arcee AI: Trinity Mini" },
278
- { id: "openrouter/arcee-ai/virtuoso-large", label: "Arcee AI: Virtuoso Large" },
279
- { id: "openrouter/auto", label: "Auto" },
280
- { id: "openrouter/bytedance-seed/seed-1.6", label: "ByteDance Seed: Seed 1.6" },
281
- { id: "openrouter/bytedance-seed/seed-1.6-flash", label: "ByteDance Seed: Seed 1.6 Flash" },
282
- { id: "openrouter/bytedance-seed/seed-2.0-lite", label: "ByteDance Seed: Seed-2.0-Lite" },
283
- { id: "openrouter/bytedance-seed/seed-2.0-mini", label: "ByteDance Seed: Seed-2.0-Mini" },
284
- { id: "openrouter/cohere/command-r-08-2024", label: "Cohere: Command R (08-2024)" },
285
- { id: "openrouter/cohere/command-r-plus-08-2024", label: "Cohere: Command R+ (08-2024)" },
286
- { id: "openrouter/cohere/north-mini-code:free", label: "Cohere: North Mini Code (free)" },
287
- { id: "openrouter/deepseek/deepseek-chat", label: "DeepSeek: DeepSeek V3" },
288
- { id: "openrouter/deepseek/deepseek-chat-v3-0324", label: "DeepSeek: DeepSeek V3 0324" },
289
- { id: "openrouter/deepseek/deepseek-chat-v3.1", label: "DeepSeek: DeepSeek V3.1" },
290
- { id: "openrouter/deepseek/deepseek-r1", label: "DeepSeek: R1" },
291
- { id: "openrouter/deepseek/deepseek-r1-0528", label: "DeepSeek: R1 0528" },
292
- { id: "openrouter/deepseek/deepseek-v3.1-terminus", label: "DeepSeek: DeepSeek V3.1 Terminus" },
293
- { id: "openrouter/deepseek/deepseek-v3.2", label: "DeepSeek: DeepSeek V3.2" },
294
- { id: "openrouter/deepseek/deepseek-v3.2-exp", label: "DeepSeek: DeepSeek V3.2 Exp" },
295
- { id: "openrouter/deepseek/deepseek-v4-flash", label: "DeepSeek: DeepSeek V4 Flash" },
296
- { id: "openrouter/deepseek/deepseek-v4-pro", label: "DeepSeek: DeepSeek V4 Pro" },
297
- { id: "openrouter/essentialai/rnj-1-instruct", label: "EssentialAI: Rnj 1 Instruct" },
298
- { id: "openrouter/google/gemini-2.5-flash", label: "Google: Gemini 2.5 Flash" },
299
- { id: "openrouter/google/gemini-2.5-flash-lite", label: "Google: Gemini 2.5 Flash Lite" },
300
- { id: "openrouter/google/gemini-2.5-flash-lite-preview-09-2025", label: "Google: Gemini 2.5 Flash Lite Preview 09-2025" },
301
- { id: "openrouter/google/gemini-2.5-pro", label: "Google: Gemini 2.5 Pro" },
302
- { id: "openrouter/google/gemini-2.5-pro-preview", label: "Google: Gemini 2.5 Pro Preview 06-05" },
303
- { id: "openrouter/google/gemini-2.5-pro-preview-05-06", label: "Google: Gemini 2.5 Pro Preview 05-06" },
304
- { id: "openrouter/google/gemini-3-flash-preview", label: "Google: Gemini 3 Flash Preview" },
305
- { id: "openrouter/google/gemini-3-pro-image", label: "Google: Nano Banana Pro (Gemini 3 Pro Image)" },
306
- { id: "openrouter/google/gemini-3.1-flash-lite", label: "Google: Gemini 3.1 Flash Lite" },
307
- { id: "openrouter/google/gemini-3.1-flash-lite-preview", label: "Google: Gemini 3.1 Flash Lite Preview" },
308
- { id: "openrouter/google/gemini-3.1-pro-preview", label: "Google: Gemini 3.1 Pro Preview" },
309
- { id: "openrouter/google/gemini-3.1-pro-preview-customtools", label: "Google: Gemini 3.1 Pro Preview Custom Tools" },
310
- { id: "openrouter/google/gemini-3.5-flash", label: "Google: Gemini 3.5 Flash" },
311
- { id: "openrouter/google/gemma-3-12b-it", label: "Google: Gemma 3 12B" },
312
- { id: "openrouter/google/gemma-3-27b-it", label: "Google: Gemma 3 27B" },
313
- { id: "openrouter/google/gemma-4-26b-a4b-it", label: "Google: Gemma 4 26B A4B " },
314
- { id: "openrouter/google/gemma-4-26b-a4b-it:free", label: "Google: Gemma 4 26B A4B (free)" },
315
- { id: "openrouter/google/gemma-4-31b-it", label: "Google: Gemma 4 31B" },
316
- { id: "openrouter/google/gemma-4-31b-it:free", label: "Google: Gemma 4 31B (free)" },
317
- { id: "openrouter/ibm-granite/granite-4.1-8b", label: "IBM: Granite 4.1 8B" },
318
- { id: "openrouter/inception/mercury-2", label: "Inception: Mercury 2" },
319
- { id: "openrouter/inclusionai/ling-2.6-1t", label: "inclusionAI: Ling-2.6-1T" },
320
- { id: "openrouter/inclusionai/ling-2.6-flash", label: "inclusionAI: Ling-2.6-flash" },
321
- { id: "openrouter/inclusionai/ring-2.6-1t", label: "inclusionAI: Ring-2.6-1T" },
322
- { id: "openrouter/kwaipilot/kat-coder-pro-v2", label: "Kwaipilot: KAT-Coder-Pro V2" },
323
- { id: "openrouter/liquid/lfm-2.5-1.2b-thinking:free", label: "LiquidAI: LFM2.5-1.2B-Thinking (free)" },
324
- { id: "openrouter/meta-llama/llama-3.1-70b-instruct", label: "Meta: Llama 3.1 70B Instruct" },
325
- { id: "openrouter/meta-llama/llama-3.1-8b-instruct", label: "Meta: Llama 3.1 8B Instruct" },
326
- { id: "openrouter/meta-llama/llama-3.3-70b-instruct", label: "Meta: Llama 3.3 70B Instruct" },
327
- { id: "openrouter/meta-llama/llama-3.3-70b-instruct:free", label: "Meta: Llama 3.3 70B Instruct (free)" },
328
- { id: "openrouter/meta-llama/llama-4-maverick", label: "Meta: Llama 4 Maverick" },
329
- { id: "openrouter/meta-llama/llama-4-scout", label: "Meta: Llama 4 Scout" },
330
- { id: "openrouter/minimax/minimax-m1", label: "MiniMax: MiniMax M1" },
331
- { id: "openrouter/minimax/minimax-m2", label: "MiniMax: MiniMax M2" },
332
- { id: "openrouter/minimax/minimax-m2.1", label: "MiniMax: MiniMax M2.1" },
333
- { id: "openrouter/minimax/minimax-m2.5", label: "MiniMax: MiniMax M2.5" },
334
- { id: "openrouter/minimax/minimax-m2.7", label: "MiniMax: MiniMax M2.7" },
335
- { id: "openrouter/minimax/minimax-m3", label: "MiniMax: MiniMax M3" },
336
- { id: "openrouter/mistralai/codestral-2508", label: "Mistral: Codestral 2508" },
337
- { id: "openrouter/mistralai/devstral-2512", label: "Mistral: Devstral 2 2512" },
338
- { id: "openrouter/mistralai/ministral-14b-2512", label: "Mistral: Ministral 3 14B 2512" },
339
- { id: "openrouter/mistralai/ministral-3b-2512", label: "Mistral: Ministral 3 3B 2512" },
340
- { id: "openrouter/mistralai/ministral-8b-2512", label: "Mistral: Ministral 3 8B 2512" },
341
- { id: "openrouter/mistralai/mistral-large", label: "Mistral Large" },
342
- { id: "openrouter/mistralai/mistral-large-2407", label: "Mistral Large 2407" },
343
- { id: "openrouter/mistralai/mistral-large-2512", label: "Mistral: Mistral Large 3 2512" },
344
- { id: "openrouter/mistralai/mistral-medium-3", label: "Mistral: Mistral Medium 3" },
345
- { id: "openrouter/mistralai/mistral-medium-3-5", label: "Mistral: Mistral Medium 3.5" },
346
- { id: "openrouter/mistralai/mistral-medium-3.1", label: "Mistral: Mistral Medium 3.1" },
347
- { id: "openrouter/mistralai/mistral-nemo", label: "Mistral: Mistral Nemo" },
348
- { id: "openrouter/mistralai/mistral-saba", label: "Mistral: Saba" },
349
- { id: "openrouter/mistralai/mistral-small-2603", label: "Mistral: Mistral Small 4" },
350
- { id: "openrouter/mistralai/mistral-small-3.2-24b-instruct", label: "Mistral: Mistral Small 3.2 24B" },
351
- { id: "openrouter/mistralai/mixtral-8x22b-instruct", label: "Mistral: Mixtral 8x22B Instruct" },
352
- { id: "openrouter/mistralai/voxtral-small-24b-2507", label: "Mistral: Voxtral Small 24B 2507" },
353
- { id: "openrouter/moonshotai/kimi-k2", label: "MoonshotAI: Kimi K2 0711" },
354
- { id: "openrouter/moonshotai/kimi-k2-0905", label: "MoonshotAI: Kimi K2 0905" },
355
- { id: "openrouter/moonshotai/kimi-k2-thinking", label: "MoonshotAI: Kimi K2 Thinking" },
356
- { id: "openrouter/moonshotai/kimi-k2.5", label: "MoonshotAI: Kimi K2.5" },
357
- { id: "openrouter/moonshotai/kimi-k2.7-code", label: "MoonshotAI: Kimi K2.7 Code" },
358
- { id: "openrouter/nex-agi/nex-n2-pro:free", label: "Nex AGI: Nex-N2-Pro (free)" },
359
- { id: "openrouter/nvidia/llama-3.3-nemotron-super-49b-v1.5", label: "NVIDIA: Llama 3.3 Nemotron Super 49B V1.5" },
360
- { id: "openrouter/nvidia/nemotron-3-nano-30b-a3b", label: "NVIDIA: Nemotron 3 Nano 30B A3B" },
361
- { id: "openrouter/nvidia/nemotron-3-nano-30b-a3b:free", label: "NVIDIA: Nemotron 3 Nano 30B A3B (free)" },
362
- { id: "openrouter/nvidia/nemotron-3-nano-omni-30b-a3b-reasoning:free", label: "NVIDIA: Nemotron 3 Nano Omni (free)" },
363
- { id: "openrouter/nvidia/nemotron-3-super-120b-a12b", label: "NVIDIA: Nemotron 3 Super" },
364
- { id: "openrouter/nvidia/nemotron-3-super-120b-a12b:free", label: "NVIDIA: Nemotron 3 Super (free)" },
365
- { id: "openrouter/nvidia/nemotron-3-ultra-550b-a55b", label: "NVIDIA: Nemotron 3 Ultra" },
366
- { id: "openrouter/nvidia/nemotron-3-ultra-550b-a55b:free", label: "NVIDIA: Nemotron 3 Ultra (free)" },
367
- { id: "openrouter/nvidia/nemotron-nano-12b-v2-vl:free", label: "NVIDIA: Nemotron Nano 12B 2 VL (free)" },
368
- { id: "openrouter/nvidia/nemotron-nano-9b-v2:free", label: "NVIDIA: Nemotron Nano 9B V2 (free)" },
369
- { id: "openrouter/openai/gpt-3.5-turbo", label: "OpenAI: GPT-3.5 Turbo" },
370
- { id: "openrouter/openai/gpt-3.5-turbo-0613", label: "OpenAI: GPT-3.5 Turbo (older v0613)" },
371
- { id: "openrouter/openai/gpt-3.5-turbo-16k", label: "OpenAI: GPT-3.5 Turbo 16k" },
372
- { id: "openrouter/openai/gpt-4", label: "OpenAI: GPT-4" },
373
- { id: "openrouter/openai/gpt-4-turbo", label: "OpenAI: GPT-4 Turbo" },
374
- { id: "openrouter/openai/gpt-4-turbo-preview", label: "OpenAI: GPT-4 Turbo Preview" },
375
- { id: "openrouter/openai/gpt-4.1", label: "OpenAI: GPT-4.1" },
376
- { id: "openrouter/openai/gpt-4.1-mini", label: "OpenAI: GPT-4.1 Mini" },
377
- { id: "openrouter/openai/gpt-4.1-nano", label: "OpenAI: GPT-4.1 Nano" },
378
- { id: "openrouter/openai/gpt-4o", label: "OpenAI: GPT-4o" },
379
- { id: "openrouter/openai/gpt-4o-2024-05-13", label: "OpenAI: GPT-4o (2024-05-13)" },
380
- { id: "openrouter/openai/gpt-4o-2024-08-06", label: "OpenAI: GPT-4o (2024-08-06)" },
381
- { id: "openrouter/openai/gpt-4o-2024-11-20", label: "OpenAI: GPT-4o (2024-11-20)" },
382
- { id: "openrouter/openai/gpt-4o-mini", label: "OpenAI: GPT-4o-mini" },
383
- { id: "openrouter/openai/gpt-4o-mini-2024-07-18", label: "OpenAI: GPT-4o-mini (2024-07-18)" },
384
- { id: "openrouter/openai/gpt-5", label: "OpenAI: GPT-5" },
385
- { id: "openrouter/openai/gpt-5-codex", label: "OpenAI: GPT-5 Codex" },
386
- { id: "openrouter/openai/gpt-5-mini", label: "OpenAI: GPT-5 Mini" },
387
- { id: "openrouter/openai/gpt-5-nano", label: "OpenAI: GPT-5 Nano" },
388
- { id: "openrouter/openai/gpt-5-pro", label: "OpenAI: GPT-5 Pro" },
389
- { id: "openrouter/openai/gpt-5.1", label: "OpenAI: GPT-5.1" },
390
- { id: "openrouter/openai/gpt-5.1-chat", label: "OpenAI: GPT-5.1 Chat" },
391
- { id: "openrouter/openai/gpt-5.1-codex", label: "OpenAI: GPT-5.1-Codex" },
392
- { id: "openrouter/openai/gpt-5.1-codex-max", label: "OpenAI: GPT-5.1-Codex-Max" },
393
- { id: "openrouter/openai/gpt-5.1-codex-mini", label: "OpenAI: GPT-5.1-Codex-Mini" },
394
- { id: "openrouter/openai/gpt-5.2", label: "OpenAI: GPT-5.2" },
395
- { id: "openrouter/openai/gpt-5.2-chat", label: "OpenAI: GPT-5.2 Chat" },
396
- { id: "openrouter/openai/gpt-5.2-codex", label: "OpenAI: GPT-5.2-Codex" },
397
- { id: "openrouter/openai/gpt-5.2-pro", label: "OpenAI: GPT-5.2 Pro" },
398
- { id: "openrouter/openai/gpt-5.3-chat", label: "OpenAI: GPT-5.3 Chat" },
399
- { id: "openrouter/openai/gpt-5.3-codex", label: "OpenAI: GPT-5.3-Codex" },
400
- { id: "openrouter/openai/gpt-5.4", label: "OpenAI: GPT-5.4" },
401
- { id: "openrouter/openai/gpt-5.4-mini", label: "OpenAI: GPT-5.4 Mini" },
402
- { id: "openrouter/openai/gpt-5.4-nano", label: "OpenAI: GPT-5.4 Nano" },
403
- { id: "openrouter/openai/gpt-5.4-pro", label: "OpenAI: GPT-5.4 Pro" },
404
- { id: "openrouter/openai/gpt-5.5", label: "OpenAI: GPT-5.5" },
405
- { id: "openrouter/openai/gpt-5.5-pro", label: "OpenAI: GPT-5.5 Pro" },
406
- { id: "openrouter/openai/gpt-audio", label: "OpenAI: GPT Audio" },
407
- { id: "openrouter/openai/gpt-audio-mini", label: "OpenAI: GPT Audio Mini" },
408
- { id: "openrouter/openai/gpt-chat-latest", label: "OpenAI: GPT Chat Latest" },
409
- { id: "openrouter/openai/gpt-oss-120b", label: "OpenAI: gpt-oss-120b" },
410
- { id: "openrouter/openai/gpt-oss-120b:free", label: "OpenAI: gpt-oss-120b (free)" },
411
- { id: "openrouter/openai/gpt-oss-20b", label: "OpenAI: gpt-oss-20b" },
412
- { id: "openrouter/openai/gpt-oss-20b:free", label: "OpenAI: gpt-oss-20b (free)" },
413
- { id: "openrouter/openai/gpt-oss-safeguard-20b", label: "OpenAI: gpt-oss-safeguard-20b" },
414
- { id: "openrouter/openai/o1", label: "OpenAI: o1" },
415
- { id: "openrouter/openai/o3", label: "OpenAI: o3" },
416
- { id: "openrouter/openai/o3-deep-research", label: "OpenAI: o3 Deep Research" },
417
- { id: "openrouter/openai/o3-mini", label: "OpenAI: o3 Mini" },
418
- { id: "openrouter/openai/o3-mini-high", label: "OpenAI: o3 Mini High" },
419
- { id: "openrouter/openai/o3-pro", label: "OpenAI: o3 Pro" },
420
- { id: "openrouter/openai/o4-mini", label: "OpenAI: o4 Mini" },
421
- { id: "openrouter/openai/o4-mini-deep-research", label: "OpenAI: o4 Mini Deep Research" },
422
- { id: "openrouter/openai/o4-mini-high", label: "OpenAI: o4 Mini High" },
423
- { id: "openrouter/openrouter/auto", label: "Auto Router" },
424
- { id: "openrouter/openrouter/free", label: "Free Models Router" },
425
- { id: "openrouter/openrouter/fusion", label: "OpenRouter: Fusion" },
426
- { id: "openrouter/openrouter/owl-alpha", label: "Owl Alpha" },
427
- { id: "openrouter/poolside/laguna-m.1", label: "Poolside: Laguna M.1" },
428
- { id: "openrouter/poolside/laguna-m.1:free", label: "Poolside: Laguna M.1 (free)" },
429
- { id: "openrouter/poolside/laguna-xs.2", label: "Poolside: Laguna XS.2" },
430
- { id: "openrouter/poolside/laguna-xs.2:free", label: "Poolside: Laguna XS.2 (free)" },
431
- { id: "openrouter/prime-intellect/intellect-3", label: "Prime Intellect: INTELLECT-3" },
432
- { id: "openrouter/qwen/qwen-2.5-72b-instruct", label: "Qwen2.5 72B Instruct" },
433
- { id: "openrouter/qwen/qwen-2.5-7b-instruct", label: "Qwen: Qwen2.5 7B Instruct" },
434
- { id: "openrouter/qwen/qwen-plus", label: "Qwen: Qwen-Plus" },
435
- { id: "openrouter/qwen/qwen-plus-2025-07-28", label: "Qwen: Qwen Plus 0728" },
436
- { id: "openrouter/qwen/qwen-plus-2025-07-28:thinking", label: "Qwen: Qwen Plus 0728 (thinking)" },
437
- { id: "openrouter/qwen/qwen3-14b", label: "Qwen: Qwen3 14B" },
438
- { id: "openrouter/qwen/qwen3-235b-a22b", label: "Qwen: Qwen3 235B A22B" },
439
- { id: "openrouter/qwen/qwen3-235b-a22b-2507", label: "Qwen: Qwen3 235B A22B Instruct 2507" },
440
- { id: "openrouter/qwen/qwen3-235b-a22b-thinking-2507", label: "Qwen: Qwen3 235B A22B Thinking 2507" },
441
- { id: "openrouter/qwen/qwen3-30b-a3b", label: "Qwen: Qwen3 30B A3B" },
442
- { id: "openrouter/qwen/qwen3-30b-a3b-instruct-2507", label: "Qwen: Qwen3 30B A3B Instruct 2507" },
443
- { id: "openrouter/qwen/qwen3-30b-a3b-thinking-2507", label: "Qwen: Qwen3 30B A3B Thinking 2507" },
444
- { id: "openrouter/qwen/qwen3-32b", label: "Qwen: Qwen3 32B" },
445
- { id: "openrouter/qwen/qwen3-8b", label: "Qwen: Qwen3 8B" },
446
- { id: "openrouter/qwen/qwen3-coder", label: "Qwen: Qwen3 Coder 480B A35B" },
447
- { id: "openrouter/qwen/qwen3-coder-30b-a3b-instruct", label: "Qwen: Qwen3 Coder 30B A3B Instruct" },
448
- { id: "openrouter/qwen/qwen3-coder-flash", label: "Qwen: Qwen3 Coder Flash" },
449
- { id: "openrouter/qwen/qwen3-coder-next", label: "Qwen: Qwen3 Coder Next" },
450
- { id: "openrouter/qwen/qwen3-coder-plus", label: "Qwen: Qwen3 Coder Plus" },
451
- { id: "openrouter/qwen/qwen3-coder:free", label: "Qwen: Qwen3 Coder 480B A35B (free)" },
452
- { id: "openrouter/qwen/qwen3-max", label: "Qwen: Qwen3 Max" },
453
- { id: "openrouter/qwen/qwen3-max-thinking", label: "Qwen: Qwen3 Max Thinking" },
454
- { id: "openrouter/qwen/qwen3-next-80b-a3b-instruct", label: "Qwen: Qwen3 Next 80B A3B Instruct" },
455
- { id: "openrouter/qwen/qwen3-next-80b-a3b-instruct:free", label: "Qwen: Qwen3 Next 80B A3B Instruct (free)" },
456
- { id: "openrouter/qwen/qwen3-next-80b-a3b-thinking", label: "Qwen: Qwen3 Next 80B A3B Thinking" },
457
- { id: "openrouter/qwen/qwen3-vl-235b-a22b-instruct", label: "Qwen: Qwen3 VL 235B A22B Instruct" },
458
- { id: "openrouter/qwen/qwen3-vl-235b-a22b-thinking", label: "Qwen: Qwen3 VL 235B A22B Thinking" },
459
- { id: "openrouter/qwen/qwen3-vl-30b-a3b-instruct", label: "Qwen: Qwen3 VL 30B A3B Instruct" },
460
- { id: "openrouter/qwen/qwen3-vl-30b-a3b-thinking", label: "Qwen: Qwen3 VL 30B A3B Thinking" },
461
- { id: "openrouter/qwen/qwen3-vl-32b-instruct", label: "Qwen: Qwen3 VL 32B Instruct" },
462
- { id: "openrouter/qwen/qwen3-vl-8b-instruct", label: "Qwen: Qwen3 VL 8B Instruct" },
463
- { id: "openrouter/qwen/qwen3-vl-8b-thinking", label: "Qwen: Qwen3 VL 8B Thinking" },
464
- { id: "openrouter/qwen/qwen3.5-122b-a10b", label: "Qwen: Qwen3.5-122B-A10B" },
465
- { id: "openrouter/qwen/qwen3.5-27b", label: "Qwen: Qwen3.5-27B" },
466
- { id: "openrouter/qwen/qwen3.5-35b-a3b", label: "Qwen: Qwen3.5-35B-A3B" },
467
- { id: "openrouter/qwen/qwen3.5-397b-a17b", label: "Qwen: Qwen3.5 397B A17B" },
468
- { id: "openrouter/qwen/qwen3.5-9b", label: "Qwen: Qwen3.5-9B" },
469
- { id: "openrouter/qwen/qwen3.5-flash-02-23", label: "Qwen: Qwen3.5-Flash" },
470
- { id: "openrouter/qwen/qwen3.5-plus-02-15", label: "Qwen: Qwen3.5 Plus 2026-02-15" },
471
- { id: "openrouter/qwen/qwen3.5-plus-20260420", label: "Qwen: Qwen3.5 Plus 2026-04-20" },
472
- { id: "openrouter/qwen/qwen3.6-27b", label: "Qwen: Qwen3.6 27B" },
473
- { id: "openrouter/qwen/qwen3.6-35b-a3b", label: "Qwen: Qwen3.6 35B A3B" },
474
- { id: "openrouter/qwen/qwen3.6-flash", label: "Qwen: Qwen3.6 Flash" },
475
- { id: "openrouter/qwen/qwen3.6-max-preview", label: "Qwen: Qwen3.6 Max Preview" },
476
- { id: "openrouter/qwen/qwen3.6-plus", label: "Qwen: Qwen3.6 Plus" },
477
- { id: "openrouter/qwen/qwen3.7-max", label: "Qwen: Qwen3.7 Max" },
478
- { id: "openrouter/qwen/qwen3.7-plus", label: "Qwen: Qwen3.7 Plus" },
479
- { id: "openrouter/rekaai/reka-edge", label: "Reka Edge" },
480
- { id: "openrouter/relace/relace-search", label: "Relace: Relace Search" },
481
- { id: "openrouter/sao10k/l3.1-euryale-70b", label: "Sao10K: Llama 3.1 Euryale 70B v2.2" },
482
- { id: "openrouter/stepfun/step-3.5-flash", label: "StepFun: Step 3.5 Flash" },
483
- { id: "openrouter/stepfun/step-3.7-flash", label: "StepFun: Step 3.7 Flash" },
484
- { id: "openrouter/tencent/hy3-preview", label: "Tencent: Hy3 preview" },
485
- { id: "openrouter/thedrummer/rocinante-12b", label: "TheDrummer: Rocinante 12B" },
486
- { id: "openrouter/thedrummer/unslopnemo-12b", label: "TheDrummer: UnslopNemo 12B" },
487
- { id: "openrouter/upstage/solar-pro-3", label: "Upstage: Solar Pro 3" },
488
- { id: "openrouter/x-ai/grok-4.20", label: "xAI: Grok 4.20" },
489
- { id: "openrouter/x-ai/grok-4.3", label: "xAI: Grok 4.3" },
490
- { id: "openrouter/x-ai/grok-build-0.1", label: "xAI: Grok Build 0.1" },
491
- { id: "openrouter/xiaomi/mimo-v2.5", label: "Xiaomi: MiMo-V2.5" },
492
- { id: "openrouter/xiaomi/mimo-v2.5-pro", label: "Xiaomi: MiMo-V2.5-Pro" },
493
- { id: "openrouter/z-ai/glm-4.5", label: "Z.ai: GLM 4.5" },
494
- { id: "openrouter/z-ai/glm-4.5-air", label: "Z.ai: GLM 4.5 Air" },
495
- { id: "openrouter/z-ai/glm-4.5v", label: "Z.ai: GLM 4.5V" },
496
- { id: "openrouter/z-ai/glm-4.6", label: "Z.ai: GLM 4.6" },
497
- { id: "openrouter/z-ai/glm-4.6v", label: "Z.ai: GLM 4.6V" },
498
- { id: "openrouter/z-ai/glm-4.7", label: "Z.ai: GLM 4.7" },
499
- { id: "openrouter/z-ai/glm-4.7-flash", label: "Z.ai: GLM 4.7 Flash" },
500
- { id: "openrouter/z-ai/glm-5", label: "Z.ai: GLM 5" },
501
- { id: "openrouter/z-ai/glm-5-turbo", label: "Z.ai: GLM 5 Turbo" },
502
- { id: "openrouter/z-ai/glm-5.1", label: "Z.ai: GLM 5.1" },
503
- { id: "openrouter/z-ai/glm-5.2", label: "Z.ai: GLM 5.2" },
504
- { id: "openrouter/~anthropic/claude-fable-latest", label: "Anthropic: Claude Fable Latest" },
505
- { id: "openrouter/~anthropic/claude-haiku-latest", label: "Anthropic Claude Haiku Latest" },
506
- { id: "openrouter/~anthropic/claude-opus-latest", label: "Anthropic: Claude Opus Latest" },
507
- { id: "openrouter/~anthropic/claude-sonnet-latest", label: "Anthropic Claude Sonnet Latest" },
508
- { id: "openrouter/~google/gemini-flash-latest", label: "Google Gemini Flash Latest" },
509
- { id: "openrouter/~google/gemini-pro-latest", label: "Google Gemini Pro Latest" },
510
- { id: "openrouter/~moonshotai/kimi-latest", label: "MoonshotAI Kimi Latest" },
511
- { id: "openrouter/~openai/gpt-latest", label: "OpenAI GPT Latest" },
512
- { id: "openrouter/~openai/gpt-mini-latest", label: "OpenAI GPT Mini Latest" }
513
- ],
514
- "openai-compatible": [
515
- { id: "openai-compatible/gpt-5.4", label: "GPT-5.4" },
516
- { id: "openai-compatible/gpt-4", label: "GPT-4" },
517
- { id: "openai-compatible/gpt-4-turbo", label: "GPT-4 Turbo" },
518
- { id: "openai-compatible/gpt-4.1", label: "GPT-4.1" },
519
- { id: "openai-compatible/gpt-4.1-mini", label: "GPT-4.1 mini" },
520
- { id: "openai-compatible/gpt-4.1-nano", label: "GPT-4.1 nano" },
521
- { id: "openai-compatible/gpt-4o", label: "GPT-4o" },
522
- { id: "openai-compatible/gpt-4o-2024-05-13", label: "GPT-4o (2024-05-13)" },
523
- { id: "openai-compatible/gpt-4o-2024-08-06", label: "GPT-4o (2024-08-06)" },
524
- { id: "openai-compatible/gpt-4o-2024-11-20", label: "GPT-4o (2024-11-20)" },
525
- { id: "openai-compatible/gpt-4o-mini", label: "GPT-4o mini" },
526
- { id: "openai-compatible/gpt-5", label: "GPT-5" },
527
- { id: "openai-compatible/gpt-5-chat-latest", label: "GPT-5 Chat Latest" },
528
- { id: "openai-compatible/gpt-5-codex", label: "GPT-5-Codex" },
529
- { id: "openai-compatible/gpt-5-mini", label: "GPT-5 Mini" },
530
- { id: "openai-compatible/gpt-5-nano", label: "GPT-5 Nano" },
531
- { id: "openai-compatible/gpt-5-pro", label: "GPT-5 Pro" },
532
- { id: "openai-compatible/gpt-5.1", label: "GPT-5.1" },
533
- { id: "openai-compatible/gpt-5.1-chat-latest", label: "GPT-5.1 Chat" },
534
- { id: "openai-compatible/gpt-5.1-codex", label: "GPT-5.1 Codex" },
535
- { id: "openai-compatible/gpt-5.1-codex-max", label: "GPT-5.1 Codex Max" },
536
- { id: "openai-compatible/gpt-5.1-codex-mini", label: "GPT-5.1 Codex mini" },
537
- { id: "openai-compatible/gpt-5.2", label: "GPT-5.2" },
538
- { id: "openai-compatible/gpt-5.2-chat-latest", label: "GPT-5.2 Chat" },
539
- { id: "openai-compatible/gpt-5.2-codex", label: "GPT-5.2 Codex" },
540
- { id: "openai-compatible/gpt-5.2-pro", label: "GPT-5.2 Pro" },
541
- { id: "openai-compatible/gpt-5.3-chat-latest", label: "GPT-5.3 Chat (latest)" },
542
- { id: "openai-compatible/gpt-5.3-codex", label: "GPT-5.3 Codex" },
543
- { id: "openai-compatible/gpt-5.3-codex-spark", label: "GPT-5.3 Codex Spark" },
544
- { id: "openai-compatible/gpt-5.4-mini", label: "GPT-5.4 mini" },
545
- { id: "openai-compatible/gpt-5.4-nano", label: "GPT-5.4 nano" },
546
- { id: "openai-compatible/gpt-5.4-pro", label: "GPT-5.4 Pro" },
547
- { id: "openai-compatible/gpt-5.5", label: "GPT-5.5" },
548
- { id: "openai-compatible/gpt-5.5-pro", label: "GPT-5.5 Pro" },
549
- { id: "openai-compatible/o1", label: "o1" },
550
- { id: "openai-compatible/o1-pro", label: "o1-pro" },
551
- { id: "openai-compatible/o3", label: "o3" },
552
- { id: "openai-compatible/o3-deep-research", label: "o3-deep-research" },
553
- { id: "openai-compatible/o3-mini", label: "o3-mini" },
554
- { id: "openai-compatible/o3-pro", label: "o3-pro" },
555
- { id: "openai-compatible/o4-mini", label: "o4-mini" },
556
- { id: "openai-compatible/o4-mini-deep-research", label: "o4-mini-deep-research" }
557
- ],
558
- "anthropic-compatible": [
559
- { id: "anthropic-compatible/claude-opus-4-8", label: "Claude Opus 4.8" },
560
- { id: "anthropic-compatible/claude-3-5-haiku-20241022", label: "Claude Haiku 3.5" },
561
- { id: "anthropic-compatible/claude-3-5-haiku-latest", label: "Claude Haiku 3.5 (latest)" },
562
- { id: "anthropic-compatible/claude-3-5-sonnet-20240620", label: "Claude Sonnet 3.5" },
563
- { id: "anthropic-compatible/claude-3-5-sonnet-20241022", label: "Claude Sonnet 3.5 v2" },
564
- { id: "anthropic-compatible/claude-3-7-sonnet-20250219", label: "Claude Sonnet 3.7" },
565
- { id: "anthropic-compatible/claude-3-haiku-20240307", label: "Claude Haiku 3" },
566
- { id: "anthropic-compatible/claude-3-opus-20240229", label: "Claude Opus 3" },
567
- { id: "anthropic-compatible/claude-3-sonnet-20240229", label: "Claude Sonnet 3" },
568
- { id: "anthropic-compatible/claude-fable-5", label: "Claude Fable 5" },
569
- { id: "anthropic-compatible/claude-haiku-4-5", label: "Claude Haiku 4.5 (latest)" },
570
- { id: "anthropic-compatible/claude-haiku-4-5-20251001", label: "Claude Haiku 4.5" },
571
- { id: "anthropic-compatible/claude-opus-4-0", label: "Claude Opus 4 (latest)" },
572
- { id: "anthropic-compatible/claude-opus-4-1", label: "Claude Opus 4.1 (latest)" },
573
- { id: "anthropic-compatible/claude-opus-4-1-20250805", label: "Claude Opus 4.1" },
574
- { id: "anthropic-compatible/claude-opus-4-20250514", label: "Claude Opus 4" },
575
- { id: "anthropic-compatible/claude-opus-4-5", label: "Claude Opus 4.5 (latest)" },
576
- { id: "anthropic-compatible/claude-opus-4-5-20251101", label: "Claude Opus 4.5" },
577
- { id: "anthropic-compatible/claude-opus-4-6", label: "Claude Opus 4.6" },
578
- { id: "anthropic-compatible/claude-opus-4-7", label: "Claude Opus 4.7" },
579
- { id: "anthropic-compatible/claude-sonnet-4-0", label: "Claude Sonnet 4 (latest)" },
580
- { id: "anthropic-compatible/claude-sonnet-4-20250514", label: "Claude Sonnet 4" },
581
- { id: "anthropic-compatible/claude-sonnet-4-5", label: "Claude Sonnet 4.5 (latest)" },
582
- { id: "anthropic-compatible/claude-sonnet-4-5-20250929", label: "Claude Sonnet 4.5" },
583
- { id: "anthropic-compatible/claude-sonnet-4-6", label: "Claude Sonnet 4.6" }
584
- ]
585
- };
586
-
587
14
  // ../shared/src/generated/runtimeProviderDisplayNames.ts
588
15
  var RUNTIME_PROVIDER_DISPLAY_NAMES = {
589
16
  "anthropic": "Anthropic",
@@ -1723,11 +1150,15 @@ function formatAgentInboxDelta(rows, options = {}) {
1723
1150
  function formatAgentInboxRowDetails(row) {
1724
1151
  const parts = [`pending: ${row.pendingCount} message${row.pendingCount === 1 ? "" : "s"}`];
1725
1152
  if (row.firstPendingMsgId) parts.push(`first msg=${shortMessageId(row.firstPendingMsgId)}`);
1726
- if (row.latestSenderName) parts.push(`latest @${row.latestSenderName}`);
1153
+ if (row.latestSenderName) parts.push(`latest sender @${row.latestSenderName}`);
1727
1154
  if (row.latestMsgId) parts.push(`latest msg=${shortMessageId(row.latestMsgId)}`);
1728
- parts.push(...row.flags);
1155
+ parts.push(...row.flags.map(formatAgentInboxFlag));
1729
1156
  return parts.join(" \xB7 ");
1730
1157
  }
1158
+ function formatAgentInboxFlag(flag) {
1159
+ if (flag === "mention") return "you were mentioned";
1160
+ return flag;
1161
+ }
1731
1162
  function shortMessageId(value) {
1732
1163
  return value.slice(0, 8);
1733
1164
  }
@@ -1952,59 +1383,9 @@ var SERVER_CAPABILITY_MATRIX = {
1952
1383
 
1953
1384
  // ../shared/src/index.ts
1954
1385
  var RUNTIME_CONFIG_VERSION = 1;
1955
- var EMBEDDED_PI_RUNTIME_ID = "embedded-pi";
1956
- var PI_RUNTIME_ID = "pi";
1957
1386
  var PI_BUILTIN_PROVIDER_ENV_KEYS = {
1958
- deepseek: "DEEPSEEK_API_KEY",
1959
- minimax: "MINIMAX_API_KEY",
1960
- "minimax-cn": "MINIMAX_CN_API_KEY",
1961
- zai: "ZAI_API_KEY",
1962
- "zai-coding-cn": "ZAI_CODING_CN_API_KEY",
1963
- "kimi-coding": "KIMI_API_KEY",
1964
- "moonshotai-cn": "MOONSHOT_API_KEY",
1965
- moonshotai: "MOONSHOT_API_KEY",
1966
- openai: "OPENAI_API_KEY",
1967
- anthropic: "ANTHROPIC_API_KEY",
1968
- google: "GEMINI_API_KEY",
1969
- xai: "XAI_API_KEY",
1970
- groq: "GROQ_API_KEY",
1971
- mistral: "MISTRAL_API_KEY",
1972
- fireworks: "FIREWORKS_API_KEY",
1973
- together: "TOGETHER_API_KEY",
1974
- openrouter: "OPENROUTER_API_KEY",
1975
- "openai-compatible": "OPENAI_COMPATIBLE_API_KEY",
1976
- "anthropic-compatible": "ANTHROPIC_COMPATIBLE_API_KEY"
1977
- };
1978
- var PI_BUILTIN_PROVIDER_API_KEY_REQUIRED = {
1979
- deepseek: false,
1980
- minimax: true,
1981
- "minimax-cn": true,
1982
- zai: false,
1983
- "zai-coding-cn": true,
1984
- "kimi-coding": true,
1985
- "moonshotai-cn": true,
1986
- moonshotai: true,
1987
- openai: true,
1988
- anthropic: true,
1989
- google: true,
1990
- xai: true,
1991
- groq: true,
1992
- mistral: true,
1993
- fireworks: true,
1994
- together: true,
1995
- openrouter: true,
1996
- "openai-compatible": true,
1997
- "anthropic-compatible": true
1998
- };
1999
- var PI_BUILTIN_PROVIDER_API_URL_REQUIRED = {
2000
- "openai-compatible": true,
2001
- "anthropic-compatible": true
2002
- };
2003
- var PI_BUILTIN_PROVIDER_CUSTOM_MODEL_SUPPORTED = {
2004
- "openai-compatible": true,
2005
- "anthropic-compatible": true
1387
+ deepseek: "DEEPSEEK_API_KEY"
2006
1388
  };
2007
- var PI_BUILTIN_PROVIDER_MODELS = PI_BUILTIN_PROVIDER_MODELS_GENERATED;
2008
1389
  var AGENT_ACTIVITIES = ["online", "thinking", "working", "error", "offline"];
2009
1390
  var isAgentActivity = makeIsMember(AGENT_ACTIVITIES);
2010
1391
  var VALID_ACTIVITIES = new Set(AGENT_ACTIVITIES);
@@ -2012,11 +1393,6 @@ var EXTERNAL_AGENT_RUNTIME_ID = "external";
2012
1393
  var EXTERNAL_AGENT_RUNTIME_MODEL = "external";
2013
1394
  var EXTERNAL_AGENT_RUNTIME_DISPLAY_NAME = "External agent";
2014
1395
  var RUNTIMES = [
2015
- // Embedded Pi is an in-process Raft-managed runtime, so it is available
2016
- // without a user-installed PATH binary and should be the first Create Agent
2017
- // option. The ordinary `pi` entry below remains the user-installed Pi
2018
- // runtime and reads the user's configured Pi auth/model setup.
2019
- { id: EMBEDDED_PI_RUNTIME_ID, displayName: "Embedded Pi", binary: "", supported: true },
2020
1396
  { id: "claude", displayName: "Claude Code", binary: "claude", supported: true },
2021
1397
  { id: "codex", displayName: "Codex CLI", binary: "codex", supported: true },
2022
1398
  { id: "antigravity", displayName: "Antigravity CLI", binary: "agy", supported: true },
@@ -2029,7 +1405,7 @@ var RUNTIMES = [
2029
1405
  { id: "cursor", displayName: "Cursor CLI", binary: "cursor-agent", supported: true },
2030
1406
  { id: "gemini", displayName: "Gemini CLI", binary: "gemini", supported: true },
2031
1407
  { id: "opencode", displayName: "OpenCode", binary: "opencode", supported: true },
2032
- { id: PI_RUNTIME_ID, displayName: "Pi (installed)", binary: "pi", supported: true }
1408
+ { id: "pi", displayName: "Pi", binary: "pi", supported: true }
2033
1409
  ];
2034
1410
  var RUNTIME_MODELS = {
2035
1411
  [EXTERNAL_AGENT_RUNTIME_ID]: [
@@ -2088,9 +1464,6 @@ var RUNTIME_MODELS = {
2088
1464
  pi: [
2089
1465
  { id: "default", label: "Configured Default / Auto", verified: "suggestion_only" }
2090
1466
  ],
2091
- [EMBEDDED_PI_RUNTIME_ID]: [
2092
- { id: "deepseek/deepseek-v4-pro", label: "DeepSeek V4 Pro", verified: "launchable" }
2093
- ],
2094
1467
  // Kimi CLI resolves model keys from each user's local config, so the safest
2095
1468
  // built-in option is to defer to whatever default model the CLI already uses.
2096
1469
  kimi: [
@@ -2122,7 +1495,7 @@ var CONTROLLED_RUNTIME_ENV_KEYS = {
2122
1495
  // RuntimeProviderConfig.pi-builtin → runtimeConfigToLaunchFields, not by
2123
1496
  // user-supplied envVars: reading from PI_BUILTIN_PROVIDER_ENV_KEYS keeps
2124
1497
  // this list in sync as new providers are added.
2125
- [EMBEDDED_PI_RUNTIME_ID]: Object.values(PI_BUILTIN_PROVIDER_ENV_KEYS)
1498
+ pi: Object.values(PI_BUILTIN_PROVIDER_ENV_KEYS)
2126
1499
  };
2127
1500
  function isPlainRecord(value) {
2128
1501
  return value !== null && typeof value === "object" && !Array.isArray(value);
@@ -2150,11 +1523,6 @@ function stripControlledRuntimeEnvVars(runtime, envVars) {
2150
1523
  return Object.keys(normalized).length > 0 ? normalized : null;
2151
1524
  }
2152
1525
  function isPresetRuntimeModel(runtime, model) {
2153
- if (runtime === PI_RUNTIME_ID || runtime === EMBEDDED_PI_RUNTIME_ID) {
2154
- return (RUNTIME_MODELS[runtime] ?? []).some((candidate) => candidate.id === model) || Object.values(PI_BUILTIN_PROVIDER_MODELS).some(
2155
- (models) => models.some((candidate) => candidate.id === model)
2156
- );
2157
- }
2158
1526
  return (RUNTIME_MODELS[runtime] ?? []).some((candidate) => candidate.id === model);
2159
1527
  }
2160
1528
  function modelConfigFromLegacy(runtime, model) {
@@ -2171,20 +1539,10 @@ function parseProviderConfig(runtime, value, legacyApiUrl, legacyApiKey) {
2171
1539
  }
2172
1540
  return { kind: "default" };
2173
1541
  }
2174
- if (runtime === EMBEDDED_PI_RUNTIME_ID) {
1542
+ if (runtime === "pi") {
2175
1543
  if (!isPlainRecord(value)) return { kind: "default" };
2176
- if (value.kind === "pi-builtin" && typeof value.providerId === "string" && value.providerId.trim() && typeof value.apiKey === "string" && Object.prototype.hasOwnProperty.call(PI_BUILTIN_PROVIDER_ENV_KEYS, value.providerId.trim())) {
2177
- const providerId = value.providerId.trim();
2178
- const apiKey = value.apiKey.trim();
2179
- const apiUrl = typeof value.apiUrl === "string" ? value.apiUrl.trim() : "";
2180
- if (PI_BUILTIN_PROVIDER_API_KEY_REQUIRED[providerId] && !apiKey) return { kind: "default" };
2181
- if (PI_BUILTIN_PROVIDER_API_URL_REQUIRED[providerId] && !apiUrl) return { kind: "default" };
2182
- return {
2183
- kind: "pi-builtin",
2184
- providerId,
2185
- apiKey,
2186
- ...apiUrl ? { apiUrl } : {}
2187
- };
1544
+ if (value.kind === "pi-builtin" && typeof value.providerId === "string" && value.providerId.trim() && typeof value.apiKey === "string" && value.apiKey.trim() && Object.prototype.hasOwnProperty.call(PI_BUILTIN_PROVIDER_ENV_KEYS, value.providerId.trim())) {
1545
+ return { kind: "pi-builtin", providerId: value.providerId.trim(), apiKey: value.apiKey.trim() };
2188
1546
  }
2189
1547
  return { kind: "default" };
2190
1548
  }
@@ -2250,13 +1608,9 @@ function runtimeConfigToLaunchFields(config) {
2250
1608
  generatedEnvVars.ANTHROPIC_CUSTOM_MODEL_OPTION = normalized.model.name;
2251
1609
  }
2252
1610
  }
2253
- let modelValue = runtimeConfigModelValue(normalized);
2254
- if (normalized.runtime === EMBEDDED_PI_RUNTIME_ID && normalized.provider?.kind === "pi-builtin" && normalized.model.kind === "custom" && PI_BUILTIN_PROVIDER_CUSTOM_MODEL_SUPPORTED[normalized.provider.providerId]) {
2255
- modelValue = `${normalized.provider.providerId}/${normalized.model.name}`;
2256
- }
2257
- if (normalized.runtime === EMBEDDED_PI_RUNTIME_ID && normalized.provider?.kind === "pi-builtin") {
1611
+ if (normalized.runtime === "pi" && normalized.provider?.kind === "pi-builtin") {
2258
1612
  const envKey = PI_BUILTIN_PROVIDER_ENV_KEYS[normalized.provider.providerId];
2259
- if (envKey && normalized.provider.apiKey.trim()) generatedEnvVars[envKey] = normalized.provider.apiKey;
1613
+ if (envKey) generatedEnvVars[envKey] = normalized.provider.apiKey;
2260
1614
  }
2261
1615
  const envVars = {
2262
1616
  ...normalized.envVars ?? {},
@@ -2264,7 +1618,7 @@ function runtimeConfigToLaunchFields(config) {
2264
1618
  };
2265
1619
  return {
2266
1620
  runtime: normalized.runtime,
2267
- model: modelValue,
1621
+ model: runtimeConfigModelValue(normalized),
2268
1622
  mode: normalized.mode,
2269
1623
  reasoningEffort: normalized.reasoningEffort ?? null,
2270
1624
  envVars: Object.keys(envVars).length > 0 ? envVars : null,
@@ -2300,6 +1654,13 @@ var PLAN_CONFIG = {
2300
1654
  price: 0,
2301
1655
  extraAgentPrice: 0
2302
1656
  },
1657
+ partner: {
1658
+ displayName: "Partner",
1659
+ limits: { maxMachines: -1, maxAgents: -1, maxChannels: -1, messageHistoryDays: -1, includedAgents: -1 },
1660
+ comingSoon: false,
1661
+ price: 0,
1662
+ extraAgentPrice: 0
1663
+ },
2303
1664
  pro: {
2304
1665
  displayName: "Pro",
2305
1666
  limits: { maxMachines: -1, maxAgents: PRO_PACK_AGENT_SEATS, maxChannels: -1, messageHistoryDays: -1, includedAgents: PRO_PACK_AGENT_SEATS },
@@ -3333,19 +2694,6 @@ function listLegacySlockStatePaths(slockHome = resolveSlockHome(), homeDir = os.
3333
2694
  return candidates.filter((candidate) => existsSync(candidate.path));
3334
2695
  }
3335
2696
 
3336
- // src/authEnv.ts
3337
- var DAEMON_API_KEY_ENV = "SLOCK_MACHINE_API_KEY";
3338
- var SLOCK_AGENT_TOKEN_ENV = "SLOCK_AGENT_TOKEN";
3339
- function scrubDaemonAuthEnv(env) {
3340
- delete env[DAEMON_API_KEY_ENV];
3341
- return env;
3342
- }
3343
- function scrubDaemonChildEnv(env) {
3344
- delete env[DAEMON_API_KEY_ENV];
3345
- delete env[SLOCK_AGENT_TOKEN_ENV];
3346
- return env;
3347
- }
3348
-
3349
2697
  // src/agentCredentialProxy.ts
3350
2698
  import { randomBytes } from "crypto";
3351
2699
  import http from "http";
@@ -3534,7 +2882,7 @@ function reduceApmGatedReviewBoundaryFlush(_state, input) {
3534
2882
  }
3535
2883
  function reduceApmGatedTurnEnd(_state, input = {}) {
3536
2884
  const shouldDeliverQueuedMessages = Boolean(
3537
- input.inboxLength && input.inboxLength > 0 && input.supportsStdinNotification && input.hasSession
2885
+ input.inboxLength && input.inboxLength > 0 && input.supportsStdinNotification && (input.hasSession || input.canDeliverWithoutSession)
3538
2886
  );
3539
2887
  return {
3540
2888
  nextState: {
@@ -4261,7 +3609,7 @@ function projectBucket(target, messages) {
4261
3609
  if (message.channel_type === "thread") flags.add("thread");
4262
3610
  if (message.channel_type === "dm") flags.add("dm");
4263
3611
  if (message.task_number || message.task_status) flags.add("task");
4264
- if (message.mention === true || message.mentioned === true) flags.add("mention");
3612
+ if (message.mentioned === true) flags.add("mention");
4265
3613
  }
4266
3614
  return stripUndefined({
4267
3615
  target,
@@ -4913,9 +4261,7 @@ var LOOPBACK_NO_PROXY = "127.0.0.1,localhost";
4913
4261
  var CLI_TRANSPORT_TRACE_DIR_ENV = "SLOCK_CLI_TRANSPORT_TRACE_DIR";
4914
4262
  var safePathPart = (value) => value.replace(/[^a-zA-Z0-9_.-]/g, "_");
4915
4263
  var RAW_CREDENTIAL_ENV_DENYLIST = [
4916
- "SLOCK_AGENT_TOKEN",
4917
- "SLOCK_AGENT_CREDENTIAL_KEY",
4918
- "SLOCK_AGENT_CREDENTIAL_KEY_FILE"
4264
+ "SLOCK_AGENT_CREDENTIAL_KEY"
4919
4265
  ];
4920
4266
  var WORKSPACE_CLI_TRANSPORT_FILENAMES = [
4921
4267
  "agent-token",
@@ -5000,7 +4346,7 @@ function cleanupWorkspaceCliTransportFiles(workingDirectory) {
5000
4346
  rmSync(path2.join(legacySlockDir, filename), { force: true });
5001
4347
  }
5002
4348
  }
5003
- function writeOpencliWrapper(slockDir, opencliBinPath, platform = process.platform) {
4349
+ function writeOpencliWrapper(slockDir, opencliBinPath, platform = process.platform, execIsElectron = Boolean(process.versions.electron)) {
5004
4350
  const fallbacks = deriveOpencliFallbackCandidates(opencliBinPath);
5005
4351
  let binPath = opencliBinPath;
5006
4352
  if (!existsSync2(binPath)) {
@@ -5016,7 +4362,7 @@ fi
5016
4362
  path2.join(slockDir, "opencli"),
5017
4363
  `#!/usr/bin/env bash
5018
4364
  OPENCLI_BIN=${shellSingleQuote(binPath)}
5019
- ${posixFallbackBlock}exec ${shellSingleQuote(process.execPath)} "$OPENCLI_BIN" "$@"
4365
+ ${posixFallbackBlock}${execIsElectron ? "export ELECTRON_RUN_AS_NODE=1\n" : ""}exec ${shellSingleQuote(process.execPath)} "$OPENCLI_BIN" "$@"
5020
4366
  `,
5021
4367
  { mode: 493 }
5022
4368
  );
@@ -5030,6 +4376,7 @@ ${posixFallbackBlock}exec ${shellSingleQuote(process.execPath)} "$OPENCLI_BIN" "
5030
4376
  "chcp 65001 >NUL 2>NUL",
5031
4377
  `set "OPENCLI_BIN=${binPath}"`,
5032
4378
  ...fallbacks.map((candidate) => `if not exist "%OPENCLI_BIN%" set "OPENCLI_BIN=${candidate}"`),
4379
+ ...execIsElectron ? [`set "ELECTRON_RUN_AS_NODE=1"`] : [],
5033
4380
  `"${process.execPath}" "%OPENCLI_BIN%" %*`,
5034
4381
  ""
5035
4382
  ].join("\r\n") + "\r\n";
@@ -5111,7 +4458,7 @@ function runtimeContextEnv(config) {
5111
4458
  function buildCliTransportSystemPrompt(config, opts) {
5112
4459
  return buildCliSystemPrompt(config, opts);
5113
4460
  }
5114
- async function prepareCliTransport(ctx, extraEnv = {}, platform = process.platform) {
4461
+ async function prepareCliTransport(ctx, extraEnv = {}, platform = process.platform, execIsElectron = Boolean(process.versions.electron)) {
5115
4462
  if (!ctx.slockCliPath) {
5116
4463
  throw new Error(`${ctx.config.runtime} driver: slockCliPath is required (daemon must inject it)`);
5117
4464
  }
@@ -5168,7 +4515,7 @@ fi
5168
4515
  const posixBody = `#!/usr/bin/env bash
5169
4516
  ${posixLoopbackNoProxyPrelude()}
5170
4517
  SLOCK_CLI=${shellSingleQuote(cliPath)}
5171
- ${posixCliFallbackBlock}${posixCredentialPrefix}exec ${shellSingleQuote(process.execPath)} "$SLOCK_CLI" "$@"
4518
+ ${posixCliFallbackBlock}${execIsElectron ? "export ELECTRON_RUN_AS_NODE=1\n" : ""}${posixCredentialPrefix}exec ${shellSingleQuote(process.execPath)} "$SLOCK_CLI" "$@"
5172
4519
  `;
5173
4520
  writeFileSync(posixWrapper, posixBody, { mode: 493 });
5174
4521
  writeFileSync(posixRaftWrapper, posixBody, { mode: 493 });
@@ -5195,6 +4542,7 @@ set "SLOCK_AGENT_ACTIVE_CAPABILITIES=${DEFAULT_ACTIVE_CAPABILITIES}"\r
5195
4542
  cmdCredentialLine.trimEnd(),
5196
4543
  `set "SLOCK_CLI=${cliPath}"`,
5197
4544
  ...cmdCliFallbackLines,
4545
+ ...execIsElectron ? [`set "ELECTRON_RUN_AS_NODE=1"`] : [],
5198
4546
  `"${process.execPath}" "%SLOCK_CLI%" %*`,
5199
4547
  ""
5200
4548
  ].filter((line) => line.length > 0).join("\r\n") + "\r\n";
@@ -5227,6 +4575,7 @@ set "SLOCK_AGENT_ACTIVE_CAPABILITIES=${DEFAULT_ACTIVE_CAPABILITIES}"\r
5227
4575
  "$env:LC_ALL = 'C.UTF-8'",
5228
4576
  ...powershellLoopbackNoProxyLines(),
5229
4577
  ...psCredentialLines,
4578
+ ...execIsElectron ? ["$env:ELECTRON_RUN_AS_NODE = '1'"] : [],
5230
4579
  `$node = ${powershellSingleQuote(process.execPath)}`,
5231
4580
  `$cli = ${powershellSingleQuote(cliPath)}`,
5232
4581
  ...cliPath === "__cli" || cliFallbackCandidates.length === 0 ? [] : [
@@ -5249,7 +4598,7 @@ set "SLOCK_AGENT_ACTIVE_CAPABILITIES=${DEFAULT_ACTIVE_CAPABILITIES}"\r
5249
4598
  }
5250
4599
  const opencliBinPath = resolveOpencliBinPath();
5251
4600
  if (opencliBinPath) {
5252
- writeOpencliWrapper(slockDir, opencliBinPath, platform);
4601
+ writeOpencliWrapper(slockDir, opencliBinPath, platform, execIsElectron);
5253
4602
  }
5254
4603
  const wrapperPath = platform === "win32" ? path2.join(slockDir, "slock.cmd") : posixWrapper;
5255
4604
  const launchRuntimeFields = runtimeConfigToLaunchFields(ctx.config);
@@ -5267,7 +4616,7 @@ set "SLOCK_AGENT_ACTIVE_CAPABILITIES=${DEFAULT_ACTIVE_CAPABILITIES}"\r
5267
4616
  SLOCK_SERVER_URL: ctx.config.serverUrl,
5268
4617
  PATH: `${slockDir}${path2.delimiter}${process.env.PATH ?? ""}`
5269
4618
  };
5270
- scrubDaemonChildEnv(spawnEnv);
4619
+ delete spawnEnv.SLOCK_AGENT_TOKEN;
5271
4620
  for (const key of RAW_CREDENTIAL_ENV_DENYLIST) {
5272
4621
  delete spawnEnv[key];
5273
4622
  }
@@ -5789,7 +5138,7 @@ function requiresWindowsShell(command, platform = process.platform) {
5789
5138
  }
5790
5139
  function resolveCommandOnPath(command, deps = {}) {
5791
5140
  const platform = deps.platform ?? process.platform;
5792
- const env = scrubDaemonChildEnv({ ...withWindowsUserEnvironment(deps.env ?? process.env, deps) });
5141
+ const env = withWindowsUserEnvironment(deps.env ?? process.env, deps);
5793
5142
  const execFileSyncFn = deps.execFileSyncFn ?? execFileSync;
5794
5143
  const existsSyncFn = deps.existsSyncFn ?? existsSync3;
5795
5144
  if (platform === "win32") {
@@ -5815,7 +5164,7 @@ function firstExistingPath(candidates, deps = {}) {
5815
5164
  return null;
5816
5165
  }
5817
5166
  function readCommandVersion(command, args = [], deps = {}) {
5818
- const env = scrubDaemonChildEnv({ ...withWindowsUserEnvironment(deps.env ?? process.env, deps) });
5167
+ const env = withWindowsUserEnvironment(deps.env ?? process.env, deps);
5819
5168
  const execFileSyncFn = deps.execFileSyncFn ?? execFileSync;
5820
5169
  try {
5821
5170
  const output = normalizeExecOutput(execFileSyncFn(command, [...args, "--version"], {
@@ -5940,6 +5289,10 @@ var ClaudeDriver = class {
5940
5289
  // arbitrary busy instant can collide with active signed thinking blocks. The
5941
5290
  // daemon therefore gates busy delivery on Claude stream-json boundaries.
5942
5291
  busyDeliveryMode = "gated";
5292
+ // Claude can report a new session id before the conversation is resumable.
5293
+ // Treat fresh session ids as delivery-ready only after the producing turn
5294
+ // reaches a boundary; existing --resume sessions are ready at launch.
5295
+ liveSessionReadyAt = "turn_end";
5943
5296
  supportsNativeStandingPrompt = true;
5944
5297
  eventNormalizer = new ClaudeEventNormalizer();
5945
5298
  probe() {
@@ -7895,11 +7248,11 @@ function detectCursorModels(runCommand = runCursorModelsCommand) {
7895
7248
  return parseCursorModelsOutput(String(result.stdout || ""));
7896
7249
  }
7897
7250
  function buildCursorModelProbeEnv(deps = {}) {
7898
- return scrubDaemonChildEnv(withWindowsUserEnvironment({
7251
+ return withWindowsUserEnvironment({
7899
7252
  ...deps.env ?? process.env,
7900
7253
  FORCE_COLOR: "0",
7901
7254
  NO_COLOR: "1"
7902
- }, deps));
7255
+ }, deps);
7903
7256
  }
7904
7257
  function runCursorModelsCommand() {
7905
7258
  return spawnSync("cursor-agent", ["models"], {
@@ -7955,7 +7308,7 @@ function resolveGeminiSpawn(commandArgs, deps = {}) {
7955
7308
  }
7956
7309
  const execFileSyncFn = deps.execFileSyncFn ?? execFileSync3;
7957
7310
  const existsSyncFn = deps.existsSyncFn ?? existsSync5;
7958
- const env = scrubDaemonChildEnv({ ...deps.env ?? process.env });
7311
+ const env = deps.env ?? process.env;
7959
7312
  const winPath = path8.win32;
7960
7313
  let geminiEntry = null;
7961
7314
  try {
@@ -8092,15 +7445,12 @@ var GeminiDriver = class {
8092
7445
  // src/drivers/kimi.ts
8093
7446
  import { randomUUID as randomUUID2 } from "crypto";
8094
7447
  import { spawn as spawn7 } from "child_process";
8095
- import { chmodSync, existsSync as existsSync6, readFileSync as readFileSync3, writeFileSync as writeFileSync3 } from "fs";
7448
+ import { existsSync as existsSync6, readFileSync as readFileSync3, writeFileSync as writeFileSync3 } from "fs";
8096
7449
  import os4 from "os";
8097
7450
  import path9 from "path";
8098
7451
  var KIMI_WIRE_PROTOCOL_VERSION = "1.3";
8099
7452
  var KIMI_SYSTEM_PROMPT_FILE = ".slock-kimi-system.md";
8100
7453
  var KIMI_AGENT_FILE = ".slock-kimi-agent.yaml";
8101
- var KIMI_GENERATED_CONFIG_FILE = ".slock-kimi-config.toml";
8102
- var SLOCK_KIMI_CONFIG_CONTENT_ENV = "SLOCK_KIMI_CONFIG_CONTENT";
8103
- var SLOCK_KIMI_CONFIG_FILE_ENV = "SLOCK_KIMI_CONFIG_FILE";
8104
7454
  function parseToolArguments(raw) {
8105
7455
  if (typeof raw !== "string") return raw;
8106
7456
  try {
@@ -8109,73 +7459,6 @@ function parseToolArguments(raw) {
8109
7459
  return raw;
8110
7460
  }
8111
7461
  }
8112
- function readKimiConfigSource(home = os4.homedir(), env = process.env) {
8113
- const inlineConfig = env[SLOCK_KIMI_CONFIG_CONTENT_ENV];
8114
- if (inlineConfig && inlineConfig.trim()) {
8115
- return {
8116
- raw: inlineConfig,
8117
- explicitPath: null,
8118
- sourcePath: SLOCK_KIMI_CONFIG_CONTENT_ENV
8119
- };
8120
- }
8121
- const explicitPath = env[SLOCK_KIMI_CONFIG_FILE_ENV];
8122
- const configPath = explicitPath && explicitPath.trim() ? explicitPath : path9.join(home, ".kimi", "config.toml");
8123
- try {
8124
- return {
8125
- raw: readFileSync3(configPath, "utf8"),
8126
- explicitPath: explicitPath && explicitPath.trim() ? explicitPath : null,
8127
- sourcePath: configPath
8128
- };
8129
- } catch {
8130
- return {
8131
- raw: null,
8132
- explicitPath: explicitPath && explicitPath.trim() ? explicitPath : null,
8133
- sourcePath: configPath
8134
- };
8135
- }
8136
- }
8137
- function buildKimiSpawnEnv(env = process.env) {
8138
- const spawnEnv = { ...env, FORCE_COLOR: "0", NO_COLOR: "1" };
8139
- delete spawnEnv[SLOCK_KIMI_CONFIG_CONTENT_ENV];
8140
- delete spawnEnv[SLOCK_KIMI_CONFIG_FILE_ENV];
8141
- return scrubDaemonChildEnv(spawnEnv);
8142
- }
8143
- function buildKimiEffectiveEnv(ctx, overrideEnv) {
8144
- return {
8145
- ...process.env,
8146
- ...ctx.config.envVars || {},
8147
- ...overrideEnv || {}
8148
- };
8149
- }
8150
- function buildKimiLaunchOptions(ctx, opts = {}) {
8151
- const env = buildKimiEffectiveEnv(ctx, opts.env);
8152
- const source = readKimiConfigSource(opts.home ?? os4.homedir(), env);
8153
- const args = [];
8154
- let configFilePath = null;
8155
- let configContent = null;
8156
- if (source.explicitPath) {
8157
- configFilePath = source.explicitPath;
8158
- } else if (source.raw !== null && source.sourcePath === SLOCK_KIMI_CONFIG_CONTENT_ENV) {
8159
- configFilePath = path9.join(ctx.workingDirectory, KIMI_GENERATED_CONFIG_FILE);
8160
- configContent = source.raw;
8161
- if (opts.writeGeneratedConfig !== false) {
8162
- writeFileSync3(configFilePath, source.raw, { encoding: "utf8", mode: 384 });
8163
- chmodSync(configFilePath, 384);
8164
- }
8165
- }
8166
- if (configFilePath) {
8167
- args.push("--config-file", configFilePath);
8168
- }
8169
- if (ctx.config.model && ctx.config.model !== "default") {
8170
- args.push("--model", ctx.config.model);
8171
- }
8172
- return {
8173
- args,
8174
- env: buildKimiSpawnEnv(env),
8175
- configFilePath,
8176
- configContent
8177
- };
8178
- }
8179
7462
  function resolveKimiSpawn(commandArgs, deps = {}) {
8180
7463
  return {
8181
7464
  command: resolveCommandOnPath("kimi", deps) ?? "kimi",
@@ -8199,25 +7482,7 @@ var KimiDriver = class {
8199
7482
  };
8200
7483
  model = {
8201
7484
  detectedModelsVerifiedAs: "launchable",
8202
- toLaunchSpec: (modelId, ctx, opts) => {
8203
- if (!ctx) return { args: ["--model", modelId] };
8204
- const launchCtx = {
8205
- ...ctx,
8206
- config: {
8207
- ...ctx.config,
8208
- model: modelId
8209
- }
8210
- };
8211
- const launch = buildKimiLaunchOptions(launchCtx, {
8212
- home: opts?.home,
8213
- writeGeneratedConfig: false
8214
- });
8215
- return {
8216
- args: launch.args,
8217
- env: launch.env,
8218
- configFiles: launch.configFilePath ? [launch.configFilePath] : void 0
8219
- };
8220
- }
7485
+ toLaunchSpec: (modelId) => ({ args: ["--model", modelId] })
8221
7486
  };
8222
7487
  supportsStdinNotification = true;
8223
7488
  busyDeliveryMode = "direct";
@@ -8241,23 +7506,21 @@ var KimiDriver = class {
8241
7506
  ` system_prompt_path: ./${KIMI_SYSTEM_PROMPT_FILE}`,
8242
7507
  ""
8243
7508
  ].join("\n"), "utf8");
8244
- const launch = buildKimiLaunchOptions(ctx);
8245
7509
  const args = [
8246
7510
  "--wire",
8247
7511
  "--yolo",
8248
7512
  "--agent-file",
8249
7513
  agentFilePath,
8250
7514
  "--session",
8251
- this.sessionId,
8252
- ...launch.args
7515
+ this.sessionId
8253
7516
  ];
8254
7517
  const launchRuntimeFields = runtimeConfigToLaunchFields(ctx.config);
8255
7518
  if (launchRuntimeFields.model && launchRuntimeFields.model !== "default") {
8256
7519
  args.push("--model", launchRuntimeFields.model);
8257
7520
  }
8258
7521
  const spawnEnv = (await prepareCliTransport(ctx, { NO_COLOR: "1" })).spawnEnv;
8259
- const spawnTarget = resolveKimiSpawn(args);
8260
- const proc = spawn7(spawnTarget.command, spawnTarget.args, {
7522
+ const launch = resolveKimiSpawn(args);
7523
+ const proc = spawn7(launch.command, launch.args, {
8261
7524
  cwd: ctx.workingDirectory,
8262
7525
  stdio: ["pipe", "pipe", "pipe"],
8263
7526
  env: spawnEnv,
@@ -8265,7 +7528,7 @@ var KimiDriver = class {
8265
7528
  // and has an 8191-character command-line limit. Kimi's official
8266
7529
  // installer/uv entrypoint is an executable, so launch it directly and
8267
7530
  // keep prompts on stdin / files instead of routing through cmd.exe.
8268
- shell: spawnTarget.shell
7531
+ shell: launch.shell
8269
7532
  });
8270
7533
  proc.stdin?.write(JSON.stringify({
8271
7534
  jsonrpc: "2.0",
@@ -8378,9 +7641,14 @@ var KimiDriver = class {
8378
7641
  return detectKimiModels();
8379
7642
  }
8380
7643
  };
8381
- function detectKimiModels(home = os4.homedir(), opts = {}) {
8382
- const raw = readKimiConfigSource(home, opts.env).raw;
8383
- if (raw === null) return null;
7644
+ function detectKimiModels(home = os4.homedir()) {
7645
+ const configPath = path9.join(home, ".kimi", "config.toml");
7646
+ let raw;
7647
+ try {
7648
+ raw = readFileSync3(configPath, "utf8");
7649
+ } catch {
7650
+ return null;
7651
+ }
8384
7652
  const models = [];
8385
7653
  const sectionRe = /^\s*\[models(?:\.([^\]]+)|"\.[^"]+"|\."[^"]+")\s*\]\s*$/gm;
8386
7654
  const lineRe = /^\s*\[models\.(.+?)\s*\]\s*$/gm;
@@ -9046,7 +8314,7 @@ function runOpenCodeModelsCommand(home, deps = {}) {
9046
8314
  const platform = deps.platform ?? process.platform;
9047
8315
  const spawnSyncFn = deps.spawnSyncFn ?? spawnSync2;
9048
8316
  const result = spawnSyncFn("opencode", ["models"], {
9049
- env: scrubDaemonChildEnv({ ...process.env, HOME: home, FORCE_COLOR: "0", NO_COLOR: "1" }),
8317
+ env: { ...process.env, HOME: home, FORCE_COLOR: "0", NO_COLOR: "1" },
9050
8318
  encoding: "utf8",
9051
8319
  timeout: 5e3,
9052
8320
  shell: platform === "win32"
@@ -9317,7 +8585,6 @@ import {
9317
8585
  SettingsManager,
9318
8586
  VERSION as PI_SDK_VERSION
9319
8587
  } from "@earendil-works/pi-coding-agent";
9320
- import { getModels } from "@earendil-works/pi-ai";
9321
8588
  var PI_SESSION_DIR = ".pi-sessions";
9322
8589
  var PI_SDK_COMPACTION_ENABLED = true;
9323
8590
  function createPiSdkEventMappingState(sessionId = null) {
@@ -9383,77 +8650,6 @@ function logPiServiceDiagnostics(context, services) {
9383
8650
  function formatPiModelLogId(model) {
9384
8651
  return model ? `${model.provider}/${model.id}` : "default";
9385
8652
  }
9386
- var PI_COMPATIBLE_PROVIDER_CONFIGS = {
9387
- "openai-compatible": {
9388
- name: "OpenAI-compatible",
9389
- sourceProviderId: "openai",
9390
- api: "openai-completions"
9391
- },
9392
- "anthropic-compatible": {
9393
- name: "Anthropic-compatible",
9394
- sourceProviderId: "anthropic",
9395
- api: "anthropic-messages"
9396
- }
9397
- };
9398
- function piSdkModelToProviderModelConfig(model, api) {
9399
- return {
9400
- id: model.id,
9401
- name: model.name ?? humanizeRuntimeProviderSegment(model.id),
9402
- api,
9403
- reasoning: model.reasoning,
9404
- thinkingLevelMap: model.thinkingLevelMap,
9405
- input: [...model.input],
9406
- cost: model.cost,
9407
- contextWindow: model.contextWindow,
9408
- maxTokens: model.maxTokens,
9409
- headers: model.headers,
9410
- compat: model.compat
9411
- };
9412
- }
9413
- function genericCompatibleProviderModelConfig(modelId, api) {
9414
- return {
9415
- id: modelId,
9416
- name: humanizeRuntimeProviderSegment(modelId),
9417
- api,
9418
- reasoning: false,
9419
- input: ["text"],
9420
- cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
9421
- contextWindow: 2e5,
9422
- maxTokens: 16384
9423
- };
9424
- }
9425
- function buildPiCompatibleProviderConfig(providerId, apiUrl, requestedModel) {
9426
- const config = PI_COMPATIBLE_PROVIDER_CONFIGS[providerId];
9427
- if (!config) return null;
9428
- const models = getModels(config.sourceProviderId).map((model) => piSdkModelToProviderModelConfig(model, config.api));
9429
- const providerPrefix = `${providerId}/`;
9430
- const requestedProviderModelId = requestedModel?.startsWith(providerPrefix) ? requestedModel.slice(providerPrefix.length) : "";
9431
- if (requestedProviderModelId && !models.some((model) => model.id === requestedProviderModelId)) {
9432
- models.push(genericCompatibleProviderModelConfig(requestedProviderModelId, config.api));
9433
- }
9434
- return {
9435
- name: config.name,
9436
- baseUrl: apiUrl,
9437
- apiKey: `$${providerId.toUpperCase().replaceAll("-", "_")}_API_KEY`,
9438
- api: config.api,
9439
- models
9440
- };
9441
- }
9442
- function applyPiRuntimeProviderOverrides(config, authStorage, modelRegistry, requestedModel) {
9443
- const runtimeConfig = hydrateRuntimeConfig(config);
9444
- if (runtimeConfig.runtime !== EMBEDDED_PI_RUNTIME_ID || runtimeConfig.provider?.kind !== "pi-builtin") return;
9445
- const provider = runtimeConfig.provider;
9446
- if (provider.apiKey.trim()) {
9447
- authStorage.setRuntimeApiKey(provider.providerId, provider.apiKey);
9448
- }
9449
- if (!modelRegistry) return;
9450
- if (!PI_BUILTIN_PROVIDER_API_URL_REQUIRED[provider.providerId] || !provider.apiUrl?.trim()) return;
9451
- if (!PI_BUILTIN_PROVIDER_CUSTOM_MODEL_SUPPORTED[provider.providerId]) return;
9452
- const providerConfig = buildPiCompatibleProviderConfig(provider.providerId, provider.apiUrl.trim(), requestedModel);
9453
- if (providerConfig) {
9454
- modelRegistry.registerProvider(provider.providerId, providerConfig);
9455
- }
9456
- }
9457
8653
  function piServiceDiagnosticTraceAttrs(services) {
9458
8654
  let info = 0;
9459
8655
  let warning = 0;
@@ -9618,12 +8814,6 @@ var PI_RUNTIME_SESSION_DESCRIPTOR = {
9618
8814
  };
9619
8815
  var PI_IDLE_PROMPT_RETRY_MS = 25;
9620
8816
  var PI_IDLE_PROMPT_MAX_WAIT_MS = 1e3;
9621
- function inputSizeTraceAttrs(text) {
9622
- return {
9623
- input_chars: text.length,
9624
- input_bytes: Buffer.byteLength(text, "utf8")
9625
- };
9626
- }
9627
8817
  async function createPiAgentSessionForContext(ctx, sessionId) {
9628
8818
  const sessionDir = buildPiSessionDir(ctx.workingDirectory);
9629
8819
  mkdirSync3(sessionDir, { recursive: true });
@@ -9645,7 +8835,6 @@ async function createPiAgentSessionForContext(ctx, sessionId) {
9645
8835
  const spawnEnv = await buildPiSpawnEnv(ctx);
9646
8836
  const agentDir = spawnEnv.PI_CODING_AGENT_DIR || getAgentDir();
9647
8837
  const authStorage = AuthStorage.create(path12.join(agentDir, "auth.json"));
9648
- applyPiRuntimeProviderOverrides(ctx.config, authStorage, null, launchRuntimeFields.model);
9649
8838
  const settingsManager = SettingsManager.create(ctx.workingDirectory, agentDir);
9650
8839
  const services = await createAgentSessionServices({
9651
8840
  cwd: ctx.workingDirectory,
@@ -9656,7 +8845,6 @@ async function createPiAgentSessionForContext(ctx, sessionId) {
9656
8845
  systemPromptOverride: () => ctx.standingPrompt
9657
8846
  }
9658
8847
  });
9659
- applyPiRuntimeProviderOverrides(ctx.config, authStorage, services.modelRegistry, launchRuntimeFields.model);
9660
8848
  applyPiDaemonSettingsOverrides(services.settingsManager);
9661
8849
  logPiServiceDiagnostics("create_session", services);
9662
8850
  addPiServiceTraceEvent(traceSpan, "daemon.pi.session.services_ready", services, {
@@ -9785,129 +8973,46 @@ var PiSdkRuntimeSession = class {
9785
8973
  this.events.on(event, cb);
9786
8974
  }
9787
8975
  async start(input) {
9788
- const traceSpan = this.startTraceSpan("daemon.pi.session.start", {
9789
- requested_session_id_present: Boolean(input.sessionId),
9790
- config_session_id_present: Boolean(this.ctx.config.sessionId),
9791
- ...inputSizeTraceAttrs(input.text)
9792
- });
9793
8976
  if (this.started) {
9794
- traceSpan?.end("error", {
9795
- attrs: {
9796
- outcome: "already_started"
9797
- }
9798
- });
9799
8977
  return { ok: false, reason: "runtime_error", error: "runtime session already started" };
9800
8978
  }
9801
- if (this.didClose) {
9802
- traceSpan?.end("error", {
9803
- attrs: {
9804
- outcome: "closed"
9805
- }
9806
- });
9807
- return { ok: false, reason: "closed" };
9808
- }
8979
+ if (this.didClose) return { ok: false, reason: "closed" };
9809
8980
  this.started = true;
9810
8981
  const sessionId = input.sessionId || this.ctx.config.sessionId || randomUUID4();
9811
8982
  this.mappingState.sessionId = sessionId;
9812
8983
  this.setCurrentSessionId(sessionId);
9813
- try {
9814
- const session = await this.sessionFactory({
9815
- ...this.ctx,
9816
- config: {
9817
- ...this.ctx.config,
9818
- sessionId
9819
- }
9820
- }, sessionId);
9821
- this.session = session;
9822
- this.mappingState.sessionId = session.sessionId;
9823
- this.setCurrentSessionId(session.sessionId);
9824
- traceSpan?.addEvent("daemon.pi.session.start.factory_ready", {
9825
- session_id_present: Boolean(session.sessionId)
9826
- });
9827
- this.unsubscribe = session.subscribe((event) => {
9828
- for (const parsed of mapPiSdkEventToParsedEvents(event, this.mappingState)) {
9829
- this.events.emit("runtime_event", parsed);
9830
- }
9831
- });
9832
- this.emitSessionInit();
9833
- traceSpan?.addEvent("daemon.pi.session.start.initial_prompt_dispatch", {
9834
- sdk_operation: "prompt",
9835
- dispatch_reason: "initial_prompt"
9836
- });
9837
- this.launchPrompt(input.text, "initial_prompt");
9838
- traceSpan?.end("ok", {
9839
- attrs: {
9840
- outcome: "accepted",
9841
- session_id_present: Boolean(session.sessionId)
9842
- }
9843
- });
9844
- return { ok: true, acceptedAs: "prompt" };
9845
- } catch (error) {
9846
- traceSpan?.end("error", {
9847
- attrs: {
9848
- outcome: "error",
9849
- error_class: error instanceof Error ? error.name : typeof error
9850
- }
9851
- });
9852
- throw error;
9853
- }
8984
+ const session = await this.sessionFactory({
8985
+ ...this.ctx,
8986
+ config: {
8987
+ ...this.ctx.config,
8988
+ sessionId
8989
+ }
8990
+ }, sessionId);
8991
+ this.session = session;
8992
+ this.mappingState.sessionId = session.sessionId;
8993
+ this.setCurrentSessionId(session.sessionId);
8994
+ this.unsubscribe = session.subscribe((event) => {
8995
+ for (const parsed of mapPiSdkEventToParsedEvents(event, this.mappingState)) {
8996
+ this.events.emit("runtime_event", parsed);
8997
+ }
8998
+ });
8999
+ this.emitSessionInit();
9000
+ this.launchPrompt(input.text);
9001
+ return { ok: true, acceptedAs: "prompt" };
9854
9002
  }
9855
9003
  send(input) {
9004
+ if (this.didClose) return { ok: false, reason: "closed" };
9856
9005
  const session = this.session;
9857
- const traceSpan = this.startTraceSpan("daemon.pi.session.send", {
9858
- mode: input.mode,
9859
- streaming: Boolean(session?.isStreaming),
9860
- ...inputSizeTraceAttrs(input.text)
9861
- });
9862
- if (this.didClose) {
9863
- traceSpan?.end("error", {
9864
- attrs: {
9865
- outcome: "closed"
9866
- }
9867
- });
9868
- return { ok: false, reason: "closed" };
9869
- }
9870
- if (!session) {
9871
- traceSpan?.end("error", {
9872
- attrs: {
9873
- outcome: "closed"
9874
- }
9875
- });
9876
- return { ok: false, reason: "closed" };
9877
- }
9006
+ if (!session) return { ok: false, reason: "closed" };
9878
9007
  if (input.mode === "busy") {
9879
- this.deferSdkCall("steer", "busy_steer", input.text, () => session.steer(input.text));
9880
- traceSpan?.end("ok", {
9881
- attrs: {
9882
- outcome: "accepted",
9883
- accepted_as: "steer",
9884
- sdk_operation: "steer",
9885
- dispatch_reason: "busy_steer"
9886
- }
9887
- });
9008
+ this.deferSdkCall(() => session.steer(input.text));
9888
9009
  return { ok: true, acceptedAs: "steer" };
9889
9010
  }
9890
9011
  if (session.isStreaming) {
9891
9012
  this.launchPromptAfterStreaming(input.text);
9892
- traceSpan?.end("ok", {
9893
- attrs: {
9894
- outcome: "accepted",
9895
- accepted_as: "prompt",
9896
- sdk_operation: "prompt_or_steer",
9897
- dispatch_reason: "idle_prompt_after_streaming"
9898
- }
9899
- });
9900
9013
  return { ok: true, acceptedAs: "prompt" };
9901
9014
  }
9902
- this.launchPrompt(input.text, "idle_prompt");
9903
- traceSpan?.end("ok", {
9904
- attrs: {
9905
- outcome: "accepted",
9906
- accepted_as: "prompt",
9907
- sdk_operation: "prompt",
9908
- dispatch_reason: "idle_prompt"
9909
- }
9910
- });
9015
+ this.launchPrompt(input.text);
9911
9016
  return { ok: true, acceptedAs: "prompt" };
9912
9017
  }
9913
9018
  async stop(opts) {
@@ -9936,7 +9041,7 @@ var PiSdkRuntimeSession = class {
9936
9041
  this.mappingState.sessionAnnounced = true;
9937
9042
  this.events.emit("runtime_event", { kind: "session_init", sessionId });
9938
9043
  }
9939
- launchPrompt(text, dispatchReason) {
9044
+ launchPrompt(text) {
9940
9045
  const session = this.session;
9941
9046
  if (!session) {
9942
9047
  this.events.emit("runtime_event", {
@@ -9945,10 +9050,10 @@ var PiSdkRuntimeSession = class {
9945
9050
  });
9946
9051
  return;
9947
9052
  }
9948
- this.deferSdkCall("prompt", dispatchReason, text, () => session.prompt(text));
9053
+ this.deferSdkCall(() => session.prompt(text));
9949
9054
  }
9950
9055
  launchPromptAfterStreaming(text) {
9951
- this.deferSdkCall("prompt_or_steer", "idle_prompt_after_streaming", text, async () => {
9056
+ this.deferSdkCall(async () => {
9952
9057
  const session = this.session;
9953
9058
  if (!session) return;
9954
9059
  const ready = await this.waitForStreamingToClear(session);
@@ -9968,65 +9073,24 @@ var PiSdkRuntimeSession = class {
9968
9073
  }
9969
9074
  return !this.didClose && this.session === session && !session.isStreaming;
9970
9075
  }
9971
- deferSdkCall(sdkOperation, dispatchReason, text, invoke) {
9076
+ deferSdkCall(invoke) {
9972
9077
  setImmediate(() => {
9973
- void this.invokeDeferredSdkCall(sdkOperation, dispatchReason, text, invoke);
9974
- });
9975
- }
9976
- async invokeDeferredSdkCall(sdkOperation, dispatchReason, text, invoke) {
9977
- const traceSpan = this.startTraceSpan("daemon.pi.session.sdk_call", {
9978
- sdk_operation: sdkOperation,
9979
- dispatch_reason: dispatchReason,
9980
- ...inputSizeTraceAttrs(text)
9981
- });
9982
- if (this.didClose) {
9983
- traceSpan?.end("cancelled", {
9984
- attrs: {
9985
- outcome: "skipped_closed",
9986
- sdk_operation: sdkOperation,
9987
- dispatch_reason: dispatchReason
9988
- }
9989
- });
9990
- return;
9991
- }
9992
- try {
9993
- await invoke();
9994
- traceSpan?.end("ok", {
9995
- attrs: {
9996
- outcome: "resolved",
9997
- sdk_operation: sdkOperation,
9998
- dispatch_reason: dispatchReason
9999
- }
10000
- });
10001
- } catch (error) {
10002
- if (!this.didClose) {
9078
+ if (this.didClose) return;
9079
+ try {
9080
+ void invoke().catch((error) => {
9081
+ if (this.didClose) return;
9082
+ this.events.emit("runtime_event", {
9083
+ kind: "error",
9084
+ message: piErrorMessage(error)
9085
+ });
9086
+ });
9087
+ } catch (error) {
9088
+ if (this.didClose) return;
10003
9089
  this.events.emit("runtime_event", {
10004
9090
  kind: "error",
10005
9091
  message: piErrorMessage(error)
10006
9092
  });
10007
9093
  }
10008
- traceSpan?.end("error", {
10009
- attrs: {
10010
- outcome: "error",
10011
- sdk_operation: sdkOperation,
10012
- dispatch_reason: dispatchReason,
10013
- error_class: error instanceof Error ? error.name : typeof error
10014
- }
10015
- });
10016
- }
10017
- }
10018
- startTraceSpan(name, attrs) {
10019
- return this.ctx.tracer?.startSpan(name, {
10020
- surface: "daemon",
10021
- kind: "internal",
10022
- attrs: {
10023
- agentId: this.ctx.agentId,
10024
- launchId: this.ctx.launchId || void 0,
10025
- runtime: this.ctx.config.runtime,
10026
- model: this.ctx.config.model,
10027
- session_id_present: Boolean(this.mappingState.sessionId),
10028
- ...attrs
10029
- }
10030
9094
  });
10031
9095
  }
10032
9096
  async disposeSession() {
@@ -10058,7 +9122,7 @@ var PiSdkRuntimeSession = class {
10058
9122
  }
10059
9123
  };
10060
9124
  var PiDriver = class {
10061
- id;
9125
+ id = "pi";
10062
9126
  supportsNativeStandingPrompt = true;
10063
9127
  lifecycle = {
10064
9128
  kind: "persistent",
@@ -10079,9 +9143,6 @@ var PiDriver = class {
10079
9143
  supportsStdinNotification = true;
10080
9144
  busyDeliveryMode = "direct";
10081
9145
  sessionId = null;
10082
- constructor(runtimeId = EMBEDDED_PI_RUNTIME_ID) {
10083
- this.id = runtimeId;
10084
- }
10085
9146
  get currentSessionId() {
10086
9147
  return this.sessionId;
10087
9148
  }
@@ -10270,11 +9331,6 @@ function createChildProcessRuntimeSession(driver, ctx) {
10270
9331
  }
10271
9332
 
10272
9333
  // src/drivers/index.ts
10273
- function createInstalledPiDriver() {
10274
- const driver = new PiDriver(PI_RUNTIME_ID);
10275
- Object.defineProperty(driver, "probe", { value: void 0 });
10276
- return driver;
10277
- }
10278
9334
  var driverFactories = {
10279
9335
  claude: () => new ClaudeDriver(),
10280
9336
  codex: () => new CodexDriver(),
@@ -10290,8 +9346,7 @@ var driverFactories = {
10290
9346
  kimi: () => new KimiDriver(),
10291
9347
  "kimi-sdk": () => new KimiSdkDriver(),
10292
9348
  opencode: () => new OpenCodeDriver(),
10293
- [EMBEDDED_PI_RUNTIME_ID]: () => new PiDriver(EMBEDDED_PI_RUNTIME_ID),
10294
- [PI_RUNTIME_ID]: () => createInstalledPiDriver()
9349
+ pi: () => new PiDriver()
10295
9350
  };
10296
9351
  function getDriver(runtimeId) {
10297
9352
  const createDriver = driverFactories[runtimeId];
@@ -11142,7 +10197,7 @@ function resolveRuntimeSessionRef(runtime, sessionId, homeDir = os6.homedir(), f
11142
10197
  } else if (runtime === "kimi-sdk" || runtime === "kimi") {
11143
10198
  lookupMethod = "kimi_sdk_index";
11144
10199
  resolvedPath = findKimiSdkSessionDir(sessionId, opts?.agentId, homeDir);
11145
- } else if (runtime === PI_RUNTIME_ID || runtime === EMBEDDED_PI_RUNTIME_ID) {
10200
+ } else if (runtime === "pi") {
11146
10201
  lookupMethod = "pi_jsonl";
11147
10202
  resolvedPath = findPiSessionFile2(sessionId, opts?.workingDirectory, homeDir);
11148
10203
  }
@@ -11308,6 +10363,9 @@ var RUNTIME_ERROR_FINGERPRINT_FENCE_THRESHOLD = 3;
11308
10363
  var SPAWN_FAIL_BACKOFF_BASE_MS = 1e3;
11309
10364
  var SPAWN_FAIL_BACKOFF_MAX_MS = 3e4;
11310
10365
  var SPAWN_FAIL_BACKOFF_THRESHOLD = 3;
10366
+ var RUNNER_CREDENTIAL_MINT_BACKOFF_BASE_MS = 6e4;
10367
+ var RUNNER_CREDENTIAL_MINT_BACKOFF_MAX_MS = 10 * 6e4;
10368
+ var RUNNER_CREDENTIAL_MINT_BACKOFF_THRESHOLD = 0;
11311
10369
  var COMPACTION_STALE_MS = 5 * 6e4;
11312
10370
  var RUNTIME_PROGRESS_STALE_MS = 15 * 6e4;
11313
10371
  var DEFAULT_RUNTIME_START_TIMEOUT_MS = 2 * 6e4;
@@ -11965,7 +11023,7 @@ function resumeSessionRecoveryReason(ap) {
11965
11023
  if (candidates.some(isOpenCodeReplayRejectedByProvider)) return "provider_replay_rejected";
11966
11024
  return null;
11967
11025
  }
11968
- if (ap.driver.id === PI_RUNTIME_ID || ap.driver.id === EMBEDDED_PI_RUNTIME_ID) {
11026
+ if (ap.driver.id === "pi") {
11969
11027
  return candidates.some(isPiReplayRejectedByProvider) ? "provider_replay_rejected" : null;
11970
11028
  }
11971
11029
  if (ap.driver.id === "gemini") {
@@ -12332,12 +11390,14 @@ var AgentProcessManager = class _AgentProcessManager {
12332
11390
  }
12333
11391
  // ----- SPAWN-FAIL BACKOFF (per-agent) ----------------------------------
12334
11392
  // Anchored at auto_restart_from_idle (apm:3596) + runtime_profile_auto_restart (apm:4137).
12335
- // Threshold > 1 first SPAWN_FAIL_BACKOFF_THRESHOLD failures behave as today (preserves
12336
- // single-transient-hiccup); subsequent failure schedules a per-agent cooldown gating new
12337
- // spawn attempts. Successful spawn resets state. State lives outside AgentProcess because
12338
- // spawn fails BEFORE ap exists and the rate-window must persist across stop/respawn
12339
- // (else stop/start churn bypasses the cap CC1 lifecycle pattern). Never advances any
12340
- // consume cursor or model-seen state (3-cursor orthogonality with CC1/CC2).
11393
+ // Generic spawn errors keep a threshold > 1 so single-transient hiccups behave as today.
11394
+ // Runner credential mint failures are different: one outer spawn failure already means the
11395
+ // inner credential-mint loop exhausted RUNNER_CREDENTIAL_MINT_MAX_ATTEMPTS. Those enter a
11396
+ // longer cooldown immediately so repeated wakes don't keep burning three network fetches.
11397
+ // Successful spawn resets state. State lives outside AgentProcess because spawn fails BEFORE
11398
+ // ap exists and the rate-window must persist across stop/respawn (else stop/start churn
11399
+ // bypasses the cap — CC1 lifecycle pattern). Never advances any consume cursor or model-seen
11400
+ // state (3-cursor orthogonality with CC1/CC2).
12341
11401
  getOrCreateSpawnFailBackoff(agentId) {
12342
11402
  let state = this.agentSpawnFailBackoff.get(agentId);
12343
11403
  if (!state) {
@@ -12358,12 +11418,16 @@ var AgentProcessManager = class _AgentProcessManager {
12358
11418
  const state = this.getOrCreateSpawnFailBackoff(agentId);
12359
11419
  state.attempts += 1;
12360
11420
  state.reason = reason;
12361
- if (state.attempts <= SPAWN_FAIL_BACKOFF_THRESHOLD) {
11421
+ const isRunnerCredentialMint = reason === "runner_credential_mint";
11422
+ const threshold = isRunnerCredentialMint ? RUNNER_CREDENTIAL_MINT_BACKOFF_THRESHOLD : SPAWN_FAIL_BACKOFF_THRESHOLD;
11423
+ const baseMs = isRunnerCredentialMint ? RUNNER_CREDENTIAL_MINT_BACKOFF_BASE_MS : SPAWN_FAIL_BACKOFF_BASE_MS;
11424
+ const maxMs = isRunnerCredentialMint ? RUNNER_CREDENTIAL_MINT_BACKOFF_MAX_MS : SPAWN_FAIL_BACKOFF_MAX_MS;
11425
+ if (state.attempts <= threshold) {
12362
11426
  state.untilMs = 0;
12363
11427
  return { backoffActive: false, attempts: state.attempts, untilMs: 0 };
12364
11428
  }
12365
- const exponent = Math.min(state.attempts - SPAWN_FAIL_BACKOFF_THRESHOLD, 10);
12366
- const baseDelay = Math.min(SPAWN_FAIL_BACKOFF_MAX_MS, SPAWN_FAIL_BACKOFF_BASE_MS * Math.pow(2, exponent));
11429
+ const exponent = Math.min(state.attempts - threshold - 1, 10);
11430
+ const baseDelay = Math.min(maxMs, baseMs * Math.pow(2, exponent));
12367
11431
  state.untilMs = this.clockNow() + Math.floor(baseDelay);
12368
11432
  if (state.timer) clearTimeout(state.timer);
12369
11433
  state.timer = setTimeout(() => {
@@ -13112,6 +12176,20 @@ var AgentProcessManager = class _AgentProcessManager {
13112
12176
  if (driver.requiresSessionInitForDelivery) return null;
13113
12177
  return config.sessionId || null;
13114
12178
  }
12179
+ initialSessionReadyForDelivery(driver, config, sessionId) {
12180
+ if (!sessionId) return false;
12181
+ if (config.sessionId && config.sessionId === sessionId) return true;
12182
+ return driver.liveSessionReadyAt !== "turn_end";
12183
+ }
12184
+ markSessionReadyForDelivery(ap, source) {
12185
+ if (!ap.sessionId) return;
12186
+ if (source === "turn_end" || ap.driver.liveSessionReadyAt !== "turn_end") {
12187
+ ap.sessionReadyForDelivery = true;
12188
+ }
12189
+ }
12190
+ canDeliverToRuntimeSession(ap) {
12191
+ return Boolean(ap.sessionId && ap.sessionReadyForDelivery);
12192
+ }
13115
12193
  restartSafeSessionId(ap) {
13116
12194
  return ap.sessionId || (ap.driver.requiresSessionInitForDelivery ? ap.config.sessionId || null : null);
13117
12195
  }
@@ -13161,9 +12239,11 @@ var AgentProcessManager = class _AgentProcessManager {
13161
12239
  const nextLaunchId = start.launchId || ap.launchId || null;
13162
12240
  const requiresSessionInit = ap.driver.requiresSessionInitForDelivery === true;
13163
12241
  const nextSessionId = ap.sessionId || (requiresSessionInit ? null : start.config.sessionId || null);
12242
+ const nextSessionReadyForDelivery = nextSessionId ? nextSessionId === ap.sessionId ? ap.sessionReadyForDelivery : this.initialSessionReadyForDelivery(ap.driver, start.config, nextSessionId) : false;
13164
12243
  const nextConfigSessionId = nextSessionId || (requiresSessionInit ? start.config.sessionId || null : ap.config.sessionId || start.config.sessionId || null);
13165
12244
  ap.launchId = nextLaunchId;
13166
12245
  ap.sessionId = nextSessionId;
12246
+ ap.sessionReadyForDelivery = nextSessionReadyForDelivery;
13167
12247
  ap.config = {
13168
12248
  ...start.config,
13169
12249
  sessionId: nextConfigSessionId
@@ -13580,6 +12660,7 @@ Use ${communicationCommand("read_history")} to catch up on the channels listed a
13580
12660
  inbox: wakeMessageDeliveredAsInboxUpdate && wakeMessage ? [wakeMessage, ...startingInboxMessages] : startingInboxMessages,
13581
12661
  config: liveProcessConfig,
13582
12662
  sessionId: initialSessionId,
12663
+ sessionReadyForDelivery: this.initialSessionReadyForDelivery(driver, liveProcessConfig, initialSessionId),
13583
12664
  launchId: effectiveLaunchId,
13584
12665
  startupWakeMessage: wakeMessage,
13585
12666
  startupUnreadSummary: unreadSummary,
@@ -14556,7 +13637,7 @@ Use ${communicationCommand("read_history")} to catch up on the channels listed a
14556
13637
  if (!transientDelivery && this.queueDeliveryForRuntimeErrorBackoff(agentId, ap, message)) {
14557
13638
  return true;
14558
13639
  }
14559
- if (isIdle && ap.driver.supportsStdinNotification && ap.sessionId) {
13640
+ if (isIdle && ap.driver.supportsStdinNotification && this.canDeliverToRuntimeSession(ap)) {
14560
13641
  if (transientDelivery) {
14561
13642
  this.commitApmIdleState(agentId, ap, false);
14562
13643
  this.startRuntimeTrace(agentId, ap, "stdin-idle-delivery", [message]);
@@ -14574,6 +13655,7 @@ Use ${communicationCommand("read_history")} to catch up on the channels listed a
14574
13655
  process_present: true,
14575
13656
  runtime: ap.config.runtime,
14576
13657
  session_id_present: true,
13658
+ session_ready_for_delivery: true,
14577
13659
  launchId: ap.launchId || void 0,
14578
13660
  stdin_delivery_accepted: stdinAccepted2,
14579
13661
  delivered_messages_count: 1,
@@ -14592,6 +13674,7 @@ Use ${communicationCommand("read_history")} to catch up on the channels listed a
14592
13674
  process_present: true,
14593
13675
  runtime: ap.config.runtime,
14594
13676
  session_id_present: true,
13677
+ session_ready_for_delivery: true,
14595
13678
  launchId: ap.launchId || void 0,
14596
13679
  is_idle: isIdle,
14597
13680
  inbox_count: ap.inbox.length,
@@ -14674,6 +13757,20 @@ Use ${communicationCommand("read_history")} to catch up on the channels listed a
14674
13757
  }));
14675
13758
  return true;
14676
13759
  }
13760
+ if (!this.canDeliverToRuntimeSession(ap)) {
13761
+ this.recordDaemonTrace("daemon.agent.delivery.routed", this.deliveryTraceAttrs(agentId, message, {
13762
+ outcome: "queued_before_session_ready",
13763
+ accepted: true,
13764
+ process_present: true,
13765
+ runtime: ap.config.runtime,
13766
+ session_id_present: true,
13767
+ session_ready_for_delivery: false,
13768
+ launchId: ap.launchId || void 0,
13769
+ is_idle: isIdle,
13770
+ inbox_count: ap.inbox.length
13771
+ }));
13772
+ return true;
13773
+ }
14677
13774
  if (ap.gatedSteering.compacting) {
14678
13775
  ap.notifications.add();
14679
13776
  ap.notifications.clearTimer();
@@ -14921,7 +14018,8 @@ Use ${communicationCommand("read_history")} to catch up on the channels listed a
14921
14018
  };
14922
14019
  const ap = this.agents.get(agentId);
14923
14020
  const isIdle = ap ? this.isApmIdle(ap) : false;
14924
- if (ap && !(ap.sessionId && ap.driver.supportsStdinNotification && isIdle) && !(ap.sessionId && ap.runtime.descriptor.busyDelivery === "direct")) {
14021
+ const sessionReadyForDelivery = ap ? this.canDeliverToRuntimeSession(ap) : false;
14022
+ if (ap && !(sessionReadyForDelivery && ap.driver.supportsStdinNotification && isIdle) && !(sessionReadyForDelivery && ap.runtime.descriptor.busyDelivery === "direct")) {
14925
14023
  this.enqueueRuntimeProfileNotification(agentId, ap, message, kind, key);
14926
14024
  span.end("ok", {
14927
14025
  attrs: {
@@ -14929,13 +14027,14 @@ Use ${communicationCommand("read_history")} to catch up on the channels listed a
14929
14027
  runtime: ap.config.runtime,
14930
14028
  launchId: ap.launchId || void 0,
14931
14029
  session_id_present: Boolean(ap.sessionId),
14030
+ session_ready_for_delivery: sessionReadyForDelivery,
14932
14031
  supports_stdin_notification: ap.driver.supportsStdinNotification,
14933
14032
  busy_delivery_mode: ap.driver.busyDeliveryMode
14934
14033
  }
14935
14034
  });
14936
14035
  return true;
14937
14036
  }
14938
- if (ap?.sessionId && ap.driver.supportsStdinNotification && isIdle) {
14037
+ if (ap && sessionReadyForDelivery && ap.driver.supportsStdinNotification && isIdle) {
14939
14038
  this.commitApmIdleState(agentId, ap, false);
14940
14039
  this.startRuntimeTrace(agentId, ap, "runtime-profile", [message]);
14941
14040
  const written = this.deliverMessagesViaStdin(agentId, ap, [message], "idle");
@@ -14951,7 +14050,7 @@ Use ${communicationCommand("read_history")} to catch up on the channels listed a
14951
14050
  });
14952
14051
  return written;
14953
14052
  }
14954
- if (ap?.sessionId && ap.runtime.descriptor.busyDelivery === "direct") {
14053
+ if (ap && sessionReadyForDelivery && ap.runtime.descriptor.busyDelivery === "direct") {
14955
14054
  const written = this.deliverMessagesViaStdin(agentId, ap, [message], "busy");
14956
14055
  span.end(written ? "ok" : "error", {
14957
14056
  attrs: {
@@ -15859,6 +14958,7 @@ Use ${communicationCommand("read_history")} to catch up on the channels listed a
15859
14958
  model: ap.config.model,
15860
14959
  reason,
15861
14960
  hasSession: Boolean(ap.sessionId),
14961
+ sessionReadyForDelivery: ap.sessionReadyForDelivery,
15862
14962
  ...this.messagesTraceAttrs(messages),
15863
14963
  ...inputTraceAttrs,
15864
14964
  ...this.runtimeLaunchPolicyTraceAttrs(ap.config),
@@ -15867,6 +14967,7 @@ Use ${communicationCommand("read_history")} to catch up on the channels listed a
15867
14967
  });
15868
14968
  span.addEvent("daemon.turn.started", {
15869
14969
  reason,
14970
+ sessionReadyForDelivery: ap.sessionReadyForDelivery,
15870
14971
  ...this.messagesTraceAttrs(messages),
15871
14972
  ...inputTraceAttrs,
15872
14973
  ...this.runtimeLaunchPolicyTraceAttrs(ap.config),
@@ -15967,7 +15068,7 @@ Use ${communicationCommand("read_history")} to catch up on the channels listed a
15967
15068
  notifyGatedSteeringBoundary(agentId, ap, reason) {
15968
15069
  const readiness = reduceApmGatedFlushReadiness(ap.gatedSteering, {
15969
15070
  isGated: ap.runtime.descriptor.busyDelivery === "gated",
15970
- hasSession: Boolean(ap.sessionId),
15071
+ hasSession: this.canDeliverToRuntimeSession(ap),
15971
15072
  inboxLength: ap.inbox.length,
15972
15073
  reason
15973
15074
  });
@@ -16416,7 +15517,10 @@ Use ${communicationCommand("read_history")} to catch up on the channels listed a
16416
15517
  }
16417
15518
  switch (event.kind) {
16418
15519
  case "session_init":
16419
- if (ap) ap.sessionId = event.sessionId;
15520
+ if (ap) {
15521
+ ap.sessionId = event.sessionId;
15522
+ this.markSessionReadyForDelivery(ap, "session_init");
15523
+ }
16420
15524
  this.sendToServer({ type: "agent:session", agentId, sessionId: event.sessionId, launchId: ap?.launchId || void 0 });
16421
15525
  this.sendRuntimeProfileReport(agentId, "session_init");
16422
15526
  break;
@@ -16527,8 +15631,10 @@ Use ${communicationCommand("read_history")} to catch up on the channels listed a
16527
15631
  flushBoundaryMessages: false
16528
15632
  });
16529
15633
  this.flushPendingTrajectory(agentId);
15634
+ const turnEndSessionId = event.sessionId ?? ap?.driver.currentSessionId ?? void 0;
16530
15635
  if (ap) {
16531
- if (event.sessionId) ap.sessionId = event.sessionId;
15636
+ if (turnEndSessionId) ap.sessionId = turnEndSessionId;
15637
+ this.markSessionReadyForDelivery(ap, "turn_end");
16532
15638
  const stickyTerminalFailure = classifyStickyTerminalFailure(ap);
16533
15639
  if (!stickyTerminalFailure && ap.runtimeErrorDeliveryBackoff.reason === "runtime_error") {
16534
15640
  this.clearRuntimeErrorDeliveryBackoffWithTrace(agentId, ap, "turn_end_unclassified_runtime_error");
@@ -16536,7 +15642,8 @@ Use ${communicationCommand("read_history")} to catch up on the channels listed a
16536
15642
  const reduction = reduceApmGatedTurnEnd(ap.gatedSteering, {
16537
15643
  inboxLength: stickyTerminalFailure ? 0 : ap.inbox.length,
16538
15644
  supportsStdinNotification: ap.driver.supportsStdinNotification,
16539
- hasSession: Boolean(ap.sessionId),
15645
+ hasSession: this.canDeliverToRuntimeSession(ap),
15646
+ canDeliverWithoutSession: !ap.driver.requiresSessionInitForDelivery,
16540
15647
  terminateProcessOnTurnEnd: ap.driver.terminateProcessOnTurnEnd === true
16541
15648
  });
16542
15649
  this.commitGatedSteeringDecisionState(agentId, ap, reduction.nextState, { event: "turn_end" });
@@ -16582,8 +15689,8 @@ Use ${communicationCommand("read_history")} to catch up on the channels listed a
16582
15689
  }
16583
15690
  }
16584
15691
  }
16585
- if (event.sessionId) {
16586
- this.sendToServer({ type: "agent:session", agentId, sessionId: event.sessionId, launchId: ap?.launchId || void 0 });
15692
+ if (turnEndSessionId) {
15693
+ this.sendToServer({ type: "agent:session", agentId, sessionId: turnEndSessionId, launchId: ap?.launchId || void 0 });
16587
15694
  this.sendRuntimeProfileReport(agentId, "turn_end");
16588
15695
  }
16589
15696
  break;
@@ -16789,6 +15896,22 @@ Use ${communicationCommand("read_history")} to catch up on the channels listed a
16789
15896
  if (count === 0) return false;
16790
15897
  if (this.isApmIdle(ap)) return false;
16791
15898
  if (!ap.sessionId) return false;
15899
+ if (!this.canDeliverToRuntimeSession(ap)) {
15900
+ ap.notifications.add(count);
15901
+ this.recordDaemonTrace("daemon.agent.stdin_notification", {
15902
+ agentId,
15903
+ runtime: ap.config.runtime,
15904
+ model: ap.config.model,
15905
+ launchId: ap.launchId || void 0,
15906
+ outcome: "suppressed_session_not_ready",
15907
+ mode: "busy",
15908
+ pending_notification_count: count,
15909
+ inbox_count: ap.inbox.length,
15910
+ session_id_present: true,
15911
+ session_ready_for_delivery: false
15912
+ });
15913
+ return false;
15914
+ }
16792
15915
  const runtimeErrorBackoffRemainingMs = this.runtimeErrorDeliveryBackoffRemainingMs(ap);
16793
15916
  if (runtimeErrorBackoffRemainingMs > 0) {
16794
15917
  ap.notifications.add(count);
@@ -18204,22 +17327,6 @@ var DAEMON_CORE_TRACE_ATTR_CONTRACTS = {
18204
17327
  },
18205
17328
  endAttrs: ["outcome", "available_models_count", "diagnostics_count", "diagnostic_info_count", "diagnostic_warning_count", "requested_model", "resolved_model", "resolved_model_present", "error_class"]
18206
17329
  },
18207
- "daemon.pi.session.start": {
18208
- spanAttrs: ["agentId", "launchId", "runtime", "model", "session_id_present", "requested_session_id_present", "config_session_id_present", "input_chars", "input_bytes"],
18209
- eventAttrs: {
18210
- "daemon.pi.session.start.factory_ready": ["session_id_present"],
18211
- "daemon.pi.session.start.initial_prompt_dispatch": ["sdk_operation", "dispatch_reason"]
18212
- },
18213
- endAttrs: ["outcome", "session_id_present", "error_class"]
18214
- },
18215
- "daemon.pi.session.send": {
18216
- spanAttrs: ["agentId", "launchId", "runtime", "model", "session_id_present", "mode", "streaming", "input_chars", "input_bytes"],
18217
- endAttrs: ["outcome", "accepted_as", "sdk_operation", "dispatch_reason"]
18218
- },
18219
- "daemon.pi.session.sdk_call": {
18220
- spanAttrs: ["agentId", "launchId", "runtime", "model", "session_id_present", "sdk_operation", "dispatch_reason", "input_chars", "input_bytes"],
18221
- endAttrs: ["outcome", "sdk_operation", "dispatch_reason", "error_class"]
18222
- },
18223
17330
  "daemon.connection.local_disconnect_observed": {
18224
17331
  spanAttrs: ["running_agents_count", "idle_agents_count"]
18225
17332
  },
@@ -18233,7 +17340,7 @@ var DAEMON_CORE_TRACE_ATTR_CONTRACTS = {
18233
17340
  spanAttrs: ["agentId", "event_kind", "runtime"]
18234
17341
  }
18235
17342
  };
18236
- var DAEMON_CLI_USAGE = `Usage: slock-daemon --server-url <url> (--api-key <key> or ${DAEMON_API_KEY_ENV}=<key>)`;
17343
+ var DAEMON_CLI_USAGE = "Usage: slock-daemon --server-url <url> --api-key <key>";
18237
17344
  var RunnerCredentialMintError2 = class extends Error {
18238
17345
  code;
18239
17346
  retryable;
@@ -18269,9 +17376,9 @@ function runnerCredentialErrorDetail2(error) {
18269
17376
  async function waitForRunnerCredentialRetry2() {
18270
17377
  await new Promise((resolve) => setTimeout(resolve, RUNNER_CREDENTIAL_MINT_RETRY_DELAY_MS2));
18271
17378
  }
18272
- function parseDaemonCliArgs(args, env = {}) {
17379
+ function parseDaemonCliArgs(args) {
18273
17380
  let serverUrl = "";
18274
- let apiKey = env[DAEMON_API_KEY_ENV] ?? "";
17381
+ let apiKey = "";
18275
17382
  for (let i = 0; i < args.length; i++) {
18276
17383
  if (args[i] === "--server-url" && args[i + 1]) serverUrl = args[++i];
18277
17384
  if (args[i] === "--api-key" && args[i + 1]) apiKey = args[++i];
@@ -18308,7 +17415,7 @@ function resolveSlockCliPathOrEmpty(moduleUrl = import.meta.url) {
18308
17415
  }
18309
17416
  async function runBundledSlockCli(argv) {
18310
17417
  process.argv = [process.execPath, "slock", ...argv];
18311
- await import("./dist-53X4DIA6.js");
17418
+ await import("./dist-7ZEXJWIW.js");
18312
17419
  }
18313
17420
  function detectRuntimes(tracer = noopTracer) {
18314
17421
  const ids = [];
@@ -18356,20 +17463,6 @@ function detectRuntimes(tracer = noopTracer) {
18356
17463
  } catch {
18357
17464
  probeErrorPresent = true;
18358
17465
  }
18359
- if (!runtime.binary) {
18360
- if (runtime.supported) {
18361
- ids.push(runtime.id);
18362
- }
18363
- span.addEvent("daemon.runtime.detect.checked", {
18364
- runtime: runtime.id,
18365
- outcome: runtime.supported ? "available" : "unavailable",
18366
- version_present: false,
18367
- binary_path_present: false,
18368
- probe_error_present: probeErrorPresent,
18369
- builtin_runtime: true
18370
- });
18371
- continue;
18372
- }
18373
17466
  const detectionBinaries = [runtime.binary];
18374
17467
  let detectedByPath = false;
18375
17468
  for (const binary of detectionBinaries) {
@@ -19259,8 +18352,6 @@ var DaemonCore = class {
19259
18352
 
19260
18353
  export {
19261
18354
  subscribeDaemonLogs,
19262
- DAEMON_API_KEY_ENV,
19263
- scrubDaemonAuthEnv,
19264
18355
  resolveWorkspaceDirectoryPath,
19265
18356
  scanWorkspaceDirectories,
19266
18357
  deleteWorkspaceDirectory,