Files
openclaw/extensions/feishu/src/chat-schema.ts
刘苇 5209c48923 feat(feishu): add chat info/member tool (openclaw#14674)
* feat(feishu): add chat members/info tool support

* Feishu: harden chat tool schema and coverage

---------

Co-authored-by: Nereo <nereo@Nereos-Mac-mini.local>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
2026-02-28 10:00:31 -06:00

25 lines
948 B
TypeScript

import { Type, type Static } from "@sinclair/typebox";
const CHAT_ACTION_VALUES = ["members", "info"] as const;
const MEMBER_ID_TYPE_VALUES = ["open_id", "user_id", "union_id"] as const;
export const FeishuChatSchema = Type.Object({
action: Type.Unsafe<(typeof CHAT_ACTION_VALUES)[number]>({
type: "string",
enum: [...CHAT_ACTION_VALUES],
description: "Action to run: members | info",
}),
chat_id: Type.String({ description: "Chat ID (from URL or event payload)" }),
page_size: Type.Optional(Type.Number({ description: "Page size (1-100, default 50)" })),
page_token: Type.Optional(Type.String({ description: "Pagination token" })),
member_id_type: Type.Optional(
Type.Unsafe<(typeof MEMBER_ID_TYPE_VALUES)[number]>({
type: "string",
enum: [...MEMBER_ID_TYPE_VALUES],
description: "Member ID type (default: open_id)",
}),
),
});
export type FeishuChatParams = Static<typeof FeishuChatSchema>;