@f-o-h/cli 0.1.40 → 0.1.41
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/foh.js +38 -8
- package/package.json +1 -1
package/dist/foh.js
CHANGED
|
@@ -32801,7 +32801,7 @@ var StdioServerTransport = class {
|
|
|
32801
32801
|
};
|
|
32802
32802
|
|
|
32803
32803
|
// src/lib/cli-version.ts
|
|
32804
|
-
var CLI_VERSION = "0.1.
|
|
32804
|
+
var CLI_VERSION = "0.1.41";
|
|
32805
32805
|
|
|
32806
32806
|
// src/commands/mcp-serve.ts
|
|
32807
32807
|
var DEFAULT_TIMEOUT_MS = 12e4;
|
|
@@ -39054,7 +39054,13 @@ function resolveCodexExecutionCommand() {
|
|
|
39054
39054
|
}
|
|
39055
39055
|
function validateCodexRunner(options) {
|
|
39056
39056
|
if (options.skipRunnerProbe) {
|
|
39057
|
-
return {
|
|
39057
|
+
return {
|
|
39058
|
+
binaryChecked: false,
|
|
39059
|
+
requiredFlagsChecked: false,
|
|
39060
|
+
automationMode: "ask-for-approval-never",
|
|
39061
|
+
globalArgs: ["--ask-for-approval", "never"],
|
|
39062
|
+
execArgs: []
|
|
39063
|
+
};
|
|
39058
39064
|
}
|
|
39059
39065
|
const probe = options.runnerProbe ?? defaultRunnerProbe;
|
|
39060
39066
|
const probeCommand = resolveCodexProbeCommand();
|
|
@@ -39066,26 +39072,48 @@ function validateCodexRunner(options) {
|
|
|
39066
39072
|
if (help.error || help.status !== 0) {
|
|
39067
39073
|
throw new ExternalAgentExecutorError("external_agent_runner_help_unavailable", "Codex runner probe failed: `codex exec --help` did not exit 0.");
|
|
39068
39074
|
}
|
|
39069
|
-
const
|
|
39075
|
+
const execHelpText = `${help.stdout}
|
|
39070
39076
|
${help.stderr}`;
|
|
39071
|
-
const
|
|
39077
|
+
const rootHelp = probe(probeCommand, ["--help"]);
|
|
39078
|
+
const rootHelpText = `${rootHelp.stdout}
|
|
39079
|
+
${rootHelp.stderr}`;
|
|
39080
|
+
const commonExecFlags = [
|
|
39072
39081
|
"--cd",
|
|
39073
39082
|
"--skip-git-repo-check",
|
|
39074
39083
|
"--ephemeral",
|
|
39075
39084
|
"--ignore-rules",
|
|
39076
39085
|
"--sandbox",
|
|
39077
|
-
"--full-auto",
|
|
39078
39086
|
"--json",
|
|
39079
39087
|
"--output-last-message"
|
|
39080
39088
|
];
|
|
39081
|
-
const missing =
|
|
39089
|
+
const missing = commonExecFlags.filter((flag) => !execHelpText.includes(flag));
|
|
39090
|
+
const supportsLegacyFullAuto = execHelpText.includes("--full-auto");
|
|
39091
|
+
const supportsModernApprovalMode = rootHelp.status === 0 && rootHelpText.includes("--ask-for-approval");
|
|
39092
|
+
if (!supportsLegacyFullAuto && !supportsModernApprovalMode) {
|
|
39093
|
+
missing.push("--full-auto or --ask-for-approval");
|
|
39094
|
+
}
|
|
39082
39095
|
if (missing.length > 0) {
|
|
39083
39096
|
throw new ExternalAgentExecutorError(
|
|
39084
39097
|
"external_agent_runner_required_flags_missing",
|
|
39085
39098
|
`Codex runner is missing required exec flag(s): ${missing.join(", ")}`
|
|
39086
39099
|
);
|
|
39087
39100
|
}
|
|
39088
|
-
|
|
39101
|
+
if (supportsModernApprovalMode) {
|
|
39102
|
+
return {
|
|
39103
|
+
binaryChecked: true,
|
|
39104
|
+
requiredFlagsChecked: true,
|
|
39105
|
+
automationMode: "ask-for-approval-never",
|
|
39106
|
+
globalArgs: ["--ask-for-approval", "never"],
|
|
39107
|
+
execArgs: []
|
|
39108
|
+
};
|
|
39109
|
+
}
|
|
39110
|
+
return {
|
|
39111
|
+
binaryChecked: true,
|
|
39112
|
+
requiredFlagsChecked: true,
|
|
39113
|
+
automationMode: "full-auto",
|
|
39114
|
+
globalArgs: [],
|
|
39115
|
+
execArgs: ["--full-auto"]
|
|
39116
|
+
};
|
|
39089
39117
|
}
|
|
39090
39118
|
function normalizeCodexSandboxBackend(value) {
|
|
39091
39119
|
const normalized = (value || "default").trim().toLowerCase();
|
|
@@ -39175,6 +39203,7 @@ function createExternalAgentExecutorPlan(options) {
|
|
|
39175
39203
|
const runPath = (0, import_path12.join)(runDir, "run.json");
|
|
39176
39204
|
const artifactSafetyPath = (0, import_path12.join)(runDir, "artifact-safety.json");
|
|
39177
39205
|
const args = [
|
|
39206
|
+
...runnerProbe.globalArgs,
|
|
39178
39207
|
"exec",
|
|
39179
39208
|
...codexConfigArgs({ backend: codexSandboxBackend, networkAccess: codexNetworkAccess }),
|
|
39180
39209
|
"--cd",
|
|
@@ -39184,7 +39213,7 @@ function createExternalAgentExecutorPlan(options) {
|
|
|
39184
39213
|
"--ignore-rules",
|
|
39185
39214
|
"--sandbox",
|
|
39186
39215
|
"workspace-write",
|
|
39187
|
-
|
|
39216
|
+
...runnerProbe.execArgs,
|
|
39188
39217
|
"--json",
|
|
39189
39218
|
"--output-last-message",
|
|
39190
39219
|
lastMessagePath,
|
|
@@ -39230,6 +39259,7 @@ function createExternalAgentExecutorPlan(options) {
|
|
|
39230
39259
|
binary_checked: runnerProbe.binaryChecked,
|
|
39231
39260
|
required_flags_checked: runnerProbe.requiredFlagsChecked
|
|
39232
39261
|
},
|
|
39262
|
+
codex_automation_mode: runnerProbe.automationMode,
|
|
39233
39263
|
codex_sandbox_backend: codexSandboxBackend,
|
|
39234
39264
|
codex_network_access: codexNetworkAccess
|
|
39235
39265
|
},
|