MCPcopy
hub / github.com/claude-code-best/claude-code / remove

Function remove

src/utils/messageQueueManager.ts:273–292  ·  view source on GitHub ↗
(commandsToRemove: QueuedCommand[])

Source from the content-addressed store, hash-verified

271 * (e.g. from getCommandsByMaxPriority). Logs a 'remove' operation for each.
272 */
273export function remove(commandsToRemove: QueuedCommand[]): void {
274 if (commandsToRemove.length === 0) {
275 return
276 }
277
278 const before = commandQueue.length
279 for (let i = commandQueue.length - 1; i >= 0; i--) {
280 if (commandsToRemove.includes(commandQueue[i]!)) {
281 commandQueue.splice(i, 1)
282 }
283 }
284
285 if (commandQueue.length !== before) {
286 notifySubscribers()
287 }
288
289 for (const _cmd of commandsToRemove) {
290 logOperation('remove')
291 }
292}
293
294/**
295 * Remove commands matching a predicate.

Callers 2

removeEventListenerFunction · 0.50
bridge.test.tsFile · 0.50

Calls 2

notifySubscribersFunction · 0.85
logOperationFunction · 0.85

Tested by 1

removeEventListenerFunction · 0.40