import { m as resolveDefaultAgentId, p as resolveAgentWorkspaceDir } from "./agent-scope-BA9YeMqS.js";
import { t as formatCliCommand } from "./command-format-BeJUeZeT.js";
import { t as buildWorkspaceHookStatus } from "./hooks-status-CHUoagAd.js";
//#region src/commands/onboard-hooks.ts
async function setupInternalHooks(cfg, runtime, prompter) {
	const eligibleHooks = buildWorkspaceHookStatus(resolveAgentWorkspaceDir(cfg, resolveDefaultAgentId(cfg)), { config: cfg }).hooks.filter((h) => h.loadable);
	if (eligibleHooks.length === 0) return cfg;
	const entries = { ...cfg.hooks?.internal?.entries };
	const names = [];
	for (const hook of eligibleHooks) {
		entries[hook.name] = { enabled: true };
		names.push(hook.name);
	}
	const next = {
		...cfg,
		hooks: {
			...cfg.hooks,
			internal: {
				enabled: true,
				entries
			}
		}
	};
	await prompter.note([
		`Enabled ${names.length} hook${names.length > 1 ? "s" : ""}: ${names.join(", ")}`,
		"",
		"You can manage hooks later with:",
		`  ${formatCliCommand("kaijibot hooks list")}`,
		`  ${formatCliCommand("kaijibot hooks enable <name>")}`,
		`  ${formatCliCommand("kaijibot hooks disable <name>")}`
	].join("\n"), "Hooks Configured");
	return next;
}
//#endregion
export { setupInternalHooks };
