@tryarcanist/cli 0.1.193 → 0.1.195
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 +49 -29
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1062,7 +1062,7 @@ var CODEX_SUBSCRIPTION_SESSION_START_MODEL_PROVIDER_GROUPS = buildModelProviderG
|
|
|
1062
1062
|
function parseGithubRepoFullName(value) {
|
|
1063
1063
|
const shorthand = value.match(/^([a-zA-Z0-9_.-]+)\/([a-zA-Z0-9_.-]+)$/);
|
|
1064
1064
|
if (shorthand) return { owner: shorthand[1], repo: shorthand[2] };
|
|
1065
|
-
const ssh = value.match(
|
|
1065
|
+
const ssh = value.match(/^git@github\.com:([^/]+)\/([^/]+?)(?:\.git)?$/);
|
|
1066
1066
|
if (ssh) return { owner: ssh[1], repo: ssh[2] };
|
|
1067
1067
|
const https = value.match(/^https?:\/\/github\.com\/([^/]+)\/([^/]+?)(?:\.git)?\/?$/);
|
|
1068
1068
|
if (https) return { owner: https[1], repo: https[2] };
|
|
@@ -1240,6 +1240,7 @@ function formatTime(value) {
|
|
|
1240
1240
|
|
|
1241
1241
|
// src/commands/codex.ts
|
|
1242
1242
|
import { spawn } from "child_process";
|
|
1243
|
+
import { rmSync } from "fs";
|
|
1243
1244
|
import { mkdtemp, readFile, rm } from "fs/promises";
|
|
1244
1245
|
import { tmpdir } from "os";
|
|
1245
1246
|
import { join as join2 } from "path";
|
|
@@ -1288,8 +1289,19 @@ async function setCodexSubscriptionEnabled(config, enabled) {
|
|
|
1288
1289
|
async function codexLoginCommand(options, command) {
|
|
1289
1290
|
const { config } = resolveBusinessContext(command, options);
|
|
1290
1291
|
const codexPath = resolveCodexPath(options.codexPath);
|
|
1291
|
-
|
|
1292
|
+
let codexHome;
|
|
1293
|
+
const handleSigint = () => {
|
|
1294
|
+
if (codexHome) {
|
|
1295
|
+
try {
|
|
1296
|
+
rmSync(codexHome, { recursive: true, force: true });
|
|
1297
|
+
} catch {
|
|
1298
|
+
}
|
|
1299
|
+
}
|
|
1300
|
+
process.exit(EXIT_CODE_INTERRUPTED);
|
|
1301
|
+
};
|
|
1302
|
+
process.on("SIGINT", handleSigint);
|
|
1292
1303
|
try {
|
|
1304
|
+
codexHome = await mkdtemp(join2(tmpdir(), "arcanist-codex-"));
|
|
1293
1305
|
await runCodexDeviceLogin(codexPath, codexHome);
|
|
1294
1306
|
let authJson;
|
|
1295
1307
|
try {
|
|
@@ -1325,8 +1337,14 @@ async function codexLoginCommand(options, command) {
|
|
|
1325
1337
|
}
|
|
1326
1338
|
});
|
|
1327
1339
|
} finally {
|
|
1328
|
-
|
|
1329
|
-
|
|
1340
|
+
try {
|
|
1341
|
+
if (codexHome) {
|
|
1342
|
+
await rm(codexHome, { recursive: true, force: true }).catch(() => {
|
|
1343
|
+
});
|
|
1344
|
+
}
|
|
1345
|
+
} finally {
|
|
1346
|
+
process.off("SIGINT", handleSigint);
|
|
1347
|
+
}
|
|
1330
1348
|
}
|
|
1331
1349
|
}
|
|
1332
1350
|
async function codexUseCommand(state, options, command) {
|
|
@@ -2582,8 +2600,8 @@ var ERROR_CODE_LABELS = {
|
|
|
2582
2600
|
output_length: "Output was too long",
|
|
2583
2601
|
context_overflow: "Context window exceeded",
|
|
2584
2602
|
aborted: "Stopped by user",
|
|
2585
|
-
rate_limit: "
|
|
2586
|
-
api_error: "
|
|
2603
|
+
rate_limit: "Rate limited - please retry shortly",
|
|
2604
|
+
api_error: "Model service error",
|
|
2587
2605
|
config_error: "Configuration error",
|
|
2588
2606
|
failed_edits: "Edit failure",
|
|
2589
2607
|
memory_enforcement_failed: "Memory enforcement failed",
|
|
@@ -2596,7 +2614,7 @@ var ERROR_CODE_LABELS = {
|
|
|
2596
2614
|
spawn_modal_error: "Sandbox spawn failed (legacy provider error)",
|
|
2597
2615
|
spawn_provider_error: "Sandbox spawn failed (provider API error)",
|
|
2598
2616
|
spawn_deadline_no_object: "Sandbox spawn timed out before provider responded",
|
|
2599
|
-
spawn_deadline_no_bridge: "Sandbox
|
|
2617
|
+
spawn_deadline_no_bridge: "Sandbox startup timed out before the runtime became reachable",
|
|
2600
2618
|
spawn_preconnect: "Sandbox failed before connecting",
|
|
2601
2619
|
sandbox_terminated: "Sandbox terminated",
|
|
2602
2620
|
sandbox_disconnected: "Sandbox disconnected",
|
|
@@ -2604,13 +2622,13 @@ var ERROR_CODE_LABELS = {
|
|
|
2604
2622
|
sandbox_never_started: "Sandbox never started the prompt",
|
|
2605
2623
|
session_archived: "Session archived while processing",
|
|
2606
2624
|
sandbox_callback: "Sandbox callback failed",
|
|
2607
|
-
codex_startup_timeout: "
|
|
2608
|
-
codex_api_readiness_timeout: "
|
|
2609
|
-
codex_session_create_timeout: "
|
|
2610
|
-
codex_prompt_dispatch_timeout: "
|
|
2611
|
-
codex_not_ready: "
|
|
2612
|
-
codex_transport_closed: "
|
|
2613
|
-
codex_unrecoverable: "
|
|
2625
|
+
codex_startup_timeout: "Agent runtime startup timed out",
|
|
2626
|
+
codex_api_readiness_timeout: "Agent runtime did not become ready",
|
|
2627
|
+
codex_session_create_timeout: "Agent runtime session could not be created",
|
|
2628
|
+
codex_prompt_dispatch_timeout: "Prompt could not be delivered to the agent runtime",
|
|
2629
|
+
codex_not_ready: "Agent runtime did not become ready",
|
|
2630
|
+
codex_transport_closed: "Agent runtime connection closed",
|
|
2631
|
+
codex_unrecoverable: "Agent runtime stopped unexpectedly",
|
|
2614
2632
|
question_delivery_failed: "Answer could not be delivered to the agent",
|
|
2615
2633
|
malformed_search_command: "Malformed search command blocked",
|
|
2616
2634
|
unknown: "Unknown failure"
|
|
@@ -2695,8 +2713,7 @@ ${event.answer ? `**Answer:** ${event.answer}
|
|
|
2695
2713
|
return `**Error:** ${formatSessionErrorMessage(event.error, event.code)}
|
|
2696
2714
|
`;
|
|
2697
2715
|
case "session_resumed_cold":
|
|
2698
|
-
return
|
|
2699
|
-
`;
|
|
2716
|
+
return "*[Environment was reset; in-environment state was lost]*\n";
|
|
2700
2717
|
case "customer_activity":
|
|
2701
2718
|
return `**${event.title}:** ${event.summary}
|
|
2702
2719
|
`;
|
|
@@ -3054,7 +3071,9 @@ function formatStatusLine(status) {
|
|
|
3054
3071
|
const substate = [];
|
|
3055
3072
|
if (status.sandboxSubstate && status.sandboxSubstate !== "none") substate.push(status.sandboxSubstate);
|
|
3056
3073
|
if (status.stopMode && status.stopMode !== "none") substate.push(status.stopMode);
|
|
3057
|
-
if (status.finalizingStep && status.finalizingStep !== "none")
|
|
3074
|
+
if (status.finalizingStep && status.finalizingStep !== "none") {
|
|
3075
|
+
substate.push(status.finalizingStep === "post_execution" ? "verification" : status.finalizingStep);
|
|
3076
|
+
}
|
|
3058
3077
|
const phaseLabel2 = substate.length > 0 ? `${label}/${substate.join("/")}` : label;
|
|
3059
3078
|
const details = [];
|
|
3060
3079
|
if (status.title) details.push(status.title);
|
|
@@ -3456,10 +3475,14 @@ function parseEgressAllowlistSourceFile(content, key = EGRESS_ALLOWLIST_SOURCE_P
|
|
|
3456
3475
|
|
|
3457
3476
|
// src/commands/egress.ts
|
|
3458
3477
|
function parseRepoArg(value) {
|
|
3459
|
-
const
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
|
|
3478
|
+
const parsed = parseGithubRepoFullName(value);
|
|
3479
|
+
if (!parsed) throw new CliError("user", "repo must be owner/name or a GitHub URL");
|
|
3480
|
+
return {
|
|
3481
|
+
...parsed,
|
|
3482
|
+
// Preserve the legacy shorthand contract while URLs and SSH remotes are
|
|
3483
|
+
// normalized by the shared parser itself.
|
|
3484
|
+
repo: /^[^/:]+\/[^/]+\.git$/.test(value.trim()) ? parsed.repo.slice(0, -4) : parsed.repo
|
|
3485
|
+
};
|
|
3463
3486
|
}
|
|
3464
3487
|
async function egressSourceSetCommand(sourceRepoArg, options = {}, command) {
|
|
3465
3488
|
const { config } = resolveBusinessContext(command, options);
|
|
@@ -3811,7 +3834,7 @@ function currentRepo() {
|
|
|
3811
3834
|
|
|
3812
3835
|
// src/commands/repos.ts
|
|
3813
3836
|
function parseRepoArg2(value) {
|
|
3814
|
-
if (
|
|
3837
|
+
if (value === void 0) return currentRepo();
|
|
3815
3838
|
const parsed = parseGithubRepoFullName(value);
|
|
3816
3839
|
if (!parsed) throw new CliError("user", "repo must be owner/name or a GitHub URL");
|
|
3817
3840
|
return { owner: parsed.owner, repo: parsed.repo };
|
|
@@ -5160,13 +5183,10 @@ function parseStopBlocked(err) {
|
|
|
5160
5183
|
|
|
5161
5184
|
// src/commands/test-creds.ts
|
|
5162
5185
|
import { readFileSync as readFileSync4 } from "fs";
|
|
5163
|
-
function parseRepoArg4(
|
|
5164
|
-
const
|
|
5165
|
-
|
|
5166
|
-
|
|
5167
|
-
throw new CliError("user", `repo must be in the form 'owner/name' (got: '${repo}')`);
|
|
5168
|
-
}
|
|
5169
|
-
return { owner: trimmed.slice(0, slashIndex), name: trimmed.slice(slashIndex + 1) };
|
|
5186
|
+
function parseRepoArg4(value) {
|
|
5187
|
+
const parsed = parseGithubRepoFullName(value);
|
|
5188
|
+
if (!parsed) throw new CliError("user", "repo must be owner/name or a GitHub URL");
|
|
5189
|
+
return { owner: parsed.owner, name: parsed.repo };
|
|
5170
5190
|
}
|
|
5171
5191
|
function basePath(businessId, repo) {
|
|
5172
5192
|
return `/api/businesses/${encodeURIComponent(businessId)}/repos/${encodeURIComponent(repo.owner)}/${encodeURIComponent(repo.name)}/test-credentials`;
|