diff --git a/Makefile b/Makefile index 9f0fa14..ee98178 100644 --- a/Makefile +++ b/Makefile @@ -218,6 +218,7 @@ check: $(LIB) $(BIN) $(PLUGIN) $(TESTS) export LD_LIBRARY_PATH=.; \ for t in $(TESTS); do echo "== $$t"; ./$$t; done; \ echo "== tests/test_delegate_cli.sh"; sh tests/test_delegate_cli.sh; \ + echo "== tests/test_interview.sh"; sh tests/test_interview.sh; \ echo "== tests/test_gateway.sh"; sh tests/test_gateway.sh; \ echo "== tests/test_a2a.sh"; sh tests/test_a2a.sh; \ echo "== tests/test_a2a_ui.sh"; sh tests/test_a2a_ui.sh; \ diff --git a/README.md b/README.md index 3fa8db0..844a67b 100644 --- a/README.md +++ b/README.md @@ -254,7 +254,9 @@ processes that share a working directory — not A2A, and not a network protocol splinter --interview Six questions - language, who you are, stack, answering style, what never to -do, which paths are sacred - written to `~/.splinter/profile/.md`. Enter +do, which paths are sacred - written to `~/.splinter/profile/.md`. The +questions come from the catalogue: the default is English, `locale = de` (or +`SPLINTER_LOCALE`) makes them German. Enter skips a question and the skip is recorded as such: an empty line would be a lie. Starting the chat without a profile prints a hint, once. diff --git a/src/main.c b/src/main.c index 2414d96..6e799bc 100644 --- a/src/main.c +++ b/src/main.c @@ -605,6 +605,9 @@ run_delegate_cli(const struct sp_registry *reg, const char *id, static int check_usage(const struct opts *o) { + /* these answer files or ask questions; none of them runs a model */ + if (o->ack_id > 0 || o->acklist || o->interview) + return 0; if ((o->endpoint != NULL) + (o->script != NULL) + (o->transport != NULL) > 1) { fprintf(stderr, "splinter: choose one transport\n"); diff --git a/src/www/index.en.html b/src/www/index.en.html index 7ebe115..8917e04 100644 --- a/src/www/index.en.html +++ b/src/www/index.en.html @@ -53,7 +53,7 @@ hr { border: 0; border-top: 1px solid #1d2126; margin: 3em 0 1.5em 0; }

splinter_

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.

-

24430 lines of C99/POSIX · +

24433 lines of C99/POSIX · 23 tools · 31 test programs · 16 plugins · 42 palettes · BSD-3-Clause

diff --git a/src/www/index.html b/src/www/index.html index ca0aff3..e039699 100644 --- a/src/www/index.html +++ b/src/www/index.html @@ -53,7 +53,7 @@ hr { border: 0; border-top: 1px solid #1d2126; margin: 3em 0 1.5em 0; }

splinter_

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.

-

24430 Zeilen C99/POSIX · +

24433 Zeilen C99/POSIX · 23 Werkzeuge · 31 Test-Programme · 16 Plugins · 42 Farbschemata · BSD-3-Clause

diff --git a/src/www/index.pt.html b/src/www/index.pt.html index c46272a..2c14923 100644 --- a/src/www/index.pt.html +++ b/src/www/index.pt.html @@ -53,7 +53,7 @@ hr { border: 0; border-top: 1px solid #1d2126; margin: 3em 0 1.5em 0; }

splinter_

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.

-

24430 linhas C99/POSIX · +

24433 linhas C99/POSIX · 23 ferramentas · 31 programas de teste · 16 plugins · 42 paletas · BSD-3-Clause

diff --git a/tests/test_interview.sh b/tests/test_interview.sh new file mode 100755 index 0000000..5c12abc --- /dev/null +++ b/tests/test_interview.sh @@ -0,0 +1,34 @@ +#!/bin/sh +# splinter -- the first-run interview from the terminal. +# +# No transport is needed; the questions come from the catalogue (English here), +# and the answers are written to profile/.md. The six answers also prove +# that a skipped question (the empty line) is recorded as such. +set -u +cd "$(dirname "$0")/.." || exit 1 +D=$(mktemp -d "${TMPDIR:-/var/tmp}/splinter-iv-XXXXXX") || exit 1 +cleanup() { rm -rf "$D"; } +trap cleanup EXIT +fails=0 +check() { # $1 = description, $2.. = command + d=$1; shift + if "$@"; then :; else echo "FAIL $d"; fails=$((fails + 1)); fi +} + +out=$(printf 'english\nabout me\nC99\n\nno commits\n/home/carol\n' | \ + HOME="$D" SPLINTER_LOCALE=en ./splinter --no-config \ + --session "$D/sess" --interview 2>&1) +check "the interview needs no transport" test $? -eq 0 +echo "$out" | grep -q 'First conversation' +check "the questions are in the process language" test $? -eq 0 +echo "$out" | grep -q 'Which language should I speak' +check "the language question is English" test $? -eq 0 + +prof=$(ls "$D/sess/profile/"*.md 2>/dev/null | head -1) +check "the profile was written" test -n "$prof" +check "the first answer is in the profile" grep -q 'english' "$prof" +check "the skipped question is not a lie" grep -q '(not answered)' "$prof" +check "the last section is in the profile" grep -q '## paths' "$prof" + +if [ "$fails" -eq 0 ]; then echo "test_interview: ok"; exit 0; fi +exit 1