@inferencesh/sdk 0.37.0 → 0.38.0

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.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.38.0] - 2026-10-29
11
+
12
+ ### Changed
13
+ - Reading a chat's messages (`fetchMessages`, `fetchMessagesPage`, `fetchChat`, and the stream's resync after a dropped connection) sends `POST /chats/{id}/messages/list` with the limit and cursor in the body. It was `GET /chats/{id}/messages`.
14
+
15
+ ### Added
16
+ - The server proxy forwards `POST /chats/{id}/messages/list` (`conversations:read`). It still forwards `GET /chats/{id}/messages` for clients on 0.37.0 and older. A page on this version needs a proxy on this version or newer. `src/proxy/endpoints.json` is regenerated from the API.
17
+
10
18
  ## [0.37.0] - 2026-10-29
11
19
 
12
20
  ### Added
package/dist/agent/api.js CHANGED
@@ -95,12 +95,12 @@ export async function fetchMessages(client, chatId, options) {
95
95
  }
96
96
  export async function fetchMessagesPage(client, chatId, options) {
97
97
  try {
98
- const params = {};
98
+ const body = {};
99
99
  if (options?.limit !== undefined)
100
- params.limit = options.limit;
100
+ body.limit = options.limit;
101
101
  if (options?.cursor)
102
- params.cursor = options.cursor;
103
- const resp = await client.http.request('get', `/chats/${chatId}/messages`, { params });
102
+ body.cursor = options.cursor;
103
+ const resp = await client.http.request('post', `/chats/${chatId}/messages/list`, { data: body });
104
104
  return resp.data || { items: [], next_cursor: '', has_next: false };
105
105
  }
106
106
  catch (error) {
@@ -283,7 +283,7 @@ export class Agent {
283
283
  deltaAccums.clear();
284
284
  const [{ data: chat }, { data: page }] = await Promise.all([
285
285
  this.http.request('get', `/chats/${chatId}`),
286
- this.http.request('get', `/chats/${chatId}/messages`),
286
+ this.http.request('post', `/chats/${chatId}/messages/list`),
287
287
  ]);
288
288
  for (const message of page?.items ?? [])
289
289
  observeMessage(message);
@@ -174,6 +174,14 @@
174
174
  "conversations:read"
175
175
  ]
176
176
  },
177
+ {
178
+ "method": "POST",
179
+ "path": "/chats/{id}/messages/list",
180
+ "purpose": "list a chat's messages",
181
+ "scopes": [
182
+ "conversations:read"
183
+ ]
184
+ },
177
185
  {
178
186
  "method": "GET",
179
187
  "path": "/chats/{id}/stream",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inferencesh/sdk",
3
- "version": "0.37.0",
3
+ "version": "0.38.0",
4
4
  "description": "Official JavaScript/TypeScript SDK for inference.sh - Run AI models with a simple API",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",