Bold questions
This commit is contained in:
+4
-35
@@ -13,8 +13,6 @@ import (
|
||||
"strings"
|
||||
|
||||
"g.fc.run/misc/byre/internal/claude"
|
||||
"g.fc.run/misc/byre/internal/mcp"
|
||||
"g.fc.run/misc/byre/internal/report"
|
||||
)
|
||||
|
||||
func runCmd(args []string) {
|
||||
@@ -27,18 +25,12 @@ func runCmd(args []string) {
|
||||
fatal("getwd", "err", err)
|
||||
}
|
||||
|
||||
gate := &report.Gate{OnReport: printReport}
|
||||
|
||||
ctx := context.Background()
|
||||
s, err := claude.Start(ctx, claude.Options{
|
||||
Cwd: dir,
|
||||
Resume: *resume,
|
||||
GitName: gitConfig(dir, "user.name"),
|
||||
GitEmail: gitConfig(dir, "user.email"),
|
||||
MCPServers: []*mcp.Server{{Name: "byre", Version: "0.0.0", Tools: []mcp.Tool{gate.Tool()}}},
|
||||
Hooks: map[string][]claude.HookMatcher{
|
||||
"Stop": {{Func: gate.StopHook}},
|
||||
},
|
||||
Cwd: dir,
|
||||
Resume: *resume,
|
||||
GitName: gitConfig(dir, "user.name"),
|
||||
GitEmail: gitConfig(dir, "user.email"),
|
||||
})
|
||||
if err != nil {
|
||||
fatal("start claude", "err", err)
|
||||
@@ -62,7 +54,6 @@ func runCmd(args []string) {
|
||||
if strings.TrimSpace(line) == "" {
|
||||
continue
|
||||
}
|
||||
gate.Reset()
|
||||
err := s.Send(line)
|
||||
if err != nil {
|
||||
fatal("send", "err", err)
|
||||
@@ -148,28 +139,6 @@ func printEvent(ev claude.Event) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func printReport(r report.Report) {
|
||||
fmt.Println("── report")
|
||||
sections := []struct {
|
||||
name string
|
||||
items []string
|
||||
}{
|
||||
{"done", r.Done},
|
||||
{"next steps", r.NextSteps},
|
||||
{"risks", r.Risks},
|
||||
{"deviations", r.Deviations},
|
||||
}
|
||||
for _, sec := range sections {
|
||||
if len(sec.items) == 0 {
|
||||
continue
|
||||
}
|
||||
fmt.Printf(" %s:\n", sec.name)
|
||||
for _, item := range sec.items {
|
||||
fmt.Printf(" • %s\n", item)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func readLines(out chan<- string) {
|
||||
defer close(out)
|
||||
sc := bufio.NewScanner(os.Stdin)
|
||||
|
||||
Reference in New Issue
Block a user