The open source coding agent.
TypeScript
ignore: fix typos and formatting (#294)
Márk Magyar333569bed38f
diff --git a/packages/opencode/src/tool/edit.ts b/packages/opencode/src/tool/edit.tsindex 7840011964a..5dea06e32cf 100644--- a/packages/opencode/src/tool/edit.ts+++ b/packages/opencode/src/tool/edit.ts@@ -22,7 +22,7 @@ export const EditTool = Tool.define({replaceAll: z.boolean().optional()- .describe("Replace all occurences of old_string (default false)"),+ .describe("Replace all occurrences of old_string (default false)"),}),async execute(params, ctx) {if (!params.filePath) {diff --git a/packages/opencode/src/tool/multiedit.txt b/packages/opencode/src/tool/multiedit.txtindex dded8c3c71d..1b32bbd9c2d 100644--- a/packages/opencode/src/tool/multiedit.txt+++ b/packages/opencode/src/tool/multiedit.txt@@ -10,7 +10,7 @@ To make multiple file edits, provide the following:2. edits: An array of edit operations to perform, where each edit contains:- old_string: The text to replace (must match the file contents exactly, including all whitespace and indentation)- new_string: The edited text to replace the old_string- - replace_all: Replace all occurences of old_string. This parameter is optional and defaults to false.+ - replace_all: Replace all occurrences of old_string. This parameter is optional and defaults to false.IMPORTANT:- All edits are applied in sequence, in the order they are provideddiff --git a/packages/tui/internal/app/app.go b/packages/tui/internal/app/app.goindex 6fb8242a42f..f206207901b 100644--- a/packages/tui/internal/app/app.go+++ b/packages/tui/internal/app/app.go@@ -44,7 +44,7 @@ type SendMsg struct {Text stringAttachments []Attachment}-type CompletionDialogTriggerdMsg struct {+type CompletionDialogTriggeredMsg struct {InitialValue string}diff --git a/packages/tui/internal/components/dialog/complete.go b/packages/tui/internal/components/dialog/complete.goindex 212df49f7e6..4924885f9ce 100644--- a/packages/tui/internal/components/dialog/complete.go+++ b/packages/tui/internal/components/dialog/complete.go@@ -116,7 +116,7 @@ func (c *completionDialogComponent) Update(msg tea.Msg) (tea.Model, tea.Cmd) {switch msg := msg.(type) {case []CompletionItemI:c.list.SetItems(msg)- case app.CompletionDialogTriggerdMsg:+ case app.CompletionDialogTriggeredMsg:c.pseudoSearchTextArea.SetValue(msg.InitialValue)case tea.KeyMsg:if c.pseudoSearchTextArea.Focused() {diff --git a/packages/tui/internal/image/clipboard_unix.go b/packages/tui/internal/image/clipboard_unix.goindex 3cb59020779..2653d8cadf9 100644--- a/packages/tui/internal/image/clipboard_unix.go+++ b/packages/tui/internal/image/clipboard_unix.go@@ -5,8 +5,8 @@ package imageimport ("bytes""fmt"- "image""github.com/atotto/clipboard"+ "image")func GetImageFromClipboard() ([]byte, string, error) {@@ -28,8 +28,6 @@ func GetImageFromClipboard() ([]byte, string, error) {}--func binaryToImage(data []byte) ([]byte, error) {reader := bytes.NewReader(data)img, _, err := image.Decode(reader)@@ -40,7 +38,6 @@ func binaryToImage(data []byte) ([]byte, error) {return ImageToBytes(img)}-func min(a, b int) int {if a < b {return adiff --git a/packages/tui/internal/layout/overlay.go b/packages/tui/internal/layout/overlay.goindex c617da4cb13..e14695c6028 100644--- a/packages/tui/internal/layout/overlay.go+++ b/packages/tui/internal/layout/overlay.go@@ -109,11 +109,11 @@ func PlaceOverlay(// Get the foreground linefgLine := fgLines[i-y]fgLineWidth := ansi.PrintableRuneWidth(fgLine)-+// Extract the styles at the border positionsleftStyle := getStyleAtPosition(bgLine, pos)- rightStyle := getStyleAtPosition(bgLine, pos + 1 + fgLineWidth)-+ rightStyle := getStyleAtPosition(bgLine, pos+1+fgLineWidth)+// Left border - combine background from original with border foregroundleftSeq := combineStyles(leftStyle, options.borderColor)if leftSeq != "" {@@ -172,17 +172,17 @@ type ansiStyle struct {// parseANSISequence parses an ANSI escape sequence into its componentsfunc parseANSISequence(seq string) ansiStyle {style := ansiStyle{}-+// Extract the parameters from the sequence (e.g., \x1b[38;5;123;48;5;456m -> "38;5;123;48;5;456")if !strings.HasPrefix(seq, "\x1b[") || !strings.HasSuffix(seq, "m") {return style}-+params := seq[2 : len(seq)-1]if params == "" {return style}-+parts := strings.Split(params, ";")i := 0for i < len(parts) {@@ -222,7 +222,7 @@ func parseANSISequence(seq string) ansiStyle {}i++}-+return style}@@ -231,32 +231,32 @@ func combineStyles(bgStyle ansiStyle, fgColor *compat.AdaptiveColor) string {if fgColor == nil && bgStyle.bgColor == "" && len(bgStyle.attrs) == 0 {return ""}-+var parts []string-+// Add attributesparts = append(parts, bgStyle.attrs...)-+// Add background color from the original styleif bgStyle.bgColor != "" {parts = append(parts, bgStyle.bgColor)}-+// Add foreground color if specifiedif fgColor != nil {// Use the light color (could be improved to detect terminal background)color := (*fgColor).Light-+// Use RGBA to get color componentsr, g, b, _ := color.RGBA()// RGBA returns 16-bit values, we need 8-bitparts = append(parts, fmt.Sprintf("38;2;%d;%d;%d", r>>8, g>>8, b>>8))}-+if len(parts) == 0 {return ""}-+return fmt.Sprintf("\x1b[%sm", strings.Join(parts, ";"))}@@ -264,10 +264,10 @@ func combineStyles(bgStyle ansiStyle, fgColor *compat.AdaptiveColor) string {func getStyleAtPosition(s string, targetPos int) ansiStyle {// ANSI escape sequence regexansiRegex := regexp.MustCompile(`\x1b\[[0-9;]*m`)-+visualPos := 0currentStyle := ansiStyle{}-+i := 0for i < len(s) && visualPos <= targetPos {// Check if we're at an ANSI escape sequence@@ -275,7 +275,7 @@ func getStyleAtPosition(s string, targetPos int) ansiStyle {// Found an ANSI sequence at current positionseq := s[i : i+match[1]]parsedStyle := parseANSISequence(seq)-+// Update current style (merge with existing)if parsedStyle.fgColor != "" {currentStyle.fgColor = parsedStyle.fgColor@@ -286,7 +286,7 @@ func getStyleAtPosition(s string, targetPos int) ansiStyle {if len(parsedStyle.attrs) > 0 {currentStyle.attrs = parsedStyle.attrs}-+i += match[1]} else if i < len(s) {// Regular character@@ -298,7 +298,7 @@ func getStyleAtPosition(s string, targetPos int) ansiStyle {visualPos++}}-+return currentStyle}diff --git a/packages/tui/internal/theme/loader_test.go b/packages/tui/internal/theme/loader_test.goindex c854cac0ff0..1039ab3f1ca 100644--- a/packages/tui/internal/theme/loader_test.go+++ b/packages/tui/internal/theme/loader_test.go@@ -133,4 +133,3 @@ func TestLoadThemesFromDirectories(t *testing.T) {t.Error("Override theme not properly loaded")}}-diff --git a/packages/tui/internal/tui/tui.go b/packages/tui/internal/tui/tui.goindex c822388d3c0..6e90b02afcc 100644--- a/packages/tui/internal/tui/tui.go+++ b/packages/tui/internal/tui/tui.go@@ -117,7 +117,7 @@ func (a appModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {}updated, cmd := a.completions.Update(- app.CompletionDialogTriggerdMsg{+ app.CompletionDialogTriggeredMsg{InitialValue: initialValue,},)@@ -178,7 +178,7 @@ func (a appModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {}// 7. Fallback to editor. This is for other characters- // likek backspace, tab, etc.+ // like backspace, tab, etc.updatedEditor, cmd := a.editor.Update(msg)a.editor = updatedEditor.(chat.EditorComponent)return a, cmddiff --git a/packages/tui/pkg/client/generated-client.go b/packages/tui/pkg/client/generated-client.goindex a108357d7b7..63623db54a1 100644--- a/packages/tui/pkg/client/generated-client.go+++ b/packages/tui/pkg/client/generated-client.go@@ -603,7 +603,7 @@ func (a *MessageInfo_Metadata_Tool_AdditionalProperties) UnmarshalJSON(b []byte)var fieldVal interface{}err := json.Unmarshal(fieldBuf, &fieldVal)if err != nil {- return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err)+ return fmt.Errorf("error unmarshalling field %s: %w", fieldName, err)}a.AdditionalProperties[fieldName] = fieldVal}diff --git a/packages/web/src/components/Share.tsx b/packages/web/src/components/Share.tsxindex 0671f49f671..73001e2ed0e 100644--- a/packages/web/src/components/Share.tsx+++ b/packages/web/src/components/Share.tsx@@ -444,7 +444,7 @@ function MarkdownPart(props: MarkdownPartProps) {{...rest}><MarkdownView- data-elment-markdown+ data-element-markdownmarkdown={local.text}ref={(el) => (divEl = el)}/>@@ -726,7 +726,7 @@ export default function Share(props: {for (let i = 0; i < messages().length; i++) {const msg = messages()[i]- // TODO: Cleaup+ // TODO: Cleanup// const system = result.messages.length === 0 && msg.role === "system"const assistant = msg.metadata?.assistantdiff --git a/packages/web/src/components/share.module.css b/packages/web/src/components/share.module.cssindex 37fce65eb33..f094bda5616 100644--- a/packages/web/src/components/share.module.css+++ b/packages/web/src/components/share.module.css@@ -659,12 +659,12 @@}&[data-expanded="true"] {- [data-elment-markdown] {+ [data-element-markdown] {display: block;}}&[data-expanded="false"] {- [data-elment-markdown] {+ [data-element-markdown] {display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 3;