feat(seats): memory, the Playwright MCP config, and the seats library
:Memory: MemAvailable and the reserve policy, the sampler of a pass's peak
tree PSS (one sweep, a pause of three sweeps at least, stopped with the
driver), and the calibration file every driver on the machine shares,
re-read and written under its lock.
:Mcp: the pinned @playwright/mcp 0.0.83 arguments and the --mcp-config of
one pass, compact and in a fixed key order.
:Seats: the dotenv loader (token lines only, TOKEN7 inert), the one-word
probe (run under the supervisor, a missing binary reported with its errno
text), the window maths, the ranking, the Fable merge, the editor-bundle
lookup of the claude binary, the redaction of anything token-shaped, and
the report. This libc++ has no tzdb, so a zone by name converts through
the C library with TZ set, reading the system's zoneinfo.
tests/Seats: 92 checks against reference vectors, numbered in order, all
green.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 07:32:14 +01:00
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
// SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
|
|
|
|
|
|
|
|
|
module Crafter.Review:Mcp_impl;
|
|
|
|
|
import :Mcp;
|
|
|
|
|
import :Json;
|
|
|
|
|
import :Text;
|
|
|
|
|
import :Tools;
|
|
|
|
|
import std;
|
|
|
|
|
|
|
|
|
|
namespace fs = std::filesystem;
|
|
|
|
|
|
|
|
|
|
namespace Crafter::Review::Mcp {
|
|
|
|
|
std::vector<std::string> DefaultArgs() {
|
|
|
|
|
return {"-y", std::format("@playwright/mcp@{}", PlaywrightMcpVersion), "--headless", "--isolated", "--browser", "chromium"};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Json PlaywrightConfig(const Json& functional, const std::string& outputDir) {
|
|
|
|
|
const Json& mcp = Dyn::Or(Dyn::Get(Dyn::Or(functional, Dyn::EmptyDict()), "mcp"), Dyn::EmptyDict());
|
|
|
|
|
Json args = Json::array();
|
|
|
|
|
const Json& configured = Dyn::Get(mcp, "args");
|
|
|
|
|
if (!configured.is_null()) {
|
|
|
|
|
for (const Json& arg : configured) args.push_back(arg);
|
|
|
|
|
} else {
|
|
|
|
|
for (const std::string& arg : DefaultArgs()) args.push_back(arg);
|
|
|
|
|
}
|
|
|
|
|
if (!Dyn::In(Json("--output-dir"), args)) {
|
|
|
|
|
args.push_back("--output-dir");
|
|
|
|
|
args.push_back(outputDir);
|
|
|
|
|
}
|
|
|
|
|
const Json& command = Dyn::Get(mcp, "command");
|
|
|
|
|
return {{"mcpServers", {{std::string(Tools::McpServer), {{"command", Dyn::Truthy(command) ? command : Json("npx")}, {"args", std::move(args)}}}}}};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::string ConfigJson(const Json& config) {
|
feat(opencode): the OpenCode harness, checked against its goldens
The tool source generated from the schema, the home with its view, the
shared and per-process environments, the permission rules, the commands,
the warm-up under the supervisor, the event stream and the
classification, its patterns as hand-written scanners. The goldens record
the answer for each, a warm-up against a fake opencode included.
A timed-out supervised command now gets SIGTERM, so the supervisor takes
its tree down (SIGKILL 10 s later); any other child gets SIGKILL. :Json
gains DumpCompact.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 08:32:51 +01:00
|
|
|
return DumpCompact(config);
|
feat(seats): memory, the Playwright MCP config, and the seats library
:Memory: MemAvailable and the reserve policy, the sampler of a pass's peak
tree PSS (one sweep, a pause of three sweeps at least, stopped with the
driver), and the calibration file every driver on the machine shares,
re-read and written under its lock.
:Mcp: the pinned @playwright/mcp 0.0.83 arguments and the --mcp-config of
one pass, compact and in a fixed key order.
:Seats: the dotenv loader (token lines only, TOKEN7 inert), the one-word
probe (run under the supervisor, a missing binary reported with its errno
text), the window maths, the ranking, the Fable merge, the editor-bundle
lookup of the claude binary, the redaction of anything token-shaped, and
the report. This libc++ has no tzdb, so a zone by name converts through
the C library with TZ set, reading the system's zoneinfo.
tests/Seats: 92 checks against reference vectors, numbered in order, all
green.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 07:32:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fs::path OutputDir(const fs::path& scratch, std::string_view label) {
|
|
|
|
|
const fs::path dir = scratch / "playwright" / Dyn::Replace(Dyn::Replace(label, "/", "_"), " ", "_");
|
|
|
|
|
fs::create_directories(dir);
|
|
|
|
|
return dir;
|
|
|
|
|
}
|
|
|
|
|
}
|