chore: import upstream snapshot with attribution
This commit is contained in:
@@ -0,0 +1,270 @@
|
||||
[
|
||||
{
|
||||
"number": 262,
|
||||
"title": "Add MseeP.ai badge",
|
||||
"files": [
|
||||
{"filename": "README.md", "status": "modified"}
|
||||
],
|
||||
"expected": ["documentation"]
|
||||
},
|
||||
{
|
||||
"number": 260,
|
||||
"title": "feat: add hacker-feeds-cli to registry",
|
||||
"files": [
|
||||
{"filename": "registry.json", "status": "modified"}
|
||||
],
|
||||
"expected": ["cli-anything-hub", "new-cli"]
|
||||
},
|
||||
{
|
||||
"number": 259,
|
||||
"title": "feat: add ve-twini to registry",
|
||||
"files": [
|
||||
{"filename": "registry.json", "status": "modified"}
|
||||
],
|
||||
"expected": ["cli-anything-hub", "new-cli"]
|
||||
},
|
||||
{
|
||||
"number": 258,
|
||||
"title": "feat: add sliver to registry",
|
||||
"files": [
|
||||
{"filename": "registry.json", "status": "modified"}
|
||||
],
|
||||
"expected": ["cli-anything-hub", "new-cli"]
|
||||
},
|
||||
{
|
||||
"number": 256,
|
||||
"title": "feat(Calibre): add a CLI-Anything harness for Calibre Desktop",
|
||||
"files": [
|
||||
{"filename": ".gitignore", "status": "modified"},
|
||||
{"filename": "README.md", "status": "modified"},
|
||||
{"filename": "calibre/agent-harness/CALIBRE.md", "status": "added"},
|
||||
{"filename": "calibre/agent-harness/cli_anything/calibre/calibre_cli.py", "status": "added"},
|
||||
{"filename": "calibre/agent-harness/cli_anything/calibre/core/session.py", "status": "added"},
|
||||
{"filename": "calibre/agent-harness/cli_anything/calibre/skills/SKILL.md", "status": "added"},
|
||||
{"filename": "calibre/agent-harness/setup.py", "status": "added"},
|
||||
{"filename": "cli-anything-plugin/scripts/setup-cli-anything.sh", "status": "modified"},
|
||||
{"filename": "codex-skill/scripts/install.sh", "status": "modified"},
|
||||
{"filename": "registry.json", "status": "modified"},
|
||||
{"filename": "skills/cli-anything-calibre/SKILL.md", "status": "added"}
|
||||
],
|
||||
"expected": ["cli-anything-hub", "cli-anything-skill", "new-cli"]
|
||||
},
|
||||
{
|
||||
"number": 254,
|
||||
"title": "feat: add quietshrink harness - Apple Silicon screen recording compressor",
|
||||
"files": [
|
||||
{"filename": ".gitignore", "status": "modified"},
|
||||
{"filename": "quietshrink/agent-harness/QUIETSHRINK.md", "status": "added"},
|
||||
{"filename": "quietshrink/agent-harness/cli_anything/quietshrink/quietshrink_cli.py", "status": "added"},
|
||||
{"filename": "quietshrink/agent-harness/cli_anything/quietshrink/skills/SKILL.md", "status": "added"},
|
||||
{"filename": "quietshrink/agent-harness/setup.py", "status": "added"},
|
||||
{"filename": "registry.json", "status": "modified"},
|
||||
{"filename": "skills/cli-anything-quietshrink/SKILL.md", "status": "added"}
|
||||
],
|
||||
"expected": ["cli-anything-hub", "cli-anything-skill", "new-cli"]
|
||||
},
|
||||
{
|
||||
"number": 252,
|
||||
"title": "Add cli-anything-rekordbox: Pioneer Rekordbox 6/7 harness",
|
||||
"files": [
|
||||
{"filename": ".gitignore", "status": "modified"},
|
||||
{"filename": "ableton/agent-harness/setup.py", "status": "added"},
|
||||
{"filename": "ableton/agent-harness/cli_anything/ableton/ableton_cli.py", "status": "added"},
|
||||
{"filename": "rekordbox/agent-harness/setup.py", "status": "added"},
|
||||
{"filename": "rekordbox/agent-harness/cli_anything/rekordbox/rekordbox_cli.py", "status": "added"},
|
||||
{"filename": "rekordbox/agent-harness/cli_anything/rekordbox/skills/SKILL.md", "status": "added"},
|
||||
{"filename": "serum/agent-harness/setup.py", "status": "added"},
|
||||
{"filename": "vital/agent-harness/setup.py", "status": "added"},
|
||||
{"filename": "skills/cli-anything-rekordbox/SKILL.md", "status": "added"}
|
||||
],
|
||||
"expected": ["cli-anything-skill", "new-cli"]
|
||||
},
|
||||
{
|
||||
"number": 251,
|
||||
"title": "feat: add s&box CLI harness",
|
||||
"files": [
|
||||
{"filename": ".gitignore", "status": "modified"},
|
||||
{"filename": "README.md", "status": "modified"},
|
||||
{"filename": "registry.json", "status": "modified"},
|
||||
{"filename": "sbox/agent-harness/SBOX.md", "status": "added"},
|
||||
{"filename": "sbox/agent-harness/cli_anything/sbox/sbox_cli.py", "status": "added"},
|
||||
{"filename": "sbox/agent-harness/cli_anything/sbox/skills/SKILL.md", "status": "added"},
|
||||
{"filename": "sbox/agent-harness/setup.py", "status": "added"},
|
||||
{"filename": "skills/cli-anything-sbox/SKILL.md", "status": "added"}
|
||||
],
|
||||
"expected": ["cli-anything-hub", "cli-anything-skill", "new-cli"]
|
||||
},
|
||||
{
|
||||
"number": 245,
|
||||
"title": "feat: mature lldb agent harness",
|
||||
"files": [
|
||||
{"filename": "lldb/agent-harness/LLDB.md", "status": "modified"},
|
||||
{"filename": "lldb/agent-harness/cli_anything/lldb/lldb_cli.py", "status": "modified"},
|
||||
{"filename": "lldb/agent-harness/cli_anything/lldb/skills/SKILL.md", "status": "modified"},
|
||||
{"filename": "lldb/agent-harness/setup.py", "status": "modified"},
|
||||
{"filename": "registry.json", "status": "modified"},
|
||||
{"filename": "skills/cli-anything-lldb/SKILL.md", "status": "modified"}
|
||||
],
|
||||
"expected": ["cli-anything-hub", "cli-anything-skill", "existing-cli-fix"]
|
||||
},
|
||||
{
|
||||
"number": 244,
|
||||
"title": "feat: improve Unreal Insights live analysis",
|
||||
"files": [
|
||||
{"filename": "skills/cli-anything-unrealinsights/SKILL.md", "status": "modified"},
|
||||
{"filename": "unrealinsights/agent-harness/UNREALINSIGHTS.md", "status": "modified"},
|
||||
{"filename": "unrealinsights/agent-harness/cli_anything/unrealinsights/core/analyze.py", "status": "added"},
|
||||
{"filename": "unrealinsights/agent-harness/cli_anything/unrealinsights/skills/SKILL.md", "status": "modified"},
|
||||
{"filename": "unrealinsights/agent-harness/cli_anything/unrealinsights/unrealinsights_cli.py", "status": "modified"}
|
||||
],
|
||||
"expected": ["cli-anything-skill", "existing-cli-fix"]
|
||||
},
|
||||
{
|
||||
"number": 241,
|
||||
"title": "Feat/add firefly iii cli",
|
||||
"files": [
|
||||
{"filename": ".gitignore", "status": "modified"},
|
||||
{"filename": "firefly-iii/agent-harness/README.md", "status": "added"},
|
||||
{"filename": "firefly-iii/agent-harness/cli_anything/firefly_iii/firefly_iii_cli.py", "status": "added"},
|
||||
{"filename": "firefly-iii/agent-harness/cli_anything/firefly_iii/skills/SKILL.md", "status": "added"},
|
||||
{"filename": "firefly-iii/agent-harness/setup.py", "status": "added"},
|
||||
{"filename": "firefly-iii/agent-harness/skills/cli-anything-firefly-iii/SKILL.md", "status": "added"}
|
||||
],
|
||||
"expected": ["cli-anything-skill", "new-cli"]
|
||||
},
|
||||
{
|
||||
"number": 240,
|
||||
"title": "fix(blender): align docs and render execute with real behavior",
|
||||
"files": [
|
||||
{"filename": "README.md", "status": "modified"},
|
||||
{"filename": "README_CN.md", "status": "modified"},
|
||||
{"filename": "blender/agent-harness/cli_anything/blender/README.md", "status": "modified"},
|
||||
{"filename": "blender/agent-harness/cli_anything/blender/blender_cli.py", "status": "modified"},
|
||||
{"filename": "blender/agent-harness/cli_anything/blender/core/render.py", "status": "modified"},
|
||||
{"filename": "blender/agent-harness/cli_anything/blender/utils/blender_backend.py", "status": "modified"}
|
||||
],
|
||||
"expected": ["existing-cli-fix"]
|
||||
},
|
||||
{
|
||||
"number": 238,
|
||||
"title": "feat: add NSLogger CLI harness",
|
||||
"files": [
|
||||
{"filename": ".gitignore", "status": "modified"},
|
||||
{"filename": "README.md", "status": "modified"},
|
||||
{"filename": "nslogger/agent-harness/NSLOGGER.md", "status": "added"},
|
||||
{"filename": "nslogger/agent-harness/cli_anything/nslogger/nslogger_cli.py", "status": "added"},
|
||||
{"filename": "nslogger/agent-harness/cli_anything/nslogger/skills/SKILL.md", "status": "added"},
|
||||
{"filename": "nslogger/agent-harness/setup.py", "status": "added"},
|
||||
{"filename": "registry.json", "status": "modified"},
|
||||
{"filename": "skills/cli-anything-nslogger/SKILL.md", "status": "added"}
|
||||
],
|
||||
"expected": ["cli-anything-hub", "cli-anything-skill", "new-cli"]
|
||||
},
|
||||
{
|
||||
"number": 237,
|
||||
"title": "refactor(openclaw-skill->macrocli): rename, complete backends, add recorder and visual anchor",
|
||||
"files": [
|
||||
{"filename": "macrocli/SKILL.md", "status": "added"},
|
||||
{"filename": "macrocli/agent-harness/MACROCLI.md", "status": "added"},
|
||||
{"filename": "macrocli/agent-harness/cli_anything/macrocli/macrocli_cli.py", "status": "added"},
|
||||
{"filename": "macrocli/agent-harness/cli_anything/macrocli/skills/SKILL.md", "status": "added"},
|
||||
{"filename": "macrocli/agent-harness/setup.py", "status": "added"},
|
||||
{"filename": "openclaw-skill/agent-harness/cli_anything/openclaw/openclaw_cli.py", "status": "modified"},
|
||||
{"filename": "registry.json", "status": "modified"},
|
||||
{"filename": "skills/cli-anything-macrocli/SKILL.md", "status": "added"}
|
||||
],
|
||||
"expected": ["cli-anything-hub", "cli-anything-skill", "new-cli"]
|
||||
},
|
||||
{
|
||||
"number": 233,
|
||||
"title": "fix(browser): add MCP timeout guard to prevent fs hangs",
|
||||
"files": [
|
||||
{"filename": "browser/agent-harness/cli_anything/browser/browser_cli.py", "status": "modified"},
|
||||
{"filename": "browser/agent-harness/cli_anything/browser/skills/SKILL.md", "status": "modified"},
|
||||
{"filename": "browser/agent-harness/cli_anything/browser/utils/domshell_backend.py", "status": "modified"},
|
||||
{"filename": "browser/agent-harness/setup.py", "status": "modified"},
|
||||
{"filename": "registry.json", "status": "modified"}
|
||||
],
|
||||
"expected": ["cli-anything-hub", "cli-anything-skill", "existing-cli-fix"]
|
||||
},
|
||||
{
|
||||
"number": 220,
|
||||
"title": "fix(browser): harden bridge and sync REPL template",
|
||||
"files": [
|
||||
{"filename": ".github/workflows/pr-ci.yml", "status": "added"},
|
||||
{"filename": "browser/agent-harness/cli_anything/browser/browser_cli.py", "status": "modified"},
|
||||
{"filename": "browser/agent-harness/cli_anything/browser/utils/repl_skin.py", "status": "modified"},
|
||||
{"filename": "cli-anything-plugin/repl_skin.py", "status": "modified"},
|
||||
{"filename": "gimp/agent-harness/cli_anything/gimp/utils/repl_skin.py", "status": "modified"}
|
||||
],
|
||||
"expected": ["cli-anything-skill", "existing-cli-fix", "github-actions"]
|
||||
},
|
||||
{
|
||||
"number": 218,
|
||||
"title": "fix: Executing cli-anything-browser --json fs ls yields no return result",
|
||||
"files": [
|
||||
{"filename": "browser/agent-harness/cli_anything/browser/tests/test_core.py", "status": "modified"},
|
||||
{"filename": "browser/agent-harness/cli_anything/browser/utils/domshell_backend.py", "status": "modified"}
|
||||
],
|
||||
"expected": ["existing-cli-fix"]
|
||||
},
|
||||
{
|
||||
"number": 202,
|
||||
"title": "security: add user confirmation guard to meta-skill installation flow",
|
||||
"files": [
|
||||
{"filename": "cli-hub-meta-skill/SKILL.md", "status": "modified"},
|
||||
{"filename": "docs/hub/SKILL.md", "status": "modified"}
|
||||
],
|
||||
"expected": ["cli-anything-hub", "cli-anything-skill"]
|
||||
},
|
||||
{
|
||||
"number": 189,
|
||||
"title": "feat: add MiniMax CLI harness (chat + TTS)",
|
||||
"files": [
|
||||
{"filename": ".gitignore", "status": "modified"},
|
||||
{"filename": "minimax/agent-harness/cli_anything/minimax/minimax_cli.py", "status": "added"},
|
||||
{"filename": "minimax/agent-harness/cli_anything/minimax/skills/SKILL.md", "status": "added"},
|
||||
{"filename": "minimax/agent-harness/setup.py", "status": "added"},
|
||||
{"filename": "registry.json", "status": "modified"}
|
||||
],
|
||||
"expected": ["cli-anything-hub", "cli-anything-skill", "new-cli"]
|
||||
},
|
||||
{
|
||||
"number": 187,
|
||||
"title": "Refactor AnyGen CLI for better state management",
|
||||
"files": [
|
||||
{"filename": "anygen/agent-harness/cli_anything/anygen/anygen_cli.py", "status": "modified"}
|
||||
],
|
||||
"expected": ["existing-cli-fix"]
|
||||
},
|
||||
{
|
||||
"number": 167,
|
||||
"title": "feat(freecad): add FreeCAD 1.0.2 backward compatibility",
|
||||
"files": [
|
||||
{"filename": "freecad/agent-harness/FREECAD.md", "status": "modified"},
|
||||
{"filename": "freecad/agent-harness/cli_anything/freecad/core/generate.py", "status": "modified"},
|
||||
{"filename": "freecad/agent-harness/cli_anything/freecad/freecad_cli.py", "status": "modified"},
|
||||
{"filename": "freecad/agent-harness/cli_anything/freecad/skills/SKILL.md", "status": "modified"},
|
||||
{"filename": "registry.json", "status": "modified"}
|
||||
],
|
||||
"expected": ["cli-anything-hub", "cli-anything-skill", "existing-cli-fix"]
|
||||
},
|
||||
{
|
||||
"number": 106,
|
||||
"title": "fix: split token-aware into default exclusions + optional --economic mode",
|
||||
"files": [
|
||||
{"filename": "cli-anything-plugin/HARNESS.md", "status": "modified"},
|
||||
{"filename": "cli-anything-plugin/commands/cli-anything.md", "status": "modified"},
|
||||
{"filename": "cli-anything-plugin/commands/refine.md", "status": "modified"}
|
||||
],
|
||||
"expected": ["cli-anything-skill"]
|
||||
},
|
||||
{
|
||||
"number": "registry-maintenance",
|
||||
"title": "Update registry dates",
|
||||
"files": [
|
||||
{"filename": "registry.json", "status": "modified"}
|
||||
],
|
||||
"expected": ["cli-anything-hub"]
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,208 @@
|
||||
const assert = require("node:assert/strict");
|
||||
const fs = require("node:fs");
|
||||
const path = require("node:path");
|
||||
const test = require("node:test");
|
||||
|
||||
const labeler = require("../pr-labeler.js");
|
||||
const fixtures = require("./pr-labeler-fixtures.json");
|
||||
|
||||
const REPO_ROOT = path.resolve(__dirname, "../../..");
|
||||
const LABELER_CONFIG_PATH = path.join(REPO_ROOT, ".github/labeler.yml");
|
||||
const EXPECTED_LABELS = [
|
||||
"cli-anything-hub",
|
||||
"cli-anything-skill",
|
||||
"documentation",
|
||||
"existing-cli-fix",
|
||||
"github-actions",
|
||||
"new-cli",
|
||||
];
|
||||
|
||||
function normalizeLabels(labels) {
|
||||
return [...labels].sort();
|
||||
}
|
||||
|
||||
function sameLabels(left, right) {
|
||||
return JSON.stringify(left) === JSON.stringify(right);
|
||||
}
|
||||
|
||||
function loadLabelerPatterns() {
|
||||
const patternsByLabel = new Map();
|
||||
let currentLabel = null;
|
||||
|
||||
for (const line of fs.readFileSync(LABELER_CONFIG_PATH, "utf8").split(/\r?\n/)) {
|
||||
const labelMatch = line.match(/^([a-z0-9-]+):$/);
|
||||
if (labelMatch) {
|
||||
currentLabel = labelMatch[1];
|
||||
patternsByLabel.set(currentLabel, []);
|
||||
continue;
|
||||
}
|
||||
|
||||
const patternMatch = line.match(/-\s+"([^"]+)"/);
|
||||
if (currentLabel && patternMatch) {
|
||||
patternsByLabel.get(currentLabel).push(patternMatch[1]);
|
||||
}
|
||||
}
|
||||
|
||||
return patternsByLabel;
|
||||
}
|
||||
|
||||
function globToRegex(pattern) {
|
||||
let regex = "^";
|
||||
|
||||
for (let index = 0; index < pattern.length; index += 1) {
|
||||
const char = pattern[index];
|
||||
const next = pattern[index + 1];
|
||||
const afterNext = pattern[index + 2];
|
||||
|
||||
if (char === "*" && next === "*" && afterNext === "/") {
|
||||
regex += "(?:.*/)?";
|
||||
index += 2;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (char === "*" && next === "*") {
|
||||
regex += ".*";
|
||||
index += 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (char === "*") {
|
||||
regex += "[^/]*";
|
||||
continue;
|
||||
}
|
||||
|
||||
regex += char.replace(/[|\\{}()[\]^$+?.]/g, "\\$&");
|
||||
}
|
||||
|
||||
regex += "$";
|
||||
return new RegExp(regex);
|
||||
}
|
||||
|
||||
function computePathLabels(files) {
|
||||
const labels = new Set();
|
||||
const patternsByLabel = loadLabelerPatterns();
|
||||
|
||||
for (const [label, patterns] of patternsByLabel.entries()) {
|
||||
const regexes = patterns.map(globToRegex);
|
||||
if (files.some((file) => regexes.some((regex) => regex.test(file.filename)))) {
|
||||
labels.add(label);
|
||||
}
|
||||
}
|
||||
|
||||
return labels;
|
||||
}
|
||||
|
||||
function computeAllLabels(sample) {
|
||||
const labels = new Set(labeler.computeScriptLabels(sample.files, sample.title));
|
||||
for (const pathLabel of computePathLabels(sample.files)) {
|
||||
labels.add(pathLabel);
|
||||
}
|
||||
return normalizeLabels(labels);
|
||||
}
|
||||
|
||||
function summarizeMetrics(results) {
|
||||
const labels = new Set(EXPECTED_LABELS);
|
||||
for (const result of results) {
|
||||
for (const label of result.expected) labels.add(label);
|
||||
for (const label of result.predicted) labels.add(label);
|
||||
}
|
||||
|
||||
const perLabel = {};
|
||||
for (const label of labels) {
|
||||
let truePositive = 0;
|
||||
let falsePositive = 0;
|
||||
let falseNegative = 0;
|
||||
|
||||
for (const result of results) {
|
||||
const expected = new Set(result.expected);
|
||||
const predicted = new Set(result.predicted);
|
||||
|
||||
if (expected.has(label) && predicted.has(label)) truePositive += 1;
|
||||
if (!expected.has(label) && predicted.has(label)) falsePositive += 1;
|
||||
if (expected.has(label) && !predicted.has(label)) falseNegative += 1;
|
||||
}
|
||||
|
||||
const precisionDenominator = truePositive + falsePositive;
|
||||
const recallDenominator = truePositive + falseNegative;
|
||||
|
||||
perLabel[label] = {
|
||||
truePositive,
|
||||
falsePositive,
|
||||
falseNegative,
|
||||
precision: precisionDenominator === 0 ? 1 : truePositive / precisionDenominator,
|
||||
recall: recallDenominator === 0 ? 1 : truePositive / recallDenominator,
|
||||
};
|
||||
}
|
||||
|
||||
const exactMatches = results.filter((result) => sameLabels(result.predicted, result.expected)).length;
|
||||
|
||||
return {
|
||||
exactAccuracy: exactMatches / results.length,
|
||||
perLabel,
|
||||
};
|
||||
}
|
||||
|
||||
test("real PR fixture label accuracy and recall", () => {
|
||||
const results = fixtures.map((sample) => ({
|
||||
number: sample.number,
|
||||
title: sample.title,
|
||||
expected: normalizeLabels(sample.expected),
|
||||
predicted: computeAllLabels(sample),
|
||||
}));
|
||||
|
||||
const mismatches = results.filter((result) => {
|
||||
return !sameLabels(result.predicted, result.expected);
|
||||
});
|
||||
|
||||
const metrics = summarizeMetrics(results);
|
||||
|
||||
assert.deepStrictEqual(mismatches, [], JSON.stringify({mismatches, metrics}, null, 2));
|
||||
assert.equal(metrics.exactAccuracy, 1);
|
||||
|
||||
for (const [label, metric] of Object.entries(metrics.perLabel)) {
|
||||
assert.equal(metric.precision, 1, `${label} precision: ${JSON.stringify(metric)}`);
|
||||
assert.equal(metric.recall, 1, `${label} recall: ${JSON.stringify(metric)}`);
|
||||
}
|
||||
});
|
||||
|
||||
test("labeler config and script agree on the supported label set", () => {
|
||||
const configLabels = new Set(loadLabelerPatterns().keys());
|
||||
const scriptLabels = new Set(Object.keys(labeler.LABELS));
|
||||
for (const label of EXPECTED_LABELS) {
|
||||
assert(scriptLabels.has(label), `${label} must be creatable by pr-labeler.js`);
|
||||
}
|
||||
|
||||
assert(configLabels.has("cli-anything-hub"));
|
||||
assert(configLabels.has("cli-anything-skill"));
|
||||
assert(configLabels.has("github-actions"));
|
||||
});
|
||||
|
||||
test("registry-only maintenance is not treated as a new CLI", () => {
|
||||
const labels = computeAllLabels({
|
||||
title: "Update registry dates",
|
||||
files: [{filename: "registry.json", status: "modified"}],
|
||||
});
|
||||
|
||||
assert.deepStrictEqual(labels, ["cli-anything-hub"]);
|
||||
});
|
||||
|
||||
test("mixed README and harness changes are not documentation-only", () => {
|
||||
const labels = computeAllLabels({
|
||||
title: "fix(blender): update docs and render behavior",
|
||||
files: [
|
||||
{filename: "README.md", status: "modified"},
|
||||
{filename: "blender/agent-harness/cli_anything/blender/core/render.py", status: "modified"},
|
||||
],
|
||||
});
|
||||
|
||||
assert.deepStrictEqual(labels, ["existing-cli-fix"]);
|
||||
});
|
||||
|
||||
test("harness README-only changes are documentation", () => {
|
||||
const labels = computeAllLabels({
|
||||
title: "docs(firefly-iii): clarify setup notes",
|
||||
files: [{filename: "firefly-iii/agent-harness/README.md", status: "modified"}],
|
||||
});
|
||||
|
||||
assert.deepStrictEqual(labels, ["documentation"]);
|
||||
});
|
||||
@@ -0,0 +1,83 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import importlib.util
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
SCRIPT_PATH = Path(__file__).resolve().parents[1] / "update_registry_dates.py"
|
||||
SPEC = importlib.util.spec_from_file_location("update_registry_dates", SCRIPT_PATH)
|
||||
MODULE = importlib.util.module_from_spec(SPEC)
|
||||
assert SPEC and SPEC.loader
|
||||
SPEC.loader.exec_module(MODULE)
|
||||
|
||||
|
||||
def test_resolve_harness_path_prefers_install_subdirectory_for_qgis():
|
||||
cli = {
|
||||
"name": "qgis",
|
||||
"install_cmd": "pip install git+https://github.com/HKUDS/CLI-Anything.git#subdirectory=QGIS/agent-harness",
|
||||
"skill_md": "QGIS/agent-harness/cli_anything/qgis/skills/SKILL.md",
|
||||
}
|
||||
|
||||
path = MODULE.resolve_harness_path(cli, MODULE.REPO_ROOT)
|
||||
|
||||
assert path == MODULE.REPO_ROOT / "QGIS" / "agent-harness"
|
||||
|
||||
|
||||
def test_resolve_harness_path_handles_underscore_directory_names():
|
||||
cli = {
|
||||
"name": "unimol_tools",
|
||||
"install_cmd": "pip install git+https://github.com/HKUDS/CLI-Anything.git#subdirectory=unimol_tools/agent-harness",
|
||||
"skill_md": "skills/cli-anything-unimol-tools/SKILL.md",
|
||||
}
|
||||
|
||||
path = MODULE.resolve_harness_path(cli, MODULE.REPO_ROOT)
|
||||
|
||||
assert path == MODULE.REPO_ROOT / "unimol_tools" / "agent-harness"
|
||||
|
||||
|
||||
def test_extract_external_source_url_from_cargo_git_install():
|
||||
cli = {
|
||||
"name": "clibrowser",
|
||||
"install_cmd": "cargo install --git https://github.com/allthingssecurity/clibrowser.git --tag v0.1.0 --locked",
|
||||
"source_url": None,
|
||||
}
|
||||
|
||||
source_url = MODULE.extract_external_source_url(cli)
|
||||
|
||||
assert source_url == "https://github.com/allthingssecurity/clibrowser"
|
||||
|
||||
|
||||
def test_extract_npm_package_supports_scoped_package_names():
|
||||
cli = {
|
||||
"npm_package": "@sentry/cli",
|
||||
"install_cmd": "npm install -g @sentry/cli",
|
||||
}
|
||||
|
||||
assert MODULE._extract_npm_package(cli) == "@sentry/cli"
|
||||
|
||||
|
||||
def test_extract_pypi_package_supports_python_module_invocation():
|
||||
install_cmd = "python -m pip install py4csr"
|
||||
|
||||
assert MODULE._extract_pypi_package(install_cmd) == "py4csr"
|
||||
|
||||
|
||||
def test_extract_pypi_package_skips_index_option_values():
|
||||
install_cmd = (
|
||||
"python -m pip install --index-url https://mirror.example/simple "
|
||||
"--trusted-host mirror.example py4csr"
|
||||
)
|
||||
|
||||
assert MODULE._extract_pypi_package(install_cmd) == "py4csr"
|
||||
|
||||
|
||||
def test_extract_pypi_package_skips_editable_option_value():
|
||||
install_cmd = "pip install -e ./local/pkg py4csr"
|
||||
|
||||
assert MODULE._extract_pypi_package(install_cmd) == "py4csr"
|
||||
|
||||
|
||||
def test_extract_pypi_package_returns_none_for_editable_only_install():
|
||||
install_cmd = "pip install -e ."
|
||||
|
||||
assert MODULE._extract_pypi_package(install_cmd) is None
|
||||
Reference in New Issue
Block a user