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

Function call

src/tools/VerifyPlanExecutionTool/VerifyPlanExecutionTool.ts:197–374  ·  view source on GitHub ↗
(_input, toolUseContext, canUseTool, parentMessage)

Source from the content-addressed store, hash-verified

195 return null
196 },
197 async call(_input, toolUseContext, canUseTool, parentMessage) {
198 if (toolUseContext.agentId) {
199 return {
200 data: {
201 status: 'disabled',
202 message:
203 'VerifyPlanExecution must be called from the main thread, not from an agent.',
204 },
205 }
206 }
207
208 if (!isEnvTruthy(process.env.CLAUDE_CODE_VERIFY_PLAN)) {
209 return {
210 data: {
211 status: 'disabled',
212 message: 'Plan verification is not enabled.',
213 },
214 }
215 }
216
217 const appState = toolUseContext.getAppState()
218 const pending = appState.pendingPlanVerification
219 if (!pending) {
220 return {
221 data: {
222 status: 'no_pending_plan',
223 message:
224 'No pending plan verification was found. Continue implementation or exit plan mode first.',
225 },
226 }
227 }
228
229 if (pending.verificationCompleted) {
230 return {
231 data: {
232 status: 'already_completed',
233 message: 'Plan verification has already completed for this plan.',
234 },
235 }
236 }
237
238 if (pending.verificationStarted) {
239 return {
240 data: {
241 status: 'already_started',
242 message: 'Plan verification is already running in the background.',
243 },
244 }
245 }
246
247 const rootSetAppState =
248 toolUseContext.setAppStateForTasks ?? toolUseContext.setAppState
249 const plan = pending.plan
250 updatePendingVerificationState(rootSetAppState, plan, {
251 verificationStarted: true,
252 verificationCompleted: false,
253 })
254

Callers

nothing calls this directly

Calls 15

isEnvTruthyFunction · 0.90
buildVerifierPromptFunction · 0.85
getPlanFilePathFunction · 0.85
createAgentIdFunction · 0.85
verificationGetAppStateFunction · 0.85
assembleToolPoolFunction · 0.85
isBuiltInAgentFunction · 0.85
runWithAgentContextFunction · 0.85
runAsyncAgentLifecycleFunction · 0.85
runAgentFunction · 0.85
asAgentIdFunction · 0.85

Tested by

no test coverage detected