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

Function publishThreadUpdate

desktop/runtime-host/live-thread-publisher.ts:48–65  ·  view source on GitHub ↗
(runtime: PiRuntime, reason: RuntimeThreadReason)

Source from the content-addressed store, hash-verified

46}
47
48export async function publishThreadUpdate(runtime: PiRuntime, reason: RuntimeThreadReason) {
49 const sessionPath = runtime.session.sessionFile
50 if (!sessionPath) return
51 const liveThread = buildLiveThreadData(runtime)
52 if (!liveThread) return
53 emitDesktopEvent({ type: 'internal-thread-update', sessionPath })
54 emitDesktopEvent({
55 type: 'thread-update',
56 reason,
57 projectId: runtime.cwd,
58 threadId: runtime.session.sessionId,
59 sessionPath,
60 chatGroupId: runtime.chatGroupId ?? null,
61 isChat: isChatSessionPath(sessionPath),
62 thread: normalizeThreadDataForReason(liveThread, reason),
63 composer: await buildComposerState(runtime, { includeContextUsage: reason !== 'update' }),
64 })
65}
66
67export function publishComposerUpdate(
68 composer: Awaited<ReturnType<typeof buildComposerState>>,

Callers 5

promptComposerRuntimeFunction · 0.90
handleRuntimeMessageEndFunction · 0.90
deferLiveThreadUpdateFunction · 0.70
scheduleLiveThreadUpdateFunction · 0.70

Calls 5

emitDesktopEventFunction · 0.90
isChatSessionPathFunction · 0.90
buildComposerStateFunction · 0.90
buildLiveThreadDataFunction · 0.70

Tested by

no test coverage detected