Lead create_project tool
This commit is contained in:
@@ -253,6 +253,27 @@ func (m *Manager) leadTools(l *live) []mcp.Tool {
|
||||
return fmt.Sprintf("Task %s %q created from %s and its agent started.", task.Id, task.Title, task.BaseRef), nil
|
||||
}),
|
||||
|
||||
tool("create_project",
|
||||
"Add a project to byre for the human: name it, and give the path of a git repository on this machine. "+
|
||||
"byre records the repository's root and default branch. Returns the project as JSON.",
|
||||
`{"type": "object", "properties": {
|
||||
"name": {"type": "string"},
|
||||
"repo_path": {"type": "string"}
|
||||
}, "required": ["name", "repo_path"]}`,
|
||||
func(ctx context.Context, user api.User, raw json.RawMessage) (string, error) {
|
||||
args := api.ProjectCreate{}
|
||||
err := json.Unmarshal(raw, &args)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
p, err := m.addProject(ctx, args.Name, args.RepoPath, user.Login)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
b, err := json.MarshalIndent(p, "", " ")
|
||||
return string(b), err
|
||||
}),
|
||||
|
||||
tool("start_todo",
|
||||
"Start a task on an item of a project's TODO.md (its title, exactly as list_tasks' project or the file on the default branch has it). "+
|
||||
"With workflow, it runs that workflow with the item as its brief, each stage as its own task, and model can't be given.",
|
||||
|
||||
Reference in New Issue
Block a user