import "./safe-text-3QwCgtr3.js";
import { t as chunkTextByBreakResolver } from "./text-chunking-BMeCEEgT.js";
import "./tables-CnnOFY-H.js";
import "./chunk-items-DxQitu4j.js";
import "./auto-linked-file-ref-Uv6kgYfd.js";
//#region src/plugin-sdk/text-chunking.ts
/** Chunk outbound text while preferring newline boundaries over spaces. */
function chunkTextForOutbound(text, limit) {
	return chunkTextByBreakResolver(text, limit, (window) => {
		const lastNewline = window.lastIndexOf("\n");
		const lastSpace = window.lastIndexOf(" ");
		return lastNewline > 0 ? lastNewline : lastSpace;
	});
}
//#endregion
export { chunkTextForOutbound as t };
