@tryarcanist/cli 0.1.82 → 0.1.84

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/index.js +21 -8
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -401,6 +401,9 @@ var TERMINAL_PHASES_ARRAY = [
401
401
  "archived"
402
402
  ];
403
403
  var TERMINAL_PHASES = new Set(TERMINAL_PHASES_ARRAY);
404
+ var TERMINAL_FOR_FALLBACK_POLLING_PHASES = new Set(
405
+ TERMINAL_PHASES_ARRAY.filter((phase) => phase !== "completed")
406
+ );
404
407
  function isTerminalPhase(phase, sessionKind) {
405
408
  if (TERMINAL_PHASES.has(phase)) return true;
406
409
  return phase === "idle" && !isRepoSession(sessionKind);
@@ -1354,7 +1357,6 @@ var ERROR_CODES = [
1354
1357
  "rate_limit",
1355
1358
  "api_error",
1356
1359
  "config_error",
1357
- "doom_loop",
1358
1360
  "failed_edits",
1359
1361
  "empty_completion",
1360
1362
  "followup_not_started",
@@ -1368,6 +1370,7 @@ var ERROR_CODES = [
1368
1370
  "spawn_preconnect",
1369
1371
  "sandbox_terminated",
1370
1372
  "sandbox_disconnected",
1373
+ "session_archived",
1371
1374
  "sandbox_callback",
1372
1375
  "codex_startup_timeout",
1373
1376
  "codex_api_readiness_timeout",
@@ -1387,7 +1390,6 @@ var ERROR_CODE_LABELS = {
1387
1390
  rate_limit: "Provider rate limit",
1388
1391
  api_error: "Provider API error",
1389
1392
  config_error: "Configuration error",
1390
- doom_loop: "Repeated failure loop",
1391
1393
  failed_edits: "Edit failure",
1392
1394
  empty_completion: "Empty completion",
1393
1395
  followup_not_started: "Follow-up did not start",
@@ -1401,6 +1403,7 @@ var ERROR_CODE_LABELS = {
1401
1403
  spawn_preconnect: "Sandbox failed before connecting",
1402
1404
  sandbox_terminated: "Sandbox terminated",
1403
1405
  sandbox_disconnected: "Sandbox disconnected",
1406
+ session_archived: "Session archived while processing",
1404
1407
  sandbox_callback: "Sandbox callback failed",
1405
1408
  codex_startup_timeout: "Codex startup timed out",
1406
1409
  codex_api_readiness_timeout: "Codex API readiness timed out",
@@ -2147,9 +2150,11 @@ async function getSessionCommand(sessionId, options, command) {
2147
2150
  if (session.title) console.log(`Title: ${String(session.title)}`);
2148
2151
  }
2149
2152
  async function sessionEventsCommand(sessionId, options, command) {
2153
+ const afterSequence = resolveSequenceOption(options.afterSequence, options.after, "--after-sequence", "--after");
2154
+ const beforeSequence = resolveSequenceOption(options.beforeSequence, options.before, "--before-sequence", "--before");
2150
2155
  if (options.follow) {
2151
- if (options.beforeSequence) {
2152
- throw new CliError("user", "--before-sequence cannot be used with --follow.");
2156
+ if (beforeSequence) {
2157
+ throw new CliError("user", "--before-sequence/--before cannot be used with --follow.");
2153
2158
  }
2154
2159
  if (options.promptId) {
2155
2160
  throw new CliError(
@@ -2159,7 +2164,7 @@ async function sessionEventsCommand(sessionId, options, command) {
2159
2164
  }
2160
2165
  await watchCommand(
2161
2166
  sessionId,
2162
- { ...options, pollInterval: options.pollInterval, afterSequence: options.afterSequence, limit: options.limit },
2167
+ { ...options, pollInterval: options.pollInterval, afterSequence, limit: options.limit },
2163
2168
  command
2164
2169
  );
2165
2170
  return;
@@ -2167,8 +2172,8 @@ async function sessionEventsCommand(sessionId, options, command) {
2167
2172
  const runtime = getRuntimeOptions(command, options);
2168
2173
  const config = requireConfig(runtime);
2169
2174
  const query = new URLSearchParams();
2170
- if (options.afterSequence) query.set("after_sequence", options.afterSequence);
2171
- if (options.beforeSequence) query.set("before_sequence", options.beforeSequence);
2175
+ if (afterSequence) query.set("after_sequence", afterSequence);
2176
+ if (beforeSequence) query.set("before_sequence", beforeSequence);
2172
2177
  if (options.promptId) query.set("prompt_id", options.promptId);
2173
2178
  if (options.limit) query.set("limit", options.limit);
2174
2179
  const payload = await apiFetch(config, `/api/sessions/${sessionId}/events/history${query.size ? `?${query.toString()}` : ""}`);
@@ -2201,6 +2206,12 @@ async function sessionEventsCommand(sessionId, options, command) {
2201
2206
  }
2202
2207
  if (textOpen) process.stdout.write("\n");
2203
2208
  }
2209
+ function resolveSequenceOption(canonicalValue, aliasValue, canonicalFlag, aliasFlag) {
2210
+ if (canonicalValue !== void 0 && aliasValue !== void 0) {
2211
+ throw new CliError("user", `${aliasFlag} cannot be combined with ${canonicalFlag}.`);
2212
+ }
2213
+ return canonicalValue ?? aliasValue;
2214
+ }
2204
2215
  async function usageCommand(sessionId, options, command) {
2205
2216
  const runtime = getRuntimeOptions(command, options);
2206
2217
  const config = requireConfig(runtime);
@@ -2531,11 +2542,13 @@ Examples:
2531
2542
  arcanist sessions search "mcp debugging" --tag codex --json
2532
2543
  `
2533
2544
  ).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(
2545
+ 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
2546
  "after",
2536
2547
  `
2537
2548
  Examples:
2538
2549
  arcanist sessions events <session-id> --json
2550
+ arcanist sessions events <session-id> --after-sequence 540 --limit 250 --json
2551
+ arcanist sessions events <session-id> --after 540 --limit 250 --json
2539
2552
  arcanist sessions events <session-id> --follow --json
2540
2553
  `
2541
2554
  ).action((sessionId, options, command) => sessionEventsCommand(sessionId, options, command));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tryarcanist/cli",
3
- "version": "0.1.82",
3
+ "version": "0.1.84",
4
4
  "description": "CLI for Arcanist — create and manage coding agent sessions",
5
5
  "type": "module",
6
6
  "bin": {