@@ -13,15 +13,15 @@ import (
1313)
1414
1515const (
16- insertTextLinesFuncID spec.FuncID = "github.com/flexigpt/llmtools-go/texttool/inserttextlines.InsertTextLines "
17- whereBetween string = "between"
18- whereEnd string = "end"
16+ insertTextFuncID spec.FuncID = "github.com/flexigpt/llmtools-go/texttool/inserttext.InsertText "
17+ whereBetween string = "between"
18+ whereEnd string = "end"
1919)
2020
21- var insertTextLinesTool = spec.Tool {
21+ var insertTextTool = spec.Tool {
2222 SchemaVersion : spec .SchemaVersion ,
2323 ID : "019c04d3-572e-7d26-b4ca-f37feb7e8368" ,
24- Slug : "inserttextlines " ,
24+ Slug : "inserttext " ,
2525 Version : "v1.0.0" ,
2626 DisplayName : "Insert text" ,
2727 Description : "Insert a text block into a text file at the start, end, or between text. " +
@@ -65,13 +65,13 @@ var insertTextLinesTool = spec.Tool{
6565"additionalProperties": false
6666}` ),
6767
68- GoImpl : spec.GoToolImpl {FuncID : insertTextLinesFuncID },
68+ GoImpl : spec.GoToolImpl {FuncID : insertTextFuncID },
6969
7070 CreatedAt : spec .SchemaStartTime ,
7171 ModifiedAt : spec .SchemaStartTime ,
7272}
7373
74- type InsertTextLinesArgs struct {
74+ type InsertTextArgs struct {
7575 Path string `json:"path"`
7676 Text * string `json:"text"`
7777 Position string `json:"position"`
@@ -80,7 +80,7 @@ type InsertTextLinesArgs struct {
8080 LineHint * int `json:"lineHint,omitempty"`
8181}
8282
83- type InsertTextLinesOut struct {
83+ type InsertTextOut struct {
8484 InsertedAtLine int `json:"insertedAtLine"` // 1-based, where insertion begins
8585 InsertedLineCount int `json:"insertedLineCount"`
8686 TextAboveMatchedAtLine * int `json:"textAboveMatchedAtLine,omitempty"` // 1-based start line of the matched textAbove boundary block used in the original file
@@ -94,7 +94,7 @@ func normalizeOptionalTextBlock(s *string) []string {
9494 return ioutil .NormalizeTextBlockString (* s )
9595}
9696
97- // insertTextLines inserts Text into a UTF‑8 file.
97+ // insertText inserts Text into a UTF‑8 file.
9898// Behavior notes (entry point):
9999//
100100// - File must exist, be regular, not a symlink, and valid UTF‑8.
@@ -104,11 +104,11 @@ func normalizeOptionalTextBlock(s *string) []string {
104104// and insertion occurs at the start of that blank gap.
105105// - The resulting insertion location must match exactly once; otherwise it fails.
106106// - Writes are atomic and preserve newline style and final newline presence.
107- func insertTextLines (
107+ func insertText (
108108 ctx context.Context ,
109- args InsertTextLinesArgs ,
109+ args InsertTextArgs ,
110110 p fspolicy.FSPolicy ,
111- ) (* InsertTextLinesOut , error ) {
111+ ) (* InsertTextOut , error ) {
112112 if err := ctx .Err (); err != nil {
113113 return nil , err
114114 }
@@ -171,7 +171,7 @@ func insertTextLines(
171171 return nil , err
172172 }
173173
174- return & InsertTextLinesOut {
174+ return & InsertTextOut {
175175 InsertedAtLine : insertAt + 1 ,
176176 InsertedLineCount : len (textToInsert ),
177177 TextAboveMatchedAtLine : textAboveAt ,
0 commit comments