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

Function cycle

packages/arctic/src/cli/cmd/tui/context/local.tsx:246–258  ·  view source on GitHub ↗
(direction: 1 | -1)

Source from the content-addressed store, hash-verified

244 }
245 }),
246 cycle(direction: 1 | -1) {
247 const current = currentModel()
248 if (!current) return
249 const recent = modelStore.recent
250 const index = recent.findIndex((x) => x.providerID === current.providerID && x.modelID === current.modelID)
251 if (index === -1) return
252 let next = index + direction
253 if (next < 0) next = recent.length - 1
254 if (next >= recent.length) next = 0
255 const val = recent[next]
256 if (!val) return
257 setModelStore("model", agent.current().name, { ...val })
258 },
259 cycleFavorite(direction: 1 | -1) {
260 const favorites = modelStore.favorite.filter((item) => isModelValid(item))
261 if (!favorites.length) {

Callers

nothing calls this directly

Calls 2

saveFunction · 0.70
currentMethod · 0.45

Tested by

no test coverage detected