@f-o-h/cli 0.1.27 → 0.1.29
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/README.md +1 -1
- package/dist/foh.js +33 -9
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ AI-operator provisioning CLI for Front Of House.
|
|
|
4
4
|
|
|
5
5
|
Public mirror: https://github.com/iiko38/front-of-house-cli
|
|
6
6
|
|
|
7
|
-
Current published baseline: `@f-o-h/cli@0.1.
|
|
7
|
+
Current published baseline: `@f-o-h/cli@0.1.29`
|
|
8
8
|
|
|
9
9
|
This mirror is a generated release artifact. The private product monorepo is not
|
|
10
10
|
published here, and no open-source license is granted unless stated separately.
|
package/dist/foh.js
CHANGED
|
@@ -32698,7 +32698,7 @@ var StdioServerTransport = class {
|
|
|
32698
32698
|
};
|
|
32699
32699
|
|
|
32700
32700
|
// src/lib/cli-version.ts
|
|
32701
|
-
var CLI_VERSION = "0.1.
|
|
32701
|
+
var CLI_VERSION = "0.1.29";
|
|
32702
32702
|
|
|
32703
32703
|
// src/commands/mcp-serve.ts
|
|
32704
32704
|
var DEFAULT_TIMEOUT_MS = 12e4;
|
|
@@ -38394,6 +38394,7 @@ function artifactFiles(runDir) {
|
|
|
38394
38394
|
return (0, import_fs12.readdirSync)(runDir).map((name) => (0, import_path10.join)(runDir, name)).filter((path2) => {
|
|
38395
38395
|
const stat = (0, import_fs12.statSync)(path2);
|
|
38396
38396
|
const name = path2.split(/[\\/]/).pop() || "";
|
|
38397
|
+
if (name.endsWith(".redacted")) return false;
|
|
38397
38398
|
return stat.isFile() && (TEXT_ARTIFACT_NAMES.has(name) || name.startsWith("command-output-cmd_"));
|
|
38398
38399
|
}).sort();
|
|
38399
38400
|
}
|
|
@@ -38973,16 +38974,23 @@ function proofArtifactPasses(runDir) {
|
|
|
38973
38974
|
function readIfExists(path2) {
|
|
38974
38975
|
return (0, import_fs14.existsSync)(path2) ? (0, import_fs14.readFileSync)(path2, "utf8") : "";
|
|
38975
38976
|
}
|
|
38976
|
-
function
|
|
38977
|
+
function redactArtifactFile(path2, input = {}) {
|
|
38977
38978
|
if (!(0, import_fs14.existsSync)(path2)) return;
|
|
38978
38979
|
const original = (0, import_fs14.readFileSync)(path2, "utf8");
|
|
38979
|
-
const redacted =
|
|
38980
|
+
const redacted = redactExternalAgentArtifactText(original, input);
|
|
38980
38981
|
if (redacted !== original) (0, import_fs14.writeFileSync)(path2, redacted, "utf8");
|
|
38981
38982
|
}
|
|
38982
|
-
function
|
|
38983
|
-
|
|
38984
|
-
|
|
38985
|
-
|
|
38983
|
+
function redactOutputArtifacts(run, input = {}) {
|
|
38984
|
+
redactArtifactFile(run.outputs.jsonl, input);
|
|
38985
|
+
redactArtifactFile(run.outputs.last_message, input);
|
|
38986
|
+
redactArtifactFile(run.outputs.stderr, input);
|
|
38987
|
+
redactArtifactFile((0, import_path12.join)(run.run_dir, "commands.ndjson"), input);
|
|
38988
|
+
if (!(0, import_fs14.existsSync)(run.run_dir)) return;
|
|
38989
|
+
for (const name of (0, import_fs14.readdirSync)(run.run_dir)) {
|
|
38990
|
+
if (name.startsWith("command-output-cmd_") && !name.endsWith(".redacted")) {
|
|
38991
|
+
redactArtifactFile((0, import_path12.join)(run.run_dir, name), input);
|
|
38992
|
+
}
|
|
38993
|
+
}
|
|
38986
38994
|
}
|
|
38987
38995
|
function copyCommandCaptureArtifacts(input) {
|
|
38988
38996
|
const commandLog = (0, import_path12.join)(input.captureDir, "commands.ndjson");
|
|
@@ -39000,6 +39008,21 @@ function relativeArtifactName(path2) {
|
|
|
39000
39008
|
function classifyRun(input) {
|
|
39001
39009
|
if (input.timedOut) return { status: "hold", reasonCode: "codex_runner_timeout" };
|
|
39002
39010
|
if (!input.artifactSafetyOk) return { status: "fail", reasonCode: "external_agent_artifact_safety_blocked" };
|
|
39011
|
+
const completedCommands = readCommandRecords(input.run.run_dir).filter((record2) => record2.phase === "completed");
|
|
39012
|
+
const commandReasonCodes = completedCommands.map((record2) => String(record2.reason_code || "")).filter(Boolean);
|
|
39013
|
+
const hasCommandReason = (pattern) => commandReasonCodes.some((reason) => pattern.test(reason));
|
|
39014
|
+
if (hasCommandReason(/contact_phone_missing/i)) {
|
|
39015
|
+
return { status: "hold", reasonCode: "voice_contact_phone_missing" };
|
|
39016
|
+
}
|
|
39017
|
+
if (hasCommandReason(/proof_held/i)) {
|
|
39018
|
+
return { status: "hold", reasonCode: "external_agent_proof_held" };
|
|
39019
|
+
}
|
|
39020
|
+
if (hasCommandReason(/sim(?:ulation)?[_-]?cert(?:ify|ification)?.*failed|simulation_certification_failed/i)) {
|
|
39021
|
+
return { status: "hold", reasonCode: "simulation_certification_failed" };
|
|
39022
|
+
}
|
|
39023
|
+
if (hasCommandReason(/agent_limit_reached/i)) {
|
|
39024
|
+
return { status: "hold", reasonCode: "eval_org_agent_limit_reached" };
|
|
39025
|
+
}
|
|
39003
39026
|
const lastMessage = readIfExists(input.run.outputs.last_message);
|
|
39004
39027
|
const stderr = readIfExists(input.run.outputs.stderr);
|
|
39005
39028
|
const combined = `${lastMessage}
|
|
@@ -39167,10 +39190,11 @@ async function executeExternalAgentExecutorPlan(plan, options = {}) {
|
|
|
39167
39190
|
timeoutMs: plan.timeout_minutes * 60 * 1e3
|
|
39168
39191
|
});
|
|
39169
39192
|
copyCommandCaptureArtifacts({ captureDir: commandCaptureDir, runDir: run.run_dir });
|
|
39170
|
-
|
|
39193
|
+
const privateRepoRoot = options.privateRepoRoot || plan.private_repo_root;
|
|
39194
|
+
redactOutputArtifacts(run, { privateRepoRoot });
|
|
39171
39195
|
const artifactSafety = scanExternalAgentArtifacts({
|
|
39172
39196
|
runDir: run.run_dir,
|
|
39173
|
-
privateRepoRoot
|
|
39197
|
+
privateRepoRoot,
|
|
39174
39198
|
writeRedacted: true
|
|
39175
39199
|
});
|
|
39176
39200
|
(0, import_fs14.writeFileSync)(run.outputs.artifact_safety, `${JSON.stringify(artifactSafety, null, 2)}
|