www: describe the harness that exists now, not the kernel it started as
The old page described a loop. The page now shows the layout (chat three quarters, sidebar one), the plugin ABI with its threading table, the theme derivation from CDE palettes, and the limits - including that a plugin is not sandboxed.
This commit is contained in:
1 parent
e4f910cc4e
commit
424209141b
1 file changed
+76
-39
+76
-39
@@ -3,17 +3,21 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<title>splinter — a small C99/POSIX agent harness</title>
|
||||
<meta name="description" content="splinter runs one turn of an agent loop against a transport, with a tool registry and explicit authorization classes.">
|
||||
<title>splinter — an agent harness with a curses UI</title>
|
||||
<meta name="description" content="splinter is a C99/POSIX agent harness: chat on three quarters of the terminal, a sidebar on one quarter, plugins that add tools and widgets.">
|
||||
<style type="text/css">
|
||||
body { background: #0d0d0d; color: #d8d8d8; font-family: "DejaVu Sans Mono", monospace;
|
||||
max-width: 46em; margin: 4em auto; padding: 0 1em; line-height: 1.55; }
|
||||
max-width: 52em; margin: 4em auto; padding: 0 1em; line-height: 1.55; }
|
||||
h1 { color: #f0f0f0; font-size: 1.6em; border-bottom: 1px solid #333; padding-bottom: .4em; }
|
||||
h2 { color: #b9b9b9; font-size: 1.1em; margin-top: 2.2em; }
|
||||
a { color: #7fb2ff; }
|
||||
pre { background: #151515; border-left: 3px solid #333; padding: .8em; overflow-x: auto; }
|
||||
pre { background: #151515; border-left: 3px solid #333; padding: .8em; overflow-x: auto;
|
||||
color: #cfd6dd; }
|
||||
code { color: #e6c07b; }
|
||||
.dim { color: #777; }
|
||||
table { border-collapse: collapse; margin: .5em 0; }
|
||||
th, td { text-align: left; padding: .2em .8em .2em 0; border-bottom: 1px solid #222; }
|
||||
th { color: #b9b9b9; }
|
||||
ul { padding-left: 1.2em; }
|
||||
</style>
|
||||
</head>
|
||||
@@ -21,23 +25,36 @@
|
||||
|
||||
<h1>splinter</h1>
|
||||
|
||||
<p class="dim">a small C99/POSIX agent harness — no runtime, no SDK, no database</p>
|
||||
<p class="dim">agent harness · C99/POSIX · curses UI · plugins · no runtime, no SDK, no database</p>
|
||||
|
||||
<p>
|
||||
splinter runs one turn of an agent loop against a transport. It sends a prompt,
|
||||
executes the tools the transport asks for, and prints the final answer. Every
|
||||
turn is appended to a session log as JSON Lines.
|
||||
splinter is the program you sit in front of. It talks to a model, runs the
|
||||
tools the model asks for, and shows you what happened — in a terminal, on three
|
||||
quarters of the screen, with a sidebar on the rest.
|
||||
</p>
|
||||
|
||||
<h2>Why it exists</h2>
|
||||
<pre><code>+---------------------------------+------------+
|
||||
| history | sidebar |
|
||||
| you: which files changed? | session |
|
||||
| agent: three, all in src/ | transport |
|
||||
| | theme |
|
||||
| | last turn |
|
||||
| | widgets |
|
||||
+---------------------------------+------------+
|
||||
| splinter 0.1.0 Delphinium 38ms |
|
||||
+-----------------------------------------------+</code></pre>
|
||||
|
||||
<h2>Run it</h2>
|
||||
<pre><code>$ make
|
||||
$ make check
|
||||
$ ./splinter --chat --plugin plugins/clock/clock.so --script replies.txt</code></pre>
|
||||
<p>
|
||||
Because a harness that hides its state cannot be debugged. splinter keeps three
|
||||
things visible at all times: the request it sent, the tools it ran, and the
|
||||
records it wrote. It does not own a model, a UI, or a network stack — those are
|
||||
transports.
|
||||
Seven test binaries drive the real loop through a mock transport: no network,
|
||||
no key, no model. The plugin test loads the real <code>clock.so</code> with
|
||||
<code>dlopen</code> and checks that its worker thread published.
|
||||
</p>
|
||||
|
||||
<h2>Rules it enforces before any tool runs</h2>
|
||||
<h2>Rules the loop enforces</h2>
|
||||
<ul>
|
||||
<li>the request fits the byte budget, otherwise nothing is sent at all;</li>
|
||||
<li>the tool exists in the registry, otherwise the model is told it does not;</li>
|
||||
@@ -45,38 +62,58 @@ transports.
|
||||
tools ask the operator unless autonomy was granted;</li>
|
||||
<li>a denial is the observation the model receives, never a silent skip.</li>
|
||||
</ul>
|
||||
|
||||
<h2>Build</h2>
|
||||
<pre><code>$ make
|
||||
$ make check</code></pre>
|
||||
<p>Five test binaries drive the loop through a deterministic mock transport:
|
||||
no network, no key, no model.</p>
|
||||
|
||||
<h2>Use</h2>
|
||||
<pre><code>$ printf 'tool echo ping\nanswer finished\n' > /tmp/r.txt
|
||||
$ splinter -p "test run" --script /tmp/r.txt
|
||||
finished
|
||||
|
||||
$ splinter -p "list the C files" --endpoint http://127.0.0.1:8080/turn</code></pre>
|
||||
|
||||
<h2>Protocol</h2>
|
||||
<pre><code>request user <text>
|
||||
request observe <tool> <output>
|
||||
reply answer <text>
|
||||
reply tool <name> <arguments></code></pre>
|
||||
<p>
|
||||
A provider adapter translates an OpenAI-compatible endpoint into this shape and
|
||||
back. The harness never parses vendor JSON — which is exactly why the loop can
|
||||
be tested with no network at all.
|
||||
The model never decides whether a tool may run. The registry and the class do.
|
||||
A plugin can add tools, but not change that rule.
|
||||
</p>
|
||||
|
||||
<h2>Plugins</h2>
|
||||
<p>
|
||||
A plugin is a shared object against <code>libsplinter.so</code>, exporting one
|
||||
symbol:
|
||||
</p>
|
||||
<pre><code>const struct sp_plugin *sp_plugin_describe(void);</code></pre>
|
||||
<p>
|
||||
It can register <b>tools</b> (with the authorization classes above) and
|
||||
<b>widgets</b> that appear in the sidebar. A widget's <code>tick()</code> runs on
|
||||
its own thread and may block; it publishes text with
|
||||
<code>sp_host_widget_text()</code> and never touches curses. Only the UI thread
|
||||
draws.
|
||||
</p>
|
||||
<table>
|
||||
<tr><th>hook</th><th>thread</th><th>may block</th></tr>
|
||||
<tr><td>init()</td><td>main</td><td>no</td></tr>
|
||||
<tr><td>run()</td><td>main</td><td>yes</td></tr>
|
||||
<tr><td>tick()</td><td>its own</td><td>yes</td></tr>
|
||||
<tr><td>draw()</td><td>UI</td><td>no</td></tr>
|
||||
</table>
|
||||
<p>
|
||||
A wrong ABI number is refused with both numbers in the message. A failed
|
||||
<code>init()</code> is reported and skipped. Nothing is
|
||||
<code>dlclose()</code>d while a thread might still be inside it.
|
||||
</p>
|
||||
|
||||
<h2>Themes</h2>
|
||||
<p>
|
||||
Colours come from CDE's own palette files — 42 of them, converted by a
|
||||
generator, not invented. The eight colour sets of a palette become roles by
|
||||
measurement: darkest is the background, lightest the foreground, the second
|
||||
darkest the border, the most saturated the accent. Default: <b>Delphinium</b>.
|
||||
</p>
|
||||
<pre><code>$ ./splinter --list-themes | head -3
|
||||
Alpine
|
||||
Arizona
|
||||
BeigeRose</code></pre>
|
||||
|
||||
<h2>What it is not</h2>
|
||||
<p>
|
||||
Not a chat UI. Not a model. Not a plugin platform. It is the part in the middle
|
||||
that decides whether a tool may run, and writes down what happened.
|
||||
Not a model, not a plugin marketplace, not a sandbox. A plugin runs with your
|
||||
rights; the authorization classes protect the harness from the model, not from
|
||||
code you chose to load.
|
||||
</p>
|
||||
|
||||
<p class="dim">Manual page: <code>man ./docs/splinter.1</code> · Source: <code>src/</code> · License: BSD-3-Clause</p>
|
||||
<p class="dim">Manual: <code>man ./docs/splinter.1</code> ·
|
||||
Plugin ABI: <code>docs/PLUGINS.md</code> · License: BSD-3-Clause</p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in new issue
Block a user