<commit_before>#!/usr/bin/env bash

set -e

browser=$(tempfile)
js=$(tempfile)
trap "rm -f '$browser' '$js'" EXIT

base='https://chromium.googlesource.com/chromium/src/+/master/third_party/WebKit/Source'
curl -s "$base/core/inspector/browser_protocol.json?format=TEXT" | base64 -d >"$browser"
curl -s "$base/platform/v8_inspector/js_protocol.json?format=TEXT" | base64 -d >"$js"
node -p '
    const protocols = process.argv.slice(1).map((path) => JSON.parse(fs.readFileSync(path)));
    protocols[0].domains.push(...protocols[1].domains);
    JSON.stringify(protocols[0], null, 4);
' "$browser" "$js" >lib/protocol.json

git diff lib/protocol.json<commit_msg>Update the 'update-protocol.sh' script<commit_after>#!/usr/bin/env bash

set -e

browser=$(tempfile)
js=$(tempfile)
trap "rm -f '$browser' '$js'" EXIT

base='https://chromium.googlesource.com'
curl -s "$base/chromium/src/+/master/third_party/WebKit/Source/core/inspector/browser_protocol.json?format=TEXT" | base64 -d >"$browser"
curl -s "$base/v8/v8.git/+/master/src/inspector/js_protocol.json?format=TEXT" | base64 -d >"$js"
node -p '
    const protocols = process.argv.slice(1).map((path) => JSON.parse(fs.readFileSync(path)));
    protocols[0].domains.push(...protocols[1].domains);
    JSON.stringify(protocols[0], null, 4);
' "$browser" "$js" >lib/protocol.json

git diff lib/protocol.json
{'fraction_non_alphanumeric': 0.1964549483013294, 'fraction_numerical': 0.0155096011816839, 'mean_word_length': 5.022222222222222, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5599732', 'n_tokens_mistral': 531, 'n_tokens_neox': 497, 'n_words': 84}