MCPcopy Create free account
hub / github.com/browserwing/browserwing / GetExplorationScript

Method GetExplorationScript

backend/api/handlers_explore.go:116–135  ·  view source on GitHub ↗

GetExplorationScript returns the generated script for a completed session

(c *gin.Context)

Source from the content-addressed store, hash-verified

114
115// GetExplorationScript returns the generated script for a completed session
116func (h *Handler) GetExplorationScript(c *gin.Context) {
117 if h.explorer == nil {
118 c.JSON(http.StatusServiceUnavailable, gin.H{"error": "AI Explorer is not available"})
119 return
120 }
121
122 sessionID := c.Param("id")
123 session, ok := h.explorer.GetSession(sessionID)
124 if !ok {
125 c.JSON(http.StatusNotFound, gin.H{"error": "session not found"})
126 return
127 }
128
129 if session.GeneratedScript == nil {
130 c.JSON(http.StatusBadRequest, gin.H{"error": "script not ready yet", "status": session.Status})
131 return
132 }
133
134 c.JSON(http.StatusOK, session.GeneratedScript)
135}
136
137// SaveExplorationScript saves the generated script to the database
138func (h *Handler) SaveExplorationScript(c *gin.Context) {

Callers

nothing calls this directly

Calls 1

GetSessionMethod · 0.65

Tested by

no test coverage detected