import assert from "node:assert/strict";
import { readFile } from "node:fs/promises";
import test from "node:test";

const runtimePromptPath = new URL("./prompts/hwlab-v02-runtime.md", import.meta.url);

test("HWLAB v0.2 runtime prompt constrains MiniMax-M3 tool calls", async () => {
  const prompt = await readFile(runtimePromptPath, "utf8");
  assert.match(prompt, /MiniMax-M3 tool-call guidance/u);
  assert.match(prompt, /one short, single-purpose command/u);
  assert.match(prompt, /Do not emit multi-line inline scripts/u);
  assert.match(prompt, /does not guarantee `python3` or `jq`/u);
  assert.match(prompt, /command -v python3/u);
  assert.match(prompt, /multiple `grep -F` checks/u);
  assert.match(prompt, /curl -fsS http:\/\/74\.48\.78\.17:19666\/v1\/skills -o \/tmp\/skills\.json/u);
  assert.match(prompt, /hwpod-cli/u);
  assert.match(prompt, /hwpod-ctl/u);
  assert.match(prompt, /\/v1\/hwpod\/specs\?probe=1/u);
  assert.match(prompt, /preinstalled `.hwlab\/hwpod-spec.yaml`/u);
  assert.match(prompt, /unidesk-ssh/u);
});
