feat: remove deprecated service and types, and refactor tool search request handling

This commit is contained in:
mlogclub
2026-04-14 11:07:26 +08:00
parent c12e75b6a1
commit 2211f29da7
10 changed files with 100 additions and 178 deletions
@@ -1,33 +0,0 @@
package engine
import (
"context"
runtimeeino "cs-agent/internal/ai/infra/eino"
)
type Service struct {
executor *runtimeeino.RuntimeExecutor
}
func NewService() *Service {
return &Service{
executor: runtimeeino.NewRuntimeExecutor(),
}
}
func (s *Service) Run(ctx context.Context, req Request) (*Summary, error) {
return s.ExecuteRun(ctx, req)
}
func (s *Service) ExecuteRun(ctx context.Context, req RunInput) (*RunResult, error) {
return s.executor.ExecuteRun(ctx, runtimeeino.RunInput(req))
}
func (s *Service) Resume(ctx context.Context, req ResumeRequest) (*Summary, error) {
return s.ExecuteResume(ctx, req)
}
func (s *Service) ExecuteResume(ctx context.Context, req ResumeInput) (*RunResult, error) {
return s.executor.ExecuteResume(ctx, runtimeeino.ResumeInput(req))
}
@@ -1,13 +0,0 @@
package engine
import runtimeeino "cs-agent/internal/ai/infra/eino"
// TODO 这个地方为什么要定义类型别名,不能直接用吗?
type RunInput = runtimeeino.RunInput
type ResumeInput = runtimeeino.ResumeInput
type InterruptContextSummary = runtimeeino.InterruptContextSummary
type RunResult = runtimeeino.RunResult
type Request = RunInput
type ResumeRequest = ResumeInput
type Summary = RunResult
@@ -1,31 +0,0 @@
package executor
import (
"context"
publicexecutor "cs-agent/internal/ai/runtime/executor"
)
type Service struct {
inner *publicexecutor.Service
}
func NewService() *Service {
return &Service{
inner: publicexecutor.NewService(),
}
}
func (s *Service) ExecuteRun(ctx context.Context, req RunInput) (*RunResult, error) {
if s == nil || s.inner == nil {
return nil, nil
}
return s.inner.ExecuteRun(ctx, publicexecutor.RunInput(req))
}
func (s *Service) ExecuteResume(ctx context.Context, req ResumeInput) (*RunResult, error) {
if s == nil || s.inner == nil {
return nil, nil
}
return s.inner.ExecuteResume(ctx, publicexecutor.ResumeInput(req))
}
@@ -1,8 +0,0 @@
package executor
import publicexecutor "cs-agent/internal/ai/runtime/executor"
type RunInput = publicexecutor.RunInput
type ResumeInput = publicexecutor.ResumeInput
type InterruptContextSummary = publicexecutor.InterruptContextSummary
type RunResult = publicexecutor.RunResult