feat: implement runtime service and types for application integration

This commit is contained in:
mlogclub
2026-04-13 20:37:22 +08:00
parent 2a5629b9f1
commit 521729f5d3
4 changed files with 48 additions and 9 deletions
@@ -0,0 +1,31 @@
package runtime
import (
"context"
runtimeapp "cs-agent/internal/ai/runtime/app"
)
type Service struct {
app *runtimeapp.Service
}
func NewService() *Service {
return &Service{
app: runtimeapp.NewService(),
}
}
func (s *Service) Run(ctx context.Context, req Request) (*Summary, error) {
if s == nil || s.app == nil {
return nil, nil
}
return s.app.Run(ctx, req)
}
func (s *Service) Resume(ctx context.Context, req ResumeRequest) (*Summary, error) {
if s == nil || s.app == nil {
return nil, nil
}
return s.app.Resume(ctx, req)
}
+9
View File
@@ -0,0 +1,9 @@
package runtime
import runtimeapp "cs-agent/internal/ai/runtime/app"
// TODO 为什么要定义类型别名?
type Request = runtimeapp.Request
type ResumeRequest = runtimeapp.ResumeRequest
type InterruptContextSummary = runtimeapp.InterruptContextSummary
type Summary = runtimeapp.Summary