walidsobhie-code
refactor: Squeeze folders further - cleaner structure
65888d5
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Stack 2.9 Documentation</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">
<style>
:root {
--bg-primary: #ffffff;
--bg-secondary: #f8fafc;
--bg-tertiary: #f1f5f9;
--text-primary: #1e293b;
--text-secondary: #475569;
--text-muted: #94a3b8;
--accent: #6366f1;
--accent-hover: #4f46e5;
--accent-light: #eef2ff;
--border: #e2e8f0;
--code-bg: #f1f5f9;
--code-text: #1e293b;
--success: #10b981;
--warning: #f59e0b;
--danger: #ef4444;
--sidebar-width: 280px;
--header-height: 60px;
--shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
--shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
--shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
--radius-sm: 4px;
--radius-md: 8px;
--radius-lg: 12px;
}
[data-theme="dark"] {
--bg-primary: #0f172a;
--bg-secondary: #1e293b;
--bg-tertiary: #334155;
--text-primary: #f1f5f9;
--text-secondary: #cbd5e1;
--text-muted: #64748b;
--accent: #818cf8;
--accent-hover: #a5b4fc;
--accent-light: #1e1b4b;
--border: #334155;
--code-bg: #1e293b;
--code-text: #e2e8f0;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
background: var(--bg-primary);
color: var(--text-primary);
line-height: 1.6;
min-height: 100vh;
}
/* Header */
.header {
position: fixed;
top: 0;
left: 0;
right: 0;
height: var(--header-height);
background: var(--bg-primary);
border-bottom: 1px solid var(--border);
display: flex;
align-items: center;
padding: 0 24px;
z-index: 100;
backdrop-filter: blur(10px);
background: rgba(var(--bg-primary), 0.9);
}
.header-content {
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
max-width: 1600px;
margin: 0 auto;
}
.logo {
display: flex;
align-items: center;
gap: 12px;
font-size: 20px;
font-weight: 700;
color: var(--text-primary);
text-decoration: none;
}
.logo-icon {
width: 32px;
height: 32px;
background: linear-gradient(135deg, var(--accent), var(--accent-hover));
border-radius: var(--radius-md);
display: flex;
align-items: center;
justify-content: center;
color: white;
font-size: 18px;
}
.header-actions {
display: flex;
align-items: center;
gap: 16px;
}
/* Search */
.search-container {
position: relative;
}
.search-input {
width: 300px;
height: 40px;
padding: 0 16px 0 44px;
border: 1px solid var(--border);
border-radius: var(--radius-md);
background: var(--bg-secondary);
color: var(--text-primary);
font-size: 14px;
outline: none;
transition: all 0.2s ease;
}
.search-input:focus {
border-color: var(--accent);
box-shadow: 0 0 0 3px var(--accent-light);
}
.search-icon {
position: absolute;
left: 14px;
top: 50%;
transform: translateY(-50%);
color: var(--text-muted);
}
.search-results {
position: absolute;
top: calc(100% + 8px);
left: 0;
right: 0;
background: var(--bg-primary);
border: 1px solid var(--border);
border-radius: var(--radius-md);
box-shadow: var(--shadow-lg);
max-height: 400px;
overflow-y: auto;
display: none;
z-index: 200;
}
.search-results.active {
display: block;
}
.search-result-item {
padding: 12px 16px;
cursor: pointer;
border-bottom: 1px solid var(--border);
transition: background 0.15s ease;
}
.search-result-item:last-child {
border-bottom: none;
}
.search-result-item:hover {
background: var(--bg-tertiary);
}
.search-result-title {
font-weight: 500;
color: var(--text-primary);
margin-bottom: 4px;
}
.search-result-preview {
font-size: 13px;
color: var(--text-secondary);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.search-result-section {
font-size: 11px;
color: var(--accent);
text-transform: uppercase;
letter-spacing: 0.5px;
margin-bottom: 4px;
}
/* Theme Toggle */
.theme-toggle {
width: 40px;
height: 40px;
border: 1px solid var(--border);
border-radius: var(--radius-md);
background: var(--bg-secondary);
color: var(--text-secondary);
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.2s ease;
}
.theme-toggle:hover {
background: var(--bg-tertiary);
color: var(--text-primary);
}
/* Layout */
.layout {
display: flex;
padding-top: var(--header-height);
min-height: 100vh;
}
/* Sidebar */
.sidebar {
width: var(--sidebar-width);
position: fixed;
top: var(--header-height);
left: 0;
bottom: 0;
background: var(--bg-secondary);
border-right: 1px solid var(--border);
overflow-y: auto;
padding: 24px 0;
}
.sidebar-section {
margin-bottom: 24px;
}
.sidebar-title {
font-size: 11px;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.5px;
color: var(--text-muted);
padding: 0 24px;
margin-bottom: 8px;
}
.sidebar-link {
display: flex;
align-items: center;
gap: 12px;
padding: 10px 24px;
color: var(--text-secondary);
text-decoration: none;
font-size: 14px;
font-weight: 500;
transition: all 0.15s ease;
border-left: 3px solid transparent;
}
.sidebar-link:hover {
color: var(--text-primary);
background: var(--bg-tertiary);
}
.sidebar-link.active {
color: var(--accent);
background: var(--accent-light);
border-left-color: var(--accent);
}
.sidebar-link-icon {
width: 18px;
height: 18px;
opacity: 0.7;
}
.sidebar-link.active .sidebar-link-icon {
opacity: 1;
}
/* Main Content */
.main {
flex: 1;
margin-left: var(--sidebar-width);
padding: 48px;
max-width: 1200px;
}
.content {
background: var(--bg-primary);
border: 1px solid var(--border);
border-radius: var(--radius-lg);
padding: 48px;
box-shadow: var(--shadow-sm);
}
.content h1 {
font-size: 36px;
font-weight: 700;
margin-bottom: 16px;
color: var(--text-primary);
}
.content h2 {
font-size: 24px;
font-weight: 600;
margin: 32px 0 16px;
color: var(--text-primary);
padding-bottom: 8px;
border-bottom: 1px solid var(--border);
}
.content h3 {
font-size: 18px;
font-weight: 600;
margin: 24px 0 12px;
color: var(--text-primary);
}
.content p {
margin-bottom: 16px;
color: var(--text-secondary);
}
.content ul, .content ol {
margin-bottom: 16px;
padding-left: 24px;
color: var(--text-secondary);
}
.content li {
margin-bottom: 8px;
}
.content a {
color: var(--accent);
text-decoration: none;
}
.content a:hover {
text-decoration: underline;
}
/* Code Blocks */
.content pre {
background: var(--code-bg);
border: 1px solid var(--border);
border-radius: var(--radius-md);
padding: 16px;
margin-bottom: 16px;
overflow-x: auto;
font-family: 'JetBrains Mono', monospace;
font-size: 13px;
line-height: 1.5;
}
.content code {
font-family: 'JetBrains Mono', monospace;
font-size: 0.9em;
background: var(--code-bg);
padding: 2px 6px;
border-radius: var(--radius-sm);
color: var(--code-text);
}
.content pre code {
padding: 0;
background: none;
}
/* Tables */
.content table {
width: 100%;
border-collapse: collapse;
margin-bottom: 24px;
font-size: 14px;
}
.content th, .content td {
padding: 12px 16px;
text-align: left;
border: 1px solid var(--border);
}
.content th {
background: var(--bg-tertiary);
font-weight: 600;
color: var(--text-primary);
}
.content td {
color: var(--text-secondary);
}
.content tr:hover td {
background: var(--bg-secondary);
}
/* Badges */
.badge {
display: inline-block;
padding: 4px 8px;
font-size: 12px;
font-weight: 500;
border-radius: var(--radius-sm);
margin-right: 8px;
}
.badge-success {
background: #d1fae5;
color: #065f46;
}
.badge-warning {
background: #fef3c7;
color: #92400e;
}
.badge-danger {
background: #fee2e2;
color: #991b1b;
}
[data-theme="dark"] .badge-success {
background: #064e3b;
color: #6ee7b7;
}
[data-theme="dark"] .badge-warning {
background: #78350f;
color: #fcd34d;
}
[data-theme="dark"] .badge-danger {
background: #7f1d1d;
color: #fca5a5;
}
/* Alerts */
.alert {
padding: 16px;
border-radius: var(--radius-md);
margin-bottom: 24px;
border-left: 4px solid;
}
.alert-info {
background: var(--accent-light);
border-color: var(--accent);
color: var(--text-primary);
}
.alert-success {
background: #d1fae5;
border-color: var(--success);
color: #065f46;
}
[data-theme="dark"] .alert-success {
background: #064e3b;
color: #6ee7b7;
}
/* Quick Start */
.quickstart {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
gap: 24px;
margin: 32px 0;
}
.quickstart-card {
background: var(--bg-secondary);
border: 1px solid var(--border);
border-radius: var(--radius-md);
padding: 24px;
transition: all 0.2s ease;
}
.quickstart-card:hover {
border-color: var(--accent);
box-shadow: var(--shadow-md);
}
.quickstart-icon {
width: 48px;
height: 48px;
background: var(--accent-light);
border-radius: var(--radius-md);
display: flex;
align-items: center;
justify-content: center;
font-size: 24px;
margin-bottom: 16px;
}
.quickstart-title {
font-size: 16px;
font-weight: 600;
margin-bottom: 8px;
color: var(--text-primary);
}
.quickstart-desc {
font-size: 14px;
color: var(--text-secondary);
margin-bottom: 16px;
}
.quickstart-link {
font-size: 14px;
font-weight: 500;
color: var(--accent);
text-decoration: none;
display: inline-flex;
align-items: center;
gap: 4px;
}
.quickstart-link:hover {
text-decoration: underline;
}
/* Mobile Menu Button */
.mobile-menu-btn {
display: none;
width: 40px;
height: 40px;
border: 1px solid var(--border);
border-radius: var(--radius-md);
background: var(--bg-secondary);
color: var(--text-secondary);
cursor: pointer;
align-items: center;
justify-content: center;
}
/* Responsive */
@media (max-width: 1024px) {
.sidebar {
transform: translateX(-100%);
transition: transform 0.3s ease;
z-index: 90;
}
.sidebar.open {
transform: translateX(0);
}
.main {
margin-left: 0;
padding: 24px;
}
.mobile-menu-btn {
display: flex;
}
.search-input {
width: 200px;
}
}
@media (max-width: 640px) {
.search-container {
display: none;
}
.quickstart {
grid-template-columns: 1fr;
}
}
/* Keyboard Shortcuts */
.kbd {
display: inline-block;
padding: 2px 6px;
font-size: 12px;
font-family: 'JetBrains Mono', monospace;
background: var(--bg-tertiary);
border: 1px solid var(--border);
border-radius: var(--radius-sm);
color: var(--text-muted);
}
/* TOC */
.toc {
position: sticky;
top: calc(var(--header-height) + 24px);
max-height: calc(100vh - var(--header-height) - 48px);
overflow-y: auto;
padding-right: 16px;
}
.toc-title {
font-size: 12px;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.5px;
color: var(--text-muted);
margin-bottom: 12px;
}
.toc-list {
list-style: none;
padding: 0;
}
.toc-item {
margin-bottom: 8px;
}
.toc-link {
font-size: 13px;
color: var(--text-secondary);
text-decoration: none;
display: block;
padding: 4px 0;
border-left: 2px solid transparent;
padding-left: 12px;
transition: all 0.15s ease;
}
.toc-link:hover, .toc-link.active {
color: var(--accent);
border-left-color: var(--accent);
}
.content-wrapper {
display: flex;
gap: 48px;
}
.content-main {
flex: 1;
min-width: 0;
}
@media (max-width: 1200px) {
.content-wrapper {
flex-direction: column;
}
.toc {
display: none;
}
}
</style>
</head>
<body>
<!-- Header -->
<header class="header">
<div class="header-content">
<div style="display: flex; align-items: center; gap: 16px;">
<button class="mobile-menu-btn" onclick="toggleSidebar()">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<line x1="3" y1="12" x2="21" y2="12"></line>
<line x1="3" y1="6" x2="21" y2="6"></line>
<line x1="3" y1="18" x2="21" y2="18"></line>
</svg>
</button>
<a href="#" class="logo" onclick="showDoc('home')">
<div class="logo-icon">🤖</div>
<span>Stack 2.9</span>
</a>
</div>
<div class="header-actions">
<div class="search-container">
<svg class="search-icon" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="11" cy="11" r="8"></circle>
<path d="M21 21l-4.35-4.35"></path>
</svg>
<input type="text" class="search-input" placeholder="Search docs... (Ctrl+K)" id="searchInput" autocomplete="off">
<div class="search-results" id="searchResults"></div>
</div>
<button class="theme-toggle" onclick="toggleTheme()" title="Toggle theme">
<svg id="themeIcon" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="12" cy="12" r="5"></circle>
<line x1="12" y1="1" x2="12" y2="3"></line>
<line x1="12" y1="21" x2="12" y2="23"></line>
<line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line>
<line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line>
<line x1="1" y1="12" x2="3" y2="12"></line>
<line x1="21" y1="12" x2="23" y2="12"></line>
<line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line>
<line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line>
</svg>
</button>
</div>
</div>
</header>
<!-- Layout -->
<div class="layout">
<!-- Sidebar -->
<nav class="sidebar" id="sidebar">
<div class="sidebar-section">
<div class="sidebar-title">Getting Started</div>
<a href="#" class="sidebar-link active" data-doc="home" onclick="showDoc('home')">
<svg class="sidebar-link-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"></path>
<polyline points="9 22 9 12 15 12 15 22"></polyline>
</svg>
Overview
</a>
<a href="#" class="sidebar-link" data-doc="quickstart" onclick="showDoc('quickstart')">
<svg class="sidebar-link-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2"></polygon>
</svg>
Quick Start
</a>
<a href="#" class="sidebar-link" data-doc="features" onclick="showDoc('features')">
<svg class="sidebar-link-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<polyline points="22 12 18 12 15 21 9 3 6 12 2 12"></polyline>
</svg>
Features
</a>
</div>
<div class="sidebar-section">
<div class="sidebar-title">Setup & Installation</div>
<a href="#" class="sidebar-link" data-doc="setup" onclick="showDoc('setup')">
<svg class="sidebar-link-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"></path>
</svg>
Installation
</a>
<a href="#" class="sidebar-link" data-doc="configuration" onclick="showDoc('configuration')">
<svg class="sidebar-link-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="12" cy="12" r="3"></circle>
<path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"></path>
</svg>
Configuration
</a>
<a href="#" class="sidebar-link" data-doc="docker" onclick="showDoc('docker')">
<svg class="sidebar-link-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M22 12.5c-1.5-1.5-4.5-1.5-6 0l-2-2c-1-1-3-1-4 0l-3 3c-1 1-2 0-3 0l-2-2c-1-1-3-1-4 0l-3 3c-1 1-2 0-3 0l-2-2c-1-1-3-1-4 0"></path>
<rect x="3" y="4" width="18" height="18" rx="2"></rect>
</svg>
Docker
</a>
</div>
<div class="sidebar-section">
<div class="sidebar-title">API Reference</div>
<a href="#" class="sidebar-link" data-doc="api" onclick="showDoc('api')">
<svg class="sidebar-link-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path>
<polyline points="15 3 21 3 21 9"></polyline>
<line x1="10" y1="14" x2="21" y2="3"></line>
</svg>
REST API
</a>
<a href="#" class="sidebar-link" data-doc="websocket" onclick="showDoc('websocket')">
<svg class="sidebar-link-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M22 12h-4l-3 9L9 3l-3 9H2"></path>
</svg>
WebSocket
</a>
<a href="#" class="sidebar-link" data-doc="sdks" onclick="showDoc('sdks')">
<svg class="sidebar-link-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<rect x="2" y="3" width="20" height="14" rx="2" ry="2"></rect>
<line x1="8" y1="21" x2="16" y2="21"></line>
<line x1="12" y1="17" x2="12" y2="21"></line>
</svg>
SDKs
</a>
</div>
<div class="sidebar-section">
<div class="sidebar-title">Architecture</div>
<a href="#" class="sidebar-link" data-doc="architecture" onclick="showDoc('architecture')">
<svg class="sidebar-link-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<rect x="3" y="3" width="7" height="7"></rect>
<rect x="14" y="3" width="7" height="7"></rect>
<rect x="14" y="14" width="7" height="7"></rect>
<rect x="3" y="14" width="7" height="7"></rect>
</svg>
System Design
</a>
<a href="#" class="sidebar-link" data-doc="self-evolution" onclick="showDoc('self-evolution')">
<svg class="sidebar-link-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="12" cy="12" r="10"></circle>
<path d="M12 16v-4"></path>
<path d="M12 8h.01"></path>
</svg>
Self-Evolution
</a>
<a href="#" class="sidebar-link" data-doc="tools" onclick="showDoc('tools')">
<svg class="sidebar-link-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"></path>
</svg>
Tool System
</a>
</div>
<div class="sidebar-section">
<div class="sidebar-title">Resources</div>
<a href="#" class="sidebar-link" data-doc="benchmarking" onclick="showDoc('benchmarking')">
<svg class="sidebar-link-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<line x1="18" y1="20" x2="18" y2="10"></line>
<line x1="12" y1="20" x2="12" y2="4"></line>
<line x1="6" y1="20" x2="6" y2="14"></line>
</svg>
Benchmarks
</a>
<a href="#" class="sidebar-link" data-doc="contributing" onclick="showDoc('contributing')">
<svg class="sidebar-link-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path>
<circle cx="9" cy="7" r="4"></circle>
<path d="M23 21v-2a4 4 0 0 0-3-3.87"></path>
<path d="M16 3.13a4 4 0 0 1 0 7.75"></path>
</svg>
Contributing
</a>
<a href="#" class="sidebar-link" data-doc="changelog" onclick="showDoc('changelog')">
<svg class="sidebar-link-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="12" cy="12" r="10"></circle>
<polyline points="12 6 12 12 16 14"></polyline>
</svg>
Changelog
</a>
</div>
</nav>
<!-- Main Content -->
<main class="main">
<div class="content" id="content">
<!-- Content will be loaded here -->
</div>
</main>
</div>
<script>
// Documentation content
const docs = {
home: `
<div class="content-wrapper">
<div class="content-main">
<h1>Welcome to Stack 2.9</h1>
<p class="alert alert-info">Your self-evolving AI companion — gets smarter with every conversation.</p>
<p>Stack 2.9 is an open-source voice-enabled coding assistant built on Qwen2.5-Coder-32B, fine-tuned with OpenClaw tool patterns. It provides a powerful, self-hostable alternative to commercial coding assistants.</p>
<h2>Key Features</h2>
<div class="quickstart">
<div class="quickstart-card">
<div class="quickstart-icon">🧠</div>
<div class="quickstart-title">Self-Evolving</div>
<div class="quickstart-desc">Learns from every conversation and improves its capabilities over time through persistent memory.</div>
</div>
<div class="quickstart-card">
<div class="quickstart-icon">🎙️</div>
<div class="quickstart-title">Voice-Enabled</div>
<div class="quickstart-desc">Natural voice commands and voice cloning for hands-free coding assistance.</div>
</div>
<div class="quickstart-card">
<div class="quickstart-icon">🔧</div>
<div class="quickstart-title">37+ Built-in Tools</div>
<div class="quickstart-desc">File operations, git, shell commands, API calls, search, and more.</div>
</div>
<div class="quickstart-card">
<div class="quickstart-icon">📦</div>
<div class="quickstart-title">Open Source</div>
<div class="quickstart-desc">Apache 2.0 licensed. Deploy anywhere, own your data completely.</div>
</div>
</div>
<h2>Quick Start</h2>
<pre><code># Clone the repository
git clone https://github.com/openclaw/stack-2.9.git
cd stack-2.9
# Install dependencies
pip install -r requirements.txt
# Run the CLI
python stack.py</code></pre>
<h2>Benchmarks</h2>
<table>
<thead>
<tr>
<th>Benchmark</th>
<th>Score</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>HumanEval</strong></td>
<td><span class="badge badge-success">76.8%</span></td>
<td>Python coding tasks</td>
</tr>
<tr>
<td><strong>MBPP</strong></td>
<td><span class="badge badge-success">82.3%</span></td>
<td>Python function synthesis</td>
</tr>
<tr>
<td><strong>Tool Use</strong></td>
<td><span class="badge badge-success">94.1%</span></td>
<td>OpenClaw tool patterns</td>
</tr>
<tr>
<td><strong>Context Window</strong></td>
<td><span class="badge badge-success">131K</span></td>
<td>Token context understanding</td>
</tr>
</tbody>
</table>
<h2>Architecture Overview</h2>
<pre><code>┌─────────────────────────────────────────────────────────────┐
│ CLIENT LAYER │
│ CLI │ Web UI │ IDE Plugins │ Voice │ API Clients │
├─────────────────────────────────────────────────────────────┤
│ API GATEWAY │
│ OpenAI-compatible REST │ WebSocket │ Auth │
├─────────────────────────────────────────────────────────────┤
│ ORCHESTRATION LAYER │
│ Agent │ Context Manager │ Tool Coordinator │
├─────────────────────────────────────────────────────────────┤
│ MODEL LAYER │ TOOL ENGINE │ SELF-EVOLUTION │
│ Qwen2.5-Coder │ 37 Tools │ Observe/Learn │
│ 32B + LoRA │ Sandbox Exec │ Memory/Train │
└─────────────────────────────────────────────────────────────┘</code></pre>
<h2>Next Steps</h2>
<ul>
<li><a href="#" onclick="showDoc('quickstart')">Quick Start Guide</a> - Get up and running in 5 minutes</li>
<li><a href="#" onclick="showDoc('setup')">Installation Guide</a> - Detailed setup instructions</li>
<li><a href="#" onclick="showDoc('api')">API Reference</a> - Integrate Stack 2.9 into your apps</li>
<li><a href="#" onclick="showDoc('architecture')">Architecture</a> - Understand the technical design</li>
</ul>
</div>
<aside class="toc">
<div class="toc-title">On this page</div>
<ul class="toc-list">
<li class="toc-item"><a href="#" class="toc-link">Key Features</a></li>
<li class="toc-item"><a href="#" class="toc-link">Quick Start</a></li>
<li class="toc-item"><a href="#" class="toc-link">Benchmarks</a></li>
<li class="toc-item"><a href="#" class="toc-link">Architecture Overview</a></li>
<li class="toc-item"><a href="#" class="toc-link">Next Steps</a></li>
</ul>
</aside>
</div>
`,
quickstart: `
<div class="content-wrapper">
<div class="content-main">
<h1>Quick Start Guide</h1>
<p>Get Stack 2.9 up and running in under 5 minutes.</p>
<h2>Prerequisites</h2>
<table>
<thead>
<tr>
<th>Component</th>
<th>Minimum</th>
<th>Recommended</th>
</tr>
</thead>
<tbody>
<tr><td>Python</td><td>3.8+</td><td>3.11+</td></tr>
<tr><td>Node.js</td><td>18+</td><td>20 LTS</td></tr>
<tr><td>RAM</td><td>8 GB</td><td>16 GB</td></tr>
<tr><td>GPU VRAM</td><td>8 GB</td><td>24 GB</td></tr>
</tbody>
</table>
<h2>Installation</h2>
<h3>1. Clone the Repository</h3>
<pre><code>git clone https://github.com/openclaw/stack-2.9.git
cd stack-2.9</code></pre>
<h3>2. Install Python Dependencies</h3>
<pre><code># Create virtual environment
python -m venv .venv
source .venv/bin/activate # Linux/macOS
# .venv\\Scripts\\activate # Windows
# Install dependencies
pip install -r requirements.txt</code></pre>
<h3>3. Install Node.js Dependencies (Optional - for voice features)</h3>
<pre><code>npm install</code></pre>
<h3>4. Run Stack 2.9</h3>
<pre><code>python stack.py</code></pre>
<h2>Docker Installation</h2>
<pre><code># Build the image
docker build -t stack-2.9 .
# Run with GPU support
docker run --gpus all -p 3000:3000 stack-2.9</code></pre>
<h2>Your First Conversation</h2>
<pre><code>$ python stack.py
Welcome to Stack 2.9! Type 'exit' to quit.
> Hello, what can you help me with?
I'm Stack 2.9, your AI coding assistant. I can help you with:
• Writing and editing code
• Debugging and troubleshooting
• Git operations
• File management
• API development
• And much more!
What would you like to work on today?
> Write a Python function to calculate factorial
I'll create a factorial function for you:
\`\`\`python
def factorial(n: int) -> int:
"""Calculate the factorial of a non-negative integer.
Args:
n: A non-negative integer
Returns:
The factorial of n (n!)
Raises:
ValueError: If n is negative
"""
if n < 0:
raise ValueError("Factorial is not defined for negative numbers")
if n == 0 or n == 1:
return 1
result = 1
for i in range(2, n + 1):
result *= i
return result
\`\`\`
This uses an iterative approach which is memory-efficient for large numbers.
Would you like me to add any features like memoization or input validation?</code></pre>
<h2>Using the API</h2>
<pre><code># Start the API server
python -m stack_cli.api
# Make a request
curl -X POST http://localhost:3000/v1/chat/completions \\
-H "Content-Type: application/json" \\
-H "Authorization: Bearer YOUR_API_KEY" \\
-d '{
"model": "qwen/qwen2.5-coder-32b",
"messages": [{"role": "user", "content": "Hello!"}]
}'</code></pre>
<h2>Voice Commands</h2>
<pre><code># Start with voice enabled
python stack.py --voice
# Or use the voice command
> voice: "Write a hello world function in Python"</code></pre>
<h2>Next Steps</h2>
<ul>
<li><a href="#" onclick="showDoc('setup')">Detailed Setup Guide</a> - Hardware requirements and troubleshooting</li>
<li><a href="#" onclick="showDoc('configuration')">Configuration</a> - Customize Stack 2.9 for your needs</li>
<li><a href="#" onclick="showDoc('api')">API Reference</a> - Full API documentation</li>
</ul>
</div>
</div>
`,
features: `
<div class="content-wrapper">
<div class="content-main">
<h1>Features Overview</h1>
<p>Stack 2.9 is packed with features designed for developers.</p>
<h2>Core Capabilities</h2>
<table>
<thead>
<tr><th>Feature</th><th>Description</th></tr>
</thead>
<tbody>
<tr><td><strong>Code Generation</strong></td><td>Write code in 50+ programming languages</td></tr>
<tr><td><strong>Code Completion</strong></td><td>Intelligent autocompletion with context awareness</td></tr>
<tr><td><strong>Bug Detection</strong></td><td>Identify and fix bugs automatically</td></tr>
<tr><td><strong>Code Review</strong></td><td>Automated code quality analysis</td></tr>
<tr><td><strong>Refactoring</strong></td><td>Suggest and apply code improvements</td></tr>
<tr><td><strong>Documentation</strong></td><td>Auto-generate API docs and comments</td></tr>
</tbody>
</table>
<h2>Tool System</h2>
<p>37 built-in tools organized into categories:</p>
<h3>File Operations</h3>
<pre><code>• read_file - Read file contents
• write_file - Create or overwrite files
• edit_file - Make targeted edits
• delete_file - Remove files safely
• list_dir - Directory listing
• create_dir - Create directories
• copy_file - Copy files
• move_file - Move/rename files</code></pre>
<h3>Search Operations</h3>
<pre><code>• grep - Text search within files
• search_code - Code-aware search
• find_files - Find files by pattern
• search_web - Web search</code></pre>
<h3>Git Operations</h3>
<pre><code>• git_status - Check repository status
• git_log - View commit history
• git_diff - Show changes
• git_commit - Create commits
• git_push - Push to remote
• git_pull - Pull from remote
• git_branch - Manage branches
• git_merge - Merge branches</code></pre>
<h3>Shell Commands</h3>
<pre><code>• run_command - Execute shell commands
• background - Run commands in background
• job_control - Manage background jobs
• env_vars - Read/set environment variables</code></pre>
<h3>Voice Processing</h3>
<pre><code>• speech_to_text - Convert speech to text
• text_to_speech - Convert text to speech
• voice_clone - Clone voice for synthesis</code></pre>
<h2>Self-Evolution</h2>
<p>Stack 2.9 improves itself through experience:</p>
<ol>
<li><strong>Observe</strong> - Watches problem-solving processes</li>
<li><strong>Learn</strong> - Extracts patterns from successes and failures</li>
<li><strong>Remember</strong> - Stores learnings in persistent vector memory</li>
<li><strong>Apply</strong> - Uses accumulated wisdom in future tasks</li>
<li><strong>Evolve</strong> - Updates behavior based on feedback</li>
</ol>
<h2>Comparison</h2>
<table>
<thead>
<tr><th>Feature</th><th>Stack 2.9</th><th>Claude Code</th><th>Copilot</th></tr>
</thead>
<tbody>
<tr><td>Voice Integration</td><td>✅ Native</td><td></td><td></td></tr>
<tr><td>Open Source</td><td>✅ Apache 2.0</td><td></td><td></td></tr>
<tr><td>Self-Evolution</td><td>✅ Yes</td><td></td><td></td></tr>
<tr><td>Context Window</td><td>131K tokens</td><td>200K</td><td>32K</td></tr>
<tr><td>Self-Hosting</td><td>✅ Yes</td><td></td><td></td></tr>
<tr><td>Price</td><td>Free</td><td>$20/mo</td><td>$10/mo</td></tr>
</tbody>
</table>
</div>
</div>
`,
setup: `
<div class="content-wrapper">
<div class="content-main">
<h1>Installation Guide</h1>
<h2>Hardware Requirements</h2>
<h3>CPU-Only (Testing/Development)</h3>
<table>
<thead><tr><th>Component</th><th>Specification</th></tr></thead>
<tbody>
<tr><td>CPU</td><td>4+ cores</td></tr>
<tr><td>RAM</td><td>8 GB minimum</td></tr>
<tr><td>Storage</td><td>10 GB free space</td></tr>
</tbody>
</table>
<h3>GPU Inference (Production)</h3>
<table>
<thead><tr><th>Component</th><th>Specification</th><th>Notes</th></tr></thead>
<tbody>
<tr><td>GPU</td><td>NVIDIA 24GB+ VRAM</td><td>A100, H100, RTX 3090</td></tr>
<tr><td>CPU</td><td>8+ cores</td><td>AMD Ryzen 9, Intel i9</td></tr>
<tr><td>RAM</td><td>32 GB</td><td>64 GB recommended</td></tr>
<tr><td>NVMe Storage</td><td>50 GB+</td><td>For model caching</td></tr>
</tbody>
</table>
<h2>Software Prerequisites</h2>
<h3>Python Installation</h3>
<pre><code># Using pyenv (recommended)
curl https://pyenv.run | bash
pyenv install 3.11.4
pyenv global 3.11.4
# Verify
python --version</code></pre>
<h3>Node.js Installation</h3>
<pre><code># Using nvm (recommended)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
nvm install 20
nvm use 20
# Verify
node --version</code></pre>
<h3>CUDA Setup (GPU Support)</h3>
<pre><code># Check CUDA version
nvidia-smi
# Install cuDNN
sudo apt install libcudnn8 libcudnn8-dev
# Verify
python -c "import torch; print(torch.cuda.is_available())"</code></pre>
<h2>Installation Steps</h2>
<h3>Method 1: Standard Installation</h3>
<pre><code>git clone https://github.com/openclaw/stack-2.9.git
cd stack-2.9
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
npm install
python stack.py --version</code></pre>
<h3>Method 2: Development Installation</h3>
<pre><code>pip install -e ".[dev]"
pre-commit install
pytest</code></pre>
<h2>Troubleshooting</h2>
<h3>Import Errors</h3>
<pre><code># Reinstall in editable mode
pip install -e .
# Or add to PYTHONPATH
export PYTHONPATH="\${PYTHONPATH}:$(pwd)"</code></pre>
<h3>CUDA Out of Memory</h3>
<pre><code># Use smaller batch size
python stack.py --batch-size 1
# Use quantization
python stack.py --quantization awq</code></pre>
<h3>Permission Issues</h3>
<pre><code># Fix script permissions
chmod +x stack.py install.sh setup.sh
# Fix directory permissions
chmod 755 self_evolution/data</code></pre>
<h2>Next Steps</h2>
<ul>
<li><a href="#" onclick="showDoc('configuration')">Configuration Guide</a> - Customize your installation</li>
<li><a href="#" onclick="showDoc('docker')">Docker Setup</a> - Containerized deployment</li>
<li><a href="#" onclick="showDoc('api')">API Reference</a> - Start integrating</li>
</ul>
</div>
</div>
`,
configuration: `
<div class="content-wrapper">
<div class="content-main">
<h1>Configuration Guide</h1>
<h2>Environment Variables</h2>
<p>Create a <code>.env</code> file in the project root:</p>
<pre><code># API Configuration
API_HOST=0.0.0.0
API_PORT=3000
API_KEY=your-secret-api-key-here
# Model Configuration
MODEL_NAME=qwen/qwen2.5-coder-32b
CONTEXT_WINDOW=131072
QUANTIZATION=awq
# GPU Configuration
CUDA_VISIBLE_DEVICES=0
NUM_GPUS=1
# Self-Evolution
ENABLE_SELF_EVOLUTION=true
EVOLUTION_INTERVAL_HOURS=24
# Logging
LOG_LEVEL=INFO
LOG_FILE=stack-2.9.log
# Database
MEMORY_DB_PATH=./self_evolution/data/memory.db</code></pre>
<h2>Configuration File</h2>
<p>Create <code>config.yaml</code> for advanced configuration:</p>
<pre><code># Stack 2.9 Configuration
server:
host: 0.0.0.0
port: 3000
workers: 4
timeout: 300
model:
name: qwen/qwen2.5-coder-32b
device: cuda
quantization: awq
context_window: 131072
temperature: 0.7
max_tokens: 4096
tools:
enabled:
- file_operations
- git_operations
- shell_commands
- api_calls
- search
- voice
sandbox:
enabled: true
timeout: 30
self_evolution:
enabled: true
interval_hours: 24
min_success_for_pattern: 3
min_failure_for_pattern: 2
max_memories: 10000
rate_limiting:
enabled: true
requests_per_minute: 100
tokens_per_day: 100000
concurrent_requests: 5</code></pre>
<h2>Rate Limits</h2>
<table>
<thead>
<tr><th>Tier</th><th>Requests/min</th><th>Tokens/day</th><th>Concurrent</th></tr>
</thead>
<tbody>
<tr><td>Free</td><td>100</td><td>100,000</td><td>5</td></tr>
<tr><td>Pro</td><td>1,000</td><td>10,000,000</td><td>20</td></tr>
<tr><td>Enterprise</td><td>Custom</td><td>Custom</td><td>Custom</td></tr>
</tbody>
</table>
<h2>Authentication</h2>
<pre><code># Generate API key
openssl rand -hex 32
# Set in environment
export API_KEY=your-generated-key</code></pre>
</div>
</div>
`,
docker: `
<div class="content-wrapper">
<div class="content-main">
<h1>Docker Deployment</h1>
<h2>Building the Image</h2>
<pre><code># Build with GPU support
docker build -t stack-2.9:gpu -f Dockerfile.gpu .
# Build for CPU only
docker build -t stack-2.9:cpu -f Dockerfile.cpu .</code></pre>
<h2>Running Container</h2>
<pre><code># Basic run
docker run -p 3000:3000 stack-2.9
# With GPU
docker run --gpus all -p 3000:3000 stack-2.9
# With volume mounts
docker run -p 3000:3000 \\
-v $(pwd)/data:/app/data \\
-v $(pwd)/config.yaml:/app/config.yaml \\
stack-2.9</code></pre>
<h2>Docker Compose</h2>
<pre><code># docker-compose.yml
version: '3.8'
services:
stack-2-9:
build: .
ports:
- "3000:3000"
environment:
- API_KEY=\${API_KEY}
- MODEL_NAME=qwen/qwen2.5-coder-32b
volumes:
- ./data:/app/data
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
redis:
image: redis:7-alpine
ports:
- "6379:6379"
volumes:
- redis_data:/data
volumes:
redis_data:</code></pre>
<h2>Kubernetes</h2>
<pre><code>kubectl apply -f stack-2.9-deployment.yaml</code></pre>
</div>
</div>
`,
api: `
<div class="content-wrapper">
<div class="content-main">
<h1>REST API Reference</h1>
<h2>Base URL</h2>
<pre><code>Production: https://api.stack2.9.openclaw.org/v1
Local: http://localhost:3000/v1</code></pre>
<h2>Authentication</h2>
<pre><code>curl -H "Authorization: Bearer YOUR_API_KEY" \\
-H "Content-Type: application/json" \\
https://api.stack2.9.openclaw.org/v1/chat/completions</code></pre>
<h2>Chat Completions</h2>
<p><strong>Endpoint:</strong> <code>POST /chat/completions</code></p>
<h3>Request</h3>
<pre><code>{
"model": "qwen/qwen2.5-coder-32b",
"messages": [
{"role": "system", "content": "You are a helpful coding assistant."},
{"role": "user", "content": "Write a Python function to calculate Fibonacci numbers."}
],
"temperature": 0.7,
"max_tokens": 1000,
"stream": false
}</code></pre>
<h3>Response</h3>
<pre><code>{
"id": "chatcmpl-1234567890",
"object": "chat.completion",
"created": 1234567890,
"model": "qwen/qwen2.5-coder-32b",
"choices": [{
"index": 0,
"message": {
"role": "assistant",
"content": "def fibonacci(n):\\n if n <= 1:\\n return n\\n return fibonacci(n-1) + fibonacci(n-2)"
},
"finish_reason": "stop"
}],
"usage": {
"prompt_tokens": 25,
"completion_tokens": 35,
"total_tokens": 60
}
}</code></pre>
<h2>Streaming</h2>
<pre><code>curl -X POST http://localhost:3000/v1/chat/completions \\
-H "Authorization: Bearer YOUR_API_KEY" \\
-H "Content-Type: application/json" \\
-d '{"model": "qwen/qwen2.5-coder-32b", "messages": [{"role": "user", "content": "Hello"}], "stream": true}'</code></pre>
<h2>Error Codes</h2>
<table>
<thead><tr><th>Code</th><th>HTTP Status</th><th>Description</th></tr></thead>
<tbody>
<tr><td>invalid_api_key</td><td>401</td><td>API key is invalid</td></tr>
<tr><td>rate_limit_exceeded</td><td>429</td><td>Too many requests</td></tr>
<tr><td>context_length_exceeded</td><td>400</td><td>Context too long</td></tr>
<tr><td>internal_error</td><td>500</td><td>Server error</td></tr>
</tbody>
</table>
</div>
</div>
`,
websocket: `
<div class="content-wrapper">
<div class="content-main">
<h1>WebSocket Streaming</h1>
<h2>Connection</h2>
<pre><code>const ws = new WebSocket('wss://api.stack2.9.openclaw.org/v1/ws/chat');
ws.onopen = () => {
ws.send(JSON.stringify({
type: 'start',
model: 'qwen/qwen2.5-coder-32b',
messages: [{role: 'user', content: 'Hello'}],
temperature: 0.7
}));
};
ws.onmessage = (event) => {
const data = JSON.parse(event.data);
console.log(data.content); // Streamed content
};</code></pre>
<h2>Message Types</h2>
<h3>Client → Server</h3>
<table>
<thead><tr><th>Type</th><th>Description</th></tr></thead>
<tbody>
<tr><td>start</td><td>Start a new chat session</td></tr>
<tr><td>stop</td><td>Stop current generation</td></tr>
<tr><td>ping</td><td>Keep-alive ping</td></tr>
</tbody>
</table>
<h3>Server → Client</h3>
<table>
<thead><tr><th>Type</th><th>Description</th></tr></thead>
<tbody>
<tr><td>content</td><td>Streamed content chunk</td></tr>
<tr><td>tool_call</td><td>Tool invocation request</td></tr>
<tr><td>done</td><td>Generation complete</td></tr>
<tr><td>error</td><td>Error occurred</td></tr>
</tbody>
</table>
</div>
</div>
`,
sdks: `
<div class="content-wrapper">
<div class="content-main">
<h1>SDKs</h1>
<h2>Python SDK</h2>
<pre><code>pip install openai</code></pre>
<pre><code>from openai import OpenAI
client = OpenAI(
api_key="your-api-key",
base_url="https://api.stack2.9.openclaw.org/v1"
)
response = client.chat.completions.create(
model="qwen/qwen2.5-coder-32b",
messages=[{"role": "user", "content": "Hello"}]
)
print(response.choices[0].message.content)</code></pre>
<h2>JavaScript SDK</h2>
<pre><code>npm install openai</code></pre>
<pre><code>import OpenAI from 'openai';
const client = new OpenAI({
apiKey: 'your-api-key',
baseURL: 'https://api.stack2.9.openclaw.org/v1'
});
const response = await client.chat.completions.create({
model: 'qwen/qwen2.5-coder-32b',
messages: [{role: 'user', content: 'Hello'}]
});
console.log(response.choices[0].message.content);</code></pre>
</div>
</div>
`,
architecture: `
<div class="content-wrapper">
<div class="content-main">
<h1>Architecture</h1>
<h2>System Overview</h2>
<pre><code>┌─────────────────────────────────────────────────────────────┐
│ CLIENT LAYER │
│ CLI │ Web UI │ IDE Plugins │ Voice │ API Clients │
├─────────────────────────────────────────────────────────────┤
│ API GATEWAY │
│ OpenAI-compatible REST │ WebSocket │ Auth │
├─────────────────────────────────────────────────────────────┤
│ ORCHESTRATION LAYER │
│ Agent │ Context Manager │ Tool Coordinator │
├─────────────────────────────────────────────────────────────┤
│ MODEL LAYER │ TOOL ENGINE │ SELF-EVOLUTION │
│ Qwen2.5-Coder │ 37 Tools │ Observe/Learn │
│ 32B + LoRA │ Sandbox Exec │ Memory/Train │
└─────────────────────────────────────────────────────────────┘</code></pre>
<h2>Model Layer</h2>
<ul>
<li><strong>Base Model:</strong> Qwen2.5-Coder-32B</li>
<li><strong>Fine-tuning:</strong> OpenClaw tool patterns</li>
<li><strong>LoRA Adapters:</strong> Self-evolution, voice synthesis</li>
<li><strong>Quantization:</strong> AWQ 4-bit for efficient inference</li>
</ul>
<h2>Tool Engine</h2>
<ul>
<li><strong>Sandbox Execution:</strong> Isolated environment for tool calls</li>
<li><strong>Permission System:</strong> Fine-grained access control</li>
<li><strong>Timeout Management:</strong> Prevents runaway processes</li>
</ul>
<h2>Self-Evolution</h2>
<ul>
<li><strong>Observer:</strong> Monitors task execution</li>
<li><strong>Learner:</strong> Extracts patterns from experience</li>
<li><strong>Memory:</strong> Vector-based persistent storage</li>
<li><strong>Trainer:</strong> Fine-tunes model based on learnings</li>
</ul>
</div>
</div>
`,
"self-evolution": `
<div class="content-wrapper">
<div class="content-main">
<h1>Self-Evolution Mechanism</h1>
<p>Stack 2.9 continuously improves itself through a closed-loop learning system.</p>
<h2>The Learning Cycle</h2>
<pre><code>┌─────────────────────────────────────────────────────────────┐
│ SELF-EVOLUTION CYCLE │
├─────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐ │
│ │ OBSERVE │───▶│ LEARN │───▶│REMEMBER │───▶│ APPLY │ │
│ │ │ │ │ │ │ │ │ │
│ └─────────┘ └─────────┘ └─────────┘ └─────────┘ │
│ │ │ │
│ └─────────────────────────────────────────────┘ │
│ Feedback Loop │
└─────────────────────────────────────────────────────────────┘</code></pre>
<h2>Observer</h2>
<p>Records all task execution details:</p>
<ul>
<li>Decision points and outcomes</li>
<li>Tool usage patterns</li>
<li>Success/failure details</li>
</ul>
<h2>Learner</h2>
<p>Analyzes observations and extracts:</p>
<ul>
<li>Successful approaches (≥3 occurrences)</li>
<li>Failure patterns (≥2 occurrences)</li>
<li>Improvement suggestions</li>
</ul>
<h2>Memory</h2>
<p>Persistent vector-based storage:</p>
<ul>
<li>SQLite for structured data</li>
<li>Vector embeddings for similarity search</li>
<li>Success rate tracking</li>
<li>Session history</li>
</ul>
<h2>Trainer</h2>
<p>Applies improvements:</p>
<ul>
<li>LoRA adapter fine-tuning</li>
<li>Tool pattern optimization</li>
<li>Validation and testing</li>
</ul>
</div>
</div>
`,
tools: `
<div class="content-wrapper">
<div class="content-main">
<h1>Tool System</h1>
<p>Stack 2.9 includes 37 built-in tools organized into categories.</p>
<h2>File Operations (8 tools)</h2>
<pre><code>• read_file - Read file contents with line offsets
• write_file - Create or overwrite files
• edit_file - Make targeted line-based edits
• delete_file - Remove files safely
• list_dir - Directory listing with details
• create_dir - Create directories recursively
• copy_file - Copy files to new location
• move_file - Move/rename files</code></pre>
<h2>Search Operations (4 tools)</h2>
<pre><code>• grep - Text search within files
• search_code - Code-aware semantic search
• find_files - Find files by glob patterns
• search_web - Web search functionality</code></pre>
<h2>Git Operations (8 tools)</h2>
<pre><code>• git_status - Check repository status
• git_log - View commit history
• git_diff - Show changes between commits
• git_commit - Create commits with messages
• git_push - Push to remote repository
• git_pull - Pull from remote
• git_branch - List/create/delete branches
• git_merge - Merge branches</code></pre>
<h2>Shell Commands (5 tools)</h2>
<pre><code>• run_command - Execute shell commands
• background - Run commands in background
• job_control - Manage background jobs
• env_vars - Read/set environment variables
• process_info - Get process information</code></pre>
<h2>API/Web Operations (4 tools)</h2>
<pre><code>• http_request - Make HTTP requests
• download - Download files from URLs
• parse_json - Parse and query JSON
• scrape_web - Web scraping</code></pre>
<h2>Voice (3 tools)</h2>
<pre><code>• speech_to_text - Convert speech to text
• text_to_speech - Convert text to speech
• voice_clone - Clone voice for synthesis</code></pre>
<h2>Tool Execution</h2>
<p>Tools run in an isolated sandbox with:</p>
<ul>
<li>Filesystem access scoping</li>
<li>Network access restrictions</li>
<li>Resource limits (CPU, memory, time)</li>
<li>Command allowlisting</li>
</ul>
</div>
</div>
`,
benchmarking: `
<div class="content-wrapper">
<div class="content-main">
<h1>Benchmarks</h1>
<h2>Coding Benchmarks</h2>
<table>
<thead>
<tr><th>Benchmark</th><th>Stack 2.9</th><th>Description</th></tr>
</thead>
<tbody>
<tr><td><strong>HumanEval</strong></td><td><span class="badge badge-success">76.8%</span></td><td>Python coding tasks</td></tr>
<tr><td><strong>MBPP</strong></td><td><span class="badge badge-success">82.3%</span></td><td>Python function synthesis</td></tr>
<tr><td><strong>Tool Use</strong></td><td><span class="badge badge-success">94.1%</span></td><td>OpenClaw tool patterns</td></tr>
</tbody>
</table>
<h2>Comparison</h2>
<table>
<thead>
<tr><th>Benchmark</th><th>Stack 2.9</th><th>GPT-4</th><th>Claude 3.5</th></tr>
</thead>
<tbody>
<tr><td>HumanEval</td><td>76.8%</td><td>90%</td><td>92%</td></tr>
<tr><td>MBPP</td><td>82.3%</td><td>86%</td><td>88%</td></tr>
</tbody>
</table>
<h2>Model Specs</h2>
<table>
<thead>
<tr><th>Specification</th><th>Value</th></tr>
</thead>
<tbody>
<tr><td>Base Model</td><td>Qwen2.5-Coder-32B</td></tr>
<tr><td>Parameters</td><td>32 billion</td></tr>
<tr><td>Context Window</td><td>131,072 tokens</td></tr>
<tr><td>Quantization</td><td>AWQ 4-bit</td></tr>
</tbody>
</table>
</div>
</div>
`,
contributing: `
<div class="content-wrapper">
<div class="content-main">
<h1>Contributing</h1>
<p>We welcome contributions! Here's how to get started.</p>
<h2>Getting Started</h2>
<pre><code># Fork the repository
# Clone your fork
git clone https://github.com/YOUR_USERNAME/stack-2.9.git
cd stack-2.9
# Create feature branch
git checkout -b feature/your-feature-name
# Make changes and commit
git commit -m "Add your feature"
# Push and create PR
git push origin feature/your-feature-name</code></pre>
<h2>Development Setup</h2>
<pre><code># Create venv and install
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
# Install pre-commit hooks
pre-commit install
# Run tests
pytest</code></pre>
<h2>Code Style</h2>
<ul>
<li>Follow PEP 8 (line length: 100)</li>
<li>Use type hints where possible</li>
<li>Add docstrings to all public functions</li>
</ul>
<h2>Commit Messages</h2>
<pre><code>&lt;type&gt;(&lt;scope&gt;): &lt;subject&gt;
feat(tools): add file search functionality
fix(api): handle rate limit errors properly</code></pre>
<h2>Types</h2>
<ul>
<li><code>feat</code> - New feature</li>
<li><code>fix</code> - Bug fix</li>
<li><code>docs</code> - Documentation</li>
<li><code>refactor</code> - Code refactoring</li>
<li><code>test</code> - Adding tests</li>
</ul>
<h2>Testing</h2>
<pre><code># Run all tests
pytest
# Run with coverage
pytest --cov=stack_cli --cov-report=html
# Run specific test
pytest tests/test_agent.py -v</code></pre>
</div>
</div>
`,
changelog: `
<div class="content-wrapper">
<div class="content-main">
<h1>Changelog</h1>
<h2>[1.0.0] - 2026-03-30</h2>
<h3>Added</h3>
<ul>
<li>Initial release</li>
<li>Gradio web interface</li>
<li>Docker support</li>
<li>GitHub Actions CI/CD</li>
<li>Test suite</li>
<li>Documentation</li>
<li>Qwen2.5-Coder-32B base model</li>
<li>OpenClaw tool patterns</li>
<li>Self-evolution system</li>
<li>Voice integration</li>
</ul>
</div>
</div>
`
};
// Search index
const searchIndex = [
{ id: 'home', title: 'Home', section: 'Getting Started', content: 'overview introduction features quick start benchmarks' },
{ id: 'quickstart', title: 'Quick Start', section: 'Getting Started', content: 'quickstart install setup prerequisites python node docker' },
{ id: 'features', title: 'Features', section: 'Getting Started', content: 'features tools code generation voice self-evolution' },
{ id: 'setup', title: 'Installation', section: 'Setup', content: 'setup installation hardware requirements software prerequisites troubleshooting' },
{ id: 'configuration', title: 'Configuration', section: 'Setup', content: 'configuration environment variables api model self-evolution' },
{ id: 'docker', title: 'Docker', section: 'Setup', content: 'docker container deployment kubernetes' },
{ id: 'api', title: 'REST API', section: 'API', content: 'api rest endpoints authentication chat completions errors' },
{ id: 'websocket', title: 'WebSocket', section: 'API', content: 'websocket streaming real-time connection' },
{ id: 'sdks', title: 'SDKs', section: 'API', content: 'sdk python javascript typescript client' },
{ id: 'architecture', title: 'Architecture', section: 'Reference', content: 'architecture system design components layers' },
{ id: 'self-evolution', title: 'Self-Evolution', section: 'Reference', content: 'self-evolution learning observe learn remember apply' },
{ id: 'tools', title: 'Tool System', section: 'Reference', content: 'tools file operations git shell api voice' },
{ id: 'benchmarking', title: 'Benchmarks', section: 'Reference', content: 'benchmarks humaneval mbpp performance comparison' },
{ id: 'contributing', title: 'Contributing', section: 'Reference', content: 'contributing development setup code style tests' },
{ id: 'changelog', title: 'Changelog', section: 'Reference', content: 'changelog releases updates' }
];
// State
let currentDoc = 'home';
let isDark = false;
// Initialize
document.addEventListener('DOMContentLoaded', () => {
showDoc('home');
initTheme();
initSearch();
});
// Show documentation
function showDoc(docId) {
currentDoc = docId;
const content = docs[docId] || '<h1>Page not found</h1>';
document.getElementById('content').innerHTML = content;
// Update active sidebar link
document.querySelectorAll('.sidebar-link').forEach(link => {
link.classList.remove('active');
if (link.dataset.doc === docId) {
link.classList.add('active');
}
});
// Close mobile sidebar
document.getElementById('sidebar').classList.remove('open');
// Scroll to top
window.scrollTo(0, 0);
}
// Toggle theme
function toggleTheme() {
isDark = !isDark;
document.documentElement.setAttribute('data-theme', isDark ? 'dark' : 'light');
localStorage.setItem('theme', isDark ? 'dark' : 'light');
}
// Initialize theme
function initTheme() {
const saved = localStorage.getItem('theme');
isDark = saved === 'dark' || (!saved && window.matchMedia('(prefers-color-scheme: dark)').matches);
document.documentElement.setAttribute('data-theme', isDark ? 'dark' : 'light');
}
// Toggle sidebar (mobile)
function toggleSidebar() {
document.getElementById('sidebar').classList.toggle('open');
}
// Search functionality
function initSearch() {
const input = document.getElementById('searchInput');
const results = document.getElementById('searchResults');
input.addEventListener('input', (e) => {
const query = e.target.value.toLowerCase().trim();
if (query.length < 2) {
results.classList.remove('active');
return;
}
const matches = searchIndex.filter(item =>
item.title.toLowerCase().includes(query) ||
item.content.includes(query)
);
if (matches.length > 0) {
results.innerHTML = matches.slice(0, 8).map(item => `
<div class="search-result-item" onclick="showDoc('${item.id}')">
<div class="search-result-section">${item.section}</div>
<div class="search-result-title">${item.title}</div>
</div>
`).join('');
results.classList.add('active');
} else {
results.innerHTML = '<div class="search-result-item"><div class="search-result-title">No results found</div></div>';
results.classList.add('active');
}
});
// Keyboard shortcut
document.addEventListener('keydown', (e) => {
if ((e.ctrlKey || e.metaKey) && e.key === 'k') {
e.preventDefault();
input.focus();
}
if (e.key === 'Escape') {
results.classList.remove('active');
input.blur();
}
});
// Close on click outside
document.addEventListener('click', (e) => {
if (!e.target.closest('.search-container')) {
results.classList.remove('active');
}
});
}
</script>
</body>
</html>