Refactor skill definitions into SSOT structure
Move onboarding intents, prompt data, and tools behind skill-local sources. Register skills through factories and add a moderation skill PoC.
This commit is contained in:
1 parent
b1cc27f6ad
commit
fb189330da
29 files changed
+993
-494
No files matched your search
@@ -0,0 +1,54 @@
|
||||
import { z } from "zod";
|
||||
import {
|
||||
DEADLINE_NEAR_THRESHOLD_MIN,
|
||||
DISCORD_GUIDE_TEXT,
|
||||
HEART_RULE_TEXT,
|
||||
MIN_AGE,
|
||||
NICKNAME_FORMAT_TEXT,
|
||||
TIER_CODES_TEXT,
|
||||
} from "@skills/onboarding/constants";
|
||||
import type { Tool } from "../tool.js";
|
||||
|
||||
const argsSchema = z.object({
|
||||
topic: z.enum([
|
||||
"age",
|
||||
"tier-codes",
|
||||
"discord-link",
|
||||
"heart-rule",
|
||||
"nickname-format",
|
||||
"deadline",
|
||||
]),
|
||||
});
|
||||
|
||||
const resultSchema = z.object({
|
||||
topic: argsSchema.shape.topic,
|
||||
text: z.string(),
|
||||
source: z.literal("constants"),
|
||||
});
|
||||
|
||||
const TOPIC_TEXT: Record<z.infer<typeof argsSchema>["topic"], string> = {
|
||||
age: `가입 가능 연령은 ${MIN_AGE}세 이상이에요.`,
|
||||
"tier-codes": `사용 가능한 티어 코드는 ${TIER_CODES_TEXT}예요.`,
|
||||
"discord-link": DISCORD_GUIDE_TEXT,
|
||||
"heart-rule": HEART_RULE_TEXT,
|
||||
"nickname-format": NICKNAME_FORMAT_TEXT,
|
||||
deadline: `데드라인이 ${DEADLINE_NEAR_THRESHOLD_MIN}분 이하로 남으면 마감이 임박한 상태로 안내해요.`,
|
||||
};
|
||||
|
||||
export const lookupCommunityRuleTool: Tool<
|
||||
z.infer<typeof argsSchema>,
|
||||
z.infer<typeof resultSchema>
|
||||
> = {
|
||||
name: "lookup-community-rule",
|
||||
description:
|
||||
"나이 제한, 닉네임 형식, 티어 코드, 하트 인증 규칙, 디스코드 안내 같은 커뮤니티 규칙을 상수에서 조회한다.",
|
||||
argsSchema,
|
||||
resultSchema,
|
||||
execute(args) {
|
||||
return Promise.resolve({
|
||||
topic: args.topic,
|
||||
text: TOPIC_TEXT[args.topic],
|
||||
source: "constants",
|
||||
});
|
||||
},
|
||||
};
|
||||
Reference in new issue
Block a user