@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
26 lines • 1.49 kB
JavaScript
import { APP_NAME } from "../config.js";
/**
* Banner written at the top of the generated global-default extension shim.
*
* The config-reload watcher recognises its own generated shims by this banner. A rebranded
* install writes its own product name, so every banner a machine may already carry stays
* recognised - otherwise those files would look user-authored and retrigger reload loops.
*/
export const GENERATED_SHIM_BANNER = `// Generated by ${APP_NAME}. Delete this file to stop loading the default global extension.\n`;
const HISTORICAL_SHIM_BANNERS = [
"// Generated by senpi. Delete this file to stop loading the default global extension.\n",
"// Generated by pi-coding-agent. Delete this file to stop loading the default global extension.\n",
];
/** Every banner spelling that identifies a generated shim, current brand first. */
export const ACCEPTED_SHIM_BANNERS = [
...new Set([GENERATED_SHIM_BANNER, ...HISTORICAL_SHIM_BANNERS]),
];
/** Prefixes used to recognise a generated shim by its first line. */
export const ACCEPTED_SHIM_BANNER_PREFIXES = [
...new Set(ACCEPTED_SHIM_BANNERS.map((banner) => banner.split(".")[0] ?? banner).map((prefix) => `${prefix}.`)),
];
/** Whether the given file content was generated by this product or a previous brand of it. */
export function hasGeneratedShimBanner(content) {
return ACCEPTED_SHIM_BANNER_PREFIXES.some((prefix) => content.startsWith(prefix));
}
//# sourceMappingURL=generated-shim-banner.js.map