Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8,472 changes: 8,472 additions & 0 deletions public/skill/SKILL.md

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ import { CONTENT } from './data/content.jsx';
export function App() {
const [lang, setLang] = useState('en');
const [view, setView] = useState(() => (window.location.hash.startsWith('#docs') ? 'docs' : 'home'));
const [docsInitialTab, setDocsInitialTab] = useState(() =>
window.location.hash.includes('catalog') ? 'catalog' : 'chapters'
);
const currentContent = CONTENT[lang] || CONTENT.en;

useEffect(() => {
Expand Down Expand Up @@ -64,25 +67,21 @@ export function App() {
}, []);

useEffect(() => {
const handleHash = () => {
if (window.location.hash.startsWith('#docs')) {
setView('docs');
} else {
setView('home');
}
};
window.addEventListener('hashchange', handleHash);
return () => window.removeEventListener('hashchange', handleHash);
// Older builds used a #docs fragment even though the guide is an
// in-app view. Remove it from old links so navigation never leaves a
// decorative hash in the address bar.
if (window.location.hash.startsWith('#docs')) {
window.history.replaceState(null, '', window.location.pathname + window.location.search);
}
}, []);

const openDocs = (target) => {
window.location.hash = target === 'catalog' ? '#docs-catalog' : '#docs';
setDocsInitialTab(target === 'catalog' ? 'catalog' : 'chapters');
setView('docs');
window.scrollTo({ top: 0, behavior: 'smooth' });
};

const backHome = () => {
window.location.hash = '';
setView('home');
window.scrollTo({ top: 0, behavior: 'smooth' });
};
Expand All @@ -94,6 +93,7 @@ export function App() {
lang={lang}
setLang={setLang}
onBackToHome={backHome}
initialTab={docsInitialTab}
/>
);
}
Expand Down
6 changes: 2 additions & 4 deletions src/components/FumadocsView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -266,10 +266,8 @@ function FormattedContent({ rawContent, copyLabel, copiedLabel, failedLabel }) {
);
}

export function FumadocsView({ content, lang, setLang, onBackToHome }) {
const [activeTab, setActiveTab] = useState(() =>
window.location.hash.includes('catalog') ? 'catalog' : 'chapters'
);
export function FumadocsView({ content, lang, setLang, onBackToHome, initialTab = 'chapters' }) {
const [activeTab, setActiveTab] = useState(initialTab);
const [activeSection, setActiveSection] = useState(0);
const [chapterDropdownOpen, setChapterDropdownOpen] = useState(false);
const [searchQuery, setSearchQuery] = useState('');
Expand Down
4 changes: 3 additions & 1 deletion src/components/QuasarScene.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,8 @@ function rotate(v, k, ang) {
// the page bare
const DEFAULT_PITCH = 0.34;
const DEFAULT_DIST = 26.0;
const DIST_MIN = 15.0;
const DIST_MAX = 33.0;
// how far the eye sits below the middle of the band, to compensate for the
// bright limb of the disk glowing above the eye point
const BRIGHT_LIFT = 16;
Expand Down Expand Up @@ -777,7 +779,7 @@ export function QuasarScene({ lang = 'en', copyRef = null }) {
stateRef.current.isDragging = false;
};
const zoomBy = (k) => {
stateRef.current.dist = Math.max(14.0, Math.min(48.0, stateRef.current.dist * k));
stateRef.current.dist = Math.max(DIST_MIN, Math.min(DIST_MAX, stateRef.current.dist * k));
start();
};

Expand Down
28 changes: 14 additions & 14 deletions src/data/docs.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Hotaru inherits the transport and the cryptography from GoyGram.

![The GoyGram mark](media/goygram-mark.png)

The chart below is the upstream GoyGram TL codec benchmark, rendered here in grayscale to match the rest of the interface.
The chart below is the upstream GoyGram TL codec benchmark.

![GoyGram TL codec benchmark: 351270 operations per second for serialize sendMessage](media/goygram-codec.png)`,
},
Expand Down Expand Up @@ -101,7 +101,7 @@ HOTARU = {

| Field | Type | Rule |
| --- | --- | --- |
| \`id\` | string | Non-empty, at most 128 characters, no slash or NUL. |
| \`id\` | string | Canonical module ID and default name. Non-empty, at most 128 characters, no slash or NUL. |
| \`version\` | string | Non-empty. |
| \`commands\` | list of strings | No empty entries and no whitespace inside a command. |
| \`capabilities\` | list of strings | Names from the capability registry. |
Expand All @@ -110,7 +110,7 @@ HOTARU = {

| Field | Type | Meaning |
| --- | --- | --- |
| \`name\` | string | Display name. Defaults to \`id\`. |
| \`name\` | string | Optional display label; the runtime uses \`id\` when omitted. |
| \`watchers\` | list of strings | Watcher entry points the runtime subscribes. |
| \`tasks\` | dict | Background tasks. Each entry may set \`interval\` (seconds, default 60) and \`autostart\`. |
| \`aliases\` | dict | Alternative command names mapped to existing commands. |
Expand Down Expand Up @@ -385,9 +385,9 @@ The image below is the running Singularity frontend, captured from the upstream
},
{
id: 'skill',
title: 'The agent skill',
summary: 'SKILL.md, the reference an agent reads to write modules against the real API.',
content: `\`SKILL.md\` is the guide written for an AI agent that has to produce working modules. It is a single file, and it is the same file the download button serves.
title: 'Module-writing reference',
summary: 'SKILL.md documents the Hotaru module contract and runtime API.',
content: `\`SKILL.md\` is the reference for Hotaru's module contract and runtime API. It is available as a single-file download.

### What it contains

Expand All @@ -404,7 +404,7 @@ The method cards are generated from the upstream sources rather than written by

### Language

The guide is written in Russian, which is the language of the upstream project. The interface here keeps the same split: this documentation in the language you chose, the agent guide in the language it was written in.`,
The guide is written in Russian, the language of the upstream project.`,
},
];

Expand Down Expand Up @@ -436,7 +436,7 @@ Hotaru наследует транспорт и криптографию от Go

![Знак GoyGram](media/goygram-mark.png)

На графике ниже — бенчмарк TL-кодек GoyGram из upstream-репозитория, переведённый здесь в оттенки серого, чтобы встать в ряд с остальным интерфейсом.
На графике ниже — бенчмарк TL-кодек GoyGram из upstream-репозитория.

![Бенчмарк TL-кодек GoyGram: 351270 операций в секунду на serialize sendMessage](media/goygram-codec.png)`,
},
Expand Down Expand Up @@ -511,7 +511,7 @@ HOTARU = {

| Поле | Тип | Правило |
| --- | --- | --- |
| \`id\` | строка | Не пусто, не длиннее 128 символов, без слэша и NUL. |
| \`id\` | строка | Канонический ID и имя модуля по умолчанию. Не пусто, не длиннее 128 символов, без слэша и NUL. |
| \`version\` | строка | Не пусто. |
| \`commands\` | список строк | Без пустых записей и без пробелов внутри команды. |
| \`capabilities\` | список строк | Имена из реестра владений. |
Expand All @@ -520,7 +520,7 @@ HOTARU = {

| Поле | Тип | Значение |
| --- | --- | --- |
| \`name\` | строка | Отображаемое имя. По умолчанию равно \`id\`. |
| \`name\` | строка | Необязательная подпись для отображения; если её нет, среда использует \`id\`. |
| \`watchers\` | список строк | Точки входа наблюдателей, на которые подписывается среда. |
| \`tasks\` | словарь | Фоновые задачи. У каждой можно задать \`interval\` (секунды, по умолчанию 60) и \`autostart\`. |
| \`aliases\` | словарь | Другие имена команд, отображаемые на существующие. |
Expand Down Expand Up @@ -795,9 +795,9 @@ Hotaru может поднять туннель Cloudflare Horizon и зарег
},
{
id: 'skill',
title: 'Скилл для агента',
summary: 'SKILL.md — справочник, по которому агент пишет модули по настоящему API.',
content: `\`SKILL.md\` — руководство, написанное для ИИ-агента, которому нужно писать рабочие модули. Это один файл, и именно его отдаёт кнопка скачивания.
title: 'Справочник по разработке модулей',
summary: 'SKILL.md описывает контракт модулей Hotaru и API среды выполнения.',
content: `\`SKILL.md\` — справочник по контракту модулей и реальному API Hotaru. Он доступен для скачивания одним файлом.

### Что внутри

Expand All @@ -814,6 +814,6 @@ Hotaru может поднять туннель Cloudflare Horizon и зарег

### Язык

Руководство написано по-русски — на языке самого проекта. Здесь разделение такое же: эта документация на выбранном вами языке, руководство для агента на языке, на котором оно написано.`,
Руководство написано по-русски, как и сам проект.`,
},
];
6 changes: 3 additions & 3 deletions src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -882,15 +882,15 @@
margin-top: var(--space-lg);
font-size: var(--text-lg);
color: var(--color-ink);
text-shadow: var(--halo-doc-title);
text-shadow: var(--halo-doc-head);
}
.doc-h3 {
margin-top: var(--space-md);
font-family: var(--font-body);
font-size: var(--text-md);
font-weight: 600;
color: var(--color-ink);
text-shadow: 0 0 16px oklch(100% 0 0 / 0.09);
text-shadow: var(--halo-doc-head);
}
.doc-list {
margin: 0;
Expand Down Expand Up @@ -986,7 +986,7 @@
cursor: pointer;
transition: color var(--dur-short) var(--ease-out), background-color var(--dur-short) var(--ease-out);
}
.doc-code code { font: inherit; white-space: pre; }
.doc-code code { font: inherit; white-space: pre-wrap; overflow-wrap: anywhere; }
.doc-code:hover { color: var(--color-ink); }
.doc-code:focus-visible { outline: 2px solid var(--color-focus); outline-offset: -2px; }
.doc-code--done { color: var(--color-ink); background: oklch(100% 0 0 / 0.035); }
Expand Down
14 changes: 10 additions & 4 deletions src/tokens.css
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,16 @@
0 0 40px oklch(100% 0 0 / 0.17),
0 0 96px oklch(100% 0 0 / 0.07);
--halo-doc-title:
0 0 3px oklch(100% 0 0 / 0.14),
-2px 0 11px oklch(100% 0 0 / 0.07),
2px 0 11px oklch(100% 0 0 / 0.07),
0 0 28px oklch(100% 0 0 / 0.04);
0 0 4px oklch(100% 0 0 / 0.42),
-3px 0 15px oklch(100% 0 0 / 0.28),
3px 0 15px oklch(100% 0 0 / 0.28),
0 0 34px oklch(100% 0 0 / 0.16),
0 0 80px oklch(100% 0 0 / 0.07);
--halo-doc-head:
0 0 3px oklch(100% 0 0 / 0.30),
-2px 0 10px oklch(100% 0 0 / 0.16),
2px 0 10px oklch(100% 0 0 / 0.16),
0 0 24px oklch(100% 0 0 / 0.08);
--halo-method:
0 0 4px oklch(100% 0 0 / 0.62),
-2px 0 12px oklch(100% 0 0 / 0.34),
Expand Down
Loading