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
+3 -1
View File
@@ -12,6 +12,7 @@
"packages/utils",
"packages/model-core",
"packages/comment-checker-core",
"packages/hashline-core",
"packages/boulder-state",
"packages/agents-md-core"
],
@@ -48,7 +49,7 @@
"prepublishOnly": "bun run clean && bun run build:lsp-tools-mcp && bun run build",
"test:model-capabilities": "bun test src/shared/model-capability-aliases.test.ts src/shared/model-capability-guardrails.test.ts src/shared/model-capabilities.test.ts src/cli/doctor/checks/model-resolution.test.ts --bail",
"typecheck": "tsgo --noEmit && bun run typecheck:packages",
"typecheck:packages": "tsgo --noEmit -p packages/rules-engine/tsconfig.json && tsgo --noEmit -p packages/ast-grep-core/tsconfig.json && tsgo --noEmit -p packages/ast-grep-mcp/tsconfig.json && tsgo --noEmit -p packages/utils/tsconfig.json && tsgo --noEmit -p packages/model-core/tsconfig.json && tsgo --noEmit -p packages/comment-checker-core/tsconfig.json && tsgo --noEmit -p packages/boulder-state/tsconfig.json && tsgo --noEmit -p packages/agents-md-core/tsconfig.json",
"typecheck:packages": "tsgo --noEmit -p packages/rules-engine/tsconfig.json && tsgo --noEmit -p packages/ast-grep-core/tsconfig.json && tsgo --noEmit -p packages/ast-grep-mcp/tsconfig.json && tsgo --noEmit -p packages/utils/tsconfig.json && tsgo --noEmit -p packages/model-core/tsconfig.json && tsgo --noEmit -p packages/comment-checker-core/tsconfig.json && tsgo --noEmit -p packages/hashline-core/tsconfig.json && tsgo --noEmit -p packages/boulder-state/tsconfig.json && tsgo --noEmit -p packages/agents-md-core/tsconfig.json",
"typecheck:script": "tsgo --noEmit -p script/tsconfig.json",
"test": "bun test",
"build:ast-grep-mcp": "bun run --cwd packages/ast-grep-mcp build"
@@ -97,6 +98,7 @@
"@oh-my-opencode/agents-md-core": "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:*",