Add server-side workflows with YAML files, task freeze and lead tools
This commit is contained in:
@@ -32,7 +32,7 @@ func (m *Manager) leadTools(l *live) []mcp.Tool {
|
||||
}
|
||||
taskOnly := `{"type": "object", "properties": {"task_id": {"type": "string"}}, "required": ["task_id"]}`
|
||||
|
||||
return []mcp.Tool{
|
||||
return append([]mcp.Tool{
|
||||
tool("list_tasks",
|
||||
"List every project and its active tasks (id, title, worktree path, the agent's state and model, and open inbox items), "+
|
||||
"and the titles of its TODO.md items on the default branch that no active task was started from.",
|
||||
@@ -162,7 +162,8 @@ func (m *Manager) leadTools(l *live) []mcp.Tool {
|
||||
"title": {"type": "string"},
|
||||
"prompt": {"type": "string"},
|
||||
"from_task_id": {"type": "string"},
|
||||
"model": {"type": "string"}
|
||||
"model": {"type": "string"},
|
||||
"workflow": {"type": "string", "description": "The name of a workflow for the task to freeze a copy of."}
|
||||
}, "required": ["project_id", "title", "prompt"]}`,
|
||||
func(ctx context.Context, user api.User, raw json.RawMessage) (string, error) {
|
||||
args := struct {
|
||||
@@ -171,6 +172,7 @@ func (m *Manager) leadTools(l *live) []mcp.Tool {
|
||||
Prompt string `json:"prompt"`
|
||||
FromTaskID string `json:"from_task_id"`
|
||||
Model string `json:"model"`
|
||||
Workflow string `json:"workflow"`
|
||||
}{}
|
||||
err := json.Unmarshal(raw, &args)
|
||||
if err != nil {
|
||||
@@ -197,7 +199,7 @@ func (m *Manager) leadTools(l *live) []mcp.Tool {
|
||||
return "", err
|
||||
}
|
||||
}
|
||||
task, err := m.CreateTask(ctx, project, args.Title, user.Login, base, leadActor(user.Login))
|
||||
task, err := m.CreateTask(ctx, project, args.Title, user.Login, base, leadActor(user.Login), args.Workflow)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
@@ -213,13 +215,15 @@ func (m *Manager) leadTools(l *live) []mcp.Tool {
|
||||
`{"type": "object", "properties": {
|
||||
"project_id": {"type": "string"},
|
||||
"title": {"type": "string"},
|
||||
"model": {"type": "string"}
|
||||
"model": {"type": "string"},
|
||||
"workflow": {"type": "string", "description": "The name of a workflow for the task to freeze a copy of."}
|
||||
}, "required": ["project_id", "title"]}`,
|
||||
func(ctx context.Context, user api.User, raw json.RawMessage) (string, error) {
|
||||
args := struct {
|
||||
ProjectID string `json:"project_id"`
|
||||
Title string `json:"title"`
|
||||
Model string `json:"model"`
|
||||
Workflow string `json:"workflow"`
|
||||
}{}
|
||||
err := json.Unmarshal(raw, &args)
|
||||
if err != nil {
|
||||
@@ -229,7 +233,7 @@ func (m *Manager) leadTools(l *live) []mcp.Tool {
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
task, err := m.StartTodo(ctx, project, user, args.Title, m.modelOr(args.Model, l), leadActor(user.Login))
|
||||
task, err := m.StartTodo(ctx, project, user, args.Title, m.modelOr(args.Model, l), leadActor(user.Login), args.Workflow)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
@@ -362,7 +366,7 @@ func (m *Manager) leadTools(l *live) []mcp.Tool {
|
||||
m.mu.Unlock()
|
||||
return "byre will ask for your handoff once this turn ends.", nil
|
||||
}),
|
||||
}
|
||||
}, m.workflowTools(tool)...)
|
||||
}
|
||||
|
||||
func (m *Manager) SetFocus(ctx context.Context, login string, f api.Focus, actor string) error {
|
||||
|
||||
Reference in New Issue
Block a user