( entries: readonly ToolInventoryEntry[], )
| 46 | } |
| 47 | |
| 48 | export function collectToolInventoryGaps( |
| 49 | entries: readonly ToolInventoryEntry[], |
| 50 | ): ToolInventoryGap[] { |
| 51 | return [ |
| 52 | collectGap( |
| 53 | entries, |
| 54 | 'policy_only', |
| 55 | entry => entry.policyDefined && !entry.compiled, |
| 56 | ), |
| 57 | collectGap( |
| 58 | entries, |
| 59 | 'compiled_without_policy', |
| 60 | entry => entry.compiled && !entry.policyDefined, |
| 61 | ), |
| 62 | collectGap( |
| 63 | entries, |
| 64 | 'enabled_without_policy', |
| 65 | entry => entry.enabled && !entry.policyDefined, |
| 66 | ), |
| 67 | collectGap( |
| 68 | entries, |
| 69 | 'first_line_deferred', |
| 70 | entry => |
| 71 | entry.tier === 'first_line' && entry.turnOneOrDeferred === 'deferred', |
| 72 | ), |
| 73 | collectGap( |
| 74 | entries, |
| 75 | 'first_line_not_enabled', |
| 76 | entry => entry.tier === 'first_line' && !entry.enabled, |
| 77 | ), |
| 78 | collectGap( |
| 79 | entries, |
| 80 | 'gated_turn_one', |
| 81 | entry => entry.tier === 'gated' && entry.turnOneOrDeferred === 'turn_one', |
| 82 | ), |
| 83 | collectGap( |
| 84 | entries, |
| 85 | 'repl_only', |
| 86 | entry => entry.replExposed && !entry.baseRegistered, |
| 87 | ), |
| 88 | collectGap( |
| 89 | entries, |
| 90 | 'deferred_without_search_hint', |
| 91 | entry => |
| 92 | entry.turnOneOrDeferred === 'deferred' && |
| 93 | entry.searchHint === null && |
| 94 | entry.isMcp !== true, |
| 95 | ), |
| 96 | ].filter((gap): gap is ToolInventoryGap => gap !== null) |
| 97 | } |
| 98 | |
| 99 | export function indexToolInventoryGaps( |
| 100 | gaps: readonly ToolInventoryGap[], |
no test coverage detected