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

Function dispatchReplSubmitPrelude

src/session/replSubmitPreludeDispatch.ts:84–233  ·  view source on GitHub ↗
(
  {
    submitPreludePlan,
    shouldAddToHistory,
    input,
    pastedContents,
    getInputValue,
    helpers,
    promptInputMode,
    matchingSubmitCommand,
    fromKeybinding,
    mainLoopModel,
    stashedPrompt,
    totalInputTokens,
    nowMs,
    lastQueryCompletionTimeMs,
    messageCount,
  }: ReplSubmitPreludeDispatchOptions,
  {
    addNotification,
    dispatchBackgroundPrShortcutPrelaunchImpl = dispatchBackgroundPrShortcutPrelaunch,
    dispatchImmediateLocalJsxSubmitImpl = dispatchImmediateLocalJsxSubmit,
    dispatchReplIdleReturnDialogImpl = dispatchReplIdleReturnDialog,
    addToHistory,
    setInputValue,
    setPastedContents,
    setInputMode,
    setIDESelection,
    incrementSubmitCount,
    createAbortController,
    getMessages,
    getToolUseContext,
    setMessages,
    setStashedPrompt,
    setToolJSX,
    logEvent,
    addIdleReturnPending,
    clearIdleHint,
    getIdleHint,
    isFullscreenEnvEnabled,
  }: ReplSubmitPreludeDispatchDeps,
)

Source from the content-addressed store, hash-verified

82}
83
84export async function dispatchReplSubmitPrelude(
85 {
86 submitPreludePlan,
87 shouldAddToHistory,
88 input,
89 pastedContents,
90 getInputValue,
91 helpers,
92 promptInputMode,
93 matchingSubmitCommand,
94 fromKeybinding,
95 mainLoopModel,
96 stashedPrompt,
97 totalInputTokens,
98 nowMs,
99 lastQueryCompletionTimeMs,
100 messageCount,
101 }: ReplSubmitPreludeDispatchOptions,
102 {
103 addNotification,
104 dispatchBackgroundPrShortcutPrelaunchImpl = dispatchBackgroundPrShortcutPrelaunch,
105 dispatchImmediateLocalJsxSubmitImpl = dispatchImmediateLocalJsxSubmit,
106 dispatchReplIdleReturnDialogImpl = dispatchReplIdleReturnDialog,
107 addToHistory,
108 setInputValue,
109 setPastedContents,
110 setInputMode,
111 setIDESelection,
112 incrementSubmitCount,
113 createAbortController,
114 getMessages,
115 getToolUseContext,
116 setMessages,
117 setStashedPrompt,
118 setToolJSX,
119 logEvent,
120 addIdleReturnPending,
121 clearIdleHint,
122 getIdleHint,
123 isFullscreenEnvEnabled,
124 }: ReplSubmitPreludeDispatchDeps,
125): Promise<boolean> {
126 switch (submitPreludePlan.type) {
127 case 'background-pr-empty-prompt':
128 addNotification({
129 key: 'suggest-background-pr-empty',
130 text: 'Background PR shortcut needs a prompt after "&".',
131 priority: 'immediate',
132 timeoutMs: 3500,
133 })
134 return true
135 case 'background-pr-images-unsupported':
136 addNotification({
137 key: 'suggest-background-pr-images-unsupported',
138 text: 'Background PR shortcut currently supports text input only.',
139 priority: 'immediate',
140 timeoutMs: 3500,
141 })

Calls 4

addNotificationFunction · 0.85
isFullscreenEnvEnabledFunction · 0.85
logEventFunction · 0.50
getCommandNameFunction · 0.50

Tested by

no test coverage detected