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

Function handleRuntimeToolEvent

desktop/runtime/runtime-registry.ts:170–186  ·  view source on GitHub ↗
(
  runtime: PiRuntime,
  event: Extract<
    RuntimeSessionEvent,
    { type: 'tool_execution_start' | 'tool_execution_update' | 'tool_execution_end' }
  >,
)

Source from the content-addressed store, hash-verified

168}
169
170function handleRuntimeToolEvent(
171 runtime: PiRuntime,
172 event: Extract<
173 RuntimeSessionEvent,
174 { type: 'tool_execution_start' | 'tool_execution_update' | 'tool_execution_end' }
175 >,
176) {
177 rememberRuntimeToolProgress(runtime, {
178 toolCallId: event.toolCallId,
179 toolName: event.toolName,
180 args: 'args' in event ? event.args : undefined,
181 partialResult: getRuntimeToolProgressPartial(event),
182 isError: event.type === 'tool_execution_end' ? event.isError : false,
183 terminal: event.type === 'tool_execution_end',
184 })
185 scheduleLiveThreadUpdate(runtime, publishLiveThreadUpdate)
186}
187
188function handleRuntimeSessionEvent(runtime: PiRuntime, event: RuntimeSessionEvent) {
189 const runtimeKey = getPersistedSessionPath(runtime.session.sessionFile)

Callers 1

Calls 3

scheduleLiveThreadUpdateFunction · 0.90

Tested by

no test coverage detected