@tryarcanist/cli 0.1.237 → 0.1.239

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 +14 -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,13 @@ 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
+ var AGENT_RUNTIME_BACKEND_NAMES = {
8268
+ [CODEX_AGENT_RUNTIME_BACKEND]: "Codex"
8269
+ };
8270
+
8279
8271
  // ../../shared/utils/type-guards.ts
8280
8272
  function isRecord(value) {
8281
8273
  return !!value && typeof value === "object" && !Array.isArray(value);
@@ -8303,13 +8295,6 @@ var OpenAIModel = {
8303
8295
  GPT52ChatLatest: "gpt-5.2-chat-latest",
8304
8296
  GPT52Codex: "gpt-5.2-codex"
8305
8297
  };
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
8298
  var MODEL_PROVIDERS_SET = /* @__PURE__ */ new Set(["openai", "anthropic"]);
8314
8299
  var BACKEND_DESKTOP_IMAGE_FEEDBACK_CONFIGS = {
8315
8300
  [CODEX_AGENT_RUNTIME_BACKEND]: {
@@ -8317,12 +8302,6 @@ var BACKEND_DESKTOP_IMAGE_FEEDBACK_CONFIGS = {
8317
8302
  fixture: "known_image_fixture",
8318
8303
  deliveryPath: "synthetic_image_context",
8319
8304
  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
8305
  }
8327
8306
  };
8328
8307
  var MODEL_REGISTRY = [
@@ -8540,85 +8519,6 @@ var MODEL_REGISTRY = [
8540
8519
  contextWindow: 4e5,
8541
8520
  reasoning: { efforts: ["low", "medium", "high", "xhigh"], default: "high" },
8542
8521
  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
8522
  }
8623
8523
  ];
8624
8524
  var MODEL_PROVIDER_NAMES = {
@@ -8658,10 +8558,7 @@ var DEFAULT_SESSION_START_MODEL_ID_BY_BACKEND = buildDefaultSessionStartModelIdB
8658
8558
  var DEFAULT_SESSION_START_MODEL_ID = DEFAULT_SESSION_START_MODEL_ID_BY_BACKEND[CODEX_AGENT_RUNTIME_BACKEND];
8659
8559
  var VALID_MODEL_IDS = new Set(MODEL_REGISTRY.map((model) => model.id));
8660
8560
  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
- )
8561
+ [CODEX_AGENT_RUNTIME_BACKEND]: new Set(SESSION_START_MODEL_IDS_BY_BACKEND[CODEX_AGENT_RUNTIME_BACKEND])
8665
8562
  };
8666
8563
  var MODEL_CONTEXT_WINDOWS = {
8667
8564
  ...Object.fromEntries(
@@ -8713,18 +8610,12 @@ function extractModelId(raw) {
8713
8610
  if (!value) return void 0;
8714
8611
  return splitModelIdentifier(value)?.modelID;
8715
8612
  }
8716
- function getAgentRuntimeBackendForModel(modelId) {
8717
- return getBackendsForModel(modelId)?.[0];
8718
- }
8719
8613
  function getSessionStartModelIdsForBackend(backend) {
8720
8614
  return SESSION_START_MODEL_IDS_BY_BACKEND[backend];
8721
8615
  }
8722
8616
  function isSessionStartModelAllowedForBackend(modelId, backend) {
8723
8617
  return VALID_SESSION_START_MODEL_IDS_BY_BACKEND[backend].has(modelId);
8724
8618
  }
8725
- function getBackendsForModel(modelId) {
8726
- return MODEL_DEFINITIONS_BY_ID[modelId]?.backends;
8727
- }
8728
8619
  function getProviderForModel(modelId) {
8729
8620
  return MODEL_PROVIDERS[modelId] ?? "openai";
8730
8621
  }
@@ -8791,26 +8682,9 @@ var CODEX_SUBSCRIPTION_SESSION_START_MODEL_PROVIDER_GROUPS = buildModelProviderG
8791
8682
  );
8792
8683
 
8793
8684
  // 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
8685
  function resolveModelAndBackend(options) {
8800
8686
  let agentRuntimeBackend = CODEX_AGENT_RUNTIME_BACKEND;
8801
8687
  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
8688
  if (options.model !== void 0) {
8815
8689
  if (normalizedModel === void 0 || !isSessionStartModelAllowedForBackend(normalizedModel, agentRuntimeBackend)) {
8816
8690
  const allowed = getSessionStartModelIdsForBackend(agentRuntimeBackend).join(", ");
@@ -11012,7 +10886,7 @@ async function createCommand(repoUrl, promptArg, options, command) {
11012
10886
  const runtime = getRuntimeOptions(command, options);
11013
10887
  assertArcanistSessionMutationAllowed("create");
11014
10888
  const config = requireConfig(runtime);
11015
- const { agentRuntimeBackend } = resolveModelAndBackend(options);
10889
+ resolveModelAndBackend(options);
11016
10890
  const prompt = options.onboarding ? ONBOARDING_PROMPT : await resolvePromptInput(promptArg, options);
11017
10891
  const waitPollIntervalMs = options.wait ? parsePollInterval(options.pollInterval) : null;
11018
10892
  const repoError = validateRepoUrl(repoUrl);
@@ -11041,7 +10915,6 @@ async function createCommand(repoUrl, promptArg, options, command) {
11041
10915
  const promptIdempotencyKey = `${idempotencyKey}:prompt`;
11042
10916
  const body = { context: { repoUrl } };
11043
10917
  if (options.model) body.model = options.model;
11044
- if (options.backend) body.agentRuntimeBackend = agentRuntimeBackend;
11045
10918
  if (options.reasoningEffort) body.reasoningEffort = options.reasoningEffort;
11046
10919
  if (options.autoVerify) body.autoVerify = true;
11047
10920
  const promptPreview = buildSessionCreatePromptPreview(prompt);
@@ -11123,7 +10996,6 @@ async function createCommand(repoUrl, promptArg, options, command) {
11123
10996
  if (sessionData.sessionUrl) output.sessionUrl = sessionData.sessionUrl;
11124
10997
  output.repoUrl = repoUrl;
11125
10998
  if (options.model) output.model = options.model;
11126
- if (options.backend) output.agentRuntimeBackend = agentRuntimeBackend;
11127
10999
  if (options.reasoningEffort) output.reasoningEffort = options.reasoningEffort;
11128
11000
  if (options.autoVerify) output.autoVerify = true;
11129
11001
  if (baseBranch) output.baseBranch = baseBranch;
@@ -11438,7 +11310,7 @@ async function qaCommand(prUrl, options, command) {
11438
11310
  assertArcanistSessionMutationAllowed("qa");
11439
11311
  const config = requireConfig(runtime);
11440
11312
  const { targetPrUrl, repoUrl } = parseCanonicalPrUrl(prUrl);
11441
- const { agentRuntimeBackend } = resolveModelAndBackend(options);
11313
+ resolveModelAndBackend(options);
11442
11314
  const idempotencyKey = options.idempotencyKey ?? randomIdempotencyKey();
11443
11315
  const sessionIdempotencyKey = `${idempotencyKey}:session`;
11444
11316
  const promptIdempotencyKey = `${idempotencyKey}:prompt`;
@@ -11448,7 +11320,6 @@ async function qaCommand(prUrl, options, command) {
11448
11320
  targetPrUrl
11449
11321
  };
11450
11322
  if (options.model) body.model = options.model;
11451
- if (options.backend) body.agentRuntimeBackend = agentRuntimeBackend;
11452
11323
  if (options.reasoningEffort) body.reasoningEffort = options.reasoningEffort;
11453
11324
  let sessionData;
11454
11325
  try {
@@ -11503,7 +11374,6 @@ async function qaCommand(prUrl, options, command) {
11503
11374
  const output = { sessionId, repoUrl, targetPrUrl };
11504
11375
  if (sessionData.sessionUrl) output.sessionUrl = sessionData.sessionUrl;
11505
11376
  if (options.model) output.model = options.model;
11506
- if (options.backend) output.agentRuntimeBackend = agentRuntimeBackend;
11507
11377
  if (options.reasoningEffort) output.reasoningEffort = options.reasoningEffort;
11508
11378
  if (promptId) output.promptId = promptId;
11509
11379
  writeJson(output);
@@ -13101,7 +12971,7 @@ program.hook("preAction", (_thisCommand, actionCommand) => {
13101
12971
  applyColorEnvironment(getRuntimeOptions(actionCommand));
13102
12972
  });
13103
12973
  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(
12974
+ 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
12975
  "--start-branch <branch>",
13106
12976
  "Resume an existing branch with its history instead of forking a new one off base"
13107
12977
  ).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 +12994,7 @@ Examples:
13124
12994
  arcanist sessions create https://github.com/org/repo - --json | jq -r .sessionId | xargs -I{} arcanist sessions events {} --follow --json
13125
12995
 
13126
12996
  JSON:
13127
- JSON mode returns {sessionId, sessionUrl?, repoUrl, model?, agentRuntimeBackend?, reasoningEffort?, autoVerify?, baseBranch?, startBranch?, continuePrUrl?, continueMode?, onboarding?, promptId?}
12997
+ JSON mode returns {sessionId, sessionUrl?, repoUrl, model?, reasoningEffort?, autoVerify?, baseBranch?, startBranch?, continuePrUrl?, continueMode?, onboarding?, promptId?}
13128
12998
  --wait --json also includes best-effort result fields when available: prUrl?, publishedBranch?, lastBranch?
13129
12999
  Follow async progress with: arcanist sessions events <session-id> --follow --json
13130
13000
  `
@@ -13151,7 +13021,7 @@ JSON mode returns {sessionId, promptId?}
13151
13021
  );
13152
13022
  }
13153
13023
  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(
13024
+ 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
13025
  "--poll-interval <ms>",
13156
13026
  "Polling interval in milliseconds while waiting",
13157
13027
  String(DEFAULT_WATCH_POLL_INTERVAL_MS)
@@ -13164,7 +13034,7 @@ Examples:
13164
13034
  arcanist sessions qa https://github.com/org/repo/pull/123 --idempotency-key 1f0e6f1a-...
13165
13035
 
13166
13036
  JSON:
13167
- JSON mode returns {sessionId, sessionUrl?, repoUrl, targetPrUrl, model?, agentRuntimeBackend?, reasoningEffort?, promptId?}
13037
+ JSON mode returns {sessionId, sessionUrl?, repoUrl, targetPrUrl, model?, reasoningEffort?, promptId?}
13168
13038
  Inspect progress with the session URL or the session events stream.
13169
13039
  `
13170
13040
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tryarcanist/cli",
3
- "version": "0.1.237",
3
+ "version": "0.1.239",
4
4
  "description": "CLI for Arcanist — create and manage coding agent sessions",
5
5
  "type": "module",
6
6
  "bin": {