Eingehende Ausloeser: n8n und andere starten Agenten (#725, Stufe 1)

Something outside hands an agent a task - an n8n workflow on a mail, a
schedule, a form, or any system that sends an HTTP request.

- Core/Triggers/InboundTriggers: one token per trigger and agent, kept as a
  hash and shown once; a rate per hour; deliveries up to 64 KB. Each
  delivery becomes a task whose content is framed as foreign content with its
  origin; every delivery, accepted or refused, is in the audit (source
  "trigger").
- POST /hooks/trigger on the instance (MCP socket, own token, no browsers);
  the manager forwards /hooks/{instance}/trigger. /api/triggers to issue,
  list and revoke.
- Agent view: a triggers card with the address and an n8n/curl example.
- Nothing writes back: no right to create or change workflows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Richard
2026-10-01 13:19:05 +02:00
co-authored by Claude Opus 5.5
parent 47a20913b0
commit 73565eff18
14 changed files with 607 additions and 5 deletions
@@ -373,6 +373,28 @@ public sealed class SqliteStorage
PRIMARY KEY (VoteId, Voter)
);
-- #725: inbound triggers (token kept as hash) and every delivery, accepted or not.
CREATE TABLE IF NOT EXISTS InboundTriggers (
Id TEXT PRIMARY KEY,
Label TEXT NOT NULL,
AgentId TEXT NOT NULL,
TokenHash TEXT NOT NULL UNIQUE,
PerHour INTEGER NOT NULL,
CreatedAt TEXT NOT NULL,
RevokedAt TEXT NULL
);
CREATE TABLE IF NOT EXISTS InboundTriggerEvents (
Id INTEGER PRIMARY KEY AUTOINCREMENT,
TriggerId TEXT NOT NULL,
ReceivedAt TEXT NOT NULL,
Outcome TEXT NOT NULL,
Bytes INTEGER NOT NULL,
TaskId TEXT NULL
);
CREATE INDEX IF NOT EXISTS IX_InboundTriggerEvents_Trigger ON InboundTriggerEvents (TriggerId, ReceivedAt);
CREATE TABLE IF NOT EXISTS StagedCalls (
Id INTEGER PRIMARY KEY AUTOINCREMENT,
RunId TEXT NOT NULL,