@f-o-h/cli 0.1.49 → 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.
Files changed (2) hide show
  1. package/dist/foh.js +26 -7
  2. 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.49";
32804
+ var CLI_VERSION = "0.1.50";
32805
32805
 
32806
32806
  // src/commands/mcp-serve.ts
32807
32807
  var DEFAULT_TIMEOUT_MS = 12e4;
@@ -40064,8 +40064,19 @@ function inferShell(raw) {
40064
40064
  if (process.platform === "win32") return { command: "powershell.exe", args: ["-NoLogo", "-NoProfile"], label: "powershell" };
40065
40065
  return { command: process.env.SHELL || "sh", args: [], label: process.env.SHELL || "sh" };
40066
40066
  }
40067
- function writePrompt(runDir, promptVersion) {
40068
- const prompt = PROMPTS[promptVersion] ?? PROMPTS[DEFAULT_PROMPT_VERSION];
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)}`;
40069
40080
  const path2 = (0, import_path14.join)(runDir, "prompt.txt");
40070
40081
  (0, import_fs16.writeFileSync)(path2, `${prompt}
40071
40082
  `, "utf8");
@@ -40128,6 +40139,9 @@ function buildRunArtifact(input) {
40128
40139
  commands_run: commands.map((command) => command.command),
40129
40140
  docs_pages_used: agentMetadata.docs_pages_used,
40130
40141
  eval_state: buildDefaultEvalState(),
40142
+ context: {
40143
+ replay_file: input.session.replay_file ?? null
40144
+ },
40131
40145
  artifacts: {
40132
40146
  terminal_transcript: null,
40133
40147
  command_log: "commands.ndjson",
@@ -40148,16 +40162,17 @@ function buildRunArtifact(input) {
40148
40162
  function registerEval(program3) {
40149
40163
  const evalCommand = program3.command("eval").description("Run or summarize external-agent evaluation workflows");
40150
40164
  const external = evalCommand.command("external-agent").description("Capture clean external coding-agent setup attempts");
40151
- 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) => {
40152
40166
  const promptVersion = String(opts.promptVersion || DEFAULT_PROMPT_VERSION);
40153
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;
40154
40169
  const models = parseModelList(String(opts.models || DEFAULT_BATCH_MODELS));
40155
40170
  (0, import_fs16.mkdirSync)(batchDir, { recursive: true });
40156
40171
  const runs = models.map((model, index) => {
40157
40172
  const runId = `${String(index + 1).padStart(2, "0")}-${safeSlug(model.provider)}-${safeSlug(model.name)}`;
40158
40173
  const runDir = (0, import_path14.join)(batchDir, runId);
40159
40174
  (0, import_fs16.mkdirSync)(runDir, { recursive: true });
40160
- const promptPath = writePrompt(runDir, promptVersion);
40175
+ const promptPath = writePrompt(runDir, promptVersion, { replayFile });
40161
40176
  const commandArgs = [
40162
40177
  "eval",
40163
40178
  "external-agent",
@@ -40175,6 +40190,7 @@ function registerEval(program3) {
40175
40190
  "--out-dir",
40176
40191
  runDir
40177
40192
  ];
40193
+ if (replayFile) commandArgs.push("--replay-file", replayFile);
40178
40194
  return {
40179
40195
  run_id: runId,
40180
40196
  model_provider: model.provider,
@@ -40191,6 +40207,7 @@ function registerEval(program3) {
40191
40207
  created_at: (/* @__PURE__ */ new Date()).toISOString(),
40192
40208
  batch_dir: batchDir,
40193
40209
  prompt_version: promptVersion,
40210
+ replay_file: replayFile ?? null,
40194
40211
  workspace_type: String(opts.workspaceType || "clean-no-repo"),
40195
40212
  agent_shell: String(opts.agentShell || "vscode-terminal"),
40196
40213
  run_count: runs.length,
@@ -40215,13 +40232,14 @@ function registerEval(program3) {
40215
40232
  extra: { batch }
40216
40233
  }), { json: Boolean(opts.json) });
40217
40234
  });
40218
- 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) => {
40219
40236
  const status = normalizeStatus(opts.status);
40220
40237
  const promptVersion = String(opts.promptVersion || DEFAULT_PROMPT_VERSION);
40221
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;
40222
40240
  (0, import_fs16.mkdirSync)(runDir, { recursive: true });
40223
40241
  const runId = runDir.split(/[\\/]/).filter(Boolean).slice(-1)[0];
40224
- const promptPath = writePrompt(runDir, promptVersion);
40242
+ const promptPath = writePrompt(runDir, promptVersion, { replayFile });
40225
40243
  const shell = inferShell(opts.shell);
40226
40244
  const session = {
40227
40245
  schema_version: "external_agent_capture_session.v1",
@@ -40230,6 +40248,7 @@ function registerEval(program3) {
40230
40248
  model_provider: String(opts.modelProvider || "unknown"),
40231
40249
  model_name: String(opts.modelName || "unknown-model"),
40232
40250
  prompt_version: promptVersion,
40251
+ replay_file: replayFile ?? null,
40233
40252
  workspace_type: String(opts.workspaceType || "clean-no-repo"),
40234
40253
  agent_shell: String(opts.agentShell || shell.label),
40235
40254
  manual_intervention_count: 0,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@f-o-h/cli",
3
- "version": "0.1.49",
3
+ "version": "0.1.50",
4
4
  "description": "FOH CLI - AI-operator provisioning tool for Front Of House",
5
5
  "license": "UNLICENSED",
6
6
  "bin": {