4ea76365cd
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
11 lines
369 B
TypeScript
11 lines
369 B
TypeScript
export const NIBBLE_STR = "ZPMQVRWSNKTXJBYH"
|
|
|
|
export const HASHLINE_DICT = Array.from({ length: 256 }, (_, i) => {
|
|
const high = i >>> 4
|
|
const low = i & 0x0f
|
|
return `${NIBBLE_STR[high]}${NIBBLE_STR[low]}`
|
|
})
|
|
|
|
export const HASHLINE_REF_PATTERN = /^([0-9]+)#([ZPMQVRWSNKTXJBYH]{2})$/
|
|
export const HASHLINE_OUTPUT_PATTERN = /^([0-9]+)#([ZPMQVRWSNKTXJBYH]{2})\|(.*)$/
|