diff --git a/packages/backend/package.json b/packages/backend/package.json index 96edb7f026..b207b21378 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -35,7 +35,7 @@ "@peertube/http-signature": "1.7.0", "@redocly/openapi-core": "1.0.0-beta.120", "@sinonjs/fake-timers": "9.1.2", - "@syuilo/aiscript": "0.11.1", + "@syuilo/aiscript": "0.13.3", "@tensorflow/tfjs": "^4.2.0", "adm-zip": "^0.5.10", "ajv": "8.11.2", diff --git a/packages/client/package.json b/packages/client/package.json index 1af31dd099..19fc45279a 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -13,7 +13,7 @@ "@rollup/plugin-alias": "3.1.9", "@rollup/plugin-json": "4.1.0", "@rollup/pluginutils": "^4.2.1", - "@syuilo/aiscript": "0.11.1", + "@syuilo/aiscript": "^0.13.3", "@types/escape-regexp": "0.0.1", "@types/glob": "8.0.0", "@types/gulp": "4.0.10", diff --git a/packages/client/src/components/page/page.vue b/packages/client/src/components/page/page.vue index f2079c9ba8..5b830a25e2 100644 --- a/packages/client/src/components/page/page.vue +++ b/packages/client/src/components/page/page.vue @@ -22,7 +22,7 @@ import { onUnmounted, PropType, } from "vue"; -import { parse } from "@syuilo/aiscript"; +import { Parser } from "@syuilo/aiscript"; import XBlock from "./page.block.vue"; import { Hpml } from "@/scripts/hpml/evaluator"; import { url } from "@/config"; @@ -51,8 +51,9 @@ export default defineComponent({ nextTick(() => { if (props.page.script && hpml.aiscript) { let ast; + const parser = new Parser() try { - ast = parse(props.page.script); + ast = parser.parse(props.page.script); } catch (err) { console.error(err); /*os.alert({ diff --git a/packages/client/src/pages/scratchpad.vue b/packages/client/src/pages/scratchpad.vue index 06c6a8c27f..7db8833b86 100644 --- a/packages/client/src/pages/scratchpad.vue +++ b/packages/client/src/pages/scratchpad.vue @@ -45,7 +45,7 @@ import "prismjs/components/prism-javascript"; import "prismjs/themes/prism-okaidia.css"; import { PrismEditor } from "vue-prism-editor"; import "vue-prism-editor/dist/prismeditor.min.css"; -import { AiScript, parse, utils } from "@syuilo/aiscript"; +import { Interpreter, Parser, utils } from "@syuilo/aiscript"; import MkContainer from "@/components/MkContainer.vue"; import MkButton from "@/components/MkButton.vue"; import { createAiScriptEnv } from "@/scripts/aiscript/api"; @@ -68,7 +68,8 @@ watch(code, () => { async function run() { logs.value = []; - const aiscript = new AiScript( + const parser = new Parser() + const aiscript = new Interpreter( createAiScriptEnv({ storageKey: "scratchpad", token: $i?.token, @@ -111,7 +112,7 @@ async function run() { let ast; try { - ast = parse(code.value); + ast = parser.parse(code.value); } catch (error) { os.alert({ type: "error", diff --git a/packages/client/src/pages/settings/plugin.install.vue b/packages/client/src/pages/settings/plugin.install.vue index ab678cf990..362e4e1091 100644 --- a/packages/client/src/pages/settings/plugin.install.vue +++ b/packages/client/src/pages/settings/plugin.install.vue @@ -19,8 +19,7 @@