| 160 | } |
| 161 | |
| 162 | function createScopedAttention( |
| 163 | attention: TuiPluginApi["attention"], |
| 164 | scope: PluginScope, |
| 165 | root: string, |
| 166 | ): TuiPluginApi["attention"] { |
| 167 | return { |
| 168 | notify(input) { |
| 169 | return attention.notify(input) |
| 170 | }, |
| 171 | soundboard: { |
| 172 | registerPack(pack) { |
| 173 | return scope.track( |
| 174 | attention.soundboard.registerPack({ |
| 175 | ...pack, |
| 176 | sounds: resolveHostAttentionSoundPaths(root, pack.sounds, { trim: true }), |
| 177 | }), |
| 178 | ) |
| 179 | }, |
| 180 | activate(id, options) { |
| 181 | return attention.soundboard.activate(id, options) |
| 182 | }, |
| 183 | current() { |
| 184 | return attention.soundboard.current() |
| 185 | }, |
| 186 | list() { |
| 187 | return attention.soundboard.list() |
| 188 | }, |
| 189 | }, |
| 190 | } |
| 191 | } |
| 192 | |
| 193 | function createScopedMode(mode: TuiPluginApi["mode"], scope: PluginScope): TuiPluginApi["mode"] { |
| 194 | return { |