{"id":"text-delimiter-chunk","version":"1.0.0","description":"Split text on an explicit literal delimiter (Python str.split rules, optional max_splits) with spans and line numbers.","supported_operations":["split text on a custom delimiter","chunk a document at every separator marker","split on a multi character separator and keep empty pieces","split at most n times on a delimiter","character offsets of each piece between delimiters","cut text at explicit split markers like <!-- split -->"],"unsupported_operations":["regular-expression or multiple alternative delimiters (one literal string only)","whitespace-run splitting without a delimiter (Python str.split() with no sep)","splitting from the right (rsplit) or dropping empty pieces"],"semantics":["Follows Python 3 str.split(sep, maxsplit) with an explicit sep: the delimiter is a non-empty literal string matched by exact UTF-16 code units (no case folding or Unicode normalization); occurrences are found left to right without overlap, each search resuming right after the previous occurrence; consecutive delimiters delimit empty strings; text \"\" gives one empty chunk.","max_splits omitted means no limit (Python maxsplit=-1). max_splits = k >= 0 performs at most k splits, so the last chunk keeps the remaining text including any further delimiters; k = 0 returns the whole text as one chunk.","Each chunk reports start and end as Unicode code point offsets into text (end exclusive) and its exact text; the delimiters themselves belong to no chunk. delimiter_count is the number of delimiter occurrences consumed (chunk_count - 1).","Line numbers use CommonMark 0.31.2 line endings (LF, CR, CRLF) of the whole text: line(pos) = 1 + number of line endings that end at or before pos; start_line = line(start), end_line = line(end - 1), or start_line for an empty chunk.","An empty delimiter (Python: ValueError \"empty separator\"), a lone surrogate in text or delimiter, or a negative or non-integer max_splits throws invalid_input."],"limits":{"max_input_bytes":262144,"max_delimiter_bytes":256,"max_chunks":10000,"max_output_bytes":1048576},"pricing":{"status":"unpriced","charge_usd":null},"input_schema":{"type":"object","additionalProperties":false,"required":["text","delimiter"],"properties":{"text":{"type":"string","description":"The text to split (UTF-8, at most max_input_bytes)."},"delimiter":{"type":"string","minLength":1,"description":"The literal separator string (at most max_delimiter_bytes)."},"max_splits":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"At most this many splits; omit for no limit."}}},"output_schema":{"type":"object","additionalProperties":false,"required":["chunk_count","delimiter_count","chunks"],"properties":{"chunk_count":{"type":"integer","minimum":1},"delimiter_count":{"type":"integer","minimum":0},"chunks":{"type":"array","minItems":1,"maxItems":10000,"items":{"type":"object","additionalProperties":false,"required":["index","start","end","start_line","end_line","text"],"properties":{"index":{"type":"integer","minimum":0},"start":{"type":"integer","minimum":0},"end":{"type":"integer","minimum":0},"start_line":{"type":"integer","minimum":1},"end_line":{"type":"integer","minimum":1},"text":{"type":"string"}}}}}},"examples":[{"input":{"text":"1,2,,3,","delimiter":","},"output":{"chunk_count":5,"delimiter_count":4,"chunks":[{"index":0,"start":0,"end":1,"start_line":1,"end_line":1,"text":"1"},{"index":1,"start":2,"end":3,"start_line":1,"end_line":1,"text":"2"},{"index":2,"start":4,"end":4,"start_line":1,"end_line":1,"text":""},{"index":3,"start":5,"end":6,"start_line":1,"end_line":1,"text":"3"},{"index":4,"start":7,"end":7,"start_line":1,"end_line":1,"text":""}]}},{"input":{"text":"intro\n<!-- split -->\nbody 😀\n<!-- split -->\nend","delimiter":"\n<!-- split -->\n","max_splits":1},"output":{"chunk_count":2,"delimiter_count":1,"chunks":[{"index":0,"start":0,"end":5,"start_line":1,"end_line":1,"text":"intro"},{"index":1,"start":21,"end":46,"start_line":3,"end_line":5,"text":"body 😀\n<!-- split -->\nend"}]}}],"execute_url":"/v1/tools/text-delimiter-chunk/versions/1.0.0/execute"}