on main help sign in
fix diff
0136948Kujtim Hoxha
go.mod+16−4
@@ -18,6 +18,7 @@ require (
18 github.com/charmbracelet/lipgloss v1.1.0
18 github.com/charmbracelet/lipgloss v1.1.0
19 github.com/charmbracelet/x/ansi v0.8.0
19 github.com/charmbracelet/x/ansi v0.8.0
20 github.com/fsnotify/fsnotify v1.8.0
20 github.com/fsnotify/fsnotify v1.8.0
21+ github.com/go-git/go-git/v5 v5.15.0
21 github.com/go-logfmt/logfmt v0.6.0
22 github.com/go-logfmt/logfmt v0.6.0
22 github.com/golang-migrate/migrate/v4 v4.18.2
23 github.com/golang-migrate/migrate/v4 v4.18.2
23 github.com/google/generative-ai-go v0.19.0
24 github.com/google/generative-ai-go v0.19.0
@@ -46,6 +47,9 @@ require (
46 cloud.google.com/go/auth/oauth2adapt v0.2.6 // indirect
47 cloud.google.com/go/auth/oauth2adapt v0.2.6 // indirect
47 cloud.google.com/go/compute/metadata v0.6.0 // indirect
48 cloud.google.com/go/compute/metadata v0.6.0 // indirect
48 cloud.google.com/go/longrunning v0.5.7 // indirect
49 cloud.google.com/go/longrunning v0.5.7 // indirect
50+ dario.cat/mergo v1.0.0 // indirect
51+ github.com/Microsoft/go-winio v0.6.2 // indirect
52+ github.com/ProtonMail/go-crypto v1.1.6 // indirect
49 github.com/andybalholm/cascadia v1.3.2 // indirect
53 github.com/andybalholm/cascadia v1.3.2 // indirect
50 github.com/atotto/clipboard v0.1.4 // indirect
54 github.com/atotto/clipboard v0.1.4 // indirect
51 github.com/aws/aws-sdk-go-v2 v1.30.3 // indirect
55 github.com/aws/aws-sdk-go-v2 v1.30.3 // indirect
@@ -68,15 +72,20 @@ require (
68 github.com/charmbracelet/x/cellbuf v0.0.13-0.20250311204145-2c3ea96c31dd // indirect
72 github.com/charmbracelet/x/cellbuf v0.0.13-0.20250311204145-2c3ea96c31dd // indirect
69 github.com/charmbracelet/x/exp/strings v0.0.0-20240722160745-212f7b056ed0 // indirect
73 github.com/charmbracelet/x/exp/strings v0.0.0-20240722160745-212f7b056ed0 // indirect
70 github.com/charmbracelet/x/term v0.2.1 // indirect
74 github.com/charmbracelet/x/term v0.2.1 // indirect
75+ github.com/cloudflare/circl v1.6.1 // indirect
76+ github.com/cyphar/filepath-securejoin v0.4.1 // indirect
71 github.com/davecgh/go-spew v1.1.1 // indirect
77 github.com/davecgh/go-spew v1.1.1 // indirect
72 github.com/dlclark/regexp2 v1.11.4 // indirect
78 github.com/dlclark/regexp2 v1.11.4 // indirect
73 github.com/dustin/go-humanize v1.0.1 // indirect
79 github.com/dustin/go-humanize v1.0.1 // indirect
80+ github.com/emirpasic/gods v1.18.1 // indirect
74 github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect
81 github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect
75 github.com/felixge/httpsnoop v1.0.4 // indirect
82 github.com/felixge/httpsnoop v1.0.4 // indirect
83+ github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
84+ github.com/go-git/go-billy/v5 v5.6.2 // indirect
76 github.com/go-logr/logr v1.4.2 // indirect
85 github.com/go-logr/logr v1.4.2 // indirect
77 github.com/go-logr/stdr v1.2.2 // indirect
86 github.com/go-logr/stdr v1.2.2 // indirect
78 github.com/go-viper/mapstructure/v2 v2.2.1 // indirect
87 github.com/go-viper/mapstructure/v2 v2.2.1 // indirect
79− github.com/google/go-cmp v0.7.0 // indirect
88+ github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect
80 github.com/google/s2a-go v0.1.8 // indirect
89 github.com/google/s2a-go v0.1.8 // indirect
81 github.com/googleapis/enterprise-certificate-proxy v0.3.4 // indirect
90 github.com/googleapis/enterprise-certificate-proxy v0.3.4 // indirect
82 github.com/googleapis/gax-go/v2 v2.14.1 // indirect
91 github.com/googleapis/gax-go/v2 v2.14.1 // indirect
@@ -84,6 +93,8 @@ require (
84 github.com/hashicorp/errwrap v1.1.0 // indirect
93 github.com/hashicorp/errwrap v1.1.0 // indirect
85 github.com/hashicorp/go-multierror v1.1.1 // indirect
94 github.com/hashicorp/go-multierror v1.1.1 // indirect
86 github.com/inconshreveable/mousetrap v1.1.0 // indirect
95 github.com/inconshreveable/mousetrap v1.1.0 // indirect
96+ github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
97+ github.com/kevinburke/ssh_config v1.2.0 // indirect
87 github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
98 github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
88 github.com/mattn/go-isatty v0.0.20 // indirect
99 github.com/mattn/go-isatty v0.0.20 // indirect
89 github.com/mattn/go-localereader v0.0.1 // indirect
100 github.com/mattn/go-localereader v0.0.1 // indirect
@@ -91,11 +102,12 @@ require (
91 github.com/mitchellh/hashstructure/v2 v2.0.2 // indirect
102 github.com/mitchellh/hashstructure/v2 v2.0.2 // indirect
92 github.com/muesli/cancelreader v0.2.2 // indirect
103 github.com/muesli/cancelreader v0.2.2 // indirect
93 github.com/pelletier/go-toml/v2 v2.2.3 // indirect
104 github.com/pelletier/go-toml/v2 v2.2.3 // indirect
105+ github.com/pjbgf/sha1cd v0.3.2 // indirect
94 github.com/pmezard/go-difflib v1.0.0 // indirect
106 github.com/pmezard/go-difflib v1.0.0 // indirect
95 github.com/rivo/uniseg v0.4.7 // indirect
107 github.com/rivo/uniseg v0.4.7 // indirect
96− github.com/rogpeppe/go-internal v1.14.1 // indirect
97 github.com/sagikazarmark/locafero v0.7.0 // indirect
108 github.com/sagikazarmark/locafero v0.7.0 // indirect
98 github.com/sahilm/fuzzy v0.1.1 // indirect
109 github.com/sahilm/fuzzy v0.1.1 // indirect
110+ github.com/skeema/knownhosts v1.3.1 // indirect
99 github.com/sourcegraph/conc v0.3.0 // indirect
111 github.com/sourcegraph/conc v0.3.0 // indirect
100 github.com/spf13/afero v1.12.0 // indirect
112 github.com/spf13/afero v1.12.0 // indirect
101 github.com/spf13/cast v1.7.1 // indirect
113 github.com/spf13/cast v1.7.1 // indirect
@@ -105,6 +117,7 @@ require (
105 github.com/tidwall/match v1.1.1 // indirect
117 github.com/tidwall/match v1.1.1 // indirect
106 github.com/tidwall/pretty v1.2.1 // indirect
118 github.com/tidwall/pretty v1.2.1 // indirect
107 github.com/tidwall/sjson v1.2.5 // indirect
119 github.com/tidwall/sjson v1.2.5 // indirect
120+ github.com/xanzy/ssh-agent v0.3.3 // indirect
108 github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
121 github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
109 github.com/yosida95/uritemplate/v3 v3.0.2 // indirect
122 github.com/yosida95/uritemplate/v3 v3.0.2 // indirect
110 github.com/yuin/goldmark v1.7.8 // indirect
123 github.com/yuin/goldmark v1.7.8 // indirect
@@ -118,7 +131,6 @@ require (
118 go.uber.org/multierr v1.9.0 // indirect
131 go.uber.org/multierr v1.9.0 // indirect
119 golang.design/x/clipboard v0.7.0 // indirect
132 golang.design/x/clipboard v0.7.0 // indirect
120 golang.org/x/crypto v0.37.0 // indirect
133 golang.org/x/crypto v0.37.0 // indirect
121− golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect
122 golang.org/x/exp/shiny v0.0.0-20250305212735-054e65f0b394 // indirect
134 golang.org/x/exp/shiny v0.0.0-20250305212735-054e65f0b394 // indirect
123 golang.org/x/image v0.14.0 // indirect
135 golang.org/x/image v0.14.0 // indirect
124 golang.org/x/mobile v0.0.0-20231127183840-76ac6878050a // indirect
136 golang.org/x/mobile v0.0.0-20231127183840-76ac6878050a // indirect
@@ -132,6 +144,6 @@ require (
132 google.golang.org/genproto/googleapis/rpc v0.0.0-20241223144023-3abc09e42ca8 // indirect
144 google.golang.org/genproto/googleapis/rpc v0.0.0-20241223144023-3abc09e42ca8 // indirect
133 google.golang.org/grpc v1.67.3 // indirect
145 google.golang.org/grpc v1.67.3 // indirect
134 google.golang.org/protobuf v1.36.1 // indirect
146 google.golang.org/protobuf v1.36.1 // indirect
135− gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
147+ gopkg.in/warnings.v0 v0.1.2 // indirect
136 gopkg.in/yaml.v3 v3.0.1 // indirect
148 gopkg.in/yaml.v3 v3.0.1 // indirect
137)
149)
go.sum+56−1
@@ -10,10 +10,17 @@ cloud.google.com/go/compute/metadata v0.6.0 h1:A6hENjEsCDtC1k8byVsgwvVcioamEHvZ4
10cloud.google.com/go/compute/metadata v0.6.0/go.mod h1:FjyFAW1MW0C203CEOMDTu3Dk1FlqW3Rga40jzHL4hfg=
10cloud.google.com/go/compute/metadata v0.6.0/go.mod h1:FjyFAW1MW0C203CEOMDTu3Dk1FlqW3Rga40jzHL4hfg=
11cloud.google.com/go/longrunning v0.5.7 h1:WLbHekDbjK1fVFD3ibpFFVoyizlLRl73I7YKuAKilhU=
11cloud.google.com/go/longrunning v0.5.7 h1:WLbHekDbjK1fVFD3ibpFFVoyizlLRl73I7YKuAKilhU=
12cloud.google.com/go/longrunning v0.5.7/go.mod h1:8GClkudohy1Fxm3owmBGid8W0pSgodEMwEAztp38Xng=
12cloud.google.com/go/longrunning v0.5.7/go.mod h1:8GClkudohy1Fxm3owmBGid8W0pSgodEMwEAztp38Xng=
13+dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk=
14+dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk=
13github.com/JohannesKaufmann/html-to-markdown v1.6.0 h1:04VXMiE50YYfCfLboJCLcgqF5x+rHJnb1ssNmqpLH/k=
15github.com/JohannesKaufmann/html-to-markdown v1.6.0 h1:04VXMiE50YYfCfLboJCLcgqF5x+rHJnb1ssNmqpLH/k=
14github.com/JohannesKaufmann/html-to-markdown v1.6.0/go.mod h1:NUI78lGg/a7vpEJTz/0uOcYMaibytE4BUOQS8k78yPQ=
16github.com/JohannesKaufmann/html-to-markdown v1.6.0/go.mod h1:NUI78lGg/a7vpEJTz/0uOcYMaibytE4BUOQS8k78yPQ=
15github.com/MakeNowJust/heredoc v1.0.0 h1:cXCdzVdstXyiTqTvfqk9SDHpKNjxuom+DOlyEeQ4pzQ=
17github.com/MakeNowJust/heredoc v1.0.0 h1:cXCdzVdstXyiTqTvfqk9SDHpKNjxuom+DOlyEeQ4pzQ=
16github.com/MakeNowJust/heredoc v1.0.0/go.mod h1:mG5amYoWBHf8vpLOuehzbGGw0EHxpZZ6lCpQ4fNJ8LE=
18github.com/MakeNowJust/heredoc v1.0.0/go.mod h1:mG5amYoWBHf8vpLOuehzbGGw0EHxpZZ6lCpQ4fNJ8LE=
19+github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY=
20+github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY=
21+github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU=
22+github.com/ProtonMail/go-crypto v1.1.6 h1:ZcV+Ropw6Qn0AX9brlQLAUXfqLBc7Bl+f/DmNxpLfdw=
23+github.com/ProtonMail/go-crypto v1.1.6/go.mod h1:rA3QumHc/FZ8pAHreoekgiAbzpNsfQAosU5td4SnOrE=
17github.com/PuerkitoBio/goquery v1.9.2 h1:4/wZksC3KgkQw7SQgkKotmKljk0M6V8TUvA8Wb4yPeE=
24github.com/PuerkitoBio/goquery v1.9.2 h1:4/wZksC3KgkQw7SQgkKotmKljk0M6V8TUvA8Wb4yPeE=
18github.com/PuerkitoBio/goquery v1.9.2/go.mod h1:GHPCaP0ODyyxqcNoFGYlAprUFH81NuRPd0GX3Zu2Mvk=
25github.com/PuerkitoBio/goquery v1.9.2/go.mod h1:GHPCaP0ODyyxqcNoFGYlAprUFH81NuRPd0GX3Zu2Mvk=
19github.com/alecthomas/assert/v2 v2.11.0 h1:2Q9r3ki8+JYXvGsDyBXwH3LcJ+WK5D0gc5E8vS6K3D0=
26github.com/alecthomas/assert/v2 v2.11.0 h1:2Q9r3ki8+JYXvGsDyBXwH3LcJ+WK5D0gc5E8vS6K3D0=
@@ -24,8 +31,12 @@ github.com/alecthomas/repr v0.4.0 h1:GhI2A8MACjfegCPVq9f1FLvIBS+DrQ2KQBFZP1iFzXc
24github.com/alecthomas/repr v0.4.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4=
31github.com/alecthomas/repr v0.4.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4=
25github.com/andybalholm/cascadia v1.3.2 h1:3Xi6Dw5lHF15JtdcmAHD3i1+T8plmv7BQ/nsViSLyss=
32github.com/andybalholm/cascadia v1.3.2 h1:3Xi6Dw5lHF15JtdcmAHD3i1+T8plmv7BQ/nsViSLyss=
26github.com/andybalholm/cascadia v1.3.2/go.mod h1:7gtRlve5FxPPgIgX36uWBX58OdBsSS6lUvCFb+h7KvU=
33github.com/andybalholm/cascadia v1.3.2/go.mod h1:7gtRlve5FxPPgIgX36uWBX58OdBsSS6lUvCFb+h7KvU=
34+github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be h1:9AeTilPcZAjCFIImctFaOjnTIavg87rW78vTPkQqLI8=
35+github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be/go.mod h1:ySMOLuWl6zY27l47sB3qLNK6tF2fkHG55UZxx8oIVo4=
27github.com/anthropics/anthropic-sdk-go v0.2.0-beta.2 h1:h7qxtumNjKPWFv1QM/HJy60MteeW23iKeEtBoY7bYZk=
36github.com/anthropics/anthropic-sdk-go v0.2.0-beta.2 h1:h7qxtumNjKPWFv1QM/HJy60MteeW23iKeEtBoY7bYZk=
28github.com/anthropics/anthropic-sdk-go v0.2.0-beta.2/go.mod h1:AapDW22irxK2PSumZiQXYUFvsdQgkwIWlpESweWZI/c=
37github.com/anthropics/anthropic-sdk-go v0.2.0-beta.2/go.mod h1:AapDW22irxK2PSumZiQXYUFvsdQgkwIWlpESweWZI/c=
38+github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio=
39+github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs=
29github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z4=
40github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z4=
30github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI=
41github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI=
31github.com/aws/aws-sdk-go-v2 v1.30.3 h1:jUeBtG0Ih+ZIFH0F4UkmL9w3cSpaMv9tYYDbzILP8dY=
42github.com/aws/aws-sdk-go-v2 v1.30.3 h1:jUeBtG0Ih+ZIFH0F4UkmL9w3cSpaMv9tYYDbzILP8dY=
@@ -88,7 +99,11 @@ github.com/charmbracelet/x/exp/strings v0.0.0-20240722160745-212f7b056ed0 h1:qko
88github.com/charmbracelet/x/exp/strings v0.0.0-20240722160745-212f7b056ed0/go.mod h1:pBhA0ybfXv6hDjQUZ7hk1lVxBiUbupdw5R31yPUViVQ=
99github.com/charmbracelet/x/exp/strings v0.0.0-20240722160745-212f7b056ed0/go.mod h1:pBhA0ybfXv6hDjQUZ7hk1lVxBiUbupdw5R31yPUViVQ=
89github.com/charmbracelet/x/term v0.2.1 h1:AQeHeLZ1OqSXhrAWpYUtZyX1T3zVxfpZuEQMIQaGIAQ=
100github.com/charmbracelet/x/term v0.2.1 h1:AQeHeLZ1OqSXhrAWpYUtZyX1T3zVxfpZuEQMIQaGIAQ=
90github.com/charmbracelet/x/term v0.2.1/go.mod h1:oQ4enTYFV7QN4m0i9mzHrViD7TQKvNEEkHUMCmsxdUg=
101github.com/charmbracelet/x/term v0.2.1/go.mod h1:oQ4enTYFV7QN4m0i9mzHrViD7TQKvNEEkHUMCmsxdUg=
102+github.com/cloudflare/circl v1.6.1 h1:zqIqSPIndyBh1bjLVVDHMPpVKqp8Su/V+6MeDzzQBQ0=
103+github.com/cloudflare/circl v1.6.1/go.mod h1:uddAzsPgqdMAYatqJ0lsjX1oECcQLIlRpzZh3pJrofs=
91github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
104github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
105+github.com/cyphar/filepath-securejoin v0.4.1 h1:JyxxyPEaktOD+GAnqIqTf9A8tHyAG22rowi7HkoSU1s=
106+github.com/cyphar/filepath-securejoin v0.4.1/go.mod h1:Sdj7gXlvMcPZsbhwhQ33GguGLDGQL7h7bg04C/+u9jI=
92github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
107github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
93github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
108github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
94github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
109github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
@@ -96,6 +111,10 @@ github.com/dlclark/regexp2 v1.11.4 h1:rPYF9/LECdNymJufQKmri9gV604RvvABwgOA8un7yA
96github.com/dlclark/regexp2 v1.11.4/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8=
111github.com/dlclark/regexp2 v1.11.4/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8=
97github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
112github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
98github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
113github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
114+github.com/elazarl/goproxy v1.7.2 h1:Y2o6urb7Eule09PjlhQRGNsqRfPmYI3KKQLFpCAV3+o=
115+github.com/elazarl/goproxy v1.7.2/go.mod h1:82vkLNir0ALaW14Rc399OTTjyNREgmdL2cVoIbS6XaE=
116+github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc=
117+github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ=
99github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f h1:Y/CXytFA4m6baUTXGLOoWe4PQhGxaX0KpnayAqC48p4=
118github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f h1:Y/CXytFA4m6baUTXGLOoWe4PQhGxaX0KpnayAqC48p4=
100github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f/go.mod h1:vw97MGsxSvLiUE2X8qFplwetxpGLQrlU1Q9AUEIzCaM=
119github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f/go.mod h1:vw97MGsxSvLiUE2X8qFplwetxpGLQrlU1Q9AUEIzCaM=
101github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=
120github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=
@@ -104,6 +123,16 @@ github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHk
104github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
123github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
105github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M=
124github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M=
106github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=
125github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=
126+github.com/gliderlabs/ssh v0.3.8 h1:a4YXD1V7xMF9g5nTkdfnja3Sxy1PVDCj1Zg4Wb8vY6c=
127+github.com/gliderlabs/ssh v0.3.8/go.mod h1:xYoytBv1sV0aL3CavoDuJIQNURXkkfPA/wxQ1pL1fAU=
128+github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI=
129+github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmSxCcxctByoQdvwPiA7DTK7jaaFDBTtu0ic=
130+github.com/go-git/go-billy/v5 v5.6.2 h1:6Q86EsPXMa7c3YZ3aLAQsMA0VlWmy43r6FHqa/UNbRM=
131+github.com/go-git/go-billy/v5 v5.6.2/go.mod h1:rcFC2rAsp/erv7CMz9GczHcuD0D32fWzH+MJAU+jaUU=
132+github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399 h1:eMje31YglSBqCdIqdhKBW8lokaMrL3uTkpGYlE2OOT4=
133+github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399/go.mod h1:1OCfN199q1Jm3HZlxleg+Dw/mwps2Wbk9frAWm+4FII=
134+github.com/go-git/go-git/v5 v5.15.0 h1:f5Qn0W0F7ry1iN0ZwIU5m/n7/BKB4hiZfc+zlZx7ly0=
135+github.com/go-git/go-git/v5 v5.15.0/go.mod h1:4Ge4alE/5gPs30F2H1esi2gPd69R0C39lolkucHBOp8=
107github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4=
136github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4=
108github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs=
137github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs=
109github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
138github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
@@ -115,6 +144,8 @@ github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIx
115github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
144github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
116github.com/golang-migrate/migrate/v4 v4.18.2 h1:2VSCMz7x7mjyTXx3m2zPokOY82LTRgxK1yQYKo6wWQ8=
145github.com/golang-migrate/migrate/v4 v4.18.2 h1:2VSCMz7x7mjyTXx3m2zPokOY82LTRgxK1yQYKo6wWQ8=
117github.com/golang-migrate/migrate/v4 v4.18.2/go.mod h1:2CM6tJvn2kqPXwnXO/d3rAQYiyoIm180VsO8PRX6Rpk=
146github.com/golang-migrate/migrate/v4 v4.18.2/go.mod h1:2CM6tJvn2kqPXwnXO/d3rAQYiyoIm180VsO8PRX6Rpk=
147+github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 h1:f+oWsMOmNPc8JmEHVZIycC7hBoQxHH9pNKQORJNozsQ=
148+github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8/go.mod h1:wcDNUvekVysuuOpQKo3191zZyTpiI6se1N1ULghS0sw=
118github.com/google/generative-ai-go v0.19.0 h1:R71szggh8wHMCUlEMsW2A/3T+5LdEIkiaHSYgSpUgdg=
149github.com/google/generative-ai-go v0.19.0 h1:R71szggh8wHMCUlEMsW2A/3T+5LdEIkiaHSYgSpUgdg=
119github.com/google/generative-ai-go v0.19.0/go.mod h1:JYolL13VG7j79kM5BtHz4qwONHkeJQzOCkKXnpqtS/E=
150github.com/google/generative-ai-go v0.19.0/go.mod h1:JYolL13VG7j79kM5BtHz4qwONHkeJQzOCkKXnpqtS/E=
120github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
151github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
@@ -138,8 +169,11 @@ github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUq
138github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg=
169github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg=
139github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
170github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
140github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
171github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
172+github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A=
173+github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo=
174+github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4=
175+github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM=
141github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
176github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
142−github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
143github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
177github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
144github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
178github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
145github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
179github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
@@ -179,11 +213,17 @@ github.com/muesli/reflow v0.3.0 h1:IFsN6K9NfGtjeggFP+68I4chLZV2yIKsXJFNZ+eWh6s=
179github.com/muesli/reflow v0.3.0/go.mod h1:pbwTDkVPibjO2kyvBQRBxTWEEGDGq0FlB1BIKtnHY/8=
213github.com/muesli/reflow v0.3.0/go.mod h1:pbwTDkVPibjO2kyvBQRBxTWEEGDGq0FlB1BIKtnHY/8=
180github.com/muesli/termenv v0.16.0 h1:S5AlUN9dENB57rsbnkPyfdGuWIlkmzJjbFf0Tf5FWUc=
214github.com/muesli/termenv v0.16.0 h1:S5AlUN9dENB57rsbnkPyfdGuWIlkmzJjbFf0Tf5FWUc=
181github.com/muesli/termenv v0.16.0/go.mod h1:ZRfOIKPFDYQoDFF4Olj7/QJbW60Ol/kL1pU3VfY/Cnk=
215github.com/muesli/termenv v0.16.0/go.mod h1:ZRfOIKPFDYQoDFF4Olj7/QJbW60Ol/kL1pU3VfY/Cnk=
216+github.com/onsi/gomega v1.34.1 h1:EUMJIKUjM8sKjYbtxQI9A4z2o+rruxnzNvpknOXie6k=
217+github.com/onsi/gomega v1.34.1/go.mod h1:kU1QgUvBDLXBJq618Xvm2LUX6rSAfRaFRTcdOeDLwwY=
182github.com/openai/openai-go v0.1.0-beta.2 h1:Ra5nCFkbEl9w+UJwAciC4kqnIBUCcJazhmMA0/YN894=
218github.com/openai/openai-go v0.1.0-beta.2 h1:Ra5nCFkbEl9w+UJwAciC4kqnIBUCcJazhmMA0/YN894=
183github.com/openai/openai-go v0.1.0-beta.2/go.mod h1:g461MYGXEXBVdV5SaR/5tNzNbSfwTBBefwc+LlDCK0Y=
219github.com/openai/openai-go v0.1.0-beta.2/go.mod h1:g461MYGXEXBVdV5SaR/5tNzNbSfwTBBefwc+LlDCK0Y=
184github.com/pelletier/go-toml/v2 v2.2.3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNHvL12M=
220github.com/pelletier/go-toml/v2 v2.2.3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNHvL12M=
185github.com/pelletier/go-toml/v2 v2.2.3/go.mod h1:MfCQTFTvCcUyyvvwm1+G6H/jORL20Xlb6rzQu9GuUkc=
221github.com/pelletier/go-toml/v2 v2.2.3/go.mod h1:MfCQTFTvCcUyyvvwm1+G6H/jORL20Xlb6rzQu9GuUkc=
222+github.com/pjbgf/sha1cd v0.3.2 h1:a9wb0bp1oC2TGwStyn0Umc/IGKQnEgF0vVaZ8QF8eo4=
223+github.com/pjbgf/sha1cd v0.3.2/go.mod h1:zQWigSxVmsHEZow5qaLtPYxpcKMMQpa09ixqBxuCS6A=
186github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
224github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
225+github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
226+github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
187github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
227github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
188github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
228github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
189github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
229github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
@@ -203,6 +243,9 @@ github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAm
203github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I=
243github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I=
204github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 h1:n661drycOFuPLCN3Uc8sB6B/s6Z4t2xvBgU1htSHuq8=
244github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 h1:n661drycOFuPLCN3Uc8sB6B/s6Z4t2xvBgU1htSHuq8=
205github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4=
245github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4=
246+github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
247+github.com/skeema/knownhosts v1.3.1 h1:X2osQ+RAjK76shCbvhHHHVl3ZlgDm8apHEHFqRjnBY8=
248+github.com/skeema/knownhosts v1.3.1/go.mod h1:r7KTdC8l4uxWRyK2TpQZ/1o5HaSzh06ePQNxPwTcfiY=
206github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo=
249github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo=
207github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0=
250github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0=
208github.com/spf13/afero v1.12.0 h1:UcOPyRBYczmFn6yvphxkn9ZEOY65cpwGKb5mL36mrqs=
251github.com/spf13/afero v1.12.0 h1:UcOPyRBYczmFn6yvphxkn9ZEOY65cpwGKb5mL36mrqs=
@@ -216,6 +259,7 @@ github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An
216github.com/spf13/viper v1.20.0 h1:zrxIyR3RQIOsarIrgL8+sAvALXul9jeEPa06Y0Ph6vY=
259github.com/spf13/viper v1.20.0 h1:zrxIyR3RQIOsarIrgL8+sAvALXul9jeEPa06Y0Ph6vY=
217github.com/spf13/viper v1.20.0/go.mod h1:P9Mdzt1zoHIG8m2eZQinpiBjo6kCmZSKBClNNqjJvu4=
260github.com/spf13/viper v1.20.0/go.mod h1:P9Mdzt1zoHIG8m2eZQinpiBjo6kCmZSKBClNNqjJvu4=
218github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
261github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
262+github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
219github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
263github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
220github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
264github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
221github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
265github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
@@ -232,6 +276,8 @@ github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4=
232github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU=
276github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU=
233github.com/tidwall/sjson v1.2.5 h1:kLy8mja+1c9jlljvWTlSazM7cKDRfJuR/bOJhcY5NcY=
277github.com/tidwall/sjson v1.2.5 h1:kLy8mja+1c9jlljvWTlSazM7cKDRfJuR/bOJhcY5NcY=
234github.com/tidwall/sjson v1.2.5/go.mod h1:Fvgq9kS/6ociJEDnK0Fk1cpYF4FIW6ZF7LAe+6jwd28=
278github.com/tidwall/sjson v1.2.5/go.mod h1:Fvgq9kS/6ociJEDnK0Fk1cpYF4FIW6ZF7LAe+6jwd28=
279+github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM=
280+github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw=
235github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e h1:JVG44RsyaB9T2KIHavMF/ppJZNG9ZpyihvCd0w101no=
281github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e h1:JVG44RsyaB9T2KIHavMF/ppJZNG9ZpyihvCd0w101no=
236github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e/go.mod h1:RbqR21r5mrJuqunuUZ/Dhy/avygyECGrLceyNeo4LiM=
282github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e/go.mod h1:RbqR21r5mrJuqunuUZ/Dhy/avygyECGrLceyNeo4LiM=
237github.com/yosida95/uritemplate/v3 v3.0.2 h1:Ed3Oyj9yrmi9087+NczuL5BwkIc4wvTb5zIM+UJPGz4=
283github.com/yosida95/uritemplate/v3 v3.0.2 h1:Ed3Oyj9yrmi9087+NczuL5BwkIc4wvTb5zIM+UJPGz4=
@@ -260,6 +306,7 @@ golang.design/x/clipboard v0.7.0 h1:4Je8M/ys9AJumVnl8m+rZnIvstSnYj1fvzqYrU3TXvo=
260golang.design/x/clipboard v0.7.0/go.mod h1:PQIvqYO9GP29yINEfsEn5zSQKAz3UgXmZKzDA6dnq2E=
306golang.design/x/clipboard v0.7.0/go.mod h1:PQIvqYO9GP29yINEfsEn5zSQKAz3UgXmZKzDA6dnq2E=
261golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
307golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
262golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
308golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
309+golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
263golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU=
310golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU=
264golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M=
311golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M=
265golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=
312golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=
@@ -277,6 +324,7 @@ golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91
277golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
324golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
278golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
325golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
279golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
326golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
327+golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
280golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
328golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
281golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
329golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
282golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns=
330golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns=
@@ -294,10 +342,14 @@ golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
294golang.org/x/sync v0.13.0 h1:AauUjRAJ9OSnvULf/ARrrVywoJDy0YS2AwQ98I37610=
342golang.org/x/sync v0.13.0 h1:AauUjRAJ9OSnvULf/ARrrVywoJDy0YS2AwQ98I37610=
295golang.org/x/sync v0.13.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
343golang.org/x/sync v0.13.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
296golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
344golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
345+golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
297golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
346golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
347+golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
348+golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
298golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
349golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
299golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
350golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
300golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
351golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
352+golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
301golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
353golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
302golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
354golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
303golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
355golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
@@ -320,6 +372,7 @@ golang.org/x/term v0.31.0 h1:erwDkOK1Msy6offm1mOgvspSkslFnIGsFnxOKoufg3o=
320golang.org/x/term v0.31.0/go.mod h1:R4BeIy7D95HzImkxGkTW1UQTtP54tio2RyHz7PwK0aw=
372golang.org/x/term v0.31.0/go.mod h1:R4BeIy7D95HzImkxGkTW1UQTtP54tio2RyHz7PwK0aw=
321golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
373golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
322golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
374golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
375+golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
323golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
376golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
324golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
377golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
325golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
378golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
@@ -348,6 +401,8 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8
348gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
401gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
349gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
402gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
350gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
403gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
404+gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME=
405+gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI=
351gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
406gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
352gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
407gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
353gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
408gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
internal/diff/diff.go+83−279
@@ -4,6 +4,8 @@ import (
4 "bytes"
4 "bytes"
5 "fmt"
5 "fmt"
6 "io"
6 "io"
7+ "os"
8+ "path/filepath"
7 "regexp"
9 "regexp"
8 "strconv"
10 "strconv"
9 "strings"
11 "strings"
@@ -15,6 +17,8 @@ import (
15 "github.com/alecthomas/chroma/v2/styles"
17 "github.com/alecthomas/chroma/v2/styles"
16 "github.com/charmbracelet/lipgloss"
18 "github.com/charmbracelet/lipgloss"
17 "github.com/charmbracelet/x/ansi"
19 "github.com/charmbracelet/x/ansi"
20+ "github.com/go-git/go-git/v5"
21+ "github.com/go-git/go-git/v5/plumbing/object"
18 "github.com/sergi/go-diff/diffmatchpatch"
22 "github.com/sergi/go-diff/diffmatchpatch"
19)
23)
20
24
@@ -224,21 +228,6 @@ type ParseConfig struct {
224// ParseOption defines a function that modifies a ParseConfig.
228// ParseOption defines a function that modifies a ParseConfig.
225type ParseOption func(*ParseConfig)
229type ParseOption func(*ParseConfig)
226
230
227−// NewParseConfig creates a ParseConfig with default values and applies any provided options.
228−func NewParseConfig(opts ...ParseOption) ParseConfig {
229− // Set default values
230− config := ParseConfig{
231− ContextSize: 3,
232− }
233−
234− // Apply all provided options
235− for _, opt := range opts {
236− opt(&config)
237− }
238−
239− return config
240−}
241−
242// WithContextSize sets the number of context lines to include.
231// WithContextSize sets the number of context lines to include.
243func WithContextSize(size int) ParseOption {
232func WithContextSize(size int) ParseOption {
244 return func(p *ParseConfig) {
233 return func(p *ParseConfig) {
@@ -347,6 +336,10 @@ func ParseUnifiedDiff(diff string) (DiffResult, error) {
347 continue
336 continue
348 }
337 }
349
338
339+ // ignore the \\ No newline at end of file
340+ if strings.HasPrefix(line, "\\ No newline at end of file") {
341+ continue
342+ }
350 if currentHunk == nil {
343 if currentHunk == nil {
351 continue
344 continue
352 }
345 }
@@ -450,32 +443,22 @@ func colorizeSegments(diffs []diffmatchpatch.Diff, isOld bool, style StyleConfig
450 removedLineStyle := lipgloss.NewStyle().Background(style.RemovedLineBg)
443 removedLineStyle := lipgloss.NewStyle().Background(style.RemovedLineBg)
451 addedLineStyle := lipgloss.NewStyle().Background(style.AddedLineBg)
444 addedLineStyle := lipgloss.NewStyle().Background(style.AddedLineBg)
452
445
453− afterBg := false
454−
455 for _, d := range diffs {
446 for _, d := range diffs {
456 switch d.Type {
447 switch d.Type {
457 case diffmatchpatch.DiffEqual:
448 case diffmatchpatch.DiffEqual:
458 // Handle text that's the same in both versions
449 // Handle text that's the same in both versions
459− if afterBg {
460− if isOld {
461− buf.WriteString(removedLineStyle.Render(d.Text))
462− } else {
463− buf.WriteString(addedLineStyle.Render(d.Text))
464− }
465− } else {
466− buf.WriteString(d.Text)
450+ buf.WriteString(d.Text)
467− }
468 case diffmatchpatch.DiffDelete:
451 case diffmatchpatch.DiffDelete:
469 // Handle deleted text (only show in old version)
452 // Handle deleted text (only show in old version)
470 if isOld {
453 if isOld {
471 buf.WriteString(removeBg.Render(d.Text))
454 buf.WriteString(removeBg.Render(d.Text))
472− afterBg = true
455+ buf.WriteString(removedLineStyle.Render(""))
473 }
456 }
474 case diffmatchpatch.DiffInsert:
457 case diffmatchpatch.DiffInsert:
475 // Handle inserted text (only show in new version)
458 // Handle inserted text (only show in new version)
476 if !isOld {
459 if !isOld {
477 buf.WriteString(addBg.Render(d.Text))
460 buf.WriteString(addBg.Render(d.Text))
478− afterBg = true
461+ buf.WriteString(addedLineStyle.Render(""))
479 }
462 }
480 }
463 }
481 }
464 }
@@ -621,7 +604,13 @@ func renderLeftColumn(fileName string, dl *DiffLine, colWidth int, styles StyleC
621 }
604 }
622
605
623 lineText := prefix + content
606 lineText := prefix + content
624− return bgStyle.MaxHeight(1).Width(colWidth).Render(ansi.Truncate(lineText, colWidth, "..."))
607+ return bgStyle.MaxHeight(1).Width(colWidth).Render(
608+ ansi.Truncate(
609+ lineText,
610+ colWidth,
611+ lipgloss.NewStyle().Background(styles.HunkLineBg).Foreground(styles.HunkLineFg).Render("..."),
612+ ),
613+ )
625}
614}
626
615
627// renderRightColumn formats the right side of a side-by-side diff.
616// renderRightColumn formats the right side of a side-by-side diff.
@@ -662,7 +651,13 @@ func renderRightColumn(fileName string, dl *DiffLine, colWidth int, styles Style
662 }
651 }
663
652
664 lineText := prefix + content
653 lineText := prefix + content
665− return bgStyle.MaxHeight(1).Width(colWidth).Render(ansi.Truncate(lineText, colWidth, "..."))
654+ return bgStyle.MaxHeight(1).Width(colWidth).Render(
655+ ansi.Truncate(
656+ lineText,
657+ colWidth,
658+ lipgloss.NewStyle().Background(styles.HunkLineBg).Foreground(styles.HunkLineFg).Render("..."),
659+ ),
660+ )
666}
661}
667
662
668// -------------------------------------------------------------------------
663// -------------------------------------------------------------------------
@@ -718,278 +713,87 @@ func FormatDiff(diffText string, opts ...SideBySideOption) (string, error) {
718}
713}
719
714
720// GenerateDiff creates a unified diff from two file contents.
715// GenerateDiff creates a unified diff from two file contents.
721−func GenerateDiff(beforeContent, afterContent, beforeFilename, afterFilename string, opts ...ParseOption) (string, int, int) {
716+func GenerateDiff(beforeContent, afterContent, fileName string) (string, int, int) {
722− config := NewParseConfig(opts...)
717+ tempDir, err := os.MkdirTemp("", "git-diff-temp")
723−
718+ if err != nil {
724− var output strings.Builder
719+ return "", 0, 0
725−
726− // Ensure we handle newlines correctly
727− beforeHasNewline := len(beforeContent) > 0 && beforeContent[len(beforeContent)-1] == '\n'
728− afterHasNewline := len(afterContent) > 0 && afterContent[len(afterContent)-1] == '\n'
729−
730− // Split into lines
731− beforeLines := strings.Split(beforeContent, "\n")
732− afterLines := strings.Split(afterContent, "\n")
733−
734− // Remove empty trailing element from the split if the content ended with a newline
735− if beforeHasNewline && len(beforeLines) > 0 {
736− beforeLines = beforeLines[:len(beforeLines)-1]
737− }
738− if afterHasNewline && len(afterLines) > 0 {
739− afterLines = afterLines[:len(afterLines)-1]
740 }
720 }
721+ defer os.RemoveAll(tempDir)
741
722
742− dmp := diffmatchpatch.New()
723+ repo, err := git.PlainInit(tempDir, false)
743− dmp.DiffTimeout = 5 * time.Second
724+ if err != nil {
725+ return "", 0, 0
726+ }
744
727
745− // Convert lines to characters for efficient diffing
728+ wt, err := repo.Worktree()
746− lineArray1, lineArray2, lineArrays := dmp.DiffLinesToChars(beforeContent, afterContent)
729+ if err != nil {
747− diffs := dmp.DiffMain(lineArray1, lineArray2, false)
730+ return "", 0, 0
748− diffs = dmp.DiffCharsToLines(diffs, lineArrays)
731+ }
749
732
750− // Default filenames if not provided
733+ fullPath := filepath.Join(tempDir, fileName)
751− if beforeFilename == "" {
734+ if err = os.MkdirAll(filepath.Dir(fullPath), 0o755); err != nil {
752− beforeFilename = "a"
735+ return "", 0, 0
753 }
736 }
754− if afterFilename == "" {
737+ if err = os.WriteFile(fullPath, []byte(beforeContent), 0o644); err != nil {
755− afterFilename = "b"
738+ return "", 0, 0
756 }
739 }
757
740
758− // Write diff header
741+ _, err = wt.Add(fileName)
759− output.WriteString(fmt.Sprintf("diff --git a/%s b/%s\n", beforeFilename, afterFilename))
742+ if err != nil {
760− output.WriteString(fmt.Sprintf("--- a/%s\n", beforeFilename))
743+ return "", 0, 0
761− output.WriteString(fmt.Sprintf("+++ b/%s\n", afterFilename))
762−
763− line1 := 0 // Line numbers start from 0 internally
764− line2 := 0
765− additions := 0
766− deletions := 0
767−
768− var hunks []string
769− var currentHunk strings.Builder
770− var hunkStartLine1, hunkStartLine2 int
771− var hunkLines1, hunkLines2 int
772− inHunk := false
773−
774− contextSize := config.ContextSize
775−
776− // startHunk begins recording a new hunk
777− startHunk := func(startLine1, startLine2 int) {
778− inHunk = true
779− hunkStartLine1 = startLine1
780− hunkStartLine2 = startLine2
781− hunkLines1 = 0
782− hunkLines2 = 0
783− currentHunk.Reset()
784− }
785−
786− // writeHunk adds the current hunk to the hunks slice
787− writeHunk := func() {
788− if inHunk {
789− hunkHeader := fmt.Sprintf("@@ -%d,%d +%d,%d @@\n",
790− hunkStartLine1+1, hunkLines1,
791− hunkStartLine2+1, hunkLines2)
792− hunks = append(hunks, hunkHeader+currentHunk.String())
793− inHunk = false
794− }
795 }
744 }
796
745
797− // Process diffs to create hunks
746+ beforeCommit, err := wt.Commit("Before", &git.CommitOptions{
798− pendingContext := make([]string, 0, contextSize*2)
747+ Author: &object.Signature{
799− var contextLines1, contextLines2 int
748+ Name: "OpenCode",
800−
749+ Email: "coder@opencode.ai",
801− // Helper function to add context lines to the hunk
750+ When: time.Now(),
802− addContextToHunk := func(lines []string, count int) {
751+ },
803− for i := 0; i < count; i++ {
752+ })
804− if i < len(lines) {
753+ if err != nil {
805− currentHunk.WriteString(" " + lines[i] + "\n")
754+ return "", 0, 0
806− hunkLines1++
807− hunkLines2++
808− }
809− }
810 }
755 }
811
756
812− // Process diffs
757+ if err = os.WriteFile(fullPath, []byte(afterContent), 0o644); err != nil {
813− for _, diff := range diffs {
814− lines := strings.Split(diff.Text, "\n")
815−
816− // Remove empty trailing line that comes from splitting a string that ends with \n
817− if len(lines) > 0 && lines[len(lines)-1] == "" && diff.Text[len(diff.Text)-1] == '\n' {
818− lines = lines[:len(lines)-1]
819− }
820−
821− switch diff.Type {
822− case diffmatchpatch.DiffEqual:
823− // If we have enough equal lines to serve as context, add them to pending
824− pendingContext = append(pendingContext, lines...)
825−
826− // If pending context grows too large, trim it
827− if len(pendingContext) > contextSize*2 {
828− pendingContext = pendingContext[len(pendingContext)-contextSize*2:]
829− }
830−
831− // If we're in a hunk, add the necessary context
832− if inHunk {
833− // Only add the first contextSize lines as trailing context
834− numContextLines := min(contextSize, len(lines))
835− addContextToHunk(lines[:numContextLines], numContextLines)
836−
837− // If we've added enough trailing context, close the hunk
838− if numContextLines >= contextSize {
839− writeHunk()
840− }
841− }
842−
843− line1 += len(lines)
844− line2 += len(lines)
845− contextLines1 += len(lines)
846− contextLines2 += len(lines)
847−
848− case diffmatchpatch.DiffDelete, diffmatchpatch.DiffInsert:
849− // Start a new hunk if needed
850− if !inHunk {
851− // Determine how many context lines we can add before
852− contextBefore := min(contextSize, len(pendingContext))
853− ctxStartIdx := len(pendingContext) - contextBefore
854−
855− // Calculate the correct start lines
856− startLine1 := line1 - contextLines1 + ctxStartIdx
857− startLine2 := line2 - contextLines2 + ctxStartIdx
858−
859− startHunk(startLine1, startLine2)
860−
861− // Add the context lines before
862− addContextToHunk(pendingContext[ctxStartIdx:], contextBefore)
863− }
864−
865− // Reset context tracking when we see a diff
866− pendingContext = pendingContext[:0]
867− contextLines1 = 0
868− contextLines2 = 0
869−
870− // Add the changes
871− if diff.Type == diffmatchpatch.DiffDelete {
872− for _, line := range lines {
873− currentHunk.WriteString("-" + line + "\n")
874− hunkLines1++
875− deletions++
876− }
877− line1 += len(lines)
878− } else { // DiffInsert
879− for _, line := range lines {
880− currentHunk.WriteString("+" + line + "\n")
881− hunkLines2++
882− additions++
883− }
884− line2 += len(lines)
885− }
886− }
887 }
758 }
888
759
889− // Write the final hunk if there's one pending
760+ _, err = wt.Add(fileName)
890− if inHunk {
761+ if err != nil {
891− writeHunk()
762+ return "", 0, 0
892 }
763 }
893
764
894− // Merge hunks that are close to each other (within 2*contextSize lines)
765+ afterCommit, err := wt.Commit("After", &git.CommitOptions{
895− var mergedHunks []string
766+ Author: &object.Signature{
896− if len(hunks) > 0 {
767+ Name: "OpenCode",
897− mergedHunks = append(mergedHunks, hunks[0])
768+ Email: "coder@opencode.ai",
898−
769+ When: time.Now(),
899− for i := 1; i < len(hunks); i++ {
770+ },
900− prevHunk := mergedHunks[len(mergedHunks)-1]
771+ })
901− currHunk := hunks[i]
772+ if err != nil {
902−
773+ return "", 0, 0
903− // Extract line numbers to check proximity
904− var prevStart, prevLen, currStart, currLen int
905− fmt.Sscanf(prevHunk, "@@ -%d,%d", &prevStart, &prevLen)
906− fmt.Sscanf(currHunk, "@@ -%d,%d", &currStart, &currLen)
907−
908− prevEnd := prevStart + prevLen - 1
909−
910− // If hunks are close, merge them
911− if currStart-prevEnd <= contextSize*2 {
912− // Create a merged hunk - this is a simplification, real git has more complex merging logic
913− merged := mergeHunks(prevHunk, currHunk)
914− mergedHunks[len(mergedHunks)-1] = merged
915− } else {
916− mergedHunks = append(mergedHunks, currHunk)
917− }
918− }
919 }
774 }
920
775
921− // Write all hunks to output
776+ beforeCommitObj, err := repo.CommitObject(beforeCommit)
922− for _, hunk := range mergedHunks {
777+ if err != nil {
923− output.WriteString(hunk)
778+ return "", 0, 0
924 }
779 }
925
780
926− // Handle "No newline at end of file" notifications
781+ afterCommitObj, err := repo.CommitObject(afterCommit)
927− if !beforeHasNewline && len(beforeLines) > 0 {
782+ if err != nil {
928− // Find the last deletion in the diff and add the notification after it
783+ return "", 0, 0
929− lastPos := strings.LastIndex(output.String(), "\n-")
930− if lastPos != -1 {
931− // Insert the notification after the line
932− str := output.String()
933− output.Reset()
934− output.WriteString(str[:lastPos+1])
935− output.WriteString("\\ No newline at end of file\n")
936− output.WriteString(str[lastPos+1:])
937− }
938 }
784 }
939
785
940− if !afterHasNewline && len(afterLines) > 0 {
786+ patch, err := beforeCommitObj.Patch(afterCommitObj)
941− // Find the last insertion in the diff and add the notification after it
787+ if err != nil {
942− lastPos := strings.LastIndex(output.String(), "\n+")
788+ return "", 0, 0
943− if lastPos != -1 {
944− // Insert the notification after the line
945− str := output.String()
946− output.Reset()
947− output.WriteString(str[:lastPos+1])
948− output.WriteString("\\ No newline at end of file\n")
949− output.WriteString(str[lastPos+1:])
950− }
951 }
789 }
952
790
953− // Return the diff without the summary line
791+ additions := 0
954− return output.String(), additions, deletions
792+ removals := 0
955−}
793+ for _, fileStat := range patch.Stats() {
956−
794+ additions += fileStat.Addition
957−// Helper function to merge two hunks
795+ removals += fileStat.Deletion
958−func mergeHunks(hunk1, hunk2 string) string {
959− // This is a simplified implementation
960− // A full implementation would need to properly recalculate the hunk header
961− // and remove redundant context lines
962−
963− // Extract header info from both hunks
964− var start1, len1, start2, len2 int
965− var startB1, lenB1, startB2, lenB2 int
966−
967− fmt.Sscanf(hunk1, "@@ -%d,%d +%d,%d @@", &start1, &len1, &startB1, &lenB1)
968− fmt.Sscanf(hunk2, "@@ -%d,%d +%d,%d @@", &start2, &len2, &startB2, &lenB2)
969−
970− // Split the hunks to get content
971− parts1 := strings.SplitN(hunk1, "\n", 2)
972− parts2 := strings.SplitN(hunk2, "\n", 2)
973−
974− content1 := ""
975− content2 := ""
976−
977− if len(parts1) > 1 {
978− content1 = parts1[1]
979− }
980− if len(parts2) > 1 {
981− content2 = parts2[1]
982 }
796 }
983
797
984− // Calculate the new header
798+ return patch.String(), additions, removals
985− newEnd := max(start1+len1-1, start2+len2-1)
986− newEndB := max(startB1+lenB1-1, startB2+lenB2-1)
987−
988− newLen := newEnd - start1 + 1
989− newLenB := newEndB - startB1 + 1
990−
991− newHeader := fmt.Sprintf("@@ -%d,%d +%d,%d @@", start1, newLen, startB1, newLenB)
992−
993− // Combine the content, potentially with some overlap handling
994− return newHeader + "\n" + content1 + content2
995}
799}
internal/llm/tools/edit.go−3
@@ -186,7 +186,6 @@ func (e *editTool) createNewFile(ctx context.Context, filePath, content string)
186 "",
186 "",
187 content,
187 content,
188 filePath,
188 filePath,
189− filePath,
190 )
189 )
191 p := e.permissions.Request(
190 p := e.permissions.Request(
192 permission.CreatePermissionRequest{
191 permission.CreatePermissionRequest{
@@ -277,7 +276,6 @@ func (e *editTool) deleteContent(ctx context.Context, filePath, oldString string
277 oldContent,
276 oldContent,
278 newContent,
277 newContent,
279 filePath,
278 filePath,
280− filePath,
281 )
279 )
282
280
283 p := e.permissions.Request(
281 p := e.permissions.Request(
@@ -367,7 +365,6 @@ func (e *editTool) replaceContent(ctx context.Context, filePath, oldString, newS
367 oldContent,
365 oldContent,
368 newContent,
366 newContent,
369 filePath,
367 filePath,
370− filePath,
371 )
368 )
372 p := e.permissions.Request(
369 p := e.permissions.Request(
373 permission.CreatePermissionRequest{
370 permission.CreatePermissionRequest{
internal/llm/tools/write.go−1
@@ -154,7 +154,6 @@ func (w *writeTool) Run(ctx context.Context, call ToolCall) (ToolResponse, error
154 oldContent,
154 oldContent,
155 params.Content,
155 params.Content,
156 filePath,
156 filePath,
157− filePath,
158 )
157 )
159 p := w.permissions.Request(
158 p := w.permissions.Request(
160 permission.CreatePermissionRequest{
159 permission.CreatePermissionRequest{