MCPcopy Create free account
hub / github.com/arctic-cli/interface / cancel

Function cancel

packages/arctic/src/session/prompt.ts:354–368  ·  view source on GitHub ↗
(sessionID: string)

Source from the content-addressed store, hash-verified

352 }
353
354 export function cancel(sessionID: string) {
355 log.info("cancel", { sessionID })
356 const s = state()
357 const match = s[sessionID]
358 if (match) {
359 match.abort.abort()
360 for (const item of match.callbacks) {
361 item.reject()
362 }
363 delete s[sessionID]
364 }
365 // always set status to idle, even if no match in state
366 // this ensures status is properly reset if state got out of sync
367 SessionStatus.set(sessionID, { type: "idle" })
368 }
369
370 export const loop = fn(Identifier.schema("session"), async (sessionID) => {
371 const abort = start(sessionID)

Callers 2

prompt.tsFile · 0.70
shellFunction · 0.70

Calls 3

stateFunction · 0.85
abortMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected