splinter: the site speaks both languages, from one source

The page was hardcoded German while the program has catalogues - the same
inconsistency the operator keeps finding, this time in the docs.

tools/gen_www.py now holds the skeleton and both languages and writes
index.html (de) and index.en.html (en). A key that exists in one language and
not the other is a hard error, and 'make check' runs the generator with --check,
so a page that no longer matches its source fails the build instead of living on
as a stale copy - exactly the rule the program's own catalogues follow.

Verified: both pages generated (11158 / 10888 bytes), xmllint --html clean, and
both serve 200 on :8099 with a language switch in the header.
This commit is contained in:
Konrad committed 2026-11-08 14:00:51 +00:00
1 parent 6872aad60a
commit bb365ef08b
4 files changed
+624 -93

No files matched your search

+6 -1
View File
@@ -161,7 +161,7 @@ tests/test_plugin: tests/test_plugin.c $(LIB) $(PLUGIN)
$(CC) $(CFLAGS) -o $@ tests/test_plugin.c -L. -lsplinter $(TEST_RPATH) $(LIBS)
check: $(LIB) $(BIN) $(PLUGIN) $(TESTS)
@set -e; python3 tools/check_i18n.py; \
@set -e; python3 tools/check_i18n.py; python3 tools/gen_www.py --check; \
for t in $(TESTS); do echo "== $$t"; ./$$t; done; \
echo "all tests passed"
@@ -174,3 +174,8 @@ clean:
rm -f $(BIN) $(LIB) $(LIBOBJ) $(BINOBJ) $(PLUGIN) $(TESTS)
.PHONY: all check curses install clean
# The pages are generated: one source, every language, and a missing translation
# is a hard error - the same rule as the program's own catalogues.
www:
python3 tools/gen_www.py
+171
View File
@@ -0,0 +1,171 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>splinter — an agent harness you own</title>
<meta name="description" content="splinter is a C99/POSIX agent harness: chat in the terminal, tools with authorization classes, plugins, any OpenAI-compatible endpoint, a Telegram gateway.">
<style type="text/css">
body { background: #0d0f12; color: #c8ccd2; margin: 0; padding: 0;
font-family: "DejaVu Sans Mono", "Courier New", monospace;
font-size: 14px; line-height: 1.55; }
#wrap { width: 46em; margin: 0 auto; padding: 3em 1.5em 6em 1.5em; }
h1 { font-size: 2.4em; color: #e8ecf1; margin: 0 0 0.2em 0; letter-spacing: -0.02em; }
h1 span { color: #5f9ea0; }
h2 { font-size: 1em; color: #5f9ea0; margin: 2.6em 0 0.7em 0; font-weight: normal;
border-bottom: 1px solid #22262c; padding-bottom: 0.3em;
text-transform: uppercase; letter-spacing: 0.08em; }
p { margin: 0.8em 0; }
a { color: #7fb3b5; text-decoration: none; border-bottom: 1px dotted #3d5a5c; }
a:hover { color: #a8d8da; }
.lead { font-size: 1.15em; color: #e2e6ea; }
.meta { color: #6b727c; font-size: 0.92em; margin-bottom: 2.5em; }
.meta b { color: #9aa2ad; font-weight: normal; }
pre { background: #07090b; border: 1px solid #1d2126; border-left: 2px solid #2f4a4c;
padding: 1em 1.1em; overflow-x: auto; font-size: 0.88em; line-height: 1.45;
color: #b9c0c8; margin: 1.2em 0; }
pre .u { color: #e8ecf1; }
pre .k { color: #5f9ea0; }
pre .d { color: #6b727c; }
table { border-collapse: collapse; width: 100%; margin: 1.2em 0; font-size: 0.9em; }
th { text-align: left; color: #7d848e; font-weight: normal; padding: 0.35em 0.6em;
border-bottom: 1px solid #22262c; text-transform: uppercase; font-size: 0.85em;
letter-spacing: 0.06em; }
td { padding: 0.35em 0.6em; border-bottom: 1px solid #14181c; vertical-align: top; }
td.c { color: #5f9ea0; white-space: nowrap; }
td.m { color: #c98b6b; white-space: nowrap; }
td.x { color: #b06f6f; white-space: nowrap; }
.box { border: 1px solid #1d2126; padding: 0.9em 1em; margin: 1em 0; background: #0a0c0f; }
.box h3 { margin: 0 0 0.3em 0; font-size: 0.95em; color: #e2e6ea; font-weight: normal; }
ul { margin: 0.6em 0 0.6em 1.2em; padding: 0; }
li { margin: 0.25em 0; }
.small { font-size: 0.88em; color: #7d848e; }
hr { border: 0; border-top: 1px solid #1d2126; margin: 3em 0 1.5em 0; }
#foot { color: #5a616b; font-size: 0.88em; }
#lang { color: #5a616b; font-size: 0.88em; margin: 0 0 2em 0; }
</style>
</head>
<body>
<div id="wrap">
<p id="lang"><a href="index.html">Deutsch</a> &middot; English</p>
<h1>splinter<span>_</span></h1>
<p class="lead">An agent harness you own: chat in the terminal, tools with authorization classes, plugins, any model that speaks OpenAI — built by us so we can change it, instead of getting used to how somebody else's client behaves.</p>
<p class="meta"><b>9.125</b> lines of C99/POSIX &middot;
<b>248.568</b> bytes binary &middot; <b>21</b> test programs &middot;
<b>8</b> plugins &middot; <b>42</b> palettes &middot; BSD-3-Clause</p>
<h2>What it is</h2>
<p>The same thing Claude Code or opencode is for you: a program you sit in front of, talking to a model, running the tools it asks for. The difference is the source. If something bothers you — the layout, the keys, the confirmation prompts, the transport — you change it here instead of waiting for someone else to.</p>
<p>splinter is the layer in between: what gets sent, whether a tool may run, what is written down, and what you see on screen.</p>
<h2>What that looks like</h2>
<pre><span class="u">you:</span> Aendere in /tmp/x.c die Zeile 'return 0' in 'return 1'.
<span class="k">thinking:</span> I must read the file, then replace exactly one place.
An ambiguous pattern would be a wrong edit.
<span class="k">tool:</span> edit {"path":"/tmp/x.c","old":"return 0","new":"return 1"}
<span class="k">diff:</span> --- a//tmp/x.c
+++ b//tmp/x.c
@@ -11,3 +11,3 @@
int main(void) {
- return 0;
+ return 1;
}
<span class="k">model:</span> Done. Line 12 returns 1 now.
<span class="d"> splinter 0.1.0 session sess-1794... Delphinium 842 ms</span></pre>
<p>Reasoning, the tool call with its arguments, the diff, the answer. The reasoning block grows where it belongs while the turn runs, and does not jump away when it ends.</p>
<h2>Three checks before any tool runs</h2>
<div class="box"><h3>1 &middot; Budget</h3><p class="small">Does the conversation still fit? If not, it is compacted before sending — not after, and not quietly in the middle of a turn.</p></div>
<div class="box"><h3>2 &middot; Registry</h3><p class="small">Does the tool exist? An invented name becomes an observation, not a crash.</p></div>
<div class="box"><h3>3 &middot; Authorization class</h3><p class="small">The <em>tool</em> declares what it may do — <b>read</b>, <b>mutate</b>, <b>destructive</b>. Not the model, not the prompt. For mutate and destructive the harness asks you — in the prompt line in the chat, as a y/N message on Telegram.</p></div>
<h2>Tools</h2>
<table>
<tr><th>Tool</th><th>Class</th><th>What it does</th></tr>
<tr><td class="c">read</td><td>read</td><td>numbered lines, offset/limit, refuses binary files</td></tr>
<tr><td class="c">search</td><td>read</td><td>literal search over a tree, at most 100 hits</td></tr>
<tr><td class="c">list</td><td>read</td><td>list a directory</td></tr>
<tr><td class="c">skill_search</td><td>read</td><td>find installed skills — nothing is preloaded</td></tr>
<tr><td class="c">skill_load</td><td>read</td><td>read one skill in full</td></tr>
<tr><td class="c">memory_search</td><td>read</td><td>your own memories, scoped per user</td></tr>
<tr><td class="c">write</td><td class="m">mutate</td><td>write a file, with the diff in the observation</td></tr>
<tr><td class="c">edit</td><td class="m">mutate</td><td>replace exactly one occurrence; ambiguous is an error</td></tr>
<tr><td class="c">memory_add</td><td class="m">mutate</td><td>remember one fact</td></tr>
<tr><td class="c">run</td><td class="x">destructive</td><td>a shell command; the exit status is an observation</td></tr>
<tr><td class="c">delegate</td><td class="x">destructive</td><td>hand a task to another model</td></tr>
</table>
<h2>Transports and plugins</h2>
<table>
<tr><th>Name</th><th>What it does</th></tr>
<tr><td class="c">openai</td><td>any OpenAI-compatible endpoint, streaming over SSE</td></tr>
<tr><td class="c">cli</td><td>any program as the model, e.g. <code>claude -p</code></td></tr>
<tr><td class="c">ring</td><td>exit ring: 429 or limit &rarr; next exit</td></tr>
<tr><td class="c">mcp</td><td>an MCP server as a tool source, with its own schemas</td></tr>
<tr><td class="c">lcm</td><td>compaction of the conversation</td></tr>
<tr><td class="c">focus</td><td>reminds the model of the goal every N turns (<code>/goal</code>)</td></tr>
<tr><td class="c">reminder</td><td>puts the ground rules back into the conversation every 10 turns</td></tr>
<tr><td class="c">cps, clock</td><td>widgets in the sidebar</td></tr>
</table>
<h2>Delegation: other models, splinter chooses</h2>
<pre><span class="d"># ~/.splinter/splinter.conf.d/20-delegates.conf</span>
delegate = coder | C99, POSIX, Review | tags=code,c99,review | endpoint=... | model=...
delegate = quick | short answers, chat | tags=chat,cheap | endpoint=... | model=...
<span class="u">$</span> splinter --choose "pruefe diesen C-Code auf Speicherfehler"
coder 7 task mentions 'code'</pre>
<p>A requested tag counts 5, a tag in the task 3, a word from the description 1. The observation opens with the choice and the reason — a wrong pick is visible instead of mysterious. No profiles: one line per model.</p>
<h2>Configuration</h2>
<p><code>~/.splinter/splinter.conf</code>, plus every <code>.conf</code> in <code>~/.splinter/splinter.conf.d/</code> in name order. An unknown key is an error naming the file and line — a typo must not silently do nothing.</p>
<pre><span class="d"># ~/.splinter/splinter.conf</span>
endpoint = http://kontron.local:8080/v1/chat/completions
model = Qwen3.6-35B-A3B-UD-Q8_K_XL.gguf
locale = de
theme = Delphinium
autonomous = 1
telegram_allow = 8300935
plugin = plugins/lcm/lcm.so
plugin = plugins/reminder/reminder.so</pre>
<h2>Gateway: Telegram</h2>
<p><code>splinter --daemon</code> long-polls <code>getUpdates</code>, one turn per message, answers with <code>sendMessage</code>. The token lives in <code>~/.splinter/telegram.token</code> with mode 0600 and is never passed as an argument — arguments end up in <code>ps</code>. While a turn runs, the chat sees &quot;typing&quot; every four seconds.</p>
<p>Slash commands work there too. Programs in <code>~/.splinter/commands/</code> become <code>/name</code>: they get the rest of the line as an argument, and their output goes <em>to the model</em> as context — not to you as a reply. That is how the model fetches what it cannot see itself.</p>
<h2>What gets written down</h2>
<pre><span class="d">~/.splinter/logs/&lt;session&gt;/session.log</span> readable, in order, everything
<span class="d">~/.splinter/logs/&lt;session&gt;/wire.jsonl</span> every request body, every reply, raw</pre>
<p>Your words, the answer, the reasoning, every tool call with its arguments, every observation, failures, token counts. Nothing truncated — a log that keeps only the good parts cannot explain a bad turn.</p>
<h2>Building</h2>
<pre><span class="u">$</span> git clone ssh://host/home/git/splinter.git
<span class="u">$</span> cd splinter &amp;&amp; make <span class="d">248 KB, nothing but libc and curses</span>
<span class="u">$</span> make check <span class="d">21 test programs, plus the i18n checker</span>
<span class="u">$</span> ./splinter <span class="d">chat, the config is read</span>
<span class="u">$</span> ./splinter --daemon <span class="d">Telegram gateway</span></pre>
<p>POSIX make, C99, <code>-Wall -Wextra -Werror</code>. NetBSD curses is vendored, so the binary does not depend on a distribution's mood.</p>
<h2>What it is not</h2>
<ul>
<li>Not a model. splinter ships none and picks none for you.</li>
<li>Not a cloud. It talks to the endpoint you configure.</li>
<li>Not a sandbox. Plugins run in the process with your rights — the classes protect the harness from the model, not from code you chose to load.</li>
</ul>
<hr>
<p id="foot">splinter — C99/POSIX, BSD-3-Clause. Manual: <code>man ./docs/splinter.1</code> &middot; Plugin ABI: <code>docs/PLUGINS.md</code> &middot; We take things apart, rebuild them and keep them. Their systems: leave them alone unless asked.</p>
</div>
</body>
</html>
+36 -92
View File
@@ -3,8 +3,8 @@
<html lang="de">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>splinter &mdash; ein Agent-Harness, das dir gehoert</title>
<meta name="description" content="splinter ist ein Agent-Harness in C99/POSIX: Chat-Oberflaeche im Terminal, Werkzeuge mit Autorisierungsklassen, Plugins, jeder OpenAI-kompatible Endpunkt, Telegram-Gateway.">
<title>splinter — ein Agent-Harness, das dir gehoert</title>
<meta name="description" content="splinter ist ein Agent-Harness in C99/POSIX: Chat im Terminal, Werkzeuge mit Autorisierungsklassen, Plugins, jeder OpenAI-kompatible Endpunkt, Telegram-Gateway.">
<style type="text/css">
body { background: #0d0f12; color: #c8ccd2; margin: 0; padding: 0;
font-family: "DejaVu Sans Mono", "Courier New", monospace;
@@ -27,7 +27,6 @@ pre { background: #07090b; border: 1px solid #1d2126; border-left: 2px solid #2f
pre .u { color: #e8ecf1; }
pre .k { color: #5f9ea0; }
pre .d { color: #6b727c; }
pre .g { color: #7fa86b; }
table { border-collapse: collapse; width: 100%; margin: 1.2em 0; font-size: 0.9em; }
th { text-align: left; color: #7d848e; font-weight: normal; padding: 0.35em 0.6em;
border-bottom: 1px solid #22262c; text-transform: uppercase; font-size: 0.85em;
@@ -43,82 +42,55 @@ li { margin: 0.25em 0; }
.small { font-size: 0.88em; color: #7d848e; }
hr { border: 0; border-top: 1px solid #1d2126; margin: 3em 0 1.5em 0; }
#foot { color: #5a616b; font-size: 0.88em; }
#lang { color: #5a616b; font-size: 0.88em; margin: 0 0 2em 0; }
</style>
</head>
<body>
<div id="wrap">
<p id="lang">Deutsch &middot; <a href="index.en.html">English</a></p>
<h1>splinter<span>_</span></h1>
<p class="lead">Ein Agent-Harness, das dir gehoert: Chat im Terminal, Werkzeuge
mit Autorisierungsklassen, Plugins, jedes Modell das OpenAI spricht &mdash;
von uns gebaut, damit wir es umbauen koennen, statt uns an das Verhalten
eines fremden Clients zu gewoehnen.</p>
<p class="lead">Ein Agent-Harness, das dir gehoert: Chat im Terminal, Werkzeuge mit Autorisierungsklassen, Plugins, jedes Modell das OpenAI spricht — von uns gebaut, damit wir es umbauen koennen, statt uns an das Verhalten eines fremden Clients zu gewoehnen.</p>
<p class="meta"><b>9.125</b> Zeilen C99/POSIX &middot;
<b>248.568</b> Bytes Binary &middot; <b>21</b> Test-Programme &middot;
<b>8</b> Plugins &middot; <b>42</b> Farbschemata &middot; BSD-3-Clause</p>
<h2>Was es ist</h2>
<p>Dasselbe, was Claude Code oder opencode fuer dich sind: ein Programm, in dem
du mit einem Modell redest und das die Werkzeuge ausfuehrt, um die es bittet.
Der Unterschied ist der Quelltext. Wenn dich etwas stoert &mdash; das Layout, die
Tasten, die Frage nach Bestaetigung, der Transport &mdash; aenderst du es hier,
statt darauf zu warten.</p>
<p>splinter ist die Schicht dazwischen: was gesendet wird, ob ein Werkzeug laufen
darf, was davon aufgezeichnet wird und was du auf dem Schirm siehst.</p>
<p>Dasselbe, was Claude Code oder opencode fuer dich sind: ein Programm, in dem du mit einem Modell redest und das die Werkzeuge ausfuehrt, um die es bittet. Der Unterschied ist der Quelltext. Wenn dich etwas stoert — das Layout, die Tasten, die Frage nach Bestaetigung, der Transport — aenderst du es hier, statt darauf zu warten.</p>
<p>splinter ist die Schicht dazwischen: was gesendet wird, ob ein Werkzeug laufen darf, was davon aufgezeichnet wird und was du auf dem Schirm siehst.</p>
<h2>So sieht das aus</h2>
<pre><span class="u">du:</span> Aendere in /tmp/x.c die Zeile 'return 0' in 'return 1'.
<span class="k">denkt:</span> Ich muss die Datei lesen, dann genau eine Stelle ersetzen.
Ein mehrdeutiges Muster waere ein falscher Edit.
<span class="k">werkzeug:</span> edit {"path":"/tmp/x.c","old":"return 0","new":"return 1"}
<span class="k">aenderung:</span> --- a//tmp/x.c
<pre><span class="u">you:</span> Aendere in /tmp/x.c die Zeile 'return 0' in 'return 1'.
<span class="k">thinking:</span> I must read the file, then replace exactly one place.
An ambiguous pattern would be a wrong edit.
<span class="k">tool:</span> edit {"path":"/tmp/x.c","old":"return 0","new":"return 1"}
<span class="k">diff:</span> --- a//tmp/x.c
+++ b//tmp/x.c
@@ -11,3 +11,3 @@
int main(void) {
- return 0;
+ return 1;
}
<span class="k">modell:</span> Geaendert. Zeile 12 gibt jetzt 1 zurueck.
<span class="k">model:</span> Done. Line 12 returns 1 now.
<span class="d"> splinter 0.1.0 Sitzung sess-1794... Delphinium 842 ms</span></pre>
<span class="d"> splinter 0.1.0 session sess-1794... Delphinium 842 ms</span></pre>
<p>Denken, Werkzeugaufruf mit Argumenten, Diff, Antwort. Der Denk-Block waechst waehrend des Laufs dort, wo er hingehoert, und springt am Ende nicht weg.</p>
<p>Denken, Werkzeugaufruf mit Argumenten, Diff, Antwort. Der Denk-Block waechst
waehrend des Laufs dort, wo er hingehoert, und springt am Ende nicht weg.</p>
<h2>Drei Pruefungen, bevor ein Werkzeug laeuft</h2>
<div class="box">
<h3>1 &middot; Budget</h3>
<p class="small">Passt die Konversation noch? Wenn nicht, wird vor dem Senden
komprimiert &mdash; nicht danach, und nicht heimlich waehrend des Laufs.</p>
</div>
<div class="box">
<h3>2 &middot; Registry</h3>
<p class="small">Existiert das Werkzeug? Ein erfundener Name wird zu einer
Beobachtung, nicht zu einem Absturz.</p>
</div>
<div class="box">
<h3>3 &middot; Autorisierungsklasse</h3>
<p class="small">Das <em>Werkzeug</em> erklaert, was es darf &mdash;
<b>read</b>, <b>mutate</b>, <b>destructive</b>. Nicht das Modell, nicht der
Prompt. Bei mutate und destructive fragt dich das Harness &mdash; im Chat in der
Eingabezeile, auf Telegram als Nachricht mit y/N.</p>
</div>
<div class="box"><h3>1 &middot; Budget</h3><p class="small">Passt die Konversation noch? Wenn nicht, wird vor dem Senden komprimiert — nicht danach, und nicht heimlich waehrend des Laufs.</p></div>
<div class="box"><h3>2 &middot; Registry</h3><p class="small">Existiert das Werkzeug? Ein erfundener Name wird zu einer Beobachtung, nicht zu einem Absturz.</p></div>
<div class="box"><h3>3 &middot; Autorisierungsklasse</h3><p class="small">Das <em>Werkzeug</em> erklaert, was es darf — <b>read</b>, <b>mutate</b>, <b>destructive</b>. Nicht das Modell, nicht der Prompt. Bei mutate und destructive fragt dich das Harness — im Chat in der Eingabezeile, auf Telegram als Nachricht mit y/N.</p></div>
<h2>Werkzeuge</h2>
<table>
<tr><th>Werkzeug</th><th>Klasse</th><th>Was es tut</th></tr>
<tr><td class="c">read</td><td>read</td><td>numerierte Zeilen, offset/limit, verweigert Binaerdateien</td></tr>
<tr><td class="c">search</td><td>read</td><td>Literal-Suche im Baum, maximal 100 Treffer</td></tr>
<tr><td class="c">list</td><td>read</td><td>Verzeichnis anzeigen</td></tr>
<tr><td class="c">skill_search</td><td>read</td><td>installierte Skills finden &mdash; nichts wird vorgeladen</td></tr>
<tr><td class="c">skill_search</td><td>read</td><td>installierte Skills finden — nichts wird vorgeladen</td></tr>
<tr><td class="c">skill_load</td><td>read</td><td>einen Skill ganz lesen</td></tr>
<tr><td class="c">memory_search</td><td>read</td><td>eigene Erinnerungen, pro Benutzer getrennt</td></tr>
<tr><td class="c">write</td><td class="m">mutate</td><td>Datei schreiben, mit Diff in der Beobachtung</td></tr>
@@ -128,8 +100,8 @@ Eingabezeile, auf Telegram als Nachricht mit y/N.</p>
<tr><td class="c">delegate</td><td class="x">destructive</td><td>Aufgabe an ein anderes Modell geben</td></tr>
</table>
<h2>Transporte und Plugins</h2>
<h2>Transporte und Plugins</h2>
<table>
<tr><th>Name</th><th>Was es tut</th></tr>
<tr><td class="c">openai</td><td>jeder OpenAI-kompatible Endpunkt, Streaming ueber SSE</td></tr>
@@ -142,26 +114,19 @@ Eingabezeile, auf Telegram als Nachricht mit y/N.</p>
<tr><td class="c">cps, clock</td><td>Widgets in der Seitenleiste</td></tr>
</table>
<h2>Delegation: andere Modelle, splinter waehlt</h2>
<h2>Delegation: andere Modelle, splinter waehlt</h2>
<pre><span class="d"># ~/.splinter/splinter.conf.d/20-delegates.conf</span>
delegate = coder | C99, POSIX, Review | tags=code,c99,review | endpoint=... | model=...
delegate = quick | kurze Antworten, Chat | tags=chat,cheap | endpoint=... | model=...
delegate = quick | short answers, chat | tags=chat,cheap | endpoint=... | model=...
<span class="u">$</span> splinter --choose "pruefe diesen C-Code auf Speicherfehler"
coder 7 task mentions 'code'</pre>
<p>Angefragter Tag zaehlt 5, Tag im Aufgabentext 3, Wort aus der Beschreibung 1. Die Beobachtung beginnt mit der Wahl und dem Grund — eine falsche Wahl ist sichtbar statt mysterioes. Ohne Profile: eine Zeile pro Modell.</p>
<p>Angefragter Tag zaehlt 5, Tag im Aufgabentext 3, Wort aus der Beschreibung 1.
Die Beobachtung beginnt mit der Wahl und dem Grund &mdash; eine falsche Wahl ist
sichtbar statt mysterioes. Ohne Profile: eine Zeile pro Modell.</p>
<h2>Konfiguration</h2>
<p><code>~/.splinter/splinter.conf</code>, plus jede <code>.conf</code> in
<code>~/.splinter/splinter.conf.d/</code> in Namensreihenfolge. Ein unbekannter
Schluessel ist ein Fehler mit Dateiname und Zeile &mdash; ein Tippfehler darf
nicht still nichts tun.</p>
<p><code>~/.splinter/splinter.conf</code>, plus jede <code>.conf</code> in <code>~/.splinter/splinter.conf.d/</code> in Namensreihenfolge. Ein unbekannter Schluessel ist ein Fehler mit Dateiname und Zeile — ein Tippfehler darf nicht still nichts tun.</p>
<pre><span class="d"># ~/.splinter/splinter.conf</span>
endpoint = http://kontron.local:8080/v1/chat/completions
model = Qwen3.6-35B-A3B-UD-Q8_K_XL.gguf
@@ -172,55 +137,34 @@ telegram_allow = 8300935
plugin = plugins/lcm/lcm.so
plugin = plugins/reminder/reminder.so</pre>
<h2>Gateway: Telegram</h2>
<p><code>splinter --daemon</code> pollt <code>getUpdates</code>, ein Turn pro
Nachricht, Antwort per <code>sendMessage</code>. Der Token liegt in
<code>~/.splinter/telegram.token</code> mit Modus 0600 und wird nie als Argument
uebergeben &mdash; Argumente stehen in <code>ps</code>. Waehrend eines Turns
sieht der Chat alle vier Sekunden &bdquo;typing&ldquo;.</p>
<p>Slash-Kommandos funktionieren dort genauso. Programme in
<code>~/.splinter/commands/</code> werden zu <code>/name</code>: sie bekommen den
Rest der Zeile als Argument, und ihre Ausgabe geht <em>ans Modell</em> als
Kontext &mdash; nicht an dich als Antwort. Damit holt sich das Modell, was es
selbst nicht sehen kann.</p>
<p><code>splinter --daemon</code> pollt <code>getUpdates</code>, ein Turn pro Nachricht, Antwort per <code>sendMessage</code>. Der Token liegt in <code>~/.splinter/telegram.token</code> mit Modus 0600 und wird nie als Argument uebergeben — Argumente stehen in <code>ps</code>. Waehrend eines Turns sieht der Chat alle vier Sekunden &bdquo;typing&ldquo;.</p>
<p>Slash-Kommandos funktionieren dort genauso. Programme in <code>~/.splinter/commands/</code> werden zu <code>/name</code>: sie bekommen den Rest der Zeile als Argument, und ihre Ausgabe geht <em>ans Modell</em> als Kontext — nicht an dich als Antwort. Damit holt sich das Modell, was es selbst nicht sehen kann.</p>
<h2>Was mitgeschrieben wird</h2>
<pre><span class="d">~/.splinter/logs/&lt;sitzung&gt;/session.log</span> lesbar, in Reihenfolge, alles
<span class="d">~/.splinter/logs/&lt;sitzung&gt;/wire.jsonl</span> jeder Request-Body, jede Antwort, roh</pre>
<p>Deine Worte, die Antwort, das Denken, jeder Werkzeugaufruf mit Argumenten,
jede Beobachtung, Fehler, Token-Zahlen. Nichts gekuerzt &mdash; ein Log, das nur
das Gute behaelt, kann einen schlechten Turn nicht erklaeren.</p>
<p>Deine Worte, die Antwort, das Denken, jeder Werkzeugaufruf mit Argumenten, jede Beobachtung, Fehler, Token-Zahlen. Nichts gekuerzt — ein Log, das nur das Gute behaelt, kann einen schlechten Turn nicht erklaeren.</p>
<h2>Bauen</h2>
<pre><span class="u">$</span> git clone ssh://host/home/git/splinter.git
<span class="u">$</span> cd splinter &amp;&amp; make <span class="d"># 248 KB, nichts ausser libc und curses</span>
<span class="u">$</span> make check <span class="d"># 21 Test-Programme, plus i18n-Pruefer</span>
<span class="u">$</span> ./splinter <span class="d"># Chat, Konfiguration wird gelesen</span>
<span class="u">$</span> ./splinter --daemon <span class="d"># Telegram-Gateway</span></pre>
<span class="u">$</span> cd splinter &amp;&amp; make <span class="d">248 KB, nichts ausser libc und curses</span>
<span class="u">$</span> make check <span class="d">21 Test-Programme, plus i18n-Pruefer</span>
<span class="u">$</span> ./splinter <span class="d">Chat, Konfiguration wird gelesen</span>
<span class="u">$</span> ./splinter --daemon <span class="d">Telegram-Gateway</span></pre>
<p>POSIX make, C99, <code>-Wall -Wextra -Werror</code>. Die NetBSD-curses liegt im Baum, damit das Binary nicht von der Laune einer Distribution abhaengt.</p>
<p>POSIX make, C99, <code>-Wall -Wextra -Werror</code>. Die NetBSD-curses liegt
im Baum, damit das Binary nicht von der Laune einer Distribution abhaengt.</p>
<h2>Was es nicht ist</h2>
<ul>
<li>Kein Modell. splinter bringt keins mit und waehlt keins fuer dich.</li>
<li>Keine Cloud. Es spricht mit dem Endpunkt, den du eintraegst.</li>
<li>Kein Sandkasten. Plugins laufen im Prozess mit deinen Rechten &mdash; die
Klassen schuetzen vor dem Modell, nicht vor Code, den du selbst laedst.</li>
<li>Kein Sandkasten. Plugins laufen im Prozess mit deinen Rechten — die Klassen schuetzen vor dem Modell, nicht vor Code, den du selbst laedst.</li>
</ul>
<hr>
<p id="foot">splinter &mdash; C99/POSIX, BSD-3-Clause.
Manual: <code>man ./docs/splinter.1</code> &middot;
Plugin-ABI: <code>docs/PLUGINS.md</code> &middot;
Wir nehmen auseinander, bauen nach und behalten. Ihre Systeme: in Ruhe lassen,
wenn nicht gefragt.</p>
<p id="foot">splinter — C99/POSIX, BSD-3-Clause. Manual: <code>man ./docs/splinter.1</code> &middot; Plugin-ABI: <code>docs/PLUGINS.md</code> &middot; Wir nehmen auseinander, bauen nach und behalten. Ihre Systeme: in Ruhe lassen, wenn nicht gefragt.</p>
</div>
</body>
+411
View File
@@ -0,0 +1,411 @@
#!/usr/bin/env python3
"""Generate the splinter pages from one source, in every language.
Same rule as the program's own catalogues: a text that exists in one language
and not the other is an error, not a gap. The generator refuses to write a page
when a key is missing, so index.html and index.en.html can never drift apart.
python3 tools/gen_www.py # write the pages
python3 tools/gen_www.py --check # compare, exit 1 if they are stale
"""
import pathlib
import sys
ROOT = pathlib.Path(__file__).resolve().parent.parent
OUT = ROOT / "src" / "www"
LANGS = ["de", "en"]
FILES = {"de": "index.html", "en": "index.en.html"}
HEAD = """<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="{{lang}}">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>{{title}}</title>
<meta name="description" content="{{desc}}">
<style type="text/css">
body { background: #0d0f12; color: #c8ccd2; margin: 0; padding: 0;
font-family: "DejaVu Sans Mono", "Courier New", monospace;
font-size: 14px; line-height: 1.55; }
#wrap { width: 46em; margin: 0 auto; padding: 3em 1.5em 6em 1.5em; }
h1 { font-size: 2.4em; color: #e8ecf1; margin: 0 0 0.2em 0; letter-spacing: -0.02em; }
h1 span { color: #5f9ea0; }
h2 { font-size: 1em; color: #5f9ea0; margin: 2.6em 0 0.7em 0; font-weight: normal;
border-bottom: 1px solid #22262c; padding-bottom: 0.3em;
text-transform: uppercase; letter-spacing: 0.08em; }
p { margin: 0.8em 0; }
a { color: #7fb3b5; text-decoration: none; border-bottom: 1px dotted #3d5a5c; }
a:hover { color: #a8d8da; }
.lead { font-size: 1.15em; color: #e2e6ea; }
.meta { color: #6b727c; font-size: 0.92em; margin-bottom: 2.5em; }
.meta b { color: #9aa2ad; font-weight: normal; }
pre { background: #07090b; border: 1px solid #1d2126; border-left: 2px solid #2f4a4c;
padding: 1em 1.1em; overflow-x: auto; font-size: 0.88em; line-height: 1.45;
color: #b9c0c8; margin: 1.2em 0; }
pre .u { color: #e8ecf1; }
pre .k { color: #5f9ea0; }
pre .d { color: #6b727c; }
table { border-collapse: collapse; width: 100%; margin: 1.2em 0; font-size: 0.9em; }
th { text-align: left; color: #7d848e; font-weight: normal; padding: 0.35em 0.6em;
border-bottom: 1px solid #22262c; text-transform: uppercase; font-size: 0.85em;
letter-spacing: 0.06em; }
td { padding: 0.35em 0.6em; border-bottom: 1px solid #14181c; vertical-align: top; }
td.c { color: #5f9ea0; white-space: nowrap; }
td.m { color: #c98b6b; white-space: nowrap; }
td.x { color: #b06f6f; white-space: nowrap; }
.box { border: 1px solid #1d2126; padding: 0.9em 1em; margin: 1em 0; background: #0a0c0f; }
.box h3 { margin: 0 0 0.3em 0; font-size: 0.95em; color: #e2e6ea; font-weight: normal; }
ul { margin: 0.6em 0 0.6em 1.2em; padding: 0; }
li { margin: 0.25em 0; }
.small { font-size: 0.88em; color: #7d848e; }
hr { border: 0; border-top: 1px solid #1d2126; margin: 3em 0 1.5em 0; }
#foot { color: #5a616b; font-size: 0.88em; }
#lang { color: #5a616b; font-size: 0.88em; margin: 0 0 2em 0; }
</style>
</head>
<body>
<div id="wrap">
<p id="lang">{{langbar}}</p>
<h1>splinter<span>_</span></h1>
<p class="lead">{{lead}}</p>
<p class="meta"><b>9.125</b> {{m_lines}} &middot;
<b>248.568</b> {{m_binary}} &middot; <b>21</b> {{m_tests}} &middot;
<b>8</b> {{m_plugins}} &middot; <b>42</b> {{m_themes}} &middot; BSD-3-Clause</p>
{{body}}
<hr>
<p id="foot">{{foot}}</p>
</div>
</body>
</html>
"""
LOOK = """<h2>{h}</h2>
<pre><span class="u">you:</span> Aendere in /tmp/x.c die Zeile 'return 0' in 'return 1'.
<span class="k">thinking:</span> I must read the file, then replace exactly one place.
An ambiguous pattern would be a wrong edit.
<span class="k">tool:</span> edit {{"path":"/tmp/x.c","old":"return 0","new":"return 1"}}
<span class="k">diff:</span> --- a//tmp/x.c
+++ b//tmp/x.c
@@ -11,3 +11,3 @@
int main(void) {{
- return 0;
+ return 1;
}}
<span class="k">model:</span> Done. Line 12 returns 1 now.
<span class="d"> splinter 0.1.0 session sess-1794... Delphinium 842 ms</span></pre>
<p>{p}</p>
"""
TOOLS = """<h2>{h}</h2>
<table>
<tr><th>{t_tool}</th><th>{t_class}</th><th>{t_does}</th></tr>
<tr><td class="c">read</td><td>read</td><td>{d_read}</td></tr>
<tr><td class="c">search</td><td>read</td><td>{d_search}</td></tr>
<tr><td class="c">list</td><td>read</td><td>{d_list}</td></tr>
<tr><td class="c">skill_search</td><td>read</td><td>{d_ss}</td></tr>
<tr><td class="c">skill_load</td><td>read</td><td>{d_sl}</td></tr>
<tr><td class="c">memory_search</td><td>read</td><td>{d_ms}</td></tr>
<tr><td class="c">write</td><td class="m">mutate</td><td>{d_write}</td></tr>
<tr><td class="c">edit</td><td class="m">mutate</td><td>{d_edit}</td></tr>
<tr><td class="c">memory_add</td><td class="m">mutate</td><td>{d_ma}</td></tr>
<tr><td class="c">run</td><td class="x">destructive</td><td>{d_run}</td></tr>
<tr><td class="c">delegate</td><td class="x">destructive</td><td>{d_del}</td></tr>
</table>
"""
TRANSPORTS = """<h2>{h}</h2>
<table>
<tr><th>{t_name}</th><th>{t_does}</th></tr>
<tr><td class="c">openai</td><td>{d_openai}</td></tr>
<tr><td class="c">cli</td><td>{d_cli}</td></tr>
<tr><td class="c">ring</td><td>{d_ring}</td></tr>
<tr><td class="c">mcp</td><td>{d_mcp}</td></tr>
<tr><td class="c">lcm</td><td>{d_lcm}</td></tr>
<tr><td class="c">focus</td><td>{d_focus}</td></tr>
<tr><td class="c">reminder</td><td>{d_rem}</td></tr>
<tr><td class="c">cps, clock</td><td>{d_widget}</td></tr>
</table>
"""
DELEGATE = """<h2>{h}</h2>
<pre><span class="d"># ~/.splinter/splinter.conf.d/20-delegates.conf</span>
delegate = coder | C99, POSIX, Review | tags=code,c99,review | endpoint=... | model=...
delegate = quick | short answers, chat | tags=chat,cheap | endpoint=... | model=...
<span class="u">$</span> splinter --choose "pruefe diesen C-Code auf Speicherfehler"
coder 7 task mentions 'code'</pre>
<p>{p}</p>
"""
CONFIG = """<h2>{h}</h2>
<p>{p}</p>
<pre><span class="d"># ~/.splinter/splinter.conf</span>
endpoint = http://kontron.local:8080/v1/chat/completions
model = Qwen3.6-35B-A3B-UD-Q8_K_XL.gguf
locale = de
theme = Delphinium
autonomous = 1
telegram_allow = 8300935
plugin = plugins/lcm/lcm.so
plugin = plugins/reminder/reminder.so</pre>
"""
BUILD = """<h2>{h}</h2>
<pre><span class="u">$</span> git clone ssh://host/home/git/splinter.git
<span class="u">$</span> cd splinter &amp;&amp; make <span class="d">{c_make}</span>
<span class="u">$</span> make check <span class="d">{c_check}</span>
<span class="u">$</span> ./splinter <span class="d">{c_chat}</span>
<span class="u">$</span> ./splinter --daemon <span class="d">{c_gw}</span></pre>
<p>{p}</p>
"""
T = {
"de": {
"title": "splinter — ein Agent-Harness, das dir gehoert",
"desc": "splinter ist ein Agent-Harness in C99/POSIX: Chat im Terminal, Werkzeuge mit Autorisierungsklassen, Plugins, jeder OpenAI-kompatible Endpunkt, Telegram-Gateway.",
"langbar": "Deutsch &middot; <a href=\"index.en.html\">English</a>",
"lead": "Ein Agent-Harness, das dir gehoert: Chat im Terminal, Werkzeuge mit "
"Autorisierungsklassen, Plugins, jedes Modell das OpenAI spricht — von uns "
"gebaut, damit wir es umbauen koennen, statt uns an das Verhalten eines "
"fremden Clients zu gewoehnen.",
"m_lines": "Zeilen C99/POSIX", "m_binary": "Bytes Binary",
"m_tests": "Test-Programme", "m_plugins": "Plugins", "m_themes": "Farbschemata",
"foot": "splinter — C99/POSIX, BSD-3-Clause. Manual: <code>man ./docs/splinter.1</code>"
" &middot; Plugin-ABI: <code>docs/PLUGINS.md</code> &middot; Wir nehmen "
"auseinander, bauen nach und behalten. Ihre Systeme: in Ruhe lassen, wenn "
"nicht gefragt.",
},
"en": {
"title": "splinter — an agent harness you own",
"desc": "splinter is a C99/POSIX agent harness: chat in the terminal, tools with "
"authorization classes, plugins, any OpenAI-compatible endpoint, a Telegram gateway.",
"langbar": "<a href=\"index.html\">Deutsch</a> &middot; English",
"lead": "An agent harness you own: chat in the terminal, tools with authorization "
"classes, plugins, any model that speaks OpenAI — built by us so we can change "
"it, instead of getting used to how somebody else's client behaves.",
"m_lines": "lines of C99/POSIX", "m_binary": "bytes binary",
"m_tests": "test programs", "m_plugins": "plugins", "m_themes": "palettes",
"foot": "splinter — C99/POSIX, BSD-3-Clause. Manual: <code>man ./docs/splinter.1</code>"
" &middot; Plugin ABI: <code>docs/PLUGINS.md</code> &middot; We take things "
"apart, rebuild them and keep them. Their systems: leave them alone unless asked.",
},
}
SECTIONS = {
"de": [
("<h2>Was es ist</h2>\n<p>Dasselbe, was Claude Code oder opencode fuer dich sind: ein "
"Programm, in dem du mit einem Modell redest und das die Werkzeuge ausfuehrt, um die "
"es bittet. Der Unterschied ist der Quelltext. Wenn dich etwas stoert — das Layout, "
"die Tasten, die Frage nach Bestaetigung, der Transport — aenderst du es hier, statt "
"darauf zu warten.</p>\n<p>splinter ist die Schicht dazwischen: was gesendet wird, ob "
"ein Werkzeug laufen darf, was davon aufgezeichnet wird und was du auf dem Schirm "
"siehst.</p>"),
(LOOK.format(h="So sieht das aus",
p="Denken, Werkzeugaufruf mit Argumenten, Diff, Antwort. Der Denk-Block waechst "
"waehrend des Laufs dort, wo er hingehoert, und springt am Ende nicht weg.")),
("<h2>Drei Pruefungen, bevor ein Werkzeug laeuft</h2>\n"
"<div class=\"box\"><h3>1 &middot; Budget</h3><p class=\"small\">Passt die "
"Konversation noch? Wenn nicht, wird vor dem Senden komprimiert — nicht danach, und "
"nicht heimlich waehrend des Laufs.</p></div>\n"
"<div class=\"box\"><h3>2 &middot; Registry</h3><p class=\"small\">Existiert das "
"Werkzeug? Ein erfundener Name wird zu einer Beobachtung, nicht zu einem "
"Absturz.</p></div>\n"
"<div class=\"box\"><h3>3 &middot; Autorisierungsklasse</h3><p class=\"small\">Das "
"<em>Werkzeug</em> erklaert, was es darf — <b>read</b>, <b>mutate</b>, "
"<b>destructive</b>. Nicht das Modell, nicht der Prompt. Bei mutate und destructive "
"fragt dich das Harness — im Chat in der Eingabezeile, auf Telegram als Nachricht mit "
"y/N.</p></div>"),
(TOOLS.format(h="Werkzeuge", t_tool="Werkzeug", t_class="Klasse", t_does="Was es tut",
d_read="numerierte Zeilen, offset/limit, verweigert Binaerdateien",
d_search="Literal-Suche im Baum, maximal 100 Treffer",
d_list="Verzeichnis anzeigen",
d_ss="installierte Skills finden — nichts wird vorgeladen",
d_sl="einen Skill ganz lesen",
d_ms="eigene Erinnerungen, pro Benutzer getrennt",
d_write="Datei schreiben, mit Diff in der Beobachtung",
d_edit="genau ein Vorkommen ersetzen; mehrdeutig ist ein Fehler",
d_ma="einen Fakt merken",
d_run="Shell-Befehl; der Exit-Status ist eine Beobachtung",
d_del="Aufgabe an ein anderes Modell geben")),
(TRANSPORTS.format(h="Transporte und Plugins", t_name="Name", t_does="Was es tut",
d_openai="jeder OpenAI-kompatible Endpunkt, Streaming ueber SSE",
d_cli="jedes Programm als Modell, etwa <code>claude -p</code>",
d_ring="Exit-Ring: 429 oder Limit &rarr; naechster Ausgang",
d_mcp="MCP-Server als Werkzeugquelle, mit den Schemata des Servers",
d_lcm="Komprimierung der Konversation",
d_focus="erinnert alle N Turns an das Ziel (<code>/goal</code>)",
d_rem="legt alle 10 Turns die Grundregeln zurueck in die Konversation",
d_widget="Widgets in der Seitenleiste")),
(DELEGATE.format(h="Delegation: andere Modelle, splinter waehlt",
p="Angefragter Tag zaehlt 5, Tag im Aufgabentext 3, Wort aus der Beschreibung 1. Die "
"Beobachtung beginnt mit der Wahl und dem Grund — eine falsche Wahl ist sichtbar "
"statt mysterioes. Ohne Profile: eine Zeile pro Modell.")),
(CONFIG.format(h="Konfiguration",
p="<code>~/.splinter/splinter.conf</code>, plus jede <code>.conf</code> in "
"<code>~/.splinter/splinter.conf.d/</code> in Namensreihenfolge. Ein unbekannter "
"Schluessel ist ein Fehler mit Dateiname und Zeile — ein Tippfehler darf nicht "
"still nichts tun.")),
("<h2>Gateway: Telegram</h2>\n<p><code>splinter --daemon</code> pollt "
"<code>getUpdates</code>, ein Turn pro Nachricht, Antwort per "
"<code>sendMessage</code>. Der Token liegt in "
"<code>~/.splinter/telegram.token</code> mit Modus 0600 und wird nie als Argument "
"uebergeben — Argumente stehen in <code>ps</code>. Waehrend eines Turns sieht der "
"Chat alle vier Sekunden &bdquo;typing&ldquo;.</p>\n<p>Slash-Kommandos funktionieren "
"dort genauso. Programme in <code>~/.splinter/commands/</code> werden zu "
"<code>/name</code>: sie bekommen den Rest der Zeile als Argument, und ihre Ausgabe "
"geht <em>ans Modell</em> als Kontext — nicht an dich als Antwort. Damit holt sich "
"das Modell, was es selbst nicht sehen kann.</p>"),
("<h2>Was mitgeschrieben wird</h2>\n"
"<pre><span class=\"d\">~/.splinter/logs/&lt;sitzung&gt;/session.log</span> lesbar, "
"in Reihenfolge, alles\n<span class=\"d\">~/.splinter/logs/&lt;sitzung&gt;/wire.jsonl"
"</span> jeder Request-Body, jede Antwort, roh</pre>\n"
"<p>Deine Worte, die Antwort, das Denken, jeder Werkzeugaufruf mit Argumenten, jede "
"Beobachtung, Fehler, Token-Zahlen. Nichts gekuerzt — ein Log, das nur das Gute "
"behaelt, kann einen schlechten Turn nicht erklaeren.</p>"),
(BUILD.format(h="Bauen", c_make="248 KB, nichts ausser libc und curses",
c_check="21 Test-Programme, plus i18n-Pruefer",
c_chat="Chat, Konfiguration wird gelesen", c_gw="Telegram-Gateway",
p="POSIX make, C99, <code>-Wall -Wextra -Werror</code>. Die NetBSD-curses liegt im "
"Baum, damit das Binary nicht von der Laune einer Distribution abhaengt.")),
("<h2>Was es nicht ist</h2>\n<ul>\n<li>Kein Modell. splinter bringt keins mit und "
"waehlt keins fuer dich.</li>\n<li>Keine Cloud. Es spricht mit dem Endpunkt, den du "
"eintraegst.</li>\n<li>Kein Sandkasten. Plugins laufen im Prozess mit deinen Rechten "
"— die Klassen schuetzen vor dem Modell, nicht vor Code, den du selbst "
"laedst.</li>\n</ul>"),
],
"en": [
("<h2>What it is</h2>\n<p>The same thing Claude Code or opencode is for you: a "
"program you sit in front of, talking to a model, running the tools it asks for. The "
"difference is the source. If something bothers you — the layout, the keys, the "
"confirmation prompts, the transport — you change it here instead of waiting for "
"someone else to.</p>\n<p>splinter is the layer in between: what gets sent, whether a "
"tool may run, what is written down, and what you see on screen.</p>"),
(LOOK.format(h="What that looks like",
p="Reasoning, the tool call with its arguments, the diff, the answer. The reasoning "
"block grows where it belongs while the turn runs, and does not jump away when it "
"ends.")),
("<h2>Three checks before any tool runs</h2>\n"
"<div class=\"box\"><h3>1 &middot; Budget</h3><p class=\"small\">Does the conversation "
"still fit? If not, it is compacted before sending — not after, and not quietly in the "
"middle of a turn.</p></div>\n"
"<div class=\"box\"><h3>2 &middot; Registry</h3><p class=\"small\">Does the tool "
"exist? An invented name becomes an observation, not a crash.</p></div>\n"
"<div class=\"box\"><h3>3 &middot; Authorization class</h3><p class=\"small\">The "
"<em>tool</em> declares what it may do — <b>read</b>, <b>mutate</b>, "
"<b>destructive</b>. Not the model, not the prompt. For mutate and destructive the "
"harness asks you — in the prompt line in the chat, as a y/N message on "
"Telegram.</p></div>"),
(TOOLS.format(h="Tools", t_tool="Tool", t_class="Class", t_does="What it does",
d_read="numbered lines, offset/limit, refuses binary files",
d_search="literal search over a tree, at most 100 hits",
d_list="list a directory",
d_ss="find installed skills — nothing is preloaded",
d_sl="read one skill in full",
d_ms="your own memories, scoped per user",
d_write="write a file, with the diff in the observation",
d_edit="replace exactly one occurrence; ambiguous is an error",
d_ma="remember one fact",
d_run="a shell command; the exit status is an observation",
d_del="hand a task to another model")),
(TRANSPORTS.format(h="Transports and plugins", t_name="Name", t_does="What it does",
d_openai="any OpenAI-compatible endpoint, streaming over SSE",
d_cli="any program as the model, e.g. <code>claude -p</code>",
d_ring="exit ring: 429 or limit &rarr; next exit",
d_mcp="an MCP server as a tool source, with its own schemas",
d_lcm="compaction of the conversation",
d_focus="reminds the model of the goal every N turns (<code>/goal</code>)",
d_rem="puts the ground rules back into the conversation every 10 turns",
d_widget="widgets in the sidebar")),
(DELEGATE.format(h="Delegation: other models, splinter chooses",
p="A requested tag counts 5, a tag in the task 3, a word from the description 1. The "
"observation opens with the choice and the reason — a wrong pick is visible instead "
"of mysterious. No profiles: one line per model.")),
(CONFIG.format(h="Configuration",
p="<code>~/.splinter/splinter.conf</code>, plus every <code>.conf</code> in "
"<code>~/.splinter/splinter.conf.d/</code> in name order. An unknown key is an "
"error naming the file and line — a typo must not silently do nothing.")),
("<h2>Gateway: Telegram</h2>\n<p><code>splinter --daemon</code> long-polls "
"<code>getUpdates</code>, one turn per message, answers with "
"<code>sendMessage</code>. The token lives in "
"<code>~/.splinter/telegram.token</code> with mode 0600 and is never passed as an "
"argument — arguments end up in <code>ps</code>. While a turn runs, the chat sees "
"&quot;typing&quot; every four seconds.</p>\n<p>Slash commands work there too. "
"Programs in <code>~/.splinter/commands/</code> become <code>/name</code>: they get "
"the rest of the line as an argument, and their output goes <em>to the model</em> as "
"context — not to you as a reply. That is how the model fetches what it cannot see "
"itself.</p>"),
("<h2>What gets written down</h2>\n"
"<pre><span class=\"d\">~/.splinter/logs/&lt;session&gt;/session.log</span> "
"readable, in order, everything\n<span class=\"d\">~/.splinter/logs/&lt;session&gt;"
"/wire.jsonl</span> every request body, every reply, raw</pre>\n"
"<p>Your words, the answer, the reasoning, every tool call with its arguments, every "
"observation, failures, token counts. Nothing truncated — a log that keeps only the "
"good parts cannot explain a bad turn.</p>"),
(BUILD.format(h="Building", c_make="248 KB, nothing but libc and curses",
c_check="21 test programs, plus the i18n checker",
c_chat="chat, the config is read", c_gw="Telegram gateway",
p="POSIX make, C99, <code>-Wall -Wextra -Werror</code>. NetBSD curses is vendored, so "
"the binary does not depend on a distribution's mood.")),
("<h2>What it is not</h2>\n<ul>\n<li>Not a model. splinter ships none and picks none "
"for you.</li>\n<li>Not a cloud. It talks to the endpoint you configure.</li>\n"
"<li>Not a sandbox. Plugins run in the process with your rights — the classes protect "
"the harness from the model, not from code you chose to load.</li>\n</ul>"),
],
}
def render(lang):
strings = dict(T[lang])
strings["lang"] = lang
body = "\n\n".join(SECTIONS[lang])
html = HEAD
for key, value in strings.items():
html = html.replace("{{%s}}" % key, value)
html = html.replace("{{body}}", body)
if "{{" in html:
leftover = html[html.index("{{"):html.index("{{") + 40]
raise SystemExit("gen_www: unfilled placeholder: %s" % leftover)
return html
def main(argv):
check = "--check" in argv
problems = []
# both languages must cover the same keys
for key in sorted(set(T["de"]) | set(T["en"])):
for lang in LANGS:
if key not in T[lang]:
problems.append("%s: missing key %r" % (lang, key))
if problems:
for p in problems:
print("gen_www: " + p, file=sys.stderr)
return 1
stale = []
for lang in LANGS:
path = OUT / FILES[lang]
html = render(lang)
if check:
if not path.exists() or path.read_text(encoding="utf-8") != html:
stale.append(str(path))
continue
path.write_text(html, encoding="utf-8")
print("gen_www: wrote %s (%d bytes)" % (path, len(html.encode())))
if check:
if stale:
print("gen_www: stale page(s): " + ", ".join(stale), file=sys.stderr)
return 1
print("gen_www: ok (%d languages)" % len(LANGS))
return 0
if __name__ == "__main__":
sys.exit(main(sys.argv[1:]))