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

Function clearRuntimeToolProgress

desktop/runtime/thread-publisher.ts:114–139  ·  view source on GitHub ↗
(
  runtime: PiRuntime,
  options: { toolCallId?: string | undefined; toolName?: string | undefined } = {},
)

Source from the content-addressed store, hash-verified

112}
113
114export function clearRuntimeToolProgress(
115 runtime: PiRuntime,
116 options: { toolCallId?: string | undefined; toolName?: string | undefined } = {},
117) {
118 const progress = liveToolProgressByRuntime.get(runtime)
119 if (!progress) {
120 return
121 }
122
123 if (options.toolCallId) {
124 progress.delete(options.toolCallId)
125 } else if (options.toolName) {
126 for (const [toolCallId, entry] of progress) {
127 if (entry.toolName === options.toolName) {
128 progress.delete(toolCallId)
129 break
130 }
131 }
132 } else {
133 progress.clear()
134 }
135
136 if (progress.size === 0) {
137 liveToolProgressByRuntime.delete(runtime)
138 }
139}
140
141function buildLiveThreadData(runtime: PiRuntime) {
142 const sessionPath = runtime.session.sessionFile

Callers 1

handleRuntimeMessageEndFunction · 0.90

Calls 1

getMethod · 0.80

Tested by

no test coverage detected