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

Function alignDelta

apps/kimi-web/src/api/daemon/agentEventProjector.ts:610–615  ·  view source on GitHub ↗

* Align a live text-delta against the per-turn accumulated length using the * wire `offset`. Returns 'skip' for duplicates (offset behind local state), * 'gap' when deltas were missed (offset ahead — trigger a re-snapshot), and * 'append' otherwise.

(localLen: number, offset: number | undefined)

Source from the content-addressed store, hash-verified

608 * 'append' otherwise.
609 */
610 function alignDelta(localLen: number, offset: number | undefined): 'append' | 'skip' | 'gap' {
611 if (offset === undefined) return 'append';
612 if (offset < localLen) return 'skip';
613 if (offset > localLen) return 'gap';
614 return 'append';
615 }
616
617 function _project(
618 rawType: string,

Callers 1

_projectFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected