@f-o-h/cli 0.1.28 → 0.1.30

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 (3) hide show
  1. package/README.md +1 -1
  2. package/dist/foh.js +37 -3
  3. 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.28`
7
+ Current published baseline: `@f-o-h/cli@0.1.30`
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.28";
32701
+ var CLI_VERSION = "0.1.30";
32702
32702
 
32703
32703
  // src/commands/mcp-serve.ts
32704
32704
  var DEFAULT_TIMEOUT_MS = 12e4;
@@ -38496,6 +38496,20 @@ function commandIdFor(input) {
38496
38496
  function outputArtifactName(commandId) {
38497
38497
  return `command-output-${commandId}.txt`;
38498
38498
  }
38499
+ function collectCheckReasonCodes(parsed) {
38500
+ const checks = Array.isArray(parsed.checks) ? parsed.checks : [];
38501
+ const codes = /* @__PURE__ */ new Set();
38502
+ for (const check2 of checks) {
38503
+ if (!check2 || typeof check2 !== "object") continue;
38504
+ const record2 = check2;
38505
+ const status = typeof record2.status === "string" ? record2.status.toLowerCase() : "";
38506
+ const reasonCode = typeof record2.reason_code === "string" ? record2.reason_code.trim() : "";
38507
+ if (reasonCode && status && status !== "pass" && status !== "skipped") {
38508
+ codes.add(reasonCode);
38509
+ }
38510
+ }
38511
+ return Array.from(codes);
38512
+ }
38499
38513
  function parseEnvelope(text) {
38500
38514
  const candidates = [
38501
38515
  ...text.split(/\r?\n/).map((line) => line.trim()).filter((line) => line.startsWith("{") && line.endsWith("}")).reverse()
@@ -38508,11 +38522,12 @@ function parseEnvelope(text) {
38508
38522
  const parsed = JSON.parse(candidate);
38509
38523
  const status = typeof parsed.status === "string" ? parsed.status : parsed.ok === true ? "pass" : parsed.ok === false ? "fail" : null;
38510
38524
  const reasonCode = typeof parsed.reason_code === "string" ? parsed.reason_code : typeof parsed.code === "string" ? parsed.code : null;
38511
- if (status || reasonCode) return { status, reasonCode };
38525
+ const checkReasonCodes = collectCheckReasonCodes(parsed);
38526
+ if (status || reasonCode || checkReasonCodes.length > 0) return { status, reasonCode, checkReasonCodes };
38512
38527
  } catch {
38513
38528
  }
38514
38529
  }
38515
- return { status: null, reasonCode: null };
38530
+ return { status: null, reasonCode: null, checkReasonCodes: [] };
38516
38531
  }
38517
38532
  function recordExternalAgentCliInvocation(input) {
38518
38533
  const runDir = getExternalAgentRunDir();
@@ -38615,6 +38630,7 @@ function completeExternalAgentCliInvocation(capture, input) {
38615
38630
  exit_code: Number.isInteger(input.exitCode) ? Number(input.exitCode) : null,
38616
38631
  status: parsed.status,
38617
38632
  reason_code: parsed.reasonCode,
38633
+ check_reason_codes: parsed.checkReasonCodes,
38618
38634
  output_artifact: artifact,
38619
38635
  output_bytes: Buffer.byteLength(output, "utf8")
38620
38636
  };
@@ -39008,6 +39024,24 @@ function relativeArtifactName(path2) {
39008
39024
  function classifyRun(input) {
39009
39025
  if (input.timedOut) return { status: "hold", reasonCode: "codex_runner_timeout" };
39010
39026
  if (!input.artifactSafetyOk) return { status: "fail", reasonCode: "external_agent_artifact_safety_blocked" };
39027
+ const completedCommands = readCommandRecords(input.run.run_dir).filter((record2) => record2.phase === "completed");
39028
+ const commandReasonCodes = completedCommands.flatMap((record2) => [
39029
+ String(record2.reason_code || ""),
39030
+ ...Array.isArray(record2.check_reason_codes) ? record2.check_reason_codes.map((code) => String(code || "")) : []
39031
+ ]).filter(Boolean);
39032
+ const hasCommandReason = (pattern) => commandReasonCodes.some((reason) => pattern.test(reason));
39033
+ if (hasCommandReason(/contact_phone_missing/i)) {
39034
+ return { status: "hold", reasonCode: "voice_contact_phone_missing" };
39035
+ }
39036
+ if (hasCommandReason(/sim(?:ulation)?[_-]?cert(?:ify|ification)?.*failed|simulation_certification_failed/i)) {
39037
+ return { status: "hold", reasonCode: "simulation_certification_failed" };
39038
+ }
39039
+ if (hasCommandReason(/proof_held/i)) {
39040
+ return { status: "hold", reasonCode: "external_agent_proof_held" };
39041
+ }
39042
+ if (hasCommandReason(/agent_limit_reached/i)) {
39043
+ return { status: "hold", reasonCode: "eval_org_agent_limit_reached" };
39044
+ }
39011
39045
  const lastMessage = readIfExists(input.run.outputs.last_message);
39012
39046
  const stderr = readIfExists(input.run.outputs.stderr);
39013
39047
  const combined = `${lastMessage}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@f-o-h/cli",
3
- "version": "0.1.28",
3
+ "version": "0.1.30",
4
4
  "description": "FOH CLI - AI-operator provisioning tool for Front Of House",
5
5
  "license": "UNLICENSED",
6
6
  "bin": {