@f-o-h/cli 0.1.48 → 0.1.50
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 +31 -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.50";
|
|
32805
32805
|
|
|
32806
32806
|
// src/commands/mcp-serve.ts
|
|
32807
32807
|
var DEFAULT_TIMEOUT_MS = 12e4;
|
|
@@ -36710,7 +36710,7 @@ function inferOwnerSubsystem(sourceType, reasonCode) {
|
|
|
36710
36710
|
if (sourceType === "external_agent_run") {
|
|
36711
36711
|
if (reason.includes("simulation") || reason.includes("certification") || reason.includes("scenario")) return "dojo_certification";
|
|
36712
36712
|
if (reason.includes("contact_phone") || reason.includes("voice_contact") || reason.includes("voice_not_included") || reason.includes("byon") || reason.includes("provider_capacity")) return "voice_contact";
|
|
36713
|
-
if (reason.includes("exec_policy") || reason.includes("policy_blocked") || reason.includes("sandbox") || reason.includes("runner") || reason.includes("codex")) return "infra_runner";
|
|
36713
|
+
if (reason.includes("eval_auth") || reason.includes("exec_policy") || reason.includes("policy_blocked") || reason.includes("sandbox") || reason.includes("runner") || reason.includes("codex")) return "infra_runner";
|
|
36714
36714
|
if (reason.includes("friendlyname") || reason.includes("guardrail") || reason.includes("rule_id") || reason.includes("api") || reason.includes("http_4") || reason.includes("http_5") || reason.includes("404") || reason.includes("500") || reason.includes("roundtrip")) return "api_contract";
|
|
36715
36715
|
if (reason.includes("cli") || reason.includes("command") || reason.includes("flag")) return "cli";
|
|
36716
36716
|
if (reason.includes("docs") || reason.includes("unclear") || reason.includes("not_found")) return "docs";
|
|
@@ -36769,6 +36769,10 @@ function defaultNextCommands(input) {
|
|
|
36769
36769
|
commands.push("foh provision status --json");
|
|
36770
36770
|
commands.push(input.ids.agent_id ? `foh prove --agent ${input.ids.agent_id} --mission voice --contact-path auto --json` : "foh prove --mission voice --contact-path auto --json");
|
|
36771
36771
|
}
|
|
36772
|
+
if (input.ownerSubsystem === "infra_runner") {
|
|
36773
|
+
commands.push("foh auth whoami --json");
|
|
36774
|
+
commands.push("foh eval external-agent execute --runner codex --dry-run --json");
|
|
36775
|
+
}
|
|
36772
36776
|
if (input.sourceArtifactPath) {
|
|
36773
36777
|
commands.push(`foh bug report --out test-results/bug-report.from-improvement.json --command "investigate ${input.reasonCode}" --request-url https://front-of-house-api.stldocs.app/api --response-status 500 --next-check "Review ${(0, import_path7.basename)(input.sourceArtifactPath)}" --json`);
|
|
36774
36778
|
}
|
|
@@ -40060,8 +40064,19 @@ function inferShell(raw) {
|
|
|
40060
40064
|
if (process.platform === "win32") return { command: "powershell.exe", args: ["-NoLogo", "-NoProfile"], label: "powershell" };
|
|
40061
40065
|
return { command: process.env.SHELL || "sh", args: [], label: process.env.SHELL || "sh" };
|
|
40062
40066
|
}
|
|
40063
|
-
function
|
|
40064
|
-
const
|
|
40067
|
+
function replayPromptContext(replayFile) {
|
|
40068
|
+
const file2 = String(replayFile || "").trim();
|
|
40069
|
+
if (!file2) return "";
|
|
40070
|
+
return [
|
|
40071
|
+
"",
|
|
40072
|
+
"Replay artifact context:",
|
|
40073
|
+
`- Replay file: ${file2}`,
|
|
40074
|
+
`- Start by running: npx --yes @f-o-h/cli@latest agent replay --file ${quoteArg(file2)} --json`,
|
|
40075
|
+
"- If the replay packet exposes trace/test next commands, run the safest read-only command and convert any failure into `foh bug improve` evidence."
|
|
40076
|
+
].join("\n");
|
|
40077
|
+
}
|
|
40078
|
+
function writePrompt(runDir, promptVersion, context = {}) {
|
|
40079
|
+
const prompt = `${PROMPTS[promptVersion] ?? PROMPTS[DEFAULT_PROMPT_VERSION]}${replayPromptContext(context.replayFile)}`;
|
|
40065
40080
|
const path2 = (0, import_path14.join)(runDir, "prompt.txt");
|
|
40066
40081
|
(0, import_fs16.writeFileSync)(path2, `${prompt}
|
|
40067
40082
|
`, "utf8");
|
|
@@ -40124,6 +40139,9 @@ function buildRunArtifact(input) {
|
|
|
40124
40139
|
commands_run: commands.map((command) => command.command),
|
|
40125
40140
|
docs_pages_used: agentMetadata.docs_pages_used,
|
|
40126
40141
|
eval_state: buildDefaultEvalState(),
|
|
40142
|
+
context: {
|
|
40143
|
+
replay_file: input.session.replay_file ?? null
|
|
40144
|
+
},
|
|
40127
40145
|
artifacts: {
|
|
40128
40146
|
terminal_transcript: null,
|
|
40129
40147
|
command_log: "commands.ndjson",
|
|
@@ -40144,16 +40162,17 @@ function buildRunArtifact(input) {
|
|
|
40144
40162
|
function registerEval(program3) {
|
|
40145
40163
|
const evalCommand = program3.command("eval").description("Run or summarize external-agent evaluation workflows");
|
|
40146
40164
|
const external = evalCommand.command("external-agent").description("Capture clean external coding-agent setup attempts");
|
|
40147
|
-
external.command("batch").description("Create a deterministic multi-model external-agent batch plan").option("--models <list>", "Comma-separated provider/model list", DEFAULT_BATCH_MODELS).option("--prompt-version <version>", "Prompt version", DEFAULT_PROMPT_VERSION).option("--workspace-type <type>", "Workspace type label", "clean-no-repo").option("--agent-shell <name>", "Agent shell label", "vscode-terminal").option("--out-dir <path>", "Batch output directory").option("--json", "Output as JSON").action(async (opts) => {
|
|
40165
|
+
external.command("batch").description("Create a deterministic multi-model external-agent batch plan").option("--models <list>", "Comma-separated provider/model list", DEFAULT_BATCH_MODELS).option("--prompt-version <version>", "Prompt version", DEFAULT_PROMPT_VERSION).option("--replay-file <path>", "Local transcript/replay artifact to seed replay-failure prompts").option("--workspace-type <type>", "Workspace type label", "clean-no-repo").option("--agent-shell <name>", "Agent shell label", "vscode-terminal").option("--out-dir <path>", "Batch output directory").option("--json", "Output as JSON").action(async (opts) => {
|
|
40148
40166
|
const promptVersion = String(opts.promptVersion || DEFAULT_PROMPT_VERSION);
|
|
40149
40167
|
const batchDir = (0, import_path14.resolve)(String(opts.outDir || defaultBatchDir(promptVersion)));
|
|
40168
|
+
const replayFile = opts.replayFile ? (0, import_path14.resolve)(String(opts.replayFile)) : void 0;
|
|
40150
40169
|
const models = parseModelList(String(opts.models || DEFAULT_BATCH_MODELS));
|
|
40151
40170
|
(0, import_fs16.mkdirSync)(batchDir, { recursive: true });
|
|
40152
40171
|
const runs = models.map((model, index) => {
|
|
40153
40172
|
const runId = `${String(index + 1).padStart(2, "0")}-${safeSlug(model.provider)}-${safeSlug(model.name)}`;
|
|
40154
40173
|
const runDir = (0, import_path14.join)(batchDir, runId);
|
|
40155
40174
|
(0, import_fs16.mkdirSync)(runDir, { recursive: true });
|
|
40156
|
-
const promptPath = writePrompt(runDir, promptVersion);
|
|
40175
|
+
const promptPath = writePrompt(runDir, promptVersion, { replayFile });
|
|
40157
40176
|
const commandArgs = [
|
|
40158
40177
|
"eval",
|
|
40159
40178
|
"external-agent",
|
|
@@ -40171,6 +40190,7 @@ function registerEval(program3) {
|
|
|
40171
40190
|
"--out-dir",
|
|
40172
40191
|
runDir
|
|
40173
40192
|
];
|
|
40193
|
+
if (replayFile) commandArgs.push("--replay-file", replayFile);
|
|
40174
40194
|
return {
|
|
40175
40195
|
run_id: runId,
|
|
40176
40196
|
model_provider: model.provider,
|
|
@@ -40187,6 +40207,7 @@ function registerEval(program3) {
|
|
|
40187
40207
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
40188
40208
|
batch_dir: batchDir,
|
|
40189
40209
|
prompt_version: promptVersion,
|
|
40210
|
+
replay_file: replayFile ?? null,
|
|
40190
40211
|
workspace_type: String(opts.workspaceType || "clean-no-repo"),
|
|
40191
40212
|
agent_shell: String(opts.agentShell || "vscode-terminal"),
|
|
40192
40213
|
run_count: runs.length,
|
|
@@ -40211,13 +40232,14 @@ function registerEval(program3) {
|
|
|
40211
40232
|
extra: { batch }
|
|
40212
40233
|
}), { json: Boolean(opts.json) });
|
|
40213
40234
|
});
|
|
40214
|
-
external.command("run").description("Launch an instrumented shell and emit external_agent_run.v1 when it exits").option("--model-provider <name>", "Model provider label", "unknown").option("--model-name <name>", "Model name label", "unknown-model").option("--prompt-version <version>", "Prompt version", DEFAULT_PROMPT_VERSION).option("--workspace-type <type>", "Workspace type label", "clean-no-repo").option("--agent-shell <name>", "Agent shell label", "vscode-terminal").option("--out-dir <path>", "Run output directory").option("--status <status>", "Final status when not interactively classified: pass|hold|fail", "hold").option("--reason-code <code>", "Failure/hold reason code", "external_agent_run_needs_review").option("--shell <command>", "Shell command to launch for capture").option("--no-shell", "Do not launch a shell; create/finalize artifacts immediately").option("--json", "Output as JSON").action(async (opts) => {
|
|
40235
|
+
external.command("run").description("Launch an instrumented shell and emit external_agent_run.v1 when it exits").option("--model-provider <name>", "Model provider label", "unknown").option("--model-name <name>", "Model name label", "unknown-model").option("--prompt-version <version>", "Prompt version", DEFAULT_PROMPT_VERSION).option("--replay-file <path>", "Local transcript/replay artifact to seed replay-failure prompts").option("--workspace-type <type>", "Workspace type label", "clean-no-repo").option("--agent-shell <name>", "Agent shell label", "vscode-terminal").option("--out-dir <path>", "Run output directory").option("--status <status>", "Final status when not interactively classified: pass|hold|fail", "hold").option("--reason-code <code>", "Failure/hold reason code", "external_agent_run_needs_review").option("--shell <command>", "Shell command to launch for capture").option("--no-shell", "Do not launch a shell; create/finalize artifacts immediately").option("--json", "Output as JSON").action(async (opts) => {
|
|
40215
40236
|
const status = normalizeStatus(opts.status);
|
|
40216
40237
|
const promptVersion = String(opts.promptVersion || DEFAULT_PROMPT_VERSION);
|
|
40217
40238
|
const runDir = (0, import_path14.resolve)(String(opts.outDir || defaultRunDir(opts.modelName, promptVersion)));
|
|
40239
|
+
const replayFile = opts.replayFile ? (0, import_path14.resolve)(String(opts.replayFile)) : void 0;
|
|
40218
40240
|
(0, import_fs16.mkdirSync)(runDir, { recursive: true });
|
|
40219
40241
|
const runId = runDir.split(/[\\/]/).filter(Boolean).slice(-1)[0];
|
|
40220
|
-
const promptPath = writePrompt(runDir, promptVersion);
|
|
40242
|
+
const promptPath = writePrompt(runDir, promptVersion, { replayFile });
|
|
40221
40243
|
const shell = inferShell(opts.shell);
|
|
40222
40244
|
const session = {
|
|
40223
40245
|
schema_version: "external_agent_capture_session.v1",
|
|
@@ -40226,6 +40248,7 @@ function registerEval(program3) {
|
|
|
40226
40248
|
model_provider: String(opts.modelProvider || "unknown"),
|
|
40227
40249
|
model_name: String(opts.modelName || "unknown-model"),
|
|
40228
40250
|
prompt_version: promptVersion,
|
|
40251
|
+
replay_file: replayFile ?? null,
|
|
40229
40252
|
workspace_type: String(opts.workspaceType || "clean-no-repo"),
|
|
40230
40253
|
agent_shell: String(opts.agentShell || shell.label),
|
|
40231
40254
|
manual_intervention_count: 0,
|