refactor(packages): extract hashline-core package

Move the hash-anchored edit core (hash computation, validation, edit operations, text normalization, chunk formatter, diff utilities, and a runtime-aware xxHash32 binding) into a new @oh-my-opencode/hashline-core workspace package.

The src/tools/hashline-edit/ surface becomes a set of thin re-export shims, so existing import paths in the plugin keep working while the pure logic lives behind a stable package boundary that has no opencode runtime dependencies.

Tests: bun test packages/hashline-core src/tools/hashline-edit
This commit is contained in:
YeonGyu-Kim
2026-05-21 16:02:09 +09:00
parent f29411a689
commit 4ea76365cd
42 changed files with 2561 additions and 1260 deletions
+10
View File
@@ -29,6 +29,7 @@
"@oh-my-opencode/ast-grep-mcp": "workspace:*",
"@oh-my-opencode/boulder-state": "workspace:*",
"@oh-my-opencode/comment-checker-core": "workspace:*",
"@oh-my-opencode/hashline-core": "workspace:*",
"@oh-my-opencode/model-core": "workspace:*",
"@oh-my-opencode/rules-engine": "workspace:*",
"@oh-my-opencode/utils": "workspace:*",
@@ -93,6 +94,13 @@
"name": "@oh-my-opencode/comment-checker-core",
"version": "0.1.0",
},
"packages/hashline-core": {
"name": "@oh-my-opencode/hashline-core",
"version": "0.1.0",
"dependencies": {
"diff": "^9.0.0",
},
},
"packages/model-core": {
"name": "@oh-my-opencode/model-core",
"version": "0.1.0",
@@ -197,6 +205,8 @@
"@oh-my-opencode/comment-checker-core": ["@oh-my-opencode/comment-checker-core@workspace:packages/comment-checker-core"],
"@oh-my-opencode/hashline-core": ["@oh-my-opencode/hashline-core@workspace:packages/hashline-core"],
"@oh-my-opencode/model-core": ["@oh-my-opencode/model-core@workspace:packages/model-core"],
"@oh-my-opencode/rules-engine": ["@oh-my-opencode/rules-engine@workspace:packages/rules-engine"],