From bfd968c765d3d5333227ff6e1b1734c7a2001254 Mon Sep 17 00:00:00 2001 From: Shivaditya Shivganesh Date: Sat, 19 Oct 2024 00:20:48 -0400 Subject: [PATCH 01/11] fix: added plugin action workflow --- .github/workflows/test.yml | 18 ++++ package.json | 2 +- yarn.lock | 169 ++++++++++++++++++------------------- 3 files changed, 100 insertions(+), 89 deletions(-) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..4dc4ccd --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,18 @@ +name: Update Manifest and Commit Changes +on: + push: + +jobs: + update-manifest: + runs-on: ubuntu-latest + steps: + - name: Update Manifest and Commit Changes + uses: ubiquity-os/action-deploy-plugin@main + with: + manifestPath: ${{ github.workspace }}/manifest.json + schemaPath: ${{ github.workspace }}/src/types/plugin-input.js + pluginEntry: ${{ github.workspace }}/src/index.ts + commitMessage: "chore: updated manifest.json and dist build" + nodeVersion: "20.10.0" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/package.json b/package.json index 31e77a6..12f4432 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,7 @@ "tsx": "4.15.6", "typescript": "5.4.5", "typescript-eslint": "7.13.1", - "wrangler": "3.60.3" + "wrangler": "^3.81.0" }, "lint-staged": { "*.ts": [ diff --git a/yarn.lock b/yarn.lock index a5fea8f..b487cca 100644 --- a/yarn.lock +++ b/yarn.lock @@ -326,37 +326,45 @@ "@types/tough-cookie" "^4.0.5" tough-cookie "^4.1.4" -"@cloudflare/kv-asset-handler@0.3.2": - version "0.3.2" - resolved "https://registry.yarnpkg.com/@cloudflare/kv-asset-handler/-/kv-asset-handler-0.3.2.tgz#06437b75664729823ac9033b89f06a3b078e4f55" - integrity sha512-EeEjMobfuJrwoctj7FA1y1KEbM0+Q1xSjobIEyie9k4haVEBB7vkDvsasw1pM3rO39mL2akxIAzLMUAtrMHZhA== +"@cloudflare/kv-asset-handler@0.3.4": + version "0.3.4" + resolved "https://registry.yarnpkg.com/@cloudflare/kv-asset-handler/-/kv-asset-handler-0.3.4.tgz#5cc152847c8ae4d280ec5d7f4f6ba8c976b585c3" + integrity sha512-YLPHc8yASwjNkmcDMQMY35yiWjoKAKnhUbPRszBRS0YgH+IXtsMp61j+yTcnCE3oO2DgP0U3iejLC8FTtKDC8Q== dependencies: mime "^3.0.0" -"@cloudflare/workerd-darwin-64@1.20240610.1": - version "1.20240610.1" - resolved "https://registry.yarnpkg.com/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-1.20240610.1.tgz#417d18708664ec9662d74280f1f78cd50c209035" - integrity sha512-YanZ1iXgMGaUWlleB5cswSE6qbzyjQ8O7ENWZcPAcZZ6BfuL7q3CWi0t9iM1cv2qx92rRztsRTyjcfq099++XQ== +"@cloudflare/workerd-darwin-64@1.20241011.1": + version "1.20241011.1" + resolved "https://registry.yarnpkg.com/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-1.20241011.1.tgz#044845a13492e409a8b49394d9ecd4d49520f94f" + integrity sha512-gZ2PrMCQ4WdDCB+V6vsB2U2SyYcmgaGMEa3GGjcUfC79L/8so3Vp/bO0eCoLmvttRs39wascZ+JiWL0HpcZUgA== + +"@cloudflare/workerd-darwin-arm64@1.20241011.1": + version "1.20241011.1" + resolved "https://registry.yarnpkg.com/@cloudflare/workerd-darwin-arm64/-/workerd-darwin-arm64-1.20241011.1.tgz#76750e046df9e2fca3f223ff0e3920766973c436" + integrity sha512-c26TYtS0e3WZ09nL/a8YaEqveCsTlgDm12ehPMNua9u68sh1KzETMl2G45O934m8UrI3Rhpv2TTecO0S5b9exA== -"@cloudflare/workerd-darwin-arm64@1.20240610.1": - version "1.20240610.1" - resolved "https://registry.yarnpkg.com/@cloudflare/workerd-darwin-arm64/-/workerd-darwin-arm64-1.20240610.1.tgz#740764dc991414c247cb72dd2c74985196937fa2" - integrity sha512-bRe/y/LKjIgp3L2EHjc+CvoCzfHhf4aFTtOBkv2zW+VToNJ4KlXridndf7LvR9urfsFRRo9r4TXCssuKaU+ypQ== +"@cloudflare/workerd-linux-64@1.20241011.1": + version "1.20241011.1" + resolved "https://registry.yarnpkg.com/@cloudflare/workerd-linux-64/-/workerd-linux-64-1.20241011.1.tgz#c2369ccbf78f362bef89cbee148d573ac47712ed" + integrity sha512-pl4xvHNXnm3cYh5GwHadOTQRWt4Ih/gzCOb6RW4n78oNQQydFvpwqYAjbYk32y485feLhdTKXut/MgZAyWnKyQ== -"@cloudflare/workerd-linux-64@1.20240610.1": - version "1.20240610.1" - resolved "https://registry.yarnpkg.com/@cloudflare/workerd-linux-64/-/workerd-linux-64-1.20240610.1.tgz#62ed716e4b216fd9ca5e40c8fcecf20c16d8fb1b" - integrity sha512-2zDcadR7+Gs9SjcMXmwsMji2Xs+yASGNA2cEHDuFc4NMUup+eL1mkzxc/QzvFjyBck98e92rBjMZt2dVscpGKg== +"@cloudflare/workerd-linux-arm64@1.20241011.1": + version "1.20241011.1" + resolved "https://registry.yarnpkg.com/@cloudflare/workerd-linux-arm64/-/workerd-linux-arm64-1.20241011.1.tgz#5041be32b98e32e53883110b0d8f92bbf40e341a" + integrity sha512-I4HAF2Qe8xgIjAdE53viT2fDdHXkrb3Be0L3eWeeP5SEkOtQ4cHLqsOV7yhUWOJpHiI1XCDcf+wdfn0PB/EngQ== -"@cloudflare/workerd-linux-arm64@1.20240610.1": - version "1.20240610.1" - resolved "https://registry.yarnpkg.com/@cloudflare/workerd-linux-arm64/-/workerd-linux-arm64-1.20240610.1.tgz#c93d924618d69c8eddfe126da321d2efc3865ed0" - integrity sha512-7y41rPi5xmIYJN8CY+t3RHnjLL0xx/WYmaTd/j552k1qSr02eTE2o/TGyWZmGUC+lWnwdPQJla0mXbvdqgRdQg== +"@cloudflare/workerd-windows-64@1.20241011.1": + version "1.20241011.1" + resolved "https://registry.yarnpkg.com/@cloudflare/workerd-windows-64/-/workerd-windows-64-1.20241011.1.tgz#1d900eb644bd0289117238693d7a0cda1aebcff1" + integrity sha512-oVr1Cb7NkDpukd7v68FdxOH8vaHRSzHkX9uE/IttHd2yPK6mwOS220nIxK9UMcx5CwZmrgphRwtZwSYVk/lREQ== -"@cloudflare/workerd-windows-64@1.20240610.1": - version "1.20240610.1" - resolved "https://registry.yarnpkg.com/@cloudflare/workerd-windows-64/-/workerd-windows-64-1.20240610.1.tgz#6e55ba3c253e33c94cf0d2e2f0ac8f7e30e072bb" - integrity sha512-B0LyT3DB6rXHWNptnntYHPaoJIy0rXnGfeDBM3nEVV8JIsQrx8MEFn2F2jYioH1FkUVavsaqKO/zUosY3tZXVA== +"@cloudflare/workers-shared@0.6.0": + version "0.6.0" + resolved "https://registry.yarnpkg.com/@cloudflare/workers-shared/-/workers-shared-0.6.0.tgz#154ed3d496b7276ca9ba8a886437991273a24ee0" + integrity sha512-rfUCvb3hx4AsvdUZsxgk9lmgEnQehqV3jdtXLP/Xr0+P56n11T/0nXNMzmn7Nnv+IJFOV6X9NmFhuMz4sBPw7w== + dependencies: + mime "^3.0.0" + zod "^3.22.3" "@commitlint/cli@19.3.0": version "19.3.0" @@ -2711,11 +2719,6 @@ concat-map@0.0.1: resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== -consola@^3.2.3: - version "3.2.3" - resolved "https://registry.yarnpkg.com/consola/-/consola-3.2.3.tgz#0741857aa88cfa0d6fd53f1cff0375136e98502f" - integrity sha512-I5qxpzLv+sJhTVEoLYNcTW+bThDCPsit0vLNKShZx6rLtpilNpmmeTPaeqJb9ZE9dV3DGaeby6Vuhrw38WjeyQ== - conventional-changelog-angular@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/conventional-changelog-angular/-/conventional-changelog-angular-7.0.0.tgz#5eec8edbff15aa9b1680a8dcfbd53e2d7eb2ba7a" @@ -5052,10 +5055,10 @@ mimic-response@^3.1.0: resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-3.1.0.tgz#2d1d59af9c1b129815accc2c46a022a5ce1fa3c9" integrity sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ== -miniflare@3.20240610.0: - version "3.20240610.0" - resolved "https://registry.yarnpkg.com/miniflare/-/miniflare-3.20240610.0.tgz#6efeb60f3ba2e658a3e0395538010228fac0e719" - integrity sha512-J6aXmkII5gcq+kC4TurxKiR4rC++apPST/K8P/YjqoQQgrJ+NRPacBhf6iVh8R3ujnXYXaq+Ae+gm+LM0XHK/w== +miniflare@3.20241011.0: + version "3.20241011.0" + resolved "https://registry.yarnpkg.com/miniflare/-/miniflare-3.20241011.0.tgz#66d838551b162c15692f8d6fb923e3eda50525e4" + integrity sha512-Mb3U9+QvKgIUl9LgHwBxEz8WajMRYqO5mMHRtO8yHjNCLGh24I6Ts9z13zRAYGPDd1xBQ1o983fHT9S+tn6r+A== dependencies: "@cspotcode/source-map-support" "0.8.1" acorn "^8.8.0" @@ -5064,11 +5067,11 @@ miniflare@3.20240610.0: exit-hook "^2.2.1" glob-to-regexp "^0.4.1" stoppable "^1.1.0" - undici "^5.28.2" - workerd "1.20240610.1" - ws "^8.11.0" + undici "^5.28.4" + workerd "1.20241011.1" + ws "^8.17.1" youch "^3.2.2" - zod "^3.20.6" + zod "^3.22.3" minimatch@^3.0.4, minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2: version "3.1.2" @@ -5164,11 +5167,6 @@ node-domexception@1.0.0: resolved "https://registry.yarnpkg.com/node-domexception/-/node-domexception-1.0.0.tgz#6888db46a1f71c0b76b3f7555016b63fe64766e5" integrity sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ== -node-fetch-native@^1.6.4: - version "1.6.4" - resolved "https://registry.yarnpkg.com/node-fetch-native/-/node-fetch-native-1.6.4.tgz#679fc8fd8111266d47d7e72c379f1bed9acff06e" - integrity sha512-IhOigYzAKHd244OC0JIMIUrjzctirCmPkaIfhDeGcEETWof5zKYUW7e7MYvChGWh/4CJeXEgsRyGzuF334rOOQ== - node-fetch@2.7.0, node-fetch@^2.6.7: version "2.7.0" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.7.0.tgz#d0f0fa6e3e2dc1d27efcd8ad99d550bda94d187d" @@ -5265,6 +5263,11 @@ object.assign@^4.1.5: has-symbols "^1.0.3" object-keys "^1.1.1" +ohash@^1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/ohash/-/ohash-1.1.4.tgz#ae8d83014ab81157d2c285abf7792e2995fadd72" + integrity sha512-FlDryZAahJmEF3VR3w1KogSEdWX3WhA5GPakFx4J81kEAiHyLMpdLLElS8n8dfNadMgAne/MywcvmogzscVt4g== + once@^1.3.0, once@^1.3.1, once@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" @@ -5447,11 +5450,6 @@ path-parse@^1.0.7: resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== -path-to-regexp@^6.2.0: - version "6.2.2" - resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-6.2.2.tgz#324377a83e5049cbecadc5554d6a63a9a4866b36" - integrity sha512-GQX3SSMokngb36+whdpRXE+3f9V8UzyAorlYvOGx87ufGHehNTn5lCxrKtLyZ4Yl/wEKnNnr98ZzOwwDZV5ogw== - path-to-regexp@^6.3.0: version "6.3.0" resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-6.3.0.tgz#2b6a26a337737a8e1416f9272ed0766b1c0389f4" @@ -5963,7 +5961,7 @@ source-map-support@0.5.13: buffer-from "^1.0.0" source-map "^0.6.0" -source-map@0.6.1, source-map@^0.6.0, source-map@^0.6.1: +source-map@^0.6.0, source-map@^0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== @@ -6406,10 +6404,10 @@ typescript@5.4.5: resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.4.5.tgz#42ccef2c571fdbd0f6718b1d1f5e6e5ef006f611" integrity sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ== -ufo@^1.5.3: - version "1.5.3" - resolved "https://registry.yarnpkg.com/ufo/-/ufo-1.5.3.tgz#3325bd3c977b6c6cd3160bf4ff52989adc9d3344" - integrity sha512-Y7HYmWaFwPUmkoQCUIAYpKqkOf+SbVj/2fJJZ4RJMCfZp0rTGwRbzQD+HghfnhKOjL9E01okqz+ncJskGYfBNw== +ufo@^1.5.4: + version "1.5.4" + resolved "https://registry.yarnpkg.com/ufo/-/ufo-1.5.4.tgz#16d6949674ca0c9e0fbbae1fa20a71d7b1ded754" + integrity sha512-UsUk3byDzKd04EyoZ7U4DOlxQaD14JUKQl6/P7wiX4FNvUfm3XL246n9W5AmqwW5RSFJ27NAuM0iLscAOYUiGQ== unbox-primitive@^1.0.2: version "1.0.2" @@ -6431,24 +6429,22 @@ undici-types@~6.19.2: resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.19.8.tgz#35111c9d1437ab83a7cdc0abae2f26d88eda0a02" integrity sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw== -undici@^5.28.2: +undici@^5.28.4: version "5.28.4" resolved "https://registry.yarnpkg.com/undici/-/undici-5.28.4.tgz#6b280408edb6a1a604a9b20340f45b422e373068" integrity sha512-72RFADWFqKmUb2hmmvNODKL3p9hcB6Gt2DOQMis1SEBaV6a4MH8soBvzg+95CYhCKPFedut2JY9bMfrDl9D23g== dependencies: "@fastify/busboy" "^2.0.0" -"unenv@npm:unenv-nightly@1.10.0-1717606461.a117952": - version "1.10.0-1717606461.a117952" - resolved "https://registry.yarnpkg.com/unenv-nightly/-/unenv-nightly-1.10.0-1717606461.a117952.tgz#ff0b97e1e159f84be747271e1d55263b4b3eae7e" - integrity sha512-u3TfBX02WzbHTpaEfWEKwDijDSFAHcgXkayUZ+MVDrjhLFvgAJzFGTSTmwlEhwWi2exyRQey23ah9wELMM6etg== +"unenv@npm:unenv-nightly@2.0.0-20241009-125958-e8ea22f": + version "2.0.0-20241009-125958-e8ea22f" + resolved "https://registry.yarnpkg.com/unenv-nightly/-/unenv-nightly-2.0.0-20241009-125958-e8ea22f.tgz#98b5aae21b1520885b88ef63b5c9740cf5b98c9b" + integrity sha512-hRxmKz1iSVRmuFx/vBdPsx7rX4o7Cas9vdjDNeUeWpQTK2LzU3Xy3Jz0zbo7MJX0bpqo/LEFCA+GPwsbl6zKEQ== dependencies: - consola "^3.2.3" defu "^6.1.4" - mime "^3.0.0" - node-fetch-native "^1.6.4" + ohash "^1.1.4" pathe "^1.1.2" - ufo "^1.5.3" + ufo "^1.5.4" unescape-js@^1.0.5: version "1.1.4" @@ -6628,36 +6624,38 @@ word-wrap@^1.2.5: resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.5.tgz#d2c45c6dd4fbce621a66f136cbe328afd0410b34" integrity sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA== -workerd@1.20240610.1: - version "1.20240610.1" - resolved "https://registry.yarnpkg.com/workerd/-/workerd-1.20240610.1.tgz#a73718a0f2daff39b2c03e0be143ad007d13c60e" - integrity sha512-Rtut5GrsODQMh6YU43b9WZ980Wd05Ov1/ds88pT/SoetmXFBvkBzdRfiHiATv+azmGX8KveE0i/Eqzk/yI01ug== +workerd@1.20241011.1: + version "1.20241011.1" + resolved "https://registry.yarnpkg.com/workerd/-/workerd-1.20241011.1.tgz#d28f436632f8495a3ce2834ce710838868a32d20" + integrity sha512-ORobT1XDkE+p+36yk6Szyw68bWuGSmuwIlDnAeUOfnYunb/Txt0jg7ydzfwr4UIsof7AH5F1nqZms5PWLu05yw== optionalDependencies: - "@cloudflare/workerd-darwin-64" "1.20240610.1" - "@cloudflare/workerd-darwin-arm64" "1.20240610.1" - "@cloudflare/workerd-linux-64" "1.20240610.1" - "@cloudflare/workerd-linux-arm64" "1.20240610.1" - "@cloudflare/workerd-windows-64" "1.20240610.1" - -wrangler@3.60.3: - version "3.60.3" - resolved "https://registry.yarnpkg.com/wrangler/-/wrangler-3.60.3.tgz#1b2ebd2214e10e42a143e47b425480cbe7b7be21" - integrity sha512-a6zn/KFnYaYp3nxJR/aP0TeaBvJDkrrfI89KoxUtx28H7zpya/5/VLu3CxQ3PRspEojJGF0s6f3/pddRy3F+BQ== - dependencies: - "@cloudflare/kv-asset-handler" "0.3.2" + "@cloudflare/workerd-darwin-64" "1.20241011.1" + "@cloudflare/workerd-darwin-arm64" "1.20241011.1" + "@cloudflare/workerd-linux-64" "1.20241011.1" + "@cloudflare/workerd-linux-arm64" "1.20241011.1" + "@cloudflare/workerd-windows-64" "1.20241011.1" + +wrangler@^3.81.0: + version "3.81.0" + resolved "https://registry.yarnpkg.com/wrangler/-/wrangler-3.81.0.tgz#db3c92651e779516b9d794d1d3c59084125e888f" + integrity sha512-sa5dhLJAMmYtl/dJWDJ92sdnKj0VUC0DYBfGqbhd5xn7CDdn1oGhICDXtx2E6BNhQ1L+4d9oAcP/oQvOs5gKLA== + dependencies: + "@cloudflare/kv-asset-handler" "0.3.4" + "@cloudflare/workers-shared" "0.6.0" "@esbuild-plugins/node-globals-polyfill" "^0.2.3" "@esbuild-plugins/node-modules-polyfill" "^0.2.2" blake3-wasm "^2.1.5" chokidar "^3.5.3" esbuild "0.17.19" - miniflare "3.20240610.0" + miniflare "3.20241011.0" nanoid "^3.3.3" - path-to-regexp "^6.2.0" + path-to-regexp "^6.3.0" resolve "^1.22.8" resolve.exports "^2.0.2" selfsigned "^2.0.1" - source-map "0.6.1" - unenv "npm:unenv-nightly@1.10.0-1717606461.a117952" + source-map "^0.6.1" + unenv "npm:unenv-nightly@2.0.0-20241009-125958-e8ea22f" + workerd "1.20241011.1" xxhash-wasm "^1.0.1" optionalDependencies: fsevents "~2.3.2" @@ -6702,12 +6700,7 @@ write-file-atomic@^4.0.2: imurmurhash "^0.1.4" signal-exit "^3.0.7" -ws@^8.11.0: - version "8.17.0" - resolved "https://registry.yarnpkg.com/ws/-/ws-8.17.0.tgz#d145d18eca2ed25aaf791a183903f7be5e295fea" - integrity sha512-uJq6108EgZMAl20KagGkzCKfMEjxmKvZHG7Tlq0Z6nOky7YF7aq4mOx6xK8TJ/i1LeK4Qus7INktacctDgY8Ow== - -ws@^8.14.2: +ws@^8.14.2, ws@^8.17.1: version "8.18.0" resolved "https://registry.yarnpkg.com/ws/-/ws-8.18.0.tgz#0d7505a6eafe2b0e712d232b42279f53bc289bbc" integrity sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw== @@ -6794,7 +6787,7 @@ zod-validation-error@^3.0.3: resolved "https://registry.yarnpkg.com/zod-validation-error/-/zod-validation-error-3.3.0.tgz#2cfe81b62d044e0453d1aa3ae7c32a2f36dde9af" integrity sha512-Syib9oumw1NTqEv4LT0e6U83Td9aVRk9iTXPUQr1otyV1PuXQKOvOwhMNqZIq5hluzHP2pMgnOmHEo7kPdI2mw== -zod@^3.20.6, zod@^3.22.4: +zod@^3.22.3, zod@^3.22.4: version "3.23.8" resolved "https://registry.yarnpkg.com/zod/-/zod-3.23.8.tgz#e37b957b5d52079769fb8097099b592f0ef4067d" integrity sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g== From fd0bda0197da24cd9deb4f767ffa8a0ef285a983 Mon Sep 17 00:00:00 2001 From: Shivaditya Shivganesh Date: Sat, 19 Oct 2024 00:22:54 -0400 Subject: [PATCH 02/11] fix: updated action --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4dc4ccd..25a5d14 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,7 +11,7 @@ jobs: with: manifestPath: ${{ github.workspace }}/manifest.json schemaPath: ${{ github.workspace }}/src/types/plugin-input.js - pluginEntry: ${{ github.workspace }}/src/index.ts + pluginEntry: ${{ github.workspace }}/src/plugin.ts commitMessage: "chore: updated manifest.json and dist build" nodeVersion: "20.10.0" env: From aa309dd8d9cbc79bc7d17410a0a402dc3e58c7a3 Mon Sep 17 00:00:00 2001 From: Shivaditya Shivganesh Date: Sat, 19 Oct 2024 09:33:16 -0400 Subject: [PATCH 03/11] fix: updated compute.yml --- .github/workflows/{test.yml => compute.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{test.yml => compute.yml} (100%) diff --git a/.github/workflows/test.yml b/.github/workflows/compute.yml similarity index 100% rename from .github/workflows/test.yml rename to .github/workflows/compute.yml From a0c5ea580ed7054f5b6a955886a319bf2afdcdad Mon Sep 17 00:00:00 2001 From: Shivaditya Shivganesh Date: Sat, 19 Oct 2024 09:45:55 -0400 Subject: [PATCH 04/11] fix: updated compute.yml --- .github/workflows/compute.yml | 54 +++++++++++++++++----- .github/workflows/update-configuration.yml | 22 +++++++++ 2 files changed, 65 insertions(+), 11 deletions(-) create mode 100644 .github/workflows/update-configuration.yml diff --git a/.github/workflows/compute.yml b/.github/workflows/compute.yml index 25a5d14..39ce57c 100644 --- a/.github/workflows/compute.yml +++ b/.github/workflows/compute.yml @@ -1,18 +1,50 @@ -name: Update Manifest and Commit Changes +name: "@ubiquity-os/command-ask" + on: - push: + workflow_dispatch: + inputs: + stateId: + description: "State Id" + eventName: + description: "Event Name" + eventPayload: + description: "Event Payload" + settings: + description: "Settings" + authToken: + description: "Auth Token" + ref: + description: "Ref" jobs: - update-manifest: + compute: + name: "LLM Reply" runs-on: ubuntu-latest + permissions: write-all + env: + SUPABASE_URL: ${{ secrets.SUPABASE_URL }} + SUPABASE_KEY: ${{ secrets.SUPABASE_KEY }} + VOYAGEAI_API_KEY: ${{secrets.VOYAGEAI_API_KEY}} + OPENAI_API_KEY: ${{secrets.OPENAI_API_KEY}} + UBIQUITY_OS_APP_NAME: ${{secrets.UBIQUITY_OS_APP_NAME}} + steps: - - name: Update Manifest and Commit Changes - uses: ubiquity-os/action-deploy-plugin@main + - uses: actions/checkout@v4 + + - name: setup node + uses: actions/setup-node@v4 with: - manifestPath: ${{ github.workspace }}/manifest.json - schemaPath: ${{ github.workspace }}/src/types/plugin-input.js - pluginEntry: ${{ github.workspace }}/src/plugin.ts - commitMessage: "chore: updated manifest.json and dist build" - nodeVersion: "20.10.0" + node-version: "20.10.0" + + - name: install dependencies + run: yarn + + - name: execute directive + run: npx tsx ./src/plugin.ts + id: command-ask env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + SUPABASE_URL: ${{ secrets.SUPABASE_URL }} + SUPABASE_KEY: ${{ secrets.SUPABASE_KEY }} + VOYAGEAI_API_KEY: ${{secrets.VOYAGEAI_API_KEY}} + OPENAI_API_KEY: ${{secrets.OPENAI_API_KEY}} + UBIQUITY_OS_APP_NAME: ${{secrets.UBIQUITY_OS_APP_NAME}} \ No newline at end of file diff --git a/.github/workflows/update-configuration.yml b/.github/workflows/update-configuration.yml new file mode 100644 index 0000000..01ae31e --- /dev/null +++ b/.github/workflows/update-configuration.yml @@ -0,0 +1,22 @@ +name: Update Manifest and Commit Changes + +on: + workflow_dispatch: + push: + + +jobs: + update-manifest: + name: "Update Manifest and Commit Changes" + runs-on: ubuntu-latest + steps: + - name: Update Manifest and Commit Changes + uses: ubiquity-os/action-deploy-plugin@main + with: + manifestPath: ${{ github.workspace }}/manifest.json + schemaPath: ${{ github.workspace }}/src/types/plugin-input.js + pluginEntry: ${{ github.workspace }}/src/plugin.ts + commitMessage: "chore: updated manifest.json and dist build" + nodeVersion: "20.10.0" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From 4d9e674db05a8dd4b526adc556e98b2ecb2fe56e Mon Sep 17 00:00:00 2001 From: Shivaditya Shivganesh Date: Sat, 19 Oct 2024 09:56:56 -0400 Subject: [PATCH 05/11] fix: updated compute.yml --- .github/workflows/compute.yml | 2 +- package.json | 2 + src/main.ts | 39 +++++++++++++++++++ yarn.lock | 73 ++++++++++++++++++++++++++++++++++- 4 files changed, 113 insertions(+), 3 deletions(-) create mode 100644 src/main.ts diff --git a/.github/workflows/compute.yml b/.github/workflows/compute.yml index 39ce57c..bee9d84 100644 --- a/.github/workflows/compute.yml +++ b/.github/workflows/compute.yml @@ -40,7 +40,7 @@ jobs: run: yarn - name: execute directive - run: npx tsx ./src/plugin.ts + run: npx tsx ./src/main.ts id: command-ask env: SUPABASE_URL: ${{ secrets.SUPABASE_URL }} diff --git a/package.json b/package.json index 12f4432..94d1357 100644 --- a/package.json +++ b/package.json @@ -39,6 +39,8 @@ "voyageai": "^0.0.1-5" }, "devDependencies": { + "@actions/core": "^1.11.1", + "@actions/github": "^6.0.0", "@commitlint/cli": "19.3.0", "@commitlint/config-conventional": "19.2.2", "@cspell/dict-node": "5.0.1", diff --git a/src/main.ts b/src/main.ts new file mode 100644 index 0000000..62e2875 --- /dev/null +++ b/src/main.ts @@ -0,0 +1,39 @@ +import * as core from "@actions/core"; +import * as github from "@actions/github"; +import { Value } from "@sinclair/typebox/value"; +import { envSchema } from "./types/env"; +import { pluginSettingsSchema, PluginInputs, pluginSettingsValidator } from "./types"; +import { plugin } from "./plugin"; + +/** + * How a GitHub action executes the plugin. + */ +export async function run() { + const payload = github.context.payload.inputs; + const env = Value.Decode(envSchema, process.env); + const settings = Value.Decode(pluginSettingsSchema, Value.Default(pluginSettingsSchema, JSON.parse(payload.settings))); + + if (!pluginSettingsValidator.test(settings)) { + throw new Error("Invalid settings provided"); + } + + const inputs: PluginInputs = { + stateId: payload.stateId, + eventName: payload.eventName, + eventPayload: JSON.parse(payload.eventPayload), + settings, + authToken: payload.authToken, + ref: payload.ref, + }; + + await plugin(inputs, env); +} + +run() + .then((result) => { + core.setOutput("result", result); + }) + .catch((error) => { + console.error(error); + core.setFailed(error); + }); diff --git a/yarn.lock b/yarn.lock index b487cca..8dccaee 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,6 +2,44 @@ # yarn lockfile v1 +"@actions/core@^1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@actions/core/-/core-1.11.1.tgz#ae683aac5112438021588030efb53b1adb86f172" + integrity sha512-hXJCSrkwfA46Vd9Z3q4cpEpHB1rL5NG04+/rbqW9d3+CSvtB1tYe8UTpAlixa1vj0m/ULglfEK2UKxMGxCxv5A== + dependencies: + "@actions/exec" "^1.1.1" + "@actions/http-client" "^2.0.1" + +"@actions/exec@^1.1.1": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@actions/exec/-/exec-1.1.1.tgz#2e43f28c54022537172819a7cf886c844221a611" + integrity sha512-+sCcHHbVdk93a0XT19ECtO/gIXoxvdsgQLzb2fE2/5sIZmWQuluYyjPQtrtTHdU1YzTZ7bAPN4sITq2xi1679w== + dependencies: + "@actions/io" "^1.0.1" + +"@actions/github@^6.0.0": + version "6.0.0" + resolved "https://registry.yarnpkg.com/@actions/github/-/github-6.0.0.tgz#65883433f9d81521b782a64cc1fd45eef2191ea7" + integrity sha512-alScpSVnYmjNEXboZjarjukQEzgCRmjMv6Xj47fsdnqGS73bjJNDpiiXmp8jr0UZLdUB6d9jW63IcmddUP+l0g== + dependencies: + "@actions/http-client" "^2.2.0" + "@octokit/core" "^5.0.1" + "@octokit/plugin-paginate-rest" "^9.0.0" + "@octokit/plugin-rest-endpoint-methods" "^10.0.0" + +"@actions/http-client@^2.0.1", "@actions/http-client@^2.2.0": + version "2.2.3" + resolved "https://registry.yarnpkg.com/@actions/http-client/-/http-client-2.2.3.tgz#31fc0b25c0e665754ed39a9f19a8611fc6dab674" + integrity sha512-mx8hyJi/hjFvbPokCg4uRd4ZX78t+YyRPtnKWwIl+RzNaVuFpQHfmlGVfsKEJN8LwTCvL+DfVgAM04XaHkm6bA== + dependencies: + tunnel "^0.0.6" + undici "^5.25.4" + +"@actions/io@^1.0.1": + version "1.1.3" + resolved "https://registry.yarnpkg.com/@actions/io/-/io-1.1.3.tgz#4cdb6254da7962b07473ff5c335f3da485d94d71" + integrity sha512-wi9JjgKLYS7U/z8PPbco+PvTb/nRWjeoFlJ1Qer83k/3C5PHQi28hiVdeE2kHXmIL99mQFawx8qt/JPjZilJ8Q== + "@ampproject/remapping@^2.2.0": version "2.3.0" resolved "https://registry.yarnpkg.com/@ampproject/remapping/-/remapping-2.3.0.tgz#ed441b6fa600072520ce18b43d2c8cc8caecc7f4" @@ -1595,7 +1633,7 @@ resolved "https://registry.yarnpkg.com/@octokit/auth-token/-/auth-token-4.0.0.tgz#40d203ea827b9f17f42a29c6afb93b7745ef80c7" integrity sha512-tY/msAuJo6ARbK6SPIxZrPBms3xPbfwBrulZe0Wtr/DIY9lje2HeV1uoebShn6mx7SjCHif6EjMvoREj+gZ+SA== -"@octokit/core@^5.0.2": +"@octokit/core@^5.0.1", "@octokit/core@^5.0.2": version "5.2.0" resolved "https://registry.yarnpkg.com/@octokit/core/-/core-5.2.0.tgz#ddbeaefc6b44a39834e1bb2e58a49a117672a7ea" integrity sha512-1LFfa/qnMQvEOAdzlQymH0ulepxbxnCYAKJZfMci/5XJyIHWgEYnDmgnKakbTh7CH2tFQ5O60oYDvns4i9RAIg== @@ -1625,6 +1663,11 @@ "@octokit/types" "^13.0.0" universal-user-agent "^6.0.0" +"@octokit/openapi-types@^20.0.0": + version "20.0.0" + resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-20.0.0.tgz#9ec2daa0090eeb865ee147636e0c00f73790c6e5" + integrity sha512-EtqRBEjp1dL/15V7WiX5LJMIxxkdiGJnabzYx5Apx4FkQIFgAfKumXeYAqqJCj1s+BMX4cPFIFC4OLCR6stlnA== + "@octokit/openapi-types@^22.2.0": version "22.2.0" resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-22.2.0.tgz#75aa7dcd440821d99def6a60b5f014207ae4968e" @@ -1642,6 +1685,13 @@ dependencies: "@octokit/types" "^13.5.0" +"@octokit/plugin-paginate-rest@^9.0.0": + version "9.2.1" + resolved "https://registry.yarnpkg.com/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-9.2.1.tgz#2e2a2f0f52c9a4b1da1a3aa17dabe3c459b9e401" + integrity sha512-wfGhE/TAkXZRLjksFXuDZdmGnJQHvtU/joFQdweXUgzo1XwvBCD4o4+75NtFfjfLK5IwLf9vHTfSiU3sLRYpRw== + dependencies: + "@octokit/types" "^12.6.0" + "@octokit/plugin-request-log@^4.0.0": version "4.0.1" resolved "https://registry.yarnpkg.com/@octokit/plugin-request-log/-/plugin-request-log-4.0.1.tgz#98a3ca96e0b107380664708111864cb96551f958" @@ -1654,6 +1704,13 @@ dependencies: "@octokit/types" "^13.5.0" +"@octokit/plugin-rest-endpoint-methods@^10.0.0": + version "10.4.1" + resolved "https://registry.yarnpkg.com/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-10.4.1.tgz#41ba478a558b9f554793075b2e20cd2ef973be17" + integrity sha512-xV1b+ceKV9KytQe3zCVqjg+8GTGfDYwaT1ATU5isiUyVtlVAO3HNdzpS4sr4GBx4hxQ46s7ITtZrAsxG22+rVg== + dependencies: + "@octokit/types" "^12.6.0" + "@octokit/request-error@^5.1.0": version "5.1.0" resolved "https://registry.yarnpkg.com/@octokit/request-error/-/request-error-5.1.0.tgz#ee4138538d08c81a60be3f320cd71063064a3b30" @@ -1690,6 +1747,13 @@ "@octokit/plugin-request-log" "^4.0.0" "@octokit/plugin-rest-endpoint-methods" "13.2.2" +"@octokit/types@^12.6.0": + version "12.6.0" + resolved "https://registry.yarnpkg.com/@octokit/types/-/types-12.6.0.tgz#8100fb9eeedfe083aae66473bd97b15b62aedcb2" + integrity sha512-1rhSOfRa6H9w4YwK0yrf5faDaDTb+yLyBUKOCV4xtCDB5VmIPqd/v9yr9o6SAzOAlRxMiRiCic6JVM1/kunVkw== + dependencies: + "@octokit/openapi-types" "^20.0.0" + "@octokit/types@^13.0.0", "@octokit/types@^13.1.0", "@octokit/types@^13.5.0": version "13.5.0" resolved "https://registry.yarnpkg.com/@octokit/types/-/types-13.5.0.tgz#4796e56b7b267ebc7c921dcec262b3d5bfb18883" @@ -6319,6 +6383,11 @@ tsx@4.15.6: optionalDependencies: fsevents "~2.3.3" +tunnel@^0.0.6: + version "0.0.6" + resolved "https://registry.yarnpkg.com/tunnel/-/tunnel-0.0.6.tgz#72f1314b34a5b192db012324df2cc587ca47f92c" + integrity sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg== + type-check@^0.4.0, type-check@~0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1" @@ -6429,7 +6498,7 @@ undici-types@~6.19.2: resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.19.8.tgz#35111c9d1437ab83a7cdc0abae2f26d88eda0a02" integrity sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw== -undici@^5.28.4: +undici@^5.25.4, undici@^5.28.4: version "5.28.4" resolved "https://registry.yarnpkg.com/undici/-/undici-5.28.4.tgz#6b280408edb6a1a604a9b20340f45b422e373068" integrity sha512-72RFADWFqKmUb2hmmvNODKL3p9hcB6Gt2DOQMis1SEBaV6a4MH8soBvzg+95CYhCKPFedut2JY9bMfrDl9D23g== From ae5f5522ebc9968da57a27737bd61ca91f953680 Mon Sep 17 00:00:00 2001 From: Shivaditya Shivganesh Date: Sat, 19 Oct 2024 11:54:21 -0400 Subject: [PATCH 06/11] fix: comments and issues --- src/adapters/supabase/helpers/comment.ts | 4 +++- src/adapters/supabase/helpers/issues.ts | 1 + src/handlers/comments.ts | 1 - src/helpers/format-chat-history.ts | 4 ++-- src/helpers/issue-fetching.ts | 1 - src/helpers/issue.ts | 5 +++-- src/main.ts | 1 - src/types/github-types.d.ts | 4 ++-- 8 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/adapters/supabase/helpers/comment.ts b/src/adapters/supabase/helpers/comment.ts index d09f24a..ea67958 100644 --- a/src/adapters/supabase/helpers/comment.ts +++ b/src/adapters/supabase/helpers/comment.ts @@ -31,9 +31,11 @@ export class Comment extends SuperSupabase { } return data; } - async findSimilarComments(query: string, threshold: number, currentId: string): Promise { const embedding = await this.context.adapters.voyage.embedding.createEmbedding({ text: query, prompt: "This is a query for the stored documents:" }); + //Escape the any special characters in the query for use in the SQL query + query = query.replace(/'/g, "''").replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/%/g, "\\%").replace(/_/g, "\\_"); + this.context.logger.info(`Query: ${query}`); const { data, error } = await this.supabase.rpc("find_similar_comments", { current_id: currentId, query_text: query, diff --git a/src/adapters/supabase/helpers/issues.ts b/src/adapters/supabase/helpers/issues.ts index 142ef02..8635539 100644 --- a/src/adapters/supabase/helpers/issues.ts +++ b/src/adapters/supabase/helpers/issues.ts @@ -34,6 +34,7 @@ export class Issue extends SuperSupabase { } async findSimilarIssues(plaintext: string, threshold: number, currentId: string): Promise { const embedding = await this.context.adapters.voyage.embedding.createEmbedding({ text: plaintext, prompt: "This is a query for the stored documents:" }); + plaintext = plaintext.replace(/'/g, "''").replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/%/g, "\\%").replace(/_/g, "\\_"); const { data, error } = await this.supabase.rpc("find_similar_issue_ftse", { current_id: currentId, query_text: plaintext, diff --git a/src/handlers/comments.ts b/src/handlers/comments.ts index cf12053..d7e2d0f 100644 --- a/src/handlers/comments.ts +++ b/src/handlers/comments.ts @@ -76,7 +76,6 @@ export function streamlineComments(comments: SimplifiedComment[]) { if (user?.type === "Bot") continue; const key = createKey(url); const [owner, repo] = splitKey(key); - if (!streamlined[key]) { streamlined[key] = []; } diff --git a/src/helpers/format-chat-history.ts b/src/helpers/format-chat-history.ts index 5c92c63..aadd7f3 100644 --- a/src/helpers/format-chat-history.ts +++ b/src/helpers/format-chat-history.ts @@ -140,9 +140,9 @@ function createComment(comment: StreamlinedComments) { return ""; } // Remove duplicates - const uniqueComments = comment.comments.filter((c, i, a) => a.findIndex((cc) => cc.id === c.id) === i); + //const uniqueComments = comment.comments.filter((c, i, a) => a.findIndex((cc) => cc.id === c.id) === i); // Format comments - const formattedComments = uniqueComments.map((c) => `${c.id} ${c.user}: ${c.body}\n`); + const formattedComments = comment.comments.map((c) => `${c.id} ${c.user}: ${c.body}\n`); return formattedComments.join(""); } diff --git a/src/helpers/issue-fetching.ts b/src/helpers/issue-fetching.ts index 486d83e..fc1df5a 100644 --- a/src/helpers/issue-fetching.ts +++ b/src/helpers/issue-fetching.ts @@ -87,7 +87,6 @@ export async function fetchLinkedIssues(params: FetchParams) { for (const comment of comments) { const foundIssues = idIssueFromComment(comment.body); const foundCodes = comment.body ? await fetchCodeLinkedFromIssue(comment.body, params.context, comment.issueUrl) : []; - if (foundIssues) { for (const linkedIssue of foundIssues) { const linkedKey = createKey(linkedIssue.url, linkedIssue.issueNumber); diff --git a/src/helpers/issue.ts b/src/helpers/issue.ts index 2c76179..cc67b2a 100644 --- a/src/helpers/issue.ts +++ b/src/helpers/issue.ts @@ -144,7 +144,6 @@ export async function fetchCodeLinkedFromIssue( path: parsedUrl.path, }); } - if ("content" in response.data) { const content = Buffer.from(response.data.content, "base64").toString(); return { body: content, id: parsedUrl.path }; @@ -163,7 +162,9 @@ export async function fetchCodeLinkedFromIssue( repo: context.payload.repository.name, issueNumber: parseInt(issue.match(/\/issues\/(\d+)/)?.[1] || "0", 10), issueUrl: url, - user: null, + user: { + ...context.payload.sender, + }, })); } diff --git a/src/main.ts b/src/main.ts index 62e2875..32b3828 100644 --- a/src/main.ts +++ b/src/main.ts @@ -25,7 +25,6 @@ export async function run() { authToken: payload.authToken, ref: payload.ref, }; - await plugin(inputs, env); } diff --git a/src/types/github-types.d.ts b/src/types/github-types.d.ts index 55e3824..23a0b18 100644 --- a/src/types/github-types.d.ts +++ b/src/types/github-types.d.ts @@ -27,7 +27,7 @@ export type LinkedIssues = { }; export type SimplifiedComment = { - user: User | null; + user: User | Partial; body: string; id: string; org: string; @@ -37,7 +37,7 @@ export type SimplifiedComment = { export type FetchedCodes = { body: string; - user: User | null; + user: User | Partial; issueUrl: string; id: string; org: string; From c6873b18b9a169b63c390ee444fdaebc91e31d3f Mon Sep 17 00:00:00 2001 From: Shivaditya Shivganesh Date: Mon, 21 Oct 2024 00:11:45 -0400 Subject: [PATCH 07/11] fix: tests --- src/main.ts | 1 + tests/main.test.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/src/main.ts b/src/main.ts index 32b3828..62e2875 100644 --- a/src/main.ts +++ b/src/main.ts @@ -25,6 +25,7 @@ export async function run() { authToken: payload.authToken, ref: payload.ref, }; + await plugin(inputs, env); } diff --git a/tests/main.test.ts b/tests/main.test.ts index 9875f81..57c0e72 100644 --- a/tests/main.test.ts +++ b/tests/main.test.ts @@ -162,6 +162,7 @@ describe("Ask plugin tests", () => { === Linked Issue #3 Conversation === ubiquity/test-repo #3 === + 4 ubiquity: Just a comment [#1](https://www.github.com/ubiquity/test-repo/issues/1) 4 ubiquity: Just a comment [#1](https://www.github.com/ubiquity/test-repo/issues/1) === End Linked Issue #3 Conversation ===\n `; From 6e155e98a08d4974300a6063957fdec535215d55 Mon Sep 17 00:00:00 2001 From: Shivaditya Shivganesh Date: Mon, 21 Oct 2024 09:33:00 -0400 Subject: [PATCH 08/11] fix: changed to '.ts' in configuration.yml --- .github/workflows/compute.yml | 2 +- .github/workflows/update-configuration.yml | 2 +- src/helpers/format-chat-history.ts | 2 -- src/helpers/issue.ts | 4 +--- 4 files changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/compute.yml b/.github/workflows/compute.yml index bee9d84..b74c477 100644 --- a/.github/workflows/compute.yml +++ b/.github/workflows/compute.yml @@ -1,4 +1,4 @@ -name: "@ubiquity-os/command-ask" +name: "@ubiquity-os-marketplace/command-ask" on: workflow_dispatch: diff --git a/.github/workflows/update-configuration.yml b/.github/workflows/update-configuration.yml index 01ae31e..d3c051d 100644 --- a/.github/workflows/update-configuration.yml +++ b/.github/workflows/update-configuration.yml @@ -14,7 +14,7 @@ jobs: uses: ubiquity-os/action-deploy-plugin@main with: manifestPath: ${{ github.workspace }}/manifest.json - schemaPath: ${{ github.workspace }}/src/types/plugin-input.js + schemaPath: ${{ github.workspace }}/src/types/plugin-input.ts pluginEntry: ${{ github.workspace }}/src/plugin.ts commitMessage: "chore: updated manifest.json and dist build" nodeVersion: "20.10.0" diff --git a/src/helpers/format-chat-history.ts b/src/helpers/format-chat-history.ts index aadd7f3..b1b5ecb 100644 --- a/src/helpers/format-chat-history.ts +++ b/src/helpers/format-chat-history.ts @@ -139,8 +139,6 @@ function createComment(comment: StreamlinedComments) { if (!comment.comments) { return ""; } - // Remove duplicates - //const uniqueComments = comment.comments.filter((c, i, a) => a.findIndex((cc) => cc.id === c.id) === i); // Format comments const formattedComments = comment.comments.map((c) => `${c.id} ${c.user}: ${c.body}\n`); return formattedComments.join(""); diff --git a/src/helpers/issue.ts b/src/helpers/issue.ts index cc67b2a..68fcda7 100644 --- a/src/helpers/issue.ts +++ b/src/helpers/issue.ts @@ -162,9 +162,7 @@ export async function fetchCodeLinkedFromIssue( repo: context.payload.repository.name, issueNumber: parseInt(issue.match(/\/issues\/(\d+)/)?.[1] || "0", 10), issueUrl: url, - user: { - ...context.payload.sender, - }, + user: context.payload.sender, })); } From bbfb34fbacfb72c439e8a1460eda1581672a16e3 Mon Sep 17 00:00:00 2001 From: Shivaditya Shivganesh Date: Mon, 21 Oct 2024 09:52:03 -0400 Subject: [PATCH 09/11] feat: updated compute.yml --- .github/workflows/compute.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/compute.yml b/.github/workflows/compute.yml index b74c477..b4b8677 100644 --- a/.github/workflows/compute.yml +++ b/.github/workflows/compute.yml @@ -15,6 +15,8 @@ on: description: "Auth Token" ref: description: "Ref" + signature: + description: "Signature sent from the Kernel" jobs: compute: From 66605468fcbbfe5a04325ccfbd2eae4b4dffe7f4 Mon Sep 17 00:00:00 2001 From: Shivaditya Shivganesh Date: Mon, 21 Oct 2024 11:05:20 -0400 Subject: [PATCH 10/11] fix: compute.yml --- .github/workflows/compute.yml | 14 +++++++------- .github/workflows/update-configuration.yml | 1 - 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/compute.yml b/.github/workflows/compute.yml index b4b8677..285665e 100644 --- a/.github/workflows/compute.yml +++ b/.github/workflows/compute.yml @@ -26,9 +26,9 @@ jobs: env: SUPABASE_URL: ${{ secrets.SUPABASE_URL }} SUPABASE_KEY: ${{ secrets.SUPABASE_KEY }} - VOYAGEAI_API_KEY: ${{secrets.VOYAGEAI_API_KEY}} - OPENAI_API_KEY: ${{secrets.OPENAI_API_KEY}} - UBIQUITY_OS_APP_NAME: ${{secrets.UBIQUITY_OS_APP_NAME}} + VOYAGEAI_API_KEY: ${{ secrets.VOYAGEAI_API_KEY }} + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} + UBIQUITY_OS_APP_NAME: ${{ secrets.UBIQUITY_OS_APP_NAME }} steps: - uses: actions/checkout@v4 @@ -42,11 +42,11 @@ jobs: run: yarn - name: execute directive - run: npx tsx ./src/main.ts + run: yarn tsx ./src/main.ts id: command-ask env: SUPABASE_URL: ${{ secrets.SUPABASE_URL }} SUPABASE_KEY: ${{ secrets.SUPABASE_KEY }} - VOYAGEAI_API_KEY: ${{secrets.VOYAGEAI_API_KEY}} - OPENAI_API_KEY: ${{secrets.OPENAI_API_KEY}} - UBIQUITY_OS_APP_NAME: ${{secrets.UBIQUITY_OS_APP_NAME}} \ No newline at end of file + VOYAGEAI_API_KEY: ${{ secrets.VOYAGEAI_API_KEY }} + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} + UBIQUITY_OS_APP_NAME: ${{ secrets.UBIQUITY_OS_APP_NAME }} \ No newline at end of file diff --git a/.github/workflows/update-configuration.yml b/.github/workflows/update-configuration.yml index d3c051d..2d366d6 100644 --- a/.github/workflows/update-configuration.yml +++ b/.github/workflows/update-configuration.yml @@ -4,7 +4,6 @@ on: workflow_dispatch: push: - jobs: update-manifest: name: "Update Manifest and Commit Changes" From d9cd7985a6116e0eb75e15e4f617df8cc2ec806e Mon Sep 17 00:00:00 2001 From: Shivaditya Shivganesh Date: Mon, 21 Oct 2024 11:59:40 -0400 Subject: [PATCH 11/11] fix: knip --- .github/knip.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/knip.ts b/.github/knip.ts index 2ca6fdf..d74420a 100644 --- a/.github/knip.ts +++ b/.github/knip.ts @@ -1,12 +1,12 @@ import type { KnipConfig } from "knip"; const config: KnipConfig = { - entry: ["build/index.ts"], + entry: ["build/index.ts", "src/main.ts"], project: ["src/**/*.ts"], ignore: ["src/types/config.ts", "**/__mocks__/**", "**/__fixtures__/**"], ignoreExportsUsedInFile: true, // eslint can also be safely ignored as per the docs: https://knip.dev/guides/handling-issues#eslint--jest - ignoreDependencies: ["eslint-config-prettier", "eslint-plugin-prettier", "tsx"], + ignoreDependencies: ["eslint-config-prettier", "eslint-plugin-prettier"], eslint: true, };