MCPcopy
hub / github.com/claude-code-best/claude-code / submitMessage

Method submitMessage

src/QueryEngine.ts:217–1215  ·  view source on GitHub ↗
(
    prompt: string | ContentBlockParam[],
    options?: { uuid?: string; isMeta?: boolean },
  )

Source from the content-addressed store, hash-verified

215 }
216
217 async *submitMessage(
218 prompt: string | ContentBlockParam[],
219 options?: { uuid?: string; isMeta?: boolean },
220 ): AsyncGenerator<SDKMessage, void, unknown> {
221 const {
222 cwd,
223 commands,
224 tools,
225 mcpClients,
226 verbose = false,
227 thinkingConfig,
228 maxTurns,
229 maxBudgetUsd,
230 taskBudget,
231 canUseTool,
232 customSystemPrompt,
233 appendSystemPrompt,
234 userSpecifiedModel,
235 fallbackModel,
236 jsonSchema,
237 getAppState,
238 setAppState,
239 replayUserMessages = false,
240 includePartialMessages = false,
241 agents = [],
242 setSDKStatus,
243 orphanedPermission,
244 } = this.config
245
246 this.discoveredSkillNames.clear()
247 this.permissionDenials = []
248 setCwd(cwd)
249 const persistSession = !isSessionPersistenceDisabled()
250 const startTime = Date.now()
251
252 // Wrap canUseTool to track permission denials
253 const wrappedCanUseTool: CanUseToolFn = async (
254 tool,
255 input,
256 toolUseContext,
257 assistantMessage,
258 toolUseID,
259 forceDecision,
260 ) => {
261 const result = await canUseTool(
262 tool,
263 input,
264 toolUseContext,
265 assistantMessage,
266 toolUseID,
267 forceDecision,
268 )
269
270 // Track denials for SDK reporting
271 if (result.behavior !== 'allow') {
272 this.permissionDenials.push({
273 type: 'permission_denial',
274 tool_name: sdkCompatToolName(tool.name),

Callers 2

askFunction · 0.95
promptFunction · 0.80

Calls 15

setCwdFunction · 0.85
parseUserSpecifiedModelFunction · 0.85
getMainLoopModelFunction · 0.85
fetchSystemPromptPartsFunction · 0.85
isScratchpadEnabledFunction · 0.85
getScratchpadDirFunction · 0.85
hasAutoMemPathOverrideFunction · 0.85
loadMemoryPromptFunction · 0.85

Tested by

no test coverage detected