5d7c10aeab
- Updated runtime configuration to use __CS_AI_AGENT_WIDGET_CONFIG__ instead of __CS_AGENT_WIDGET_CONFIG__. - Changed message types in support host bridge from "cs-agent" to "cs-ai-agent". - Minified SDK script updated to reflect new AI agent naming conventions. - Adjusted scrollbar styles in main.scss to use .cs-ai-agent-scrollbar instead of .cs-agent-scrollbar.
43 lines
964 B
Go
43 lines
964 B
Go
package runtime
|
|
|
|
import (
|
|
"strings"
|
|
|
|
applicationruntime "cs-ai-agent/internal/ai/application/runtime"
|
|
svc "cs-ai-agent/internal/services"
|
|
)
|
|
|
|
var AIReplyService = newAIReplyService()
|
|
|
|
func init() {
|
|
svc.TriggerAIReplyAsyncHook = AIReplyService.TriggerReplyAsync
|
|
}
|
|
|
|
func newAIReplyService() *aiReplyService {
|
|
return &aiReplyService{
|
|
eligibility: newReplyEligibility(),
|
|
executor: newRuntimeReplyExecutor(),
|
|
interrupts: newReplyInterruptService(),
|
|
commit: newReplyCommitService(),
|
|
runlog: newReplyRunLogService(),
|
|
}
|
|
}
|
|
|
|
type aiReplyService struct {
|
|
eligibility *replyEligibility
|
|
executor *runtimeReplyExecutor
|
|
interrupts *replyInterruptService
|
|
commit *replyCommitService
|
|
runlog *replyRunLogService
|
|
}
|
|
|
|
func firstInvokedToolCode(summary *applicationruntime.Summary) string {
|
|
if summary == nil {
|
|
return ""
|
|
}
|
|
if len(summary.InvokedToolCodes) > 0 {
|
|
return strings.TrimSpace(summary.InvokedToolCodes[0])
|
|
}
|
|
return ""
|
|
}
|