Hashline editing: content-hash anchors for edit_file stale-patch detection.
Pure-JS xxHash32, line hash computation, validation with HashlineMismatchError,
256-entry hash dictionary. 6 files in apps/coder/src/services/hashline/.
Audit hooks: emitHook('tool.execute.after') wired in frame-emitter.ts for
completed/failed tool results. emitHook('turn.end') wired at terminal points
in dispatcher.ts (all 5 run functions: native, external, opencode, warm ACP,
claude SDK). Fire-and-forget, non-blocking.
12 lines
698 B
TypeScript
12 lines
698 B
TypeScript
/**
|
|
* Hashline editing core — content-hash anchors for edit_file stale-patch detection.
|
|
*
|
|
* Ported from oh-my-openagent/packages/hashline-core/.
|
|
* Bundles a runtime-aware xxHash32 (Bun fast-path, pure-JS fallback).
|
|
*/
|
|
export { computeLineHash, formatHashLines, formatHashLine, computeLegacyLineHash } from "./hash-computation.js"
|
|
export { parseLineRef, validateLineRef, validateLineRefs, HashlineMismatchError, normalizeLineRef } from "./validation.js"
|
|
export type { LineRef } from "./validation.js"
|
|
export { NIBBLE_STR, HASHLINE_DICT, HASHLINE_REF_PATTERN, HASHLINE_OUTPUT_PATTERN } from "./constants.js"
|
|
export type { ReplaceEdit, AppendEdit, PrependEdit, HashlineEdit } from "./types.js"
|