AGENTS.md
packages/hashline-core/AGENTS.mdAGENTS.md
Quality
48/100
Scores the file, not the repository.Length
288 words
5 headings · 0 code blocksRepository
67k
— · pushed 0 days agoLast changed
2 days ago
First indexed 2 days ago.1# hashline-core — Hash-Anchored Edit Primitives (Core)23**Generated:** 2026-06-1745## OVERVIEW67The engine behind the Hashline edit tool (inspired by [oh-my-pi](https://github.com/can1357/oh-my-pi)). Tags every line with a `LINE#HASH|` content hash, validates edit refs against current content (rejecting stale lines), then applies structured `replace`/`append`/`prepend` edits with autocorrection, deduplication, and unified-diff generation. Package: `@oh-my-opencode/hashline-core`.89## PUBLIC API (`src/index.ts`, ~26 fns + 7 types) — by area1011| Area | Files | Key exports |12|------|-------|-------------|13| **Hash compute** | `hash-computation.ts`, `xxhash32.ts`, `constants.ts` | `computeLineHash`, `computeLegacyLineHash`, `formatHashLine(s)`, `streamHashLinesFrom{Utf8,Lines}`, `NIBBLE_STR`, `HASHLINE_DICT` |14| **Validation** | `validation.ts` | `parseLineRef`, `validateLineRef(s)`, `normalizeLineRef`, `HashlineMismatchError` |15| **Apply** | `edit-operations.ts`, `edit-operation-primitives.ts` | `applyHashlineEdits`, `applyHashlineEditsWithReport`, `apply{SetLine,ReplaceLines,InsertAfter,InsertBefore,Append,Prepend}` |16| **Normalize/dedup/order** | `normalize-edits.ts`, `edit-deduplication.ts`, `edit-ordering.ts` | `normalizeHashlineEdits`, `dedupeEdits`, `detectOverlappingRanges` |17| **Autocorrect** | `autocorrect-replacement-lines.ts`, `edit-text-normalization.ts` | `autocorrectReplacementLines`, prefix/indent/echo strippers |18| **Diff/display** | `diff-utils.ts`, `hashline-edit-diff.ts` | `toHashlineContent`, `generateUnifiedDiff`, `countLineDiffs`, `generateHashlineDiff` |19| **Canonicalize/chunk** | `file-text-canonicalization.ts`, `hashline-chunk-formatter.ts` | `canonicalizeFileText`/`restoreFileText` (BOM + LF/CRLF), `createHashlineChunkFormatter` (200 lines / 64 KB) |2021## DEPENDENCIES & CONSUMERS2223- **Depends on:** `diff` (^9) — for `createTwoFilesPatch` in `generateUnifiedDiff` only. Otherwise self-contained.24- **Consumed by:** the ~15 thin re-export shims under `omo-opencode/src/tools/hashline-edit/`. NOT consumed by the Codex edition (Light has no hashline).2526## NOTES2728- **"Option 2" hashing:** no npm xxhash dependency. `xxhash32.ts` prefers native `Bun.hash.xxHash32()` at call time and falls back to a pure-JS impl, so it runs under Bun and Node.29- **Legacy hash compatibility:** validation accepts both `computeLineHash` (trimEnd + strip `\r`) and `computeLegacyLineHash` (strip ALL whitespace) — old stored hashes still validate.30- **Seed rule:** content lines seed `0`; whitespace-only lines seed `lineNumber` (distinct hash per position).31- **`normalizeHashlineEdits` rejects unknown ops** with `"Legacy format was removed; use op/pos/end/lines."` — the discriminated union is `replace | append | prepend` only.32- Parent: [`packages/AGENTS.md`](../AGENTS.md).33
Also in code-yeongyu/oh-my-openagent
Diff this repo’s formatsOne repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| code-yeongyu/oh-my-openagent.agents/AGENTS.md · 67k | AGENTS.md | stylearchtesting-strategydatabase | 64/100 | 2 days ago | |
| code-yeongyu/oh-my-openagent.opencode/AGENTS.md · 67k | AGENTS.md | stylearchdo-not | 71/100 | 2 days ago | |
| code-yeongyu/oh-my-openagentAGENTS.md · 67k | AGENTS.md | setupbuildtestlint-format+11 | 84/100 | 2 days ago | |
| code-yeongyu/oh-my-openagentassets/AGENTS.md · 67k | AGENTS.md | buildteststylearch | 88/100 | 2 days ago | |
| code-yeongyu/oh-my-openagentbin/AGENTS.md · 67k | AGENTS.md | teststylearch | 64/100 | 2 days ago | |
| code-yeongyu/oh-my-openagentpackages/AGENTS.md · 67k | AGENTS.md | buildtestlint-formatstyle+3 | 83/100 | 2 days ago | |
| code-yeongyu/oh-my-openagentpackages/agents-md-core/AGENTS.md · 67k | AGENTS.md | archdependenciesapi | 48/100 | 2 days ago | |
| code-yeongyu/oh-my-openagentpackages/boulder-state/AGENTS.md · 67k | AGENTS.md | archapi | 48/100 | 2 days ago | |
| code-yeongyu/oh-my-openagentpackages/claude-code-compat-core/AGENTS.md · 67k | AGENTS.md | archagent-behaviour | 56/100 | 2 days ago | |
| code-yeongyu/oh-my-openagentpackages/comment-checker-core/AGENTS.md · 67k | AGENTS.md | archdependenciesapi | 48/100 | 2 days ago | |
| code-yeongyu/oh-my-openagentpackages/delegate-core/AGENTS.md · 67k | AGENTS.md | stylearchdependenciesapi | 60/100 | 2 days ago | |
| code-yeongyu/oh-my-openagentpackages/git-bash-mcp/AGENTS.md · 67k | AGENTS.md | buildtestlint-formatarch+1 | 82/100 | 2 days ago | |
| code-yeongyu/oh-my-openagentpackages/lsp-core/AGENTS.md · 67k | AGENTS.md | archmonorepo | 43/100 | 2 days ago | |
| code-yeongyu/oh-my-openagentpackages/lsp-daemon/AGENTS.md · 67k | AGENTS.md | buildtestlint-formatarch+1 | 84/100 | 2 days ago | |
| code-yeongyu/oh-my-openagentpackages/lsp-tools-mcp/AGENTS.md · 67k | AGENTS.md | buildtestlint-formatarch | 74/100 | 2 days ago | |
| code-yeongyu/oh-my-openagentpackages/mcp-client-core/AGENTS.md · 67k | AGENTS.md | arch | 43/100 | 2 days ago | |
| code-yeongyu/oh-my-openagentpackages/mcp-stdio-core/AGENTS.md · 67k | AGENTS.md | archapi | 56/100 | 2 days ago | |
| code-yeongyu/oh-my-openagentpackages/model-core/AGENTS.md · 67k | AGENTS.md | arch | 54/100 | 2 days ago | |
| code-yeongyu/oh-my-openagentpackages/omo-codex/AGENTS.md · 67k | AGENTS.md | setupbuildtestarch+6 | 93/100 | 2 days ago | |
| code-yeongyu/oh-my-openagentpackages/omo-codex/plugin/components/bootstrap/AGENTS.md · 67k | AGENTS.md | buildtestarchagent-behaviour | 88/100 | 2 days ago |
Diff against .agents/AGENTS.md Diff against .opencode/AGENTS.md Diff against AGENTS.md Diff against assets/AGENTS.md Diff against bin/AGENTS.md Diff against packages/AGENTS.md Diff against packages/agents-md-core/AGENTS.md Diff against packages/boulder-state/AGENTS.md Diff against packages/claude-code-compat-core/AGENTS.md Diff against packages/comment-checker-core/AGENTS.md Diff against packages/delegate-core/AGENTS.md Diff against packages/git-bash-mcp/AGENTS.md Diff against packages/lsp-core/AGENTS.md Diff against packages/lsp-daemon/AGENTS.md Diff against packages/lsp-tools-mcp/AGENTS.md Diff against packages/mcp-client-core/AGENTS.md Diff against packages/mcp-stdio-core/AGENTS.md Diff against packages/model-core/AGENTS.md Diff against packages/omo-codex/AGENTS.md Diff against packages/omo-codex/plugin/components/bootstrap/AGENTS.md
Similar configs
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| mui/material-uiAGENTS.md · 99k | AGENTS.md | setupbuildtestlint-format+9 | 100/100 | 3 days ago | |
| TryGhost/Ghoste2e/AGENTS.md · 55k | AGENTS.md | setupteststylearch+2 | 100/100 | 3 days ago | |
| code-yeongyu/oh-my-openagentpackages/web/AGENTS.md · 67k | AGENTS.md | setupbuildtestlint-format+6 | 100/100 | 2 days ago | |
| duckduckgo/content-scope-scriptsspecial-pages/AGENTS.md · 70 | AGENTS.md | buildteststylearch+3 | 100/100 | 3 days ago | |
| SkeneTechnologies/skene-cookbookAGENTS.md · 51 | AGENTS.md | setupbuildtestlint-format+7 | 100/100 | 2 days ago | |
| n8n-io/n8npackages/@n8n/agents/AGENTS.md · 199k | AGENTS.md | buildteststylearch+3 | 100/100 | 3 days ago | |
| aaif-goose/gooseAGENTS.md · 52k | AGENTS.md | setupbuildtestlint-format+6 | 100/100 | 3 days ago | |
| elastic/elasticsearchx-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/AGENTS.md · 78k | AGENTS.md | buildtestlint-formatstyle+2 | 100/100 | 3 days ago |
