@forloop-cc/forloop-cli 0.2.14 → 0.2.15

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 (2) hide show
  1. package/dist/forloop +14 -3
  2. package/package.json +1 -1
package/dist/forloop CHANGED
@@ -422,7 +422,6 @@ var ForLoopAPIClient = class {
422
422
  }
423
423
  async ensureOpencodeApiToken(endpoint) {
424
424
  if (this.tokenType !== "jwt") return;
425
- if (!endpoint.startsWith("/api/opencode/")) return;
426
425
  if (endpoint.startsWith("/api/opencode/auth/tokens")) return;
427
426
  if (!this.jwtExchangePromise) {
428
427
  this.jwtExchangePromise = this.exchangeJwtForApiToken();
@@ -505,7 +504,18 @@ var ForLoopAPIClient = class {
505
504
  const error = await this.parseError(response);
506
505
  throw error;
507
506
  }
508
- return response.json();
507
+ if (response.status === 204) {
508
+ return void 0;
509
+ }
510
+ const text = await response.text();
511
+ if (!text) {
512
+ return void 0;
513
+ }
514
+ try {
515
+ return JSON.parse(text);
516
+ } catch {
517
+ throw new APIError("invalid_response", "Failed to parse response body as JSON", 502);
518
+ }
509
519
  } catch (error) {
510
520
  lastError = error;
511
521
  if (error instanceof APIError && error.status >= 400 && error.status < 500) {
@@ -692,8 +702,9 @@ var ForLoopAPIClient = class {
692
702
  async getConversationHistory(params) {
693
703
  const query = new URLSearchParams();
694
704
  if (params?.sprintId) query.append("sprintId", String(params.sprintId));
705
+ if (params?.conversationId) query.append("conversationId", String(params.conversationId));
695
706
  if (params?.limit) query.append("limit", String(params.limit));
696
- return this.request(`/api/opencode/messages?${query}`);
707
+ return this.request(`/api/opencode/conversations/context?${query}`);
697
708
  }
698
709
  async clearConversationHistory(params) {
699
710
  const query = new URLSearchParams();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forloop-cc/forloop-cli",
3
- "version": "0.2.14",
3
+ "version": "0.2.15",
4
4
  "description": "Command-line interface for the ForLoop AI development platform",
5
5
  "type": "module",
6
6
  "license": "MIT",