@tryarcanist/cli 0.1.238 → 0.1.240

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 +11 -144
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -7337,21 +7337,6 @@ var require_dist = __commonJS({
7337
7337
  import { createRequire as createRequire2 } from "module";
7338
7338
  import { Command } from "commander";
7339
7339
 
7340
- // ../../shared/agent/agent-runtime-backend.ts
7341
- var CODEX_AGENT_RUNTIME_BACKEND = "codex";
7342
- var CLAUDE_CODE_AGENT_RUNTIME_BACKEND = "claude_code";
7343
- var AGENT_RUNTIME_BACKENDS = [
7344
- CODEX_AGENT_RUNTIME_BACKEND,
7345
- CLAUDE_CODE_AGENT_RUNTIME_BACKEND
7346
- ];
7347
- var AGENT_RUNTIME_BACKEND_NAMES = {
7348
- [CODEX_AGENT_RUNTIME_BACKEND]: "Codex",
7349
- [CLAUDE_CODE_AGENT_RUNTIME_BACKEND]: "Claude Code"
7350
- };
7351
- function isAgentRuntimeBackend(value) {
7352
- return AGENT_RUNTIME_BACKENDS.includes(value);
7353
- }
7354
-
7355
7340
  // src/api.ts
7356
7341
  import { createRequire } from "module";
7357
7342
 
@@ -8276,6 +8261,10 @@ function parseRepoArgOrCurrent(value, argName = "repo") {
8276
8261
  return parseRepoArg(value, argName);
8277
8262
  }
8278
8263
 
8264
+ // ../../shared/agent/agent-runtime-backend.ts
8265
+ var CODEX_AGENT_RUNTIME_BACKEND = "codex";
8266
+ var AGENT_RUNTIME_BACKENDS = [CODEX_AGENT_RUNTIME_BACKEND];
8267
+
8279
8268
  // ../../shared/utils/type-guards.ts
8280
8269
  function isRecord(value) {
8281
8270
  return !!value && typeof value === "object" && !Array.isArray(value);
@@ -8303,13 +8292,6 @@ var OpenAIModel = {
8303
8292
  GPT52ChatLatest: "gpt-5.2-chat-latest",
8304
8293
  GPT52Codex: "gpt-5.2-codex"
8305
8294
  };
8306
- var AnthropicModel = {
8307
- Opus48: "claude-opus-4-8",
8308
- Opus5: "claude-opus-5",
8309
- Sonnet46: "claude-sonnet-4-6",
8310
- Sonnet5: "claude-sonnet-5",
8311
- Fable5: "claude-fable-5"
8312
- };
8313
8295
  var MODEL_PROVIDERS_SET = /* @__PURE__ */ new Set(["openai", "anthropic"]);
8314
8296
  var BACKEND_DESKTOP_IMAGE_FEEDBACK_CONFIGS = {
8315
8297
  [CODEX_AGENT_RUNTIME_BACKEND]: {
@@ -8317,12 +8299,6 @@ var BACKEND_DESKTOP_IMAGE_FEEDBACK_CONFIGS = {
8317
8299
  fixture: "known_image_fixture",
8318
8300
  deliveryPath: "synthetic_image_context",
8319
8301
  verifiedAt: "2026-07-07"
8320
- },
8321
- [CLAUDE_CODE_AGENT_RUNTIME_BACKEND]: {
8322
- backend: CLAUDE_CODE_AGENT_RUNTIME_BACKEND,
8323
- fixture: "known_image_fixture",
8324
- deliveryPath: "native_mcp_tool_result_image",
8325
- verifiedAt: "2026-07-07"
8326
8302
  }
8327
8303
  };
8328
8304
  var MODEL_REGISTRY = [
@@ -8540,85 +8516,6 @@ var MODEL_REGISTRY = [
8540
8516
  contextWindow: 4e5,
8541
8517
  reasoning: { efforts: ["low", "medium", "high", "xhigh"], default: "high" },
8542
8518
  pricing: { inputPerMillion: 1.75, outputPerMillion: 14, cacheReadPerMillion: 0.175 }
8543
- },
8544
- {
8545
- id: AnthropicModel.Opus48,
8546
- name: "Claude Opus 4.8",
8547
- provider: "anthropic",
8548
- backends: [CLAUDE_CODE_AGENT_RUNTIME_BACKEND],
8549
- contextWindow: 1e6,
8550
- // Verified 2026-06-29 against Claude Code model config docs and SDK
8551
- // EffortLevel: Opus 4.8 supports low/medium/high/xhigh/max. "none" maps to
8552
- // omitting SDK Options.effort so Claude keeps its adaptive default.
8553
- reasoning: { efforts: ["none", "low", "medium", "high", "xhigh", "max"], default: "high" },
8554
- // Bridge cost-ESTIMATE only; NOT authoritative for control-plane Anthropic
8555
- // billing. `anthropic/cost.ts` ANTHROPIC_MESSAGES_MODEL_PRICING owns that
8556
- // and is intentionally ~3x divergent until Phase 5.
8557
- pricing: { inputPerMillion: 5, outputPerMillion: 25, cacheReadPerMillion: 0.5, cacheWritePerMillion: 6.25 },
8558
- sessionStart: { eligible: true }
8559
- },
8560
- {
8561
- id: AnthropicModel.Opus5,
8562
- name: "Claude Opus 5",
8563
- provider: "anthropic",
8564
- backends: [CLAUDE_CODE_AGENT_RUNTIME_BACKEND],
8565
- contextWindow: 1e6,
8566
- // Verified 2026-07-26 against @anthropic-ai/claude-agent-sdk 0.3.219
8567
- // EffortLevel: Opus 5 supports low/medium/high/xhigh/max. "none" maps to
8568
- // omitting SDK Options.effort so Claude keeps its adaptive default.
8569
- reasoning: { efforts: ["none", "low", "medium", "high", "xhigh", "max"], default: "high" },
8570
- // Bridge cost estimate; authoritative Anthropic Messages pricing lives in
8571
- // apps/control-plane-worker/src/anthropic/cost.ts, where Opus 5 carries the
8572
- // same rates as Opus 4.8, so this default move has no modeled cost delta.
8573
- pricing: { inputPerMillion: 5, outputPerMillion: 25, cacheReadPerMillion: 0.5, cacheWritePerMillion: 6.25 },
8574
- sessionStart: { eligible: true, isDefault: true }
8575
- },
8576
- {
8577
- id: AnthropicModel.Sonnet46,
8578
- name: "Claude Sonnet 4.6",
8579
- provider: "anthropic",
8580
- backends: [CLAUDE_CODE_AGENT_RUNTIME_BACKEND],
8581
- contextWindow: 1e6,
8582
- // Claude Code model config docs: Sonnet 4.6 supports low/medium/high/max;
8583
- // xhigh falls back to high upstream, so keep it invalid in Arcanist.
8584
- reasoning: { efforts: ["none", "low", "medium", "high", "max"], default: "high" },
8585
- // Bridge cost-ESTIMATE only; NOT authoritative for control-plane Anthropic
8586
- // billing. `anthropic/cost.ts` ANTHROPIC_MESSAGES_MODEL_PRICING owns that
8587
- // and is intentionally ~3x divergent until Phase 5.
8588
- pricing: { inputPerMillion: 3, outputPerMillion: 15, cacheReadPerMillion: 0.3, cacheWritePerMillion: 3.75 },
8589
- sessionStart: { eligible: true }
8590
- },
8591
- {
8592
- id: AnthropicModel.Sonnet5,
8593
- name: "Claude Sonnet 5",
8594
- provider: "anthropic",
8595
- backends: [CLAUDE_CODE_AGENT_RUNTIME_BACKEND],
8596
- contextWindow: 1e6,
8597
- // Verified 2026-07-12 against Anthropic's Sonnet 5 launch documentation:
8598
- // adaptive thinking supports low/medium/high/xhigh/max; "none" omits the
8599
- // SDK effort option and lets Claude use its adaptive default.
8600
- reasoning: { efforts: ["none", "low", "medium", "high", "xhigh", "max"], default: "high" },
8601
- // Bridge cost-estimate only; authoritative Anthropic Messages pricing lives
8602
- // in apps/control-plane-worker/src/anthropic/cost.ts.
8603
- pricing: { inputPerMillion: 3, outputPerMillion: 15, cacheReadPerMillion: 0.3, cacheWritePerMillion: 3.75 },
8604
- sessionStart: { eligible: true }
8605
- },
8606
- {
8607
- id: AnthropicModel.Fable5,
8608
- name: "Claude Fable 5",
8609
- provider: "anthropic",
8610
- backends: [CLAUDE_CODE_AGENT_RUNTIME_BACKEND],
8611
- contextWindow: 1e6,
8612
- // Fable's adaptive thinking means "none" would safely omit SDK
8613
- // Options.effort, as with Opus/Sonnet. We intentionally require an explicit
8614
- // effort for this higher-cost model and default to the existing Claude
8615
- // Code high effort.
8616
- reasoning: { efforts: ["low", "medium", "high", "xhigh", "max"], default: "high" },
8617
- // Bridge cost-ESTIMATE only; NOT authoritative for control-plane Anthropic
8618
- // billing. `anthropic/cost.ts` ANTHROPIC_MESSAGES_MODEL_PRICING owns that
8619
- // verified Messages API table.
8620
- pricing: { inputPerMillion: 10, outputPerMillion: 50, cacheReadPerMillion: 1, cacheWritePerMillion: 12.5 },
8621
- sessionStart: { eligible: true }
8622
8519
  }
8623
8520
  ];
8624
8521
  var MODEL_PROVIDER_NAMES = {
@@ -8658,10 +8555,7 @@ var DEFAULT_SESSION_START_MODEL_ID_BY_BACKEND = buildDefaultSessionStartModelIdB
8658
8555
  var DEFAULT_SESSION_START_MODEL_ID = DEFAULT_SESSION_START_MODEL_ID_BY_BACKEND[CODEX_AGENT_RUNTIME_BACKEND];
8659
8556
  var VALID_MODEL_IDS = new Set(MODEL_REGISTRY.map((model) => model.id));
8660
8557
  var VALID_SESSION_START_MODEL_IDS_BY_BACKEND = {
8661
- [CODEX_AGENT_RUNTIME_BACKEND]: new Set(SESSION_START_MODEL_IDS_BY_BACKEND[CODEX_AGENT_RUNTIME_BACKEND]),
8662
- [CLAUDE_CODE_AGENT_RUNTIME_BACKEND]: new Set(
8663
- SESSION_START_MODEL_IDS_BY_BACKEND[CLAUDE_CODE_AGENT_RUNTIME_BACKEND]
8664
- )
8558
+ [CODEX_AGENT_RUNTIME_BACKEND]: new Set(SESSION_START_MODEL_IDS_BY_BACKEND[CODEX_AGENT_RUNTIME_BACKEND])
8665
8559
  };
8666
8560
  var MODEL_CONTEXT_WINDOWS = {
8667
8561
  ...Object.fromEntries(
@@ -8713,18 +8607,12 @@ function extractModelId(raw) {
8713
8607
  if (!value) return void 0;
8714
8608
  return splitModelIdentifier(value)?.modelID;
8715
8609
  }
8716
- function getAgentRuntimeBackendForModel(modelId) {
8717
- return getBackendsForModel(modelId)?.[0];
8718
- }
8719
8610
  function getSessionStartModelIdsForBackend(backend) {
8720
8611
  return SESSION_START_MODEL_IDS_BY_BACKEND[backend];
8721
8612
  }
8722
8613
  function isSessionStartModelAllowedForBackend(modelId, backend) {
8723
8614
  return VALID_SESSION_START_MODEL_IDS_BY_BACKEND[backend].has(modelId);
8724
8615
  }
8725
- function getBackendsForModel(modelId) {
8726
- return MODEL_DEFINITIONS_BY_ID[modelId]?.backends;
8727
- }
8728
8616
  function getProviderForModel(modelId) {
8729
8617
  return MODEL_PROVIDERS[modelId] ?? "openai";
8730
8618
  }
@@ -8791,26 +8679,9 @@ var CODEX_SUBSCRIPTION_SESSION_START_MODEL_PROVIDER_GROUPS = buildModelProviderG
8791
8679
  );
8792
8680
 
8793
8681
  // src/commands/model-options.ts
8794
- function backendForProviderPrefix(rawModel) {
8795
- const provider = rawModel.match(/^([a-z]+)[/:]/i)?.[1]?.toLowerCase();
8796
- if (provider === "anthropic") return CLAUDE_CODE_AGENT_RUNTIME_BACKEND;
8797
- return void 0;
8798
- }
8799
8682
  function resolveModelAndBackend(options) {
8800
8683
  let agentRuntimeBackend = CODEX_AGENT_RUNTIME_BACKEND;
8801
8684
  const normalizedModel = options.model !== void 0 ? extractModelId(options.model) : void 0;
8802
- if (options.backend !== void 0) {
8803
- if (!isAgentRuntimeBackend(options.backend)) {
8804
- throw new CliError(
8805
- "user",
8806
- `Invalid --backend '${options.backend}'. Expected ${AGENT_RUNTIME_BACKENDS.join(", ")}.`
8807
- );
8808
- }
8809
- agentRuntimeBackend = options.backend;
8810
- } else if (options.model !== void 0) {
8811
- const derived = (normalizedModel ? getAgentRuntimeBackendForModel(normalizedModel) : void 0) ?? backendForProviderPrefix(options.model);
8812
- if (derived) agentRuntimeBackend = derived;
8813
- }
8814
8685
  if (options.model !== void 0) {
8815
8686
  if (normalizedModel === void 0 || !isSessionStartModelAllowedForBackend(normalizedModel, agentRuntimeBackend)) {
8816
8687
  const allowed = getSessionStartModelIdsForBackend(agentRuntimeBackend).join(", ");
@@ -11012,7 +10883,7 @@ async function createCommand(repoUrl, promptArg, options, command) {
11012
10883
  const runtime = getRuntimeOptions(command, options);
11013
10884
  assertArcanistSessionMutationAllowed("create");
11014
10885
  const config = requireConfig(runtime);
11015
- const { agentRuntimeBackend } = resolveModelAndBackend(options);
10886
+ resolveModelAndBackend(options);
11016
10887
  const prompt = options.onboarding ? ONBOARDING_PROMPT : await resolvePromptInput(promptArg, options);
11017
10888
  const waitPollIntervalMs = options.wait ? parsePollInterval(options.pollInterval) : null;
11018
10889
  const repoError = validateRepoUrl(repoUrl);
@@ -11041,7 +10912,6 @@ async function createCommand(repoUrl, promptArg, options, command) {
11041
10912
  const promptIdempotencyKey = `${idempotencyKey}:prompt`;
11042
10913
  const body = { context: { repoUrl } };
11043
10914
  if (options.model) body.model = options.model;
11044
- if (options.backend) body.agentRuntimeBackend = agentRuntimeBackend;
11045
10915
  if (options.reasoningEffort) body.reasoningEffort = options.reasoningEffort;
11046
10916
  if (options.autoVerify) body.autoVerify = true;
11047
10917
  const promptPreview = buildSessionCreatePromptPreview(prompt);
@@ -11123,7 +10993,6 @@ async function createCommand(repoUrl, promptArg, options, command) {
11123
10993
  if (sessionData.sessionUrl) output.sessionUrl = sessionData.sessionUrl;
11124
10994
  output.repoUrl = repoUrl;
11125
10995
  if (options.model) output.model = options.model;
11126
- if (options.backend) output.agentRuntimeBackend = agentRuntimeBackend;
11127
10996
  if (options.reasoningEffort) output.reasoningEffort = options.reasoningEffort;
11128
10997
  if (options.autoVerify) output.autoVerify = true;
11129
10998
  if (baseBranch) output.baseBranch = baseBranch;
@@ -11438,7 +11307,7 @@ async function qaCommand(prUrl, options, command) {
11438
11307
  assertArcanistSessionMutationAllowed("qa");
11439
11308
  const config = requireConfig(runtime);
11440
11309
  const { targetPrUrl, repoUrl } = parseCanonicalPrUrl(prUrl);
11441
- const { agentRuntimeBackend } = resolveModelAndBackend(options);
11310
+ resolveModelAndBackend(options);
11442
11311
  const idempotencyKey = options.idempotencyKey ?? randomIdempotencyKey();
11443
11312
  const sessionIdempotencyKey = `${idempotencyKey}:session`;
11444
11313
  const promptIdempotencyKey = `${idempotencyKey}:prompt`;
@@ -11448,7 +11317,6 @@ async function qaCommand(prUrl, options, command) {
11448
11317
  targetPrUrl
11449
11318
  };
11450
11319
  if (options.model) body.model = options.model;
11451
- if (options.backend) body.agentRuntimeBackend = agentRuntimeBackend;
11452
11320
  if (options.reasoningEffort) body.reasoningEffort = options.reasoningEffort;
11453
11321
  let sessionData;
11454
11322
  try {
@@ -11503,7 +11371,6 @@ async function qaCommand(prUrl, options, command) {
11503
11371
  const output = { sessionId, repoUrl, targetPrUrl };
11504
11372
  if (sessionData.sessionUrl) output.sessionUrl = sessionData.sessionUrl;
11505
11373
  if (options.model) output.model = options.model;
11506
- if (options.backend) output.agentRuntimeBackend = agentRuntimeBackend;
11507
11374
  if (options.reasoningEffort) output.reasoningEffort = options.reasoningEffort;
11508
11375
  if (promptId) output.promptId = promptId;
11509
11376
  writeJson(output);
@@ -13101,7 +12968,7 @@ program.hook("preAction", (_thisCommand, actionCommand) => {
13101
12968
  applyColorEnvironment(getRuntimeOptions(actionCommand));
13102
12969
  });
13103
12970
  function addCreateOptions(cmd) {
13104
- return cmd.argument("<repo-url>", "Repository URL").argument("[prompt]", "Prompt to send, or '-' to read stdin").option("--model <model>", "Model to use").option("--backend <backend>", `Agent runtime backend: ${AGENT_RUNTIME_BACKENDS.join(", ")} (default codex)`).option("--reasoning-effort <effort>", "Reasoning effort to use for models that support it").option("--auto-verify", "Opt this session into automatic QA verification after PR creation").option("--base-branch <branch>", "Base branch to create the session against (defaults to the repo default branch)").option(
12971
+ return cmd.argument("<repo-url>", "Repository URL").argument("[prompt]", "Prompt to send, or '-' to read stdin").option("--model <model>", "Model to use").option("--reasoning-effort <effort>", "Reasoning effort to use for models that support it").option("--auto-verify", "Opt this session into automatic QA verification after PR creation").option("--base-branch <branch>", "Base branch to create the session against (defaults to the repo default branch)").option(
13105
12972
  "--start-branch <branch>",
13106
12973
  "Resume an existing branch with its history instead of forking a new one off base"
13107
12974
  ).option("--linear-issue <id|url>", "Associate the session with a Linear issue for pickup writeback").option("--jira-issue <key|url>", "Associate the session with a Jira issue for pickup writeback").option("--continue-pr <url>", "Continue from an existing same-repo pull request").option("--continue-mode <mode>", "Continuation mode: auto (default), update-pr, or new-pr").option("--prompt-stdin", "Read prompt from stdin").option(
@@ -13124,7 +12991,7 @@ Examples:
13124
12991
  arcanist sessions create https://github.com/org/repo - --json | jq -r .sessionId | xargs -I{} arcanist sessions events {} --follow --json
13125
12992
 
13126
12993
  JSON:
13127
- JSON mode returns {sessionId, sessionUrl?, repoUrl, model?, agentRuntimeBackend?, reasoningEffort?, autoVerify?, baseBranch?, startBranch?, continuePrUrl?, continueMode?, onboarding?, promptId?}
12994
+ JSON mode returns {sessionId, sessionUrl?, repoUrl, model?, reasoningEffort?, autoVerify?, baseBranch?, startBranch?, continuePrUrl?, continueMode?, onboarding?, promptId?}
13128
12995
  --wait --json also includes best-effort result fields when available: prUrl?, publishedBranch?, lastBranch?
13129
12996
  Follow async progress with: arcanist sessions events <session-id> --follow --json
13130
12997
  `
@@ -13151,7 +13018,7 @@ JSON mode returns {sessionId, promptId?}
13151
13018
  );
13152
13019
  }
13153
13020
  function addQaOptions(cmd) {
13154
- return cmd.argument("<pr-url>", "GitHub pull request URL to QA").option("--model <model>", "Model to use").option("--backend <backend>", `Agent runtime backend: ${AGENT_RUNTIME_BACKENDS.join(", ")} (default codex)`).option("--reasoning-effort <effort>", "Reasoning effort to use for models that support it").option("--wait", "Wait for the QA prompt to finish and exit non-zero if it fails").option(
13021
+ return cmd.argument("<pr-url>", "GitHub pull request URL to QA").option("--model <model>", "Model to use").option("--reasoning-effort <effort>", "Reasoning effort to use for models that support it").option("--wait", "Wait for the QA prompt to finish and exit non-zero if it fails").option(
13155
13022
  "--poll-interval <ms>",
13156
13023
  "Polling interval in milliseconds while waiting",
13157
13024
  String(DEFAULT_WATCH_POLL_INTERVAL_MS)
@@ -13164,7 +13031,7 @@ Examples:
13164
13031
  arcanist sessions qa https://github.com/org/repo/pull/123 --idempotency-key 1f0e6f1a-...
13165
13032
 
13166
13033
  JSON:
13167
- JSON mode returns {sessionId, sessionUrl?, repoUrl, targetPrUrl, model?, agentRuntimeBackend?, reasoningEffort?, promptId?}
13034
+ JSON mode returns {sessionId, sessionUrl?, repoUrl, targetPrUrl, model?, reasoningEffort?, promptId?}
13168
13035
  Inspect progress with the session URL or the session events stream.
13169
13036
  `
13170
13037
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tryarcanist/cli",
3
- "version": "0.1.238",
3
+ "version": "0.1.240",
4
4
  "description": "CLI for Arcanist — create and manage coding agent sessions",
5
5
  "type": "module",
6
6
  "bin": {