update AiScript to 0.12.0
This commit is contained in:
parent
db1ca28de3
commit
e44f83fb9c
15 changed files with 75 additions and 157 deletions
|
@ -14,7 +14,7 @@
|
|||
|
||||
<script lang="ts" setup>
|
||||
import { onMounted, onUnmounted, ref, watch } from 'vue';
|
||||
import { AiScript, parse, utils } from '@syuilo/aiscript';
|
||||
import { Interpreter, Parser, utils } from '@syuilo/aiscript';
|
||||
import { useWidgetPropsManager, Widget, WidgetComponentEmits, WidgetComponentExpose, WidgetComponentProps } from './widget';
|
||||
import { GetFormResultType } from '@/scripts/form';
|
||||
import * as os from '@/os';
|
||||
|
@ -52,6 +52,8 @@ const { widgetProps, configure } = useWidgetPropsManager(name,
|
|||
emit,
|
||||
);
|
||||
|
||||
const parser = new Parser();
|
||||
|
||||
const logs = ref<{
|
||||
id: string;
|
||||
text: string;
|
||||
|
@ -60,7 +62,7 @@ const logs = ref<{
|
|||
|
||||
const run = async () => {
|
||||
logs.value = [];
|
||||
const aiscript = new AiScript(createAiScriptEnv({
|
||||
const aiscript = new Interpreter(createAiScriptEnv({
|
||||
storageKey: 'widget',
|
||||
token: $i?.token,
|
||||
}), {
|
||||
|
@ -94,7 +96,7 @@ const run = async () => {
|
|||
|
||||
let ast;
|
||||
try {
|
||||
ast = parse(widgetProps.script);
|
||||
ast = parser.parse(widgetProps.script);
|
||||
} catch (err) {
|
||||
os.alert({
|
||||
type: 'error',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue