@tryarcanist/cli 0.1.82 → 0.1.83
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/dist/index.js +16 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1354,7 +1354,6 @@ var ERROR_CODES = [
|
|
|
1354
1354
|
"rate_limit",
|
|
1355
1355
|
"api_error",
|
|
1356
1356
|
"config_error",
|
|
1357
|
-
"doom_loop",
|
|
1358
1357
|
"failed_edits",
|
|
1359
1358
|
"empty_completion",
|
|
1360
1359
|
"followup_not_started",
|
|
@@ -1387,7 +1386,6 @@ var ERROR_CODE_LABELS = {
|
|
|
1387
1386
|
rate_limit: "Provider rate limit",
|
|
1388
1387
|
api_error: "Provider API error",
|
|
1389
1388
|
config_error: "Configuration error",
|
|
1390
|
-
doom_loop: "Repeated failure loop",
|
|
1391
1389
|
failed_edits: "Edit failure",
|
|
1392
1390
|
empty_completion: "Empty completion",
|
|
1393
1391
|
followup_not_started: "Follow-up did not start",
|
|
@@ -2147,9 +2145,11 @@ async function getSessionCommand(sessionId, options, command) {
|
|
|
2147
2145
|
if (session.title) console.log(`Title: ${String(session.title)}`);
|
|
2148
2146
|
}
|
|
2149
2147
|
async function sessionEventsCommand(sessionId, options, command) {
|
|
2148
|
+
const afterSequence = resolveSequenceOption(options.afterSequence, options.after, "--after-sequence", "--after");
|
|
2149
|
+
const beforeSequence = resolveSequenceOption(options.beforeSequence, options.before, "--before-sequence", "--before");
|
|
2150
2150
|
if (options.follow) {
|
|
2151
|
-
if (
|
|
2152
|
-
throw new CliError("user", "--before-sequence cannot be used with --follow.");
|
|
2151
|
+
if (beforeSequence) {
|
|
2152
|
+
throw new CliError("user", "--before-sequence/--before cannot be used with --follow.");
|
|
2153
2153
|
}
|
|
2154
2154
|
if (options.promptId) {
|
|
2155
2155
|
throw new CliError(
|
|
@@ -2159,7 +2159,7 @@ async function sessionEventsCommand(sessionId, options, command) {
|
|
|
2159
2159
|
}
|
|
2160
2160
|
await watchCommand(
|
|
2161
2161
|
sessionId,
|
|
2162
|
-
{ ...options, pollInterval: options.pollInterval, afterSequence
|
|
2162
|
+
{ ...options, pollInterval: options.pollInterval, afterSequence, limit: options.limit },
|
|
2163
2163
|
command
|
|
2164
2164
|
);
|
|
2165
2165
|
return;
|
|
@@ -2167,8 +2167,8 @@ async function sessionEventsCommand(sessionId, options, command) {
|
|
|
2167
2167
|
const runtime = getRuntimeOptions(command, options);
|
|
2168
2168
|
const config = requireConfig(runtime);
|
|
2169
2169
|
const query = new URLSearchParams();
|
|
2170
|
-
if (
|
|
2171
|
-
if (
|
|
2170
|
+
if (afterSequence) query.set("after_sequence", afterSequence);
|
|
2171
|
+
if (beforeSequence) query.set("before_sequence", beforeSequence);
|
|
2172
2172
|
if (options.promptId) query.set("prompt_id", options.promptId);
|
|
2173
2173
|
if (options.limit) query.set("limit", options.limit);
|
|
2174
2174
|
const payload = await apiFetch(config, `/api/sessions/${sessionId}/events/history${query.size ? `?${query.toString()}` : ""}`);
|
|
@@ -2201,6 +2201,12 @@ async function sessionEventsCommand(sessionId, options, command) {
|
|
|
2201
2201
|
}
|
|
2202
2202
|
if (textOpen) process.stdout.write("\n");
|
|
2203
2203
|
}
|
|
2204
|
+
function resolveSequenceOption(canonicalValue, aliasValue, canonicalFlag, aliasFlag) {
|
|
2205
|
+
if (canonicalValue !== void 0 && aliasValue !== void 0) {
|
|
2206
|
+
throw new CliError("user", `${aliasFlag} cannot be combined with ${canonicalFlag}.`);
|
|
2207
|
+
}
|
|
2208
|
+
return canonicalValue ?? aliasValue;
|
|
2209
|
+
}
|
|
2204
2210
|
async function usageCommand(sessionId, options, command) {
|
|
2205
2211
|
const runtime = getRuntimeOptions(command, options);
|
|
2206
2212
|
const config = requireConfig(runtime);
|
|
@@ -2531,11 +2537,13 @@ Examples:
|
|
|
2531
2537
|
arcanist sessions search "mcp debugging" --tag codex --json
|
|
2532
2538
|
`
|
|
2533
2539
|
).action((query, options, command) => searchSessionsCommand(query, options, command));
|
|
2534
|
-
sessions.command("events").description("Read or follow session replay events").argument("<session-id>", "Session ID").option("--after-sequence <n>", "Return events after this sequence").option("--before-sequence <n>", "Return events before this sequence").option("--prompt-id <id>", "Filter events by prompt ID").option("--limit <n>", "Maximum events to return").option("--follow", "Follow events until the session is idle").option("--poll-interval <ms>", "Polling interval in milliseconds", String(DEFAULT_WATCH_POLL_INTERVAL_MS)).addHelpText(
|
|
2540
|
+
sessions.command("events").description("Read or follow session replay events").argument("<session-id>", "Session ID").option("--after-sequence <n>", "Return events after this sequence").option("--after <n>", "Alias for --after-sequence").option("--before-sequence <n>", "Return events before this sequence").option("--before <n>", "Alias for --before-sequence").option("--prompt-id <id>", "Filter events by prompt ID").option("--limit <n>", "Maximum events to return").option("--follow", "Follow events until the session is idle").option("--poll-interval <ms>", "Polling interval in milliseconds", String(DEFAULT_WATCH_POLL_INTERVAL_MS)).addHelpText(
|
|
2535
2541
|
"after",
|
|
2536
2542
|
`
|
|
2537
2543
|
Examples:
|
|
2538
2544
|
arcanist sessions events <session-id> --json
|
|
2545
|
+
arcanist sessions events <session-id> --after-sequence 540 --limit 250 --json
|
|
2546
|
+
arcanist sessions events <session-id> --after 540 --limit 250 --json
|
|
2539
2547
|
arcanist sessions events <session-id> --follow --json
|
|
2540
2548
|
`
|
|
2541
2549
|
).action((sessionId, options, command) => sessionEventsCommand(sessionId, options, command));
|