Skip to content

Commit 5c006a9

Browse files
committed
🐛 fix(home): resolve all 5 homepage issues
Fix #5 (CRITICAL): use [data-md-color-scheme] selector chain to override MkDocs black text Fix #1: rename button from 'nexa-lang.com' to '主页'/'Home' Fix #2: force homepage content to block layout (no grid gap from hidden sidebar) Fix #3: set portal-kicker font-family to Space Grotesk Fix #4: replace 8-card grid with Nexa-style scroll-down sections (philosophy, harness, community)
1 parent 2bc8749 commit 5c006a9

3 files changed

Lines changed: 310 additions & 162 deletions

File tree

docs/index.en.md

Lines changed: 114 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ comments: true
1414

1515
<div class="portal-actions">
1616
<a class="md-button md-button--primary" href="en/quickstart/">🚀 Explore Docs</a>
17-
<a class="md-button" href="https://www.nexa-lang.com" target="_blank" rel="noopener">🌐 nexa-lang.com</a>
17+
<a class="md-button" href="https://www.nexa-lang.com" target="_blank" rel="noopener">🌐 Home</a>
1818
<a class="md-button" href="https://doi.org/10.5281/zenodo.19994263" target="_blank" rel="noopener">📄 Paper</a>
1919
<a class="md-button" href="https://github.com/Nexa-Language/Nexa" target="_blank" rel="noopener">
2020
<svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor" style="vertical-align:middle;margin-right:6px;"><path d="M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0024 12c0-6.63-5.37-12-12-12z"/></svg>
@@ -42,56 +42,119 @@ comments: true
4242
</div>
4343
</div>
4444

45-
---
45+
<!-- ────────────────────────────────────────────────────────────────
46+
SECTION: Design Philosophy
47+
──────────────────────────────────────────────────────────────── -->
48+
<div class="portal-section" id="philosophy">
49+
50+
<div class="portal-section-label">Why Nexa</div>
51+
<h2 class="portal-section-title">A Language Designed for Agents,<br>Not Adapted for Them</h2>
52+
<p class="portal-section-desc">
53+
Every other "agent framework" is a library bolted onto a general-purpose language.
54+
Nexa is built from the ground up with the <strong>Harness Native</strong> methodology — agent safety, context management, and autonomous execution as first-class language constructs.
55+
</p>
56+
57+
<div class="portal-feature-grid">
58+
<div class="portal-feature-card">
59+
<h3>🛡️ Harness Native Syntax</h3>
60+
<p>Agents, tools, protocols, and flows are first-class citizens — not library wrappers. The Harness six-tuple (E, T, C, S, L, V) is enforced at the language level.</p>
61+
</div>
62+
<div class="portal-feature-card">
63+
<h3>🔒 Compiler-Enforced Safety</h3>
64+
<p>26 Harness Validator rules check your code at compile time. Missing exit conditions, untyped tools, context overflow risks — caught before a single line runs.</p>
65+
</div>
66+
<div class="portal-feature-card">
67+
<h3>🔀 DAG Orchestration</h3>
68+
<p>Native fork, merge, pipeline, and conditional branch operators. Compose complex agent workflows as directed acyclic graphs with zero boilerplate.</p>
69+
</div>
70+
<div class="portal-feature-card">
71+
<h3>📐 Gradual Type System</h3>
72+
<p>From forgiving to strict — choose your safety level. Structural types, semantic types, Option/Result types, and compile-time protocol verification.</p>
73+
</div>
74+
<div class="portal-feature-card">
75+
<h3>🧪 1,935+ Tests</h3>
76+
<p>Battle-tested across 23+ major features. v1.x: Design by Contract, Error Propagation, Pattern Matching, ADTs, Jobs, HTTP Server, DB, Auth. v2.0: Harness Native Runtime.</p>
77+
</div>
78+
<div class="portal-feature-card">
79+
<h3>🚀 AVM Runtime</h3>
80+
<p>A Rust-powered Agent Virtual Machine with WASM sandboxing, COW memory, context paging, and work-stealing scheduler — 20× faster than Python transpilation.</p>
81+
</div>
82+
</div>
83+
</div>
4684

47-
<div class="portal-grid" markdown="0">
48-
49-
<a class="portal-card" href="en/quickstart/">
50-
<div class="portal-card-icon">🚀</div>
51-
<h3>Quickstart</h3>
52-
<p>Master Nexa basics in 30 minutes — from install to your first Agent</p>
53-
</a>
54-
55-
<a class="portal-card" href="en/part1_basic/">
56-
<div class="portal-card-icon">🧱</div>
57-
<h3>Basic Syntax</h3>
58-
<p>Agent declarations, v2.1 properties, Harness fundamentals</p>
59-
</a>
60-
61-
<a class="portal-card" href="en/part2_advanced/">
62-
<div class="portal-card-icon">🛡️</div>
63-
<h3>Harness Six-Tuple</h3>
64-
<p>autoloop / with_context / snapshot / verify / reflect / Actor</p>
65-
</a>
66-
67-
<a class="portal-card" href="en/part3_extensions/">
68-
<div class="portal-card-icon">🧩</div>
69-
<h3>Syntax Extensions</h3>
70-
<p>Protocol, Design by Contract, Type System, @tool annotation</p>
71-
</a>
72-
73-
<a class="portal-card" href="en/part4_ecosystem_and_stdlib/">
74-
<div class="portal-card-icon">📦</div>
75-
<h3>Ecosystem & Stdlib</h3>
76-
<p>25+ namespaces: HTTP / DB / Auth / KV / Concurrency / Template</p>
77-
</a>
78-
79-
<a class="portal-card" href="en/part5_compiler/">
80-
<div class="portal-card-icon">⚙️</div>
81-
<h3>Compiler Architecture</h3>
82-
<p>Lark Parser → AST → HarnessValidator → Code Generation</p>
83-
</a>
84-
85-
<a class="portal-card" href="en/examples/">
86-
<div class="portal-card-icon">💡</div>
87-
<h3>Examples</h3>
88-
<p>All examples from v0.1 to v2.1, covering every feature</p>
89-
</a>
90-
91-
<a class="portal-card" href="en/reference/">
92-
<div class="portal-card-icon">📖</div>
93-
<h3>Language Reference</h3>
94-
<p>Complete syntax specification, keyword tables, EBNF definitions</p>
95-
</a>
85+
<!-- ────────────────────────────────────────────────────────────────
86+
SECTION: Harness Six-Tuple
87+
──────────────────────────────────────────────────────────────── -->
88+
<div class="portal-section" id="harness">
89+
90+
<div class="portal-section-label">Harness H=(E,T,C,S,L,V)</div>
91+
<h2 class="portal-section-title">Six Dimensions. One Language. Compiler-Verified.</h2>
92+
<p class="portal-section-desc">
93+
The Harness six-tuple is not a framework — it's syntax, enforced by the compiler.
94+
</p>
95+
96+
<div class="portal-feature-grid">
97+
<div class="portal-feature-card">
98+
<h3>E — Execution</h3>
99+
<p><code>autoloop max_steps: 10, exit_when: "resolved"</code><br>Autonomous ReAct loop with compiler-enforced exit conditions. No more infinite agent loops.</p>
100+
</div>
101+
<div class="portal-feature-card">
102+
<h3>T — Tool</h3>
103+
<p><code>@tool("description") fn my_tool(x: string): string</code><br>Zero-cost tool binding. Compiler auto-generates OpenAI function calling schema from type signature.</p>
104+
</div>
105+
<div class="portal-feature-card">
106+
<h3>C — Context</h3>
107+
<p><code>with_context max_tokens: 50000, strategy: sliding_window</code><br>Importance-weighted context paging. Silent context overflow degraded performance — eliminated at language level.</p>
108+
</div>
109+
<div class="portal-feature-card">
110+
<h3>S — State</h3>
111+
<p><code>snap = snapshot(); ... restore(snap);</code><br>COW state snapshots with fork/merge for Tree-of-Thoughts exploration. Roll back decisions as a primitive.</p>
112+
</div>
113+
<div class="portal-feature-card">
114+
<h3>L — Lifecycle</h3>
115+
<p><code>before_step { ... }; reflect "What went wrong?";</code><br>Compiler-enforced lifecycle hooks + AI-native self-reflection. Agents learn instead of crashing.</p>
116+
</div>
117+
<div class="portal-feature-card">
118+
<h3>V — Verify</h3>
119+
<p><code>verify result satisfies ExpectedOutput;</code><br>Compile-time + runtime output verification with multi-model routing. Quality is a language property.</p>
120+
</div>
121+
</div>
122+
</div>
123+
124+
<!-- ────────────────────────────────────────────────────────────────
125+
SECTION: Contribution
126+
──────────────────────────────────────────────────────────────── -->
127+
<div class="portal-section" id="contribute">
128+
129+
<div class="portal-section-label">Community</div>
130+
<h2 class="portal-section-title">Join Us in Building Agent Infrastructure</h2>
131+
<p class="portal-section-desc">
132+
Open source is the lifeblood of Nexa. Whether you're a frontend architect, low-level algorithm researcher, or full-stack cloud-native engineer — we welcome you to collide ideas on GitHub and in the community.
133+
</p>
134+
135+
<div class="portal-feature-grid">
136+
<div class="portal-feature-card">
137+
<h3>📦 Syntax & Parser</h3>
138+
<p>Help refine edge cases in the compiler, or build LSP plugins for VS Code / JetBrains.</p>
139+
</div>
140+
<div class="portal-feature-card">
141+
<h3>🛠️ Standard Library</h3>
142+
<p>Write practical Python utility functions, merge into runtime/stdlib.py following conventions, and leave your name in Nexa's built-in tools.</p>
143+
</div>
144+
<div class="portal-feature-card">
145+
<h3>📊 Benchmarks</h3>
146+
<p>Run concurrency stress tests at scale in cloud environments, and use data to validate each refactoring direction.</p>
147+
</div>
148+
<div class="portal-feature-card">
149+
<h3>🔭 Observability</h3>
150+
<p>Integrate LangSmith, Datadog, or build custom Web dashboards for real-time streaming topology monitoring.</p>
151+
</div>
152+
</div>
153+
</div>
154+
155+
---
96156

157+
<div class="portal-actions" style="justify-content:center;padding:60px 0;">
158+
<a class="md-button md-button--primary" href="en/quickstart/">🚀 Start Exploring Nexa</a>
159+
<a class="md-button" href="https://github.com/Nexa-Language/Nexa" target="_blank" rel="noopener">⭐ Star on GitHub</a>
97160
</div>

docs/index.md

Lines changed: 113 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ comments: true
1414

1515
<div class="portal-actions">
1616
<a class="md-button md-button--primary" href="quickstart/">🚀 探索文档</a>
17-
<a class="md-button" href="https://www.nexa-lang.com" target="_blank" rel="noopener">🌐 nexa-lang.com</a>
17+
<a class="md-button" href="https://www.nexa-lang.com" target="_blank" rel="noopener">🌐 主页</a>
1818
<a class="md-button" href="https://doi.org/10.5281/zenodo.19994263" target="_blank" rel="noopener">📄 论文</a>
1919
<a class="md-button" href="https://github.com/Nexa-Language/Nexa" target="_blank" rel="noopener">
2020
<svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor" style="vertical-align:middle;margin-right:6px;"><path d="M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0024 12c0-6.63-5.37-12-12-12z"/></svg>
@@ -42,56 +42,118 @@ comments: true
4242
</div>
4343
</div>
4444

45-
---
45+
<!-- ────────────────────────────────────────────────────────────────
46+
SECTION: 设计理念
47+
──────────────────────────────────────────────────────────────── -->
48+
<div class="portal-section" id="philosophy">
49+
50+
<div class="portal-section-label">Why Nexa</div>
51+
<h2 class="portal-section-title">为 Agent 设计的语言,<br>而非为语言适配的 Agent</h2>
52+
<p class="portal-section-desc">
53+
其他所有"Agent 框架"都是挂载在通用语言上的库。Nexa 从底层构建,以 <strong>Harness Native</strong> 方法论为核心——Agent 安全、上下文管理、自主执行作为一等语言构造。
54+
</p>
55+
56+
<div class="portal-feature-grid">
57+
<div class="portal-feature-card">
58+
<h3>🛡️ Harness Native 语法</h3>
59+
<p>Agent、工具、协议、流程是一等公民——不是库封装。Harness 六元组 (E, T, C, S, L, V) 在语言级别强制执行。</p>
60+
</div>
61+
<div class="portal-feature-card">
62+
<h3>🔒 编译器强制安全</h3>
63+
<p>26 条 Harness Validator 规则在编译期检查代码。缺失退出条件、未类型化工具、上下文溢出风险——运行前捕获。</p>
64+
</div>
65+
<div class="portal-feature-card">
66+
<h3>🔀 DAG 编排</h3>
67+
<p>原生 fork、merge、pipeline 和条件分支操作符。将复杂 Agent 工作流组合为有向无环图,零样板代码。</p>
68+
</div>
69+
<div class="portal-feature-card">
70+
<h3>📐 渐进式类型系统</h3>
71+
<p>从 forgiving 到 strict——选择你的安全等级。结构类型、语义类型、Option/Result 类型,以及编译期协议验证。</p>
72+
</div>
73+
<div class="portal-feature-card">
74+
<h3>🧪 1,935+ 测试</h3>
75+
<p>跨 23+ 主要特性经过实战检验。v1.x:契约式编程、错误传播、模式匹配、ADT、Job、HTTP Server、DB、Auth。v2.0:Harness Native Runtime。</p>
76+
</div>
77+
<div class="portal-feature-card">
78+
<h3>🚀 AVM 运行时</h3>
79+
<p>Rust 驱动的 Agent Virtual Machine,含 WASM 沙盒、COW 内存、上下文分页和工作窃取调度器——比 Python 转译快 20×。</p>
80+
</div>
81+
</div>
82+
</div>
4683

47-
<div class="portal-grid" markdown="0">
48-
49-
<a class="portal-card" href="quickstart/">
50-
<div class="portal-card-icon">🚀</div>
51-
<h3>快速入门</h3>
52-
<p>30 分钟掌握 Nexa 基础 —— 从安装到第一个 Agent</p>
53-
</a>
54-
55-
<a class="portal-card" href="part1_basic/">
56-
<div class="portal-card-icon">🧱</div>
57-
<h3>基础语法</h3>
58-
<p>Agent 声明、v2.1 属性、Harness 基础原语</p>
59-
</a>
60-
61-
<a class="portal-card" href="part2_advanced/">
62-
<div class="portal-card-icon">🛡️</div>
63-
<h3>Harness 六元组</h3>
64-
<p>autoloop / with_context / snapshot / verify / reflect / Actor</p>
65-
</a>
66-
67-
<a class="portal-card" href="part3_extensions/">
68-
<div class="portal-card-icon">🧩</div>
69-
<h3>语法扩展</h3>
70-
<p>Protocol、契约式编程、类型系统、@tool 注解</p>
71-
</a>
72-
73-
<a class="portal-card" href="part4_ecosystem_and_stdlib/">
74-
<div class="portal-card-icon">📦</div>
75-
<h3>生态与标准库</h3>
76-
<p>25+ 命名空间:HTTP / DB / Auth / KV / 并发 / 模板</p>
77-
</a>
78-
79-
<a class="portal-card" href="part5_compiler/">
80-
<div class="portal-card-icon">⚙️</div>
81-
<h3>编译器架构</h3>
82-
<p>Lark 解析器 → AST → HarnessValidator → 代码生成</p>
83-
</a>
84-
85-
<a class="portal-card" href="examples/">
86-
<div class="portal-card-icon">💡</div>
87-
<h3>完整示例</h3>
88-
<p>v0.1 到 v2.1 全部示例,覆盖所有特性</p>
89-
</a>
90-
91-
<a class="portal-card" href="reference/">
92-
<div class="portal-card-icon">📖</div>
93-
<h3>语言参考</h3>
94-
<p>完整语法规范、关键字表、EBNF 定义</p>
95-
</a>
84+
<!-- ────────────────────────────────────────────────────────────────
85+
SECTION: Harness 六元组
86+
──────────────────────────────────────────────────────────────── -->
87+
<div class="portal-section" id="harness">
88+
89+
<div class="portal-section-label">Harness H=(E,T,C,S,L,V)</div>
90+
<h2 class="portal-section-title">六个维度。一门语言。编译器验证。</h2>
91+
<p class="portal-section-desc">
92+
Harness 六元组不是框架——它是语法,由编译器强制执行。
93+
</p>
94+
95+
<div class="portal-feature-grid">
96+
<div class="portal-feature-card">
97+
<h3>E — 执行</h3>
98+
<p><code>autoloop max_steps: 10, exit_when: "resolved"</code><br>编译器强制退出条件的自主 ReAct 循环。不再有无限 Agent 循环。</p>
99+
</div>
100+
<div class="portal-feature-card">
101+
<h3>T — 工具</h3>
102+
<p><code>@tool("description") fn my_tool(x: string): string</code><br>零成本工具绑定。编译器从类型签名自动生成 OpenAI function calling schema。</p>
103+
</div>
104+
<div class="portal-feature-card">
105+
<h3>C — 上下文</h3>
106+
<p><code>with_context max_tokens: 50000, strategy: sliding_window</code><br>重要性加权上下文分页。静默上下文溢出导致的性能退化——在语言级别消除。</p>
107+
</div>
108+
<div class="portal-feature-card">
109+
<h3>S — 状态</h3>
110+
<p><code>snap = snapshot(); ... restore(snap);</code><br>COW 状态快照,用于 Tree-of-Thoughts 探索的 fork/merge。回退决策作为原语。</p>
111+
</div>
112+
<div class="portal-feature-card">
113+
<h3>L — 生命周期</h3>
114+
<p><code>before_step { ... }; reflect "出错原因?";</code><br>编译器强制的生命周期钩子 + AI 原生自我反思。Agent 学习而非崩溃。</p>
115+
</div>
116+
<div class="portal-feature-card">
117+
<h3>V — 验证</h3>
118+
<p><code>verify result satisfies ExpectedOutput;</code><br>编译期 + 运行时输出验证,含多模型路由。质量是语言的属性。</p>
119+
</div>
120+
</div>
121+
</div>
122+
123+
<!-- ────────────────────────────────────────────────────────────────
124+
SECTION: 贡献与参与
125+
──────────────────────────────────────────────────────────────── -->
126+
<div class="portal-section" id="contribute">
127+
128+
<div class="portal-section-label">Community</div>
129+
<h2 class="portal-section-title">加入我们,共建 Agent 基础设施</h2>
130+
<p class="portal-section-desc">
131+
开源是 Nexa 保持常绿的核心血液。无论你是前沿架构师、底层算法研究员,还是全栈云原生工程师——欢迎在 GitHub 和社区中碰撞思想。
132+
</p>
133+
134+
<div class="portal-feature-grid">
135+
<div class="portal-feature-card">
136+
<h3>📦 语法与 Parser</h3>
137+
<p>帮我们提纯编译器里的边缘情况,或补充 VS Code / JetBrains 的 LSP 插件。</p>
138+
</div>
139+
<div class="portal-feature-card">
140+
<h3>🛠️ 标准库扩展</h3>
141+
<p>用 Python 写实用工具函数,按规范合并进 runtime/stdlib.py,名留 Nexa 内置工具青史。</p>
142+
</div>
143+
<div class="portal-feature-card">
144+
<h3>📊 基准评测</h3>
145+
<p>在大型云环境中运行万次并发和死锁干扰脚本,用数据证明每次重构的方向。</p>
146+
</div>
147+
<div class="portal-feature-card">
148+
<h3>🔭 可观测性</h3>
149+
<p>接入 LangSmith、Datadog 或自建 Web 面板,进行实时流式拓扑监控和链路追踪。</p>
150+
</div>
151+
</div>
152+
</div>
153+
154+
---
96155

156+
<div class="portal-actions" style="justify-content:center;padding:60px 0;">
157+
<a class="md-button md-button--primary" href="quickstart/">🚀 开始探索 Nexa</a>
158+
<a class="md-button" href="https://github.com/Nexa-Language/Nexa" target="_blank" rel="noopener">⭐ Star on GitHub</a>
97159
</div>

0 commit comments

Comments
 (0)