consortium
Version:
Remote control and session sharing CLI for AI coding agents
44 lines (40 loc) • 1.04 kB
JavaScript
import { T as TransformStream } from './consumable-GBIKq8FA.mjs';
class InspectStream extends TransformStream {
constructor(callback) {
super({
transform(chunk, controller) {
callback(chunk);
controller.enqueue(chunk);
}
});
}
}
class SplitStringStream extends TransformStream {
constructor(separator) {
let remaining = void 0;
super({
transform(chunk, controller) {
if (remaining) {
chunk = remaining + chunk;
remaining = void 0;
}
let start = 0;
while (start < chunk.length) {
const index = chunk.indexOf(separator, start);
if (index === -1) {
remaining = chunk.substring(start);
break;
}
controller.enqueue(chunk.substring(start, index));
start = index + 1;
}
},
flush(controller) {
if (remaining) {
controller.enqueue(remaining);
}
}
});
}
}
export { InspectStream as I, SplitStringStream as S };