diff --git a/README.md b/README.md
index b8867c2..3fa8db0 100644
--- a/README.md
+++ b/README.md
@@ -253,7 +253,7 @@ processes that share a working directory — not A2A, and not a network protocol
splinter --interview
-Seven questions - language, who you are, stack, answering style, what never to
+Six questions - language, who you are, stack, answering style, what never to
do, which paths are sacred - written to `~/.splinter/profile/.md`. 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.
@@ -290,15 +290,17 @@ A bot cannot start a conversation - the user has to write first, otherwise the
API answers `chat not found`. That is Telegram, not the harness.
The bot registers the commands that actually exist with `setMyCommands`:
-`/start`, `/help`, every command a loaded plugin registers (`/goal`, `/recap`,
-`/tasks`, `/quota`, `/tmux`, ...) and every program in
+`/start`, `/help`, `/interview`, every command a loaded plugin registers
+(`/goal`, `/recap`, `/tasks`, `/quota`, `/tmux`, ...) and every program in
`~/.splinter/commands/` whose name is a valid Telegram command (lower-case,
digits, underscore, at most 32). `/start` and `/help` answer with the short
text plus that live list. An approval arrives as a message with **Yes/No
buttons**; the callback answers the button, removes the buttons and writes the
ack file. The text form `ok ` / `no ` still works.
-A program in `commands/` answers in the chat: its output is the reply. In the
+`/interview` asks the same six questions as `splinter --interview`, one
+message per answer; `/skip` skips one and `/cancel` stops. A program in
+`commands/` answers in the chat: its output is the reply. In the
TUI the same program's output becomes context for the model instead. A typo
such as `/nosuch` is answered with the command list, not sent to the model.
diff --git a/TODO.md b/TODO.md
index ba57d2a..e9efa65 100644
--- a/TODO.md
+++ b/TODO.md
@@ -48,9 +48,10 @@ Naechster Schritt: entscheiden, ob die npm-Reste weg duerfen. Kein Code.
`/tmp/opencode/ack-proof.txt`. Das installierte `~/.splinter/bin/tg-ask` war
eine alte Kopie ohne Tokenpfad und wurde durch `tools/tg-ask.sh` ersetzt.
- **Telegram-Menue und Knoepfe**: `setMyCommands` registriert dynamisch
- `/start`, `/help`, alle Befehle der geladenen Plugins und alle Programme in
- `~/.splinter/commands/` mit gueltigem Telegram-Namen; `/start` und `/help`
- listen sie im Chat. Zustimmungen kommen mit Ja/Nein-Knoepfen; `callback_query`
+ `/start`, `/help`, `/interview`, alle Befehle der geladenen Plugins und alle
+ Programme in `~/.splinter/commands/` mit gueltigem Telegram-Namen; `/start`
+ und `/help` listen sie im Chat. `/interview` stellt die sechs Fragen im Chat
+ und schreibt das Profil; `/skip` und `/cancel` gehoeren dazu. Zustimmungen kommen mit Ja/Nein-Knoepfen; `callback_query`
prueft denselben Allow-List-Eintrag, antwortet, entfernt die Knoepfe und legt
die Antwortdatei ab. Der Textweg `ok ` bleibt. Programme in
`commands/` antworten im Telegram-Chat direkt (im TUI gehen sie ans Modell);
diff --git a/docs/PLUGINS.md b/docs/PLUGINS.md
index aaa1914..d13237e 100644
--- a/docs/PLUGINS.md
+++ b/docs/PLUGINS.md
@@ -223,7 +223,9 @@ Ein Timeout ist ein Nein. Stille ist keine Zustimmung.
Das Telegram-Gateway registriert seine Befehle beim Start: die der geladenen
Plugins, die Programme in `~/.splinter/commands/` mit gueltigem Telegram-Namen
-und `/start`/`/help`; `/help` listet sie im Chat. Die Anfrage selbst legt es als
+und `/start`, `/help`, `/interview`; `/help` listet sie im Chat. `/interview`
+stellt dieselben sechs Fragen wie `splinter --interview` im Chat, `/skip`
+ueberspringt eine, `/cancel` bricht ab. Die Anfrage selbst legt es als
Nachricht mit **Ja/Nein-Knoepfen** vor.
Der Knopf ist ein `callback_query`, kein Text: das Gateway prueft denselben
Allow-List-Eintrag, antwortet dem Knopf, entfernt die Knoepfe und legt die
diff --git a/share/locale/de.msg b/share/locale/de.msg
index 4db00c2..9e7c8e3 100644
--- a/share/locale/de.msg
+++ b/share/locale/de.msg
@@ -102,3 +102,11 @@ tg.help = Ich bin splinter. Schreib eine Nachricht fuer einen Turn. /goal setzt
ack.yes = Ja
ack.no = Nein
ack.how = Antwort: Knopf unten oder ok %d / no %d
+
+tg.cmd.interview = Profil im Chat anlegen
+tg.interview.start = Erstes Gespraech fuer '%s'. Ich stelle %zu Fragen; /skip ueberspringt eine, /cancel bricht ab.
+tg.interview.question = Frage %zu/%zu: %s
+tg.interview.how = Antworte einfach in den Chat.
+tg.interview.saved = Profil geschrieben: %s
+tg.interview.cancel = Interview abgebrochen.
+tg.interview.busy = Das Interview laeuft; antworte, /skip oder /cancel.
diff --git a/share/locale/en.msg b/share/locale/en.msg
index 1192dbf..580794b 100644
--- a/share/locale/en.msg
+++ b/share/locale/en.msg
@@ -101,3 +101,11 @@ tg.help = I am splinter. Send a message for a turn. /goal sets the goal, /recap
ack.yes = Yes
ack.no = No
ack.how = Answer: button below or ok %d / no %d
+
+tg.cmd.interview = create the profile in the chat
+tg.interview.start = First conversation for '%s'. I ask %zu questions; /skip skips one, /cancel stops.
+tg.interview.question = Question %zu/%zu: %s
+tg.interview.how = Just answer in the chat.
+tg.interview.saved = profile written: %s
+tg.interview.cancel = interview cancelled.
+tg.interview.busy = The interview is running; answer, /skip or /cancel.
diff --git a/share/locale/pt_BR.msg b/share/locale/pt_BR.msg
index efd99e8..6a674e5 100644
--- a/share/locale/pt_BR.msg
+++ b/share/locale/pt_BR.msg
@@ -105,3 +105,11 @@ tg.help = Eu sou o splinter. Envie uma mensagem para um turno. /goal define a me
ack.yes = Sim
ack.no = Nao
ack.how = Resposta: botao abaixo ou ok %d / no %d
+
+tg.cmd.interview = criar o perfil no chat
+tg.interview.start = Primeira conversa para '%s'. Sao %zu perguntas; /skip pula uma, /cancel cancela.
+tg.interview.question = Pergunta %zu/%zu: %s
+tg.interview.how = Responda no chat.
+tg.interview.saved = perfil escrito: %s
+tg.interview.cancel = entrevista cancelada.
+tg.interview.busy = A entrevista esta em andamento; responda, /skip ou /cancel.
diff --git a/src/interview.c b/src/interview.c
index 2a5de09..2dcfb23 100644
--- a/src/interview.c
+++ b/src/interview.c
@@ -48,6 +48,72 @@ static const struct question questions[] = {
{ NULL, NULL, NULL }
};
+#define INTERVIEW_MAX 16
+
+size_t
+sp_interview_count(void)
+{
+ size_t i;
+
+ for (i = 0; questions[i].key != NULL; i++)
+ ;
+ return i;
+}
+
+const char *
+sp_interview_prompt(size_t i)
+{
+ return i < sp_interview_count() ? questions[i].prompt : NULL;
+}
+
+const char *
+sp_interview_hint(size_t i)
+{
+ return i < sp_interview_count() ? questions[i].hint : NULL;
+}
+
+/*
+ * Write the profile from answers collected by a front end. A short answer list
+ * (Ctrl-D, /cancel after a few questions) still writes what was answered; a
+ * missing answer is recorded as "not answered", not as an empty line.
+ */
+int
+sp_interview_save(const char *session_dir, const char *const *answers, size_t n,
+ struct sp_buf *err)
+{
+ char dir[600], path[700];
+ const char *user = sp_memory_user();
+ FILE *f;
+ size_t i, max = sp_interview_count();
+
+ if (sp_profile_path(session_dir, dir, sizeof(dir)) == NULL) {
+ sp_buf_puts(err, "interview: no session directory");
+ return -1;
+ }
+ (void)mkdir(dir, 0700);
+ snprintf(path, sizeof(path), "%s/%s.md", dir, user);
+ f = fopen(path, "w");
+ if (f == NULL) {
+ sp_buf_printf(err, "interview: cannot write %s", path);
+ return -1;
+ }
+ fprintf(f, "# Profile: %s\n\n", user);
+ fprintf(f, "_Written by `splinter --interview`. Edit it by hand whenever you "
+ "like; splinter reads it at start._\n\n");
+ if (n > max)
+ n = max;
+ for (i = 0; i < n; i++) {
+ fprintf(f, "## %s\n", questions[i].key);
+ if (answers == NULL || answers[i] == NULL ||
+ answers[i][0] == '\0')
+ fprintf(f, "(nicht beantwortet)\n\n");
+ else
+ fprintf(f, "%s\n\n", answers[i]);
+ }
+ fclose(f);
+ return 0;
+}
+
const char *
sp_profile_path(const char *session_dir, char *buf, size_t len)
{
@@ -72,45 +138,31 @@ sp_profile_exists(const char *session_dir)
int
sp_interview_run(const char *session_dir, struct sp_buf *err)
{
- char dir[600], path[700];
- const char *user = sp_memory_user();
- FILE *f;
- size_t i;
+ static char answers[INTERVIEW_MAX][ANSWER_MAX];
+ const char *ptrs[INTERVIEW_MAX];
+ char dir[600], path[700];
+ const char *user = sp_memory_user();
+ size_t i, n = sp_interview_count();
if (sp_profile_path(session_dir, dir, sizeof(dir)) == NULL) {
sp_buf_puts(err, "interview: no session directory");
return -1;
}
- (void)mkdir(dir, 0700);
snprintf(path, sizeof(path), "%s/%s.md", dir, user);
- f = fopen(path, "w");
- if (f == NULL) {
- sp_buf_printf(err, "interview: cannot write %s", path);
- return -1;
- }
- fprintf(f, "# Profile: %s\n\n", user);
- fprintf(f, "_Written by `splinter --interview`. Edit it by hand whenever you "
- "like; splinter reads it at start._\n\n");
-
+ if (n > INTERVIEW_MAX)
+ n = INTERVIEW_MAX;
printf("Erstes Gespraech fuer '%s'. Enter ueberspringt eine Frage, "
"Ctrl-D bricht ab.\n\n", user);
- for (i = 0; questions[i].key != NULL; i++) {
- char answer[ANSWER_MAX];
- size_t len;
-
+ for (i = 0; i < n; i++) {
printf("%s\n (%s)\n> ", questions[i].prompt, questions[i].hint);
fflush(stdout);
- if (fgets(answer, sizeof(answer), stdin) == NULL)
+ if (fgets(answers[i], sizeof(answers[i]), stdin) == NULL)
break;
- len = strcspn(answer, "\r\n");
- answer[len] = '\0';
- fprintf(f, "## %s\n", questions[i].key);
- if (len == 0)
- fprintf(f, "(nicht beantwortet)\n\n");
- else
- fprintf(f, "%s\n\n", answer);
+ answers[i][strcspn(answers[i], "\r\n")] = '\0';
+ ptrs[i] = answers[i];
}
- fclose(f);
+ if (sp_interview_save(session_dir, ptrs, i, err) != 0)
+ return -1;
printf("\nGeschrieben: %s\n", path);
return 0;
}
diff --git a/src/interview.h b/src/interview.h
index ee75f08..e7ff370 100644
--- a/src/interview.h
+++ b/src/interview.h
@@ -13,4 +13,11 @@ const char *sp_profile_path(const char *session_dir, char *buf, size_t len);
int sp_profile_exists(const char *session_dir);
int sp_interview_run(const char *session_dir, struct sp_buf *err);
+/* The same questions for a front end that is not a terminal (Telegram). */
+size_t sp_interview_count(void);
+const char *sp_interview_prompt(size_t i);
+const char *sp_interview_hint(size_t i);
+int sp_interview_save(const char *session_dir,
+ const char *const *answers, size_t n, struct sp_buf *err);
+
#endif /* SPLINTER_INTERVIEW_H */
diff --git a/src/telegram.c b/src/telegram.c
index af56b94..59b2ced 100644
--- a/src/telegram.c
+++ b/src/telegram.c
@@ -38,6 +38,7 @@
#include "mcp.h"
#include "log.h"
#include "cmdscript.h"
+#include "interview.h"
#include "splinter_plugin.h"
/*
@@ -382,6 +383,7 @@ tg_collect(struct sp_host *host, const char *sess_dir, struct tg_cmd *cmds,
tg_add_cmd(cmds, n, "start", tg_known_desc("start"));
tg_add_cmd(cmds, n, "help", tg_known_desc("help"));
+ tg_add_cmd(cmds, n, "interview", sp_t("tg.cmd.interview"));
if (sp_buf_init(&list) != 0)
return;
if (host != NULL) {
@@ -444,7 +446,7 @@ tg_help_text(struct sp_host *host, const char *sess_dir, struct sp_buf *out)
char dir[700];
sp_buf_puts(out, sp_t("tg.help"));
- sp_buf_puts(out, "\n\n/start /help ");
+ sp_buf_puts(out, "\n\n/start /help /interview ");
if (host != NULL)
(void)sp_host_command_help(host, out);
if (sp_cmdscript_dir(sess_dir, dir, sizeof(dir)) == 0 &&
@@ -505,6 +507,123 @@ static struct {
const char *allow;
} tg_cur;
+/*
+ * /interview in the chat: the same questions as `splinter --interview`, one
+ * message per answer. The state is per gateway process; a restart abandons a
+ * half-finished interview, as a closed terminal does.
+ */
+struct tg_interview {
+ int active;
+ long chat_id;
+ size_t step;
+ char answers[16][4096];
+};
+
+static struct tg_interview tg_iv;
+
+static int
+tg_interview_ask(const char *token, long chat_id, struct sp_buf *err)
+{
+ const char *q = sp_interview_prompt(tg_iv.step);
+ const char *h = sp_interview_hint(tg_iv.step);
+ struct sp_buf msg;
+
+ if (q == NULL)
+ return -1;
+ if (sp_buf_init(&msg) != 0)
+ return -1;
+ sp_buf_printf(&msg, sp_t("tg.interview.question"), tg_iv.step + 1,
+ sp_interview_count(), q);
+ if (h != NULL && *h != '\0')
+ sp_buf_printf(&msg, "\n (%s)", h);
+ sp_buf_puts(&msg, "\n");
+ sp_buf_puts(&msg, sp_t("tg.interview.how"));
+ (void)send_message(token, chat_id, msg.p, err);
+ sp_buf_free(&msg);
+ return 0;
+}
+
+static void
+tg_interview_begin(const char *token, long chat_id, struct sp_buf *err)
+{
+ struct sp_buf msg;
+
+ memset(&tg_iv, 0, sizeof(tg_iv));
+ tg_iv.active = 1;
+ tg_iv.chat_id = chat_id;
+ tg_iv.step = 0;
+ if (sp_buf_init(&msg) != 0)
+ return;
+ sp_buf_printf(&msg, sp_t("tg.interview.start"), sp_memory_user(),
+ sp_interview_count());
+ (void)send_message(token, chat_id, msg.p, err);
+ sp_buf_free(&msg);
+ (void)tg_interview_ask(token, chat_id, err);
+}
+
+static void
+tg_interview_end(const char *token, long chat_id, const char *session_dir,
+ struct sp_buf *err)
+{
+ const char *ptrs[16];
+ char dir[600], path[700];
+ struct sp_buf msg;
+ size_t i, n = tg_iv.step;
+
+ if (n > 16)
+ n = 16;
+ for (i = 0; i < n; i++)
+ ptrs[i] = tg_iv.answers[i];
+ if (sp_interview_save(session_dir, ptrs, n, err) == 0) {
+ path[0] = '\0';
+ if (sp_profile_path(session_dir, dir, sizeof(dir)) != NULL)
+ snprintf(path, sizeof(path), "%s/%s.md", dir,
+ sp_memory_user());
+ if (sp_buf_init(&msg) == 0) {
+ sp_buf_printf(&msg, sp_t("tg.interview.saved"), path);
+ (void)send_message(token, chat_id, msg.p, err);
+ sp_buf_free(&msg);
+ }
+ } else {
+ (void)send_message(token, chat_id,
+ err->p != NULL ? err->p : sp_t("err.turn_failed"), err);
+ }
+ memset(&tg_iv, 0, sizeof(tg_iv));
+}
+
+static void
+tg_interview_answer(const char *token, long chat_id, const char *text,
+ const char *session_dir, struct sp_buf *err)
+{
+ struct sp_buf msg;
+
+ if (strcmp(text, "/cancel") == 0) {
+ memset(&tg_iv, 0, sizeof(tg_iv));
+ if (sp_buf_init(&msg) == 0) {
+ sp_buf_puts(&msg, sp_t("tg.interview.cancel"));
+ (void)send_message(token, chat_id, msg.p, err);
+ sp_buf_free(&msg);
+ }
+ return;
+ }
+ if (text[0] == '/' && strcmp(text, "/skip") != 0) {
+ if (sp_buf_init(&msg) == 0) {
+ sp_buf_puts(&msg, sp_t("tg.interview.busy"));
+ (void)send_message(token, chat_id, msg.p, err);
+ sp_buf_free(&msg);
+ }
+ return;
+ }
+ if (tg_iv.step < 16)
+ snprintf(tg_iv.answers[tg_iv.step], sizeof(tg_iv.answers[0]),
+ "%s", strcmp(text, "/skip") == 0 ? "" : text);
+ tg_iv.step++;
+ if (tg_iv.step < sp_interview_count())
+ (void)tg_interview_ask(token, chat_id, err);
+ else
+ tg_interview_end(token, chat_id, session_dir, err);
+}
+
/*
* An inline keyboard answer: ack::yes|no. The button travels as a
* callback_query, not a message; the same allow list applies. The buttons are
@@ -810,8 +929,20 @@ sp_telegram_run(struct sp_agent *ag, struct sp_host *host, const char *token,
* reader of this chat, so it resolves here instead of letting a
* second poller fight it for updates.
*/
+ if (tg_iv.active && tg_iv.chat_id == chat_id) {
+ tg_interview_answer(token, chat_id, text,
+ ag->sess != NULL ? ag->sess->dir : NULL,
+ err);
+ sp_buf_clear(err);
+ continue;
+ }
if (tg_ack_reply(token, chat_id, text))
continue;
+ if (strcmp(text, "/interview") == 0) {
+ tg_interview_begin(token, chat_id, err);
+ sp_buf_clear(err);
+ continue;
+ }
if (strcmp(text, "/start") == 0 ||
strcmp(text, "/help") == 0) {
struct sp_buf help;
diff --git a/src/www/index.en.html b/src/www/index.en.html
index 3f2470b..2f85c32 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.
-24238 lines of C99/POSIX ·
+
24428 lines of C99/POSIX ·
23 tools · 31 test programs ·
16 plugins · 42 palettes · BSD-3-Clause
@@ -141,7 +141,7 @@ plugin = plugins/reminder/reminder.so
Gateway: Telegram
splinter --daemon long-polls getUpdates, one turn per message, answers with sendMessage. The token lives in ~/.splinter/telegram.token with mode 0600 and is never passed as an argument — arguments end up in ps. While a turn runs, the chat sees "typing" every four seconds.
-The bot registers its commands: the menu shows the loaded plugins' commands and the programs in ~/.splinter/commands/; an approval arrives with Yes/No buttons. Programs in commands/ answer in the chat; in the TUI their output goes to the model.
+The bot registers its commands: the menu shows the loaded plugins' commands and the programs in ~/.splinter/commands/; an approval arrives with Yes/No buttons. /interview asks the questions in the chat. Programs in commands/ answer in the chat; in the TUI their output goes to the model.
Slash commands work there too. Programs in ~/.splinter/commands/ become /name: they get the rest of the line as an argument, and their output goes to the model as context — not to you as a reply. That is how the model fetches what it cannot see itself.
What gets written down
diff --git a/src/www/index.html b/src/www/index.html
index 7ad2263..92e4937 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.
-24238 Zeilen C99/POSIX ·
+
24428 Zeilen C99/POSIX ·
23 Werkzeuge · 31 Test-Programme ·
16 Plugins · 42 Farbschemata · BSD-3-Clause
@@ -141,7 +141,7 @@ plugin = plugins/reminder/reminder.so
Gateway: Telegram
splinter --daemon pollt getUpdates, ein Turn pro Nachricht, Antwort per sendMessage. Der Token liegt in ~/.splinter/telegram.token mit Modus 0600 und wird nie als Argument uebergeben — Argumente stehen in ps. Waehrend eines Turns sieht der Chat alle vier Sekunden „typing“.
-Der Bot registriert seine Befehle: das Menue zeigt die geladenen Plugin-Befehle und die Programme in ~/.splinter/commands/; eine Zustimmung kommt mit Ja/Nein-Knoepfen. Programme in commands/ antworten dort direkt im Chat; im TUI gehen sie ans Modell.
+Der Bot registriert seine Befehle: das Menue zeigt die geladenen Plugin-Befehle und die Programme in ~/.splinter/commands/; eine Zustimmung kommt mit Ja/Nein-Knoepfen. /interview stellt die Fragen im Chat. Programme in commands/ antworten dort direkt im Chat; im TUI gehen sie ans Modell.
Slash-Kommandos funktionieren dort genauso. Programme in ~/.splinter/commands/ werden zu /name: sie bekommen den Rest der Zeile als Argument, und ihre Ausgabe geht ans Modell als Kontext — nicht an dich als Antwort. Damit holt sich das Modell, was es selbst nicht sehen kann.
Was mitgeschrieben wird
diff --git a/src/www/index.pt.html b/src/www/index.pt.html
index 6d1cfb6..54f5671 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.
-24238 linhas C99/POSIX ·
+
24428 linhas C99/POSIX ·
23 ferramentas · 31 programas de teste ·
16 plugins · 42 paletas · BSD-3-Clause
diff --git a/tests/fake_telegram.py b/tests/fake_telegram.py
index a98afca..f7f1379 100644
--- a/tests/fake_telegram.py
+++ b/tests/fake_telegram.py
@@ -84,6 +84,9 @@ class H(http.server.BaseHTTPRequestHandler):
if markup is not None:
f.write("markup: " + json.dumps(
markup, separators=(",", ":")) + "\n")
+ m = re.match(r"Frage (\d+)/", text)
+ if m:
+ add_update("antwort-%s" % m.group(1))
m = re.match(r"Zustimmung (\d+):", text)
if m:
add_update("was machst du?") # must be told to wait
diff --git a/tests/test_gateway.sh b/tests/test_gateway.sh
index 9c8b4cf..eabb42d 100755
--- a/tests/test_gateway.sh
+++ b/tests/test_gateway.sh
@@ -102,6 +102,14 @@ check "an unknown command is an error" \
grep -q '^unbekanntes Kommando: /nosuch' "$D/sent.log"
check "an unknown command does not start a model turn" test ! -e "$D/out.txt"
+# /interview asks the seven questions and writes the profile
+run_text "/interview" '^Profil geschrieben' 30
+prof=$(ls "$D/home/.splinter/profile/"*.md 2>/dev/null | head -1)
+check "the interview wrote a profile" test -n "$prof"
+check "the first answer is in the profile" grep -q 'antwort-1' "$prof"
+check "the last answer is in the profile" grep -q 'antwort-6' "$prof"
+check "the profile has the language section" grep -q '## language' "$prof"
+
if [ "$fails" -eq 0 ]; then echo "test_gateway: ok"; exit 0; fi
cat "$D/gw.out"
exit 1
diff --git a/tools/gen_www.py b/tools/gen_www.py
index 2a399a9..003ed79 100644
--- a/tools/gen_www.py
+++ b/tools/gen_www.py
@@ -305,7 +305,7 @@ SECTIONS = {
"sendMessage. Der Token liegt in "
"~/.splinter/telegram.token mit Modus 0600 und wird nie als Argument "
"uebergeben — Argumente stehen in ps. Waehrend eines Turns sieht der "
- "Chat alle vier Sekunden „typing“.
\nDer Bot registriert seine Befehle: das Menue zeigt die geladenen Plugin-Befehle und die Programme in ~/.splinter/commands/; eine Zustimmung kommt mit Ja/Nein-Knoepfen. Programme in commands/ antworten dort direkt im Chat; im TUI gehen sie ans Modell.
\nSlash-Kommandos funktionieren "
+ "Chat alle vier Sekunden „typing“.
\nDer Bot registriert seine Befehle: das Menue zeigt die geladenen Plugin-Befehle und die Programme in ~/.splinter/commands/; eine Zustimmung kommt mit Ja/Nein-Knoepfen. /interview stellt die Fragen im Chat. Programme in commands/ antworten dort direkt im Chat; im TUI gehen sie ans Modell.
\nSlash-Kommandos funktionieren "
"dort genauso. Programme in ~/.splinter/commands/ werden zu "
"/name: sie bekommen den Rest der Zeile als Argument, und ihre Ausgabe "
"geht ans Modell als Kontext — nicht an dich als Antwort. Damit holt sich "
@@ -385,7 +385,7 @@ SECTIONS = {
"sendMessage. The token lives in "
"~/.splinter/telegram.token with mode 0600 and is never passed as an "
"argument — arguments end up in ps. While a turn runs, the chat sees "
- ""typing" every four seconds.
\nThe bot registers its commands: the menu shows the loaded plugins' commands and the programs in ~/.splinter/commands/; an approval arrives with Yes/No buttons. Programs in commands/ answer in the chat; in the TUI their output goes to the model.
\nSlash commands work there too. "
+ ""typing" every four seconds.
\nThe bot registers its commands: the menu shows the loaded plugins' commands and the programs in ~/.splinter/commands/; an approval arrives with Yes/No buttons. /interview asks the questions in the chat. Programs in commands/ answer in the chat; in the TUI their output goes to the model.
\nSlash commands work there too. "
"Programs in ~/.splinter/commands/ become /name: they get "
"the rest of the line as an argument, and their output goes to the model as "
"context — not to you as a reply. That is how the model fetches what it cannot see "