MCPcopy Create free account
hub / github.com/Noumena-Network/code / normalizeReplSubmitIntent

Function normalizeReplSubmitIntent

src/session/replSubmitDispatch.ts:89–110  ·  view source on GitHub ↗
({
  input,
  inputMode,
  hasSpeculationAccept,
}: {
  input: string
  inputMode: PromptInputMode
  hasSpeculationAccept: boolean
})

Source from the content-addressed store, hash-verified

87}
88
89function normalizeReplSubmitIntent({
90 input,
91 inputMode,
92 hasSpeculationAccept,
93}: {
94 input: string
95 inputMode: PromptInputMode
96 hasSpeculationAccept: boolean
97}): NormalizedReplSubmitIntent {
98 if (hasSpeculationAccept) {
99 return { input, inputMode }
100 }
101
102 if ((inputMode === 'prompt' || inputMode === 'bash') && input.startsWith('!')) {
103 return {
104 input: input.slice(1),
105 inputMode: 'bash',
106 }
107 }
108
109 return { input, inputMode }
110}
111
112function findMatchingSubmitCommand(
113 input: string,

Callers 1

dispatchReplSubmitFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected