d24d11a274
- Standardized missing-file read errors and now return `File not found: <path>` for absent edit targets. - Centralized AI provider, usage, and OAuth helpers into shared modules to remove duplicated logic. - Migrated OAuth/API-key login flows to shared factory helpers and removed inline prompt/token-exchange code. - Reused shared tools and formatter utilities for discovery, stream tails, LSP batching, and source formatting. - Consolidated repeated test helpers and fixtures into shared modules, replacing inline helper duplicates.
13 lines
336 B
TypeScript
13 lines
336 B
TypeScript
/**
|
|
* Return the first 12 hex characters of a commit SHA, or undefined when the
|
|
* input is missing. Shared between GitHub tool argument normalization and the
|
|
* run-watch renderer.
|
|
*/
|
|
export function formatShortSha(value: string | undefined): string | undefined {
|
|
if (!value) {
|
|
return undefined;
|
|
}
|
|
|
|
return value.slice(0, 12);
|
|
}
|