import { commandRegistry } from "../registry.js";
//#region src/chat-commands/builtins/context.ts
function parseMode(args) {
	const w = args.trim().split(/\s+/)[0]?.toLowerCase();
	if (w === "detail" || w === "json" || w === "list") return w;
	return "list";
}
const contextCommand = {
	id: "session.context",
	name: "context",
	description: "Show context budget and config snapshot (list | detail | json)",
	category: "session",
	scope: [
		"global",
		"private",
		"group"
	],
	acceptsArgs: true,
	examples: [
		"/context",
		"/context detail",
		"/context json"
	],
	handler: async (ctx, args) => {
		await ctx.setTyping(true);
		const mode = parseMode(args);
		const text = await ctx.agentContextReport?.(mode);
		if (text === void 0) return {
			content: "⚠️ Context report is not available here.",
			success: false
		};
		return {
			content: text,
			success: true
		};
	}
};
function registerContextCommands() {
	commandRegistry.register(contextCommand);
}
//#endregion
export { registerContextCommands };

//# sourceMappingURL=context.js.map