sentinelayer-cli 0.11.0 → 0.11.1
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/package.json +1 -1
- package/src/commands/session.js +9 -0
- package/src/session/sync.js +23 -1
package/package.json
CHANGED
package/src/commands/session.js
CHANGED
|
@@ -2488,6 +2488,8 @@ export function registerSessionCommand(program) {
|
|
|
2488
2488
|
count: remote.count,
|
|
2489
2489
|
nextCursor: remote.nextCursor || null,
|
|
2490
2490
|
hasMore: Boolean(remote.hasMore),
|
|
2491
|
+
truncated: Boolean(remote.truncated),
|
|
2492
|
+
warnings: Array.isArray(remote.warnings) ? remote.warnings : [],
|
|
2491
2493
|
sessions: trimmed,
|
|
2492
2494
|
};
|
|
2493
2495
|
if (emitJson) {
|
|
@@ -2531,6 +2533,13 @@ export function registerSessionCommand(program) {
|
|
|
2531
2533
|
),
|
|
2532
2534
|
);
|
|
2533
2535
|
}
|
|
2536
|
+
if (remote.truncated) {
|
|
2537
|
+
console.log(
|
|
2538
|
+
pc.yellow(
|
|
2539
|
+
"Remote session listing is truncated by the page cap; JSON output includes nextCursor for resume.",
|
|
2540
|
+
),
|
|
2541
|
+
);
|
|
2542
|
+
}
|
|
2534
2543
|
return;
|
|
2535
2544
|
}
|
|
2536
2545
|
|
package/src/session/sync.js
CHANGED
|
@@ -1255,7 +1255,7 @@ export async function pollSessionEventsBefore(
|
|
|
1255
1255
|
* @param {number} [options.maxPages]
|
|
1256
1256
|
* @param {Function} [options.resolveAuthSession]
|
|
1257
1257
|
* @param {Function} [options.fetchImpl]
|
|
1258
|
-
* @returns {Promise<{ok: boolean, reason: string, sessions: Array<object>, count: number, nextCursor: string|null, hasMore: boolean}>}
|
|
1258
|
+
* @returns {Promise<{ok: boolean, reason: string, sessions: Array<object>, count: number, nextCursor: string|null, hasMore: boolean, truncated: boolean, warnings: Array<object>}>}
|
|
1259
1259
|
*/
|
|
1260
1260
|
export async function listSessionsFromApi({
|
|
1261
1261
|
targetPath = process.cwd(),
|
|
@@ -1283,6 +1283,8 @@ export async function listSessionsFromApi({
|
|
|
1283
1283
|
count: 0,
|
|
1284
1284
|
nextCursor: null,
|
|
1285
1285
|
hasMore: false,
|
|
1286
|
+
truncated: false,
|
|
1287
|
+
warnings: [],
|
|
1286
1288
|
};
|
|
1287
1289
|
}
|
|
1288
1290
|
if (!session || !session.token) {
|
|
@@ -1293,6 +1295,8 @@ export async function listSessionsFromApi({
|
|
|
1293
1295
|
count: 0,
|
|
1294
1296
|
nextCursor: null,
|
|
1295
1297
|
hasMore: false,
|
|
1298
|
+
truncated: false,
|
|
1299
|
+
warnings: [],
|
|
1296
1300
|
};
|
|
1297
1301
|
}
|
|
1298
1302
|
|
|
@@ -1330,6 +1334,8 @@ export async function listSessionsFromApi({
|
|
|
1330
1334
|
count: 0,
|
|
1331
1335
|
nextCursor: null,
|
|
1332
1336
|
hasMore: false,
|
|
1337
|
+
truncated: false,
|
|
1338
|
+
warnings: [],
|
|
1333
1339
|
};
|
|
1334
1340
|
}
|
|
1335
1341
|
if (!response || !response.ok) {
|
|
@@ -1340,6 +1346,8 @@ export async function listSessionsFromApi({
|
|
|
1340
1346
|
count: 0,
|
|
1341
1347
|
nextCursor: null,
|
|
1342
1348
|
hasMore: false,
|
|
1349
|
+
truncated: false,
|
|
1350
|
+
warnings: [],
|
|
1343
1351
|
};
|
|
1344
1352
|
}
|
|
1345
1353
|
const payload = await response.json().catch(() => ({}));
|
|
@@ -1356,6 +1364,18 @@ export async function listSessionsFromApi({
|
|
|
1356
1364
|
if (!fetchAll || !hasMore) break;
|
|
1357
1365
|
}
|
|
1358
1366
|
|
|
1367
|
+
const truncated = Boolean(fetchAll && hasMore && nextCursor);
|
|
1368
|
+
const warnings = truncated
|
|
1369
|
+
? [
|
|
1370
|
+
{
|
|
1371
|
+
code: "SESSION_LIST_MAX_PAGES_REACHED",
|
|
1372
|
+
message: `Session list stopped after ${normalizedMaxPages} pages; output is partial and nextCursor can resume the listing.`,
|
|
1373
|
+
maxPages: normalizedMaxPages,
|
|
1374
|
+
nextCursor,
|
|
1375
|
+
},
|
|
1376
|
+
]
|
|
1377
|
+
: [];
|
|
1378
|
+
|
|
1359
1379
|
return {
|
|
1360
1380
|
ok: true,
|
|
1361
1381
|
reason: "",
|
|
@@ -1363,6 +1383,8 @@ export async function listSessionsFromApi({
|
|
|
1363
1383
|
count,
|
|
1364
1384
|
nextCursor: nextCursor || null,
|
|
1365
1385
|
hasMore,
|
|
1386
|
+
truncated,
|
|
1387
|
+
warnings,
|
|
1366
1388
|
};
|
|
1367
1389
|
}
|
|
1368
1390
|
|