返回 CodeWhale
page.tsx
根目录 / web / app / [locale] / docs / vocabulary / page.tsx
1 import { StatusBadge } from "@/components/status-badge";
2 import {
3 ADVISORY_ROLE,
4 CONTROL_MODES,
5 MEASUREMENT_PRINCIPLES,
6 PERMISSION_POSTURES,
7 PRODUCT_TERMS,
8 ROUTE_IDENTITY,
9 } from "@/lib/content/vocabulary";
10 import { buildPageMetadata } from "@/lib/page-meta";
11
12 export async function generateMetadata({ params }: { params: Promise<{ locale: string }> }) {
13 const { locale } = await params;
14 const isZh = locale === "zh";
15 return buildPageMetadata({
16 path: "/docs/vocabulary",
17 locale,
18 title: isZh ? "产品名词 · Codewhale 文档" : "Vocabulary · Codewhale Docs",
19 description: isZh
20 ? "确切的产品名词:Fleet、Workflow、Lane、Runtime、Consultant,Plan / Act / Operate 与权限姿态,以及请求→实际思考档位、路由来源与测量原则。"
21 : "The exact product nouns: Fleet, Workflow, Lane, Runtime, Consultant, Plan / Act / Operate and permission postures, plus requested→effective reasoning, routing source, and measurement principles.",
22 });
23 }
24
25 export default async function VocabularyPage({ params }: { params: Promise<{ locale: string }> }) {
26 const { locale } = await params;
27 const isZh = locale === "zh";
28 const bodyClass = isZh
29 ? "text-ink-soft leading-[1.9] tracking-wide"
30 : "text-ink-soft leading-relaxed";
31
32 return (
33 <section className="space-y-10">
34 <section id="overview" className="scroll-mt-32">
35 <h2 className="font-display text-3xl mb-1">{isZh ? "产品名词" : "Vocabulary"}</h2>
36 <p className={`${bodyClass} mt-3`}>
37 {isZh
38 ? "这些名词在全站、TUI 和收据里含义完全一致。名词本身不翻译;每条定义都与仓库中的公共事实矩阵逐字对应。"
39 : "These nouns mean the same thing on this site, in the TUI, and in receipts. The nouns themselves are never translated; every definition matches the public fact matrix in the repository verbatim."}
40 </p>
41 </section>
42
43 <section id="execution-nouns" className="scroll-mt-32">
44 <h2 className="font-display text-2xl mb-1">
45 {isZh ? "执行名词" : "Execution nouns"}
46 </h2>
47 <div className="hairline-t mt-4">
48 {PRODUCT_TERMS.map((row) => (
49 <section key={row.term} className="py-4 hairline-b">
50 <h3 className="font-display text-xl">
51 {row.term}{" "}
52 <span className="text-sm text-ink-mute font-normal">
53 = {isZh ? row.short.zh : row.short.en}
54 </span>
55 </h3>
56 <p className={`${bodyClass} mt-1 text-sm`}>{isZh ? row.long.zh : row.long.en}</p>
57 </section>
58 ))}
59 </div>
60 </section>
61
62 <section id="control-nouns" className="scroll-mt-32">
63 <h2 className="font-display text-2xl mb-1">
64 {isZh ? "模式与权限姿态" : "Modes and permission postures"}
65 </h2>
66 <p className={`${bodyClass} mt-3`}>
67 {isZh
68 ? "模式(Tab 循环,输入框空闲时)决定可见的交互方式;权限姿态(Shift+Tab 循环)决定工具执行前询问的激进程度。两者正交。"
69 : "Modes (Tab, composer idle) decide the visible interaction; permission postures (Shift+Tab) decide how aggressively tools ask before executing. The two are orthogonal."}
70 </p>
71 <div className="hairline-t mt-4">
72 {[...CONTROL_MODES, ...PERMISSION_POSTURES].map((row) => (
73 <section key={row.term} className="py-4 hairline-b">
74 <h3 className="font-display text-xl">{row.term}</h3>
75 <p className={`${bodyClass} mt-1 text-sm`}>
76 {isZh ? row.description.zh : row.description.en}
77 </p>
78 </section>
79 ))}
80 </div>
81 </section>
82
83 <section id="route-identity" className="scroll-mt-32">
84 <h2 className="font-display text-2xl mb-1">
85 {isZh
86 ? "路由身份:provider · 模型 · 请求→实际思考档位 · 来源"
87 : "Route identity: provider · model · requested→effective reasoning · source"}
88 </h2>
89 <div className="hairline-t mt-4">
90 {ROUTE_IDENTITY.map((row) => (
91 <section key={row.term} className="py-4 hairline-b">
92 <h3 className="font-display text-xl">{row.term}</h3>
93 <p className={`${bodyClass} mt-1 text-sm`}>
94 {isZh ? row.description.zh : row.description.en}
95 </p>
96 </section>
97 ))}
98 </div>
99 </section>
100
101 <section id="advisory-role" className="scroll-mt-32">
102 <h2 className="font-display text-2xl mb-1">
103 {isZh ? "咨询角色" : "Advisory role"}
104 </h2>
105 <div className="hairline-t mt-4 py-4 hairline-b">
106 <h3 className="font-display text-xl">{ADVISORY_ROLE.term}</h3>
107 <p className={`${bodyClass} mt-1 text-sm`}>
108 {isZh ? ADVISORY_ROLE.description.zh : ADVISORY_ROLE.description.en}
109 </p>
110 </div>
111 </section>
112
113 <section id="measurement" className="scroll-mt-32">
114 <h2 className="font-display text-2xl mb-1">
115 {isZh ? "测量原则" : "Measurement principles"}
116 </h2>
117 <ul className="mt-4 space-y-3">
118 {MEASUREMENT_PRINCIPLES.map((principle) => (
119 <li key={principle.en} className={`${bodyClass} text-sm`}>
120 {isZh ? principle.zh : principle.en}
121 </li>
122 ))}
123 </ul>
124 <p className={`${bodyClass} mt-4 text-sm`}>
125 <StatusBadge kind="unavailable" locale={locale} />{" "}
126 {isZh
127 ? "基准排行榜:本站没有,也不会在没有路由身份与测量工具链的情况下出现。"
128 : "Benchmark leaderboard: none on this site, and none will appear without route identity and a measurement harness attached."}
129 </p>
130 </section>
131
132 <section id="source" className="hairline-t pt-8">
133 <p className="text-sm text-ink-mute">
134 {isZh
135 ? "来源文档:docs/FLEET.md, docs/MODES.md, docs/public-surface-facts.json · 名词文案来自 web/lib/content/vocabulary.ts;更新时请同步修改 docs-map.ts。"
136 : "Source documents: docs/FLEET.md, docs/MODES.md, docs/public-surface-facts.json · Vocabulary copy lives in web/lib/content/vocabulary.ts; update docs-map.ts when changing."}
137 </p>
138 </section>
139 </section>
140 );
141 }
142
142 lines Plain Text