www: hand-written site, drop the generator, no private values in docs

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
lotherkandClaude Sonnet 5.5 committed 2026-11-11 17:13:20 +00:00
1 parent 478e2ec663
commit cc2fcb5d34
8 files changed
+604 -1303

No files matched your search

+6 -6
View File
@@ -67,7 +67,7 @@ transport replays replies.
src/main.c CLI
tests/ the test binaries, run by `make check`
docs/splinter.1 manual page
src/www/index.html HTML 4.01 static page
src/www/index*.html the site, written by hand (de, en, pt_BR)
## Plugins and themes
@@ -236,14 +236,14 @@ Ships with `en` and `de`. Plugins translate their own strings with `sp_t()`.
A delegate may name a host. The whole invocation then goes through ssh, so
claude, opencode or another splinter run where the model or the network is:
delegate = olivia | auf olivia | tags=remote | host=172.25.206.16 |
endpoint=http://172.25.206.2:18082/v1/chat/completions | model=...
delegate = remote | on a remote host | tags=remote | host=build.example.org |
endpoint=http://10.0.0.2:8080/v1/chat/completions | model=...
delegate and delegate_parallel both honour it, and the report names the host like
any other model. The remote needs splinter at the same path and its own keys -
nothing crosses the jump except the task.
Proven: a delegate with host=172.25.206.16 ran on olivia and answered from a
Proven: a delegate with host=build.example.org ran on the remote host and answered from a
provider reachable only over the wireguard link.
A failing delegate can be run without a model, which is how the child's own
@@ -361,7 +361,7 @@ order when one is rate limited:
exit = go | OpenCode Go | endpoint=... | model=...
exit = groq | Groq free tier | endpoint=... | model=... | key_env=GROQ_KEY
exit = local | kontron, lokal | endpoint=... | model=...
exit = local | local | endpoint=... | model=...
Run it with `--transport ring`. Only pressure moves the ring: 429, 5xx, "rate
limit", "quota". A dead host or a bad key stops the turn where it is - a ring
@@ -422,7 +422,7 @@ profiles, no directories, nothing to keep in sync:
delegate = coder | C99, POSIX, kennt den Quellbaum | tags=code,c99,review |
prio=5 | max_parallel=2 |
endpoint=http://kontron.local:8080/v1/chat/completions |
endpoint=http://127.0.0.1:8080/v1/chat/completions |
model=Qwen3.6-35B
delegate = quick | kurze Antworten, Chat | tags=chat,cheap |
endpoint=... | model=...
+3 -4
View File
@@ -66,10 +66,9 @@ beobachten).
je Spalte und gibt ausgerichteten Text aus; Text davor/danach bleibt.
`tests/test_md.c` (Kopf, Trenner, ungleich lange Zeilen, UTF-8, zwei Bloecke)
und ein Fall in `tests/test_ui.sh`, der die Spalten auf dem Schirm prueft.
- **Website zaehlt**: `tools/gen_www.py` liest Zeilen, Werkzeuge, Tests, Plugins
und Paletten aus dem Baum. Die meta-Zeile nennt jetzt 31 Test-Programme,
23 Werkzeuge und 16 Plugins; die alte Binärgroesse ist durch die
Werkzeugzahl ersetzt, weil sie mit jedem Build altert.
- **Website von Hand**: `tools/gen_www.py` ist weg; die drei Seiten in `src/www/`
werden von Hand geschrieben. Zahlen darin sind Stand 2026-11-11, nicht
generiert, und muessen bei Aenderungen von Hand nachgezogen werden.
- **Delegate im Task-Panel**: `tests/test_delegate.c` uebergibt einen Host mit
geladenem `tasks`-Plugin, laesst einen Delegate laufen und prueft
`delegate:panel exit 0` im Widget sowie `tasks_running == 0`.
+2 -2
View File
@@ -65,7 +65,7 @@ Both are one line each, `|`-separated, every field but the first named:
```
exit = groq | Groq free tier | endpoint=https://api.groq.com/openai/v1/chat/completions | model=llama-3.3-70b | key_env=GROQ_KEY
delegate = coder | C99, POSIX, kennt den Quellbaum | endpoint=http://kontron:8080/v1/chat/completions | model=qwen | tags=code,review | prio=5 | max_parallel=2
delegate = coder | C99, POSIX, kennt den Quellbaum | endpoint=http://127.0.0.1:8080/v1/chat/completions | model=qwen | tags=code,review | prio=5 | max_parallel=2
delegate = far | the same, on another machine | host=buildbox | endpoint=... | model=...
delegate = claude-cli | Claude Code | kind=cli | cmd=claude -p | tags=plan
delegate = claude-b | Claude Code, second account | kind=cli | cmd=claude -p | env=CLAUDE_CODE_OAUTH_TOKEN=sk-ant-oat01-...
@@ -99,7 +99,7 @@ does the job wait (`waiting_quota`) for the reset.
## Example: local model
```
endpoint = http://kontron.local:8080/v1/chat/completions
endpoint = http://127.0.0.1:8080/v1/chat/completions
model = /models/unsloth/Qwen3.6-35B-A3B-MTP-GGUF/Qwen3.6-35B-A3B-UD-Q8_K_XL.gguf
theme = Delphinium
autonomous = 1
+2 -2
View File
@@ -52,8 +52,8 @@ Stream.
Zitate/Tabellen in die Tags von `parse_mode=HTML`, escapt alles andere und
teilt lange Antworten an Tag-Grenzen, mit offenen Tags pro Stueck
(`test_tgmd`, `test_gateway.sh`)
- **Website zählt**: Zeilen, Werkzeuge, Tests, Plugins und Paletten kommen beim
Generieren aus dem Baum (`tools/gen_www.py`)
- **Website von Hand**: die drei Seiten in `src/www/` sind handgeschrieben,
ohne Generator; Zahlen darin sind Stand 2026-11-11
- **Letzter Delegate-Fehler**: die letzten 400 Bytes des Kindes stehen im Fehler,
ein Limit bencht den Delegate und der nächste übernimmt (`test_delegate`)
- **A2A INPUT_REQUIRED**: ein mutierendes Werkzeug pausiert (`sp_agent_run`
+196 -214
View File
@@ -1,237 +1,219 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<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; }
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="color-scheme" content="light dark">
<title>splinter &mdash; an agent harness in C99</title>
<meta name="description" content="Agent harness in C99/POSIX: curses chat, tools with authorization classes, plugins, any OpenAI-compatible endpoint, MCP, A2A and a Telegram gateway.">
<style>
:root{
--bg:#e3e7ec; --panel:#d6dce4; --ink:#17202b; --dim:#4d5a69; --rule:#aab4c0;
--acc:#1d5f80; --read:#2a6f97; --mut:#9a5b0c; --des:#a3282b; --term:#0f1720; --termink:#d3dce6;
--serif:Charter,"Bitstream Charter","Iowa Old Style","Palatino Linotype",Palatino,Georgia,serif;
--mono:ui-monospace,"DejaVu Sans Mono","Liberation Mono",Menlo,Consolas,monospace;
}
@media (prefers-color-scheme:dark){:root{
--bg:#141a22; --panel:#1c242f; --ink:#d9e0e8; --dim:#93a0af; --rule:#334050;
--acc:#7dbbd8; --read:#6fb0d6; --mut:#e0a24f; --des:#ee7b7e; --term:#0b1016; --termink:#cfd8e2;}}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;background:var(--bg);color:var(--ink);font:1.0625rem/1.62 var(--serif)}
a{color:var(--acc);text-underline-offset:.18em}
a:focus-visible,summary:focus-visible{outline:2px solid var(--acc);outline-offset:3px}
code,pre,.m{font-family:var(--mono)}
code{font-size:.88em;background:var(--panel);padding:.08em .32em}
.bar{display:flex;justify-content:space-between;gap:1rem;padding:.55rem 1rem;border-bottom:1px solid var(--rule);font:.8rem var(--mono);color:var(--dim)}
.bar a{color:var(--dim)} .bar b{color:var(--ink);font-weight:600}
.shell{display:grid;grid-template-columns:minmax(0,1fr);max-width:68rem;margin:0 auto;padding:0 1rem}
nav.rail{display:none}
main{min-width:0;max-width:44rem;padding:2.5rem 0 5rem}
@media (min-width:62rem){
.shell{grid-template-columns:11.5rem minmax(0,1fr);gap:3rem}
nav.rail{display:block;position:sticky;top:0;align-self:start;padding:2.6rem 0;font:.85rem/1.9 var(--mono)}
nav.rail a{display:block;color:var(--dim);text-decoration:none;border-left:2px solid var(--rule);padding-left:.8rem}
nav.rail a:hover{color:var(--ink);border-color:var(--acc)}
}
h1{font:700 clamp(3rem,11vw,5.2rem)/.95 var(--serif);letter-spacing:-.035em;margin:.2em 0 .25em}
h2{font:700 1.45rem/1.2 var(--serif);margin:3.2rem 0 .8rem;padding-top:1.2rem;border-top:1px solid var(--rule)}
h3{font:600 1rem var(--serif);margin:1.5rem 0 .3rem}
p{margin:.8em 0} .lead{font-size:1.28rem;line-height:1.5}
.dim{color:var(--dim)} .small{font-size:.9rem}
pre{background:var(--term);color:var(--termink);margin:1.2rem 0;padding:1rem 1.1rem;overflow-x:auto;font-size:.82rem;line-height:1.55;border-left:4px solid var(--acc)}
pre .u{color:#fff;font-weight:600} pre .d{color:#7f8ea0} pre .r{color:#7fbfe6} pre .a{color:#f0b35e} pre .x{color:#ff8f92}
@media (prefers-color-scheme:dark){pre .u{color:#fff}}
.tw{overflow-x:auto;margin:1.1rem 0}
table{border-collapse:collapse;width:100%;font-size:.93rem}
th{text-align:left;font-weight:600;color:var(--dim);padding:.3rem .7rem;border-bottom:1px solid var(--rule)}
td{padding:.42rem .7rem;border-bottom:1px solid var(--rule);vertical-align:top}
td:first-child{font:.82rem var(--mono);white-space:nowrap}
tr.r td:first-child{box-shadow:inset 4px 0 var(--read)} tr.a td:first-child{box-shadow:inset 4px 0 var(--mut)} tr.x td:first-child{box-shadow:inset 4px 0 var(--des)}
@media (max-width:40rem){table,tbody,tr,td{display:block}tr:first-child{display:none}tr{border-bottom:1px solid var(--rule);padding:.35rem 0}td{border:0;padding:.1rem .7rem}td:first-child{white-space:normal;overflow-wrap:anywhere}}
.key{display:flex;flex-wrap:wrap;gap:.4rem 1.4rem;font:.82rem var(--mono);margin:.8rem 0}
.key span:before{content:"";display:inline-block;width:.9rem;height:.5rem;margin-right:.45rem;background:var(--c)}
dl{margin:1rem 0} dt{font:600 .9rem var(--mono);margin-top:1rem} dd{margin:.15rem 0 0}
ul{padding-left:1.2rem} li{margin:.3rem 0}
.cols{display:grid;gap:0 2rem;grid-template-columns:repeat(auto-fit,minmax(15rem,1fr))}
footer{border-top:1px solid var(--rule);margin-top:4rem;padding-top:1.2rem;font-size:.88rem;color:var(--dim)}
</style>
</head>
<body>
<div id="wrap">
<div class="bar"><span><b>splinter</b>(1)</span><span class="langs"><a href="index.html">de</a> &nbsp;<b>en</b>&nbsp; <a href="index.pt.html">pt-BR</a></span></div>
<div class="shell">
<nav class="rail" aria-label="Sections">
<a href="#checks">checks</a><a href="#tools">tools</a><a href="#models">models</a><a href="#plugins">plugins</a><a href="#agents">other agents</a><a href="#telegram">telegram</a><a href="#files">config &amp; logs</a><a href="#build">build</a><a href="#not">not</a>
</nav>
<main>
<h1>splinter</h1>
<p class="lead">An agent harness in C99. It sits between you and a model, runs the tools the model asks for, and decides which of them may run. You can read all of it.</p>
<p>Chat in a curses terminal, one-shot from a pipe, or over Telegram. Any endpoint that speaks the OpenAI chat API, any program that prints an answer, or another agent over A2A. Tools declare what they may do; the harness enforces it and tells the model what it refused.</p>
<p id="lang"><a href="index.html">Deutsch</a> &middot; English</p>
<pre><span class="d"># illustrative transcript, not a log</span>
<span class="u">you</span> set the version in Makefile to 0.2.0
<span class="u">tool</span> read {"path":"Makefile"} <span class="r">read</span>
<span class="u">tool</span> edit {"path":"Makefile","old":"0.1.0","new":"0.2.0"} <span class="a">mutate</span>
<span class="u">ask</span> edit Makefile ? [y/N] <span class="x">n</span>
<span class="u">seen</span> error: denied by operator <span class="d">&larr; this is what the model reads</span>
<span class="u">model</span> I was not allowed to edit it. Say so if I should try again.</pre>
<p class="small dim">About 29,500 lines of C (as of 2026-11-11), 16 plugins, 35 test programs. BSD-3-Clause.</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>
<h2 id="checks">Three checks before a tool runs</h2>
<dl>
<dt>Budget</dt><dd>Before every request the conversation is measured against the configured byte budget. If it does not fit, plugins such as <code>lcm</code> may compact it first. If it still does not fit, nothing is sent and the turn fails, instead of letting an endpoint truncate silently.</dd>
<dt>Registry</dt><dd>A tool name that does not exist becomes an observation for the model, not a crash and not a guess.</dd>
<dt>Authorization class</dt><dd>Each tool declares <em>read</em>, <em>mutate</em> or <em>destructive</em>. The tool says so, not the model and not the prompt. Mutating and destructive calls need your consent unless you started with <code>--autonomous</code>. A plugin can sit in front as a gate: allow, refuse with a reason, or have no opinion. The kid-mode plugin is one.</dd>
</dl>
<p>A refusal is never silent. It comes back to the model as the tool's observation, so the model can react to it.</p>
<p class="meta"><b>29543</b> lines of C99/POSIX &middot;
<b>27</b> tools &middot; <b>35</b> test programs &middot;
<b>16</b> plugins &middot; <b>42</b> palettes &middot; BSD-3-Clause</p>
<h2 id="tools">Tools</h2>
<p>41 are built in or shipped as plugins. An MCP server can add more at runtime.</p>
<div class="key"><span style="--c:var(--read)">read</span><span style="--c:var(--mut)">mutate</span><span style="--c:var(--des)">destructive</span></div>
<div class="tw"><table>
<tr><th>tool</th><th>what it does</th></tr>
<tr class="r"><td>read, search, list</td><td>Numbered lines with offset and limit, refuses binaries. Literal search, at most 100 hits. Directory listing.</td></tr>
<tr class="a"><td>write, edit</td><td>Write a file, with the diff in the observation. Edit replaces exactly one occurrence; an ambiguous match is an error.</td></tr>
<tr class="x"><td>run</td><td>A shell command. The exit status is an observation.</td></tr>
<tr class="r"><td>websearch</td><td>Web search.</td></tr>
<tr class="a"><td>webfetch</td><td>Fetch a URL.</td></tr>
<tr class="r"><td>folder_history</td><td>What last happened in this directory, so the model does not guess.</td></tr>
<tr class="r"><td>skill_search, skill_load</td><td>Find installed skills, read one in full. Nothing is preloaded.</td></tr>
<tr class="r"><td>memory_search</td><td>Your memories on a mem0 server, kept apart per user.</td></tr>
<tr class="a"><td>memory_add</td><td>Remember one fact.</td></tr>
<tr class="x"><td>delegate, delegate_parallel, delegate_submit, delegate_retry</td><td>Hand work to another model: one task, several at once, as a background job, or retry a failure.</td></tr>
<tr class="r"><td>delegate_list, delegate_jobs, delegate_result, delegate_due</td><td>List delegates, see jobs, collect a result, see what is due.</td></tr>
<tr class="x"><td>task_start, task_kill</td><td>Run a shell command in the background (four at a time) or stop it.</td></tr>
<tr class="r"><td>task_list, task_result</td><td>Background jobs and their output.</td></tr>
<tr class="a"><td>plan_task_add, plan_task_update</td><td>A persistent to-do list for the session.</td></tr>
<tr class="r"><td>plan_task_list</td><td>Read that list.</td></tr>
<tr class="x"><td>tmux_start</td><td>Start a command in a detached tmux session and make it the target.</td></tr>
<tr class="a"><td>tmux_send, tmux_ask</td><td>Type into it (text or keys such as C-c), wait for new output and return only the new lines.</td></tr>
<tr class="r"><td>tmux_status, tmux_capture, tmux_read</td><td>Look at the pane and read what is new.</td></tr>
<tr class="x"><td>a2a_send, a2a_cancel_task</td><td>Message another agent (optionally with a file) or cancel its task.</td></tr>
<tr class="r"><td>a2a_get_task, a2a_subscribe</td><td>Read another agent's task and its events.</td></tr>
<tr class="r"><td>echo, clock</td><td>Small utilities.</td></tr>
</table></div>
<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">a2a</td><td>another agent over A2A (SendMessage/streaming, text)</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>
<h2 id="models">Models</h2>
<p>A transport turns the harness's plain line protocol into whatever the other side speaks. The loop never sees a vendor API, which is why <code>make check</code> runs against a scripted mock with no network and no key.</p>
<dl>
<dt>openai</dt><dd>Any OpenAI-compatible endpoint, streaming over SSE. HTTP goes through <code>curl(1)</code>.</dd>
<dt>cli</dt><dd>Any program as the model, for example <code>claude -p</code>.</dd>
<dt>a2a</dt><dd>Another agent over A2A.</dd>
<dt>ring</dt><dd>An exit ring. On a 429 or a limit, the next configured exit takes over.</dd>
</dl>
<h3>Delegation</h3>
<p>The model can hand work to another model. splinter picks one: a requested tag scores 5, a tag found in the task text 3, a word from the delegate's description 1. The observation opens with the choice and the reason, so a wrong pick is visible.</p>
<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=...
delegate = coder | C99, POSIX, review | tags=code,c99 | endpoint=... | model=...
delegate = quick | short answers | tags=chat,cheap | endpoint=... | model=...
<span class="u">$</span> splinter --choose "pruefe diesen C-Code auf Speicherfehler"
<span class="u">$</span> splinter --choose "check this C code for memory errors"
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>
<p><code>delegate_parallel</code> sends up to eight tasks at once. The report names who answered, how long it took and the exit status for each, so a slow or failing delegate shows in the header.</p>
<pre>[parallel: 2 task(s), 12018 ms wall]
## task 1 | model slow | score 5 | 12018 ms | exit 0 | 75 B
## task 2 | model fast | score 5 | 16 ms | exit 0 | 74 B</pre>
<p>A delegate may name a <code>host=</code>. The whole call then goes over ssh, so claude, opencode or another splinter runs where the model or the network is, with that machine's own keys.</p>
<pre>delegate = remote | on another box | tags=remote | host=build.example.org | endpoint=... | model=...</pre>
<h2 id="plugins">Plugins</h2>
<p>A plugin is a <code>.so</code> loaded with dlopen. It can register tools, slash commands, sidebar widgets, transports and gates. A widget's tick runs on its own thread; only the UI thread draws. The ABI is in <code>docs/PLUGINS.md</code>. Plugins run in the process with your rights.</p>
<div class="cols"><ul>
<li><b>lcm</b>, <b>cps</b>: compact the conversation</li>
<li><b>focus</b>: reminds the model of <code>/goal</code> every N turns</li>
<li><b>reminder</b>: puts the ground rules back every 10 turns</li>
<li><b>ring</b>: next exit on 429 or limit</li>
<li><b>mcp</b>, <b>a2a</b>, <b>cli</b>: reach other tools and agents</li>
<li><b>provider</b>: add a provider while running</li>
</ul><ul>
<li><b>tasks</b>: background shell jobs</li>
<li><b>planner</b>: the session's to-do list</li>
<li><b>tmux</b>: drive a program that wants a terminal</li>
<li><b>scheduler</b>: timed work</li>
<li><b>status</b>: context, tokens per second, cost if you set prices</li>
<li><b>kids</b>: kid mode</li>
<li><b>clock</b>: a sidebar clock and a tool</li>
</ul></div>
<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>The bot registers its commands: the menu shows the loaded plugins' commands and the programs in <code>~/.splinter/commands/</code>; an approval arrives with Yes/No buttons. <code>/interview</code> asks the questions in the chat. <code>/new</code> starts a fresh conversation; <code>/model</code> offers the configured models as buttons, switches the transport and remembers the choice in <code>splinter.conf.d/90-model.conf</code>; <code>/model probe</code> asks the endpoints for <code>/v1/models</code>. <code>/connect</code> asks for name, endpoint, model and key variable, runs one test turn and writes the provider to <code>splinter.conf.d/20-connect.conf</code>. Answers are rendered as Telegram HTML: bold, italic, code and links as tags, images as photos (<code>sendPhoto</code>, local files too), other files as documents, tables as columns in a monospace block; a piece Telegram cannot parse goes out as text instead of being lost. Programs in <code>commands/</code> answer in the chat; in the TUI their output goes to the model.</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">small, nothing but libc and curses</span>
<span class="u">$</span> make check <span class="d">35 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>
<h2 id="agents">Other agents, both ways</h2>
<h3>MCP</h3>
<p>As a client, splinter takes an MCP server's tools with the server's own schemas. As a server it offers its own tools to others:</p>
<pre><span class="u">$</span> splinter --mcp-server-listen 127.0.0.1 --mcp-listen-port 8098</pre>
<p>It answers <code>initialize</code>, <code>tools/list</code> and <code>tools/call</code>. It serves read tools. Mutating and destructive ones only run with <code>--autonomous</code>, so a foreign agent does not get a shell just by asking.</p>
<h3>A2A</h3>
<pre><span class="u">$</span> SPLINTER_A2A_SERVER_TOKEN=... splinter --a2a-server-listen 127.0.0.1 --a2a-listen-port 8099</pre>
<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>
<li><code>POST /a2a</code> takes <code>SendMessage</code>, <code>SendStreamingMessage</code> (SSE), <code>GetTask</code>, <code>ListTasks</code> and <code>SubscribeToTask</code>. The agent card is at <code>/.well-known/agent-card.json</code>.</li>
<li>A <code>contextId</code> is a conversation. Without one, the server makes one and returns it.</li>
<li>A mutating tool pauses the task as <code>INPUT_REQUIRED</code>. A follow-up with the <code>taskId</code> and <code>yes</code> or <code>no</code> resumes it. <code>CancelTask</code> stops it.</li>
<li>A push notification config posts the finished task to a webhook (loopback, or hosts in <code>SPLINTER_A2A_PUSH_ALLOW</code>).</li>
<li>Binary file parts land in <code>inbox/</code> and the model is told the path. URL parts are fetched only from allowed hosts.</li>
<li>Beyond loopback a bearer token is required.</li>
<li>As a client, <code>a2a_send</code> can attach a file and <code>a2a_subscribe</code> reads a remote task's events.</li>
</ul>
<h2>The fleet</h2>
<p>A delegate may name a host. The whole invocation then goes through ssh, so
claude, opencode or another splinter run where the model or the network is:</p>
<pre>delegate = olivia | on olivia | tags=remote | host=172.25.206.16 |
endpoint=http://172.25.206.2:18082/v1/chat/completions | model=...</pre>
<p><code>delegate_parallel</code> sends up to eight tasks at once and reports back
who delivered what:</p>
<pre>[parallel: 2 task(s), 12018 ms wall]
<h2 id="telegram">Telegram</h2>
<p><code>splinter --daemon</code> long-polls <code>getUpdates</code>, runs one turn per message and answers with the same slash commands as the terminal. The token is read from a 0600 file or the environment, never from an argument. Only user ids listed in <code>telegram_allow</code> get an answer.</p>
<ul>
<li>Consent arrives as Yes/No buttons. The text reply <code>ok &lt;id&gt;</code> still works.</li>
<li><code>/model</code> switches between configured models; <code>/model probe</code> asks the endpoints for <code>/v1/models</code>. <code>/connect</code> asks for name, endpoint, model and key variable, runs a test turn and writes the provider into <code>splinter.conf.d</code>. <code>/new</code> starts a fresh conversation. <code>/interview</code> asks the setup questions in the chat.</li>
<li>Answers are sent as Telegram HTML: bold, italic, code, links, quotes and tables as monospace columns. Markdown images go out as photos, other local files as documents. A piece Telegram cannot parse is sent as plain text rather than lost.</li>
<li>Programs in <code>~/.splinter/commands/</code> become <code>/name</code> and show up in the bot's menu.</li>
</ul>
<h3>Kid mode</h3>
<p>With the <code>kids</code> plugin, every change needs a parent's approval by Telegram, a whitelist lets harmless calls through, the model is reminded of an age-appropriate tone on each request, and a daily minute budget ends the day when it is spent.</p>
## task 1 | model slow | score 5 | 12018 ms | exit 0 | 75 B | requested tag 'slow'
## task 2 | model fast | score 5 | 16 ms | exit 0 | 74 B | requested tag 'fast'
<h2 id="files">Config, logs, ways in</h2>
<pre><span class="d"># ~/.splinter/splinter.conf (plus splinter.conf.d/*.conf, in name order)</span>
endpoint = http://127.0.0.1:8080/v1/chat/completions
model = my-model
locale = en
theme = Delphinium
telegram_allow = 123456789
plugin = plugins/lcm/lcm.so</pre>
<p>It is plain <code>key = value</code>. An unknown key stops startup with the file and line, because a typo that does nothing is a config that lies. Command line beats file beats default.</p>
<pre><span class="d">~/.splinter/logs/&lt;session&gt;/session.log</span> readable, in order
<span class="d">~/.splinter/logs/&lt;session&gt;/wire.jsonl</span> every request and reply, raw</pre>
<p>Words, reasoning, every tool call with its arguments, every observation, errors and token counts. Nothing is cut, because a log that keeps only the good parts cannot explain a bad turn.</p>
<pre><span class="u">$</span> cat /etc/passwd | splinter "explain this file"
<span class="u">$</span> cd ~/src/project &amp;&amp; splinter -c <span class="d"># last session that happened here</span>
<span class="u">$</span> splinter --interview <span class="d"># once: language, style, off-limits paths</span></pre>
<p>Standard input becomes framed, size-capped context. Skills live in <code>~/.splinter/skills/</code> and are found on demand. When several splinters run in one directory, <code>/swarm</code> sends a line to the least busy one. The interface has 42 CDE colour palettes and is translated to German, English and Brazilian Portuguese; a missing translation fails <code>make check</code>.</p>
## summary
- slow: 1 task(s), 12018 ms total
- fast: 1 task(s), 16 ms total</pre>
<p>Model, duration and status per task &mdash; a slow or failing delegate is visible
in the header before anybody reads its prose.</p>
<h2>Both directions: MCP</h2>
<p>As a client splinter fetches an MCP server's tools. As a server it offers its
own:</p>
<pre><span class="u">$</span> splinter --mcp-server-listen 0.0.0.0 --mcp-listen-port 8098
splinter: MCP server on 0.0.0.0:8098 (27 tools, read only)</pre>
<p>Another agent gets <code>initialize</code>, <code>tools/list</code> and
<code>tools/call</code>. Read tools are served; mutating and destructive ones only
with <code>--autonomous</code> &mdash; a foreign agent does not run shell commands
here because it asked nicely.</p>
<h2>Pipe, folder, first talk</h2>
<pre><span class="u">$</span> cat /etc/passwd | splinter "explain the file"
<span class="u">$</span> cd ~/src/splinter &amp;&amp; splinter -c <span class="d"># the last session that happened HERE</span>
<span class="u">$</span> splinter --interview <span class="d"># once: language, style, sacred paths</span></pre>
<p>Standard input becomes context, framed and size-capped;
<code>folder_history</code> tells the model what happened in a directory instead
of letting it guess; the profile from the interview lives in
<code>~/.splinter/profile/&lt;user&gt;.md</code>.</p>
<h2>Both directions: A2A</h2>
<p>As a client splinter fetches another agent over A2A; as a server it offers
itself:</p>
<pre><span class="u">$</span> SPLINTER_A2A_SERVER_TOKEN=... splinter --a2a-server-listen 127.0.0.1 --a2a-listen-port 8099
splinter: A2A server on 127.0.0.1:8099 (token required)</pre>
<p><code>POST /a2a</code> takes <code>SendMessage</code>, <code>SendStreamingMessage</code>
(SSE), <code>GetTask</code> and <code>ListTasks</code> as JSON-RPC; the agent card lives at
<code>/.well-known/agent-card.json</code>. A <code>contextId</code> is a
conversation; without one the server makes one and returns it. A
<code>taskPushNotificationConfig</code> posts the completed task to a webhook
(loopback or <code>SPLINTER_A2A_PUSH_ALLOW</code>); push configs can be managed
with CRUD and text/plain URLs are fetched from allowed hosts; binary
<code>file</code>/<code>raw</code> parts land in the <code>inbox/</code> and the
model is told the path. A mutating tool pauses as
<code>INPUT_REQUIRED</code>; a follow-up with <code>taskId</code> and
<code>yes</code>/<code>no</code> resumes; <code>SubscribeToTask</code> sends
the state once and ends the stream; on the client side <code>a2a_subscribe</code>
reads a remote task's events as text and <code>a2a_send</code> attaches a file
(base64) to a message. Beyond loopback the bearer token is
required.</p>
<h2>Kid mode</h2>
<p>With the <code>kids</code> plugin every change needs a parent's approval
(Telegram), a whitelist lets the harmless ones through, the model is reminded of an
age-appropriate tone on every request, and a daily minute budget ends the day when
it is spent.</p>
<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>
<h2 id="build">Build</h2>
<pre><span class="u">$</span> make <span class="d"># libsplinter.so, the binary, the plugins</span>
<span class="u">$</span> make check <span class="d"># 35 test programs, shell tests, i18n check; no network, no model</span>
<span class="u">$</span> splinter</pre>
<p>POSIX make and a C99 compiler, <code>-Wall -Wextra -Werror</code>. NetBSD curses is in the tree. At run time splinter calls <code>curl(1)</code> for HTTP. Manual: <code>man ./docs/splinter.1</code>.</p>
<h2 id="not">What it is not</h2>
<ul>
<li>Not a model. It ships none and chooses none for you.</li>
<li>Not a cloud. It talks to the endpoints you list.</li>
<li>Not a sandbox. The classes protect you from the model, not from code you chose to load.</li>
</ul>
<footer>splinter, BSD-3-Clause. Plugin ABI: <code>docs/PLUGINS.md</code>. Config: <code>docs/CONFIG.md</code>.</footer>
</main>
</div>
</body>
</html>
+196 -215
View File
@@ -1,238 +1,219 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html lang="de">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<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;
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; }
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="color-scheme" content="light dark">
<title>splinter &mdash; ein Agent-Harness in C99</title>
<meta name="description" content="Agent-Harness in C99/POSIX: curses-Chat, Werkzeuge mit Autorisierungsklassen, Plugins, jeder OpenAI-kompatible Endpunkt, MCP, A2A und Telegram-Gateway.">
<style>
:root{
--bg:#e3e7ec; --panel:#d6dce4; --ink:#17202b; --dim:#4d5a69; --rule:#aab4c0;
--acc:#1d5f80; --read:#2a6f97; --mut:#9a5b0c; --des:#a3282b; --term:#0f1720; --termink:#d3dce6;
--serif:Charter,"Bitstream Charter","Iowa Old Style","Palatino Linotype",Palatino,Georgia,serif;
--mono:ui-monospace,"DejaVu Sans Mono","Liberation Mono",Menlo,Consolas,monospace;
}
@media (prefers-color-scheme:dark){:root{
--bg:#141a22; --panel:#1c242f; --ink:#d9e0e8; --dim:#93a0af; --rule:#334050;
--acc:#7dbbd8; --read:#6fb0d6; --mut:#e0a24f; --des:#ee7b7e; --term:#0b1016; --termink:#cfd8e2;}}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;background:var(--bg);color:var(--ink);font:1.0625rem/1.62 var(--serif)}
a{color:var(--acc);text-underline-offset:.18em}
a:focus-visible,summary:focus-visible{outline:2px solid var(--acc);outline-offset:3px}
code,pre,.m{font-family:var(--mono)}
code{font-size:.88em;background:var(--panel);padding:.08em .32em}
.bar{display:flex;justify-content:space-between;gap:1rem;padding:.55rem 1rem;border-bottom:1px solid var(--rule);font:.8rem var(--mono);color:var(--dim)}
.bar a{color:var(--dim)} .bar b{color:var(--ink);font-weight:600}
.shell{display:grid;grid-template-columns:minmax(0,1fr);max-width:68rem;margin:0 auto;padding:0 1rem}
nav.rail{display:none}
main{min-width:0;max-width:44rem;padding:2.5rem 0 5rem}
@media (min-width:62rem){
.shell{grid-template-columns:11.5rem minmax(0,1fr);gap:3rem}
nav.rail{display:block;position:sticky;top:0;align-self:start;padding:2.6rem 0;font:.85rem/1.9 var(--mono)}
nav.rail a{display:block;color:var(--dim);text-decoration:none;border-left:2px solid var(--rule);padding-left:.8rem}
nav.rail a:hover{color:var(--ink);border-color:var(--acc)}
}
h1{font:700 clamp(3rem,11vw,5.2rem)/.95 var(--serif);letter-spacing:-.035em;margin:.2em 0 .25em}
h2{font:700 1.45rem/1.2 var(--serif);margin:3.2rem 0 .8rem;padding-top:1.2rem;border-top:1px solid var(--rule)}
h3{font:600 1rem var(--serif);margin:1.5rem 0 .3rem}
p{margin:.8em 0} .lead{font-size:1.28rem;line-height:1.5}
.dim{color:var(--dim)} .small{font-size:.9rem}
pre{background:var(--term);color:var(--termink);margin:1.2rem 0;padding:1rem 1.1rem;overflow-x:auto;font-size:.82rem;line-height:1.55;border-left:4px solid var(--acc)}
pre .u{color:#fff;font-weight:600} pre .d{color:#7f8ea0} pre .r{color:#7fbfe6} pre .a{color:#f0b35e} pre .x{color:#ff8f92}
@media (prefers-color-scheme:dark){pre .u{color:#fff}}
.tw{overflow-x:auto;margin:1.1rem 0}
table{border-collapse:collapse;width:100%;font-size:.93rem}
th{text-align:left;font-weight:600;color:var(--dim);padding:.3rem .7rem;border-bottom:1px solid var(--rule)}
td{padding:.42rem .7rem;border-bottom:1px solid var(--rule);vertical-align:top}
td:first-child{font:.82rem var(--mono);white-space:nowrap}
tr.r td:first-child{box-shadow:inset 4px 0 var(--read)} tr.a td:first-child{box-shadow:inset 4px 0 var(--mut)} tr.x td:first-child{box-shadow:inset 4px 0 var(--des)}
@media (max-width:40rem){table,tbody,tr,td{display:block}tr:first-child{display:none}tr{border-bottom:1px solid var(--rule);padding:.35rem 0}td{border:0;padding:.1rem .7rem}td:first-child{white-space:normal;overflow-wrap:anywhere}}
.key{display:flex;flex-wrap:wrap;gap:.4rem 1.4rem;font:.82rem var(--mono);margin:.8rem 0}
.key span:before{content:"";display:inline-block;width:.9rem;height:.5rem;margin-right:.45rem;background:var(--c)}
dl{margin:1rem 0} dt{font:600 .9rem var(--mono);margin-top:1rem} dd{margin:.15rem 0 0}
ul{padding-left:1.2rem} li{margin:.3rem 0}
.cols{display:grid;gap:0 2rem;grid-template-columns:repeat(auto-fit,minmax(15rem,1fr))}
footer{border-top:1px solid var(--rule);margin-top:4rem;padding-top:1.2rem;font-size:.88rem;color:var(--dim)}
</style>
</head>
<body>
<div id="wrap">
<div class="bar"><span><b>splinter</b>(1)</span><span class="langs"><b>de</b> &nbsp;<a href="index.en.html">en</a>&nbsp; <a href="index.pt.html">pt-BR</a></span></div>
<div class="shell">
<nav class="rail" aria-label="Abschnitte">
<a href="#checks">pr&uuml;fungen</a><a href="#tools">werkzeuge</a><a href="#models">modelle</a><a href="#plugins">plugins</a><a href="#agents">andere agenten</a><a href="#telegram">telegram</a><a href="#files">config &amp; logs</a><a href="#build">bauen</a><a href="#not">nicht</a>
</nav>
<main>
<h1>splinter</h1>
<p class="lead">Ein Agent-Harness in C99. Es sitzt zwischen dir und einem Modell, f&uuml;hrt die Werkzeuge aus, um die das Modell bittet, und entscheidet, welche davon laufen d&uuml;rfen. Du kannst alles davon lesen.</p>
<p>Chat im curses-Terminal, einmalig aus der Pipe oder &uuml;ber Telegram. Jeder Endpunkt, der die OpenAI-Chat-API spricht, jedes Programm, das eine Antwort ausgibt, oder ein anderer Agent &uuml;ber A2A. Werkzeuge erkl&auml;ren, was sie d&uuml;rfen; das Harness setzt es durch und sagt dem Modell, was es abgelehnt hat.</p>
<p id="lang">Deutsch &middot; <a href="index.en.html">English</a> &middot; <a href="index.pt.html">Portugues (BR)</a></p>
<pre><span class="d"># Beispielablauf, kein echtes Log</span>
<span class="u">du</span> setze die Version im Makefile auf 0.2.0
<span class="u">tool</span> read {"path":"Makefile"} <span class="r">read</span>
<span class="u">tool</span> edit {"path":"Makefile","old":"0.1.0","new":"0.2.0"} <span class="a">mutate</span>
<span class="u">frage</span> edit Makefile ? [y/N] <span class="x">n</span>
<span class="u">gesehen</span> error: denied by operator <span class="d">&larr; das liest das Modell</span>
<span class="u">modell</span> Ich durfte die Datei nicht &auml;ndern. Sag Bescheid, wenn ich es nochmal versuchen soll.</pre>
<p class="small dim">Rund 29.500 Zeilen C (Stand 2026-11-11), 16 Plugins, 35 Testprogramme. BSD-3-Clause.</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 — von uns gebaut, damit wir es umbauen koennen, statt uns an das Verhalten eines fremden Clients zu gewoehnen.</p>
<h2 id="checks">Drei Pr&uuml;fungen, bevor ein Werkzeug l&auml;uft</h2>
<dl>
<dt>Budget</dt><dd>Vor jedem Request wird die Konversation gegen das eingestellte Byte-Budget gemessen. Passt sie nicht, kann ein Plugin wie <code>lcm</code> sie vorher komprimieren. Passt sie dann immer noch nicht, wird nichts gesendet und der Turn schl&auml;gt fehl, statt dass ein Endpunkt still k&uuml;rzt.</dd>
<dt>Registry</dt><dd>Ein Werkzeugname, den es nicht gibt, wird zur Beobachtung f&uuml;r das Modell &mdash; kein Absturz, kein Raten.</dd>
<dt>Autorisierungsklasse</dt><dd>Jedes Werkzeug erkl&auml;rt <em>read</em>, <em>mutate</em> oder <em>destructive</em>. Das Werkzeug sagt es, nicht das Modell und nicht der Prompt. Mutierende und destruktive Aufrufe brauchen deine Zustimmung, au&szlig;er du startest mit <code>--autonomous</code>. Ein Plugin kann als Gate davorstehen: erlauben, mit Grund ablehnen oder keine Meinung haben. Das Kindermodus-Plugin ist so eins.</dd>
</dl>
<p>Eine Ablehnung ist nie stumm. Sie kommt als Beobachtung des Werkzeugs zum Modell zur&uuml;ck, damit es darauf reagieren kann.</p>
<p class="meta"><b>29543</b> Zeilen C99/POSIX &middot;
<b>27</b> Werkzeuge &middot; <b>35</b> Test-Programme &middot;
<b>16</b> Plugins &middot; <b>42</b> Farbschemata &middot; BSD-3-Clause</p>
<h2 id="tools">Werkzeuge</h2>
<p>41 sind eingebaut oder kommen mit Plugins. Ein MCP-Server kann zur Laufzeit weitere hinzuf&uuml;gen.</p>
<div class="key"><span style="--c:var(--read)">read</span><span style="--c:var(--mut)">mutate</span><span style="--c:var(--des)">destructive</span></div>
<div class="tw"><table>
<tr><th>Werkzeug</th><th>Was es tut</th></tr>
<tr class="r"><td>read, search, list</td><td>Nummerierte Zeilen mit offset und limit, verweigert Bin&auml;rdateien. Literal-Suche, h&ouml;chstens 100 Treffer. Verzeichnis anzeigen.</td></tr>
<tr class="a"><td>write, edit</td><td>Datei schreiben, mit Diff in der Beobachtung. Edit ersetzt genau ein Vorkommen; mehrdeutig ist ein Fehler.</td></tr>
<tr class="x"><td>run</td><td>Ein Shell-Befehl. Der Exit-Status ist eine Beobachtung.</td></tr>
<tr class="r"><td>websearch</td><td>Websuche.</td></tr>
<tr class="a"><td>webfetch</td><td>Eine URL holen.</td></tr>
<tr class="r"><td>folder_history</td><td>Was zuletzt in diesem Verzeichnis passiert ist, damit das Modell nicht raten muss.</td></tr>
<tr class="r"><td>skill_search, skill_load</td><td>Installierte Skills finden, einen ganz lesen. Nichts wird vorgeladen.</td></tr>
<tr class="r"><td>memory_search</td><td>Deine Erinnerungen auf einem mem0-Server, pro Benutzer getrennt.</td></tr>
<tr class="a"><td>memory_add</td><td>Einen Fakt merken.</td></tr>
<tr class="x"><td>delegate, delegate_parallel, delegate_submit, delegate_retry</td><td>Arbeit an ein anderes Modell geben: eine Aufgabe, mehrere gleichzeitig, als Hintergrundjob, oder einen Fehlschlag wiederholen.</td></tr>
<tr class="r"><td>delegate_list, delegate_jobs, delegate_result, delegate_due</td><td>Delegates auflisten, Jobs ansehen, Ergebnis abholen, F&auml;lliges sehen.</td></tr>
<tr class="x"><td>task_start, task_kill</td><td>Einen Shell-Befehl im Hintergrund starten (vier gleichzeitig) oder stoppen.</td></tr>
<tr class="r"><td>task_list, task_result</td><td>Hintergrundjobs und ihre Ausgabe.</td></tr>
<tr class="a"><td>plan_task_add, plan_task_update</td><td>Eine dauerhafte Aufgabenliste f&uuml;r die Sitzung.</td></tr>
<tr class="r"><td>plan_task_list</td><td>Diese Liste lesen.</td></tr>
<tr class="x"><td>tmux_start</td><td>Einen Befehl in einer losgel&ouml;sten tmux-Sitzung starten und zum Ziel machen.</td></tr>
<tr class="a"><td>tmux_send, tmux_ask</td><td>Hineintippen (Text oder Tasten wie C-c), auf neue Ausgabe warten und nur die neuen Zeilen zurückgeben.</td></tr>
<tr class="r"><td>tmux_status, tmux_capture, tmux_read</td><td>Das Pane ansehen und lesen, was neu ist.</td></tr>
<tr class="x"><td>a2a_send, a2a_cancel_task</td><td>Einem anderen Agenten schreiben (auch mit Datei) oder seinen Task abbrechen.</td></tr>
<tr class="r"><td>a2a_get_task, a2a_subscribe</td><td>Task eines anderen Agenten und seine Ereignisse lesen.</td></tr>
<tr class="r"><td>echo, clock</td><td>Kleine Helfer.</td></tr>
</table></div>
<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 — 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">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>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 — 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 — 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>
<tr><td class="c">edit</td><td class="m">mutate</td><td>genau ein Vorkommen ersetzen; mehrdeutig ist ein Fehler</td></tr>
<tr><td class="c">memory_add</td><td class="m">mutate</td><td>einen Fakt merken</td></tr>
<tr><td class="c">run</td><td class="x">destructive</td><td>Shell-Befehl; der Exit-Status ist eine Beobachtung</td></tr>
<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>
<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>
<tr><td class="c">cli</td><td>jedes Programm als Modell, etwa <code>claude -p</code></td></tr>
<tr><td class="c">a2a</td><td>ein anderer Agent ueber A2A (SendMessage/Streaming, Text)</td></tr>
<tr><td class="c">ring</td><td>Exit-Ring: 429 oder Limit &rarr; naechster Ausgang</td></tr>
<tr><td class="c">mcp</td><td>MCP-Server als Werkzeugquelle, mit den Schemata des Servers</td></tr>
<tr><td class="c">lcm</td><td>Komprimierung der Konversation</td></tr>
<tr><td class="c">focus</td><td>erinnert alle N Turns an das Ziel (<code>/goal</code>)</td></tr>
<tr><td class="c">reminder</td><td>legt alle 10 Turns die Grundregeln zurueck in die Konversation</td></tr>
<tr><td class="c">cps, clock</td><td>Widgets in der Seitenleiste</td></tr>
</table>
<h2>Delegation: andere Modelle, splinter waehlt</h2>
<h2 id="models">Modelle</h2>
<p>Ein Transport &uuml;bersetzt das schlichte Zeilenprotokoll des Harness in das, was die Gegenseite spricht. Die Schleife sieht nie eine Hersteller-API; deshalb l&auml;uft <code>make check</code> gegen einen geskripteten Mock, ohne Netz und ohne Schl&uuml;ssel.</p>
<dl>
<dt>openai</dt><dd>Jeder OpenAI-kompatible Endpunkt, Streaming &uuml;ber SSE. HTTP l&auml;uft &uuml;ber <code>curl(1)</code>.</dd>
<dt>cli</dt><dd>Jedes Programm als Modell, etwa <code>claude -p</code>.</dd>
<dt>a2a</dt><dd>Ein anderer Agent &uuml;ber A2A.</dd>
<dt>ring</dt><dd>Ein Exit-Ring. Bei 429 oder Limit &uuml;bernimmt der n&auml;chste konfigurierte Ausgang.</dd>
</dl>
<h3>Delegation</h3>
<p>Das Modell kann Arbeit an ein anderes Modell geben. splinter w&auml;hlt: ein angefragter Tag z&auml;hlt 5, ein Tag im Aufgabentext 3, ein Wort aus der Beschreibung des Delegates 1. Die Beobachtung beginnt mit der Wahl und dem Grund, eine falsche Wahl ist also sichtbar.</p>
<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=...
delegate = coder | C99, POSIX, Review | tags=code,c99 | endpoint=... | model=...
delegate = quick | kurze Antworten | tags=chat,cheap | endpoint=... | model=...
<span class="u">$</span> splinter --choose "pruefe diesen C-Code auf Speicherfehler"
<span class="u">$</span> splinter --choose "pr&uuml;fe 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><code>delegate_parallel</code> schickt bis zu acht Aufgaben gleichzeitig los. Der Bericht nennt pro Aufgabe, wer geantwortet hat, wie lange es dauerte und den Exit-Status; ein lahmer oder kaputter Delegate steht in der Kopfzeile.</p>
<pre>[parallel: 2 task(s), 12018 ms wall]
## task 1 | model slow | score 5 | 12018 ms | exit 0 | 75 B
## task 2 | model fast | score 5 | 16 ms | exit 0 | 74 B</pre>
<p>Ein Delegate darf einen <code>host=</code> nennen. Dann geht der ganze Aufruf &uuml;ber ssh, und claude, opencode oder ein zweiter splinter l&auml;uft dort, wo das Modell oder das Netz ist &mdash; mit den Schl&uuml;sseln dieser Maschine.</p>
<pre>delegate = remote | auf einer anderen Kiste | tags=remote | host=build.example.org | endpoint=... | model=...</pre>
<h2 id="plugins">Plugins</h2>
<p>Ein Plugin ist eine <code>.so</code>, die per dlopen geladen wird. Es kann Werkzeuge, Slash-Befehle, Seitenleisten-Widgets, Transporte und Gates registrieren. Der Tick eines Widgets l&auml;uft auf einem eigenen Thread; gezeichnet wird nur im UI-Thread. Die ABI steht in <code>docs/PLUGINS.md</code>. Plugins laufen im Prozess mit deinen Rechten.</p>
<div class="cols"><ul>
<li><b>lcm</b>, <b>cps</b>: Konversation komprimieren</li>
<li><b>focus</b>: erinnert alle N Turns an <code>/goal</code></li>
<li><b>reminder</b>: legt alle 10 Turns die Grundregeln zur&uuml;ck</li>
<li><b>ring</b>: n&auml;chster Ausgang bei 429 oder Limit</li>
<li><b>mcp</b>, <b>a2a</b>, <b>cli</b>: andere Werkzeuge und Agenten erreichen</li>
<li><b>provider</b>: Provider zur Laufzeit anlegen</li>
</ul><ul>
<li><b>tasks</b>: Shell-Jobs im Hintergrund</li>
<li><b>planner</b>: Aufgabenliste der Sitzung</li>
<li><b>tmux</b>: ein Programm steuern, das ein Terminal will</li>
<li><b>scheduler</b>: zeitgesteuerte Arbeit</li>
<li><b>status</b>: Kontext, Tokens pro Sekunde, Kosten, wenn du Preise setzt</li>
<li><b>kids</b>: Kindermodus</li>
<li><b>clock</b>: Uhr in der Seitenleiste und ein Werkzeug</li>
</ul></div>
<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 — 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
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> 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>Der Bot registriert seine Befehle: das Menue zeigt die geladenen Plugin-Befehle und die Programme in <code>~/.splinter/commands/</code>; eine Zustimmung kommt mit Ja/Nein-Knoepfen. <code>/interview</code> stellt die Fragen im Chat. <code>/new</code> faengt eine frische Konversation an; <code>/model</code> bietet die konfigurierten Modelle als Knoepfe, schaltet den Transport um und merkt die Wahl in <code>splinter.conf.d/90-model.conf</code>; <code>/model probe</code> fragt die Endpoints nach <code>/v1/models</code>. <code>/connect</code> fragt Name, Endpoint, Modell und Key-Variable ab, macht einen Test-Turn und schreibt den Provider nach <code>splinter.conf.d/20-connect.conf</code>. Antworten werden als Telegram-HTML gesetzt: fett, kursiv, Code und Links als Tags, Bilder als Foto (<code>sendPhoto</code>, auch lokale Dateien), andere Dateien als Dokument, Tabellen als Spalten im Monospace-Block; ein Stueck, das Telegram nicht parst, geht als Text raus statt verloren. Programme in <code>commands/</code> antworten dort direkt im Chat; im TUI gehen sie ans Modell.</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 — 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">klein, nichts ausser libc und curses</span>
<span class="u">$</span> make check <span class="d">35 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>
<h2>Was es nicht ist</h2>
<h2 id="agents">Andere Agenten, in beide Richtungen</h2>
<h3>MCP</h3>
<p>Als Client holt splinter die Werkzeuge eines MCP-Servers samt deren Schemata. Als Server bietet es die eigenen an:</p>
<pre><span class="u">$</span> splinter --mcp-server-listen 127.0.0.1 --mcp-listen-port 8098</pre>
<p>Es beantwortet <code>initialize</code>, <code>tools/list</code> und <code>tools/call</code>. Lesende Werkzeuge werden bedient. Mutierende und destruktive laufen nur mit <code>--autonomous</code>; ein fremder Agent bekommt also keine Shell, nur weil er fragt.</p>
<h3>A2A</h3>
<pre><span class="u">$</span> SPLINTER_A2A_SERVER_TOKEN=... splinter --a2a-server-listen 127.0.0.1 --a2a-listen-port 8099</pre>
<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 — die Klassen schuetzen vor dem Modell, nicht vor Code, den du selbst laedst.</li>
<li><code>POST /a2a</code> nimmt <code>SendMessage</code>, <code>SendStreamingMessage</code> (SSE), <code>GetTask</code>, <code>ListTasks</code> und <code>SubscribeToTask</code>. Die Agent Card liegt unter <code>/.well-known/agent-card.json</code>.</li>
<li>Eine <code>contextId</code> ist eine Konversation. Ohne eine legt der Server eine an und gibt sie zur&uuml;ck.</li>
<li>Ein mutierendes Werkzeug pausiert den Task als <code>INPUT_REQUIRED</code>. Ein Folgeaufruf mit <code>taskId</code> und <code>yes</code> oder <code>no</code> setzt fort. <code>CancelTask</code> bricht ab.</li>
<li>Eine Push-Notification-Config schickt den fertigen Task an einen Webhook (Loopback oder Hosts aus <code>SPLINTER_A2A_PUSH_ALLOW</code>).</li>
<li>Bin&auml;re Datei-Teile landen in <code>inbox/</code>, das Modell bekommt den Pfad. URL-Teile werden nur von erlaubten Hosts geholt.</li>
<li>Jenseits von Loopback ist ein Bearer-Token Pflicht.</li>
<li>Als Client kann <code>a2a_send</code> eine Datei anh&auml;ngen, und <code>a2a_subscribe</code> liest die Ereignisse eines fremden Tasks.</li>
</ul>
<h2>Die Flotte</h2>
<p>Ein Delegate darf einen Host nennen. Dann geht der ganze Aufruf ueber ssh, und
claude, opencode oder ein zweiter splinter laufen dort, wo das Modell oder das
Netz ist:</p>
<pre>delegate = olivia | auf olivia | tags=remote | host=172.25.206.16 |
endpoint=http://172.25.206.2:18082/v1/chat/completions | model=...</pre>
<p><code>delegate_parallel</code> schickt bis zu acht Aufgaben gleichzeitig los
und berichtet zurueck, wer was geliefert hat:</p>
<pre>[parallel: 2 task(s), 12018 ms wall]
<h2 id="telegram">Telegram</h2>
<p><code>splinter --daemon</code> pollt <code>getUpdates</code>, f&uuml;hrt einen Turn pro Nachricht aus und antwortet mit denselben Slash-Befehlen wie das Terminal. Der Token kommt aus einer 0600-Datei oder der Umgebung, nie aus einem Argument. Nur Benutzer-IDs aus <code>telegram_allow</code> bekommen Antwort.</p>
<ul>
<li>Zustimmung kommt als Ja/Nein-Knopf. Die Textantwort <code>ok &lt;id&gt;</code> geht weiterhin.</li>
<li><code>/model</code> wechselt zwischen konfigurierten Modellen; <code>/model probe</code> fragt die Endpunkte nach <code>/v1/models</code>. <code>/connect</code> fragt Name, Endpunkt, Modell und Key-Variable ab, macht einen Test-Turn und schreibt den Provider nach <code>splinter.conf.d</code>. <code>/new</code> beginnt eine frische Konversation. <code>/interview</code> stellt die Einrichtungsfragen im Chat.</li>
<li>Antworten gehen als Telegram-HTML raus: fett, kursiv, Code, Links, Zitate und Tabellen als Monospace-Spalten. Markdown-Bilder werden Fotos, andere lokale Dateien Dokumente. Ein St&uuml;ck, das Telegram nicht parst, geht als Text raus, statt verloren zu gehen.</li>
<li>Programme in <code>~/.splinter/commands/</code> werden zu <code>/name</code> und stehen im Men&uuml; des Bots.</li>
</ul>
<h3>Kindermodus</h3>
<p>Mit dem Plugin <code>kids</code> braucht jede &Auml;nderung die Zustimmung eines Elternteils per Telegram, eine Whitelist l&auml;sst Harmloses durch, das Modell wird bei jeder Anfrage an einen altersgerechten Ton erinnert, und ein Tageskontingent an Minuten beendet den Tag, wenn es aufgebraucht ist.</p>
## task 1 | model slow | score 5 | 12018 ms | exit 0 | 75 B | requested tag 'slow'
## task 2 | model fast | score 5 | 16 ms | exit 0 | 74 B | requested tag 'fast'
<h2 id="files">Konfiguration, Logs, Wege hinein</h2>
<pre><span class="d"># ~/.splinter/splinter.conf (plus splinter.conf.d/*.conf, in Namensreihenfolge)</span>
endpoint = http://127.0.0.1:8080/v1/chat/completions
model = my-model
locale = de
theme = Delphinium
telegram_allow = 123456789
plugin = plugins/lcm/lcm.so</pre>
<p>Einfach <code>key = value</code>. Ein unbekannter Schl&uuml;ssel stoppt den Start mit Datei und Zeile, denn ein Tippfehler, der nichts tut, ist eine Konfiguration, die l&uuml;gt. Kommandozeile schl&auml;gt Datei schl&auml;gt Vorgabe.</p>
<pre><span class="d">~/.splinter/logs/&lt;sitzung&gt;/session.log</span> lesbar, in Reihenfolge
<span class="d">~/.splinter/logs/&lt;sitzung&gt;/wire.jsonl</span> jeder Request und jede Antwort, roh</pre>
<p>Worte, Denken, jeder Werkzeugaufruf mit Argumenten, jede Beobachtung, Fehler und Token-Zahlen. Nichts gek&uuml;rzt, denn ein Log, das nur das Gute beh&auml;lt, kann einen schlechten Turn nicht erkl&auml;ren.</p>
<pre><span class="u">$</span> cat /etc/passwd | splinter "erkl&auml;r die Datei"
<span class="u">$</span> cd ~/src/projekt &amp;&amp; splinter -c <span class="d"># die letzte Session, die HIER war</span>
<span class="u">$</span> splinter --interview <span class="d"># einmal: Sprache, Stil, tabu-Pfade</span></pre>
<p>Standardeingabe wird zu gerahmtem, gr&ouml;&szlig;enbegrenztem Kontext. Skills liegen in <code>~/.splinter/skills/</code> und werden bei Bedarf gefunden. Laufen mehrere splinter in einem Verzeichnis, schickt <code>/swarm</code> eine Zeile an den am wenigsten besch&auml;ftigten. Die Oberfl&auml;che hat 42 CDE-Farbpaletten und ist auf Deutsch, Englisch und brasilianisches Portugiesisch &uuml;bersetzt; eine fehlende &Uuml;bersetzung l&auml;sst <code>make check</code> scheitern.</p>
## summary
- slow: 1 task(s), 12018 ms total
- fast: 1 task(s), 16 ms total</pre>
<p>Modell, Dauer und Status pro Aufgabe &mdash; ein lahmer oder kaputter Delegate
ist in der Kopfzeile sichtbar, bevor jemand seinen Text liest.</p>
<h2>Beide Richtungen: MCP</h2>
<p>Als Client holt splinter die Werkzeuge eines MCP-Servers. Als Server stellt es
seine eigenen hin:</p>
<pre><span class="u">$</span> splinter --mcp-server-listen 0.0.0.0 --mcp-listen-port 8098
splinter: MCP server on 0.0.0.0:8098 (27 tools, read only)</pre>
<p>Ein anderer Agent bekommt <code>initialize</code>, <code>tools/list</code> und
<code>tools/call</code>. Lesende Werkzeuge werden bedient, mutierende und
destruktive nur mit <code>--autonomous</code> &mdash; ein fremder Agent fuehrt hier
keine Shell aus, weil er freundlich fragt.</p>
<h2>Pipe, Ordner, Erstgespraech</h2>
<pre><span class="u">$</span> cat /etc/passwd | splinter "erklaer die Datei"
<span class="u">$</span> cd ~/src/splinter &amp;&amp; splinter -c <span class="d"># die letzte Session, die HIER war</span>
<span class="u">$</span> splinter --interview <span class="d"># einmal: Sprache, Stil, heilige Pfade</span></pre>
<p>Standardeingabe wird zu Kontext, markiert und groessenbegrenzt;
<code>folder_history</code> erzaehlt dem Modell, was in einem Verzeichnis passiert
ist, statt es raten zu lassen; das Profil aus dem Interview liegt in
<code>~/.splinter/profile/&lt;user&gt;.md</code>.</p>
<h2>Beide Richtungen: A2A</h2>
<p>Als Client holt splinter einen anderen Agenten ueber A2A; als Server stellt es
sich selbst hin:</p>
<pre><span class="u">$</span> SPLINTER_A2A_SERVER_TOKEN=... splinter --a2a-server-listen 127.0.0.1 --a2a-listen-port 8099
splinter: A2A server on 127.0.0.1:8099 (token required)</pre>
<p><code>POST /a2a</code> nimmt <code>SendMessage</code>, <code>SendStreamingMessage</code>
(SSE), <code>GetTask</code> und <code>ListTasks</code> als JSON-RPC; die Agent Card liegt unter
<code>/.well-known/agent-card.json</code>. Ein <code>contextId</code> ist eine
Konversation; ohne eines legt der Server eins an und gibt es zurueck. Eine
<code>taskPushNotificationConfig</code> schickt den fertigen Task an einen
Webhook (Loopback oder <code>SPLINTER_A2A_PUSH_ALLOW</code>); Push-Configs
lassen sich per CRUD verwalten, text/plain-URLs werden von erlaubten Hosts
geholt; binaere <code>file</code>/<code>raw</code>-Teile landen im
<code>inbox/</code> und das Modell bekommt den Pfad. Ein mutierendes Werkzeug pausiert als
<code>INPUT_REQUIRED</code>; ein Folgeaufruf mit <code>taskId</code> und
<code>yes</code>/<code>no</code> setzt fort; <code>SubscribeToTask</code>
schickt den Zustand einmal und schliesst den Stream; als Client liest
<code>a2a_subscribe</code> die Ereignisse eines fremden Tasks als Text, und
<code>a2a_send</code> haengt eine Datei (base64) an eine Nachricht. Jenseits von
Loopback ist der Bearer-Token Pflicht.</p>
<h2>Kindermodus</h2>
<p>Mit dem Plugin <code>kids</code> braucht jede Aenderung die Zustimmung eines
Erwachsenen (Telegram), eine Whitelist laesst das Harmlose durch, das Modell wird
bei jeder Anfrage an einen altersgerechten Ton erinnert, und ein Tageskontingent
an Minuten beendet den Tag, wenn es aufgebraucht ist.</p>
<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; Wir nehmen auseinander, bauen nach und behalten. Ihre Systeme: in Ruhe lassen, wenn nicht gefragt.</p>
<h2 id="build">Bauen</h2>
<pre><span class="u">$</span> make <span class="d"># libsplinter.so, das Binary, die Plugins</span>
<span class="u">$</span> make check <span class="d"># 35 Testprogramme, Shell-Tests, i18n-Pr&uuml;fung; kein Netz, kein Modell</span>
<span class="u">$</span> splinter</pre>
<p>POSIX make und ein C99-Compiler, <code>-Wall -Wextra -Werror</code>. NetBSD-curses liegt im Baum. Zur Laufzeit ruft splinter f&uuml;r HTTP <code>curl(1)</code> auf. Manual: <code>man ./docs/splinter.1</code>.</p>
<h2 id="not">Was es nicht ist</h2>
<ul>
<li>Kein Modell. splinter bringt keins mit und w&auml;hlt keins f&uuml;r dich.</li>
<li>Keine Cloud. Es spricht mit den Endpunkten, die du eintr&auml;gst.</li>
<li>Kein Sandkasten. Die Klassen sch&uuml;tzen dich vor dem Modell, nicht vor Code, den du selbst l&auml;dst.</li>
</ul>
<footer>splinter, BSD-3-Clause. Plugin-ABI: <code>docs/PLUGINS.md</code>. Konfiguration: <code>docs/CONFIG.md</code>.</footer>
</main>
</div>
</body>
</html>
+199 -160
View File
@@ -1,180 +1,219 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="pt_BR">
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>splinter - um harness de agente que e seu</title>
<meta name="description" content="splinter e um harness de agente em C99/POSIX: chat no terminal, ferramentas com classes de autorizacao, plugins, qualquer endpoint compativel com OpenAI, gateway Telegram.">
<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; }
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="color-scheme" content="light dark">
<title>splinter &mdash; um harness de agente em C99</title>
<meta name="description" content="Harness de agente em C99/POSIX: chat curses, ferramentas com classes de autoriza&ccedil;&atilde;o, plugins, qualquer endpoint compat&iacute;vel com OpenAI, MCP, A2A e gateway Telegram.">
<style>
:root{
--bg:#e3e7ec; --panel:#d6dce4; --ink:#17202b; --dim:#4d5a69; --rule:#aab4c0;
--acc:#1d5f80; --read:#2a6f97; --mut:#9a5b0c; --des:#a3282b; --term:#0f1720; --termink:#d3dce6;
--serif:Charter,"Bitstream Charter","Iowa Old Style","Palatino Linotype",Palatino,Georgia,serif;
--mono:ui-monospace,"DejaVu Sans Mono","Liberation Mono",Menlo,Consolas,monospace;
}
@media (prefers-color-scheme:dark){:root{
--bg:#141a22; --panel:#1c242f; --ink:#d9e0e8; --dim:#93a0af; --rule:#334050;
--acc:#7dbbd8; --read:#6fb0d6; --mut:#e0a24f; --des:#ee7b7e; --term:#0b1016; --termink:#cfd8e2;}}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;background:var(--bg);color:var(--ink);font:1.0625rem/1.62 var(--serif)}
a{color:var(--acc);text-underline-offset:.18em}
a:focus-visible,summary:focus-visible{outline:2px solid var(--acc);outline-offset:3px}
code,pre,.m{font-family:var(--mono)}
code{font-size:.88em;background:var(--panel);padding:.08em .32em}
.bar{display:flex;justify-content:space-between;gap:1rem;padding:.55rem 1rem;border-bottom:1px solid var(--rule);font:.8rem var(--mono);color:var(--dim)}
.bar a{color:var(--dim)} .bar b{color:var(--ink);font-weight:600}
.shell{display:grid;grid-template-columns:minmax(0,1fr);max-width:68rem;margin:0 auto;padding:0 1rem}
nav.rail{display:none}
main{min-width:0;max-width:44rem;padding:2.5rem 0 5rem}
@media (min-width:62rem){
.shell{grid-template-columns:11.5rem minmax(0,1fr);gap:3rem}
nav.rail{display:block;position:sticky;top:0;align-self:start;padding:2.6rem 0;font:.85rem/1.9 var(--mono)}
nav.rail a{display:block;color:var(--dim);text-decoration:none;border-left:2px solid var(--rule);padding-left:.8rem}
nav.rail a:hover{color:var(--ink);border-color:var(--acc)}
}
h1{font:700 clamp(3rem,11vw,5.2rem)/.95 var(--serif);letter-spacing:-.035em;margin:.2em 0 .25em}
h2{font:700 1.45rem/1.2 var(--serif);margin:3.2rem 0 .8rem;padding-top:1.2rem;border-top:1px solid var(--rule)}
h3{font:600 1rem var(--serif);margin:1.5rem 0 .3rem}
p{margin:.8em 0} .lead{font-size:1.28rem;line-height:1.5}
.dim{color:var(--dim)} .small{font-size:.9rem}
pre{background:var(--term);color:var(--termink);margin:1.2rem 0;padding:1rem 1.1rem;overflow-x:auto;font-size:.82rem;line-height:1.55;border-left:4px solid var(--acc)}
pre .u{color:#fff;font-weight:600} pre .d{color:#7f8ea0} pre .r{color:#7fbfe6} pre .a{color:#f0b35e} pre .x{color:#ff8f92}
@media (prefers-color-scheme:dark){pre .u{color:#fff}}
.tw{overflow-x:auto;margin:1.1rem 0}
table{border-collapse:collapse;width:100%;font-size:.93rem}
th{text-align:left;font-weight:600;color:var(--dim);padding:.3rem .7rem;border-bottom:1px solid var(--rule)}
td{padding:.42rem .7rem;border-bottom:1px solid var(--rule);vertical-align:top}
td:first-child{font:.82rem var(--mono);white-space:nowrap}
tr.r td:first-child{box-shadow:inset 4px 0 var(--read)} tr.a td:first-child{box-shadow:inset 4px 0 var(--mut)} tr.x td:first-child{box-shadow:inset 4px 0 var(--des)}
@media (max-width:40rem){table,tbody,tr,td{display:block}tr:first-child{display:none}tr{border-bottom:1px solid var(--rule);padding:.35rem 0}td{border:0;padding:.1rem .7rem}td:first-child{white-space:normal;overflow-wrap:anywhere}}
.key{display:flex;flex-wrap:wrap;gap:.4rem 1.4rem;font:.82rem var(--mono);margin:.8rem 0}
.key span:before{content:"";display:inline-block;width:.9rem;height:.5rem;margin-right:.45rem;background:var(--c)}
dl{margin:1rem 0} dt{font:600 .9rem var(--mono);margin-top:1rem} dd{margin:.15rem 0 0}
ul{padding-left:1.2rem} li{margin:.3rem 0}
.cols{display:grid;gap:0 2rem;grid-template-columns:repeat(auto-fit,minmax(15rem,1fr))}
footer{border-top:1px solid var(--rule);margin-top:4rem;padding-top:1.2rem;font-size:.88rem;color:var(--dim)}
</style>
</head>
<body>
<div id="wrap">
<div class="bar"><span><b>splinter</b>(1)</span><span class="langs"><a href="index.html">de</a> &nbsp;<a href="index.en.html">en</a>&nbsp; <b>pt-BR</b></span></div>
<div class="shell">
<nav class="rail" aria-label="Se&ccedil;&otilde;es">
<a href="#checks">verifica&ccedil;&otilde;es</a><a href="#tools">ferramentas</a><a href="#models">modelos</a><a href="#plugins">plugins</a><a href="#agents">outros agentes</a><a href="#telegram">telegram</a><a href="#files">config &amp; logs</a><a href="#build">compilar</a><a href="#not">n&atilde;o &eacute;</a>
</nav>
<main>
<h1>splinter</h1>
<p class="lead">Um harness de agente em C99. Fica entre voc&ecirc; e um modelo, executa as ferramentas que o modelo pede e decide quais delas podem rodar. Voc&ecirc; pode ler tudo.</p>
<p>Chat em terminal curses, uma execu&ccedil;&atilde;o &uacute;nica a partir de um pipe, ou pelo Telegram. Qualquer endpoint que fale a API de chat da OpenAI, qualquer programa que imprima uma resposta, ou outro agente via A2A. As ferramentas declaram o que podem fazer; o harness aplica a regra e conta ao modelo o que recusou.</p>
<p id="lang"><a href="index.html">Deutsch</a> &middot; <a href="index.en.html">English</a> &middot; Portugues (BR)</p>
<pre><span class="d"># exemplo ilustrativo, n&atilde;o &eacute; um log real</span>
<span class="u">voc&ecirc;</span> troque a vers&atilde;o no Makefile para 0.2.0
<span class="u">tool</span> read {"path":"Makefile"} <span class="r">read</span>
<span class="u">tool</span> edit {"path":"Makefile","old":"0.1.0","new":"0.2.0"} <span class="a">mutate</span>
<span class="u">pergunta</span> edit Makefile ? [y/N] <span class="x">n</span>
<span class="u">visto</span> error: denied by operator <span class="d">&larr; isto &eacute; o que o modelo l&ecirc;</span>
<span class="u">modelo</span> N&atilde;o tive permiss&atilde;o para editar o arquivo. Avise se devo tentar de novo.</pre>
<p class="small dim">Cerca de 29.500 linhas de C (em 2026-11-11), 16 plugins, 35 programas de teste. BSD-3-Clause.</p>
<h1>splinter<span>_</span></h1>
<p class="lead">Um harness de agente que e seu: chat no terminal, ferramentas com classes de autorizacao, plugins, qualquer modelo que fale OpenAI - escrito por nos para poder mudar-lo, em vez de nos acostumar com o comportamento de um cliente alheio.</p>
<h2 id="checks">Tr&ecirc;s verifica&ccedil;&otilde;es antes de uma ferramenta rodar</h2>
<dl>
<dt>Or&ccedil;amento</dt><dd>Antes de cada requisi&ccedil;&atilde;o, a conversa &eacute; medida contra o or&ccedil;amento de bytes configurado. Se n&atilde;o couber, um plugin como o <code>lcm</code> pode comprimi-la antes. Se ainda n&atilde;o couber, nada &eacute; enviado e o turno falha, em vez de deixar um endpoint truncar em sil&ecirc;ncio.</dd>
<dt>Registro</dt><dd>Um nome de ferramenta que n&atilde;o existe vira uma observa&ccedil;&atilde;o para o modelo &mdash; sem falha, sem adivinha&ccedil;&atilde;o.</dd>
<dt>Classe de autoriza&ccedil;&atilde;o</dt><dd>Cada ferramenta declara <em>read</em>, <em>mutate</em> ou <em>destructive</em>. Quem diz &eacute; a ferramenta, n&atilde;o o modelo e n&atilde;o o prompt. Chamadas que alteram ou destroem precisam do seu consentimento, a menos que voc&ecirc; inicie com <code>--autonomous</code>. Um plugin pode ficar na frente como gate: permitir, recusar com motivo ou n&atilde;o opinar. O plugin do modo crian&ccedil;a &eacute; um deles.</dd>
</dl>
<p>Uma recusa nunca &eacute; muda. Ela volta ao modelo como observa&ccedil;&atilde;o da ferramenta, para que ele possa reagir.</p>
<p class="meta"><b>29543</b> linhas C99/POSIX &middot;
<b>27</b> ferramentas &middot; <b>35</b> programas de teste &middot;
<b>16</b> plugins &middot; <b>42</b> paletas &middot; BSD-3-Clause</p>
<h2 id="tools">Ferramentas</h2>
<p>S&atilde;o 41, embutidas ou vindas de plugins. Um servidor MCP pode acrescentar outras em tempo de execu&ccedil;&atilde;o.</p>
<div class="key"><span style="--c:var(--read)">read</span><span style="--c:var(--mut)">mutate</span><span style="--c:var(--des)">destructive</span></div>
<div class="tw"><table>
<tr><th>ferramenta</th><th>o que faz</th></tr>
<tr class="r"><td>read, search, list</td><td>Linhas numeradas com offset e limit, recusa bin&aacute;rios. Busca literal, no m&aacute;ximo 100 resultados. Lista um diret&oacute;rio.</td></tr>
<tr class="a"><td>write, edit</td><td>Grava um arquivo, com o diff na observa&ccedil;&atilde;o. Edit troca exatamente uma ocorr&ecirc;ncia; amb&iacute;guo &eacute; erro.</td></tr>
<tr class="x"><td>run</td><td>Um comando de shell. O c&oacute;digo de sa&iacute;da &eacute; uma observa&ccedil;&atilde;o.</td></tr>
<tr class="r"><td>websearch</td><td>Pesquisa na web.</td></tr>
<tr class="a"><td>webfetch</td><td>Busca uma URL.</td></tr>
<tr class="r"><td>folder_history</td><td>O que aconteceu por &uacute;ltimo neste diret&oacute;rio, para o modelo n&atilde;o ter de adivinhar.</td></tr>
<tr class="r"><td>skill_search, skill_load</td><td>Encontra skills instaladas, l&ecirc; uma inteira. Nada &eacute; pr&eacute;-carregado.</td></tr>
<tr class="r"><td>memory_search</td><td>Suas mem&oacute;rias em um servidor mem0, separadas por usu&aacute;rio.</td></tr>
<tr class="a"><td>memory_add</td><td>Guarda um fato.</td></tr>
<tr class="x"><td>delegate, delegate_parallel, delegate_submit, delegate_retry</td><td>Passa trabalho a outro modelo: uma tarefa, v&aacute;rias ao mesmo tempo, como job em segundo plano, ou repete uma falha.</td></tr>
<tr class="r"><td>delegate_list, delegate_jobs, delegate_result, delegate_due</td><td>Lista delegados, mostra jobs, busca um resultado, mostra o que est&aacute; vencido.</td></tr>
<tr class="x"><td>task_start, task_kill</td><td>Roda um comando de shell em segundo plano (quatro por vez) ou o interrompe.</td></tr>
<tr class="r"><td>task_list, task_result</td><td>Jobs em segundo plano e sua sa&iacute;da.</td></tr>
<tr class="a"><td>plan_task_add, plan_task_update</td><td>Uma lista de tarefas persistente da sess&atilde;o.</td></tr>
<tr class="r"><td>plan_task_list</td><td>L&ecirc; essa lista.</td></tr>
<tr class="x"><td>tmux_start</td><td>Inicia um comando em uma sess&atilde;o tmux separada e a torna o alvo.</td></tr>
<tr class="a"><td>tmux_send, tmux_ask</td><td>Digita nele (texto ou teclas como C-c), espera sa&iacute;da nova e devolve s&oacute; as linhas novas.</td></tr>
<tr class="r"><td>tmux_status, tmux_capture, tmux_read</td><td>Olha o painel e l&ecirc; o que &eacute; novo.</td></tr>
<tr class="x"><td>a2a_send, a2a_cancel_task</td><td>Escreve a outro agente (com arquivo, se quiser) ou cancela a tarefa dele.</td></tr>
<tr class="r"><td>a2a_get_task, a2a_subscribe</td><td>L&ecirc; a tarefa de outro agente e seus eventos.</td></tr>
<tr class="r"><td>echo, clock</td><td>Pequenos utilit&aacute;rios.</td></tr>
</table></div>
<h2>O que e</h2>
<p>splinter e um harness de agente em C99/POSIX: um programa que segura a
conversa, decide quais ferramentas existem, quem pode usa-las e o que ficou
registrado. O modelo e um detalhe trocavel; o harness e a parte que sabe o que
acontece.</p>
<h2 id="models">Modelos</h2>
<p>Um transporte traduz o protocolo de linhas simples do harness para o que o outro lado fala. O loop nunca v&ecirc; uma API de fabricante; por isso o <code>make check</code> roda contra um mock com roteiro, sem rede e sem chave.</p>
<dl>
<dt>openai</dt><dd>Qualquer endpoint compat&iacute;vel com a OpenAI, streaming por SSE. O HTTP passa pelo <code>curl(1)</code>.</dd>
<dt>cli</dt><dd>Qualquer programa como modelo, por exemplo <code>claude -p</code>.</dd>
<dt>a2a</dt><dd>Outro agente via A2A.</dd>
<dt>ring</dt><dd>Um anel de sa&iacute;das. Em um 429 ou limite, a pr&oacute;xima sa&iacute;da configurada assume.</dd>
</dl>
<h3>Delega&ccedil;&atilde;o</h3>
<p>O modelo pode passar trabalho a outro modelo. O splinter escolhe: uma tag pedida vale 5, uma tag no texto da tarefa vale 3, uma palavra da descri&ccedil;&atilde;o do delegado vale 1. A observa&ccedil;&atilde;o come&ccedil;a com a escolha e o motivo, ent&atilde;o uma escolha errada fica vis&iacute;vel.</p>
<pre><span class="d"># ~/.splinter/splinter.conf.d/20-delegates.conf</span>
delegate = coder | C99, POSIX, revis&atilde;o | tags=code,c99 | endpoint=... | model=...
delegate = quick | respostas curtas | tags=chat,cheap | endpoint=... | model=...
<h2>Como se parece</h2>
<pre><span class="u">voce:</span> por que o build falha?
<span class="d">pensando:</span> preciso ler o erro antes de opinar.
<span class="u">ferramenta:</span> search {"pattern":"error","path":"build/logs"}
<span class="u">ferramenta:</span> read {"path":"build/logs/last.log"}
<span class="d">alteracao:</span> -CFLAGS = -O2
<span class="d"> </span> +CFLAGS = -O2 -Wall -Werror
<span class="u">modelo:</span> faltava -Werror; o erro era um aviso promovido.</pre>
<p>Pensamento, ferramenta com argumentos, alteracao e resposta entram no
transcript na ordem em que acontecem.</p>
<h2>Tres verificacoes antes de cada ferramenta</h2>
<p>Orcamento, registro e classe de autorizacao. A ferramenta declara a classe
(read, mutate, destructive) - nunca o modelo, nunca o prompt. Um plugin pode
entrar na frente com um gate: permitir, negar com motivo, ou nao opinar.</p>
<h2>Ferramentas</h2>
<p>27 ferramentas: <code>read</code>, <code>write</code>, <code>edit</code>,
<code>search</code>, <code>list</code>, <code>run</code>, <code>folder_history</code>,
<code>delegate</code>, <code>delegate_parallel</code>, as de leitura do sistema e as de
skills, memoria e pesquisa na web.</p>
<h2>Transportes e plugins</h2>
<p>Transporte e um vtable: openai (HTTP/SSE), cli (claude, opencode), a2a
(outro agente via JSON-RPC, com streaming), mock para teste. Plugins sao <code>.so</code>
carregados com dlopen: lcm, focus, reminder, ring, mcp, cli, a2a, clock, cps,
kids, tasks, planner, provider, scheduler, status e tmux.</p>
<h2>Delegacao: outros modelos, splinter escolhe</h2>
<span class="u">$</span> splinter --choose "verifique este c&oacute;digo C quanto a erros de mem&oacute;ria"
coder 7 task mentions 'code'</pre>
<p><code>delegate_parallel</code> envia at&eacute; oito tarefas ao mesmo tempo. O relat&oacute;rio mostra, por tarefa, quem respondeu, quanto demorou e o c&oacute;digo de sa&iacute;da; um delegado lento ou quebrado aparece no cabe&ccedil;alho.</p>
<pre>[parallel: 2 task(s), 12018 ms wall]
## task 1 | model slow | score 5 | 12018 ms | exit 0 | 75 B
## task 2 | model fast | score 5 | 16 ms | exit 0 | 74 B</pre>
<p>Um delegado pode nomear um <code>host=</code>. A chamada inteira vai ent&atilde;o por ssh, e claude, opencode ou outro splinter roda onde est&aacute; o modelo ou a rede &mdash; com as chaves daquela m&aacute;quina.</p>
<pre>delegate = remote | em outra m&aacute;quina | tags=remote | host=build.example.org | endpoint=... | model=...</pre>
## task 1 | model slow | score 5 | 12018 ms | exit 0 | 75 B | requested tag 'slow'</pre>
<p>Modelo, duracao e status por tarefa - um delegado lento aparece no cabecalho
antes de alguem ler o texto.</p>
<h2 id="plugins">Plugins</h2>
<p>Um plugin &eacute; um <code>.so</code> carregado com dlopen. Ele pode registrar ferramentas, comandos com barra, widgets da barra lateral, transportes e gates. O tick de um widget roda em thread pr&oacute;pria; s&oacute; a thread da UI desenha. A ABI est&aacute; em <code>docs/PLUGINS.md</code>. Plugins rodam no processo com os seus direitos.</p>
<div class="cols"><ul>
<li><b>lcm</b>, <b>cps</b>: comprimem a conversa</li>
<li><b>focus</b>: lembra o <code>/goal</code> a cada N turnos</li>
<li><b>reminder</b>: repõe as regras b&aacute;sicas a cada 10 turnos</li>
<li><b>ring</b>: pr&oacute;xima sa&iacute;da em 429 ou limite</li>
<li><b>mcp</b>, <b>a2a</b>, <b>cli</b>: alcan&ccedil;am outras ferramentas e agentes</li>
<li><b>provider</b>: adiciona um provedor em execu&ccedil;&atilde;o</li>
</ul><ul>
<li><b>tasks</b>: jobs de shell em segundo plano</li>
<li><b>planner</b>: a lista de tarefas da sess&atilde;o</li>
<li><b>tmux</b>: controla um programa que quer um terminal</li>
<li><b>scheduler</b>: trabalho agendado</li>
<li><b>status</b>: contexto, tokens por segundo, custo se voc&ecirc; definir pre&ccedil;os</li>
<li><b>kids</b>: modo crian&ccedil;a</li>
<li><b>clock</b>: rel&oacute;gio na barra lateral e uma ferramenta</li>
</ul></div>
<h2>Configuracao</h2>
<pre>endpoint = http://kontron.local:8080/v1/chat/completions
model = ...
autonomous = 1</pre>
<p><code>~/.splinter/splinter.conf</code> mais <code>splinter.conf.d/*.conf</code>
em ordem de nome. Chave desconhecida e erro com numero de linha.</p>
<h2 id="agents">Outros agentes, nos dois sentidos</h2>
<h3>MCP</h3>
<p>Como cliente, o splinter busca as ferramentas de um servidor MCP com os esquemas dele. Como servidor, oferece as suas:</p>
<pre><span class="u">$</span> splinter --mcp-server-listen 127.0.0.1 --mcp-listen-port 8098</pre>
<p>Responde a <code>initialize</code>, <code>tools/list</code> e <code>tools/call</code>. Ferramentas de leitura s&atilde;o atendidas. As que alteram ou destroem s&oacute; rodam com <code>--autonomous</code>; um agente estranho n&atilde;o ganha um shell s&oacute; por pedir.</p>
<h3>A2A</h3>
<pre><span class="u">$</span> SPLINTER_A2A_SERVER_TOKEN=... splinter --a2a-server-listen 127.0.0.1 --a2a-listen-port 8099</pre>
<ul>
<li><code>POST /a2a</code> aceita <code>SendMessage</code>, <code>SendStreamingMessage</code> (SSE), <code>GetTask</code>, <code>ListTasks</code> e <code>SubscribeToTask</code>. O agent card fica em <code>/.well-known/agent-card.json</code>.</li>
<li>Um <code>contextId</code> &eacute; uma conversa. Sem ele, o servidor cria um e o devolve.</li>
<li>Uma ferramenta que altera pausa a tarefa como <code>INPUT_REQUIRED</code>. Uma chamada seguinte com <code>taskId</code> e <code>yes</code> ou <code>no</code> continua. <code>CancelTask</code> interrompe.</li>
<li>Uma config de push envia a tarefa conclu&iacute;da a um webhook (loopback ou hosts de <code>SPLINTER_A2A_PUSH_ALLOW</code>).</li>
<li>Partes de arquivo bin&aacute;rio caem em <code>inbox/</code> e o modelo recebe o caminho. Partes de URL s&oacute; s&atilde;o buscadas de hosts permitidos.</li>
<li>Fora do loopback, um token Bearer &eacute; obrigat&oacute;rio.</li>
<li>Como cliente, <code>a2a_send</code> pode anexar um arquivo e <code>a2a_subscribe</code> l&ecirc; os eventos de uma tarefa remota.</li>
</ul>
<h2>Gateway: Telegram</h2>
<p><code>splinter --daemon</code> fala Telegram com indicador de digitacao e os
mesmos slash commands do terminal. O bot registra seus comandos: o menu mostra os comandos dos plugins carregados
e os programas em <code>~/.splinter/commands/</code>; uma aprovacao chega com
botoes Sim/Nao; as respostas viram HTML do Telegram (negrito, codigo, links,
tabelas em bloco monoespaceado, imagens como foto (inclusive arquivos locais), outros arquivos como documento). <code>/new</code> comeca uma conversa nova; <code>/model</code> lista os modelos
configurados em botoes, troca o transporte e guarda a escolha em
<code>splinter.conf.d/90-model.conf</code>; <code>/model probe</code> pergunta
aos endpoints por <code>/v1/models</code>. <code>/connect</code> pergunta nome,
endpoint, modelo e variavel da chave, faz um turno de teste e grava o provedor
em <code>splinter.conf.d/20-connect.conf</code>.</p>
<h2 id="telegram">Telegram</h2>
<p><code>splinter --daemon</code> faz long-polling de <code>getUpdates</code>, roda um turno por mensagem e responde com os mesmos comandos de barra do terminal. O token vem de um arquivo 0600 ou do ambiente, nunca de um argumento. S&oacute; os IDs de usu&aacute;rio listados em <code>telegram_allow</code> recebem resposta.</p>
<ul>
<li>O consentimento chega como bot&otilde;es Sim/N&atilde;o. A resposta em texto <code>ok &lt;id&gt;</code> continua valendo.</li>
<li><code>/model</code> alterna entre modelos configurados; <code>/model probe</code> pergunta aos endpoints por <code>/v1/models</code>. <code>/connect</code> pergunta nome, endpoint, modelo e vari&aacute;vel da chave, faz um turno de teste e grava o provedor em <code>splinter.conf.d</code>. <code>/new</code> come&ccedil;a uma conversa nova. <code>/interview</code> faz as perguntas de configura&ccedil;&atilde;o no chat.</li>
<li>As respostas saem como HTML do Telegram: negrito, it&aacute;lico, c&oacute;digo, links, cita&ccedil;&otilde;es e tabelas em colunas monoespa&ccedil;adas. Imagens markdown viram fotos, outros arquivos locais viram documentos. Um trecho que o Telegram n&atilde;o consegue interpretar sai como texto, em vez de se perder.</li>
<li>Programas em <code>~/.splinter/commands/</code> viram <code>/nome</code> e aparecem no menu do bot.</li>
</ul>
<h3>Modo crian&ccedil;a</h3>
<p>Com o plugin <code>kids</code>, toda altera&ccedil;&atilde;o precisa da aprova&ccedil;&atilde;o de um respons&aacute;vel pelo Telegram, uma lista branca deixa passar o inofensivo, o modelo &eacute; lembrado de um tom adequado &agrave; idade a cada pedido, e um limite di&aacute;rio de minutos encerra o dia quando acaba.</p>
<h2>O que fica registrado</h2>
<p>Cada sessao escreve <code>session.log</code> (eventos legiveis) e
<code>wire.jsonl</code> (o que foi de fato enviado ao modelo).</p>
<h2>Compilar</h2>
<pre>make
make check <span class="d"># 35 binarios de teste, i18n, site</span></pre>
<p>Sem dependencias alem de libc e pthread; ncurses vem do vendor.</p>
<h2>O que nao e</h2>
<ul><li>nao e um modelo;</li><li>nao e um servico - e um programa;</li>
<li>nao guarda nada em sqlite: sessoes sao arquivos;</li>
<li>nao adivinha: mede.</li></ul>
<h2>A frota</h2>
<pre>delegate = olivia | em olivia | tags=remote | host=172.25.206.16 |
endpoint=http://172.25.206.2:18082/v1/chat/completions | model=...</pre>
<p>O delegate nomeia um host e a chamada inteira vai por ssh; a maquina remota
poe suas proprias chaves.</p>
<h2>As duas direcoes: MCP</h2>
<pre><span class="u">$</span> splinter --mcp-server-listen 0.0.0.0 --mcp-listen-port 8098
splinter: MCP server on 0.0.0.0:8098 (27 tools, read only)</pre>
<p>Como cliente busca ferramentas; como servidor oferece as suas. Mutar so com
<code>--autonomous</code>.</p>
<h2>Pipe, pasta, primeira conversa</h2>
<h2 id="files">Configura&ccedil;&atilde;o, logs, formas de entrar</h2>
<pre><span class="d"># ~/.splinter/splinter.conf (mais splinter.conf.d/*.conf, em ordem de nome)</span>
endpoint = http://127.0.0.1:8080/v1/chat/completions
model = my-model
locale = pt_BR
theme = Delphinium
telegram_allow = 123456789
plugin = plugins/lcm/lcm.so</pre>
<p>Simplesmente <code>key = value</code>. Uma chave desconhecida interrompe a partida com arquivo e linha, porque um erro de digita&ccedil;&atilde;o que n&atilde;o faz nada &eacute; uma configura&ccedil;&atilde;o que mente. Linha de comando vence arquivo, que vence o padr&atilde;o.</p>
<pre><span class="d">~/.splinter/logs/&lt;sess&atilde;o&gt;/session.log</span> leg&iacute;vel, em ordem
<span class="d">~/.splinter/logs/&lt;sess&atilde;o&gt;/wire.jsonl</span> cada requisi&ccedil;&atilde;o e resposta, cruas</pre>
<p>Suas palavras, o racioc&iacute;nio, cada chamada de ferramenta com argumentos, cada observa&ccedil;&atilde;o, erros e contagem de tokens. Nada cortado, porque um log que guarda s&oacute; o que foi bom n&atilde;o explica um turno ruim.</p>
<pre><span class="u">$</span> cat /etc/passwd | splinter "explique o arquivo"
<span class="u">$</span> cd ~/src/splinter &amp;&amp; splinter -c
<span class="u">$</span> splinter --interview</pre>
<p>stdin vira contexto; <code>-c</code> pega a ultima sessao daquele diretorio;
<code>--interview</code> escreve o perfil em
<code>~/.splinter/profile/&lt;usuario&gt;.md</code>.</p>
<span class="u">$</span> cd ~/src/projeto &amp;&amp; splinter -c <span class="d"># a &uacute;ltima sess&atilde;o que aconteceu AQUI</span>
<span class="u">$</span> splinter --interview <span class="d"># uma vez: idioma, estilo, caminhos proibidos</span></pre>
<p>A entrada padr&atilde;o vira contexto delimitado e com tamanho limitado. Skills ficam em <code>~/.splinter/skills/</code> e s&atilde;o encontradas sob demanda. Quando v&aacute;rios splinters rodam no mesmo diret&oacute;rio, <code>/swarm</code> manda uma linha ao menos ocupado. A interface tem 42 paletas de cores CDE e est&aacute; traduzida para alem&atilde;o, ingl&ecirc;s e portugu&ecirc;s do Brasil; uma tradu&ccedil;&atilde;o faltando faz o <code>make check</code> falhar.</p>
<h2>Modo crianca</h2>
<p>Com o plugin <code>kids</code>, toda acao que muda algo precisa da aprovacao de
um adulto (Telegram), uma lista branca libera o inofensivo, o modelo e lembrado a
cada pedido de manter a conversa adequada a idade, e um limite diario de minutos
fecha o dia quando acaba.</p>
<h2>As duas direcoes: A2A</h2>
<p>Como cliente, splinter busca outro agente via A2A; como servidor, oferece a
si mesmo:</p>
<pre><span class="u">$</span> SPLINTER_A2A_SERVER_TOKEN=... splinter --a2a-server-listen 127.0.0.1 --a2a-listen-port 8099
splinter: A2A server on 127.0.0.1:8099 (token required)</pre>
<p><code>POST /a2a</code> aceita <code>SendMessage</code>, <code>SendStreamingMessage</code>
(SSE), <code>GetTask</code> e <code>ListTasks</code> em JSON-RPC; o agent card fica em
<code>/.well-known/agent-card.json</code>. Um <code>contextId</code> e uma conversa;
sem ele o servidor cria um e devolve. Uma <code>taskPushNotificationConfig</code>
envia a tarefa concluida para um webhook (loopback ou
<code>SPLINTER_A2A_PUSH_ALLOW</code>); configs de push podem ser gerenciadas por
CRUD e URLs text/plain sao buscadas de hosts permitidos. Uma ferramenta mutante pausa como
<code>INPUT_REQUIRED</code>; um acompanhamento com <code>taskId</code> e
<code>yes</code>/<code>no</code> continua. Fora do loopback o token Bearer e obrigatorio.</p>
<hr>
<p id="foot">splinter - C99/POSIX, BSD-3-Clause. Manual: <code>man ./docs/splinter.1</code> &middot; ABI de plugins: <code>docs/PLUGINS.md</code></p>
<h2 id="build">Compilar</h2>
<pre><span class="u">$</span> make <span class="d"># libsplinter.so, o bin&aacute;rio, os plugins</span>
<span class="u">$</span> make check <span class="d"># 35 programas de teste, testes de shell, checagem de i18n; sem rede, sem modelo</span>
<span class="u">$</span> splinter</pre>
<p>make POSIX e um compilador C99, <code>-Wall -Wextra -Werror</code>. O curses do NetBSD est&aacute; na &aacute;rvore. Em execu&ccedil;&atilde;o, o splinter chama o <code>curl(1)</code> para HTTP. Manual: <code>man ./docs/splinter.1</code>.</p>
<h2 id="not">O que n&atilde;o &eacute;</h2>
<ul>
<li>N&atilde;o &eacute; um modelo. N&atilde;o traz nenhum e n&atilde;o escolhe um por voc&ecirc;.</li>
<li>N&atilde;o &eacute; uma nuvem. Fala com os endpoints que voc&ecirc; configura.</li>
<li>N&atilde;o &eacute; um sandbox. As classes protegem voc&ecirc; do modelo, n&atilde;o de c&oacute;digo que voc&ecirc; mesmo carrega.</li>
</ul>
<footer>splinter, BSD-3-Clause. ABI de plugins: <code>docs/PLUGINS.md</code>. Configura&ccedil;&atilde;o: <code>docs/CONFIG.md</code>.</footer>
</main>
</div>
</body>
</html>
-700
View File
@@ -1,700 +0,0 @@
#!/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 re
import sys
ROOT = pathlib.Path(__file__).resolve().parent.parent
OUT = ROOT / "src" / "www"
LANGS = ["de", "en", "pt_BR"]
FILES = {"de": "index.html", "en": "index.en.html",
"pt_BR": "index.pt.html"}
# The page states sizes and counts. They are counted here, from the tree, so a
# new test, plugin or tool cannot leave a number behind that was true last week.
def _c_lines(root):
return sum(len(p.read_text(encoding="utf-8").splitlines())
for p in sorted(root.rglob("*"))
if p.is_file() and p.suffix in (".c", ".h"))
def counts():
plugins = [p for p in (ROOT / "plugins").iterdir()
if p.is_dir() and any(p.glob("*.c"))]
tests = list((ROOT / "tests").glob("test_*.c"))
palettes = (ROOT / "src" / "palettes.c").read_text(encoding="utf-8")
tools = set()
for p in (list((ROOT / "src").glob("*.c")) +
list((ROOT / "plugins").glob("*/*.c"))):
tools.update(re.findall(r'\.name = "([a-z0-9_]+)"',
p.read_text(encoding="utf-8")))
return {
"N_LINES": (_c_lines(ROOT / "src") + _c_lines(ROOT / "include") +
_c_lines(ROOT / "plugins")),
"N_TOOLS": len(tools),
"N_TESTS": len(tests),
"N_PLUGINS": len(plugins),
"N_THEMES": len(re.findall(r'^\s*\{ "', palettes, re.M)),
}
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>@@N_LINES@@</b> {{m_lines}} &middot;
<b>@@N_TOOLS@@</b> {{m_tools}} &middot; <b>@@N_TESTS@@</b> {{m_tests}} &middot;
<b>@@N_PLUGINS@@</b> {{m_plugins}} &middot; <b>@@N_THEMES@@</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">a2a</td><td>{d_a2a}</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> &middot; <a href=\"index.pt.html\">Portugues (BR)</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_tools": "Werkzeuge",
"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_tools": "tools",
"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.",
},
}
T["pt_BR"] = {
"title": "splinter - um harness de agente que e seu",
"desc": "splinter e um harness de agente em C99/POSIX: chat no terminal, ferramentas com classes de autorizacao, plugins, qualquer endpoint compativel com OpenAI, gateway Telegram.",
"langbar": "<a href=\"index.html\">Deutsch</a> &middot; <a href=\"index.en.html\">English</a> &middot; Portugues (BR)",
"lead": "Um harness de agente que e seu: chat no terminal, ferramentas com "
"classes de autorizacao, plugins, qualquer modelo que fale OpenAI - "
"escrito por nos para poder mudar-lo, em vez de nos acostumar com o "
"comportamento de um cliente alheio.",
"m_lines": "linhas C99/POSIX", "m_tools": "ferramentas",
"m_tests": "programas de teste", "m_plugins": "plugins", "m_themes": "paletas",
"foot": "splinter - C99/POSIX, BSD-3-Clause. Manual: <code>man ./docs/splinter.1</code>"
" &middot; ABI de plugins: <code>docs/PLUGINS.md</code>",
}
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_a2a="ein anderer Agent ueber A2A (SendMessage/Streaming, Text)",
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>Der Bot registriert seine Befehle: das Menue zeigt die geladenen Plugin-Befehle und die Programme in <code>~/.splinter/commands/</code>; eine Zustimmung kommt mit Ja/Nein-Knoepfen. <code>/interview</code> stellt die Fragen im Chat. <code>/new</code> faengt eine frische Konversation an; <code>/model</code> bietet die konfigurierten Modelle als Knoepfe, schaltet den Transport um und merkt die Wahl in <code>splinter.conf.d/90-model.conf</code>; <code>/model probe</code> fragt die Endpoints nach <code>/v1/models</code>. <code>/connect</code> fragt Name, Endpoint, Modell und Key-Variable ab, macht einen Test-Turn und schreibt den Provider nach <code>splinter.conf.d/20-connect.conf</code>. Antworten werden als Telegram-HTML gesetzt: fett, kursiv, Code und Links als Tags, Bilder als Foto (<code>sendPhoto</code>, auch lokale Dateien), andere Dateien als Dokument, Tabellen als Spalten im Monospace-Block; ein Stueck, das Telegram nicht parst, geht als Text raus statt verloren. Programme in <code>commands/</code> antworten dort direkt im Chat; im TUI gehen sie ans Modell.</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="klein, nichts ausser libc und curses",
c_check="@@N_TESTS@@ 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_a2a="another agent over A2A (SendMessage/streaming, text)",
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>The bot registers its commands: the menu shows the loaded plugins' commands and the programs in <code>~/.splinter/commands/</code>; an approval arrives with Yes/No buttons. <code>/interview</code> asks the questions in the chat. <code>/new</code> starts a fresh conversation; <code>/model</code> offers the configured models as buttons, switches the transport and remembers the choice in <code>splinter.conf.d/90-model.conf</code>; <code>/model probe</code> asks the endpoints for <code>/v1/models</code>. <code>/connect</code> asks for name, endpoint, model and key variable, runs one test turn and writes the provider to <code>splinter.conf.d/20-connect.conf</code>. Answers are rendered as Telegram HTML: bold, italic, code and links as tags, images as photos (<code>sendPhoto</code>, local files too), other files as documents, tables as columns in a monospace block; a piece Telegram cannot parse goes out as text instead of being lost. Programs in <code>commands/</code> answer in the chat; in the TUI their output goes to the model.</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="small, nothing but libc and curses",
c_check="@@N_TESTS@@ 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>"),
],
}
# Sections added after the first version: the fleet, both directions of MCP, and
# the three small ways in (pipe, folder, first talk).
SECTIONS["de"] += [
"""<h2>Die Flotte</h2>
<p>Ein Delegate darf einen Host nennen. Dann geht der ganze Aufruf ueber ssh, und
claude, opencode oder ein zweiter splinter laufen dort, wo das Modell oder das
Netz ist:</p>
<pre>delegate = olivia | auf olivia | tags=remote | host=172.25.206.16 |
endpoint=http://172.25.206.2:18082/v1/chat/completions | model=...</pre>
<p><code>delegate_parallel</code> schickt bis zu acht Aufgaben gleichzeitig los
und berichtet zurueck, wer was geliefert hat:</p>
<pre>[parallel: 2 task(s), 12018 ms wall]
## task 1 | model slow | score 5 | 12018 ms | exit 0 | 75 B | requested tag 'slow'
## task 2 | model fast | score 5 | 16 ms | exit 0 | 74 B | requested tag 'fast'
## summary
- slow: 1 task(s), 12018 ms total
- fast: 1 task(s), 16 ms total</pre>
<p>Modell, Dauer und Status pro Aufgabe &mdash; ein lahmer oder kaputter Delegate
ist in der Kopfzeile sichtbar, bevor jemand seinen Text liest.</p>""",
"""<h2>Beide Richtungen: MCP</h2>
<p>Als Client holt splinter die Werkzeuge eines MCP-Servers. Als Server stellt es
seine eigenen hin:</p>
<pre><span class="u">$</span> splinter --mcp-server-listen 0.0.0.0 --mcp-listen-port 8098
splinter: MCP server on 0.0.0.0:8098 (@@N_TOOLS@@ tools, read only)</pre>
<p>Ein anderer Agent bekommt <code>initialize</code>, <code>tools/list</code> und
<code>tools/call</code>. Lesende Werkzeuge werden bedient, mutierende und
destruktive nur mit <code>--autonomous</code> &mdash; ein fremder Agent fuehrt hier
keine Shell aus, weil er freundlich fragt.</p>""",
"""<h2>Pipe, Ordner, Erstgespraech</h2>
<pre><span class="u">$</span> cat /etc/passwd | splinter "erklaer die Datei"
<span class="u">$</span> cd ~/src/splinter &amp;&amp; splinter -c <span class="d"># die letzte Session, die HIER war</span>
<span class="u">$</span> splinter --interview <span class="d"># einmal: Sprache, Stil, heilige Pfade</span></pre>
<p>Standardeingabe wird zu Kontext, markiert und groessenbegrenzt;
<code>folder_history</code> erzaehlt dem Modell, was in einem Verzeichnis passiert
ist, statt es raten zu lassen; das Profil aus dem Interview liegt in
<code>~/.splinter/profile/&lt;user&gt;.md</code>.</p>""",
"""<h2>Beide Richtungen: A2A</h2>
<p>Als Client holt splinter einen anderen Agenten ueber A2A; als Server stellt es
sich selbst hin:</p>
<pre><span class="u">$</span> SPLINTER_A2A_SERVER_TOKEN=... splinter --a2a-server-listen 127.0.0.1 --a2a-listen-port 8099
splinter: A2A server on 127.0.0.1:8099 (token required)</pre>
<p><code>POST /a2a</code> nimmt <code>SendMessage</code>, <code>SendStreamingMessage</code>
(SSE), <code>GetTask</code> und <code>ListTasks</code> als JSON-RPC; die Agent Card liegt unter
<code>/.well-known/agent-card.json</code>. Ein <code>contextId</code> ist eine
Konversation; ohne eines legt der Server eins an und gibt es zurueck. Eine
<code>taskPushNotificationConfig</code> schickt den fertigen Task an einen
Webhook (Loopback oder <code>SPLINTER_A2A_PUSH_ALLOW</code>); Push-Configs
lassen sich per CRUD verwalten, text/plain-URLs werden von erlaubten Hosts
geholt; binaere <code>file</code>/<code>raw</code>-Teile landen im
<code>inbox/</code> und das Modell bekommt den Pfad. Ein mutierendes Werkzeug pausiert als
<code>INPUT_REQUIRED</code>; ein Folgeaufruf mit <code>taskId</code> und
<code>yes</code>/<code>no</code> setzt fort; <code>SubscribeToTask</code>
schickt den Zustand einmal und schliesst den Stream; als Client liest
<code>a2a_subscribe</code> die Ereignisse eines fremden Tasks als Text, und
<code>a2a_send</code> haengt eine Datei (base64) an eine Nachricht. Jenseits von
Loopback ist der Bearer-Token Pflicht.</p>""",
]
SECTIONS["en"] += [
"""<h2>The fleet</h2>
<p>A delegate may name a host. The whole invocation then goes through ssh, so
claude, opencode or another splinter run where the model or the network is:</p>
<pre>delegate = olivia | on olivia | tags=remote | host=172.25.206.16 |
endpoint=http://172.25.206.2:18082/v1/chat/completions | model=...</pre>
<p><code>delegate_parallel</code> sends up to eight tasks at once and reports back
who delivered what:</p>
<pre>[parallel: 2 task(s), 12018 ms wall]
## task 1 | model slow | score 5 | 12018 ms | exit 0 | 75 B | requested tag 'slow'
## task 2 | model fast | score 5 | 16 ms | exit 0 | 74 B | requested tag 'fast'
## summary
- slow: 1 task(s), 12018 ms total
- fast: 1 task(s), 16 ms total</pre>
<p>Model, duration and status per task &mdash; a slow or failing delegate is visible
in the header before anybody reads its prose.</p>""",
"""<h2>Both directions: MCP</h2>
<p>As a client splinter fetches an MCP server's tools. As a server it offers its
own:</p>
<pre><span class="u">$</span> splinter --mcp-server-listen 0.0.0.0 --mcp-listen-port 8098
splinter: MCP server on 0.0.0.0:8098 (@@N_TOOLS@@ tools, read only)</pre>
<p>Another agent gets <code>initialize</code>, <code>tools/list</code> and
<code>tools/call</code>. Read tools are served; mutating and destructive ones only
with <code>--autonomous</code> &mdash; a foreign agent does not run shell commands
here because it asked nicely.</p>""",
"""<h2>Pipe, folder, first talk</h2>
<pre><span class="u">$</span> cat /etc/passwd | splinter "explain the file"
<span class="u">$</span> cd ~/src/splinter &amp;&amp; splinter -c <span class="d"># the last session that happened HERE</span>
<span class="u">$</span> splinter --interview <span class="d"># once: language, style, sacred paths</span></pre>
<p>Standard input becomes context, framed and size-capped;
<code>folder_history</code> tells the model what happened in a directory instead
of letting it guess; the profile from the interview lives in
<code>~/.splinter/profile/&lt;user&gt;.md</code>.</p>""",
"""<h2>Both directions: A2A</h2>
<p>As a client splinter fetches another agent over A2A; as a server it offers
itself:</p>
<pre><span class="u">$</span> SPLINTER_A2A_SERVER_TOKEN=... splinter --a2a-server-listen 127.0.0.1 --a2a-listen-port 8099
splinter: A2A server on 127.0.0.1:8099 (token required)</pre>
<p><code>POST /a2a</code> takes <code>SendMessage</code>, <code>SendStreamingMessage</code>
(SSE), <code>GetTask</code> and <code>ListTasks</code> as JSON-RPC; the agent card lives at
<code>/.well-known/agent-card.json</code>. A <code>contextId</code> is a
conversation; without one the server makes one and returns it. A
<code>taskPushNotificationConfig</code> posts the completed task to a webhook
(loopback or <code>SPLINTER_A2A_PUSH_ALLOW</code>); push configs can be managed
with CRUD and text/plain URLs are fetched from allowed hosts; binary
<code>file</code>/<code>raw</code> parts land in the <code>inbox/</code> and the
model is told the path. A mutating tool pauses as
<code>INPUT_REQUIRED</code>; a follow-up with <code>taskId</code> and
<code>yes</code>/<code>no</code> resumes; <code>SubscribeToTask</code> sends
the state once and ends the stream; on the client side <code>a2a_subscribe</code>
reads a remote task's events as text and <code>a2a_send</code> attaches a file
(base64) to a message. Beyond loopback the bearer token is
required.</p>""",
]
SECTIONS["pt_BR"] = [
"""<h2>O que e</h2>
<p>splinter e um harness de agente em C99/POSIX: um programa que segura a
conversa, decide quais ferramentas existem, quem pode usa-las e o que ficou
registrado. O modelo e um detalhe trocavel; o harness e a parte que sabe o que
acontece.</p>""",
"""<h2>Como se parece</h2>
<pre><span class="u">voce:</span> por que o build falha?
<span class="d">pensando:</span> preciso ler o erro antes de opinar.
<span class="u">ferramenta:</span> search {"pattern":"error","path":"build/logs"}
<span class="u">ferramenta:</span> read {"path":"build/logs/last.log"}
<span class="d">alteracao:</span> -CFLAGS = -O2
<span class="d"> </span> +CFLAGS = -O2 -Wall -Werror
<span class="u">modelo:</span> faltava -Werror; o erro era um aviso promovido.</pre>
<p>Pensamento, ferramenta com argumentos, alteracao e resposta entram no
transcript na ordem em que acontecem.</p>""",
"""<h2>Tres verificacoes antes de cada ferramenta</h2>
<p>Orcamento, registro e classe de autorizacao. A ferramenta declara a classe
(read, mutate, destructive) - nunca o modelo, nunca o prompt. Um plugin pode
entrar na frente com um gate: permitir, negar com motivo, ou nao opinar.</p>""",
"""<h2>Ferramentas</h2>
<p>@@N_TOOLS@@ ferramentas: <code>read</code>, <code>write</code>, <code>edit</code>,
<code>search</code>, <code>list</code>, <code>run</code>, <code>folder_history</code>,
<code>delegate</code>, <code>delegate_parallel</code>, as de leitura do sistema e as de
skills, memoria e pesquisa na web.</p>""",
"""<h2>Transportes e plugins</h2>
<p>Transporte e um vtable: openai (HTTP/SSE), cli (claude, opencode), a2a
(outro agente via JSON-RPC, com streaming), mock para teste. Plugins sao <code>.so</code>
carregados com dlopen: lcm, focus, reminder, ring, mcp, cli, a2a, clock, cps,
kids, tasks, planner, provider, scheduler, status e tmux.</p>""",
"""<h2>Delegacao: outros modelos, splinter escolhe</h2>
<pre>[parallel: 2 task(s), 12018 ms wall]
## task 1 | model slow | score 5 | 12018 ms | exit 0 | 75 B | requested tag 'slow'</pre>
<p>Modelo, duracao e status por tarefa - um delegado lento aparece no cabecalho
antes de alguem ler o texto.</p>""",
"""<h2>Configuracao</h2>
<pre>endpoint = http://kontron.local:8080/v1/chat/completions
model = ...
autonomous = 1</pre>
<p><code>~/.splinter/splinter.conf</code> mais <code>splinter.conf.d/*.conf</code>
em ordem de nome. Chave desconhecida e erro com numero de linha.</p>""",
"""<h2>Gateway: Telegram</h2>
<p><code>splinter --daemon</code> fala Telegram com indicador de digitacao e os
mesmos slash commands do terminal. O bot registra seus comandos: o menu mostra os comandos dos plugins carregados
e os programas em <code>~/.splinter/commands/</code>; uma aprovacao chega com
botoes Sim/Nao; as respostas viram HTML do Telegram (negrito, codigo, links,
tabelas em bloco monoespaceado, imagens como foto (inclusive arquivos locais), outros arquivos como documento). <code>/new</code> comeca uma conversa nova; <code>/model</code> lista os modelos
configurados em botoes, troca o transporte e guarda a escolha em
<code>splinter.conf.d/90-model.conf</code>; <code>/model probe</code> pergunta
aos endpoints por <code>/v1/models</code>. <code>/connect</code> pergunta nome,
endpoint, modelo e variavel da chave, faz um turno de teste e grava o provedor
em <code>splinter.conf.d/20-connect.conf</code>.</p>""",
"""<h2>O que fica registrado</h2>
<p>Cada sessao escreve <code>session.log</code> (eventos legiveis) e
<code>wire.jsonl</code> (o que foi de fato enviado ao modelo).</p>""",
"""<h2>Compilar</h2>
<pre>make
make check <span class="d"># @@N_TESTS@@ binarios de teste, i18n, site</span></pre>
<p>Sem dependencias alem de libc e pthread; ncurses vem do vendor.</p>""",
"""<h2>O que nao e</h2>
<ul><li>nao e um modelo;</li><li>nao e um servico - e um programa;</li>
<li>nao guarda nada em sqlite: sessoes sao arquivos;</li>
<li>nao adivinha: mede.</li></ul>""",
"""<h2>A frota</h2>
<pre>delegate = olivia | em olivia | tags=remote | host=172.25.206.16 |
endpoint=http://172.25.206.2:18082/v1/chat/completions | model=...</pre>
<p>O delegate nomeia um host e a chamada inteira vai por ssh; a maquina remota
poe suas proprias chaves.</p>""",
"""<h2>As duas direcoes: MCP</h2>
<pre><span class="u">$</span> splinter --mcp-server-listen 0.0.0.0 --mcp-listen-port 8098
splinter: MCP server on 0.0.0.0:8098 (@@N_TOOLS@@ tools, read only)</pre>
<p>Como cliente busca ferramentas; como servidor oferece as suas. Mutar so com
<code>--autonomous</code>.</p>""",
"""<h2>Pipe, pasta, primeira conversa</h2>
<pre><span class="u">$</span> cat /etc/passwd | splinter "explique o arquivo"
<span class="u">$</span> cd ~/src/splinter &amp;&amp; splinter -c
<span class="u">$</span> splinter --interview</pre>
<p>stdin vira contexto; <code>-c</code> pega a ultima sessao daquele diretorio;
<code>--interview</code> escreve o perfil em
<code>~/.splinter/profile/&lt;usuario&gt;.md</code>.</p>""",
"""<h2>Modo crianca</h2>
<p>Com o plugin <code>kids</code>, toda acao que muda algo precisa da aprovacao de
um adulto (Telegram), uma lista branca libera o inofensivo, o modelo e lembrado a
cada pedido de manter a conversa adequada a idade, e um limite diario de minutos
fecha o dia quando acaba.</p>""",
"""<h2>As duas direcoes: A2A</h2>
<p>Como cliente, splinter busca outro agente via A2A; como servidor, oferece a
si mesmo:</p>
<pre><span class="u">$</span> SPLINTER_A2A_SERVER_TOKEN=... splinter --a2a-server-listen 127.0.0.1 --a2a-listen-port 8099
splinter: A2A server on 127.0.0.1:8099 (token required)</pre>
<p><code>POST /a2a</code> aceita <code>SendMessage</code>, <code>SendStreamingMessage</code>
(SSE), <code>GetTask</code> e <code>ListTasks</code> em JSON-RPC; o agent card fica em
<code>/.well-known/agent-card.json</code>. Um <code>contextId</code> e uma conversa;
sem ele o servidor cria um e devolve. Uma <code>taskPushNotificationConfig</code>
envia a tarefa concluida para um webhook (loopback ou
<code>SPLINTER_A2A_PUSH_ALLOW</code>); configs de push podem ser gerenciadas por
CRUD e URLs text/plain sao buscadas de hosts permitidos. Uma ferramenta mutante pausa como
<code>INPUT_REQUIRED</code>; um acompanhamento com <code>taskId</code> e
<code>yes</code>/<code>no</code> continua. Fora do loopback o token Bearer e obrigatorio.</p>""",
]
SECTIONS["de"].append(
"""<h2>Kindermodus</h2>
<p>Mit dem Plugin <code>kids</code> braucht jede Aenderung die Zustimmung eines
Erwachsenen (Telegram), eine Whitelist laesst das Harmlose durch, das Modell wird
bei jeder Anfrage an einen altersgerechten Ton erinnert, und ein Tageskontingent
an Minuten beendet den Tag, wenn es aufgebraucht ist.</p>""")
SECTIONS["en"].append(
"""<h2>Kid mode</h2>
<p>With the <code>kids</code> plugin every change needs a parent's approval
(Telegram), a whitelist lets the harmless ones through, the model is reminded of an
age-appropriate tone on every request, and a daily minute budget ends the day when
it is spent.</p>""")
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)
for key, value in counts().items():
html = html.replace("@@%s@@" % key, str(value))
if "{{" in html:
leftover = html[html.index("{{"):html.index("{{") + 40]
raise SystemExit("gen_www: unfilled placeholder: %s" % leftover)
m = re.search(r"@@N_[A-Z_]+@@", html)
if m is not None:
raise SystemExit("gen_www: unfilled count: %s" % m.group(0))
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:]))