Skip to content

Commit e0257cb

Browse files
Antigravity Agentclaude
andcommitted
feat: Add Docusaurus documentation site with GitHub Pages deployment
- Create Docusaurus site in docsite/ with Trinity branding - Add documentation: intro, getting-started, API reference, architecture - Configure GitHub Actions workflow for automated deployment - Custom homepage with VSA, BitNet, and VIBEE features - Purple/gradient theme matching Trinity brand 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 1dd311e commit e0257cb

33 files changed

Lines changed: 20102 additions & 0 deletions

.github/workflows/deploy-docs.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Deploy Documentation to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'docsite/**'
9+
- '.github/workflows/deploy-docs.yml'
10+
workflow_dispatch:
11+
12+
permissions:
13+
contents: read
14+
pages: write
15+
id-token: write
16+
17+
concurrency:
18+
group: "pages"
19+
cancel-in-progress: false
20+
21+
jobs:
22+
build:
23+
runs-on: ubuntu-latest
24+
defaults:
25+
run:
26+
working-directory: docsite
27+
steps:
28+
- name: Checkout
29+
uses: actions/checkout@v4
30+
31+
- name: Setup Node.js
32+
uses: actions/setup-node@v4
33+
with:
34+
node-version: '20'
35+
36+
- name: Install dependencies
37+
run: npm install
38+
39+
- name: Build website
40+
run: npm run build
41+
42+
- name: Setup Pages
43+
uses: actions/configure-pages@v4
44+
45+
- name: Upload artifact
46+
uses: actions/upload-pages-artifact@v3
47+
with:
48+
path: docsite/build
49+
50+
deploy:
51+
environment:
52+
name: github-pages
53+
url: ${{ steps.deployment.outputs.page_url }}
54+
runs-on: ubuntu-latest
55+
needs: build
56+
steps:
57+
- name: Deploy to GitHub Pages
58+
id: deployment
59+
uses: actions/deploy-pages@v4

docsite/.gitignore

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Dependencies
2+
/node_modules
3+
4+
# Production
5+
/build
6+
7+
# Generated files
8+
.docusaurus
9+
.cache-loader
10+
11+
# Misc
12+
.DS_Store
13+
.env.local
14+
.env.development.local
15+
.env.test.local
16+
.env.production.local
17+
18+
npm-debug.log*
19+
yarn-debug.log*
20+
yarn-error.log*

docsite/README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Website
2+
3+
This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator.
4+
5+
## Installation
6+
7+
```bash
8+
yarn
9+
```
10+
11+
## Local Development
12+
13+
```bash
14+
yarn start
15+
```
16+
17+
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
18+
19+
## Build
20+
21+
```bash
22+
yarn build
23+
```
24+
25+
This command generates static content into the `build` directory and can be served using any static contents hosting service.
26+
27+
## Deployment
28+
29+
Using SSH:
30+
31+
```bash
32+
USE_SSH=true yarn deploy
33+
```
34+
35+
Not using SSH:
36+
37+
```bash
38+
GIT_USER=<Your GitHub username> yarn deploy
39+
```
40+
41+
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.

docsite/docs/api/firebird.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
sidebar_position: 5
3+
---
4+
5+
# Firebird API
6+
7+
LLM Inference Engine with BitNet Support.
8+
9+
**Module:** `src/firebird/`
10+
11+
## CLI Commands
12+
13+
### Chat Mode
14+
15+
```bash
16+
./bin/firebird chat --model path/to/model.gguf
17+
```
18+
19+
### Server Mode
20+
21+
```bash
22+
./bin/firebird serve --port 8080 --model model.gguf
23+
```
24+
25+
## HTTP API
26+
27+
### POST /v1/chat/completions
28+
29+
OpenAI-compatible chat endpoint.
30+
31+
```json
32+
{
33+
"model": "bitnet-3b",
34+
"messages": [{"role": "user", "content": "Hello!"}],
35+
"temperature": 0.7
36+
}
37+
```
38+
39+
## Performance
40+
41+
| Model Size | Memory | Tokens/sec |
42+
|------------|--------|------------|
43+
| 1.5B | ~1GB | 15-20 |
44+
| 3B | ~2GB | 8-12 |
45+
| 7B | ~4GB | 4-6 |

docsite/docs/api/hybrid.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
sidebar_position: 4
3+
---
4+
5+
# Hybrid API
6+
7+
HybridBigInt — Optimal Memory/Speed Trade-off.
8+
9+
**Module:** `src/hybrid.zig`
10+
11+
## Storage Modes
12+
13+
| Mode | Storage | Speed | Use Case |
14+
|------|---------|-------|----------|
15+
| Packed | 1.58 bits/trit | Slower | Storage |
16+
| Unpacked | 8 bits/trit | Fast | Computation |
17+
18+
## Core Functions
19+
20+
### zero() → HybridBigInt
21+
22+
```zig
23+
var v = HybridBigInt.zero();
24+
```
25+
26+
### random(len) → HybridBigInt
27+
28+
```zig
29+
var v = HybridBigInt.random(1000);
30+
```
31+
32+
### pack() / ensureUnpacked()
33+
34+
```zig
35+
vector.pack(); // Memory efficient
36+
vector.ensureUnpacked(); // Compute efficient
37+
```
38+
39+
## Constants
40+
41+
| Constant | Value | Description |
42+
|----------|-------|-------------|
43+
| `MAX_TRITS` | 59049 | Maximum dimension |
44+
| `SIMD_WIDTH` | 32 | Parallel trits |

docsite/docs/api/index.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
sidebar_position: 1
3+
sidebar_label: Overview
4+
---
5+
6+
# API Reference
7+
8+
Complete API documentation for Trinity modules.
9+
10+
## Core Modules
11+
12+
| Module | Description |
13+
|--------|-------------|
14+
| [VSA](/docs/api/vsa) | Vector Symbolic Architecture |
15+
| [VM](/docs/api/vm) | Ternary Virtual Machine |
16+
| [Hybrid](/docs/api/hybrid) | HybridBigInt storage |
17+
| [Firebird](/docs/api/firebird) | LLM inference engine |
18+
| [VIBEE](/docs/api/vibee) | Specification compiler |
19+
| [Plugin](/docs/api/plugin) | Extension system |
20+
21+
## Quick Reference
22+
23+
### VSA Operations
24+
25+
```zig
26+
vsa.bind(a, b) // Create association
27+
vsa.unbind(bound, key) // Retrieve from binding
28+
vsa.bundle2(a, b) // Combine 2 vectors
29+
vsa.cosineSimilarity(a, b) // Compare vectors [-1, 1]
30+
vsa.hammingDistance(a, b) // Count differences
31+
vsa.permute(v, count) // Cyclic shift
32+
```
33+
34+
### HybridBigInt
35+
36+
```zig
37+
var v = HybridBigInt.zero(); // Zero vector
38+
var v = HybridBigInt.random(1000); // Random vector
39+
v.pack(); // Memory efficient
40+
v.ensureUnpacked(); // Compute efficient
41+
```
42+
43+
### CLI Commands
44+
45+
```bash
46+
./bin/vibee gen <spec.vibee> # Generate code
47+
./bin/vibee run <program.999> # Execute program
48+
./bin/vibee chat --model <path> # Interactive chat
49+
./bin/vibee serve --port 8080 # HTTP server
50+
```

docsite/docs/api/plugin.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
sidebar_position: 7
3+
---
4+
5+
# Plugin API
6+
7+
Extensible Plugin System for Trinity.
8+
9+
**Module:** `src/vibeec/plugin/`
10+
11+
## Plugin Types
12+
13+
| Type | Loading | Use Case |
14+
|------|---------|----------|
15+
| `comptime_import` | @import | Core |
16+
| `wasm_runtime` | WASM | Community |
17+
| `native_ffi` | .so/.dylib | Performance |
18+
19+
## Creating a Plugin
20+
21+
1. Create `plugin.vibee` specification
22+
2. Implement required exports
23+
3. Build to WASM
24+
25+
## Loading Plugins
26+
27+
```zig
28+
var loader = PluginLoader.init(allocator, &registry, .{});
29+
const result = try loader.loadFromPath("plugin.wasm");
30+
```
31+
32+
## CLI Commands
33+
34+
```bash
35+
vibee plugin list # List installed
36+
vibee plugin install <url> # Install
37+
vibee plugin init <name> # Create new
38+
```

docsite/docs/api/vibee.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
sidebar_position: 6
3+
---
4+
5+
# VIBEE API
6+
7+
Specification-Driven Code Generator.
8+
9+
**Module:** `src/vibeec/`
10+
11+
## CLI Commands
12+
13+
```bash
14+
./bin/vibee gen <spec.vibee> # Generate Zig
15+
./bin/vibee run <program.999> # Execute via VM
16+
./bin/vibee koschei # Development cycle
17+
```
18+
19+
## Specification Format
20+
21+
```yaml
22+
name: module_name
23+
version: "1.0.0"
24+
language: zig
25+
module: module_name
26+
27+
types:
28+
TypeName:
29+
fields:
30+
field1: String
31+
field2: Int
32+
33+
behaviors:
34+
- name: function_name
35+
given: Precondition
36+
when: Action
37+
then: Expected result
38+
```
39+
40+
## Supported Types
41+
42+
| Type | Description |
43+
|------|-------------|
44+
| `String` | Text string |
45+
| `Int` | Integer |
46+
| `Float` | Floating point |
47+
| `Bool` | Boolean |
48+
| `List<T>` | Array |
49+
| `Option<T>` | Nullable |

0 commit comments

Comments
 (0)