MCPcopy Create free account
hub / github.com/QLHazyCoder/FlowPilot / reportComplete

Function reportComplete

content/utils.js:285–309  ·  view source on GitHub ↗

* Report step completion. * @param {number} step * @param {Object} data - Step output data

(step, data = {})

Source from the content-addressed store, hash-verified

283 * @param {Object} data - Step output data
284 */
285function reportComplete(step, data = {}) {
286 console.log(LOG_PREFIX, `步骤 ${step} 已完成`, data);
287 log(`步骤 ${step} 已成功完成`, 'ok');
288 const message = {
289 type: 'STEP_COMPLETE',
290 source: SCRIPT_SOURCE,
291 step,
292 payload: data,
293 error: null,
294 };
295 Promise.resolve(chrome.runtime.sendMessage(message))
296 .then((response) => {
297 console.log(LOG_PREFIX, `STEP_COMPLETE sent successfully for step ${step}`, {
298 response,
299 url: location.href,
300 payloadKeys: Object.keys(data || {}),
301 });
302 })
303 .catch((err) => {
304 console.error(LOG_PREFIX, `STEP_COMPLETE send failed for step ${step}`, err?.message || err, {
305 url: location.href,
306 payloadKeys: Object.keys(data || {}),
307 });
308 });
309}
310
311/**
312 * Report step error.

Callers 6

step3_fillEmailPasswordFunction · 0.85
step5_fillNameBirthdayFunction · 0.85
step1_getOAuthLinkFunction · 0.85
step9_vpsVerifyFunction · 0.85

Calls 1

logFunction · 0.85

Tested by

no test coverage detected