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 @@ -132,15 +132,34 @@ export namespace SessionPrompt {
132132 const info = yield * fsys . stat ( filepath ) . pipe ( Effect . option )
133133 if ( Option . isNone ( info ) ) {
134134 const found = yield * agents . get ( name )
135- if ( found ) parts . push ( { type : "agent" , name : found . name } )
135+ if ( found ) {
136+ parts . push ( {
137+ type : "agent" as const ,
138+ name : found . name ,
139+ source : {
140+ start : match . index ! ,
141+ end : match . index ! + match [ 0 ] . length ,
142+ value : match [ 0 ] ,
143+ } ,
144+ } )
145+ }
136146 return
137147 }
138148 const stat = info . value
139149 parts . push ( {
140- type : "file" ,
141- url : pathToFileURL ( filepath ) . href ,
142- filename : name ,
150+ type : "file" as const ,
143151 mime : stat . type === "Directory" ? "application/x-directory" : "text/plain" ,
152+ filename : name ,
153+ url : pathToFileURL ( filepath ) . href ,
154+ source : {
155+ type : "file" as const ,
156+ path : name ,
157+ text : {
158+ start : match . index ! ,
159+ end : match . index ! + match [ 0 ] . length ,
160+ value : match [ 0 ] ,
161+ } ,
162+ } ,
144163 } )
145164 } ) ,
146165 { concurrency : "unbounded" , discard : true } ,
You can’t perform that action at this time.
0 commit comments