MCPcopy Create free account
hub / github.com/microsoft/Webwright / appendPythonScripts

Function appendPythonScripts

assets/compare_trajectory/app.js:647–666  ·  view source on GitHub ↗
(target, seen, text, options = {})

Source from the content-addressed store, hash-verified

645}
646
647function appendPythonScripts(target, seen, text, options = {}) {
648 extractPythonBlocks(text).forEach((block) => {
649 const scriptText = String(block.text || '').trim();
650 if (!scriptText || seen.has(scriptText)) {
651 return;
652 }
653 seen.add(scriptText);
654 const order = target.length + 1;
655 target.push({
656 id: (options.idPrefix || 'python-script') + '-' + order,
657 order,
658 title: block.title || options.title || 'Python script ' + order,
659 text: scriptText,
660 sections: [makeCodeSection(scriptText, 'python', 'Python')],
661 timeLabel: options.timeLabel || 'n/a',
662 sourceLabel: options.sourceLabel || block.sourceLabel || '',
663 chips: uniqueStrings([options.sourceLabel || block.sourceLabel || 'python'].concat(options.chips || []))
664 });
665 });
666}
667
668function extractActionPayload(record, action = null) {
669 const source = record && typeof record === 'object' ? record : {};

Callers 5

parseSessionToolSectionFunction · 0.85
normalizeCodexFunction · 0.85
normalizeRawResponsesFunction · 0.85
normalizeTrajectoryFunction · 0.85

Calls 3

extractPythonBlocksFunction · 0.85
makeCodeSectionFunction · 0.85
uniqueStringsFunction · 0.85

Tested by

no test coverage detected