diff --git a/package-lock.json b/package-lock.json index 9f32e54..62acfb0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,9 +5,14 @@ "packages": { "": { "dependencies": { + "@anthropic-ai/tokenizer": "^0.0.4", + "@exadev/breadboard-kits": "^0.10.1", "@google-labs/breadboard": "0.11.2", - "@google-labs/core-kit": "0.3.0", - "@xenova/transformers": "^2.15.1" + "@google-labs/core-kit": "0.4.0", + "@google-labs/template-kit": "^0.2.0", + "@xenova/transformers": "^2.15.1", + "js-tiktoken": "^1.0.10", + "puppeteer": "^22.4.1" }, "devDependencies": { "@types/node": "^20.11.20", @@ -15,6 +20,80 @@ "typescript": "^5.3.3" } }, + "node_modules/@anthropic-ai/sdk": { + "version": "0.10.2", + "resolved": "https://registry.npmjs.org/@anthropic-ai/sdk/-/sdk-0.10.2.tgz", + "integrity": "sha512-ranlsLhft0njz4s0YdKxUtbouoPPTIlnmpBxUNZfmKplF6GCNIomC9YjHf4GJNJyrUHrsikl10GnvPVU6LK+WA==", + "dependencies": { + "@types/node": "^18.11.18", + "@types/node-fetch": "^2.6.4", + "abort-controller": "^3.0.0", + "agentkeepalive": "^4.2.1", + "digest-fetch": "^1.3.0", + "form-data-encoder": "1.7.2", + "formdata-node": "^4.3.2", + "node-fetch": "^2.6.7", + "web-streams-polyfill": "^3.2.1" + } + }, + "node_modules/@anthropic-ai/sdk/node_modules/@types/node": { + "version": "18.19.24", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.24.tgz", + "integrity": "sha512-eghAz3gnbQbvnHqB+mgB2ZR3aH6RhdEmHGS48BnV75KceQPHqabkxKI0BbUSsqhqy2Ddhc2xD/VAR9ySZd57Lw==", + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/@anthropic-ai/tokenizer": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/@anthropic-ai/tokenizer/-/tokenizer-0.0.4.tgz", + "integrity": "sha512-EHRKbxlxlc8W4KCBEseByJ7YwyYCmgu9OyN59H9+IYIGPoKv8tXyQXinkeGDI+cI8Tiuz9wk2jZb/kK7AyvL7g==", + "dependencies": { + "@types/node": "^18.11.18", + "tiktoken": "^1.0.10" + } + }, + "node_modules/@anthropic-ai/tokenizer/node_modules/@types/node": { + "version": "18.19.24", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.24.tgz", + "integrity": "sha512-eghAz3gnbQbvnHqB+mgB2ZR3aH6RhdEmHGS48BnV75KceQPHqabkxKI0BbUSsqhqy2Ddhc2xD/VAR9ySZd57Lw==", + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.23.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.23.5.tgz", + "integrity": "sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA==", + "dependencies": { + "@babel/highlight": "^7.23.4", + "chalk": "^2.4.2" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", + "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/highlight": { + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.23.4.tgz", + "integrity": "sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A==", + "dependencies": { + "@babel/helper-validator-identifier": "^7.22.20", + "chalk": "^2.4.2", + "js-tokens": "^4.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, "node_modules/@esbuild/linux-x64": { "version": "0.19.12", "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.12.tgz", @@ -47,6 +126,59 @@ "node": ">=12" } }, + "node_modules/@exadev/breadboard-kits": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/@exadev/breadboard-kits/-/breadboard-kits-0.10.1.tgz", + "integrity": "sha512-AK3bSZauwFU48HA0XNMAejx+ADi8xhZr6Xw6RhMYAvRMqXko1B8Z1CAtxRclgnPUSvQ1odLu/U9kr0oSryTmqw==", + "dependencies": { + "@anthropic-ai/sdk": "^0.10.2", + "@anthropic-ai/tokenizer": "^0.0.4", + "@google-labs/breadboard": "^0.7.1", + "@google-labs/core-kit": "^0.1.2", + "@google-labs/llm-starter": "^0.3.1", + "@xenova/transformers": "^2.10.1", + "axios": "^1.6.2", + "cheerio": "^1.0.0-rc.12", + "dotenv": "^16.3.1", + "js-tiktoken": "^1.0.8", + "jsonschema": "^1.4.1" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/@exadev/breadboard-kits/node_modules/@google-labs/breadboard": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/@google-labs/breadboard/-/breadboard-0.7.1.tgz", + "integrity": "sha512-3R/n1H9ByJ9ro+jSxxr8jjtzFYNrEZJjsIW+8u5fGRYBKnXSBjXLaO9E+AzCR5+0vA8sbwCjcwcDwD92hU2FoA==", + "dependencies": { + "zod": "^3.22.4", + "zod-to-json-schema": "^3.22.1" + }, + "engines": { + "node": ">=19.0.0" + } + }, + "node_modules/@exadev/breadboard-kits/node_modules/@google-labs/core-kit": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@google-labs/core-kit/-/core-kit-0.1.3.tgz", + "integrity": "sha512-HQjJAewDfaOl1mKTH9oR9pRw4tgaAL5bCkcM1La0Fl6L9pGRb6gUYgo/mD7UcNoKIrKlqAluIM8YckCc9D4Fhg==", + "dependencies": { + "@google-labs/breadboard": "^0.8.0" + } + }, + "node_modules/@exadev/breadboard-kits/node_modules/@google-labs/core-kit/node_modules/@google-labs/breadboard": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/@google-labs/breadboard/-/breadboard-0.8.0.tgz", + "integrity": "sha512-xOVINvU4cUOSfrbgDJQoAHlyDA7LIFV1NpDENL24hjFtiNAtw3+zAnYy1lzl8p5JSDJFY/ieDCUnPhC78DPaeQ==", + "dependencies": { + "zod": "^3.22.4", + "zod-to-json-schema": "^3.22.1" + }, + "engines": { + "node": ">=19.0.0" + } + }, "node_modules/@google-labs/breadboard": { "version": "0.11.2", "resolved": "https://registry.npmjs.org/@google-labs/breadboard/-/breadboard-0.11.2.tgz", @@ -64,11 +196,35 @@ "integrity": "sha512-zQCjftqxGej4OfYHGoh5jNDwhYYjglPUkC+TL6f5lzhzSKNDBgDuXYy3f5B8g3dzFvqzx1cPnxOi/Ubd536rwg==" }, "node_modules/@google-labs/core-kit": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/@google-labs/core-kit/-/core-kit-0.3.0.tgz", - "integrity": "sha512-TXMMjHdhw5HDsbx3w0kheJQXrBjiscwH4XTqHT+KD3IM7uyOFLwCPQGzPaOR65SMVTW7mOkHEgJUFDcUWIKYbg==", + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@google-labs/core-kit/-/core-kit-0.4.0.tgz", + "integrity": "sha512-8ihkKjmUeWRCeK9Z9VvwwYoVkZ80ctclnbxXQ4OCp4I/vR8+EGoFV2BehqTq97vOA/H9xjbh3tWlXuOjGrDt9A==", + "dependencies": { + "@google-labs/breadboard": "^0.11.2" + } + }, + "node_modules/@google-labs/llm-starter": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/@google-labs/llm-starter/-/llm-starter-0.3.6.tgz", + "integrity": "sha512-n4y5l6ixiB09tZShtSPRclTnWPnwggZpq3OBsGHORm53eAiOV5CYKrDxryFCmgWTm6HA4gGVDWhqU5073lsXGw==", "dependencies": { - "@google-labs/breadboard": "^0.11.0" + "@google-labs/breadboard": "^0.11.0", + "url-template": "^3.1.0" + }, + "engines": { + "node": ">=19.0.0" + } + }, + "node_modules/@google-labs/template-kit": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@google-labs/template-kit/-/template-kit-0.2.0.tgz", + "integrity": "sha512-7u03xTeeirtmTFiC2h8v8JG9ROjz7hCQGj7V3UbXr47w3gNUPWDTSEVzm5cEz2ysyHeHD7dWW6L4HYJy0sifSQ==", + "dependencies": { + "@google-labs/breadboard": "^0.11.0", + "url-template": "^3.1.0" + }, + "engines": { + "node": ">=19.0.0" } }, "node_modules/@huggingface/jinja": { @@ -133,6 +289,32 @@ "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==" }, + "node_modules/@puppeteer/browsers": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@puppeteer/browsers/-/browsers-2.1.0.tgz", + "integrity": "sha512-xloWvocjvryHdUjDam/ZuGMh7zn4Sn3ZAaV4Ah2e2EwEt90N3XphZlSsU3n0VDc1F7kggCjMuH0UuxfPQ5mD9w==", + "dependencies": { + "debug": "4.3.4", + "extract-zip": "2.0.1", + "progress": "2.0.3", + "proxy-agent": "6.4.0", + "semver": "7.6.0", + "tar-fs": "3.0.5", + "unbzip2-stream": "1.4.3", + "yargs": "17.7.2" + }, + "bin": { + "browsers": "lib/cjs/main-cli.js" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@tootallnate/quickjs-emscripten": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@tootallnate/quickjs-emscripten/-/quickjs-emscripten-0.23.0.tgz", + "integrity": "sha512-C5Mc6rdnsaJDjO3UpGW/CQTHtCKaYlScZTly4JIu97Jxo/odCiH0ITnDXSJPTOrEKk/ycSZ0AOgTmkDtkOsvIA==" + }, "node_modules/@types/long": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.2.tgz", @@ -146,6 +328,24 @@ "undici-types": "~5.26.4" } }, + "node_modules/@types/node-fetch": { + "version": "2.6.11", + "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.11.tgz", + "integrity": "sha512-24xFj9R5+rfQJLRyM56qh+wnVSYhyXC2tkoBndtY0U+vubqNsYXGjufB2nn8Q6gt0LrARwL6UBtMCSVCwl4B1g==", + "dependencies": { + "@types/node": "*", + "form-data": "^4.0.0" + } + }, + "node_modules/@types/yauzl": { + "version": "2.10.3", + "resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.10.3.tgz", + "integrity": "sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q==", + "optional": true, + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@xenova/transformers": { "version": "2.15.1", "resolved": "https://registry.npmjs.org/@xenova/transformers/-/transformers-2.15.1.tgz", @@ -159,6 +359,102 @@ "onnxruntime-node": "1.14.0" } }, + "node_modules/abort-controller": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", + "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", + "dependencies": { + "event-target-shim": "^5.0.0" + }, + "engines": { + "node": ">=6.5" + } + }, + "node_modules/agent-base": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.0.tgz", + "integrity": "sha512-o/zjMZRhJxny7OyEF+Op8X+efiELC7k7yOjMzgfzVqOzXqkBkWI79YoTdOtsuWd5BWhAGAuOY/Xa6xpiaWXiNg==", + "dependencies": { + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/agentkeepalive": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.5.0.tgz", + "integrity": "sha512-5GG/5IbQQpC9FpkRGsSvZI5QYeSCzlJHdpBQntCsuTOxhKD8lqKhrleg2Yi7yvMIf82Ycmmqln9U8V9qwEiJew==", + "dependencies": { + "humanize-ms": "^1.2.1" + }, + "engines": { + "node": ">= 8.0.0" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/ansi-styles/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/ansi-styles/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" + }, + "node_modules/ast-types": { + "version": "0.13.4", + "resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.13.4.tgz", + "integrity": "sha512-x1FCFnFifvYDDzTaLII71vG5uvDwgtmDTEVWAxrgeiR8VjMONcCXJx7E+USjDtHlwFmt9MysbqgF9b9Vjr6w+w==", + "dependencies": { + "tslib": "^2.0.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" + }, + "node_modules/axios": { + "version": "1.6.7", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.7.tgz", + "integrity": "sha512-/hDJGff6/c7u0hDkvkGxR/oy6CbCs8ziCsC7SqmhjfozqiJGc8Z11wrv9z9lYfY4K8l+H9TpjcMDX0xOZmx+RA==", + "dependencies": { + "follow-redirects": "^1.15.4", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, "node_modules/b4a": { "version": "1.6.6", "resolved": "https://registry.npmjs.org/b4a/-/b4a-1.6.6.tgz", @@ -197,6 +493,11 @@ "bare-os": "^2.1.0" } }, + "node_modules/base-64": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/base-64/-/base-64-0.1.0.tgz", + "integrity": "sha512-Y5gU45svrR5tI2Vt/X9GPd3L0HNIKzGu202EjxrXMpuc2V2CiKgemAbUUsqYmZJvPtCXoUKjNZwBJzsNScUbXA==" + }, "node_modules/base64-js": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", @@ -216,6 +517,14 @@ } ] }, + "node_modules/basic-ftp": { + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/basic-ftp/-/basic-ftp-5.0.5.tgz", + "integrity": "sha512-4Bcg1P8xhUuqcii/S0Z9wiHIrQVPMermM1any+MX5GeGD7faD3/msQUDGLol9wOcz4/jbg/WJnGqoJF6LiBdtg==", + "engines": { + "node": ">=10.0.0" + } + }, "node_modules/bl": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", @@ -226,6 +535,11 @@ "readable-stream": "^3.4.0" } }, + "node_modules/boolbase": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", + "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==" + }, "node_modules/buffer": { "version": "5.7.1", "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", @@ -249,11 +563,109 @@ "ieee754": "^1.1.13" } }, + "node_modules/buffer-crc32": { + "version": "0.2.13", + "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", + "integrity": "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==", + "engines": { + "node": "*" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "engines": { + "node": ">=6" + } + }, + "node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/charenc": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/charenc/-/charenc-0.0.2.tgz", + "integrity": "sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA==", + "engines": { + "node": "*" + } + }, + "node_modules/cheerio": { + "version": "1.0.0-rc.12", + "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.12.tgz", + "integrity": "sha512-VqR8m68vM46BNnuZ5NtnGBKIE/DfN0cRIzg9n40EIq9NOv90ayxLBXA8fXC5gquFRGJSTRqBq25Jt2ECLR431Q==", + "dependencies": { + "cheerio-select": "^2.1.0", + "dom-serializer": "^2.0.0", + "domhandler": "^5.0.3", + "domutils": "^3.0.1", + "htmlparser2": "^8.0.1", + "parse5": "^7.0.0", + "parse5-htmlparser2-tree-adapter": "^7.0.0" + }, + "engines": { + "node": ">= 6" + }, + "funding": { + "url": "https://github.com/cheeriojs/cheerio?sponsor=1" + } + }, + "node_modules/cheerio-select": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cheerio-select/-/cheerio-select-2.1.0.tgz", + "integrity": "sha512-9v9kG0LvzrlcungtnJtpGNxY+fzECQKhK4EGJX2vByejiMX84MFNQw4UxPJl3bFbTMw+Dfs37XaIkCwTZfLh4g==", + "dependencies": { + "boolbase": "^1.0.0", + "css-select": "^5.1.0", + "css-what": "^6.1.0", + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3", + "domutils": "^3.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, "node_modules/chownr": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==" }, + "node_modules/chromium-bidi": { + "version": "0.5.12", + "resolved": "https://registry.npmjs.org/chromium-bidi/-/chromium-bidi-0.5.12.tgz", + "integrity": "sha512-sZMgEBWKbupD0Q7lyFu8AWkrE+rs5ycE12jFkGwIgD/VS8lDPtelPlXM7LYaq4zrkZ/O2L3f4afHUHL0ICdKog==", + "dependencies": { + "mitt": "3.0.1", + "urlpattern-polyfill": "10.0.0" + }, + "peerDependencies": { + "devtools-protocol": "*" + } + }, + "node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, "node_modules/color": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/color/-/color-4.2.3.tgz", @@ -291,6 +703,108 @@ "simple-swizzle": "^0.2.2" } }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/cosmiconfig": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-9.0.0.tgz", + "integrity": "sha512-itvL5h8RETACmOTFc4UfIyB2RfEHi71Ax6E/PivVxq9NseKbOWpeyHEOIbmAw1rs8Ak0VursQNww7lf7YtUwzg==", + "dependencies": { + "env-paths": "^2.2.1", + "import-fresh": "^3.3.0", + "js-yaml": "^4.1.0", + "parse-json": "^5.2.0" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/d-fischer" + }, + "peerDependencies": { + "typescript": ">=4.9.5" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/cross-fetch": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-4.0.0.tgz", + "integrity": "sha512-e4a5N8lVvuLgAWgnCrLr2PP0YyDOTHa9H/Rj54dirp61qXnNq46m82bRhNqIA5VccJtWBvPTFRV3TtvHUKPB1g==", + "dependencies": { + "node-fetch": "^2.6.12" + } + }, + "node_modules/crypt": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/crypt/-/crypt-0.0.2.tgz", + "integrity": "sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow==", + "engines": { + "node": "*" + } + }, + "node_modules/css-select": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.1.0.tgz", + "integrity": "sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==", + "dependencies": { + "boolbase": "^1.0.0", + "css-what": "^6.1.0", + "domhandler": "^5.0.2", + "domutils": "^3.0.1", + "nth-check": "^2.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, + "node_modules/css-what": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/css-what/-/css-what-6.1.0.tgz", + "integrity": "sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==", + "engines": { + "node": ">= 6" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, + "node_modules/data-uri-to-buffer": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-6.0.2.tgz", + "integrity": "sha512-7hvf7/GW8e86rW0ptuwS3OcBGDjIi6SZva7hCyWC0yYry2cOPmLIjXAUHI6DK2HsnwJd9ifmt57i8eV2n4YNpw==", + "engines": { + "node": ">= 14" + } + }, + "node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, "node_modules/decompress-response": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", @@ -313,6 +827,27 @@ "node": ">=4.0.0" } }, + "node_modules/degenerator": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/degenerator/-/degenerator-5.0.1.tgz", + "integrity": "sha512-TllpMR/t0M5sqCXfj85i4XaAzxmS5tVA16dqvdkMwGmzI+dXLXnw3J+3Vdv7VKw+ThlTMboK6i9rnZ6Nntj5CQ==", + "dependencies": { + "ast-types": "^0.13.4", + "escodegen": "^2.1.0", + "esprima": "^4.0.1" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/detect-libc": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.2.tgz", @@ -321,6 +856,87 @@ "node": ">=8" } }, + "node_modules/devtools-protocol": { + "version": "0.0.1249869", + "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1249869.tgz", + "integrity": "sha512-Ctp4hInA0BEavlUoRy9mhGq0i+JSo/AwVyX2EFgZmV1kYB+Zq+EMBAn52QWu6FbRr10hRb6pBl420upbp4++vg==" + }, + "node_modules/digest-fetch": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/digest-fetch/-/digest-fetch-1.3.0.tgz", + "integrity": "sha512-CGJuv6iKNM7QyZlM2T3sPAdZWd/p9zQiRNS9G+9COUCwzWFTs0Xp8NF5iePx7wtvhDykReiRRrSeNb4oMmB8lA==", + "dependencies": { + "base-64": "^0.1.0", + "md5": "^2.3.0" + } + }, + "node_modules/dom-serializer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", + "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", + "dependencies": { + "domelementtype": "^2.3.0", + "domhandler": "^5.0.2", + "entities": "^4.2.0" + }, + "funding": { + "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" + } + }, + "node_modules/domelementtype": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", + "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } + ] + }, + "node_modules/domhandler": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", + "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", + "dependencies": { + "domelementtype": "^2.3.0" + }, + "engines": { + "node": ">= 4" + }, + "funding": { + "url": "https://github.com/fb55/domhandler?sponsor=1" + } + }, + "node_modules/domutils": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.1.0.tgz", + "integrity": "sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==", + "dependencies": { + "dom-serializer": "^2.0.0", + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3" + }, + "funding": { + "url": "https://github.com/fb55/domutils?sponsor=1" + } + }, + "node_modules/dotenv": { + "version": "16.4.5", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz", + "integrity": "sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" + } + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, "node_modules/end-of-stream": { "version": "1.4.4", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", @@ -329,6 +945,38 @@ "once": "^1.4.0" } }, + "node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/env-paths": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", + "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", + "engines": { + "node": ">=6" + } + }, + "node_modules/error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dependencies": { + "is-arrayish": "^0.2.1" + } + }, + "node_modules/error-ex/node_modules/is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==" + }, "node_modules/esbuild": { "version": "0.19.12", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.12.tgz", @@ -367,6 +1015,78 @@ "@esbuild/win32-x64": "0.19.12" } }, + "node_modules/escalade": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", + "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==", + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/escodegen": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.1.0.tgz", + "integrity": "sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w==", + "dependencies": { + "esprima": "^4.0.1", + "estraverse": "^5.2.0", + "esutils": "^2.0.2" + }, + "bin": { + "escodegen": "bin/escodegen.js", + "esgenerate": "bin/esgenerate.js" + }, + "engines": { + "node": ">=6.0" + }, + "optionalDependencies": { + "source-map": "~0.6.1" + } + }, + "node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/event-target-shim": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", + "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==", + "engines": { + "node": ">=6" + } + }, "node_modules/expand-template": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", @@ -375,21 +1095,140 @@ "node": ">=6" } }, + "node_modules/extract-zip": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-2.0.1.tgz", + "integrity": "sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg==", + "dependencies": { + "debug": "^4.1.1", + "get-stream": "^5.1.0", + "yauzl": "^2.10.0" + }, + "bin": { + "extract-zip": "cli.js" + }, + "engines": { + "node": ">= 10.17.0" + }, + "optionalDependencies": { + "@types/yauzl": "^2.9.1" + } + }, "node_modules/fast-fifo": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/fast-fifo/-/fast-fifo-1.3.2.tgz", "integrity": "sha512-/d9sfos4yxzpwkDkuN7k2SqFKtYNmCTzgfEpz82x34IM9/zc8KGxQoXg1liNC/izpRM/MBdt44Nmx41ZWqk+FQ==" }, + "node_modules/fd-slicer": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", + "integrity": "sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==", + "dependencies": { + "pend": "~1.2.0" + } + }, "node_modules/flatbuffers": { "version": "1.12.0", "resolved": "https://registry.npmjs.org/flatbuffers/-/flatbuffers-1.12.0.tgz", "integrity": "sha512-c7CZADjRcl6j0PlvFy0ZqXQ67qSEZfrVPynmnL+2zPc+NtMvrF8Y0QceMo7QqnSPc7+uWjUIAbvCQ5WIKlMVdQ==" }, + "node_modules/follow-redirects": { + "version": "1.15.5", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.5.tgz", + "integrity": "sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/form-data-encoder": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/form-data-encoder/-/form-data-encoder-1.7.2.tgz", + "integrity": "sha512-qfqtYan3rxrnCk1VYaA4H+Ms9xdpPqvLZa6xmMgFvhO32x7/3J/ExcTd6qpxM0vH2GdMI+poehyBZvqfMTto8A==" + }, + "node_modules/formdata-node": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/formdata-node/-/formdata-node-4.4.1.tgz", + "integrity": "sha512-0iirZp3uVDjVGt9p49aTaqjk84TrglENEDuqfdlZQ1roC9CWlPk6Avf8EEnZNcAqPonwkG35x4n3ww/1THYAeQ==", + "dependencies": { + "node-domexception": "1.0.0", + "web-streams-polyfill": "4.0.0-beta.3" + }, + "engines": { + "node": ">= 12.20" + } + }, + "node_modules/formdata-node/node_modules/web-streams-polyfill": { + "version": "4.0.0-beta.3", + "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-4.0.0-beta.3.tgz", + "integrity": "sha512-QW95TCTaHmsYfHDybGMwO5IJIM93I/6vTRk+daHTWFPhwh+C8Cg7j7XyKrwrj8Ib6vYXe0ocYNrmzY4xAAN6ug==", + "engines": { + "node": ">= 14" + } + }, "node_modules/fs-constants": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==" }, + "node_modules/fs-extra": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.2.0.tgz", + "integrity": "sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==", + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=14.14" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-stream": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", + "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", + "dependencies": { + "pump": "^3.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/get-tsconfig": { "version": "4.7.2", "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.2.tgz", @@ -402,16 +1241,93 @@ "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" } }, + "node_modules/get-uri": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/get-uri/-/get-uri-6.0.3.tgz", + "integrity": "sha512-BzUrJBS9EcUb4cFol8r4W3v1cPsSyajLSthNkz5BxbpDcHN5tIrM10E2eNvfnvBn3DaT3DUgx0OpsBKkaOpanw==", + "dependencies": { + "basic-ftp": "^5.0.2", + "data-uri-to-buffer": "^6.0.2", + "debug": "^4.3.4", + "fs-extra": "^11.2.0" + }, + "engines": { + "node": ">= 14" + } + }, "node_modules/github-from-package": { "version": "0.0.0", "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", "integrity": "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==" }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" + }, "node_modules/guid-typescript": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/guid-typescript/-/guid-typescript-1.0.9.tgz", "integrity": "sha512-Y8T4vYhEfwJOTbouREvG+3XDsjr8E3kIr7uf+JZ0BYloFsttiHU0WfvANVsR7TxNUJa/WpCnw/Ino/p+DeBhBQ==" }, + "node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "engines": { + "node": ">=4" + } + }, + "node_modules/htmlparser2": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-8.0.2.tgz", + "integrity": "sha512-GYdjWKDkbRLkZ5geuHs5NY1puJ+PXwP7+fHPRz06Eirsb9ugf6d8kkXav6ADhcODhFFPMIXyxkxSuMf3D6NCFA==", + "funding": [ + "https://github.com/fb55/htmlparser2?sponsor=1", + { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } + ], + "dependencies": { + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3", + "domutils": "^3.0.1", + "entities": "^4.4.0" + } + }, + "node_modules/http-proxy-agent": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz", + "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==", + "dependencies": { + "agent-base": "^7.1.0", + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/https-proxy-agent": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.4.tgz", + "integrity": "sha512-wlwpilI7YdjSkWaQ/7omYBMTliDcmCN8OLihO6I9B86g06lMyAoqgoDpV0XqoaPOKj+0DIdAvnsWfyAAhmimcg==", + "dependencies": { + "agent-base": "^7.0.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/humanize-ms": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz", + "integrity": "sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==", + "dependencies": { + "ms": "^2.0.0" + } + }, "node_modules/ieee754": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", @@ -431,6 +1347,21 @@ } ] }, + "node_modules/import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", @@ -441,11 +1372,94 @@ "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" }, + "node_modules/ip-address": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-9.0.5.tgz", + "integrity": "sha512-zHtQzGojZXTwZTHQqra+ETKd4Sn3vgi7uBmlPoXVWZqYvuKmtI0l/VZTjqGmJY9x88GGOaZ9+G9ES8hC4T4X8g==", + "dependencies": { + "jsbn": "1.1.0", + "sprintf-js": "^1.1.3" + }, + "engines": { + "node": ">= 12" + } + }, "node_modules/is-arrayish": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==" }, + "node_modules/is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "engines": { + "node": ">=8" + } + }, + "node_modules/js-tiktoken": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/js-tiktoken/-/js-tiktoken-1.0.10.tgz", + "integrity": "sha512-ZoSxbGjvGyMT13x6ACo9ebhDha/0FHdKA+OsQcMOWcm1Zs7r90Rhk5lhERLzji+3rA7EKpXCgwXcM5fF3DMpdA==", + "dependencies": { + "base64-js": "^1.5.1" + } + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" + }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/jsbn": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-1.1.0.tgz", + "integrity": "sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==" + }, + "node_modules/json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==" + }, + "node_modules/jsonfile": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/jsonschema": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jsonschema/-/jsonschema-1.4.1.tgz", + "integrity": "sha512-S6cATIPVv1z0IlxdN+zUk5EPjkGCdnhN4wVSBlvoUO1tOLJootbo9CquNJmbIh4yikWHiUedhRYrNPn1arpEmQ==", + "engines": { + "node": "*" + } + }, + "node_modules/lines-and-columns": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==" + }, "node_modules/long": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", @@ -462,6 +1476,35 @@ "node": ">=10" } }, + "node_modules/md5": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/md5/-/md5-2.3.0.tgz", + "integrity": "sha512-T1GITYmFaKuO91vxyoQMFETst+O71VUPEU3ze5GNzDm0OWdP8v1ziTaAEPUr/3kLsY3Sftgz242A1SetQiDL7g==", + "dependencies": { + "charenc": "0.0.2", + "crypt": "0.0.2", + "is-buffer": "~1.1.6" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, "node_modules/mimic-response": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", @@ -481,16 +1524,34 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/mitt": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/mitt/-/mitt-3.0.1.tgz", + "integrity": "sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw==" + }, "node_modules/mkdirp-classic": { "version": "0.5.3", "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==" }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, "node_modules/napi-build-utils": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz", "integrity": "sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==" }, + "node_modules/netmask": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/netmask/-/netmask-2.0.2.tgz", + "integrity": "sha512-dBpDMdxv9Irdq66304OLfEmQ9tbNRFnFTuZiLo+bD+r332bBmMJ8GBLXklIXXgxd3+v9+KUnZaUR5PJMa75Gsg==", + "engines": { + "node": ">= 0.4.0" + } + }, "node_modules/node-abi": { "version": "3.55.0", "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.55.0.tgz", @@ -507,6 +1568,54 @@ "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-6.1.0.tgz", "integrity": "sha512-+eawOlIgy680F0kBzPUNFhMZGtJ1YmqM6l4+Crf4IkImjYrO/mqPwRMh352g23uIaQKFItcQ64I7KMaJxHgAVA==" }, + "node_modules/node-domexception": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", + "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/jimmywarting" + }, + { + "type": "github", + "url": "https://paypal.me/jimmywarting" + } + ], + "engines": { + "node": ">=10.5.0" + } + }, + "node_modules/node-fetch": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/nth-check": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", + "integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==", + "dependencies": { + "boolbase": "^1.0.0" + }, + "funding": { + "url": "https://github.com/fb55/nth-check?sponsor=1" + } + }, "node_modules/once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -555,6 +1664,92 @@ "platform": "^1.3.6" } }, + "node_modules/pac-proxy-agent": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/pac-proxy-agent/-/pac-proxy-agent-7.0.1.tgz", + "integrity": "sha512-ASV8yU4LLKBAjqIPMbrgtaKIvxQri/yh2OpI+S6hVa9JRkUI3Y3NPFbfngDtY7oFtSMD3w31Xns89mDa3Feo5A==", + "dependencies": { + "@tootallnate/quickjs-emscripten": "^0.23.0", + "agent-base": "^7.0.2", + "debug": "^4.3.4", + "get-uri": "^6.0.1", + "http-proxy-agent": "^7.0.0", + "https-proxy-agent": "^7.0.2", + "pac-resolver": "^7.0.0", + "socks-proxy-agent": "^8.0.2" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/pac-resolver": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/pac-resolver/-/pac-resolver-7.0.1.tgz", + "integrity": "sha512-5NPgf87AT2STgwa2ntRMr45jTKrYBGkVU36yT0ig/n/GMAa3oPqhZfIQ2kMEimReg0+t9kZViDVZ83qfVUlckg==", + "dependencies": { + "degenerator": "^5.0.0", + "netmask": "^2.0.2" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/parse-json": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", + "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", + "dependencies": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/parse5": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz", + "integrity": "sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==", + "dependencies": { + "entities": "^4.4.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, + "node_modules/parse5-htmlparser2-tree-adapter": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-7.0.0.tgz", + "integrity": "sha512-B77tOZrqqfUfnVcOrUvfdLbz4pu4RopLD/4vmu3HUPswwTA8OH0EMW9BlWR2B0RCoiZRAHEUu7IxeP1Pd1UU+g==", + "dependencies": { + "domhandler": "^5.0.2", + "parse5": "^7.0.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, + "node_modules/pend": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", + "integrity": "sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==" + }, "node_modules/platform": { "version": "1.3.6", "resolved": "https://registry.npmjs.org/platform/-/platform-1.3.6.tgz", @@ -611,6 +1806,14 @@ "node": ">=6" } }, + "node_modules/progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/protobufjs": { "version": "6.11.4", "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.4.tgz", @@ -636,6 +1839,37 @@ "pbts": "bin/pbts" } }, + "node_modules/proxy-agent": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/proxy-agent/-/proxy-agent-6.4.0.tgz", + "integrity": "sha512-u0piLU+nCOHMgGjRbimiXmA9kM/L9EHh3zL81xCdp7m+Y2pHIsnmbdDoEDoAz5geaonNR6q6+yOPQs6n4T6sBQ==", + "dependencies": { + "agent-base": "^7.0.2", + "debug": "^4.3.4", + "http-proxy-agent": "^7.0.1", + "https-proxy-agent": "^7.0.3", + "lru-cache": "^7.14.1", + "pac-proxy-agent": "^7.0.1", + "proxy-from-env": "^1.1.0", + "socks-proxy-agent": "^8.0.2" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/proxy-agent/node_modules/lru-cache": { + "version": "7.18.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", + "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", + "engines": { + "node": ">=12" + } + }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" + }, "node_modules/pump": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", @@ -645,6 +1879,39 @@ "once": "^1.3.1" } }, + "node_modules/puppeteer": { + "version": "22.4.1", + "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-22.4.1.tgz", + "integrity": "sha512-Mag1wRLanzwS4yEUyrDRBUgsKlH3dpL6oAfVwNHG09oxd0+ySsatMvYj7HwjynWy/S+Hg+XHLgjyC/F6CsL/lg==", + "hasInstallScript": true, + "dependencies": { + "@puppeteer/browsers": "2.1.0", + "cosmiconfig": "9.0.0", + "puppeteer-core": "22.4.1" + }, + "bin": { + "puppeteer": "lib/esm/puppeteer/node/cli.js" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/puppeteer-core": { + "version": "22.4.1", + "resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-22.4.1.tgz", + "integrity": "sha512-l9nf8NcirYOHdID12CIMWyy7dqcJCVtgVS+YAiJuUJHg8+9yjgPiG2PcNhojIEEpCkvw3FxvnyITVfKVmkWpjA==", + "dependencies": { + "@puppeteer/browsers": "2.1.0", + "chromium-bidi": "0.5.12", + "cross-fetch": "4.0.0", + "debug": "4.3.4", + "devtools-protocol": "0.0.1249869", + "ws": "8.16.0" + }, + "engines": { + "node": ">=18" + } + }, "node_modules/queue-tick": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/queue-tick/-/queue-tick-1.0.1.tgz", @@ -677,6 +1944,22 @@ "node": ">= 6" } }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "engines": { + "node": ">=4" + } + }, "node_modules/resolve-pkg-maps": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", @@ -792,6 +2075,55 @@ "is-arrayish": "^0.3.1" } }, + "node_modules/smart-buffer": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", + "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/socks": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.8.1.tgz", + "integrity": "sha512-B6w7tkwNid7ToxjZ08rQMT8M9BJAf8DKx8Ft4NivzH0zBUfd6jldGcisJn/RLgxcX3FPNDdNQCUEMMT79b+oCQ==", + "dependencies": { + "ip-address": "^9.0.5", + "smart-buffer": "^4.2.0" + }, + "engines": { + "node": ">= 10.0.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/socks-proxy-agent": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-8.0.2.tgz", + "integrity": "sha512-8zuqoLv1aP/66PHF5TqwJ7Czm3Yv32urJQHrVyhD7mmA6d61Zv8cIXQYPTWwmg6qlupnPvs/QKDmfa4P/qct2g==", + "dependencies": { + "agent-base": "^7.0.2", + "debug": "^4.3.4", + "socks": "^2.7.1" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/sprintf-js": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.3.tgz", + "integrity": "sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==" + }, "node_modules/streamx": { "version": "2.16.1", "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.16.1.tgz", @@ -812,6 +2144,30 @@ "safe-buffer": "~5.2.0" } }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/strip-json-comments": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", @@ -820,6 +2176,17 @@ "node": ">=0.10.0" } }, + "node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/tar-fs": { "version": "3.0.5", "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-3.0.5.tgz", @@ -843,6 +2210,26 @@ "streamx": "^2.15.0" } }, + "node_modules/through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==" + }, + "node_modules/tiktoken": { + "version": "1.0.13", + "resolved": "https://registry.npmjs.org/tiktoken/-/tiktoken-1.0.13.tgz", + "integrity": "sha512-JaL9ZnvTbGFMDIBeGdVkLt4qWTeCPw+n7Ock+wceAGRenuHA6nOOvMJFliNDyXsjg2osGKJWsXtO2xc74VxyDw==" + }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" + }, + "node_modules/tslib": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" + }, "node_modules/tsx": { "version": "4.7.1", "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.7.1.tgz", @@ -877,7 +2264,7 @@ "version": "5.3.3", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==", - "dev": true, + "devOptional": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -886,25 +2273,185 @@ "node": ">=14.17" } }, + "node_modules/unbzip2-stream": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/unbzip2-stream/-/unbzip2-stream-1.4.3.tgz", + "integrity": "sha512-mlExGW4w71ebDJviH16lQLtZS32VKqsSfk80GCfUlwT/4/hNRFsoscrF/c++9xinkMzECL1uL9DDwXqFWkruPg==", + "dependencies": { + "buffer": "^5.2.1", + "through": "^2.3.8" + } + }, "node_modules/undici-types": { "version": "5.26.5", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==" }, + "node_modules/universalify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/url-template": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/url-template/-/url-template-3.1.1.tgz", + "integrity": "sha512-4oszoaEKE/mQOtAmdMWqIRHmkxWkUZMnXFnjQ5i01CuRSK3uluxcH1MRVVVWmhlnzT1SCDfKxxficm2G37qzCA==", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + } + }, + "node_modules/urlpattern-polyfill": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/urlpattern-polyfill/-/urlpattern-polyfill-10.0.0.tgz", + "integrity": "sha512-H/A06tKD7sS1O1X2SshBVeA5FLycRpjqiBeqGKmBwBDBy28EnRjORxTNe269KSSr5un5qyWi1iL61wLxpd+ZOg==" + }, "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" }, + "node_modules/web-streams-polyfill": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.3.3.tgz", + "integrity": "sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==", + "engines": { + "node": ">= 8" + } + }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, + "node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" }, + "node_modules/ws": { + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.16.0.tgz", + "integrity": "sha512-HS0c//TP7Ina87TfiPUz1rQzMhHrl/SG2guqRcTOIUYD2q8uhUdNHZYJUaQ8aTGPzCh+c6oawMKW35nFl1dxyQ==", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "engines": { + "node": ">=10" + } + }, "node_modules/yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + }, + "node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "engines": { + "node": ">=12" + } + }, + "node_modules/yauzl": { + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", + "integrity": "sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==", + "dependencies": { + "buffer-crc32": "~0.2.3", + "fd-slicer": "~1.1.0" + } + }, + "node_modules/zod": { + "version": "3.22.4", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.22.4.tgz", + "integrity": "sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + }, + "node_modules/zod-to-json-schema": { + "version": "3.22.4", + "resolved": "https://registry.npmjs.org/zod-to-json-schema/-/zod-to-json-schema-3.22.4.tgz", + "integrity": "sha512-2Ed5dJ+n/O3cU383xSY28cuVi0BCQhF8nYqWU5paEpl7fVdqdAmiLdqLyfblbNdfOFwFfi/mqU4O1pwc60iBhQ==", + "peerDependencies": { + "zod": "^3.22.4" + } } } } diff --git a/package.json b/package.json index 2e9edca..d6f00cc 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,13 @@ { "dependencies": { + "@anthropic-ai/tokenizer": "^0.0.4", + "@exadev/breadboard-kits": "^0.10.1", "@google-labs/breadboard": "0.11.2", "@google-labs/core-kit": "0.4.0", - "@xenova/transformers": "^2.15.1" + "@google-labs/template-kit": "^0.2.0", + "@xenova/transformers": "^2.15.1", + "js-tiktoken": "^1.0.10", + "puppeteer": "^22.4.1" }, "devDependencies": { "@types/node": "^20.11.20", diff --git a/src/examples/autobake/chromeStatusApiFeatures.ts b/src/examples/autobake/chromeStatusApiFeatures.ts new file mode 100644 index 0000000..019f132 --- /dev/null +++ b/src/examples/autobake/chromeStatusApiFeatures.ts @@ -0,0 +1,226 @@ +/* eslint-disable @typescript-eslint/no-unused-vars */ +/* eslint-disable @typescript-eslint/no-explicit-any */ + +import { BrowserView, ChromeBrowser } from "./chromeStatusFeaturesV2.js"; +import fetchDirtyJson from "./fetchDirtyJson.js"; + +type UserAction = { + by: string; + when: string; +}; + +type Stage = { + id: number; + created: string; + feature_id: number; + stage_type: number; + ot_description: string | null; + display_name: string | null; + intent_stage: number; + pm_emails: string[]; + tl_emails: string[]; + ux_emails: string[]; + te_emails: string[]; + intent_thread_url: string | null; + announcement_url: string | null; + experiment_goals: string | null; + experiment_risks: string | null; + origin_trial_id: string | null; + origin_trial_feedback_url: string | null; + ot_action_requested: boolean; + ot_approval_buganizer_component: string | null; + ot_approval_criteria_url: string | null; + ot_approval_group_email: string | null; + ot_chromium_trial_name: string | null; + ot_display_name: string | null; + ot_documentation_url: string | null; + ot_emails: string[]; + ot_feedback_submission_url: string | null; + ot_has_third_party_support: boolean; + ot_is_critical_trial: boolean; + ot_is_deprecation_trial: boolean; + ot_owner_email: string | null; + ot_require_approvals: boolean; + ot_webfeature_use_counter: string | null; + extensions: any[]; // Define more specifically if possible + experiment_extension_reason: string | null; + ot_stage_id: string | null; + finch_url: string | null; + rollout_milestone: string | null; + rollout_platforms: string[]; + rollout_details: string | null; + rollout_impact: number; + enterprise_policies: any[]; // Define more specifically if possible + desktop_first: string | null; + android_first: string | null; + ios_first: string | null; + webview_first: string | null; + desktop_last: string | null; + android_last: string | null; + ios_last: string | null; + webview_last: string | null; +}; + +type BrowserStatus = { + text: string; + val: number; + milestone_str: string; +}; + +export type BrowserInfo = ChromeBrowser & { + android?: string; + // blink_components: string[]; + // bug: string; + desktop?: string; + // devrel: string[]; + // flag: boolean; + // intervention: boolean; + ios?: string; + // origintrial: boolean; + // owners: string[]; + // prefixed: boolean | null; + // status: BrowserStatus; + webview?: string; +}; + +type Browsers = { + chrome: BrowserInfo; + ff: Partial; + safari: Partial; + webdev: Partial; + other: Partial; +}; + +type Standards = { + spec: string; + maturity: { + text: string; + short_text: string; + val: number; + }; +}; + +export type ChromeStatusV1ApiFeature = { + id: number; + name: string; + summary: string; + blink_components: string[]; + star_count: number; + search_tags: string[]; + created: UserAction; + updated: UserAction; + category: string; + category_int: number; + feature_notes: string | null; + enterprise_feature_categories: any[]; // Define more specifically if possible + stages: Stage[]; + accurate_as_of: string; + creator_email: string; + updater_email: string; + owner_emails: string[]; + editor_emails: string[]; + cc_emails: string[]; + spec_mentor_emails: string[]; + unlisted: boolean; + deleted: boolean; + editors: string[]; + cc_recipients: string[]; + spec_mentors: string[]; + creator: string; + feature_type: string; + feature_type_int: number; + intent_stage: string; + intent_stage_int: number; + active_stage_id: number; + bug_url: string; + launch_bug_url: string | null; + new_crbug_url: string; + screenshot_links: string[]; + breaking_change: boolean; + flag_name: string | null; + finch_name: string | null; + non_finch_justification: string | null; + ongoing_constraints: string | null; + motivation: string; + devtrial_instructions: string | null; + activation_risks: string | null; + measurement: string | null; + availability_expectation: string | null; + adoption_expectation: string | null; + adoption_plan: string | null; + initial_public_proposal_url: string | null; + explainer_links: string[]; + requires_embedder_support: boolean; + spec_link: string; + api_spec: boolean; + interop_compat_risks: string | null; + all_platforms: string | null; + all_platforms_descr: string | null; + non_oss_deps: string | null; + anticipated_spec_changes: string | null; + security_risks: string; + ergonomics_risks: string | null; + wpt: boolean; + wpt_descr: string; + webview_risks: string | null; + devrel_emails: string[]; + debuggability: string | null; + doc_links: string[]; + sample_links: string[]; + prefixed: boolean | null; + tags: string[]; + tag_review: string | null; + tag_review_status: string; + tag_review_status_int: number; + security_review_status: string; + security_review_status_int: number; + privacy_review_status: string; + privacy_review_status_int: number; + updated_display: string; + resources: { + samples: string[]; + docs: string[]; + }; + comments: string | null; + ff_views: number; + safari_views: number; + web_dev_views: number; + browsers: Browsers; + standards: Standards; + is_released: boolean; + is_enterprise_feature: boolean; + experiment_timeline: string | null; +}; + +export type ChromeStatusFeatures = { + total_count: number; + features: ChromeStatusV1ApiFeature[]; +}; + +export async function chromeStatusApiFeatures(): Promise { + return (await fetchDirtyJson( + "https://chromestatus.com/api/v0/features", + ")]}'\n" + )) as Promise; +} + +export default chromeStatusApiFeatures; + +export async function getChromeStatusApiFeatures() { + const features = await chromeStatusApiFeatures(); + return features.features; +} + +export async function getChromeStatusApiFeatureids() { + const features = await getChromeStatusApiFeatures(); + const featureIds = features.map((feature) => feature.id); + return featureIds; +} + +export async function getChromeStatusV1Feature( + id: number +): Promise { + const features = await getChromeStatusApiFeatures(); + const feature = features.find((feature) => feature.id === id); + return feature; +} \ No newline at end of file diff --git a/src/examples/autobake/chromeStatusFeaturesV2.ts b/src/examples/autobake/chromeStatusFeaturesV2.ts new file mode 100644 index 0000000..6d60edc --- /dev/null +++ b/src/examples/autobake/chromeStatusFeaturesV2.ts @@ -0,0 +1,90 @@ +import { BrowserInfo } from "./chromeStatusApiFeatures.js"; +import fetchJson from "./fetchJson.js"; + +export type ChromeStatusV2ApiFeature = { + blink_components: string[]; + breaking_change: boolean; + browsers: { + chrome: BrowserInfo; + ff: Partial; + other: Partial; + safari: Partial; + webdev: Partial; + }; + created: RecordInfo; + first_of_section: boolean; + id: number; + is_released: boolean; + milestone: null | string; // Assuming the type for milestone can be string or null + name: string; + resources: { + docs: string[]; + samples: string[]; + }; + standards: { + maturity: Maturity; + spec: string; + }; + summary: string; + unlisted: boolean; + updated: RecordInfo; +}; + +export type ChromeBrowser = { + blink_components: string[]; + bug: string; + devrel: string[]; + flag: boolean; + intervention: boolean; + origintrial: boolean; + owners: string[]; + prefixed: boolean; + status: Status; +}; + +export type BrowserView = { + view: { + notes: string; + text: string; + url: string | null; + val: number; + }; +}; + +type RecordInfo = { + by: string; + when: string; // Use Date if dates are always in a consistent format +}; + +type Maturity = { + short_text: string; + text: string; + val: number; +}; + +type Status = { + text: string; + val: number; +}; + +export async function chromeStatusFeaturesV2(): Promise< + ChromeStatusV2ApiFeature[] +> { + return (await fetchJson( + "https://chromestatus.com/features_v2.json" + )) as Promise; +} + +export default chromeStatusFeaturesV2; + +export async function getChromeStatusV2FeatureIds(): Promise { + const features = await chromeStatusFeaturesV2(); + return features.map((feature) => feature.id); +} + +export async function getChromeStatusV2Feature( + id: number +): Promise { + const features = await chromeStatusFeaturesV2(); + return features.find((feature) => feature.id === id); +} diff --git a/src/examples/autobake/chromeVersions.ts b/src/examples/autobake/chromeVersions.ts new file mode 100644 index 0000000..52f06d1 --- /dev/null +++ b/src/examples/autobake/chromeVersions.ts @@ -0,0 +1,27 @@ +import fetchJson from "./fetchJson.js"; + +export const versionsUrl = "https://chromestatus.com/omaha_data"; +export type Channel = "stable" | "beta" | "dev"; + +// text utility type for version number +export type VersionNumber = `${number}.${number}.${number}.${number}`; +export type Version = { + channel: Channel; + version: VersionNumber; +}; + +export type Versions = { + versions: Version[]; +}[]; + +export async function chromeVersions() { + const versions: Versions = (await fetchJson(versionsUrl)) as Versions; + console.log("AYOOOOOOOOOOOOOOOOO") + // key versions by channel and return object with channel keys + return versions[0].versions.reduce((acc, version) => { + acc[version.channel] = version.version; + return acc; + }, {} as Record); +} + +export default chromeVersions; \ No newline at end of file diff --git a/src/examples/autobake/crossEnvCache.ts b/src/examples/autobake/crossEnvCache.ts new file mode 100644 index 0000000..910ca02 --- /dev/null +++ b/src/examples/autobake/crossEnvCache.ts @@ -0,0 +1,118 @@ +import fs from "fs"; +import path, { dirname } from "path"; +import { fileURLToPath } from "url"; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); + +const memoryCache: Record = {}; + +export function makeCacheDirectory(cacheFilePath: string) { + const cacheDirectory = path.dirname(cacheFilePath); + if (!fs.existsSync(cacheDirectory)) { + fs.mkdirSync(cacheDirectory, { recursive: true }); + } +} + +export function writeCacheNode(url: string, data: unknown) { + const cacheFilePath = getCacheFilePath(url); + makeCacheDirectory(cacheFilePath); + fs.writeFileSync(cacheFilePath, JSON.stringify(data)); +} + +export const isNode = + typeof process !== "undefined" && + process.versions != null && + process.versions.node != null; + +export function isEnvNode() { + return isNode; +} + +export function writeCache(url: string, data: unknown) { + memoryCache[url] = { data, timestamp: new Date().getTime() }; + + if (isNode) { + writeCacheNode(url, data); + } else { + writeCacheWeb(url, data); + } +} + +export function readCache(url: string, maxAge: Date = DEFAULT_MAX_AGE) { + // First, check in-memory cache + const cachedItem = memoryCache[url]; + if (cachedItem) { + const now = new Date().getTime(); + if (now - cachedItem.timestamp <= maxAge.getTime()) { + return cachedItem.data; + } + // If in-memory cache is stale, remove the entry + delete memoryCache[url]; + } + + // Then, check file-based cache + if (isNode) { + return readCacheNode(url, maxAge); + } else { + return readCacheWeb(url, maxAge); + } +} + +const now = new Date(); +const DEFAULT_MAX_AGE: Date = new Date(now.setDate(now.getDate() - 1)); + +// Modifications needed for web environment caching +export function readCacheWeb(url: string, maxAge: Date = DEFAULT_MAX_AGE) { + const data = localStorage.getItem(url); + if (data) { + const cachedData = JSON.parse(data); + const now = new Date(); + + // Check if the cached data includes a timestamp and if it's expired + if ( + cachedData.timestamp && + now.getTime() - cachedData.timestamp > maxAge.getTime() + ) { + return null; + } + + return cachedData.data; + } + return null; +} + +export function writeCacheWeb(url: string, data: unknown) { + const cacheData = { + data: data, + timestamp: new Date().getTime(), // Add a timestamp + }; + localStorage.setItem(url, JSON.stringify(cacheData)); +} + +export function getCacheFilePath(url: string) { + let encodedUri = encodeURIComponent(url); + if (!encodedUri.endsWith(".json")) { + encodedUri += ".json"; + } + return path.join(__dirname, ".cache", encodedUri); +} + +export function readCacheNode(url: string, maxAge: Date = DEFAULT_MAX_AGE) { + const cacheFilePath = getCacheFilePath(url); + if (fs.existsSync(cacheFilePath)) { + const stats = fs.statSync(cacheFilePath); + const now = new Date(); + if ( + maxAge !== undefined && + now.getTime() - stats.mtime.getTime() > maxAge.getTime() + ) { + return null; + } + + return JSON.parse(fs.readFileSync(cacheFilePath, "utf-8")); + } + return null; +} + +export default readCache; \ No newline at end of file diff --git a/src/examples/autobake/featurekit.ts b/src/examples/autobake/featurekit.ts new file mode 100644 index 0000000..615ace9 --- /dev/null +++ b/src/examples/autobake/featurekit.ts @@ -0,0 +1,312 @@ +/* eslint-disable no-constant-condition */ +import claude from "@anthropic-ai/tokenizer/claude.json" assert { type: "json" }; +import { InputValues, NodeValue, OutputValues, addKit, asRuntimeKit, code } from "@google-labs/breadboard"; +import { KitBuilder } from "@google-labs/breadboard/kits"; +import { Tiktoken, TiktokenBPE } from "js-tiktoken"; +import * as puppeteer from "puppeteer"; +import { Browser, JSHandle, Page } from "puppeteer"; +import * as readline from 'readline/promises'; +import { chromeVersions } from "./chromeVersions.js"; +import chromeStatusApiFeatures, { ChromeStatusFeatures, ChromeStatusV1ApiFeature, getChromeStatusV1Feature } from "./chromeStatusApiFeatures.js"; +import chromeStatusFeaturesV2 from "./chromeStatusFeaturesV2.js"; +import fs from "fs"; + + +export function getTokenizer(): Tiktoken { + const tiktokenBPE: TiktokenBPE = { + pat_str: claude.pat_str, + special_tokens: claude.special_tokens, + bpe_ranks: claude.bpe_ranks, + }; + return new Tiktoken(tiktokenBPE); +} + +type pageContents = { + contents: NodeValue +}; + +type feature = { + id: NodeValue, + name: NodeValue, + summary: NodeValue, + category: NodeValue, + docs: NodeValue[], + samples: NodeValue[] +}; + +const TOKEN_LIMIT: number = 99_000; + +type featureDocuments = NodeValue + +const sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms)); + +export function countTokens(text: string): number { + const tokenizer = getTokenizer(); + const encoded = tokenizer.encode(text.normalize("NFKC")); + return encoded.length; +} + +export async function extractContents(url: string): Promise { + const browser: Browser = await puppeteer.launch({ + headless: true, + args: ['--no-sandbox'], + ignoreDefaultArgs: ['--disable-extensions'] + }); + const page: Page = await browser.newPage(); + + console.log("Extracting Feature Resources: ", url); + + await page.goto(url, { waitUntil: 'load' }); + // sleep because some page elements might not immediately render + await sleep(5000); + const element: JSHandle = await page.evaluateHandle(`document.querySelector("body")`); + + let contents = await page.evaluate((el: any) => el.textContent, element); + contents = contents.replace(/[\n\r]/g, ""); + + await browser.close(); + + return Promise.resolve({ contents }); +} + +async function extractFeatureResource(id: string): Promise { + const browser = await puppeteer.launch({ + headless: true, + args: ['--no-sandbox'], + ignoreDefaultArgs: ['--disable-extensions'] + }); + const page = await browser.newPage(); + + const baseURL = "https://chromestatus.com/feature/" + const featureURL = `${baseURL}${id}`; + console.log("Extracting Feature Content: ", featureURL); + + await page.goto(featureURL, { waitUntil: 'load' }); + // sleep to wait for page to render + await sleep(5000); + const element = await page.evaluateHandle(`document.querySelector("body > chromedash-app").shadowRoot.querySelector("#content-component-wrapper > chromedash-feature-page").shadowRoot.querySelector("sl-details")`); + + let contents = await page.evaluate((el: any) => el.textContent, element); + + contents = contents.replace(/[\n\r]/g, ""); + + await browser.close(); + + return Promise.resolve({ contents }); +} + +function filterAttributes(obj: any) { + // recursively remove any falsy attributes + if (!obj) { + return + } else if (typeof obj === "object") { + const newObj: any = {} + for (const [key, value] of Object.entries(obj)) { + const newValue = filterAttributes(value) + if (newValue) { + newObj[key] = newValue + } + } + if (Object.keys(newObj).length > 0) { + return newObj + } else { + return + } + } + // if array + else if (Array.isArray(obj)) { + const newArray: any[] = [] + for (const value of obj) { + const newValue = filterAttributes(value) + if (newValue) { + newArray.push(newValue) + } + } + return newArray + } + + return obj +} + +const filterFeatureAttributes = code<{feature: any}, OutputValues> (({feature}) => +{ + feature = feature["selected"] + const output = filterAttributes(feature) + return {filtered: output} +}) + +const selectRandom = code<{ input: ChromeStatusFeatures }, OutputValues>(async ({ input }) => { + const myList = input["features"] + const selected = myList[Math.floor(Math.random() * myList.length)] + + return {selected: selected} +}) + +const getFeatureResources = code<{ input: ChromeStatusFeatures }, OutputValues>(async ({ input }) => { + const featuresMap = new Map(); + + for (var json of input["features"]) { + const feature = { + id: json["id"], + name: json["name"], + summary: json["summary"], + category: json["category"], + docs: json["resources"]["docs"], + samples: json["resources"]["samples"] + }; + + featuresMap.set(`${json["id"]}`, feature); + } + + const featureResources: featureDocuments[] = []; + const userInput = readline.createInterface({ + input: process.stdin, + output: process.stdout + }); + + try { + while (true) { + const answer = await userInput.question('Please select a feature id to extract: '); + if (featuresMap.has(answer)) { + const webContent = await extractFeatureResource(answer); + featureResources.push(webContent["contents"]); + + const feature = featuresMap.get(answer); + const featureDocs = feature!["docs"]; + const featureSamples = feature!["samples"]; + + // extract documentation contents + for (const doc of featureDocs) { + const webContent = await extractContents(doc as string) + featureResources.push(webContent["contents"]); + } + // extract samples content + for (const sample of featureSamples) { + const webContent = await extractContents(sample as string) + featureResources.push(webContent["contents"]); + } + + // Claude has token limit, keep trimming each document until we are below the token limit + // set to 99,000 as extra tokens will be added when constructing hte prompt + // maybe trim the larger documents with a different coefficient? 20% of a large document might lose + // a lot of useful information + while (true) { + let tokenCount = 0 + for (let i = 0; i < featureResources.length; i++) { + tokenCount += countTokens(featureResources[i] as string); + } + + if (tokenCount >= TOKEN_LIMIT) { + for (let i = 0; i < featureResources.length; i++) { + // only keep 80% of the current content + // there's probably a better way to do that, but it's difficult to know the structure of the HTML because it all comes from different sources + featureResources[i] = (featureResources[i] as string).substring(0, (featureResources[i] as string).length * 0.8); + } + } else { + break; + } + } + const outputBuffer = []; + const baseURL = "https://chromestatus.com/feature/" + outputBuffer.push({ url: `${baseURL}${answer}`, content: featureResources }); + // write all extracted content to file + fs.writeFileSync( + "./featureContent.json", + JSON.stringify(outputBuffer, null, 2) + ); + break + } else { + console.log("Feature Id does not exist, please check input") + } + } + } finally { + userInput.close(); + } + return Promise.resolve({ featureResources }); +}) + +async function getResourcesForFeature({ feature }: InputValues & { feature: ChromeStatusV1ApiFeature }): Promise { + const selectedFeature = feature["selected"] + + const featureId = selectedFeature.id + const featureDocs = selectedFeature.resources.docs + const featureSamples = selectedFeature.resources.samples + const resources: featureDocuments[] = [] + + // extract feature content + const webContent = await extractFeatureResource(featureId.toString()) + resources.push(webContent["contents"]) + + // extract documentation contents + for (const doc of featureDocs) { + const webContent = await extractContents(doc as string) + resources.push(webContent["contents"]) + } + + // extract samples content + for (const sample of featureSamples) { + const webContent = await extractContents(sample as string) + resources.push(webContent["contents"]) + } + + let documentTokens: number[] = [] + const getTokenCounts = () => { + documentTokens = resources.map(r => { + return countTokens(r as string); + }) + return documentTokens + } + + getTokenCounts() + let totalTokens = () => documentTokens.reduce((a, b) => a + b, 0) + while (totalTokens() > TOKEN_LIMIT) { + const difference = totalTokens() - TOKEN_LIMIT + for (let i = 0; i < resources.length; i++) { + const docTokens = documentTokens[i] + const proportionOfAllTokens: number = Math.ceil(docTokens / totalTokens()); + const tokensToDrop: number = proportionOfAllTokens * difference; + const endIndex: number = (resources[i] as string).length - tokensToDrop; + resources[i] = (resources[i] as string).substring(0, endIndex) + } + getTokenCounts() + } + return Promise.resolve({ resources }); +} + +export const FeatureKit = new KitBuilder({ + url: "." +}).build({ + versions: async () => ( + { + output: await chromeVersions() + } + ), + chromeStatusApiFeatures: async () => ( + { + output: await chromeStatusApiFeatures() + } + ), + chromeStatusApiFeaturesV2: async () => ({ + output: await chromeStatusFeaturesV2() + }), + getFeatureResources: async (input) => ({ + output: await getFeatureResources({input: input as ChromeStatusFeatures }) + }), + getResourcesForFeature: async ({feature}) => ( + { + output: await getResourcesForFeature({feature : feature as ChromeStatusV1ApiFeature }) + } + ), + selectRandomFeature: async ({features}) => ( + { + output: await selectRandom({ input: features as ChromeStatusFeatures }) + } + ), + filterFeatureAttributes: async ({feature}) => ({ + output: await filterFeatureAttributes({feature: feature}) + }) +}) + + +export type FeatureKit = InstanceType; +export default FeatureKit; \ No newline at end of file diff --git a/src/examples/autobake/fetchDirtyJson.ts b/src/examples/autobake/fetchDirtyJson.ts new file mode 100644 index 0000000..a8ef74e --- /dev/null +++ b/src/examples/autobake/fetchDirtyJson.ts @@ -0,0 +1,29 @@ +import readCache, { writeCache } from "./crossEnvCache.js"; + +export async function fetchDirtyJson( + url: string, + excessString: string +): Promise { + let jsonData = readCache(url); + + if (jsonData) { + return jsonData; + } + + const response = await fetch(url); + if (!response.ok) { + throw new Error(`HTTP error! status: ${response.status}`); + } + + let data = await response.text(); + if (data.startsWith(excessString)) { + data = data.substring(excessString.length); + } + + jsonData = JSON.parse(data); + writeCache(url, jsonData); + + return jsonData; +} + +export default fetchDirtyJson; \ No newline at end of file diff --git a/src/examples/autobake/fetchJson.ts b/src/examples/autobake/fetchJson.ts new file mode 100644 index 0000000..ce11eed --- /dev/null +++ b/src/examples/autobake/fetchJson.ts @@ -0,0 +1,17 @@ +import {readCache, writeCache} from "./crossEnvCache.js"; + +export async function fetchJson(url: string): Promise { + let jsonData = readCache(url); + + const response = await fetch(url); + if (!response.ok) { + throw new Error(`HTTP error! status: ${response.status}`); + } + + jsonData = await response.json(); + writeCache(url, jsonData); + + return jsonData; +} + +export default fetchJson; \ No newline at end of file diff --git a/src/examples/autobake/index.ts b/src/examples/autobake/index.ts new file mode 100644 index 0000000..2cb1499 --- /dev/null +++ b/src/examples/autobake/index.ts @@ -0,0 +1,95 @@ +import { BoardRunner, OutputValues, addKit, asRuntimeKit, board, code } from "@google-labs/breadboard"; + +import Core from "@google-labs/core-kit"; +import fs from "fs" + +import { FeatureKit } from "./featurekit.js"; +import { StringKit } from "./kits/StringKit.js" +import { ClaudeKit } from "./kits/ClaudeKit.js" +import { ConfigKit } from "./kits/ConfigKit.js" +import { ObjectKit } from "./kits/ObjectKit.js" + +const featureKit = addKit(FeatureKit) +const claudeKit = addKit(ClaudeKit); +const stringKit = addKit(StringKit) +const config = addKit(ConfigKit) + +const serverUrl = "https://api.anthropic.com/v1/complete"; + +const claudeParams = { + model: "claude-2", + url: `${serverUrl}`, +}; + +const prompt = [ + "Create a markdown document that can be used to teach a junior developer about the feature discussed in the `feature` code block.", + "Base the script on the content of the `featureResources` code block.", + "The first line of the document should be a heading with the name of the feature.", + "\n", + "Provide your response formatted as raw markdown.", + "Only respond with the result of this request.", + "Do not add any additional information to the script", + "\n", + "```featureResources", + "{{featureResources}}", + "```", + "\n", + "```selectedFeature", + "{{selectedFeature}}", + "```", +].join("/n"); + +const autoBakeBoard = board(() => { + const features = featureKit.chromeStatusApiFeatures({ $id: "ChromeStatusApiFeatures" }) + const selected = featureKit.selectRandomFeature({$id:"selectRandomFeature", features: features.output }) + const featureContent = featureKit.getResourcesForFeature({ $id: "getResourcesForFeature", feature: selected.output }) + + const filtered = featureKit.filterFeatureAttributes({ feature: selected.output }) + + const instructionTemplate = stringKit.template({ + $id: "claudePromptConstructor", + template: prompt, + }); + + featureContent.output.as("featureResources").to(instructionTemplate) + filtered.output.as("selectedFeature").to(instructionTemplate) + + const claudeCompletion = claudeKit.complete({ + $id: "claudeAPI", + ...claudeParams, + }); + + const claudeApiKey = config.readEnvVar({ + key: "CLAUDE_API_KEY", + path:"." + }); + + claudeApiKey.output.to(claudeCompletion); + instructionTemplate.output.as("text").to(claudeCompletion); + + const output = claudeCompletion.completion + + return { output } +}) + +const serializedBoard = await autoBakeBoard.serialize({ + title: "AutoBake", + description: "AutoBake Board Example", + url: ".", +}) + +const kits = [asRuntimeKit(ConfigKit) , asRuntimeKit(FeatureKit), asRuntimeKit(FeatureKit), asRuntimeKit(FeatureKit), asRuntimeKit(ObjectKit), asRuntimeKit(Core), asRuntimeKit(StringKit), asRuntimeKit(ClaudeKit)] + +// running board from json and providing kit at runtime +const runner = await BoardRunner.fromGraphDescriptor(serializedBoard); +for await (const stop of runner.run({ kits: kits })) { + if (stop.type === "input") { + } else if (stop.type === "output") { + const content = [, + stop.outputs.output as string, + "---", + ].join("\n\n") + + fs.writeFileSync("./test.md", content); + } +} \ No newline at end of file diff --git a/src/examples/autobake/kits/ClaudeKit.ts b/src/examples/autobake/kits/ClaudeKit.ts new file mode 100644 index 0000000..ebfaa20 --- /dev/null +++ b/src/examples/autobake/kits/ClaudeKit.ts @@ -0,0 +1,140 @@ +/* eslint-disable @typescript-eslint/require-await */ +/* eslint-disable @typescript-eslint/no-unsafe-member-access */ +/* eslint-disable @typescript-eslint/no-unsafe-return */ +/* eslint-disable @typescript-eslint/no-unsafe-assignment */ +import claude from "@anthropic-ai/tokenizer/claude.json" assert { type: "json" }; +import { InputValues, OutputValues } from "@google-labs/breadboard"; +import { KitBuilder } from "@google-labs/breadboard/kits"; +import { Tiktoken, TiktokenBPE } from "js-tiktoken"; + +export type ClaudeResponse = { + completion: string; + stop_reason: "stop_sequence" | "max_tokens"; +}; + +export type ClaudeParams = { + apiKey: string; + model: "claude-2" | "claude-instant-1"; + userQuestion: string; + maxTokens: number; + stopSequences?: string[]; + temperature?: number; + topP?: number; + topK?: number; + stream?: boolean; + url?: string; +}; + +export function countTokens(text: string): number { + const tokenizer = getTokenizer(); + const encoded = tokenizer.encode(text.normalize("NFKC")); + return encoded.length; +} + +export function getTokenizer(): Tiktoken { + const tiktokenBPE: TiktokenBPE = { + pat_str: claude.pat_str, + special_tokens: claude.special_tokens, + bpe_ranks: claude.bpe_ranks, + }; + return new Tiktoken(tiktokenBPE); +} + +const complete = async (input: InputValues): Promise => { + let claudeParams = { + "model": input["model"], + } + + if (input["output"] != undefined) { + claudeParams["apiKey"] = input["output"]["CLAUDE_API_KEY"] + } + + if (input["text"] != undefined) { + claudeParams["userQuestion"] = input["text"]["string"] + } + + return await postClaudeCompletion(claudeParams as ClaudeParams); +} + +export const ClaudeKit = new KitBuilder({ + url: "npm:@exadev/breadboard-kits/Claude", +}).build({ + complete, + async countTokens(input: InputValues): Promise { + return Object.fromEntries( + Object.entries(input) + .filter(([, value]) => typeof value === "string") + .map(([key, value]) => [key, countTokens(value as string)]) + ); + }, +}); + +export async function postClaudeCompletion({ + apiKey, + model, + userQuestion, + maxTokens, + stopSequences, + temperature, + topP, + topK, + stream, + url, +}: ClaudeParams): Promise { + if (!apiKey) throw new Error("Missing apiKey"); + if (!userQuestion) throw new Error("Missing userQuestion"); + model = model || "claude-2"; + // Endpoint URL + // const url = "https://api.anthropic.com/v1/complete"; + url = url || "https://api.anthropic.com/v1/complete"; + // Request headers + const headers = { + accept: "application/json", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": apiKey, + }; + + + // Constructing the prompt + const prompt = `\n\nHuman: ${userQuestion}\n\nAssistant:`; + + const inputTokenCount = countTokens(prompt); + const TOKEN_LIMIT = 100000; + maxTokens = maxTokens || TOKEN_LIMIT - inputTokenCount; + if (maxTokens < 0) + throw new Error( + `input token count ${inputTokenCount} exceeds token limit ${TOKEN_LIMIT}!` + ); + + // Request body + const body = { + model, + prompt, + max_tokens_to_sample: maxTokens, + ...(stopSequences && { stop_sequences: stopSequences }), + ...(temperature !== undefined && { temperature }), + ...(topP !== undefined && { top_p: topP }), + ...(topK !== undefined && { top_k: topK }), + ...(stream !== undefined && { metadata: { stream } }), + }; + + try { + const response = await fetch(url, { + method: "POST", + headers: headers, + body: JSON.stringify(body), + }); + + if (!response.ok) + throw new Error(`HTTP error! status: ${response.status}:${response.statusText}`); + + return (await response.json()) as ClaudeResponse; + } catch (error) { + console.error("Error:", error); + throw error; + } +} + +export type ClaudeKit = InstanceType; +export default ClaudeKit \ No newline at end of file diff --git a/src/examples/autobake/kits/ConfigKit.ts b/src/examples/autobake/kits/ConfigKit.ts new file mode 100644 index 0000000..d93f883 --- /dev/null +++ b/src/examples/autobake/kits/ConfigKit.ts @@ -0,0 +1,55 @@ +import { InputValues, NodeValue, OutputValues, code } from "@google-labs/breadboard"; +import { KitBuilder } from "@google-labs/breadboard/kits"; +import dotenv from "dotenv"; +import fs from "fs"; +import path from "path"; + +export function getAbsoluteFilePath(envPath: string = ".env"): string { + if (!path.isAbsolute(envPath)) { + envPath = path.join(process.cwd(), envPath); + } + return envPath; +} +export type getAbsoluteFilePath = typeof getAbsoluteFilePath; + + +const readEnv = code<{ path: string; }, OutputValues>(({ path }) => { + if (path && !fs.existsSync(path)) { + throw new Error(`Path "${path}" was explicitly specified but does not exist`); + } + + const envPath = getAbsoluteFilePath(path || ".env"); + if (fs.existsSync(envPath)) { + dotenv.config({ path: envPath }); + } + return Promise.resolve(process.env); + }); + + +const readEnvVar = code<{key: string, path:string}, OutputValues>(async ({key, path}) => { + const env = await readEnv({path}); + + const value = env[key]; + if (value === undefined) { + const absolutePath = getAbsoluteFilePath(path); + throw new Error(`"${key}" not found in environment or "${absolutePath}"`); + } + return Promise.resolve({ [key]: env[key] }); +}) + +export const ConfigKit = new KitBuilder({ + url: "npm:@exadev/breadboard-kits/kits/ConfigKit", +}).build({ + readEnv: async (path) => ( + { + output: await readEnv(path) + } + ), + readEnvVar: async ({key, path}) => ( + { + output: await readEnvVar({key: key as string, path:path as string}) + } + ) +}); +export type ConfigKit = InstanceType; +export default ConfigKit; \ No newline at end of file diff --git a/src/examples/autobake/kits/ObjectKit.ts b/src/examples/autobake/kits/ObjectKit.ts new file mode 100644 index 0000000..03420c4 --- /dev/null +++ b/src/examples/autobake/kits/ObjectKit.ts @@ -0,0 +1,119 @@ +import { InputValues, NodeValue, OutputValues, code } from "@google-labs/breadboard"; +import { KitBuilder } from "@google-labs/breadboard/kits"; + + +const pick = code<{ object: Record, key: string; }, OutputValues>(({ object, key }) => { + const { [key]: value, ...rest } = object; + return Promise.resolve({ + value, + rest, + }); +}); + +const pickSeveral = code<{ object: Record, keys: string[]; }, OutputValues>(({ object, keys }) => { + const values = {}; + for (const key of keys) { + const { [key]: value, ...rest } = object; + values[key] = value; + object = rest; + } + return Promise.resolve({ + ...values, + rest: object, + }); +}) + +const spread = code<{ object: Record }, OutputValues & { [key: string]: NodeValue; }>(({ object }) => { + return Promise.resolve({ + ...object, + }); +}) + +const nest = code<{ inputs: InputValues, key: string }, OutputValues>(({ inputs, key }) => { + const { ...rest } = inputs; + return Promise.resolve({ + [key]: rest, + }) +}) + +const limitDepthCall = code<{ object: Record, depth: number }, OutputValues>(({ object, depth }) => { + return Promise.resolve({ + object: limitDepth(object, depth), + }); +}) + +export const ObjectKit = new KitBuilder({ + url: "npm:@exadev/breadboard-kits/kits/ObjectKit", +}).build({ + pick: async ({ object, key }) => ({ + output: await pick({ object: object as Record, key: key as string }) + }), + pickSeveral: async ({ object, keys }) => ({ + output: await pickSeveral({ object: object as Record, keys: keys as string[] }) + }), + spread: async ({ object }) => ({ + output: await spread({ object: object as Record }) + }), + nest: async ({ inputs, key }) => ({ + output: await nest({ inputs: inputs as InputValues, key: key as string }) + }), + limitDepth: async ({ object, depth }) => ({ + output: await limitDepthCall({ object: object as Record, depth: depth as number }) + }) +}); + +// Wrapper function to limit the depth of an object +export function limitDepth(obj: AnyObject, maxDepth: number): AnyObject { + const currentDepth = calculateDepth(obj); + if (currentDepth > maxDepth) { + return reduceDepth(obj, maxDepth); + } + return obj; // Return the object as is if it's within the depth limit +} // Function to reduce the depth of an object +function reduceDepth(obj: AnyObject, maxDepth: number): AnyObject { + function reduce(obj: AnyObject, currentDepth: number): AnyObject { + if (currentDepth === maxDepth) { + return Array.isArray(obj) ? [] : {}; + } + + const result: AnyObject = Array.isArray(obj) ? [] : {}; + + for (const key in obj) { + if (typeof obj[key] === "object" && obj[key] !== null) { + result[key] = reduce(obj[key], currentDepth + 1); + } else { + result[key] = obj[key]; + } + } + + return result; + } + + return reduce(obj, 0); +} + +function calculateDepth(obj: AnyObject, currentDepth: number = 0): number { + if (typeof obj !== "object" || obj === null) { + return currentDepth; + } + + let maxDepth = currentDepth; + for (const key in obj) { + if (typeof obj[key] === "object" && obj[key] !== null) { + + const depth = calculateDepth(obj[key], currentDepth + 1); + if (depth > maxDepth) { + maxDepth = depth; + } + } + } + + return maxDepth; +} +////////////////////////////////////////////////// +export interface AnyObject { + [key: string]: any; +} + +export type ObjectKit = InstanceType; +export default ObjectKit; diff --git a/src/examples/autobake/kits/StringKit.ts b/src/examples/autobake/kits/StringKit.ts new file mode 100644 index 0000000..c5179c0 --- /dev/null +++ b/src/examples/autobake/kits/StringKit.ts @@ -0,0 +1,63 @@ + +import { BoardRunner, board, addKit, asRuntimeKit, InputValues, base, code, OutputValues, NodeValue } from "@google-labs/breadboard"; +import { KitBuilder } from "@google-labs/breadboard/kits"; + +export function parametersFromTemplate(template: string): string[] { + const matches = template.matchAll(/{{(?[\w-]+)}}/g); + const parameters = Array.from(matches).map( + (match) => match.groups?.name || "" + ); + return Array.from(new Set(parameters)); +} + +export const stringify = (value: unknown): string => { + if (typeof value === "string") return value; + if (value === undefined) return "undefined"; + return JSON.stringify(value, null, 2); +}; + +export function substitute(template: string, values: InputValues) { + return Object.entries(values).reduce( + (acc, [key, value]) => acc.replace(`{{${key}}}`, stringify(value)), + template + ); +} + +const concat = code<{ input: string[]; }, OutputValues>(({ input }) => { + return { output: input.join("") }; +}); + +const templatePrompt = code<{ selectedFeature: string, featureResources: string, template: string }, OutputValues>(({selectedFeature, featureResources , template }) => { + const parameters = parametersFromTemplate(template); + const selectedInput = selectedFeature["filtered"] + const resourcesInput = featureResources["resources"] + + if (!parameters.length) return { string: template }; + const substitutes = parameters.reduce((acc, parameter) => { + if (selectedFeature === undefined || featureResources === undefined) + throw new Error(`Input is missing parameter "${parameter}"`); + const inputs = {"selectedFeature": selectedInput, "featureResources": resourcesInput } + return { ...acc, [parameter]: inputs[parameter] }; + }, {}); + + const string = substitute(template, substitutes); + return Promise.resolve({ string }); +}); + +export const StringKit = new KitBuilder({ + url: ".", +}).build({ + concat: async ({list}) => ( + { + output: await concat({input: list as string[]}) + } + ), + template: async ({selectedFeature, featureResources, template}) => ( + { + output: await templatePrompt({ selectedFeature: selectedFeature as string, featureResources: featureResources as string, template: template as string }) + } + ) +}); + +export type StringKit = InstanceType; +export default StringKit; \ No newline at end of file diff --git a/src/examples/autobake/test.md b/src/examples/autobake/test.md new file mode 100644 index 0000000..51be267 --- /dev/null +++ b/src/examples/autobake/test.md @@ -0,0 +1,35 @@ + + + # CSS paint-order for non-SVG text + +Adds support for the existing CSS property `paint-order`. This change only affects html (non-SVG) text; SVG text already supports paint-order via attribute or CSS property. + +## Summary + +This feature adds support for using the `paint-order` CSS property on non-SVG text. The `paint-order` property controls the order that the fill, stroke, and marker of text are painted. This allows text to mimic the effect of SVG text, which already supports `paint-order`. + +## Implementation Status + +- **Blink Component:** Blink>Paint +- **Chromium Bug:** [41372165](https://crbug.com/41372165) +- **Implementation Status:** Enabled by default (Milestone 123) +- **Enterprise Impact:** Minor + +## Consensus & Standardization + +- **Firefox:** Shipped/Shipping +- **Safari:** Shipped/Shipping +- **Web Developers:** No signals + +## Next Steps + +- Review potential enterprise impact +- Complete security review +- Complete privacy review + +## References + +- [Intent to Implement](https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAHOQ7J9i%3DwoeX%2Bh%2B1rwpidM%3D5SiMPnCq9fskupy2tDUjXcMAMw%40mail.gmail.com) +- [Chromium Bug](https://crbug.com/41372165) (New bugs: [File a bug](https://bugs.chromium.org/p/chromium/issues/entry?components=Blink%3EPaint&cc=szager%40chromium.org)) + +--- \ No newline at end of file diff --git a/src/examples/kit-with-code-node/README.md b/src/examples/kit-with-code-node/README.md index edb4cdb..43cf2b8 100644 --- a/src/examples/kit-with-code-node/README.md +++ b/src/examples/kit-with-code-node/README.md @@ -46,10 +46,7 @@ classDef slotted stroke:#a64d79 "type": "string", "title": "output" } - }, - "required": [ - "output" - ] + } } } }, diff --git a/src/examples/kit-with-code-node/index.ts b/src/examples/kit-with-code-node/index.ts index d00ecbc..6cf17a6 100644 --- a/src/examples/kit-with-code-node/index.ts +++ b/src/examples/kit-with-code-node/index.ts @@ -29,6 +29,7 @@ const kitInstance = addKit(myKit); // using code node via kit const kitBoard = board(({ message }) => { const { output } = kitInstance.pipe(message) + console.log("OUTPUT", output) return { output }; }); diff --git a/tsconfig.json b/tsconfig.json index 28d8b8a..a1a1f2c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,6 +7,8 @@ "noEmit": true, "skipLibCheck": true, "strict": true, - "target": "es2017" + "target": "es2017", + "resolveJsonModule": true, + "suppressImplicitAnyIndexErrors": true, } }