@forloop-cc/forloop-cli 0.2.13 → 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.
- package/ERRORS.md +1 -1
- package/dist/forloop +26 -15
- package/package.json +1 -1
package/ERRORS.md
CHANGED
|
@@ -74,7 +74,7 @@ No error scenarios — silently clears the token.
|
|
|
74
74
|
|
|
75
75
|
| Scenario | Error Message |
|
|
76
76
|
|---|---|
|
|
77
|
-
| `--confirm` not provided | `Error: --confirm is required to permanently delete a
|
|
77
|
+
| `--confirm` not provided | `Error: --confirm is required to permanently delete a space.` |
|
|
78
78
|
| Sprint not found | `ForLoop API DELETE /api/opencode/sprints/<id> failed: 404 Not Found` |
|
|
79
79
|
|
|
80
80
|
---
|
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
|
-
|
|
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/
|
|
707
|
+
return this.request(`/api/opencode/conversations/context?${query}`);
|
|
697
708
|
}
|
|
698
709
|
async clearConversationHistory(params) {
|
|
699
710
|
const query = new URLSearchParams();
|
|
@@ -1158,7 +1169,7 @@ async function getClient2() {
|
|
|
1158
1169
|
function createSprintGetCommand() {
|
|
1159
1170
|
return defineCommand({
|
|
1160
1171
|
name: "space-sprint get",
|
|
1161
|
-
description: "Get
|
|
1172
|
+
description: "Get space details including stories and files",
|
|
1162
1173
|
usage: "forloop space-sprint get --id <number>",
|
|
1163
1174
|
options: [
|
|
1164
1175
|
{ flag: "--id <number>", description: "Sprint ID (auto-detected if not provided)", type: "number" },
|
|
@@ -1192,7 +1203,7 @@ function createSprintGetCommand() {
|
|
|
1192
1203
|
function createSprintListCommand() {
|
|
1193
1204
|
return defineCommand({
|
|
1194
1205
|
name: "space-sprint list",
|
|
1195
|
-
description: "List all accessible
|
|
1206
|
+
description: "List all accessible spaces",
|
|
1196
1207
|
usage: "forloop space-sprint list [--org-id <id>] [--include-system-org]",
|
|
1197
1208
|
options: [
|
|
1198
1209
|
{ flag: "--org-id <id>", description: "Filter by organization ID", type: "number" },
|
|
@@ -1214,14 +1225,14 @@ function createSprintListCommand() {
|
|
|
1214
1225
|
function createSprintCreateCommand() {
|
|
1215
1226
|
return defineCommand({
|
|
1216
1227
|
name: "space-sprint create",
|
|
1217
|
-
description: "Create a new
|
|
1228
|
+
description: "Create a new space",
|
|
1218
1229
|
usage: "forloop space-sprint create --title <text> --start-date <YYYY-MM-DD> --end-date <YYYY-MM-DD> [flags]",
|
|
1219
1230
|
options: [
|
|
1220
1231
|
{ flag: "--title <text>", description: "Sprint title", required: true },
|
|
1221
1232
|
{ flag: "--start-date <date>", description: "Start date (YYYY-MM-DD)", required: true },
|
|
1222
1233
|
{ flag: "--end-date <date>", description: "End date (YYYY-MM-DD)", required: true },
|
|
1223
1234
|
{ flag: "--description <text>", description: "Sprint description" },
|
|
1224
|
-
{ flag: "--private", description: "Make
|
|
1235
|
+
{ flag: "--private", description: "Make space private" },
|
|
1225
1236
|
{ flag: "--org-id <id>", description: "Organization ID", type: "number" }
|
|
1226
1237
|
],
|
|
1227
1238
|
examples: ['forloop space-sprint create --title "Sprint 15" --start-date 2026-06-09 --end-date 2026-06-23'],
|
|
@@ -1248,7 +1259,7 @@ function createSprintCreateCommand() {
|
|
|
1248
1259
|
function createSprintUpdateCommand() {
|
|
1249
1260
|
return defineCommand({
|
|
1250
1261
|
name: "space-sprint update",
|
|
1251
|
-
description: "Update
|
|
1262
|
+
description: "Update space details",
|
|
1252
1263
|
usage: "forloop space-sprint update --id <number> [flags]",
|
|
1253
1264
|
options: [
|
|
1254
1265
|
{ flag: "--id <number>", description: "Sprint ID", required: true, type: "number" },
|
|
@@ -1274,14 +1285,14 @@ function createSprintUpdateCommand() {
|
|
|
1274
1285
|
process.exit(1);
|
|
1275
1286
|
}
|
|
1276
1287
|
const sprint = await client.updateSprint(flags.id, updateData);
|
|
1277
|
-
print(config, sprint, `
|
|
1288
|
+
print(config, sprint, `Space #${sprint.id} updated successfully.`);
|
|
1278
1289
|
}
|
|
1279
1290
|
});
|
|
1280
1291
|
}
|
|
1281
1292
|
function createSprintDeleteCommand() {
|
|
1282
1293
|
return defineCommand({
|
|
1283
1294
|
name: "space-sprint delete",
|
|
1284
|
-
description: "Delete a
|
|
1295
|
+
description: "Delete a space permanently",
|
|
1285
1296
|
usage: "forloop space-sprint delete --id <number> --confirm",
|
|
1286
1297
|
options: [
|
|
1287
1298
|
{ flag: "--id <number>", description: "Sprint ID", required: true, type: "number" },
|
|
@@ -1290,21 +1301,21 @@ function createSprintDeleteCommand() {
|
|
|
1290
1301
|
examples: ["forloop space-sprint delete --id 456 --confirm"],
|
|
1291
1302
|
async run(config, flags) {
|
|
1292
1303
|
if (!flags.confirm) {
|
|
1293
|
-
console.error("Error: --confirm is required to permanently delete a
|
|
1304
|
+
console.error("Error: --confirm is required to permanently delete a space.");
|
|
1294
1305
|
process.exit(1);
|
|
1295
1306
|
}
|
|
1296
1307
|
const resolved = await getClient2();
|
|
1297
1308
|
if (!resolved) return;
|
|
1298
1309
|
const { client } = resolved;
|
|
1299
1310
|
const result = await client.deleteSprint(flags.id);
|
|
1300
|
-
print(config, result, `
|
|
1311
|
+
print(config, result, `Space #${flags.id} deleted successfully.`);
|
|
1301
1312
|
}
|
|
1302
1313
|
});
|
|
1303
1314
|
}
|
|
1304
1315
|
function createSubSprintListCommand() {
|
|
1305
1316
|
return defineCommand({
|
|
1306
1317
|
name: "space-sprint sub-sprint list",
|
|
1307
|
-
description: "List all iterations within a
|
|
1318
|
+
description: "List all iterations within a space",
|
|
1308
1319
|
usage: "forloop space-sprint sub-sprint list [--sprint-id <number>]",
|
|
1309
1320
|
options: [
|
|
1310
1321
|
{ flag: "--sprint-id <number>", description: "Sprint ID (auto-detected if not provided)", type: "number" }
|
|
@@ -1639,7 +1650,7 @@ function createAgentHistoryCommand() {
|
|
|
1639
1650
|
function createDeveloperSprintCommand() {
|
|
1640
1651
|
return defineCommand({
|
|
1641
1652
|
name: "agent developer-space-sprint",
|
|
1642
|
-
description: "Trigger the developer agent to implement
|
|
1653
|
+
description: "Trigger the developer agent to implement space stories",
|
|
1643
1654
|
usage: "forloop agent developer-space-sprint --sprint <id> [--message <text>]",
|
|
1644
1655
|
options: [
|
|
1645
1656
|
{ flag: "--sprint <id>", description: "Sprint ID", required: true, type: "number" },
|
|
@@ -2305,7 +2316,7 @@ ${b("Usage:")} forloop <resource> <command> [flags]
|
|
|
2305
2316
|
|
|
2306
2317
|
${b("Resources:")}
|
|
2307
2318
|
${a("auth")} ${d("Authentication (login, status, logout)")}
|
|
2308
|
-
${a("space-sprint")}${d("
|
|
2319
|
+
${a("space-sprint")}${d("Space operations (list, get, create, update, delete)")}
|
|
2309
2320
|
${a("story")} ${d("Story operations (create, get, update, delete)")}
|
|
2310
2321
|
${a("template")} ${d("Template operations (list)")}
|
|
2311
2322
|
${a("agent")} ${d("Agent operations (history, developer-space-sprint, developer-status)")}
|