()
| 245 | } |
| 246 | |
| 247 | function getReachableProfilesByName(): Map<string, ToolImplementationProfileId[]> { |
| 248 | if (cachedReachabilityByProfile === null) { |
| 249 | cachedReachabilityByProfile = new Map( |
| 250 | TOOL_IMPLEMENTATION_PROFILES.map(profile => [ |
| 251 | profile.id, |
| 252 | probeProfileBaseTools(profile), |
| 253 | ]), |
| 254 | ) |
| 255 | } |
| 256 | |
| 257 | const byName = new Map<string, ToolImplementationProfileId[]>() |
| 258 | for (const [profileId, tools] of cachedReachabilityByProfile) { |
| 259 | for (const toolName of tools) { |
| 260 | const reachableProfiles = byName.get(toolName) ?? [] |
| 261 | reachableProfiles.push(profileId) |
| 262 | byName.set(toolName, reachableProfiles) |
| 263 | } |
| 264 | } |
| 265 | |
| 266 | // StructuredOutput is a special noninteractive tool and is exercised by the |
| 267 | // smoke harness whenever a JSON schema is provided. |
| 268 | byName.set('StructuredOutput', ['structured_output_noninteractive']) |
| 269 | |
| 270 | return byName |
| 271 | } |
| 272 | |
| 273 | function probeProfileBaseTools(profile: ToolImplementationProfile): Set<string> { |
| 274 | const script = [ |
no test coverage detected