Changeset 0.21.5 (#91)
This commit is contained in:
@@ -207,6 +207,22 @@ func streamWithToolLoop(
|
||||
})
|
||||
sendEvent("tool_result", string(resultJSON))
|
||||
|
||||
// Emit workspace.file.changed for live editor updates (v0.21.5)
|
||||
if hub != nil && !toolResult.IsError && workspaceID != "" {
|
||||
if call.Name == "workspace_write" || call.Name == "workspace_patch" {
|
||||
var toolArgs struct{ Path string `json:"path"` }
|
||||
if json.Unmarshal([]byte(call.Arguments), &toolArgs) == nil && toolArgs.Path != "" {
|
||||
hub.SendToUser(userID, events.Event{
|
||||
Label: "workspace.file.changed",
|
||||
Payload: events.MustJSON(map[string]string{
|
||||
"workspace_id": workspaceID,
|
||||
"path": toolArgs.Path,
|
||||
}),
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Collect for persistence
|
||||
result.ToolActivity = append(result.ToolActivity, map[string]interface{}{
|
||||
"id": tc.ID,
|
||||
|
||||
Reference in New Issue
Block a user