import "./paths-CE7eVGHg.js";
import "./registry-C-JddWwo.js";
import { o as resolveAgentWorkspaceDir, s as resolveDefaultAgentId } from "./agent-scope-B1Ina6jV.js";
import "./subsystem-DzRUKS9f.js";
import "./workspace-CsaDUuDn.js";
import { t as runAgentTurn } from "./unified-runner-O3qR5Iie.js";
import "./auth-profiles-BSw0aQND.js";
import "./model-selection-BqshlIZc.js";
import "./deliver-BiWlR84Y.js";
import "./ssrf-DNhyFMRW.js";
import "./boolean-BsqeuxE6.js";
import "./shell-env-B1lDWz4t.js";
import "./manifest-registry-BGJu2aC-.js";
import "./chrome-OTJg3QKn.js";
import "./frontmatter-CJEX1BrH.js";
import "./skills-Dm4gX4Tl.js";
import "./redact-CSGZUFxa.js";
import "./errors-C89ppfp9.js";
import "./local-roots-C7fBKoOI.js";
import "./thinking-h_Lv1OKF.js";
import "./chunk-BkYIP_hB.js";
import "./plugins-B06cTFHC.js";
import "./send-C75uSv6p.js";
import "./paths-BsT3BvfH.js";
import "./tokens-D_vCJSzF.js";
import "./diagnostic-BALvP9wI.js";
import "./diagnostic-session-state-BDfanaOY.js";
import "./manager-DbVMwpDc.js";
import "./github-copilot-token-uhEBNQfj.js";
import "./pi-auth-json-DCGR3yfh.js";
import "./reply-prefix-D0NzzC4I.js";
import "./sqlite-CmMv0ans.js";
import "./markdown-tables-CGqX2WvO.js";
import "./commands-registry-7vX6rnw_.js";
import "./skill-commands-lyuYvLis.js";
import "./pi-model-discovery-Rgm3jE5N.js";
import "./resolve-route-CDsQda0z.js";
import "./replies-D0FYSIJg.js";

//#region src/hooks/llm-slug-generator.ts
/**
* LLM-based slug generator for session memory filenames
*/
/**
* Generate a short 1-2 word filename slug from session content using LLM
*/
async function generateSlugViaLLM(params) {
	try {
		const agentId = resolveDefaultAgentId(params.cfg);
		const workspaceDir = resolveAgentWorkspaceDir(params.cfg, agentId);
		const sessionId = `slug-generator-${Date.now()}`;
		const prompt = `Based on this conversation, generate a short 1-2 word filename slug (lowercase, hyphen-separated, no file extension).

Conversation summary:
${params.sessionContent.slice(0, 2e3)}

Reply with ONLY the slug, nothing else. Examples: "vendor-pitch", "api-design", "bug-fix"`;
		const result = await runAgentTurn({
			sessionId,
			sessionKey: "temp:slug-generator",
			workspaceDir,
			config: params.cfg,
			prompt,
			timeoutMs: 15e3
		});
		if (result.text) return result.text.trim().toLowerCase().replace(/[^a-z0-9-]/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "").slice(0, 30) || null;
		return null;
	} catch (err) {
		console.error("[llm-slug-generator] Failed to generate slug:", err);
		return null;
	}
}

//#endregion
export { generateSlugViaLLM };