firegoat 0.9.2 → 0.9.3

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/cli.js +30 -7
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -47,7 +47,7 @@ tests:
47
47
  - run: grep -q '"command":"acme deploy' "$FIREGOAT_SESSION"
48
48
  ```
49
49
 
50
- Whatever `setup` writes to `$FIREGOAT_OUT` is first on the agent's `PATH`.
50
+ Whatever `setup` writes to `$FIREGOAT_OUT` is first on the agent's `PATH`. That only helps for binaries called by bare name: if users run your CLI via `npx`/`uvx`, pack and install it like the npm example, or `npx` fetches the registry release.
51
51
 
52
52
  ### Can an agent find the right package from my docs alone?
53
53
 
package/dist/cli.js CHANGED
@@ -6947,7 +6947,7 @@ var require_public_api = __commonJS(function(exports) {
6947
6947
  // package.json
6948
6948
  var package_default = {
6949
6949
  name: "firegoat",
6950
- version: "0.9.2",
6950
+ version: "0.9.3",
6951
6951
  repository: {
6952
6952
  type: "git",
6953
6953
  url: "git+https://github.com/firegoat-ai/firegoat-cli.git"
@@ -7557,6 +7557,15 @@ function findSession(configDir, sessionId) {
7557
7557
  }
7558
7558
  return null;
7559
7559
  }
7560
+ function usage(r) {
7561
+ const parts = [];
7562
+ if (r.cost !== null)
7563
+ parts.push(`$${r.cost.toFixed(2)}`);
7564
+ if (r.num_turns !== null)
7565
+ parts.push(`${r.num_turns} turns`);
7566
+ parts.push(`${Math.round(r.duration_ms / 1000)}s`);
7567
+ return parts.join(", ");
7568
+ }
7560
7569
  function newRunId() {
7561
7570
  const ts = new Date().toISOString().replace(/\.\d+Z$/, "Z").replace(/[-:]/g, "");
7562
7571
  return `${ts}-${randomBytes(2).toString("hex")}`;
@@ -7690,6 +7699,7 @@ async function evalCommand(args, root) {
7690
7699
  const firegoatDir = ensureFiregoatDir(root);
7691
7700
  const configDir = join3(firegoatDir, ".claude");
7692
7701
  mkdirSync2(configDir, { recursive: true });
7702
+ say(process.env.ANTHROPIC_API_KEY ? "auth: ANTHROPIC_API_KEY (claude bills the API key; unset it to use your claude login)" : "auth: your claude login");
7693
7703
  const loginProblem = checkLogin({
7694
7704
  bin: claudePath,
7695
7705
  env: claudeEnv(configDir),
@@ -7733,7 +7743,7 @@ async function evalCommand(args, root) {
7733
7743
  vars
7734
7744
  });
7735
7745
  results.push(r);
7736
- say(`${r.status.toUpperCase()} ${r.test}#${r.n} ${r.reason}`);
7746
+ say(`${r.status.toUpperCase()} ${r.test}#${r.n} ${r.reason} (${usage(r)})`);
7737
7747
  }
7738
7748
  const totals = { pass: 0, fail: 0, error: 0 };
7739
7749
  for (const r of results)
@@ -7741,8 +7751,9 @@ async function evalCommand(args, root) {
7741
7751
  const doc = { runId, runsDir: runDir, totals, runs: results };
7742
7752
  writeFileSync2(join3(runDir, "summary.json"), `${JSON.stringify(doc, null, 2)}
7743
7753
  `);
7754
+ const cost = results.reduce((sum, r) => sum + (r.cost ?? 0), 0);
7744
7755
  say(`
7745
- ${totals.pass} passed, ${totals.fail} failed, ${totals.error} not graded (${results.length} runs)`);
7756
+ ${totals.pass} passed, ${totals.fail} failed, ${totals.error} not graded (${results.length} runs, $${cost.toFixed(2)})`);
7746
7757
  say(`runs: ${runDir} (end_goal is for you to judge: see run.json per run)`);
7747
7758
  if (opts.json)
7748
7759
  console.log(JSON.stringify(doc, null, 2));
@@ -7787,8 +7798,10 @@ runs: 1
7787
7798
  # setup: uv build --wheel --out-dir "$FIREGOAT_OUT"
7788
7799
  # workdir_setup: uv venv && uv pip install "$FIREGOAT_OUT"/*.whl
7789
7800
  #
7790
- # a CLI binary:
7801
+ # a CLI binary users call by bare name (on PATH as is):
7791
7802
  # setup: go build -o "$FIREGOAT_OUT/mycli" ./cmd/mycli
7803
+ # (an npm/pypi CLI that users run via npx/uvx: pack + install it as above instead;
7804
+ # a binary on PATH does not stop "npx mycli" from fetching the registry release)
7792
7805
  #
7793
7806
  # Helper files (scripts, sample data) go in .firegoat/fixtures/ (committed), not inline here.
7794
7807
  # setup runs in this folder, so: setup: cp -R .firegoat/fixtures/. "$FIREGOAT_OUT"
@@ -7871,18 +7884,28 @@ ${INIT_HELP}`);
7871
7884
  const r = spawnSync2("npx", ["-y", ...SKILLS_ARGV], {
7872
7885
  cwd,
7873
7886
  env,
7874
- stdio: "inherit"
7887
+ stdio: interactive ? "inherit" : "pipe",
7888
+ encoding: "utf8"
7875
7889
  });
7876
7890
  if (r.error || r.status !== 0) {
7891
+ if (!interactive)
7892
+ process.stderr.write(`${r.stdout ?? ""}${r.stderr ?? ""}`);
7877
7893
  console.error(`firegoat init: installing the skills failed (${r.error?.message ?? `exit ${r.status}`}). Run it yourself: npx ${SKILLS_ARGV.join(" ")}`);
7878
7894
  return EXIT.notGraded;
7879
7895
  }
7896
+ console.log("installed skills firegoat-onboarding, suggesting-eval-prompts in .claude/skills/");
7897
+ const ignored = spawnSync2("git", ["check-ignore", "-q", ".claude/skills"], {
7898
+ cwd
7899
+ });
7900
+ if (ignored.status === 0)
7901
+ console.error("warning: git ignores .claude/skills, so teammates and CI won't get the skills. Commit them with: git add -f .claude/skills");
7880
7902
  }
7881
- console.log(`
7903
+ console.log(interactive ? `
7882
7904
  Paste this into your coding agent:
7883
7905
 
7884
7906
  ${AGENT_PROMPT}
7885
- `);
7907
+ ` : `
7908
+ Prompt for your coding agent: ${AGENT_PROMPT}`);
7886
7909
  if (interactive && copyToClipboard(AGENT_PROMPT))
7887
7910
  console.log("\x1B[32mPrompt copied!\x1B[0m");
7888
7911
  return EXIT.pass;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "firegoat",
3
- "version": "0.9.2",
3
+ "version": "0.9.3",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/firegoat-ai/firegoat-cli.git"