MCPcopy Create free account
hub / github.com/anomalyco/opencode / createScopedAttention

Function createScopedAttention

packages/opencode/src/plugin/tui/runtime.ts:162–191  ·  view source on GitHub ↗
(
  attention: TuiPluginApi["attention"],
  scope: PluginScope,
  root: string,
)

Source from the content-addressed store, hash-verified

160}
161
162function 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
193function createScopedMode(mode: TuiPluginApi["mode"], scope: PluginScope): TuiPluginApi["mode"] {
194 return {

Callers 1

pluginApiFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected