MCPcopy Index your code
hub / github.com/Effect-TS/effect / defaultProcessor

Function defaultProcessor

packages/cli/src/internal/prompt/text.ts:231–241  ·  view source on GitHub ↗
(input: string, state: State)

Source from the content-addressed store, hash-verified

229}
230
231function defaultProcessor(input: string, state: State) {
232 const beforeCursor = state.value.slice(0, state.cursor)
233 const afterCursor = state.value.slice(state.cursor)
234 const value = `${beforeCursor}${input}${afterCursor}`
235 const cursor = state.cursor + input.length
236 return Effect.succeed(
237 Action.NextFrame({
238 state: { ...state, cursor, value, error: Option.none() }
239 })
240 )
241}
242
243const initialState: State = {
244 cursor: 0,

Callers 1

handleProcessFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected