File tree Expand file tree Collapse file tree 1 file changed +23
-4
lines changed
packages/opencode/src/session Expand file tree Collapse file tree 1 file changed +23
-4
lines changed Original file line number Diff line number Diff line change @@ -170,15 +170,34 @@ export namespace SessionPrompt {
170170 const info = yield * fsys . stat ( filepath ) . pipe ( Effect . option )
171171 if ( Option . isNone ( info ) ) {
172172 const found = yield * agents . get ( name )
173- if ( found ) parts . push ( { type : "agent" , name : found . name } )
173+ if ( found ) {
174+ parts . push ( {
175+ type : "agent" as const ,
176+ name : found . name ,
177+ source : {
178+ start : match . index ! ,
179+ end : match . index ! + match [ 0 ] . length ,
180+ value : match [ 0 ] ,
181+ } ,
182+ } )
183+ }
174184 return
175185 }
176186 const stat = info . value
177187 parts . push ( {
178- type : "file" ,
179- url : pathToFileURL ( filepath ) . href ,
180- filename : name ,
188+ type : "file" as const ,
181189 mime : stat . type === "Directory" ? "application/x-directory" : "text/plain" ,
190+ filename : name ,
191+ url : pathToFileURL ( filepath ) . href ,
192+ source : {
193+ type : "file" as const ,
194+ path : name ,
195+ text : {
196+ start : match . index ! ,
197+ end : match . index ! + match [ 0 ] . length ,
198+ value : match [ 0 ] ,
199+ } ,
200+ } ,
182201 } )
183202 } ) ,
184203 { concurrency : "unbounded" , discard : true } ,
You can’t perform that action at this time.
0 commit comments