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

Function onDone

src/session/immediateLocalJsxCommand.ts:113–148  ·  view source on GitHub ↗
(
    result?: string,
    doneOptions?: {
      display?: CommandResultDisplay
      metaMessages?: string[]
    },
  )

Source from the content-addressed store, hash-verified

111 let doneWasCalled = false
112
113 const onDone = (
114 result?: string,
115 doneOptions?: {
116 display?: CommandResultDisplay
117 metaMessages?: string[]
118 },
119 ): void => {
120 doneWasCalled = true
121 setToolJSX({
122 jsx: null,
123 shouldHidePromptInput: false,
124 clearLocalJSX: true,
125 })
126
127 if (result && doneOptions?.display !== 'skip') {
128 addNotification({
129 key: `immediate-${commandNotificationName}`,
130 text: result,
131 priority: 'immediate',
132 })
133 }
134
135 const newMessages = buildImmediateLocalJsxCompletionMessages({
136 commandArgs,
137 commandName,
138 fullscreenEnabled,
139 metaMessages: doneOptions?.metaMessages,
140 result,
141 display: doneOptions?.display,
142 })
143 if (newMessages.length > 0) {
144 setMessages(prev => [...prev, ...newMessages])
145 }
146
147 restoreStashedPrompt?.()
148 }
149
150 const context = getToolUseContext(
151 getMessages(),

Callers 2

DoctorFunction · 0.50

Calls 3

addNotificationFunction · 0.85
setMessagesFunction · 0.70

Tested by

no test coverage detected