@uzysjung/agent-harness 26.180.0 → 26.181.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/README.ko.md CHANGED
@@ -149,7 +149,7 @@ your-project/
149
149
  |---|---|---|---|---|---|
150
150
  | Claude Code | ✓ | ✓ | ✓ | ✓ | ✓ |
151
151
  | Codex | ✓ (`AGENTS.md` 안에 포함) | ✓ | 세션 시작만 | — | — |
152
- | OpenCode | ✓ (`AGENTS.md` 안에 포함) | ✓ | — | — | — |
152
+ | OpenCode | ✓ (`AGENTS.md` 안에 포함. Codex 없이 Antigravity와 함께 깔면, 하네스가 만든 `AGENTS.md`일 때 `opencode.json`을 거쳐 `.agents/rules/`를 읽는다) | ✓ | — | — | — |
153
153
  | Antigravity | ✓ | ✓ | — | — | — |
154
154
 
155
155
  플러그인은 Claude Code에만 있는 기능이라 Claude Code에만 설치된다. 룰과 스킬은 같은 원본에서 만들기 때문에 어느 도구에서나 내용이 같다. 다만 도구가 스스로 막아 줄 수 있는 범위는 도구마다 다르다.
package/README.md CHANGED
@@ -142,7 +142,7 @@ What each tool gets:
142
142
  |---|---|---|---|---|---|
143
143
  | Claude Code | ✓ | ✓ | ✓ | ✓ | ✓ |
144
144
  | Codex | ✓ (in `AGENTS.md`) | ✓ | session start only | — | — |
145
- | OpenCode | ✓ (in `AGENTS.md`) | ✓ | — | — | — |
145
+ | OpenCode | ✓ (in `AGENTS.md`; with Antigravity and no Codex, from `.agents/rules/` via `opencode.json` when the harness created `AGENTS.md`) | ✓ | — | — | — |
146
146
  | Antigravity | ✓ | ✓ | — | — | — |
147
147
 
148
148
  Plugins are a Claude Code feature, so only Claude Code gets them. Rules and skills come from the same source, so they say the same thing in every tool. What a tool can block on its own differs.
@@ -1167,7 +1167,7 @@ import { dirname as dirname3, join as join4 } from "path";
1167
1167
  // package.json
1168
1168
  var package_default = {
1169
1169
  name: "@uzysjung/agent-harness",
1170
- version: "26.180.0",
1170
+ version: "26.181.0",
1171
1171
  description: "Curate vetted AI-coding skills & plugins by your tech stack \u2014 install only what you need, across Claude Code, Codex, OpenCode & Antigravity",
1172
1172
  type: "module",
1173
1173
  publishConfig: {
@@ -2219,9 +2219,10 @@ var TRACK_RULES = {
2219
2219
  data: [],
2220
2220
  executive: [],
2221
2221
  tooling: ["cli-development"],
2222
- // #820 — htmx 룰(#935 부터 셋)은 `full` 에 넣지 않는다. OpenCode 가 섞인 설치는 룰을 AGENTS.md 본문에 인라인하는데, full 의 렌더가
2223
- // Antigravity 상한(24,000 B)을 넘는다(22,322 → 24,455 B, `agents-md-size-budget`). htmx 를 쓰면 그 트랙을 함께 고른다 —
2224
- // #935 실설치 측정: 그 조합도 Antigravity 와 Codex·OpenCode 중 하나를 함께 깔면 상한을 넘는다(full+ssr-htmx · full+ssr-htmx-hono).
2222
+ // #820 — htmx 룰(#935 부터 셋)은 `full` 에 넣지 않는다. Codex 가 섞인 설치는 룰을 AGENTS.md 맨 끝에 인라인하는데(#944 — Codex 없이
2223
+ // OpenCode + Antigravity 면 위치 안내만), full 의 렌더가 Antigravity 상한(24,000 B)을 넘는다(22,322 → 24,455 B,
2224
+ // `agents-md-size-budget`). htmx 를 쓰면 그 트랙을 함께 고른다 — #935 실설치 측정: 그 조합(full+ssr-htmx · full+ssr-htmx-hono)도
2225
+ // Antigravity 와 Codex 를 함께 깔면 상한을 넘는다. #944 부터 그때 잘리는 것은 `.agents/rules/` 에도 있는 룰 사본의 뒷부분뿐이다.
2225
2226
  full: ["cli-development"],
2226
2227
  // v0.5.0 — executive-style baselines (no dev rules; common rules only).
2227
2228
  "project-management": [],
@@ -3244,6 +3245,10 @@ function splitHead(s) {
3244
3245
  return dot === -1 ? [s] : [s.slice(0, dot), s.slice(dot + 1)];
3245
3246
  }
3246
3247
  function parseKey(key) {
3248
+ const element = /^([^[]+)\[=(.*)\]$/s.exec(key);
3249
+ if (element) {
3250
+ return { kind: "element", path: splitHead(element[1] ?? ""), value: element[2] ?? "" };
3251
+ }
3247
3252
  const container = /^(.+?)(\{\}|\[\])$/.exec(key);
3248
3253
  if (container) {
3249
3254
  const inner = parseKey(container[1] ?? "");
@@ -3317,6 +3322,9 @@ function readKey(root, key, claudeDir, sha2) {
3317
3322
  }
3318
3323
  const holder = walk(root, p.path);
3319
3324
  if (p.kind === "container") return holder ?? void 0;
3325
+ if (p.kind === "element") {
3326
+ return Array.isArray(holder) && holder.includes(p.value) ? p.value : void 0;
3327
+ }
3320
3328
  return isObject(holder) ? holder[p.name] : void 0;
3321
3329
  }
3322
3330
  function writeKey(root, key, value, created, claudeDir, sha2) {
@@ -3326,7 +3334,7 @@ function writeKey(root, key, value, created, claudeDir, sha2) {
3326
3334
  const chain = p.path;
3327
3335
  for (const [i, seg] of chain.entries()) {
3328
3336
  const last = i === chain.length - 1;
3329
- const wantArray = last && p.kind === "item";
3337
+ const wantArray = last && (p.kind === "item" || p.kind === "element");
3330
3338
  const existing = cur[seg];
3331
3339
  if (existing === void 0) {
3332
3340
  const fresh = wantArray ? [] : {};
@@ -3337,6 +3345,11 @@ function writeKey(root, key, value, created, claudeDir, sha2) {
3337
3345
  }
3338
3346
  if (!wantArray) cur = cur[seg];
3339
3347
  }
3348
+ if (p.kind === "element") {
3349
+ const arr = walk(root, chain);
3350
+ if (!arr.includes(p.value)) arr.push(p.value);
3351
+ return true;
3352
+ }
3340
3353
  if (p.kind === "item") {
3341
3354
  const at4 = findHandler(root, chain, p.script, claudeDir, sha2);
3342
3355
  if (at4 !== void 0) {
@@ -3362,6 +3375,12 @@ function deleteKey(root, key, claudeDir, ownsGroup = false, sha2) {
3362
3375
  }
3363
3376
  return all2.length > 1;
3364
3377
  }
3378
+ if (p.kind === "element") {
3379
+ const arr = walk(root, p.path);
3380
+ const at4 = Array.isArray(arr) ? arr.indexOf(p.value) : -1;
3381
+ if (Array.isArray(arr) && at4 !== -1) arr.splice(at4, 1);
3382
+ return false;
3383
+ }
3365
3384
  const holderPath = p.kind === "container" ? p.path.slice(0, -1) : p.path;
3366
3385
  const name = p.kind === "container" ? p.path.at(-1) ?? "" : p.name;
3367
3386
  const holder = holderPath.length === 0 ? root : walk(root, holderPath);
@@ -3728,6 +3747,7 @@ var marker = (name) => ({
3728
3747
  });
3729
3748
  var ANCHOR_BLOCK = marker("anchor");
3730
3749
  var SKILLS_BLOCK = marker("skills");
3750
+ var RULES_BLOCK = marker("rules");
3731
3751
  var AGENTS_BLOCK_NAME = "agents";
3732
3752
  var AGENTS_BLOCK = marker(AGENTS_BLOCK_NAME);
3733
3753
  var CONTEXT_SECTION = "Project Context";
@@ -3859,7 +3879,9 @@ function renderAgentsBlock(params) {
3859
3879
  for (const line of rendered.split("\n")) {
3860
3880
  const name = headingName(line, names);
3861
3881
  if (name !== null) keep = name !== CONTEXT_SECTION && name !== RULES_SECTION;
3862
- if (keep) harness.push(line);
3882
+ if (keep && line.trim() !== RULES_BLOCK.start && line.trim() !== RULES_BLOCK.end) {
3883
+ harness.push(line);
3884
+ }
3863
3885
  }
3864
3886
  return [
3865
3887
  [`## ${params.anchorTitle}`, "", ...trimBlankEdges(anchor)],
@@ -3912,22 +3934,37 @@ function mergeAgentsMdDetailed(params) {
3912
3934
  );
3913
3935
  if (extras.length === 0) return { text: merged, droppedLegacySections, editedLegacySections };
3914
3936
  return {
3915
- text: `${merged.replace(/\n+$/, "\n")}${extras.map((e) => e.join("\n")).join("\n")}`.replace(
3916
- /\n+$/,
3917
- "\n"
3918
- ),
3937
+ text: placeBeforeHarnessRules(merged, names, extras),
3919
3938
  droppedLegacySections,
3920
3939
  editedLegacySections
3921
3940
  };
3922
3941
  }
3942
+ function placeBeforeHarnessRules(merged, names, extras) {
3943
+ const lines2 = merged.split("\n");
3944
+ const at4 = lines2.findIndex((l) => headingName(l, names) === HARNESS_RULES_SECTION);
3945
+ if (at4 === -1) {
3946
+ return `${merged.replace(/\n+$/, "\n")}${extras.map((e) => e.join("\n")).join("\n")}`.replace(
3947
+ /\n+$/,
3948
+ "\n"
3949
+ );
3950
+ }
3951
+ const head = trimTrailingBlanks(lines2.slice(0, at4));
3952
+ const block = extras.flatMap((e) => [...e, ""]);
3953
+ return [...head, "", ...block, ...lines2.slice(at4)].join("\n");
3954
+ }
3923
3955
  function headingOwner(bare, ctx) {
3924
3956
  const name = /^## (.+?)\s*$/.exec(bare)?.[1];
3925
3957
  if (name !== void 0 && ctx.names.has(name)) return "harness";
3926
3958
  if (ctx.region === CONTEXT_SECTION || ctx.region === RULES_SECTION) return "body";
3927
- if (ctx.region === HARNESS_RULES_SECTION && ctx.harnessHeadings.has(bare.trim())) {
3928
- return "harness";
3929
- }
3930
- return "installer";
3959
+ if (ctx.region !== HARNESS_RULES_SECTION) return "installer";
3960
+ const at4 = ctx.rulesBlock ?? "none";
3961
+ if (at4 !== "none") return at4 === "inside" ? "harness" : "installer";
3962
+ return ctx.harnessHeadings.has(bare.trim()) ? "harness" : "installer";
3963
+ }
3964
+ function rulesBlockPosition(lines2) {
3965
+ const at4 = blockRange(lines2, RULES_BLOCK);
3966
+ if (at4 === null) return () => "none";
3967
+ return (i) => i > at4[0] && i < at4[1] ? "inside" : "outside";
3931
3968
  }
3932
3969
  function headingLines(body) {
3933
3970
  return new Set(body.filter((l) => /^## /.test(l)).map((l) => l.replace(/\r$/, "").trim()));
@@ -3943,13 +3980,20 @@ function extraTopLevelSections(existing, names, rendered, harnessRuleHeadings, r
3943
3980
  const out = [];
3944
3981
  let current = null;
3945
3982
  let region = null;
3946
- for (const line of existing.split("\n")) {
3983
+ const lines2 = existing.split("\n");
3984
+ const rulesBlock = rulesBlockPosition(lines2);
3985
+ for (const [i, line] of lines2.entries()) {
3947
3986
  const bare = line.replace(/\r$/, "");
3948
3987
  const name = /^## (.+?)\s*$/.exec(bare)?.[1];
3949
3988
  if (name !== void 0) {
3950
3989
  if (current !== null) out.push(current);
3951
3990
  if (names.has(name)) region = name;
3952
- const owner = headingOwner(bare, { region, names, harnessHeadings });
3991
+ const owner = headingOwner(bare, {
3992
+ region,
3993
+ names,
3994
+ harnessHeadings,
3995
+ rulesBlock: rulesBlock(i)
3996
+ });
3953
3997
  const replacedBody = owner === "body" && region === RULES_SECTION && replacedRulesHeadings !== null && !replacedRulesHeadings.has(bare.trim());
3954
3998
  current = owner === "installer" || replacedBody ? [line] : null;
3955
3999
  continue;
@@ -3958,11 +4002,11 @@ function extraTopLevelSections(existing, names, rendered, harnessRuleHeadings, r
3958
4002
  }
3959
4003
  if (current !== null) out.push(current);
3960
4004
  const legacy = out.filter(isLegacyHarnessSection).length;
3961
- const sections = out.filter((lines2) => !isLegacyHarnessSection(lines2)).map((lines2) => {
3962
- const trimmed = [...lines2];
4005
+ const sections = out.filter((lines3) => !isLegacyHarnessSection(lines3)).map((lines3) => {
4006
+ const trimmed = [...lines3];
3963
4007
  while (trimmed.length > 1 && (trimmed.at(-1) ?? "").trim() === "") trimmed.pop();
3964
4008
  return trimmed;
3965
- }).filter((lines2) => lines2.length > 1 || /^## /.test(lines2[0] ?? ""));
4009
+ }).filter((lines3) => lines3.length > 1 || /^## /.test(lines3[0] ?? ""));
3966
4010
  return { sections, legacy };
3967
4011
  }
3968
4012
  function installerLines(body, m) {
@@ -3987,13 +4031,20 @@ function installerSectionsInHarnessArea(existing, names, harnessRuleHeadings, le
3987
4031
  const out = [];
3988
4032
  let current = null;
3989
4033
  let region = null;
3990
- for (const line of existing.split("\n")) {
4034
+ const lines2 = existing.split("\n");
4035
+ const rulesBlock = rulesBlockPosition(lines2);
4036
+ for (const [i, line] of lines2.entries()) {
3991
4037
  const bare = line.replace(/\r$/, "");
3992
4038
  const name = /^## (.+?)\s*$/.exec(bare)?.[1];
3993
4039
  if (name !== void 0) {
3994
4040
  if (current !== null) out.push(current);
3995
4041
  if (names.has(name)) region = name;
3996
- const owner = headingOwner(bare, { region, names, harnessHeadings: harnessRuleHeadings });
4042
+ const owner = headingOwner(bare, {
4043
+ region,
4044
+ names,
4045
+ harnessHeadings: harnessRuleHeadings,
4046
+ rulesBlock: rulesBlock(i)
4047
+ });
3997
4048
  if (!legacyFile) current = owner === "installer" ? { lines: [bare], named: false } : null;
3998
4049
  else if (region === CONTEXT_SECTION) current = null;
3999
4050
  else current = { lines: [bare], named: owner === "harness" };
@@ -4005,16 +4056,16 @@ function installerSectionsInHarnessArea(existing, names, harnessRuleHeadings, le
4005
4056
  const sections = [];
4006
4057
  const keptEdited = [];
4007
4058
  let legacy = 0;
4008
- for (const { lines: lines2, named } of out) {
4009
- if (isLegacyHarnessSection(lines2)) {
4059
+ for (const { lines: lines3, named } of out) {
4060
+ if (isLegacyHarnessSection(lines3)) {
4010
4061
  legacy++;
4011
4062
  continue;
4012
4063
  }
4013
4064
  if (named) {
4014
- if (lines2.slice(1).every((l) => l.trim() === "")) continue;
4015
- keptEdited.push((lines2[0] ?? "").replace(/^## /, "").trim());
4065
+ if (lines3.slice(1).every((l) => l.trim() === "")) continue;
4066
+ keptEdited.push((lines3[0] ?? "").replace(/^## /, "").trim());
4016
4067
  }
4017
- sections.push(trimTrailingBlanks(lines2));
4068
+ sections.push(trimTrailingBlanks(lines3));
4018
4069
  }
4019
4070
  return { sections, legacy, keptEdited };
4020
4071
  }
@@ -5789,8 +5840,10 @@ export {
5789
5840
  legacyInstallLogPath,
5790
5841
  jsonSha,
5791
5842
  isContainerKey,
5843
+ jsonKeys,
5792
5844
  ANCHOR_BLOCK,
5793
5845
  SKILLS_BLOCK,
5846
+ RULES_BLOCK,
5794
5847
  AGENTS_BLOCK_NAME,
5795
5848
  AGENTS_BLOCK,
5796
5849
  wrapHarnessBlock,
@@ -5871,4 +5924,4 @@ smol-toml/dist/index.js:
5871
5924
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
5872
5925
  *)
5873
5926
  */
5874
- //# sourceMappingURL=chunk-NDE7UYUS.js.map
5927
+ //# sourceMappingURL=chunk-MIHX6XYD.js.map