Skip to content

Commit d46a73d

Browse files
committed
snapshot
1 parent 4ecff05 commit d46a73d

File tree

6 files changed

+16
-29
lines changed

6 files changed

+16
-29
lines changed

app/summarize.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ import (
66
"os"
77
"strings"
88

9-
"gradient-engineer/playbook"
10-
tea "github.com/charmbracelet/bubbletea"
119
anthropic "github.com/anthropics/anthropic-sdk-go"
1210
anthopt "github.com/anthropics/anthropic-sdk-go/option"
11+
tea "github.com/charmbracelet/bubbletea"
1312
openai "github.com/openai/openai-go"
1413
openaiopt "github.com/openai/openai-go/option"
14+
"gradient-engineer/playbook"
1515
)
1616

1717
// SummaryCommand represents a command's description and its captured output
@@ -185,5 +185,3 @@ func summarizeCmd(s *Summarizer, systemPrompt string, commands []SummaryCommand)
185185
return llmMsg{summary: summary}
186186
}
187187
}
188-
189-

app/toolbox.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,24 @@ import (
1313
"strings"
1414
"time"
1515

16-
"gradient-engineer/playbook"
1716
"github.com/ulikunitz/xz"
1817
"gopkg.in/yaml.v3"
18+
"gradient-engineer/playbook"
1919
)
2020

2121
// DiagnosticCommand represents a diagnostic command with its actual command and display name
2222
type DiagnosticCommand struct {
23-
Command string // The actual command to execute
24-
Display string // Human-readable display name
25-
Spec *playbook.PlaybookCommand // Pointer to the originating playbook command spec
26-
Timeout time.Duration // Timeout for the command execution
23+
Command string // The actual command to execute
24+
Display string // Human-readable display name
25+
Spec *playbook.PlaybookCommand // Pointer to the originating playbook command spec
26+
Timeout time.Duration // Timeout for the command execution
2727
}
2828

2929
// Toolbox represents a downloaded and extracted toolbox
3030
type Toolbox struct {
31-
URL string // URL to download from
32-
TempDir string // Temporary directory where toolbox is extracted
33-
Playbook *playbook.PlaybookConfig // Loaded playbook configuration
31+
URL string // URL to download from
32+
TempDir string // Temporary directory where toolbox is extracted
33+
Playbook *playbook.PlaybookConfig // Loaded playbook configuration
3434
}
3535

3636
// NewToolbox creates a new Toolbox instance

app/ui.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ func NewModel(tb *Toolbox) *model {
104104
s.Style = lipgloss.NewStyle().Foreground(lipgloss.Color("205"))
105105
return s
106106
}(),
107-
startTime: time.Now(),
107+
startTime: time.Now(),
108108
summarizer: NewSummarizer(),
109109
}
110110
}

playbook/60-second-linux.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
id: 60-second-linux
12
nixpkgs:
23
version: "380be19fbd2d9079f677978361792cb25e8a3635" # nixos-22.05 branch
34
packages:

playbook/playbook.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package playbook
22

33
type PlaybookConfig struct {
4+
ID string `yaml:"id"`
45
Nixpkgs struct {
56
Version string `yaml:"version"`
67
Packages []string `yaml:"packages"`
@@ -15,5 +16,3 @@ type PlaybookCommand struct {
1516
Sudo bool `yaml:"sudo,omitempty"`
1617
TimeoutSeconds int `yaml:"timeout_seconds,omitempty"`
1718
}
18-
19-

toolbox/generate.go

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,9 @@ import (
1313
"time"
1414

1515
"gopkg.in/yaml.v3"
16+
"gradient-engineer/playbook"
1617
)
1718

18-
type playbookConfig struct {
19-
Nixpkgs struct {
20-
Version string `yaml:"version"`
21-
Packages []string `yaml:"packages"`
22-
} `yaml:"nixpkgs"`
23-
}
24-
2519
func main() {
2620
var yamlPath string
2721
var outPath string
@@ -78,12 +72,12 @@ func main() {
7872
fmt.Printf("created %s\n", outPath)
7973
}
8074

81-
func readYAML(path string) (*playbookConfig, error) {
75+
func readYAML(path string) (*playbook.PlaybookConfig, error) {
8276
data, err := os.ReadFile(path)
8377
if err != nil {
8478
return nil, err
8579
}
86-
var cfg playbookConfig
80+
var cfg playbook.PlaybookConfig
8781
if err := yaml.Unmarshal(data, &cfg); err != nil {
8882
return nil, err
8983
}
@@ -149,8 +143,6 @@ func fetchAndInstallProot(destDir string) error {
149143
return nil
150144
}
151145

152-
153-
154146
func extractProotFromAPK(apk []byte, destPath string) error {
155147
workDir, err := os.MkdirTemp("", "proot_apk_*")
156148
if err != nil {
@@ -251,6 +243,3 @@ func fatalf(format string, a ...any) {
251243
fmt.Fprintf(os.Stderr, format+"\n", a...)
252244
os.Exit(1)
253245
}
254-
255-
256-

0 commit comments

Comments
 (0)