()
| 328 | } |
| 329 | |
| 330 | async function getCommandDiagnosticsReport() { |
| 331 | const [ |
| 332 | commandsModule, |
| 333 | fastModeModule, |
| 334 | advisorModule, |
| 335 | referralModule, |
| 336 | bridgeModule, |
| 337 | voiceModule, |
| 338 | stateModule, |
| 339 | sandboxModule, |
| 340 | envModule, |
| 341 | ] = await Promise.all([ |
| 342 | import('../../commands.js'), |
| 343 | import('../../utils/fastMode.js'), |
| 344 | import('../../utils/advisor.js'), |
| 345 | import('../../services/api/referral.js'), |
| 346 | import('../../bridge/bridgeEnabled.js'), |
| 347 | import('../../voice/voiceModeEnabled.js'), |
| 348 | import('../../bootstrap/state.js'), |
| 349 | import('../../utils/sandbox/sandbox-adapter.js'), |
| 350 | import('../../utils/env.js'), |
| 351 | ]) |
| 352 | |
| 353 | const nativeCsiuTerminals = { |
| 354 | ghostty: 'Ghostty', |
| 355 | kitty: 'Kitty', |
| 356 | 'iTerm.app': 'iTerm2', |
| 357 | WezTerm: 'WezTerm', |
| 358 | } |
| 359 | |
| 360 | const modules = { |
| 361 | advisorModule, |
| 362 | bridgeModule, |
| 363 | commandSession: getCurrentCommandAvailabilitySession(), |
| 364 | envModule, |
| 365 | fastModeModule, |
| 366 | nativeCsiuTerminals, |
| 367 | referralModule, |
| 368 | sandboxModule, |
| 369 | stateModule, |
| 370 | voiceModule, |
| 371 | } |
| 372 | |
| 373 | const groups = new Map() |
| 374 | |
| 375 | for (const cmd of commandsModule.getBuiltInCommandsForDiagnostics()) { |
| 376 | const name = commandsModule.getCommandName(cmd) |
| 377 | const availableHere = commandsModule.meetsAvailabilityRequirement(cmd) |
| 378 | const enabled = commandsModule.isCommandEnabled(cmd) |
| 379 | const hidden = !!cmd.isHidden |
| 380 | const hiddenDescriptor = Object.getOwnPropertyDescriptor(cmd, 'isHidden') |
| 381 | const visibleInUi = availableHere && enabled && !hidden |
| 382 | const reasons = await getCommandReasons( |
| 383 | name, |
| 384 | cmd, |
| 385 | { availableHere, enabled, hidden, hiddenDescriptor }, |
| 386 | modules, |
| 387 | ) |
no test coverage detected