更新 .cnb.yml、package.json 和文档,添加新功能和示例代码
This commit is contained in:
@@ -1,15 +1,16 @@
|
||||
export { Route, QueryRouter, QueryRouterServer, Mini } from './route.ts';
|
||||
|
||||
export type { Rule, Schema } from './validator/index.ts';
|
||||
export type { Rule, Schema, } from './validator/index.ts';
|
||||
|
||||
export { createSchema } from './validator/index.ts';
|
||||
|
||||
export type { RouteContext, RouteOpts } from './route.ts';
|
||||
export type { RouteContext, RouteOpts, RouteMiddleware } from './route.ts';
|
||||
|
||||
export type { Run, Skill } from './route.ts';
|
||||
|
||||
export { createSkill } from './route.ts';
|
||||
export { createSkill, tool } from './route.ts';
|
||||
|
||||
export { CustomError } from './result/error.ts';
|
||||
|
||||
export * from './router-define.ts';
|
||||
// --- 以上同步更新至 browser.ts ---
|
||||
@@ -8,11 +8,12 @@ export type { RouteContext, RouteOpts, RouteMiddleware } from './route.ts';
|
||||
|
||||
export type { Run, Skill } from './route.ts';
|
||||
|
||||
export { createSkill } from './route.ts';
|
||||
export { createSkill, tool } from './route.ts';
|
||||
|
||||
export { CustomError } from './result/error.ts';
|
||||
|
||||
export * from './router-define.ts';
|
||||
// --- 以上同步更新至 browser.ts ---
|
||||
|
||||
export { ServerNode, handleServer } from './server/index.ts';
|
||||
|
||||
|
||||
@@ -102,6 +102,9 @@ export type Skill<T = SimpleObject> = {
|
||||
[key: string]: any
|
||||
};
|
||||
} & T
|
||||
export const tool = {
|
||||
schema: z
|
||||
}
|
||||
/** */
|
||||
export const createSkill = <T = SimpleObject>(skill: Skill<T>): Skill<T> => {
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user