@tryarcanist/cli 0.1.394 → 0.1.395

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 +3 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import { createRequire as __arcanistCreateRequire } from "node:module";
3
3
  const require = __arcanistCreateRequire(import.meta.url);
4
4
  var Eb=Object.defineProperty;var He=(e,t)=>{for(var r in t)Eb(e,r,{get:t[r],enumerable:!0})};import{Command as gP,Option as hP}from"commander";var em=["idle","running","review_starting","waiting_for_input","finalizing","review_listening","completed","superseded","needs_you","blocked","failed","stopped","archived"];var Zt=["completed","superseded","needs_you","blocked","failed","stopped","archived"],kb=new Set(Zt),IP=new Set(Zt.filter(e=>e!=="completed")),EP=new Set(Zt.filter(e=>e!=="stopped")),kP=Zt.filter(e=>e!=="archived"&&e!=="needs_you"&&e!=="blocked"&&e!=="stopped");function tm(e,t){return kb.has(e)}function nm(e){let t=e.createHelp().visibleGlobalOptions(e).map(im);return{...rm(e),...t.length>0?{globalOptions:t}:{}}}function rm(e){let t=Tb(e);return{path:za(e),description:e.description(),aliases:e.aliases(),arguments:e.registeredArguments.map(r=>({name:r.name(),description:r.description,required:r.required,variadic:r.variadic})),options:e.createHelp().visibleOptions(e).map(im),...t?{notes:t}:{},subcommands:e.commands.map(rm)}}function im(e){return{flags:e.flags,description:e.description,required:e.mandatory,...e.defaultValue===void 0?{}:{defaultValue:e.defaultValue}}}function za(e){let t=[];for(let r=e;r;r=r.parent)t.unshift(r.name());return t.join(" ")}function Tb(e){let t="";return e.emit("afterHelp",{error:!1,command:e,write:r=>t+=r}),t.trim()}import{existsSync as hS,mkdirSync as vS,writeFileSync as _S}from"node:fs";import{basename as yS,join as Em,resolve as bS}from"node:path";var Ab="en-US";function om(e,t){let r=new Intl.DateTimeFormat(Ab,{timeZone:t,month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",hour12:!0,timeZoneName:"short"}).formatToParts(e),o=n=>r.find(i=>i.type===n)?.value??"";return`${o("month")} ${o("day")}, ${o("year")}, ${o("hour")}:${o("minute")} ${o("dayPeriod")} ${o("timeZoneName")}`}function Ee(e,t=""){return(e instanceof Error?e.message:String(e))||t}function Qr(e){return new Promise(t=>setTimeout(t,e))}function am(e,t){return new Promise(r=>{let o=!1,n=()=>{o||(o=!0,clearTimeout(i),t?.removeEventListener("abort",n),r())},i=setTimeout(()=>{o=!0,t?.removeEventListener("abort",n),r()},e);if(t?.aborted){clearTimeout(i),o=!0,r();return}t?.addEventListener("abort",n)})}var Cb=.2,Ob=new Set([408,429,500,502,503,504]);function Nb(e){let{retry:t,baseMs:r,maxMs:o=Number.POSITIVE_INFINITY,jitter:n,random:i=Math.random}=e,a=n[0]+i()*(n[1]-n[0]);return Math.min(o,Math.max(0,Math.round(r*2**Math.max(0,t-1)*a)))}function Db(e,t){let r=t?.includeDefaults!==!1&&Ob.has(e)||t?.includeServerErrors===!0&&e>=500;return t?.remove?.includes(e)?!1:r||t?.add?.includes(e)===!0}var Ua=class extends Error{constructor(t="Provider retry aborted"){super(t),this.name="ProviderRetryAbortError"}};function zb(e){if(!(!e||typeof e!="object"||!("status"in e)))return typeof e.status=="number"?e.status:void 0}function Ub(e){if(!e||typeof e!="object"||!("headers"in e))return;let t=e.headers;if(!(!t||typeof t!="object"||!("get"in t)))return typeof t.get=="function"?t:void 0}function Lb(e){if(e instanceof TypeError||e instanceof Error&&e.name==="TimeoutError")return!0;let t=zb(e);return typeof t=="number"&&Db(t,{add:[409],includeServerErrors:!0})}function jb(e,t=Date.now()){let r=e.get("retry-after-ms");if(r){let a=Number(r);if(Number.isFinite(a)&&a>=0)return a}let o=e.get("retry-after");if(!o)return null;let n=Number(o);if(Number.isFinite(n))return n>=0?n*1e3:null;let i=Date.parse(o);return Number.isNaN(i)?null:Math.max(0,i-t)}function Mb(e){let t=Ub(e);return t?jb(t):null}function sm(e,t){if(!(!e||typeof e!="object"))try{Object.defineProperty(e,"__retryAttempts",{value:t,enumerable:!1,configurable:!0,writable:!0})}catch{}}function Zb(e,t){if(!t)return e;let r=AbortSignal.timeout(t);return e?AbortSignal.any([e,r]):r}async function um(e){if(!Number.isInteger(e.maxAttempts)||e.maxAttempts<1)throw new RangeError("maxAttempts must be at least 1");let t=e.sleep??am,r=e.random??Math.random,o=e.perAttemptTimeoutMs??6e5,n=e.isTransient??Lb,i=e.getRetryAfterMs??Mb,a=e.abortErrorFactory??(()=>new Ua),s=e.now??Date.now,u=e.jitterFactor??Cb,c=[1-u,1+u],l=0,d;for(;l<e.maxAttempts;){if(e.callerSignal?.aborted)throw a(l);if(e.deadlineMs!==void 0&&s()>=e.deadlineMs)throw d!==void 0?d:a(l);l+=1;let f=o>0&&e.deadlineMs!==void 0?Math.min(o,Math.max(1,e.deadlineMs-s())):o,m=Zb(e.callerSignal,f);try{return{value:await e.op(m??new AbortController().signal),attempts:l}}catch(g){if(e.callerSignal?.aborted)throw a(l,g);if(!n(g)||l>=e.maxAttempts)throw sm(g,l),g;let h=Math.max(i(g)??0,Nb({retry:l,baseMs:e.baseMs??250,jitter:c,random:r}));if(sm(g,l),d=g,e.deadlineMs!==void 0&&s()+h>=e.deadlineMs)throw g;try{e.onRetry?.({attempt:l+1,maxAttempts:e.maxAttempts,delayMs:h,error:g})}catch{}if(await t(h,e.callerSignal??new AbortController().signal),e.callerSignal?.aborted)throw a(l)}}throw new Error("Provider retry loop exited without a result")}function et(e){return e.replace(/\/+$/,"")}function cm(e){if(!e||typeof e!="object")return null;let t=e,r=typeof t.code=="string"&&t.code?t.code:null,o=typeof t.message=="string"&&t.message?t.message:null;if(typeof t.error=="string"&&t.error)return{code:r??t.error,message:o??t.error,raw:t.error};if(t.error&&typeof t.error=="object"){let n=t.error,i=typeof n.code=="string"&&n.code?n.code:r,a=typeof n.message=="string"&&n.message?n.message:o;return i||a?{code:i,message:a,raw:t.error}:null}return r||o?{code:r,message:o,raw:e}:null}function La(e){try{let t=JSON.parse(e);if(!t||typeof t!="object")return null;let r=t,o={...typeof r.repository=="string"?{repository:r.repository}:{},...typeof r.environmentsUrl=="string"?{environmentsUrl:r.environmentsUrl}:{},...typeof r.billingUrl=="string"?{billingUrl:r.billingUrl}:{}},n=cm(t);return n?typeof n.raw=="string"&&n.raw?{...n.code?{serverCode:n.code}:{},rawError:n.raw,...n.message?{message:n.message}:{},...o}:n.message||n.code?{...n.message?{message:n.message}:{},...n.code?{serverCode:n.code,rawError:n.code}:{},...o}:null:null}catch{return null}}var ke=130,ja=5,y=class extends Error{code;exitCode;hint;requestId;data;constructor(t,r,o={}){super(r),this.name="CliError",this.code=t,this.exitCode=o.exitCode??lm(t),this.hint=o.hint,this.requestId=o.requestId,this.data=o.data}},_t=class extends y{},ze=class extends y{status;body;constructor(t,r,o,n){let i=dm(t),a=La(r);super(i,Bb(t,r,a),{exitCode:Fb(t),hint:Vb(t,n,a),requestId:o,data:a?.serverCode||a?.repository||a?.environmentsUrl||a?.billingUrl?{...a.serverCode?{serverCode:a.serverCode}:{},...a.repository?{repository:a.repository}:{},...a.environmentsUrl?{environmentsUrl:a.environmentsUrl}:{},...a.billingUrl?{billingUrl:a.billingUrl}:{}}:void 0}),this.name="ApiError",this.status=t,this.body=r}};function lm(e){switch(e){case"auth":return 2;case"not_found":return 3;case"conflict":return 4;case"server":return 10;default:return 1}}function dm(e){return e===401||e===403?"auth":e===404?"not_found":e===409?"conflict":e>=500?"server":"user"}function Fb(e){return lm(dm(e))}function Bb(e,t,r=La(t)){return r?.message?r.message:r?.serverCode?r.serverCode:t?`API error ${e}: ${t}`:`API error ${e}`}function Vb(e,t,r){if(e===401)return"Run `arcanist auth login` or set `ARCANIST_TOKEN`.";if(e===403)return"This token is not allowed to do that. `arcanist auth whoami --json` shows its tokenScope and your businessRole: a change needs a write-scope token (mint one in Settings > CLI), and a workspace-wide change also needs the admin role.";if(e===404)return t==="repo"?"Check accessible repositories with `arcanist repos list`.":t==="session"?"List sessions with `arcanist sessions list`.":void 0;if(e===409&&r?.repository){if(r.serverCode==="environment_required")return`Run \`arcanist environments prepare ${r.repository} --wait\`, then retry the review.`;if(r.serverCode==="environment_preparing"||r.serverCode==="environment_needs_attention")return`Run \`arcanist environments status ${r.repository} --wait\` for the latest setup state.`}if(e===409)return"Check the current resource state and retry the command when it is ready.";if(e>=500)return"Retry later or check the control-plane logs."}var Gb="Run `arcanist help <command>` for usage, or `arcanist help --json` for the full command tree.";function qb(e){if(!("code"in e)||typeof e.code!="string"||!e.code.startsWith("commander."))return null;let[t="",r]=e.message.replace(/^error: /,"").split(`
5
- `);return new y("user",t,{hint:r?r.replace(/^\((.*)\)$/,"$1"):Gb})}function pm(e){if(e instanceof y)return e;if(e instanceof Error){let t=qb(e);if(t)return t}return e instanceof Error?new y("user",e.message):new y("user",String(e))}function ei(e){return JSON.stringify({error:{code:e.code,message:e.message,...e.hint?{hint:e.hint}:{},...e.requestId?{requestId:e.requestId}:{},...e.data?{data:e.data}:{}}})}var mm={name:"@tryarcanist/cli",version:"0.1.394",description:"Command-line interface for Arcanist: inspect sessions, prepare Arcanist environments, and trigger reviews",type:"module",bin:{arcanist:"dist/index.js"},engines:{node:">=22"},files:["dist/index.js"],scripts:{build:"tsup",typecheck:"node ../../node_modules/tsrs/bin/tsrs --noEmit",prepublishOnly:"npm --prefix ../.. run guard:cli-bundle"},publishConfig:{access:"public"},repository:{type:"git",url:"git+https://github.com/tryarcanist/arcanist.git",directory:"apps/cli"},homepage:"https://www.tryarcanist.com",license:"MIT",dependencies:{commander:"^12.1.0","playwright-core":"^1.61.1"},devDependencies:{tsup:"^8.0.0",typescript:"^5.9.3"}};var ti=`${mm.version}`;var Hb=`arcanist-cli/${ti}`,Kb=3e4,Jb=1e3,Yb=6e5,ni="ARCANIST_HTTP_TIMEOUT_MS";function Xb(e=process.env){let t=e[ni];if(!t)return Kb;if(!/^\d+$/.test(t))throw new y("user",`${ni} must be a positive integer between 1000 and 600000.`);let r=Number(t);if(r<Jb||r>Yb)throw new y("user",`${ni} must be between 1000 and 600000 milliseconds.`);return r}function Ma(e){return e instanceof DOMException&&e.name==="AbortError"}function Qb(e){let t=e instanceof Error?e.cause:null;return t&&typeof t=="object"&&"code"in t&&typeof t.code=="string"?t.code:null}function Za(e){return new _t("server",`Network timeout after ${e}ms.`,{hint:`Increase ${ni} for slow links, or check the API connection.`})}function eS(e){let t=Xb();if(!e)return{fetchInit:void 0,timeoutMs:t};let{timeoutMs:r,...o}=e;return r===void 0?{fetchInit:o,timeoutMs:t}:!Number.isFinite(r)||r<=0?{fetchInit:o,timeoutMs:1}:{fetchInit:o,timeoutMs:Math.max(1,Math.min(t,r))}}async function Fa(e,t,r,o){let{fetchInit:n,timeoutMs:i}=eS(r),a=new AbortController,s=setTimeout(()=>a.abort(),i);try{let u=new Headers(n?.headers);u.set("Content-Type","application/json"),u.set("User-Agent",Hb),e.token&&u.set("Authorization",`Bearer ${e.token}`);let c=await fetch(`${et(e.apiUrl)}${t}`,{...n,headers:u,signal:a.signal}).catch(l=>{throw Ma(l)?Za(i):new _t("server",`Network error: could not reach ${et(e.apiUrl)} (${Qb(l)??Ee(l)}).`,{hint:"Check the network and `ARCANIST_API_URL` or `--api-url`, then retry."})});if(!c.ok){let l=await c.text().catch(d=>{if(Ma(d))throw Za(i);return""});throw new ze(c.status,l,c.headers.get("x-request-id")??void 0,tS(t))}return await o(c)}catch(u){throw u instanceof y?u:Ma(u)?Za(i):u instanceof TypeError?new _t("server",`The API response could not be read: ${Ee(u)}`):new y("server",`The API response could not be read: ${Ee(u)}`)}finally{clearTimeout(s)}}function tS(e){if(e.startsWith("/api/repos"))return"repo";if(e.startsWith("/api/sessions"))return"session"}async function P(e,t,r){return Fa(e,t,r,o=>o.json())}async function fm(e,t,r){return Fa(e,t,r,o=>o.text())}async function gm(e,t,r){return Fa(e,t,r,async o=>new Uint8Array(await o.arrayBuffer()))}async function Un(e,t){let{value:r}=await um({op:()=>P(e,t),maxAttempts:3,perAttemptTimeoutMs:0,isTransient:o=>o instanceof _t,onRetry:({attempt:o,maxAttempts:n,delayMs:i})=>{process.stderr.write(`Retrying archive GET ${t} (${o}/${n}) in ${i}ms.
5
+ `);return new y("user",t,{hint:r?r.replace(/^\((.*)\)$/,"$1"):Gb})}function pm(e){if(e instanceof y)return e;if(e instanceof Error){let t=qb(e);if(t)return t}return e instanceof Error?new y("user",e.message):new y("user",String(e))}function ei(e){return JSON.stringify({error:{code:e.code,message:e.message,...e.hint?{hint:e.hint}:{},...e.requestId?{requestId:e.requestId}:{},...e.data?{data:e.data}:{}}})}var mm={name:"@tryarcanist/cli",version:"0.1.395",description:"Command-line interface for Arcanist: inspect sessions, prepare Arcanist environments, and trigger reviews",type:"module",bin:{arcanist:"dist/index.js"},engines:{node:">=22"},files:["dist/index.js"],scripts:{build:"tsup",typecheck:"node ../../node_modules/tsrs/bin/tsrs --noEmit",prepublishOnly:"npm --prefix ../.. run guard:cli-bundle"},publishConfig:{access:"public"},repository:{type:"git",url:"git+https://github.com/tryarcanist/arcanist.git",directory:"apps/cli"},homepage:"https://www.tryarcanist.com",license:"MIT",dependencies:{commander:"^12.1.0","playwright-core":"^1.61.1"},devDependencies:{tsup:"^8.0.0",typescript:"^5.9.3"}};var ti=`${mm.version}`;var Hb=`arcanist-cli/${ti}`,Kb=3e4,Jb=1e3,Yb=6e5,ni="ARCANIST_HTTP_TIMEOUT_MS";function Xb(e=process.env){let t=e[ni];if(!t)return Kb;if(!/^\d+$/.test(t))throw new y("user",`${ni} must be a positive integer between 1000 and 600000.`);let r=Number(t);if(r<Jb||r>Yb)throw new y("user",`${ni} must be between 1000 and 600000 milliseconds.`);return r}function Ma(e){return e instanceof DOMException&&e.name==="AbortError"}function Qb(e){let t=e instanceof Error?e.cause:null;return t&&typeof t=="object"&&"code"in t&&typeof t.code=="string"?t.code:null}function Za(e){return new _t("server",`Network timeout after ${e}ms.`,{hint:`Increase ${ni} for slow links, or check the API connection.`})}function eS(e){let t=Xb();if(!e)return{fetchInit:void 0,timeoutMs:t};let{timeoutMs:r,...o}=e;return r===void 0?{fetchInit:o,timeoutMs:t}:!Number.isFinite(r)||r<=0?{fetchInit:o,timeoutMs:1}:{fetchInit:o,timeoutMs:Math.max(1,Math.min(t,r))}}async function Fa(e,t,r,o){let{fetchInit:n,timeoutMs:i}=eS(r),a=new AbortController,s=setTimeout(()=>a.abort(),i);try{let u=new Headers(n?.headers);u.set("Content-Type","application/json"),u.set("User-Agent",Hb),e.token&&u.set("Authorization",`Bearer ${e.token}`);let c=await fetch(`${et(e.apiUrl)}${t}`,{...n,headers:u,signal:a.signal}).catch(l=>{throw Ma(l)?Za(i):new _t("server",`Network error: could not reach ${et(e.apiUrl)} (${Qb(l)??Ee(l)}).`,{hint:"Check the network and `ARCANIST_API_URL` or `--api-url`, then retry."})});if(!c.ok){let l=await c.text().catch(d=>{if(Ma(d))throw Za(i);return""});throw new ze(c.status,l,c.headers.get("x-request-id")??void 0,tS(t))}return await o(c)}catch(u){throw u instanceof y?u:Ma(u)?Za(i):u instanceof TypeError?new _t("server",`The API response could not be read: ${Ee(u)}`):new y("server",`The API response could not be read: ${Ee(u)}`)}finally{clearTimeout(s)}}function tS(e){if(e.startsWith("/api/repos"))return"repo";if(e.startsWith("/api/sessions"))return"session"}async function P(e,t,r){return Fa(e,t,r,o=>o.json())}async function fm(e,t,r){return Fa(e,t,r,o=>o.text())}async function gm(e,t,r){return Fa(e,t,r,async o=>new Uint8Array(await o.arrayBuffer()))}async function Un(e,t){let{value:r}=await um({op:()=>P(e,t),maxAttempts:3,perAttemptTimeoutMs:0,isTransient:o=>o instanceof _t,onRetry:({attempt:o,maxAttempts:n,delayMs:i})=>{process.stderr.write(`Retrying archive GET ${t} (${o}/${n}) in ${i}ms.
6
6
  `)}});return r}function A(e,t={}){return e.replace(/:([A-Za-z]+)/g,(r,o)=>{let n=t[o];if(n===void 0)throw new Error(`apiPath(${e}) is missing the ${o} parameter`);return encodeURIComponent(n)})}import{existsSync as Ln,mkdirSync as nS,readFileSync as Ba,statSync as rS,writeFileSync as iS}from"node:fs";import{homedir as oS}from"node:os";import{dirname as vm,join as yt,resolve as aS}from"node:path";var _m=yt(oS(),".arcanist"),ym=yt(_m,"config.json"),tt=".arcanist-cli.json",sS="https://app.tryarcanist.com";function bm(){try{return JSON.parse(Ba(ym,"utf-8"))}catch{return null}}function uS(e={}){let t=lS(e);if(t)return hm(t);let r=cS(),o=Va(e,r!==null),n=bm(),i=o?.apiUrl??r?.apiUrl??n?.apiUrl,a=o?.token??r?.token??n?.token;if(!i||!a)return null;let s=hm({apiUrl:i,token:a});return r&&!o&&!e.json&&process.stderr.write(`using ${tt} -> ${s.apiUrl}
7
7
  `),s}function Sm(e){let t=ri(e.apiUrl);if(t)throw new y("user",t);nS(_m,{recursive:!0,mode:448}),iS(ym,JSON.stringify({...e,apiUrl:et(e.apiUrl)},null,2)+`
8
8
  `,{mode:384})}function J(e){let t=uS(e);if(!t)throw new y("auth","Not logged in.",{hint:"Run `arcanist auth login` or set `ARCANIST_TOKEN`."});return t}function wm(e){let t=e??process.env.ARCANIST_API_URL??bm()?.apiUrl??sS,r=ri(t);if(r)throw new y("user",r);return et(t)}function cS(e=process.cwd()){let t=dS(e);if(!t)return null;let r=e;for(;;){let o=yt(r,tt);if(Ln(o))return fS(o);if(r===t)return null;let n=vm(r);if(n===r)return null;r=n}}function ri(e){let t;try{t=new URL(e)}catch{return"Invalid URL format"}return t.username||t.password?"API URL must not include embedded credentials. Use --token or ARCANIST_TOKEN to authenticate.":t.protocol!=="https:"&&!xm(t)?"API URL must use HTTPS for non-local hosts":null}function Va(e,t){let r=e.apiUrl??process.env.ARCANIST_API_URL,o=e.token??process.env.ARCANIST_TOKEN;if(!t)return!r&&!o?null:{apiUrl:r,token:o};if(r&&!o||!r&&o)throw new y("user",`${tt} is active; set both ARCANIST_API_URL and ARCANIST_TOKEN, pass both --api-url and --token, or set neither.`);return!r||!o?null:{apiUrl:r,token:o}}function lS(e){let t=e.apiUrl??process.env.ARCANIST_API_URL,r=e.token??process.env.ARCANIST_TOKEN;return!t||!r?null:{apiUrl:t,token:r}}function hm(e){let t=ri(e.apiUrl);if(t)throw new y("user",t);return{apiUrl:et(e.apiUrl),token:e.token}}function dS(e){let t=e;for(;;){if(pS(t))return t;let r=vm(t);if(r===t)return null;t=r}}function pS(e){let t=yt(e,".git");if(!Ln(t))return!1;try{let r=rS(t);if(r.isDirectory())return Ln(yt(t,"HEAD"))&&Ln(yt(t,"config"));if(!r.isFile())return!1;let o=mS(t);return o?Ln(yt(aS(e,o),"HEAD")):!1}catch{return!1}}function mS(e){let t=Ba(e,"utf-8").split(/\r?\n/).find(o=>o.startsWith("gitdir:"));return t&&t.slice(7).trim()||null}function fS(e){let t;try{t=JSON.parse(Ba(e,"utf-8"))}catch{throw new y("user",`${tt} is not valid JSON.`)}if(!t||typeof t!="object")throw new y("user",`${tt} must contain both apiUrl and token.`);let r=t;if(typeof r.apiUrl!="string"||typeof r.token!="string"||!r.apiUrl||!r.token)throw new y("user",`${tt} must contain both apiUrl and token.`);let o;try{o=new URL(r.apiUrl)}catch{throw new y("user",`${tt} apiUrl must be a valid URL.`)}if(!xm(o))throw new y("user",`${tt} apiUrl must be a loopback host.`);let n=ri(r.apiUrl);if(n)throw new y("user",n);return{apiUrl:et(r.apiUrl),token:r.token}}function xm(e){let t=e.hostname.replace(/^\[|\]$/g,"");return t==="localhost"||t==="127.0.0.1"||t==="::1"}function V(e,t={}){let o={...e?.optsWithGlobals?.(),...t};return{...o,noColor:o.noColor===!0||o.color===!1}}function Te(e,t={}){return V(e,t).json===!0}function Ue(e){process.stdout.write(`${JSON.stringify(e)}
@@ -172,10 +172,10 @@ written to your default ~/.codex.
172
172
  Examples:
173
173
  arcanist codex login
174
174
  arcanist codex login --codex-path /usr/local/bin/codex
175
- `).action((e,t)=>Bv(e,t));Qp.command("use <state>").description("Turn using your saved Codex subscription auth for OpenAI sessions on or off (state: on|off)").action((e,t,r)=>Vv(e,t,r));Qp.command("status").description("Show Codex subscription availability and whether auth is saved").action((e,t)=>Gv(e,t));var Nn=le.command("sessions").description("Session commands"),Dn=le.command("reviews").description("Read review results and manage QA recovery probes");Dn.command("recovery-probe").description("Arm, inspect, or clear finite faults on your disposable QA review").argument("<request-id>","Admitted QA review request ID").option("--fault <fault>","planner-receipt, scouts-receipt, generation-retries, or publication-effects").option("--clear","Remove the fault control after evidence capture").addHelpText("after",`
175
+ `).action((e,t)=>Bv(e,t));Qp.command("use <state>").description("Turn using your saved Codex subscription auth for OpenAI sessions on or off (state: on|off)").action((e,t,r)=>Vv(e,t,r));Qp.command("status").description("Show Codex subscription availability and whether auth is saved").action((e,t)=>Gv(e,t));var Nn=le.command("sessions").description("Session commands"),Dn=le.command("reviews").description("Read review results and manage QA recovery probes");Dn.command("recovery-probe").description("Arm, inspect, or clear finite faults on your disposable QA review").argument("<request-id>","Admitted QA review request ID").option("--fault <fault>","planner-receipt, scouts-receipt, generation-retries, generation-exhaustion, or publication-effects").option("--clear","Remove the fault control after evidence capture").addHelpText("after",`
176
176
  QA only. Requires your first active review of an open [TESTING] PR on a prod-qa branch in tryarcanist/arcanist.
177
177
  No fault flag reads receipts. Receipt faults fail once after a durable stage write.
178
- Generation and publication faults fail one more attempt than the existing retry limit, then stop.
178
+ Generation-retries fails one attempt fewer than the generation limit so the next attempt recovers; generation-exhaustion fails every attempt in the limit so the request blocks. Publication faults fail one more attempt than the existing retry limit, then stop.
179
179
  This command does not start a review, replace a sandbox, or prove recovery by itself.
180
180
  Save the receipts and verify the final request/head publication before --clear and fixture cleanup.
181
181
  `).action((e,t,r)=>fy(e,t,r));Dn.command("export-traces").description("Export production planner archives, question links, and checksums (internal)").requiredOption("--spans <file>","Archived span JSONL for the export window").option("--eval-dir <directory>","Optional private eval checkout for local holdout filtering; otherwise the consumer owns the split").requiredOption("--out <directory>","New output directory").action((e,t)=>wb(e,t));Dn.command("compare").description("Compare automatic QA Arcanist and Macroscope latency on the same trigger and head (Arcanist members only)").argument("<pr-url>","Internal GitHub PR URL").requiredOption("--head <sha>","Exact reviewed head SHA").action((e,t,r)=>ly(e,t,r));Dn.command("traces").description("List full planner trace parts or download observed events (Arcanist members only)").argument("<session-id>","Review session ID").argument("[trace-id]","Trace ID from fullTraceId metadata or the index").option("--out <file.jsonl>","Create a private JSONL file; fails if the file exists or the archive is incomplete").action((e,t,r,o)=>my(e,t,r,o));Dn.command("get").description("Read a PR request result and lifecycle snapshot without a new review").argument("<request-id>","PR review request ID, not a local review request ID").addHelpText("after",`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tryarcanist/cli",
3
- "version": "0.1.394",
3
+ "version": "0.1.395",
4
4
  "description": "Command-line interface for Arcanist: inspect sessions, prepare Arcanist environments, and trigger reviews",
5
5
  "type": "module",
6
6
  "bin": {