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

Function getEffectiveThreadRunningState

shared/thread-running-state.ts:3–12  ·  view source on GitHub ↗
(
  persistedRunning: boolean | number,
  liveThread: Pick<ThreadData, 'isStreaming' | 'isCompacting'> | null,
)

Source from the content-addressed store, hash-verified

1import type { InboxThread, ThreadData } from './desktop-contracts'
2
3export function getEffectiveThreadRunningState(
4 persistedRunning: boolean | number,
5 liveThread: Pick<ThreadData, 'isStreaming' | 'isCompacting'> | null,
6) {
7 if (liveThread) {
8 return liveThread.isStreaming || liveThread.isCompacting
9 }
10
11 return Boolean(persistedRunning)
12}
13
14export function sortInboxThreadsByPriority(threads: InboxThread[]) {
15 return [...threads].sort((left, right) => {

Callers 3

hasRunningProjectThreadFunction · 0.90
listProjectThreadsFunction · 0.90
listInboxThreadsFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected