@tryarcanist/cli 0.1.171 → 0.1.173

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/README.md CHANGED
@@ -218,9 +218,13 @@ arcanist sessions send abc123 "also update the tests"
218
218
  arcanist sessions send abc123 "use this failure log" --uploaded-file failure.log
219
219
  printf "summarize current status" | arcanist sessions send abc123 --prompt-stdin --json
220
220
  arcanist sessions send abc123 "retry-safe send" --idempotency-key 1f0e6f1a-...
221
+ arcanist sessions send abc123 "also update the tests" --wait --poll-interval 1000 --json
221
222
  ```
222
223
 
224
+ Repeatable `--uploaded-file <path>` flags attach local UTF-8 text files to the follow-up prompt. `--idempotency-key <uuid>` is for manually retrying a send that may have reached the server. `--wait` blocks until the sent prompt finishes; use `--poll-interval <ms>` to tune completion polling.
225
+
223
226
  JSON mode returns `{sessionId, promptId?}`.
227
+ With `--wait`, JSON mode also includes best-effort result fields when available: `prUrl?`, `publishedBranch?`, `lastBranch?`.
224
228
 
225
229
  ### `arcanist sessions stop <session-id>`
226
230
 
package/dist/index.js CHANGED
@@ -3324,6 +3324,9 @@ async function loginCommand(options, command) {
3324
3324
  }
3325
3325
 
3326
3326
  // src/commands/message.ts
3327
+ function unwrapSessionState2(payload) {
3328
+ return payload.session && typeof payload.session === "object" ? payload.session : payload;
3329
+ }
3327
3330
  async function messageCommand(sessionId, promptArg, options = {}, command) {
3328
3331
  const runtime = getRuntimeOptions(command, options);
3329
3332
  assertArcanistSessionMutationAllowed("send");
@@ -3340,10 +3343,31 @@ async function messageCommand(sessionId, promptArg, options = {}, command) {
3340
3343
  }
3341
3344
  );
3342
3345
  const promptId = response.prompt?.promptId ?? response.prompt?.id;
3346
+ if (options.wait) {
3347
+ const pollIntervalMs = parsePollInterval(options.pollInterval);
3348
+ await waitForCreatedPrompt(sessionId, promptId, void 0, pollIntervalMs, runtime, command);
3349
+ if (isJson(command, options)) {
3350
+ let resultFields = {};
3351
+ try {
3352
+ resultFields = await fetchSettledSessionResultFields(config, sessionId, pollIntervalMs);
3353
+ } catch {
3354
+ resultFields = {};
3355
+ }
3356
+ writeJson({ sessionId, ...promptId ? { promptId } : {}, ...resultFields });
3357
+ return;
3358
+ }
3359
+ try {
3360
+ const sessionPayload = await apiFetch(config, `/api/sessions/${sessionId}`);
3361
+ const resultLine = formatSessionResult(unwrapSessionState2(sessionPayload));
3362
+ if (resultLine) console.log(resultLine);
3363
+ } catch {
3364
+ }
3365
+ }
3343
3366
  if (isJson(command, options)) {
3344
3367
  writeJson({ sessionId, ...promptId ? { promptId } : {} });
3345
3368
  return;
3346
3369
  }
3370
+ if (options.wait) return;
3347
3371
  console.log(`Message sent to session ${sessionId}.`);
3348
3372
  }
3349
3373
 
@@ -4923,16 +4947,18 @@ function addSendOptions(cmd) {
4923
4947
  "--uploaded-file <path>",
4924
4948
  "Attach a local text file to the prompt as uploadedFiles; repeat for multiple files",
4925
4949
  collectUploadedFileOption
4926
- ).option("--idempotency-key <uuid>", "Request idempotency key for safe manual retries").addHelpText(
4950
+ ).option("--idempotency-key <uuid>", "Request idempotency key for safe manual retries").option("--wait", "Wait for the sent prompt to finish").option("--poll-interval <ms>", "Polling interval in milliseconds").addHelpText(
4927
4951
  "after",
4928
4952
  `
4929
4953
  Examples:
4930
4954
  arcanist sessions send <session-id> "also update tests"
4931
4955
  arcanist sessions send <session-id> "use this log" --uploaded-file failing.log
4932
4956
  printf "also update tests" | arcanist sessions send <session-id> --prompt-stdin --json
4957
+ arcanist sessions send <session-id> "also update tests" --wait --json
4933
4958
 
4934
4959
  JSON:
4935
4960
  JSON mode returns {sessionId, promptId?}
4961
+ --wait --json also includes best-effort result fields when available: prUrl?, publishedBranch?, lastBranch?
4936
4962
  `
4937
4963
  );
4938
4964
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tryarcanist/cli",
3
- "version": "0.1.171",
3
+ "version": "0.1.173",
4
4
  "description": "CLI for Arcanist — create and manage coding agent sessions",
5
5
  "type": "module",
6
6
  "bin": {