@tryarcanist/cli 0.1.186 → 0.1.187
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/dist/index.js +74 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -221,9 +221,9 @@ import { randomUUID } from "crypto";
|
|
|
221
221
|
import { createInterface } from "readline/promises";
|
|
222
222
|
|
|
223
223
|
// src/config.ts
|
|
224
|
-
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
|
|
224
|
+
import { existsSync, mkdirSync, readFileSync, statSync, writeFileSync } from "fs";
|
|
225
225
|
import { homedir } from "os";
|
|
226
|
-
import { dirname, join } from "path";
|
|
226
|
+
import { dirname, join, resolve } from "path";
|
|
227
227
|
var CONFIG_DIR = join(homedir(), ".arcanist");
|
|
228
228
|
var CONFIG_FILE = join(CONFIG_DIR, "config.json");
|
|
229
229
|
var PROJECT_CONFIG_FILE = ".arcanist-cli.json";
|
|
@@ -330,12 +330,34 @@ function validateAndNormalizeConfig(config) {
|
|
|
330
330
|
function findGitRoot(cwd) {
|
|
331
331
|
let current = cwd;
|
|
332
332
|
while (true) {
|
|
333
|
-
if (
|
|
333
|
+
if (hasGitMetadata(current)) return current;
|
|
334
334
|
const parent = dirname(current);
|
|
335
335
|
if (parent === current) return null;
|
|
336
336
|
current = parent;
|
|
337
337
|
}
|
|
338
338
|
}
|
|
339
|
+
function hasGitMetadata(repoPath2) {
|
|
340
|
+
const gitPath = join(repoPath2, ".git");
|
|
341
|
+
if (!existsSync(gitPath)) return false;
|
|
342
|
+
try {
|
|
343
|
+
const gitStat = statSync(gitPath);
|
|
344
|
+
if (gitStat.isDirectory()) {
|
|
345
|
+
return existsSync(join(gitPath, "HEAD")) && existsSync(join(gitPath, "config"));
|
|
346
|
+
}
|
|
347
|
+
if (!gitStat.isFile()) return false;
|
|
348
|
+
const gitDir = readGitDirPointer(gitPath);
|
|
349
|
+
if (!gitDir) return false;
|
|
350
|
+
return existsSync(join(resolve(repoPath2, gitDir), "HEAD"));
|
|
351
|
+
} catch {
|
|
352
|
+
return false;
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
function readGitDirPointer(gitFilePath) {
|
|
356
|
+
const gitDirLine = readFileSync(gitFilePath, "utf-8").split(/\r?\n/).find((line) => line.startsWith("gitdir:"));
|
|
357
|
+
if (!gitDirLine) return null;
|
|
358
|
+
const gitDir = gitDirLine.slice("gitdir:".length).trim();
|
|
359
|
+
return gitDir || null;
|
|
360
|
+
}
|
|
339
361
|
function parseProjectConfig(configPath) {
|
|
340
362
|
let parsed;
|
|
341
363
|
try {
|
|
@@ -434,7 +456,7 @@ async function readHiddenPrompt(prompt) {
|
|
|
434
456
|
if (!process.stdin.isTTY || !process.stdout.isTTY) {
|
|
435
457
|
throw new CliError("user", "No interactive terminal available. Re-run with --token-stdin or set ARCANIST_TOKEN.");
|
|
436
458
|
}
|
|
437
|
-
return new Promise((
|
|
459
|
+
return new Promise((resolve2, reject) => {
|
|
438
460
|
const stdin = process.stdin;
|
|
439
461
|
const inputChars = [];
|
|
440
462
|
let ansiCarry = "";
|
|
@@ -450,7 +472,7 @@ async function readHiddenPrompt(prompt) {
|
|
|
450
472
|
settled = true;
|
|
451
473
|
cleanup();
|
|
452
474
|
process.stdout.write("\n");
|
|
453
|
-
|
|
475
|
+
resolve2(inputChars.join(""));
|
|
454
476
|
};
|
|
455
477
|
const fail2 = (error) => {
|
|
456
478
|
if (settled) return;
|
|
@@ -605,6 +627,10 @@ function asNonEmptyString(value) {
|
|
|
605
627
|
|
|
606
628
|
// ../../shared/constants/models.ts
|
|
607
629
|
var OpenAIModel = {
|
|
630
|
+
GPT56: "gpt-5.6",
|
|
631
|
+
GPT56Sol: "gpt-5.6-sol",
|
|
632
|
+
GPT56Terra: "gpt-5.6-terra",
|
|
633
|
+
GPT56Luna: "gpt-5.6-luna",
|
|
608
634
|
GPT55: "gpt-5.5",
|
|
609
635
|
GPT54: "gpt-5.4",
|
|
610
636
|
GPT54Pro: "gpt-5.4-pro",
|
|
@@ -654,6 +680,48 @@ var MODEL_REGISTRY = [
|
|
|
654
680
|
},
|
|
655
681
|
sessionStart: { eligible: true, isDefault: true }
|
|
656
682
|
},
|
|
683
|
+
{
|
|
684
|
+
id: OpenAIModel.GPT56,
|
|
685
|
+
name: "GPT-5.6",
|
|
686
|
+
provider: "openai",
|
|
687
|
+
backends: [CODEX_AGENT_RUNTIME_BACKEND],
|
|
688
|
+
contextWindow: 105e4,
|
|
689
|
+
// Verified 2026-07-09 against OpenAI's GPT-5.6 migration guide and model
|
|
690
|
+
// catalog: the alias routes to gpt-5.6-sol and supports max effort.
|
|
691
|
+
reasoning: { efforts: ["none", "low", "medium", "high", "xhigh", "max"], default: "medium" },
|
|
692
|
+
costTracked: false,
|
|
693
|
+
sessionStart: { eligible: true }
|
|
694
|
+
},
|
|
695
|
+
{
|
|
696
|
+
id: OpenAIModel.GPT56Sol,
|
|
697
|
+
name: "GPT-5.6 Sol",
|
|
698
|
+
provider: "openai",
|
|
699
|
+
backends: [CODEX_AGENT_RUNTIME_BACKEND],
|
|
700
|
+
contextWindow: 105e4,
|
|
701
|
+
reasoning: { efforts: ["none", "low", "medium", "high", "xhigh", "max"], default: "medium" },
|
|
702
|
+
costTracked: false,
|
|
703
|
+
sessionStart: { eligible: true }
|
|
704
|
+
},
|
|
705
|
+
{
|
|
706
|
+
id: OpenAIModel.GPT56Terra,
|
|
707
|
+
name: "GPT-5.6 Terra",
|
|
708
|
+
provider: "openai",
|
|
709
|
+
backends: [CODEX_AGENT_RUNTIME_BACKEND],
|
|
710
|
+
contextWindow: 105e4,
|
|
711
|
+
reasoning: { efforts: ["none", "low", "medium", "high", "xhigh", "max"], default: "medium" },
|
|
712
|
+
costTracked: false,
|
|
713
|
+
sessionStart: { eligible: true }
|
|
714
|
+
},
|
|
715
|
+
{
|
|
716
|
+
id: OpenAIModel.GPT56Luna,
|
|
717
|
+
name: "GPT-5.6 Luna",
|
|
718
|
+
provider: "openai",
|
|
719
|
+
backends: [CODEX_AGENT_RUNTIME_BACKEND],
|
|
720
|
+
contextWindow: 105e4,
|
|
721
|
+
reasoning: { efforts: ["none", "low", "medium", "high", "xhigh", "max"], default: "medium" },
|
|
722
|
+
costTracked: false,
|
|
723
|
+
sessionStart: { eligible: true }
|
|
724
|
+
},
|
|
657
725
|
{
|
|
658
726
|
id: OpenAIModel.GPT55,
|
|
659
727
|
name: "GPT-5.5",
|
|
@@ -1180,7 +1248,7 @@ function formatTime(value) {
|
|
|
1180
1248
|
|
|
1181
1249
|
// ../../shared/utils/timing.ts
|
|
1182
1250
|
function sleep(ms) {
|
|
1183
|
-
return new Promise((
|
|
1251
|
+
return new Promise((resolve2) => setTimeout(resolve2, ms));
|
|
1184
1252
|
}
|
|
1185
1253
|
|
|
1186
1254
|
// ../../shared/session/phase.ts
|