MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / isCompleteApcSequence

Function isCompleteApcSequence

packages/pi-tui/src/stdin-buffer.ts:168–179  ·  view source on GitHub ↗

* Check if APC (Application Program Command) sequence is complete * APC sequences: ESC _ ... ST (where ST is ESC \) * Used for Kitty graphics responses like ESC _ G ... ESC \

(data: string)

Source from the content-addressed store, hash-verified

166 * Used for Kitty graphics responses like ESC _ G ... ESC \
167 */
168function isCompleteApcSequence(data: string): "complete" | "incomplete" {
169 if (!data.startsWith(`${ESC}_`)) {
170 return "complete";
171 }
172
173 // APC sequences end with ST (ESC \)
174 if (data.endsWith(`${ESC}\\`)) {
175 return "complete";
176 }
177
178 return "incomplete";
179}
180
181/**
182 * Split accumulated buffer into complete sequences

Callers 1

isCompleteSequenceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected