更新 check.ts 中的参数验证库为 zod,升级 package.json 版本并添加 zod 依赖

This commit is contained in:
xiongxiao
2026-03-16 22:23:54 +08:00
committed by cnb
parent 95bcad7587
commit f05bf93650
2 changed files with 7 additions and 7 deletions

View File

@@ -1,6 +1,6 @@
import { createSkill } from '@kevisual/router'; import { createSkill } from '@kevisual/router';
import { app, cnbManager } from '../../app.ts'; import { app, cnbManager } from '../../app.ts';
import { tool } from '@opencode-ai/plugin/tool'; import { z } from 'zod';
app.route({ app.route({
@@ -15,8 +15,8 @@ app.route({
title: 'CNB 登录验证信息', title: 'CNB 登录验证信息',
summary: '验证 CNB 登录信息是否有效', summary: '验证 CNB 登录信息是否有效',
args: { args: {
checkToken: tool.schema.boolean().describe('是否检查 Token 的有效性').default(true), checkToken: z.boolean().describe('是否检查 Token 的有效性').default(true),
checkCookie: tool.schema.boolean().describe('是否检查 Cookie 的有效性').default(false), checkCookie: z.boolean().describe('是否检查 Cookie 的有效性').default(false),
}, },
}) })
} }

View File

@@ -1,6 +1,6 @@
{ {
"name": "@kevisual/cnb", "name": "@kevisual/cnb",
"version": "0.0.50", "version": "0.0.51",
"description": "", "description": "",
"main": "index.js", "main": "index.js",
"basename": "/root/cnb", "basename": "/root/cnb",
@@ -46,7 +46,8 @@
"ai": "^6.0.116", "ai": "^6.0.116",
"commander": "^14.0.3", "commander": "^14.0.3",
"dayjs": "^1.11.20", "dayjs": "^1.11.20",
"dotenv": "^17.3.1" "dotenv": "^17.3.1",
"zod": "^4.3.6"
}, },
"publishConfig": { "publishConfig": {
"access": "public" "access": "public"
@@ -62,8 +63,7 @@
"es-toolkit": "^1.45.1", "es-toolkit": "^1.45.1",
"nanoid": "^5.1.7", "nanoid": "^5.1.7",
"unstorage": "^1.17.4", "unstorage": "^1.17.4",
"ws": "npm:@kevisual/ws", "ws": "npm:@kevisual/ws"
"zod": "^4.3.6"
}, },
"exports": { "exports": {
".": "./src/index.ts", ".": "./src/index.ts",