chore: import clean Agent Desk snapshot (2/7)

This commit is contained in:
2026-10-16 11:57:21 +00:00
parent 79176541c7
commit 89c5231c4c
461 changed files with 60092 additions and 0 deletions

View File

@@ -0,0 +1,50 @@
package runtime
import (
"context"
"strings"
applicationruntime "agent-desk/internal/ai/application/runtime"
svc "agent-desk/internal/services"
)
var AIReplyService = newAIReplyService()
func init() {
svc.TriggerAIReplyAsyncHook = AIReplyService.TriggerReplyAsync
}
type replyExecutor interface {
Run(ctx context.Context, input runtimeReplyRunInput) (*applicationruntime.RunResult, error)
ResumePendingInterrupt(ctx context.Context, input runtimeReplyResumeInput) (*applicationruntime.RunResult, error)
}
func newAIReplyService() *aiReplyService {
return newAIReplyServiceWithExecutor(newRuntimeReplyExecutor())
}
func newAIReplyServiceWithExecutor(executor replyExecutor) *aiReplyService {
return &aiReplyService{
eligibility: newReplyEligibility(),
executor: executor,
interrupts: newReplyInterruptService(),
commit: newReplyCommitService(),
}
}
type aiReplyService struct {
eligibility *replyEligibility
executor replyExecutor
interrupts *replyInterruptService
commit *replyCommitService
}
func firstInvokedToolCode(summary *applicationruntime.RunResult) string {
if summary == nil {
return ""
}
if len(summary.InvokedToolCodes) > 0 {
return strings.TrimSpace(summary.InvokedToolCodes[0])
}
return ""
}