MCPcopy Create free account
hub / github.com/IgorWarzocha/howcode / removeQueuedPromptById

Function removeQueuedPromptById

desktop/runtime/composer-queue.ts:74–92  ·  view source on GitHub ↗
(
  queue: ComposerQueueSnapshot,
  mode: ComposerQueueMode,
  queueId: string,
)

Source from the content-addressed store, hash-verified

72}
73
74export function removeQueuedPromptById(
75 queue: ComposerQueueSnapshot,
76 mode: ComposerQueueMode,
77 queueId: string,
78) {
79 const nextQueue = cloneComposerQueue(queue)
80 const targetQueue = mode === 'steer' ? nextQueue.steering : nextQueue.followUp
81 const queueIndex = findQueuedPromptIndexById(mode, targetQueue, queueId)
82
83 if (queueIndex === null || queueIndex < 0 || queueIndex >= targetQueue.length) {
84 return null
85 }
86
87 const [dequeuedText] = targetQueue.splice(queueIndex, 1)
88 return {
89 dequeuedText: dequeuedText ?? null,
90 nextQueue,
91 }
92}
93
94export async function replayComposerQueue(
95 session: ComposerQueueSession,

Callers 2

dequeueComposerPromptFunction · 0.90
dequeueComposerPromptFunction · 0.90

Calls 2

cloneComposerQueueFunction · 0.85

Tested by

no test coverage detected