summaryrefslogtreecommitdiff
path: root/internal/agentloop/tools.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/agentloop/tools.go')
-rw-r--r--internal/agentloop/tools.go38
1 files changed, 35 insertions, 3 deletions
diff --git a/internal/agentloop/tools.go b/internal/agentloop/tools.go
index fc003cb..d803c23 100644
--- a/internal/agentloop/tools.go
+++ b/internal/agentloop/tools.go
@@ -11,9 +11,11 @@ import (
"github.com/thepeterstone/claudomator/internal/sandbox"
)
-// agentToolSpecs returns the eight tools available to the loop: the four
-// agent back-channel tools (mirroring the MCP tools ContainerRunner exposes)
-// plus the four sandbox tools, as provider-neutral ToolSpecs. Ported verbatim
+// agentToolSpecs returns the nine tools available to the loop: the five
+// agent back-channel tools (mirroring the MCP tools ContainerRunner exposes;
+// propose_epic was added in Phase 7c) plus the four sandbox tools, as
+// provider-neutral ToolSpecs. The original four (ask_user/report_summary/
+// spawn_subtask/record_progress) plus the sandbox tools were ported verbatim
// (same names/descriptions/JSON schemas) from the former
// executor.agentToolDefs (internal/executor/localtools.go).
func agentToolSpecs() []provider.ToolSpec {
@@ -67,6 +69,19 @@ func agentToolSpecs() []provider.ToolSpec {
},
},
{
+ Name: "propose_epic",
+ Description: "Group one or more stories under a new or existing epic (matched by exact name) when they form a cohesive initiative. Only call this when you've been given several story IDs and independently judge that they belong together.",
+ ParametersJSONSchema: map[string]any{
+ "type": "object",
+ "properties": map[string]any{
+ "name": strProp("short descriptive name for the epic; matched by exact name to reuse an existing epic instead of creating a duplicate"),
+ "description": strProp("optional longer description of the initiative"),
+ "story_ids": map[string]any{"type": "array", "items": map[string]any{"type": "string"}, "description": "the story IDs to group under this epic"},
+ },
+ "required": []string{"name", "story_ids"},
+ },
+ },
+ {
Name: "read_file",
Description: "Read the contents of a file in the sandbox working directory.",
ParametersJSONSchema: map[string]any{
@@ -179,6 +194,23 @@ func (l *Loop) dispatchTool(ctx context.Context, name, argsJSON string) (result
}
return "Noted.", false, nil
+ case "propose_epic":
+ var a struct {
+ Name string `json:"name"`
+ Description string `json:"description"`
+ StoryIDs []string `json:"story_ids"`
+ }
+ _ = json.Unmarshal([]byte(argsJSON), &a)
+ id, peErr := l.Channel.ProposeEpic(ctx, agentchannel.EpicProposal{
+ Name: a.Name,
+ Description: a.Description,
+ StoryIDs: a.StoryIDs,
+ })
+ if peErr != nil {
+ return "", false, peErr
+ }
+ return "Proposed epic " + id, false, nil
+
case "read_file":
var a struct {
Path string `json:"path"`