@uzysjung/agent-harness 26.179.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,14 +149,14 @@ 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에만 설치된다. 룰과 스킬은 같은 원본에서 만들기 때문에 어느 도구에서나 내용이 같다. 다만 도구가 스스로 막아 줄 수 있는 범위는 도구마다 다르다.
156
156
 
157
157
  ## 지원하는 스택과 함께 제공하는 스킬
158
158
 
159
- 트랙은 개발 스택이나 업무 종류별로 묶어 둔 시작 구성이다. 표의 위쪽 10개가 개발 트랙, 아래쪽 3개가 업무 트랙이다. 트랙을 고르면 아래 외부 스킬과 도구가 미리 체크된다. 미리 체크되는 것은 모두 공식 저장소이거나, 출처와 인기도, 설치 경로를 확인해 고른 저장소다. 내용의 안전성이나 결과물의 품질까지 보증하지는 않는다([SECURITY.md](SECURITY.md)).
159
+ 트랙은 개발 스택이나 업무 종류별로 묶어 둔 시작 구성이다. 표의 위쪽 11개가 개발 트랙, 아래쪽 3개가 업무 트랙이다. 트랙을 고르면 아래 외부 스킬과 도구가 미리 체크된다. 미리 체크되는 것은 모두 공식 저장소이거나, 출처와 인기도, 설치 경로를 확인해 고른 저장소다. 내용의 안전성이나 결과물의 품질까지 보증하지는 않는다([SECURITY.md](SECURITY.md)).
160
160
 
161
161
  | 트랙 | 스택 | 미리 체크되는 외부 스킬·도구 |
162
162
  |---|---|---|
@@ -167,6 +167,7 @@ your-project/
167
167
  | `ssr-nextjs` | Next.js (App Router) | `frontend-design`, `react-best-practices`, `shadcn-ui` |
168
168
  | `ssr-htmx` | htmx + FastAPI (Python) + daisyUI | `frontend-design` |
169
169
  | `ssr-htmx-fastify` | htmx + Fastify (Node) + daisyUI | `frontend-design` |
170
+ | `ssr-htmx-hono` | htmx + Hono (TypeScript) + daisyUI | `frontend-design` |
170
171
  | `data` | Python 데이터 작업 (DuckDB, PySide6) | `anthropic-data-plugin` |
171
172
  | `tooling` | 앱 스택 없는 Bash·Markdown 프로젝트 | 없음 |
172
173
  | `full` | 개발 트랙 전부와 문서 작업 | 위 항목 전부 + `anthropic-document-skills` |
@@ -174,7 +175,7 @@ your-project/
174
175
  | `project-management` | PM 업무 | 없음 |
175
176
  | `growth-marketing` | 그로스·콘텐츠 마케팅 | 없음 (`marketingskills` 선택 가능) |
176
177
 
177
- MCP 서버도 함께 들어간다. 모든 트랙에 `context7`(최신 라이브러리 문서)가 들어가고, 웹 트랙(`csr-*`, `ssr-*`, `full`)에는 Google 사용 통계를 끈 `chrome-devtools`가 더해진다. `csr-*`·`ssr-htmx`·`ssr-htmx-fastify` 트랙에는 `railway-mcp-server`(Railway 원격 서버 — 처음 쓸 때 로그인한다)가, `csr-supabase`에는 `supabase`(Supabase 원격 서버 — 처음 쓸 때 로그인한다)가 더해진다. `full`은 둘 다 받는다. `ssr-nextjs`에서는 Railway MCP가 기본이 아니고, 직접 고르면 들어간다. Vercel·GitHub 공식 원격 서버(`vercel`, `github-mcp`)는 미리 체크되지 않는다 — `--with`로 더한다. 서버마다 위저드 3단계에 한 줄씩 보이고, 체크를 풀거나 `--without <이름>`(예: `--without context7`)을 주면 `.mcp.json`·Codex·OpenCode 에서 빠진다.
178
+ MCP 서버도 함께 들어간다. 모든 트랙에 `context7`(최신 라이브러리 문서)가 들어가고, 웹 트랙(`csr-*`, `ssr-*`, `full`)에는 Google 사용 통계를 끈 `chrome-devtools`가 더해진다. `csr-*`·`ssr-htmx`·`ssr-htmx-fastify`·`ssr-htmx-hono` 트랙에는 `railway-mcp-server`(Railway 원격 서버 — 처음 쓸 때 로그인한다)가, `csr-supabase`에는 `supabase`(Supabase 원격 서버 — 처음 쓸 때 로그인한다)가 더해진다. `full`은 둘 다 받는다. `ssr-nextjs`에서는 Railway MCP가 기본이 아니고, 직접 고르면 들어간다. Vercel·GitHub 공식 원격 서버(`vercel`, `github-mcp`)는 미리 체크되지 않는다 — `--with`로 더한다. 서버마다 위저드 3단계에 한 줄씩 보이고, 체크를 풀거나 `--without <이름>`(예: `--without context7`)을 주면 `.mcp.json`·Codex·OpenCode 에서 빠진다.
178
179
 
179
180
  미리 체크되지는 않지만 3단계나 `--with <id>`로 더할 수 있는 것도 있다.
180
181
 
package/README.md CHANGED
@@ -142,14 +142,14 @@ 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.
149
149
 
150
150
  ## Supported stacks and the skills that come with them
151
151
 
152
- A track is a starting setup for a dev stack or a kind of work: the top ten rows are dev tracks, the bottom three are work tracks. Picking a track pre-checks the external skills and tools below. Everything pre-checked comes from an official repository, or from one picked after checking its source, popularity, and install path. That does not vouch for the safety of its contents or the quality of what it produces ([SECURITY.md](SECURITY.md)).
152
+ A track is a starting setup for a dev stack or a kind of work: the top eleven rows are dev tracks, the bottom three are work tracks. Picking a track pre-checks the external skills and tools below. Everything pre-checked comes from an official repository, or from one picked after checking its source, popularity, and install path. That does not vouch for the safety of its contents or the quality of what it produces ([SECURITY.md](SECURITY.md)).
153
153
 
154
154
  | Track | Stack | Pre-checked external skills and tools |
155
155
  |---|---|---|
@@ -160,6 +160,7 @@ A track is a starting setup for a dev stack or a kind of work: the top ten rows
160
160
  | `ssr-nextjs` | Next.js (App Router) | `frontend-design`, `react-best-practices`, `shadcn-ui` |
161
161
  | `ssr-htmx` | htmx + FastAPI (Python) + daisyUI | `frontend-design` |
162
162
  | `ssr-htmx-fastify` | htmx + Fastify (Node) + daisyUI | `frontend-design` |
163
+ | `ssr-htmx-hono` | htmx + Hono (TypeScript) + daisyUI | `frontend-design` |
163
164
  | `data` | Python data work (DuckDB, PySide6) | `anthropic-data-plugin` |
164
165
  | `tooling` | Bash and Markdown projects with no app stack | None |
165
166
  | `full` | Every dev track, plus documents | All of the above, plus `anthropic-document-skills` |
@@ -167,7 +168,7 @@ A track is a starting setup for a dev stack or a kind of work: the top ten rows
167
168
  | `project-management` | PM work | None |
168
169
  | `growth-marketing` | Growth and content marketing | None (`marketingskills` available) |
169
170
 
170
- MCP servers come too. Every track gets `context7` (current library docs). Web tracks (`csr-*`, `ssr-*`, `full`) add `chrome-devtools`, with Google's usage statistics turned off. The `csr-*`, `ssr-htmx` and `ssr-htmx-fastify` tracks add `railway-mcp-server` (Railway's remote server — you sign in on first use), and `csr-supabase` adds `supabase` (Supabase's remote server — you sign in on first use). `full` gets both. On `ssr-nextjs`, Railway MCP is not a default; pick it if you want it. Vercel's and GitHub's official remote servers (`vercel`, `github-mcp`) are never pre-checked — add them with `--with`. Each server is a row in step 3 of the wizard: uncheck it or pass `--without <name>` (e.g. `--without context7`) to leave it out of `.mcp.json`, Codex and OpenCode.
171
+ MCP servers come too. Every track gets `context7` (current library docs). Web tracks (`csr-*`, `ssr-*`, `full`) add `chrome-devtools`, with Google's usage statistics turned off. The `csr-*`, `ssr-htmx`, `ssr-htmx-fastify` and `ssr-htmx-hono` tracks add `railway-mcp-server` (Railway's remote server — you sign in on first use), and `csr-supabase` adds `supabase` (Supabase's remote server — you sign in on first use). `full` gets both. On `ssr-nextjs`, Railway MCP is not a default; pick it if you want it. Vercel's and GitHub's official remote servers (`vercel`, `github-mcp`) are never pre-checked — add them with `--with`. Each server is a row in step 3 of the wizard: uncheck it or pass `--without <name>` (e.g. `--without context7`) to leave it out of `.mcp.json`, Codex and OpenCode.
171
172
 
172
173
  More external assets are never pre-checked but can be added at step 3 or with `--with <id>`:
173
174
 
@@ -58,6 +58,8 @@ var TRACKS = [
58
58
  "ssr-htmx",
59
59
  // #820 — htmx 의 Node 백엔드. `ssr-htmx`(FastAPI) 의 id 는 설치 기록이 갖고 있어 그대로 두고 옆에 더했다.
60
60
  "ssr-htmx-fastify",
61
+ // #935 — htmx 의 두 번째 TypeScript 백엔드(Hono + hono/jsx). 이스케이프 기본값·테스트 도구가 Fastify 와 달라 룰을 따로 둔다.
62
+ "ssr-htmx-hono",
61
63
  "ssr-nextjs",
62
64
  "data",
63
65
  "executive",
@@ -459,7 +461,7 @@ var EXTERNAL_ASSETS = [
459
461
  }
460
462
  },
461
463
  // #709 (ADR-101) — Railway MCP 서버의 **선택** 경로. 서버 정의는 트랙 표(`templates/track-mcp-map.tsv`)의 같은 이름
462
- // 행 하나다(key === 행 이름). 그 행의 패턴이 기본 트랙(csr-* · ssr-htmx · ssr-htmx-fastify · full)을 정하고, 이 항목은 그 밖의 트랙
464
+ // 행 하나다(key === 행 이름). 그 행의 패턴이 기본 트랙(csr-* · ssr-htmx · ssr-htmx-fastify · ssr-htmx-hono · full)을 정하고, 이 항목은 그 밖의 트랙
463
465
  // (ssr-nextjs 등)에서 위저드 체크 · `--with` 로 고르게 한다. experimental 이라 조건으로는 미리 체크되지 않는다.
464
466
  // #712 (ADR-106) — 행이 Railway 공식 원격 서버(`https://mcp.railway.com`, OAuth)로 바뀌었다. 이름 · 키 id 는 그대로라 기록이
465
467
  // 이어져 update 가 같은 키를 갈아 끼운다.
@@ -467,7 +469,7 @@ var EXTERNAL_ASSETS = [
467
469
  id: "railway-mcp-server",
468
470
  tier: "experimental",
469
471
  // railwayapp/cli 621★ (원격 서버에 공개 저장소가 따로 없다 — 같은 벤더의 CLI 를 감시, REPO_OVERRIDE)
470
- description: "Railway's official remote MCP (https://mcp.railway.com, signs in with OAuth on first use) in .mcp.json, Codex and OpenCode \u2014 default on csr-* \xB7 ssr-htmx \xB7 ssr-htmx-fastify \xB7 full; check it to add it on any other track",
472
+ description: "Railway's official remote MCP (https://mcp.railway.com, signs in with OAuth on first use) in .mcp.json, Codex and OpenCode \u2014 default on csr-* \xB7 ssr-htmx \xB7 ssr-htmx-fastify \xB7 ssr-htmx-hono \xB7 full; check it to add it on any other track",
471
473
  category: "backend",
472
474
  source: "railwayapp",
473
475
  condition: { kind: "opt-in" },
@@ -1165,7 +1167,7 @@ import { dirname as dirname3, join as join4 } from "path";
1165
1167
  // package.json
1166
1168
  var package_default = {
1167
1169
  name: "@uzysjung/agent-harness",
1168
- version: "26.179.0",
1170
+ version: "26.181.0",
1169
1171
  description: "Curate vetted AI-coding skills & plugins by your tech stack \u2014 install only what you need, across Claude Code, Codex, OpenCode & Antigravity",
1170
1172
  type: "module",
1171
1173
  publishConfig: {
@@ -2211,12 +2213,16 @@ var TRACK_RULES = {
2211
2213
  // 달라 린트가 갈린다(Jinja = ast-grep · 서버 JSX = @shadcn/lint) — 실측 = `docs/plans/820-spike/`. `full` 은 아래.
2212
2214
  "ssr-htmx": ["htmx-fastapi-ui"],
2213
2215
  "ssr-htmx-fastify": ["htmx-fastify-ui"],
2216
+ // #935 — 같은 서버 JSX 라도 Hono 는 자식을 기본으로 이스케이프하고(@kitajs/html 은 반대) 테스트 도구가 따로 있다.
2217
+ "ssr-htmx-hono": ["htmx-hono-ui"],
2214
2218
  "ssr-nextjs": [],
2215
2219
  data: [],
2216
2220
  executive: [],
2217
2221
  tooling: ["cli-development"],
2218
- // #820 — htmx 룰 둘은 `full` 에 넣지 않는다. OpenCode 가 섞인 설치는 룰을 AGENTS.md 본문에 인라인하는데, full 의 렌더가
2219
- // Antigravity 상한(24,000 B)을 넘는다(22,322 → 24,455 B, `agents-md-size-budget`). htmx 를 쓰면 그 트랙을 함께 고른다.
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/` 에도 있는 룰 사본의 뒷부분뿐이다.
2220
2226
  full: ["cli-development"],
2221
2227
  // v0.5.0 — executive-style baselines (no dev rules; common rules only).
2222
2228
  "project-management": [],
@@ -3239,6 +3245,10 @@ function splitHead(s) {
3239
3245
  return dot === -1 ? [s] : [s.slice(0, dot), s.slice(dot + 1)];
3240
3246
  }
3241
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
+ }
3242
3252
  const container = /^(.+?)(\{\}|\[\])$/.exec(key);
3243
3253
  if (container) {
3244
3254
  const inner = parseKey(container[1] ?? "");
@@ -3312,6 +3322,9 @@ function readKey(root, key, claudeDir, sha2) {
3312
3322
  }
3313
3323
  const holder = walk(root, p.path);
3314
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
+ }
3315
3328
  return isObject(holder) ? holder[p.name] : void 0;
3316
3329
  }
3317
3330
  function writeKey(root, key, value, created, claudeDir, sha2) {
@@ -3321,7 +3334,7 @@ function writeKey(root, key, value, created, claudeDir, sha2) {
3321
3334
  const chain = p.path;
3322
3335
  for (const [i, seg] of chain.entries()) {
3323
3336
  const last = i === chain.length - 1;
3324
- const wantArray = last && p.kind === "item";
3337
+ const wantArray = last && (p.kind === "item" || p.kind === "element");
3325
3338
  const existing = cur[seg];
3326
3339
  if (existing === void 0) {
3327
3340
  const fresh = wantArray ? [] : {};
@@ -3332,6 +3345,11 @@ function writeKey(root, key, value, created, claudeDir, sha2) {
3332
3345
  }
3333
3346
  if (!wantArray) cur = cur[seg];
3334
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
+ }
3335
3353
  if (p.kind === "item") {
3336
3354
  const at4 = findHandler(root, chain, p.script, claudeDir, sha2);
3337
3355
  if (at4 !== void 0) {
@@ -3357,6 +3375,12 @@ function deleteKey(root, key, claudeDir, ownsGroup = false, sha2) {
3357
3375
  }
3358
3376
  return all2.length > 1;
3359
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
+ }
3360
3384
  const holderPath = p.kind === "container" ? p.path.slice(0, -1) : p.path;
3361
3385
  const name = p.kind === "container" ? p.path.at(-1) ?? "" : p.name;
3362
3386
  const holder = holderPath.length === 0 ? root : walk(root, holderPath);
@@ -3723,6 +3747,7 @@ var marker = (name) => ({
3723
3747
  });
3724
3748
  var ANCHOR_BLOCK = marker("anchor");
3725
3749
  var SKILLS_BLOCK = marker("skills");
3750
+ var RULES_BLOCK = marker("rules");
3726
3751
  var AGENTS_BLOCK_NAME = "agents";
3727
3752
  var AGENTS_BLOCK = marker(AGENTS_BLOCK_NAME);
3728
3753
  var CONTEXT_SECTION = "Project Context";
@@ -3854,7 +3879,9 @@ function renderAgentsBlock(params) {
3854
3879
  for (const line of rendered.split("\n")) {
3855
3880
  const name = headingName(line, names);
3856
3881
  if (name !== null) keep = name !== CONTEXT_SECTION && name !== RULES_SECTION;
3857
- if (keep) harness.push(line);
3882
+ if (keep && line.trim() !== RULES_BLOCK.start && line.trim() !== RULES_BLOCK.end) {
3883
+ harness.push(line);
3884
+ }
3858
3885
  }
3859
3886
  return [
3860
3887
  [`## ${params.anchorTitle}`, "", ...trimBlankEdges(anchor)],
@@ -3907,22 +3934,37 @@ function mergeAgentsMdDetailed(params) {
3907
3934
  );
3908
3935
  if (extras.length === 0) return { text: merged, droppedLegacySections, editedLegacySections };
3909
3936
  return {
3910
- text: `${merged.replace(/\n+$/, "\n")}${extras.map((e) => e.join("\n")).join("\n")}`.replace(
3911
- /\n+$/,
3912
- "\n"
3913
- ),
3937
+ text: placeBeforeHarnessRules(merged, names, extras),
3914
3938
  droppedLegacySections,
3915
3939
  editedLegacySections
3916
3940
  };
3917
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
+ }
3918
3955
  function headingOwner(bare, ctx) {
3919
3956
  const name = /^## (.+?)\s*$/.exec(bare)?.[1];
3920
3957
  if (name !== void 0 && ctx.names.has(name)) return "harness";
3921
3958
  if (ctx.region === CONTEXT_SECTION || ctx.region === RULES_SECTION) return "body";
3922
- if (ctx.region === HARNESS_RULES_SECTION && ctx.harnessHeadings.has(bare.trim())) {
3923
- return "harness";
3924
- }
3925
- 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";
3926
3968
  }
3927
3969
  function headingLines(body) {
3928
3970
  return new Set(body.filter((l) => /^## /.test(l)).map((l) => l.replace(/\r$/, "").trim()));
@@ -3938,13 +3980,20 @@ function extraTopLevelSections(existing, names, rendered, harnessRuleHeadings, r
3938
3980
  const out = [];
3939
3981
  let current = null;
3940
3982
  let region = null;
3941
- 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()) {
3942
3986
  const bare = line.replace(/\r$/, "");
3943
3987
  const name = /^## (.+?)\s*$/.exec(bare)?.[1];
3944
3988
  if (name !== void 0) {
3945
3989
  if (current !== null) out.push(current);
3946
3990
  if (names.has(name)) region = name;
3947
- const owner = headingOwner(bare, { region, names, harnessHeadings });
3991
+ const owner = headingOwner(bare, {
3992
+ region,
3993
+ names,
3994
+ harnessHeadings,
3995
+ rulesBlock: rulesBlock(i)
3996
+ });
3948
3997
  const replacedBody = owner === "body" && region === RULES_SECTION && replacedRulesHeadings !== null && !replacedRulesHeadings.has(bare.trim());
3949
3998
  current = owner === "installer" || replacedBody ? [line] : null;
3950
3999
  continue;
@@ -3953,11 +4002,11 @@ function extraTopLevelSections(existing, names, rendered, harnessRuleHeadings, r
3953
4002
  }
3954
4003
  if (current !== null) out.push(current);
3955
4004
  const legacy = out.filter(isLegacyHarnessSection).length;
3956
- const sections = out.filter((lines2) => !isLegacyHarnessSection(lines2)).map((lines2) => {
3957
- const trimmed = [...lines2];
4005
+ const sections = out.filter((lines3) => !isLegacyHarnessSection(lines3)).map((lines3) => {
4006
+ const trimmed = [...lines3];
3958
4007
  while (trimmed.length > 1 && (trimmed.at(-1) ?? "").trim() === "") trimmed.pop();
3959
4008
  return trimmed;
3960
- }).filter((lines2) => lines2.length > 1 || /^## /.test(lines2[0] ?? ""));
4009
+ }).filter((lines3) => lines3.length > 1 || /^## /.test(lines3[0] ?? ""));
3961
4010
  return { sections, legacy };
3962
4011
  }
3963
4012
  function installerLines(body, m) {
@@ -3982,13 +4031,20 @@ function installerSectionsInHarnessArea(existing, names, harnessRuleHeadings, le
3982
4031
  const out = [];
3983
4032
  let current = null;
3984
4033
  let region = null;
3985
- 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()) {
3986
4037
  const bare = line.replace(/\r$/, "");
3987
4038
  const name = /^## (.+?)\s*$/.exec(bare)?.[1];
3988
4039
  if (name !== void 0) {
3989
4040
  if (current !== null) out.push(current);
3990
4041
  if (names.has(name)) region = name;
3991
- 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
+ });
3992
4048
  if (!legacyFile) current = owner === "installer" ? { lines: [bare], named: false } : null;
3993
4049
  else if (region === CONTEXT_SECTION) current = null;
3994
4050
  else current = { lines: [bare], named: owner === "harness" };
@@ -4000,16 +4056,16 @@ function installerSectionsInHarnessArea(existing, names, harnessRuleHeadings, le
4000
4056
  const sections = [];
4001
4057
  const keptEdited = [];
4002
4058
  let legacy = 0;
4003
- for (const { lines: lines2, named } of out) {
4004
- if (isLegacyHarnessSection(lines2)) {
4059
+ for (const { lines: lines3, named } of out) {
4060
+ if (isLegacyHarnessSection(lines3)) {
4005
4061
  legacy++;
4006
4062
  continue;
4007
4063
  }
4008
4064
  if (named) {
4009
- if (lines2.slice(1).every((l) => l.trim() === "")) continue;
4010
- keptEdited.push((lines2[0] ?? "").replace(/^## /, "").trim());
4065
+ if (lines3.slice(1).every((l) => l.trim() === "")) continue;
4066
+ keptEdited.push((lines3[0] ?? "").replace(/^## /, "").trim());
4011
4067
  }
4012
- sections.push(trimTrailingBlanks(lines2));
4068
+ sections.push(trimTrailingBlanks(lines3));
4013
4069
  }
4014
4070
  return { sections, legacy, keptEdited };
4015
4071
  }
@@ -5784,8 +5840,10 @@ export {
5784
5840
  legacyInstallLogPath,
5785
5841
  jsonSha,
5786
5842
  isContainerKey,
5843
+ jsonKeys,
5787
5844
  ANCHOR_BLOCK,
5788
5845
  SKILLS_BLOCK,
5846
+ RULES_BLOCK,
5789
5847
  AGENTS_BLOCK_NAME,
5790
5848
  AGENTS_BLOCK,
5791
5849
  wrapHarnessBlock,
@@ -5866,4 +5924,4 @@ smol-toml/dist/index.js:
5866
5924
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
5867
5925
  *)
5868
5926
  */
5869
- //# sourceMappingURL=chunk-LRPCXEUU.js.map
5927
+ //# sourceMappingURL=chunk-MIHX6XYD.js.map