@letta-ai/letta-client 1.0.0-alpha.13 → 1.0.0-alpha.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/client.d.mts +7 -1
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +7 -1
  5. package/client.d.ts.map +1 -1
  6. package/client.js +7 -2
  7. package/client.js.map +1 -1
  8. package/client.mjs +7 -2
  9. package/client.mjs.map +1 -1
  10. package/core/pagination.d.mts +1 -1
  11. package/core/pagination.d.mts.map +1 -1
  12. package/core/pagination.d.ts +1 -1
  13. package/core/pagination.d.ts.map +1 -1
  14. package/core/pagination.js +6 -6
  15. package/core/pagination.js.map +1 -1
  16. package/core/pagination.mjs +6 -6
  17. package/core/pagination.mjs.map +1 -1
  18. package/package.json +1 -1
  19. package/resources/agents/agents.d.mts +2 -2
  20. package/resources/agents/agents.d.mts.map +1 -1
  21. package/resources/agents/agents.d.ts +2 -2
  22. package/resources/agents/agents.d.ts.map +1 -1
  23. package/resources/agents/agents.js.map +1 -1
  24. package/resources/agents/agents.mjs.map +1 -1
  25. package/resources/agents/files.d.mts +39 -79
  26. package/resources/agents/files.d.mts.map +1 -1
  27. package/resources/agents/files.d.ts +39 -79
  28. package/resources/agents/files.d.ts.map +1 -1
  29. package/resources/agents/files.js +5 -1
  30. package/resources/agents/files.js.map +1 -1
  31. package/resources/agents/files.mjs +5 -1
  32. package/resources/agents/files.mjs.map +1 -1
  33. package/resources/agents/index.d.mts +1 -1
  34. package/resources/agents/index.d.mts.map +1 -1
  35. package/resources/agents/index.d.ts +1 -1
  36. package/resources/agents/index.d.ts.map +1 -1
  37. package/resources/agents/index.js.map +1 -1
  38. package/resources/agents/index.mjs.map +1 -1
  39. package/resources/templates/agents.d.mts +9 -14
  40. package/resources/templates/agents.d.mts.map +1 -1
  41. package/resources/templates/agents.d.ts +9 -14
  42. package/resources/templates/agents.d.ts.map +1 -1
  43. package/resources/templates/agents.js +2 -3
  44. package/resources/templates/agents.js.map +1 -1
  45. package/resources/templates/agents.mjs +2 -3
  46. package/resources/templates/agents.mjs.map +1 -1
  47. package/src/client.ts +13 -1
  48. package/src/core/pagination.ts +7 -7
  49. package/src/resources/agents/agents.ts +2 -0
  50. package/src/resources/agents/files.ts +47 -90
  51. package/src/resources/agents/index.ts +1 -0
  52. package/src/resources/templates/agents.ts +14 -17
  53. package/src/version.ts +1 -1
  54. package/version.d.mts +1 -1
  55. package/version.d.ts +1 -1
  56. package/version.js +1 -1
  57. package/version.mjs +1 -1
@@ -2,6 +2,7 @@
2
2
 
3
3
  import { APIResource } from '../../core/resource';
4
4
  import { APIPromise } from '../../core/api-promise';
5
+ import { NextFilesPage, type NextFilesPageParams, PagePromise } from '../../core/pagination';
5
6
  import { RequestOptions } from '../../internal/request-options';
6
7
  import { path } from '../../internal/utils/path';
7
8
 
@@ -13,8 +14,11 @@ export class Files extends APIResource {
13
14
  agentID: string,
14
15
  query: FileListParams | null | undefined = {},
15
16
  options?: RequestOptions,
16
- ): APIPromise<FileListResponse> {
17
- return this._client.get(path`/v1/agents/${agentID}/files`, { query, ...options });
17
+ ): PagePromise<FileListResponsesNextFilesPage, FileListResponse> {
18
+ return this._client.getAPIList(path`/v1/agents/${agentID}/files`, NextFilesPage<FileListResponse>, {
19
+ query,
20
+ ...options,
21
+ });
18
22
  }
19
23
 
20
24
  /**
@@ -51,128 +55,80 @@ export class Files extends APIResource {
51
55
  }
52
56
  }
53
57
 
58
+ export type FileListResponsesNextFilesPage = NextFilesPage<FileListResponse>;
59
+
54
60
  /**
55
- * Paginated response for agent files
61
+ * Response model for agent file attachments showing file status in agent context
56
62
  */
57
63
  export interface FileListResponse {
58
64
  /**
59
- * List of file attachments for the agent
65
+ * Unique identifier of the file-agent relationship
60
66
  */
61
- files: Array<FileListResponse.File>;
67
+ id: string;
62
68
 
63
69
  /**
64
- * Whether more results exist after this page
70
+ * Unique identifier of the file
65
71
  */
66
- has_more: boolean;
72
+ file_id: string;
67
73
 
68
74
  /**
69
- * Cursor for fetching the next page (file-agent relationship ID)
75
+ * Name of the file
70
76
  */
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;
132
78
 
133
- export type FileCloseAllResponse = Array<string>;
79
+ /**
80
+ * Unique identifier of the folder/source
81
+ */
82
+ folder_id: string;
134
83
 
135
- export type FileOpenResponse = Array<string>;
84
+ /**
85
+ * Name of the folder/source
86
+ */
87
+ folder_name: string;
136
88
 
137
- export interface FileListParams {
138
89
  /**
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
141
91
  */
142
- after?: string | null;
92
+ is_open: boolean;
143
93
 
144
94
  /**
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
147
96
  */
148
- before?: string | null;
97
+ end_line?: number | null;
149
98
 
150
99
  /**
151
- * @deprecated Pagination cursor from previous response (deprecated, use
152
- * before/after)
100
+ * Timestamp of last access by the agent
153
101
  */
154
- cursor?: string | null;
102
+ last_accessed_at?: string | null;
155
103
 
156
104
  /**
157
- * Filter by open status (true for open files, false for closed files)
105
+ * Starting line number if file was opened with line range
158
106
  */
159
- is_open?: boolean | null;
107
+ start_line?: number | null;
160
108
 
161
109
  /**
162
- * Maximum number of files to return
110
+ * Portion of the file visible to the agent if open
163
111
  */
164
- limit?: number | null;
112
+ visible_content?: string | null;
113
+ }
114
+
115
+ export type FileCloseResponse = unknown;
116
+
117
+ export type FileCloseAllResponse = Array<string>;
165
118
 
119
+ export type FileOpenResponse = Array<string>;
120
+
121
+ export interface FileListParams extends NextFilesPageParams {
166
122
  /**
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)
169
125
  */
170
- order?: 'asc' | 'desc';
126
+ cursor?: string | null;
171
127
 
172
128
  /**
173
- * Field to sort by
129
+ * Filter by open status (true for open files, false for closed files)
174
130
  */
175
- order_by?: 'created_at';
131
+ is_open?: boolean | null;
176
132
  }
177
133
 
178
134
  export interface FileCloseParams {
@@ -195,6 +151,7 @@ export declare namespace Files {
195
151
  type FileCloseResponse as FileCloseResponse,
196
152
  type FileCloseAllResponse as FileCloseAllResponse,
197
153
  type FileOpenResponse as FileOpenResponse,
154
+ type FileListResponsesNextFilesPage as FileListResponsesNextFilesPage,
198
155
  type FileListParams as FileListParams,
199
156
  type FileCloseParams as FileCloseParams,
200
157
  type FileOpenParams as FileOpenParams,
@@ -50,6 +50,7 @@ export {
50
50
  type FileListParams,
51
51
  type FileCloseParams,
52
52
  type FileOpenParams,
53
+ type FileListResponsesNextFilesPage,
53
54
  } from './files';
54
55
  export {
55
56
  Folders,
@@ -10,9 +10,12 @@ export class Agents extends APIResource {
10
10
  /**
11
11
  * Creates an Agent or multiple Agents from a template
12
12
  */
13
- create(templateVersion: string, params: AgentCreateParams, options?: RequestOptions): APIPromise<void> {
14
- const { project_id, ...body } = params;
15
- return this._client.post(path`/v1/templates/${project_id}/${templateVersion}/agents`, {
13
+ create(
14
+ templateVersion: string,
15
+ body: AgentCreateParams | null | undefined = {},
16
+ options?: RequestOptions,
17
+ ): APIPromise<void> {
18
+ return this._client.post(path`/v1/templates/${templateVersion}/agents`, {
16
19
  body,
17
20
  ...options,
18
21
  headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
@@ -22,40 +25,34 @@ export class Agents extends APIResource {
22
25
 
23
26
  export interface AgentCreateParams {
24
27
  /**
25
- * Path param: The project id
26
- */
27
- project_id: string;
28
-
29
- /**
30
- * Body param: The name of the agent, optional otherwise a random one will be
31
- * assigned
28
+ * The name of the agent, optional otherwise a random one will be assigned
32
29
  */
33
30
  agent_name?: string;
34
31
 
35
32
  /**
36
- * Body param: The identity ids to assign to the agent
33
+ * The identity ids to assign to the agent
37
34
  */
38
35
  identity_ids?: Array<string>;
39
36
 
40
37
  /**
41
- * Body param: Set an initial sequence of messages, if not provided, the agent will
42
- * start with the default message sequence, if an empty array is provided, the
43
- * agent will start with no messages
38
+ * Set an initial sequence of messages, if not provided, the agent will start with
39
+ * the default message sequence, if an empty array is provided, the agent will
40
+ * start with no messages
44
41
  */
45
42
  initial_message_sequence?: Array<AgentCreateParams.InitialMessageSequence>;
46
43
 
47
44
  /**
48
- * Body param: The memory variables to assign to the agent
45
+ * The memory variables to assign to the agent
49
46
  */
50
47
  memory_variables?: { [key: string]: string };
51
48
 
52
49
  /**
53
- * Body param: The tags to assign to the agent
50
+ * The tags to assign to the agent
54
51
  */
55
52
  tags?: Array<string>;
56
53
 
57
54
  /**
58
- * Body param: The tool variables to assign to the agent
55
+ * The tool variables to assign to the agent
59
56
  */
60
57
  tool_variables?: { [key: string]: string };
61
58
  }
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '1.0.0-alpha.13'; // x-release-please-version
1
+ export const VERSION = '1.0.0-alpha.14'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.0.0-alpha.13";
1
+ export declare const VERSION = "1.0.0-alpha.14";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.0.0-alpha.13";
1
+ export declare const VERSION = "1.0.0-alpha.14";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '1.0.0-alpha.13'; // x-release-please-version
4
+ exports.VERSION = '1.0.0-alpha.14'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '1.0.0-alpha.13'; // x-release-please-version
1
+ export const VERSION = '1.0.0-alpha.14'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map