返回 CodeWhale
page.tsx
根目录 / web / app / [locale] / docs / tools / page.tsx
1 import Link from "next/link";
2 import { buildPageMetadata } from "@/lib/page-meta";
3
4 export async function generateMetadata({ params }: { params: Promise<{ locale: string }> }) {
5 const { locale } = await params;
6 const isZh = locale === "zh";
7 return buildPageMetadata({
8 path: "/docs/tools",
9 locale,
10 title: isZh ? "工具 · Codewhale 文档" : "Tools · Codewhale Docs",
11 description: isZh
12 ? "Bash、File、Git、Run 四个核心 action 工具,以及协调、延迟加载与回放兼容边界。"
13 : "Canonical Bash, File, Git, and Run action tools, coordination tools, deferred loading, and replay compatibility.",
14 });
15 }
16
17 export default async function ToolsPage({ params }: { params: Promise<{ locale: string }> }) {
18 const { locale } = await params;
19 const isZh = locale === "zh";
20
21 return (
22 <section className="space-y-10">
23 <section id="overview" className="scroll-mt-32">
24 <h2 className="font-display text-3xl mb-1">
25 {isZh ? "工具" : "Tools"}{" "}
26 <span className="font-cjk text-indigo text-2xl ml-2">
27 {isZh ? "Tools" : "工具"}
28 </span>
29 </h2>
30 <p className={`text-ink-soft mt-3 ${isZh ? "leading-[1.9] tracking-wide" : "leading-relaxed"}`}>
31 {isZh
32 ? "精选工具集——设计思路详见 "
33 : "Curated surface — see "}
34 <Link
35 href="https://github.com/Hmbown/CodeWhale/blob/main/docs/TOOL_SURFACE.md"
36 className="body-link"
37 >
38 docs/TOOL_SURFACE.md
39 </Link>
40 {isZh ? "。" : " for design rationale."}
41 </p>
42 <div className="hairline-t hairline-b mt-6">
43 {[
44 {
45 group: "Bash",
46 tools: "run · wait · interact · cancel",
47 },
48 {
49 group: "File",
50 tools: "read · list · search_name · search_content · write · edit · patch",
51 },
52 {
53 group: "Git",
54 tools: "status · diff · log · show · blame",
55 },
56 {
57 group: "Run",
58 tools: "tests · verifiers",
59 },
60 {
61 group: isZh ? "协调" : "Coordination",
62 tools: isZh
63 ? "agent · remember(启用内置记忆时)· tasks · update_plan · work_update · tool_search(synthetic,始终启用)"
64 : "agent · remember (when built-in memory is enabled) · tasks · update_plan · work_update · tool_search (synthetic and always active)",
65 },
66 {
67 group: isZh ? "延迟加载" : "Deferred",
68 tools: isZh
69 ? "Web(search · fetch · wait)仅在网络策略允许时通过 tool_search 加载;github、automation 与 rlm 也默认延迟加载"
70 : "Web (search · fetch · wait) loads through tool_search only when network policy permits; github, automation, and rlm are deferred by default",
71 },
72 {
73 group: "MCP",
74 tools: isZh
75 ? "mcp_<server>_<tool>——从 ~/.codewhale/mcp.json 自动注册"
76 : "mcp_<server>_<tool> — auto-registered from ~/.codewhale/mcp.json",
77 },
78 ].map((row) => (
79 <div
80 key={row.group}
81 className="grid md:grid-cols-12 gap-0 hairline-t py-3 px-4 hover:bg-paper-deep transition-colors min-w-0"
82 >
83 <div className="md:col-span-3 font-display text-sm font-semibold">
84 {row.group}
85 </div>
86 <div className="md:col-span-9 font-mono text-[0.78rem] text-ink-soft leading-relaxed break-words min-w-0">
87 {row.tools}
88 </div>
89 </div>
90 ))}
91 </div>
92 </section>
93
94 <section id="compatibility" className="scroll-mt-32">
95 <h2 className="font-display text-2xl mb-1">
96 {isZh ? "回放兼容" : "Replay compatibility"}
97 </h2>
98 <p className={`text-ink-soft mt-3 ${isZh ? "leading-[1.9] tracking-wide" : "leading-relaxed"}`}>
99 {isZh
100 ? "旧的单用途工具名只为已保存的 transcript 与自动化回放保留。它们仍可按原名执行,但不会出现在模型目录或 tool_search 中;新工作应使用上方的 canonical action 工具。"
101 : "Legacy single-purpose names remain callable only so saved transcripts and automation can replay. They stay out of the model catalog and tool_search; new work uses the canonical action tools above."}
102 </p>
103 <Link
104 href="https://github.com/Hmbown/CodeWhale/blob/main/docs/RUNTIME_SIMPLIFICATION_DESIGN.md"
105 className="inline-block mt-3 font-mono text-xs uppercase tracking-wider text-indigo hover:underline"
106 >
107 docs/RUNTIME_SIMPLIFICATION_DESIGN.md →
108 </Link>
109 </section>
110
111 <section id="source" className="hairline-t pt-8">
112 <p className="text-sm text-ink-mute">
113 {isZh
114 ? "来源文档:docs/TOOL_SURFACE.md, docs/RUNTIME_SIMPLIFICATION_DESIGN.md · 更新时请同步修改 docs-map.ts。"
115 : "Source documents: docs/TOOL_SURFACE.md, docs/RUNTIME_SIMPLIFICATION_DESIGN.md · Update docs-map.ts when changing."}
116 </p>
117 </section>
118 </section>
119 );
120 }
121
121 lines Plain Text