From ce28b822f90aac798f70e28ff908c45df171f857 Mon Sep 17 00:00:00 2001 From: Jerry Yan <792602257@qq.com> Date: Thu, 7 May 2026 14:09:42 +0800 Subject: [PATCH] feat(acp): SessionService interface + CreateSessionInput --- internal/acp/domain.go | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/internal/acp/domain.go b/internal/acp/domain.go index 3976be5..6582d75 100644 --- a/internal/acp/domain.go +++ b/internal/acp/domain.go @@ -115,9 +115,23 @@ type AgentKindService interface { Delete(ctx context.Context, c Caller, id uuid.UUID) error } -// SessionService 在 Part 2 实施。占位以便 handler.go 编译通过。 +// SessionService 暴露 Session 聚合根的应用服务方法。 type SessionService interface { - // methods filled in Part 2 + Create(ctx context.Context, c Caller, in CreateSessionInput) (*Session, error) + Get(ctx context.Context, c Caller, id uuid.UUID) (*Session, error) + List(ctx context.Context, c Caller, all bool) ([]*Session, error) + Terminate(ctx context.Context, c Caller, id uuid.UUID) error +} + +// CreateSessionInput 是创建 session 的入参。 +// branch / issue_number / requirement_number 三选一或全空(spec §8.1)。 +type CreateSessionInput struct { + WorkspaceID uuid.UUID + AgentKindID uuid.UUID + Branch *string + IssueNumber *int + RequirementNumber *int + InitialPrompt *string } // CreateAgentKindInput 携带创建必需字段。Args / Env 可为 nil。