@uzysjung/agent-harness 26.164.0 → 26.165.0
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.
- package/dist/{chunk-X7NSQHXL.js → chunk-QHBJ7PMU.js} +77 -12
- package/dist/{chunk-X7NSQHXL.js.map → chunk-QHBJ7PMU.js.map} +1 -1
- package/dist/index.js +1231 -733
- package/dist/index.js.map +1 -1
- package/dist/trust-tier-drift.js +1 -1
- package/package.json +1 -1
- package/templates/{antigravity/AGENTS.md.template → AGENTS.md.template} +14 -2
- package/templates/codex/README.md +6 -5
- package/templates/codex/config.toml.template +0 -11
- package/templates/opencode/README.md +1 -2
- package/templates/codex/AGENTS.md.template +0 -31
- package/templates/opencode/AGENTS.md.template +0 -23
|
@@ -1029,7 +1029,7 @@ import { dirname as dirname3, join as join4 } from "path";
|
|
|
1029
1029
|
// package.json
|
|
1030
1030
|
var package_default = {
|
|
1031
1031
|
name: "@uzysjung/agent-harness",
|
|
1032
|
-
version: "26.
|
|
1032
|
+
version: "26.165.0",
|
|
1033
1033
|
description: "Curate vetted AI-coding skills & plugins by your tech stack \u2014 install only what you need, across Claude Code, Codex, OpenCode & Antigravity",
|
|
1034
1034
|
type: "module",
|
|
1035
1035
|
publishConfig: {
|
|
@@ -1118,6 +1118,12 @@ var CLI_BASE_SORT_ORDER = {
|
|
|
1118
1118
|
opencode: 2,
|
|
1119
1119
|
antigravity: 3
|
|
1120
1120
|
};
|
|
1121
|
+
var CLI_DISPLAY_NAMES = {
|
|
1122
|
+
claude: "Claude",
|
|
1123
|
+
codex: "Codex",
|
|
1124
|
+
opencode: "OpenCode",
|
|
1125
|
+
antigravity: "Antigravity"
|
|
1126
|
+
};
|
|
1121
1127
|
function parseCliTargets(input) {
|
|
1122
1128
|
const items = normalizeInput(input);
|
|
1123
1129
|
if (items.length === 0) {
|
|
@@ -1900,7 +1906,7 @@ var FILL_SPECS = {
|
|
|
1900
1906
|
},
|
|
1901
1907
|
"installed-assets": {
|
|
1902
1908
|
title: "Installed Harness Assets",
|
|
1903
|
-
prompt: "List the harness assets installed in this project (rules / skills / agents / commands) and add one line each on when to reach for it here. Verify against .claude/rules
|
|
1909
|
+
prompt: "List the harness assets installed in this project (rules / skills / agents / commands) and add one line each on when to reach for it here. Verify against the harness folders this CLI reads (.claude/rules/ \xB7 .claude/skills/ \xB7 .claude/agents/ for Claude Code; AGENTS.md \xA7 Harness Rules \xB7 .agents/skills/ for Codex and OpenCode; .agents/rules/ \xB7 .agents/skills/ for Antigravity) and list ONLY assets whose file exists on disk \u2014 do not invent any. Do NOT restate the harness's working principles (they live in this project's harness anchor and rules layer) \u2014 cross-reference them instead. Delete this comment when done.",
|
|
1904
1910
|
placeholder: "the installed rules/skills/agents/commands and when to use each"
|
|
1905
1911
|
},
|
|
1906
1912
|
boundaries: {
|
|
@@ -1918,8 +1924,7 @@ function anchorLine(surface) {
|
|
|
1918
1924
|
if (surface === "claude") {
|
|
1919
1925
|
return `> The working principles live in this project's harness anchor \`${HARNESS_ANCHOR_FILE}\`, imported at the bottom of this file. Everything above that import is **project-specific context only**.`;
|
|
1920
1926
|
}
|
|
1921
|
-
|
|
1922
|
-
return `> **This file (${self}) is the harness anchor** \u2014 it carries the working principles in full, further down. Only the \`## \u2026\` sections immediately below are project-specific context for you to fill in.`;
|
|
1927
|
+
return `> **This file (\`AGENTS.md\`) is the harness anchor** \u2014 it carries the working principles in full, further down. Only the \`## \u2026\` sections immediately below are project-specific context for you to fill in.`;
|
|
1923
1928
|
}
|
|
1924
1929
|
function scaffoldBanner(surface) {
|
|
1925
1930
|
return [
|
|
@@ -1941,6 +1946,61 @@ _(not filled yet \u2014 ${spec.placeholder})_`;
|
|
|
1941
1946
|
|
|
1942
1947
|
${blocks.join("\n\n")}`;
|
|
1943
1948
|
}
|
|
1949
|
+
var SCAFFOLD_MARK = "SCAFFOLD \u2014 not filled in yet";
|
|
1950
|
+
var TRACK_NOTE_MARK = "Active track(s):";
|
|
1951
|
+
function dropHarnessQuoteBlocks(lines) {
|
|
1952
|
+
const out = [];
|
|
1953
|
+
let i = 0;
|
|
1954
|
+
while (i < lines.length) {
|
|
1955
|
+
if (!(lines[i] ?? "").trim().startsWith(">")) {
|
|
1956
|
+
out.push(lines[i] ?? "");
|
|
1957
|
+
i += 1;
|
|
1958
|
+
continue;
|
|
1959
|
+
}
|
|
1960
|
+
let end = i;
|
|
1961
|
+
while (end < lines.length && (lines[end] ?? "").trim().startsWith(">")) end++;
|
|
1962
|
+
const run = lines.slice(i, end);
|
|
1963
|
+
const text = run.join("\n");
|
|
1964
|
+
if (!text.includes(SCAFFOLD_MARK) && !text.includes(TRACK_NOTE_MARK)) out.push(...run);
|
|
1965
|
+
i = end;
|
|
1966
|
+
}
|
|
1967
|
+
return out;
|
|
1968
|
+
}
|
|
1969
|
+
function continuousNoteEnd(lines, headingAt) {
|
|
1970
|
+
let i = headingAt + 1;
|
|
1971
|
+
while (i < lines.length) {
|
|
1972
|
+
const l = (lines[i] ?? "").replace(/\r$/, "").trim();
|
|
1973
|
+
const isNote = l === "" || l.startsWith("- `") || l.startsWith("These installed skills apply");
|
|
1974
|
+
if (!isNote) break;
|
|
1975
|
+
i++;
|
|
1976
|
+
}
|
|
1977
|
+
return i;
|
|
1978
|
+
}
|
|
1979
|
+
function dropContinuousSkillsNote(lines) {
|
|
1980
|
+
const at = lines.findIndex((l) => l.replace(/\r$/, "").trim() === CONTINUOUS_SKILLS_HEADING);
|
|
1981
|
+
if (at === -1) return [...lines];
|
|
1982
|
+
return [...lines.slice(0, at), ...lines.slice(continuousNoteEnd(lines, at))];
|
|
1983
|
+
}
|
|
1984
|
+
function dropFillComments(lines) {
|
|
1985
|
+
const out = [];
|
|
1986
|
+
let inFill = false;
|
|
1987
|
+
for (const line of lines) {
|
|
1988
|
+
if (!inFill && line.trim().startsWith("<!-- FILL:")) inFill = true;
|
|
1989
|
+
if (inFill) {
|
|
1990
|
+
if (line.includes("-->")) inFill = false;
|
|
1991
|
+
continue;
|
|
1992
|
+
}
|
|
1993
|
+
out.push(line);
|
|
1994
|
+
}
|
|
1995
|
+
return out;
|
|
1996
|
+
}
|
|
1997
|
+
function scaffoldComparable(lines) {
|
|
1998
|
+
return dropFillComments(dropContinuousSkillsNote(dropHarnessQuoteBlocks(lines))).map((l) => l.replace(/\r$/, "").trimEnd()).filter((l) => l.trim() !== "");
|
|
1999
|
+
}
|
|
2000
|
+
function isUnfilledScaffold(body) {
|
|
2001
|
+
const pristine = scaffoldComparable(renderFillScaffold("agents-md").split("\n"));
|
|
2002
|
+
return scaffoldComparable(body).join("\n") === pristine.join("\n");
|
|
2003
|
+
}
|
|
1944
2004
|
function mergeProjectClaude(opts) {
|
|
1945
2005
|
const expanded = expandTracks(opts.tracks);
|
|
1946
2006
|
const trackList = expanded.map((t) => TRACK_DISPLAY_NAMES[t]).join(", ");
|
|
@@ -2326,10 +2386,7 @@ function anchorSurface(cli) {
|
|
|
2326
2386
|
if (cli.includes("claude") || cli.length === 0) {
|
|
2327
2387
|
return { label: "CLAUDE.md", files: 2, scaffold: "claude" };
|
|
2328
2388
|
}
|
|
2329
|
-
|
|
2330
|
-
return { label: "AGENTS.md", files: 1, scaffold: "agents-md" };
|
|
2331
|
-
}
|
|
2332
|
-
return { label: ".agents/rules/uzys-harness.md", files: 1, scaffold: "antigravity-rule" };
|
|
2389
|
+
return { label: "AGENTS.md", files: 1, scaffold: "agents-md" };
|
|
2333
2390
|
}
|
|
2334
2391
|
function residentCost(entries, root = resolveBundleRoot(), cli = ["claude"], contextFiles) {
|
|
2335
2392
|
const tpl = (source) => join5(root, "templates", source);
|
|
@@ -2364,7 +2421,7 @@ function residentCost(entries, root = resolveBundleRoot(), cli = ["claude"], con
|
|
|
2364
2421
|
CONTINUOUS_SKILLS.map((s) => s.id)
|
|
2365
2422
|
).trim().length
|
|
2366
2423
|
);
|
|
2367
|
-
const onDisk = contextFiles?.map(fileTokens).filter((t) => t > 0);
|
|
2424
|
+
const onDisk = contextFiles?.map((f) => typeof f === "string" ? fileTokens(f) : estimateTokens(f.text.trim().length)).filter((t) => t > 0);
|
|
2368
2425
|
const projectClaudeMd = onDisk === void 0 ? harnessAnchor + projectScaffold : onDisk.reduce((a, b) => a + b, 0);
|
|
2369
2426
|
const claudeMdItems = onDisk !== void 0 ? onDisk.length : surface.files === 1 ? 1 : (harnessAnchor > 0 ? 1 : 0) + (projectScaffold > 0 ? 1 : 0);
|
|
2370
2427
|
return makeResidentCost({
|
|
@@ -2399,9 +2456,11 @@ function summarizeContextCost(assetIds, root = resolveBundleRoot()) {
|
|
|
2399
2456
|
}
|
|
2400
2457
|
function formatResidentCostLine(r, unmeasuredCount) {
|
|
2401
2458
|
if (r.total === 0) return null;
|
|
2459
|
+
const rules = r.rulesInline ? `rules ${r.items.rules} inside ${r.contextFile}${r.rulesInline === "planned" ? " (planned count)" : ""}` : `rules ${r.items.rules} ~${r.rules}`;
|
|
2460
|
+
const note = r.contextNote ? ` ${r.contextNote}` : "";
|
|
2402
2461
|
const parts = [
|
|
2403
2462
|
`directives ${r.directive.items} ~${r.directive.tokens}`,
|
|
2404
|
-
`[
|
|
2463
|
+
`[${rules} \xB7 ${r.contextFile} ${r.items.claudeMd} ~${r.projectClaudeMd}${note}]`,
|
|
2405
2464
|
`triggers ${r.firing.items} ~${r.firing.tokens}`,
|
|
2406
2465
|
`[skills ${r.items.skills} ~${r.skillDescriptors} \xB7 agents ${r.items.agents} ~${r.agentDescriptors}]`
|
|
2407
2466
|
].join(" \xB7 ");
|
|
@@ -2503,6 +2562,7 @@ export {
|
|
|
2503
2562
|
DEFAULT_OPTIONS,
|
|
2504
2563
|
UPDATE_GROUPS,
|
|
2505
2564
|
CLI_BASE_SORT_ORDER,
|
|
2565
|
+
CLI_DISPLAY_NAMES,
|
|
2506
2566
|
parseCliTargets,
|
|
2507
2567
|
targetsInclude,
|
|
2508
2568
|
anyTrack,
|
|
@@ -2540,9 +2600,12 @@ export {
|
|
|
2540
2600
|
HARNESS_IMPORT_LINE,
|
|
2541
2601
|
CONTINUOUS_SKILLS_HEADING,
|
|
2542
2602
|
renderContinuousSkillsNote,
|
|
2543
|
-
withContinuousSkillsNote,
|
|
2544
2603
|
scaffoldBanner,
|
|
2545
2604
|
renderFillScaffold,
|
|
2605
|
+
dropHarnessQuoteBlocks,
|
|
2606
|
+
continuousNoteEnd,
|
|
2607
|
+
dropContinuousSkillsNote,
|
|
2608
|
+
isUnfilledScaffold,
|
|
2546
2609
|
upsertHarnessImport,
|
|
2547
2610
|
stripHarnessImport,
|
|
2548
2611
|
buildAssetSpec,
|
|
@@ -2582,6 +2645,8 @@ export {
|
|
|
2582
2645
|
resolveBundleRoot,
|
|
2583
2646
|
extractFrontmatter,
|
|
2584
2647
|
assetCostRows,
|
|
2648
|
+
makeResidentCost,
|
|
2649
|
+
anchorSurface,
|
|
2585
2650
|
residentCost,
|
|
2586
2651
|
summarizeContextCost,
|
|
2587
2652
|
formatResidentCostLine,
|
|
@@ -2589,4 +2654,4 @@ export {
|
|
|
2589
2654
|
CATEGORIES,
|
|
2590
2655
|
CATEGORY_TITLES
|
|
2591
2656
|
};
|
|
2592
|
-
//# sourceMappingURL=chunk-
|
|
2657
|
+
//# sourceMappingURL=chunk-QHBJ7PMU.js.map
|