From 845f08893f6c5071a80cabd8f9888f39a8f7d804 Mon Sep 17 00:00:00 2001 From: naskya Date: Fri, 17 Nov 2023 05:04:05 +0900 Subject: [PATCH] fix: upgrade AiScript! There are braking changes in the AiScript syntax, so existing plugins must alse be upgraded Also, I didn't include the function that can call remote servers' API (which is present in the latest Misskey) Co-authored-by: syuilo Co-authored-by: Sayamame-beans <61457993+Sayamame-beans@users.noreply.github.com> --- packages/backend/package.json | 1 - packages/client/package.json | 2 +- packages/client/src/components/page/page.vue | 6 +- packages/client/src/pages/scratchpad.vue | 10 ++- .../src/pages/settings/plugin.install.vue | 55 ++++++++++---- packages/client/src/plugin.ts | 73 ++++++++++++++----- packages/client/src/scripts/aiscript/api.ts | 3 + packages/client/src/scripts/hpml/evaluator.ts | 6 +- packages/client/src/widgets/aiscript.vue | 27 ++++--- packages/client/src/widgets/button.vue | 35 +++++---- pnpm-lock.yaml | 47 +++++------- 11 files changed, 164 insertions(+), 101 deletions(-) diff --git a/packages/backend/package.json b/packages/backend/package.json index e79d1c9776..2728541575 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -37,7 +37,6 @@ "@peertube/http-signature": "1.7.0", "@redocly/openapi-core": "1.0.2", "@sinonjs/fake-timers": "9.1.2", - "@syuilo/aiscript": "0.11.1", "@tensorflow/tfjs": "^4.2.0", "adm-zip": "^0.5.10", "ajv": "8.12.0", diff --git a/packages/client/package.json b/packages/client/package.json index 6136f23b40..43fc376b4f 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -17,7 +17,7 @@ "@rollup/plugin-alias": "5.0.0", "@rollup/plugin-json": "6.0.0", "@rollup/pluginutils": "^5.0.4", - "@syuilo/aiscript": "0.11.1", + "@syuilo/aiscript": "0.16.0", "@types/autosize": "^4.0.2", "@types/escape-regexp": "0.0.1", "@types/glob": "8.1.0", diff --git a/packages/client/src/components/page/page.vue b/packages/client/src/components/page/page.vue index 5edda71d07..e43af6add6 100644 --- a/packages/client/src/components/page/page.vue +++ b/packages/client/src/components/page/page.vue @@ -17,7 +17,7 @@ - - diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 916eb10fdd..f051466af3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -129,9 +129,6 @@ importers: '@sinonjs/fake-timers': specifier: 9.1.2 version: 9.1.2 - '@syuilo/aiscript': - specifier: 0.11.1 - version: 0.11.1 '@tensorflow/tfjs': specifier: ^4.2.0 version: 4.2.0(seedrandom@3.0.5) @@ -358,8 +355,8 @@ importers: specifier: 3.4.1 version: 3.4.1 re2: - specifier: 1.20.3 - version: 1.20.3 + specifier: 1.20.5 + version: 1.20.5 redis-semaphore: specifier: 5.5.0 version: 5.5.0(ioredis@5.3.2) @@ -666,8 +663,8 @@ importers: specifier: ^5.0.4 version: 5.0.4(rollup@3.28.1) '@syuilo/aiscript': - specifier: 0.11.1 - version: 0.11.1 + specifier: 0.16.0 + version: 0.16.0 '@types/autosize': specifier: ^4.0.2 version: 4.0.2 @@ -3417,14 +3414,13 @@ packages: dev: false optional: true - /@syuilo/aiscript@0.11.1: - resolution: {integrity: sha512-chwOIA3yLUKvOB0G611hjLArKTeOWNmTm3lHERSaDW1d+dS6do56naX6Lkwy2UpnwWC0qzeNSgg35elk6t2gZg==} + /@syuilo/aiscript@0.16.0: + resolution: {integrity: sha512-CXvoWOq6kmOSUQtKv0IEf7Ebfkk5PO1LxAgLqgRRPgssPvDvINCXu/gFNXKdapkFMkmX+Gj8qjemKR1vnUS4ZA==} dependencies: - autobind-decorator: 2.4.0 - chalk: 4.0.0 seedrandom: 3.0.5 stringz: 2.1.0 - uuid: 7.0.3 + uuid: 9.0.1 + dev: true /@szmarczak/http-timer@4.0.6: resolution: {integrity: sha512-4BAffykYOgO+5nzBWYwE3W90sBgLJoUPRWWcL8wlyiM8IB8ipJz3UMJ9KXQd1RKQXpKp8Tutn80HZtWsu2u76w==} @@ -5739,6 +5735,7 @@ packages: /autobind-decorator@2.4.0: resolution: {integrity: sha512-OGYhWUO72V6DafbF8PM8rm3EPbfuyMZcJhtm5/n26IDwO18pohE4eNazLoCGhPiXOCD0gEGmrbU3849QvM8bbw==} engines: {node: '>=8.10', npm: '>=6.4.1'} + dev: true /autolinker@4.0.0: resolution: {integrity: sha512-fl5Kh6BmEEZx+IWBfEirnRUU5+cOiV0OK7PEt0RBKvJMJ8GaRseIOeDU3FKf4j3CE5HVefcjHmhYPOcaVt0bZw==} @@ -6513,13 +6510,6 @@ packages: escape-string-regexp: 1.0.5 supports-color: 5.5.0 - /chalk@4.0.0: - resolution: {integrity: sha512-N9oWFcegS0sFr9oh1oz2d7Npos6vNoWW9HvtCg5N1KRFpUhaAhvTv5Y58g880fZaEYSNm3qDz8SU1UrGvp+n7A==} - engines: {node: '>=10'} - dependencies: - ansi-styles: 4.3.0 - supports-color: 7.2.0 - /chalk@4.1.2: resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} engines: {node: '>=10'} @@ -13550,8 +13540,8 @@ packages: object-assign: 4.1.1 thenify-all: 1.6.0 - /nan@2.17.0: - resolution: {integrity: sha512-2ZTgtl0nJsO0KQCjEpxcIr5D+Yv90plTitZt9JBfQvVJDS5seMl3FOvsh3+9CoYWXf/1l5OaZzzF6nDm4cagaQ==} + /nan@2.18.0: + resolution: {integrity: sha512-W7tfG7vMOGtD30sHoZSSc/JVYiyDPEyQVso/Zz+/uQd0B0L46gtC+pHha5FFMRpil6fm/AoEcRWyOVi4+E/f8w==} dev: false /nanoid@3.3.3: @@ -15408,12 +15398,12 @@ packages: setimmediate: 1.0.5 dev: false - /re2@1.20.3: - resolution: {integrity: sha512-g5j4YjygwGEccP9SCuDI90uPlgALLEYLotfL0K+kqL3XKB4ht7Nm1JuXfOTG96c7JozpvCUxTz1T7oTNwwMI6w==} + /re2@1.20.5: + resolution: {integrity: sha512-wZAqOjJ3m0PBgM2B8KG9dNJLwSNIAOZGiHN/c0FpKpaM1Hkg5NpKNAWSVbCXe+bb2K0xmHz6DPR4HJaQ2MejgQ==} requiresBuild: true dependencies: install-artifact-from-github: 1.3.3 - nan: 2.17.0 + nan: 2.18.0 node-gyp: 9.4.0 transitivePeerDependencies: - supports-color @@ -17881,10 +17871,6 @@ packages: hasBin: true dev: false - /uuid@7.0.3: - resolution: {integrity: sha512-DPSke0pXhTZgoF/d+WSt2QaKMCFSfx7QegxEWT+JOuHF5aWrKEn0G+ztjuJg/gG8/ItK+rbPCD/yNv8yyih6Cg==} - hasBin: true - /uuid@8.0.0: resolution: {integrity: sha512-jOXGuXZAWdsTH7eZLtyXMqUb9EcWMGZNbL9YcGBJl4MH4nrxHmZJhEHvyLFrkxo+28uLb/NYRcStH48fnD0Vzw==} hasBin: true @@ -17898,6 +17884,11 @@ packages: resolution: {integrity: sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==} hasBin: true + /uuid@9.0.1: + resolution: {integrity: sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==} + hasBin: true + dev: true + /v8-compile-cache-lib@3.0.1: resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==}