oficina / equipo Public

Clone
git clone https://amadan.net/oficina/equipo

Plain git — no account needed to clone.

Download

Download this file

1package coordinator
2
3import (
4 "amadan.net/oficina/equipo/internal/runnerproto"
5 "amadan.net/oficina/equipo/internal/taskplan"
6 "context"
7)
8
9type CoordinatorToolCall = runnerproto.CoordinatorToolCall
10type CoordinatorToolResult = runnerproto.CoordinatorToolResult
11type ClarificationQuestion = runnerproto.ClarificationQuestion
12type QuestionOption = runnerproto.QuestionOption
13type ToolClient interface {
14 Call(context.Context, CoordinatorToolCall) (CoordinatorToolResult, error)
15}
16
17type ToolFunc func(context.Context, CoordinatorToolCall) (CoordinatorToolResult, error)
18
19func (f ToolFunc) Call(ctx context.Context, c CoordinatorToolCall) (CoordinatorToolResult, error) {
20 return f(ctx, c)
21}
22
23type ReadProject struct {
24 ProjectID int64 `json:"project_id"`
25}
26type ReadTask struct {
27 TaskID string `json:"task_id"`
28}
29type PlanStep struct {
30 Key string `json:"key"`
31 Specialist string `json:"specialist,omitempty"`
32 Action string `json:"action"`
33 Instructions string `json:"instructions,omitempty"`
34 DependsOn []string `json:"depends_on,omitempty"`
35}
36type Plan struct {
37 PlaybookID string `json:"playbook_id,omitempty"`
38 PlaybookRevision int64 `json:"playbook_revision,omitempty"`
39 Kind taskplan.Kind `json:"kind"`
40 ProjectID int64 `json:"project_id"`
41 Steps []PlanStep `json:"steps"`
42}
43
44func (p Plan) TaskPlan() taskplan.Plan {
45 out := taskplan.Plan{Kind: p.Kind, ProjectID: p.ProjectID, PlaybookID: p.PlaybookID, PlaybookRevision: p.PlaybookRevision}
46 for _, s := range p.Steps {
47 out.Steps = append(out.Steps, taskplan.Step{Key: s.Key, Specialist: s.Specialist, Action: s.Action, Instructions: s.Instructions, DependsOn: s.DependsOn})
48 }
49 return out
50}
51
52type ProposeProject struct {
53 Repository string `json:"repository"`
54 Why string `json:"why"`
55}
56
57type ProposePlan struct {
58 MessageID string `json:"message_id"`
59 Plan Plan `json:"plan"`
60}
61type AskPerson struct {
62 MessageID string `json:"message_id"`
63 Question string `json:"question"`
64 Options []QuestionOption `json:"options"`
65}
66type RouteToTask struct {
67 MessageID string `json:"message_id"`
68 TaskID string `json:"task_id"`
69}
70type PostMessage struct {
71 Body string `json:"body"`
72 SourceRefs []taskplan.SourceRef `json:"source_refs"`
73}
74type SuggestPreference struct {
75 SourceMessageID string `json:"source_message_id"`
76 Text string `json:"text"`
77}
78type Draft struct {
79 Name string `json:"name"`
80 Instructions string `json:"instructions"`
81}
82type SuggestDraft struct {
83 SourceMessageIDs []string `json:"source_message_ids"`
84 Draft Draft `json:"draft"`
85}
86
87// EquipoStatus accepts no scope supplied by the model.
88type EquipoStatus struct{}
89