2026-04-09 10:01:23 +08:00
|
|
|
package runtime
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"context"
|
|
|
|
|
|
2026-04-13 20:37:22 +08:00
|
|
|
applicationruntime "cs-agent/internal/ai/application/runtime"
|
2026-04-09 10:01:23 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
var Service = newService()
|
|
|
|
|
|
|
|
|
|
func newService() *service {
|
|
|
|
|
return &service{
|
2026-04-13 20:37:22 +08:00
|
|
|
app: applicationruntime.NewService(),
|
2026-04-09 10:01:23 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type service struct {
|
2026-04-13 20:37:22 +08:00
|
|
|
app *applicationruntime.Service
|
2026-04-09 10:01:23 +08:00
|
|
|
}
|
|
|
|
|
|
2026-04-14 12:13:33 +08:00
|
|
|
func (s *service) Run(ctx context.Context, req applicationruntime.Request) (*applicationruntime.Summary, error) {
|
2026-04-12 23:37:52 +08:00
|
|
|
if s == nil || s.app == nil {
|
|
|
|
|
return nil, nil
|
2026-04-09 10:01:23 +08:00
|
|
|
}
|
2026-04-12 23:37:52 +08:00
|
|
|
return s.app.Run(ctx, req)
|
2026-04-09 10:01:23 +08:00
|
|
|
}
|
|
|
|
|
|
2026-04-14 12:13:33 +08:00
|
|
|
func (s *service) Resume(ctx context.Context, req applicationruntime.ResumeRequest) (*applicationruntime.Summary, error) {
|
2026-04-12 23:37:52 +08:00
|
|
|
if s == nil || s.app == nil {
|
|
|
|
|
return nil, nil
|
2026-04-10 14:43:57 +08:00
|
|
|
}
|
2026-04-12 23:37:52 +08:00
|
|
|
return s.app.Resume(ctx, req)
|
2026-04-10 14:43:57 +08:00
|
|
|
}
|