22
33import  {  APIResource  }  from  '../../core/resource' ; 
44import  {  APIPromise  }  from  '../../core/api-promise' ; 
5+ import  {  NextFilesPage ,  type  NextFilesPageParams ,  PagePromise  }  from  '../../core/pagination' ; 
56import  {  RequestOptions  }  from  '../../internal/request-options' ; 
67import  {  path  }  from  '../../internal/utils/path' ; 
78
@@ -13,8 +14,11 @@ export class Files extends APIResource {
1314    agentID : string , 
1415    query : FileListParams  |  null  |  undefined  =  { } , 
1516    options ?: RequestOptions , 
16-   ) : APIPromise < FileListResponse >  { 
17-     return  this . _client . get ( path `/v1/agents/${ agentID }  ,  {  query,  ...options  } ) ; 
17+   ) : PagePromise < FileListResponsesNextFilesPage ,  FileListResponse >  { 
18+     return  this . _client . getAPIList ( path `/v1/agents/${ agentID }  ,  NextFilesPage < FileListResponse > ,  { 
19+       query, 
20+       ...options , 
21+     } ) ; 
1822  } 
1923
2024  /** 
@@ -51,128 +55,80 @@ export class Files extends APIResource {
5155  } 
5256} 
5357
58+ export  type  FileListResponsesNextFilesPage  =  NextFilesPage < FileListResponse > ; 
59+ 
5460/** 
55-  * Paginated response  for agent files  
61+  * Response model  for agent file attachments showing file status in agent context  
5662 */ 
5763export  interface  FileListResponse  { 
5864  /** 
59-    * List  of file attachments for  the agent 
65+    * Unique identifier  of the file- agent relationship  
6066   */ 
61-   files :  Array < FileListResponse . File > ; 
67+   id :  string ; 
6268
6369  /** 
64-    * Whether more results exist after this page  
70+    * Unique identifier of the file  
6571   */ 
66-   has_more :  boolean ; 
72+   file_id :  string ; 
6773
6874  /** 
69-    * Cursor for fetching  the next page ( file-agent relationship ID)  
75+    * Name of  the file 
7076   */ 
71-   next_cursor ?: string  |  null ; 
72- } 
73- 
74- export  namespace  FileListResponse  { 
75-   /** 
76-    * Response model for agent file attachments showing file status in agent context 
77-    */ 
78-   export  interface  File  { 
79-     /** 
80-      * Unique identifier of the file-agent relationship 
81-      */ 
82-     id : string ; 
83- 
84-     /** 
85-      * Unique identifier of the file 
86-      */ 
87-     file_id : string ; 
88- 
89-     /** 
90-      * Name of the file 
91-      */ 
92-     file_name : string ; 
93- 
94-     /** 
95-      * Unique identifier of the folder/source 
96-      */ 
97-     folder_id : string ; 
98- 
99-     /** 
100-      * Name of the folder/source 
101-      */ 
102-     folder_name : string ; 
103- 
104-     /** 
105-      * Whether the file is currently open in the agent's context 
106-      */ 
107-     is_open : boolean ; 
108- 
109-     /** 
110-      * Ending line number if file was opened with line range 
111-      */ 
112-     end_line ?: number  |  null ; 
113- 
114-     /** 
115-      * Timestamp of last access by the agent 
116-      */ 
117-     last_accessed_at ?: string  |  null ; 
118- 
119-     /** 
120-      * Starting line number if file was opened with line range 
121-      */ 
122-     start_line ?: number  |  null ; 
123- 
124-     /** 
125-      * Portion of the file visible to the agent if open 
126-      */ 
127-     visible_content ?: string  |  null ; 
128-   } 
129- } 
130- 
131- export  type  FileCloseResponse  =  unknown ; 
77+   file_name : string ; 
13278
133- export  type  FileCloseAllResponse  =  Array < string > ; 
79+   /** 
80+    * Unique identifier of the folder/source 
81+    */ 
82+   folder_id : string ; 
13483
135- export  type  FileOpenResponse  =  Array < string > ; 
84+   /** 
85+    * Name of the folder/source 
86+    */ 
87+   folder_name : string ; 
13688
137- export  interface  FileListParams  { 
13889  /** 
139-    * File ID cursor for pagination. Returns files that come after this file ID in the 
140-    * specified sort order 
90+    * Whether the file is currently open in the agent's context 
14191   */ 
142-   after ?:  string   |   null ; 
92+   is_open :  boolean ; 
14393
14494  /** 
145-    * File ID cursor for pagination. Returns files that come before this file ID in 
146-    * the specified sort order 
95+    * Ending line number if file was opened with line range 
14796   */ 
148-   before ?: string  |  null ; 
97+   end_line ?: number  |  null ; 
14998
15099  /** 
151-    * @deprecated  Pagination cursor from previous response (deprecated, use 
152-    * before/after) 
100+    * Timestamp of last access by the agent 
153101   */ 
154-   cursor ?: string  |  null ; 
102+   last_accessed_at ?: string  |  null ; 
155103
156104  /** 
157-    * Filter by open status (true for open files, false for closed files)  
105+    * Starting line number if file was opened with line range  
158106   */ 
159-   is_open ?: boolean  |  null ; 
107+   start_line ?: number  |  null ; 
160108
161109  /** 
162-    * Maximum number  of files  to return  
110+    * Portion  of the file visible  to the agent if open  
163111   */ 
164-   limit ?: number  |  null ; 
112+   visible_content ?: string  |  null ; 
113+ } 
114+ 
115+ export  type  FileCloseResponse  =  unknown ; 
116+ 
117+ export  type  FileCloseAllResponse  =  Array < string > ; 
165118
119+ export  type  FileOpenResponse  =  Array < string > ; 
120+ 
121+ export  interface  FileListParams  extends  NextFilesPageParams  { 
166122  /** 
167-    * Sort order for files by creation time. 'asc' for oldest first, 'desc' for newest  
168-    * first  
123+    * @deprecated  Pagination cursor from previous response (deprecated, use  
124+    * before/after)  
169125   */ 
170-   order ?: 'asc'  |  'desc' ; 
126+   cursor ?: string  |  null ; 
171127
172128  /** 
173-    * Field to sort by  
129+    * Filter by open status (true for open files, false for closed files)  
174130   */ 
175-   order_by ?: 'created_at' ; 
131+   is_open ?: boolean   |   null ; 
176132} 
177133
178134export  interface  FileCloseParams  { 
@@ -195,6 +151,7 @@ export declare namespace Files {
195151    type  FileCloseResponse  as  FileCloseResponse , 
196152    type  FileCloseAllResponse  as  FileCloseAllResponse , 
197153    type  FileOpenResponse  as  FileOpenResponse , 
154+     type  FileListResponsesNextFilesPage  as  FileListResponsesNextFilesPage , 
198155    type  FileListParams  as  FileListParams , 
199156    type  FileCloseParams  as  FileCloseParams , 
200157    type  FileOpenParams  as  FileOpenParams , 
0 commit comments