Files
Skald-Circle/default.config.yaml
T
dguiducci bcd8f7b5c0 feat(mcp): connector marketplace + split the Connectors surface (§7/§14/§15)
Fills a gap the blueprint names: the admin had to hand-author every
`mcp_catalog` entry. A remote feed of vetted connectors now proposes them
and the admin installs — the feed is *consultative*, so §14's risk axis is
untouched and the trust anchor stays on the box.

Marketplace client (`src/frontend/api/marketplace.rs`):
- Fetches the feed server-side (it sends no CORS headers) and caches it;
  icons are proxied for the same reason.
- Verifies every declared SHA-256 before writing, fail-closed and
  all-or-nothing. Feed-supplied paths are refused if they escape
  `./scripts/<id>/`. Importing an `mcp_local` entry still demands the
  admin-only `mcp.register_local_script`.
- Translates the feed's vocabulary into Skald's: `user`→`per_user`,
  `mcp_local`→`local_script`. Scope is read, never inferred from transport
  (a remote connector can be per-user — that is what `mcp.register_remote`
  is for), and an unreadable `type` fails closed to the answer needing more
  authority. The feed's `llm_short_description` maps to `description`, the
  column `render_mcp_list` puts in front of the LLM for `activate_tools()`.
- Feed URL is config (`marketplace.url`), not a constant: an on-premise
  product must not hard-require reaching one vendor's host.

Two silent failures found while wiring it:
- `transport_of` maps anything unknown to Stdio, so the feed's
  `streamable-http` would have tried to spawn a command. Normalised on import.
- Some servers want their key as a query param, not a bearer header, and say
  so with a `{key}` placeholder. Substituted at connect time in
  `global_row_spec`/`user_row_spec` — never at rest, so the key stays in its
  own column and the stored URL stays a template.

Pages, split by the question each answers:
- Connectors — what runs (`UserMcpView` = global ∪ per-user) and what I can
  add. Same page for everyone; the admin just has more verbs. One Available
  list with the verb per row: `per_user`→Activate, `global`→Enable globally.
  Enabling a global is the admin's counterpart to activating a per-user one,
  so the catalog picker dropdown is gone — the entry comes from the row.
- Connector Catalog (admin) — what this box offers. One `Add connector`
  with two sources: marketplace first (vetted, hashed), manual second
  (unvetted by nature) — the order mirrors the trust model.
- Marketplace (admin) — reached from the catalog, not the sidebar: it is a
  destination of an action, not a place.

`available()` no longer returns `McpGlobalServerRow`: that row carries
`api_key` and this view now reaches every logged-in user. A slim `GlobalView`
crosses instead, and an admin sees every global (with `can_use` marking their
own) so one enabled for someone else stays manageable.

Also fixes `connectors-page` having no CSS rule at all — every sibling page
has one, so it never got `flex: 1` and left an empty column beside it.
2026-07-16 18:52:59 +01:00

141 lines
8.7 KiB
YAML

server:
host: 127.0.0.1
port: 9000
# ── Global timezone ─────────────────────────────────────────────────────────────
# IANA timezone name applied globally to:
# - cron expression evaluation (next_run_at computation)
# - the date/time string injected into the LLM context each turn
# When omitted, the server's local system timezone is used.
# Examples: Europe/Rome, Europe/London, America/New_York, Asia/Tokyo
#
# timezone: Europe/Rome
# ────────────────────────────────────────────────────────────────────────────────
web:
static_dir: ./web
# ── Connector marketplace ──────────────────────────────────────────────────────
# The feed of vetted connectors the admin browses under Connectors → Marketplace.
# It is *consultative*: the feed proposes, the admin installs into the local
# catalog, and only then can a connector be enabled globally or activated by a
# user. The trust anchor stays on this box.
#
# Point it at a self-hosted mirror or a local copy to run fully offline — the feed
# is plain static files (`connectors.json` + `<folder>/connector.json`).
marketplace:
url: https://connectors.skaldagent.net
# The database lives at ./database/system.db — fixed, not configurable.
# ── LLM clients ────────────────────────────────────────────────────────────────
# LLM clients (providers, models, API keys, strength, scope) are configured
# via the web app and stored in the database — not in this file.
# ───────────────────────────────────────────────────────────────────────────────
llm:
# Maximum number of messages kept in the LLM context window.
# NOTE: this setting is ignored when `compaction` is enabled — in that case
# the compactor manages the token budget and truncating by count would silently
# discard history that should be summarised instead. With compaction active
# this field has no effect; without it, this is the only context-size guard.
max_history_messages: 30
max_tool_rounds: 100
# Max synchronous sub-agents dispatched concurrently when the LLM emits a
# homogeneous batch (≥2) of sub-agent calls (execute_task mode=sync /
# execute_subtask) in a single response. Bounds fan-out to avoid provider
# rate-limit storms. Omit for the default (4); set to 1 to force sequential.
max_parallel_subagents: 4
datetime:
enabled: true
round_minutes: 60 # Help with KV cache (instead of 10:54, it will pass 10:50 to the LLM)
# ── Tool result size limit ──────────────────────────────────────────────────
# When set, tool results from *previous* turns that exceed this character
# count are replaced (at context-build time) with a short placeholder:
# "[Tool response hidden: N chars. Call the tool again if you need it.]"
# The original result is always preserved in the database and shown in the
# frontend; only what the LLM receives in subsequent turns is affected.
# The current turn always sees full results regardless of this limit.
# Omit or comment out to disable (no limit).
max_tool_result_chars: 10000
# ───────────────────────────────────────────────────────────────────────────
# ── Context compaction ──────────────────────────────────────────────────────
# When enabled, the conversation history is automatically summarised when the
# previous turn consumed more than `threshold_tokens` input tokens.
# The summary is persisted to the DB and injected at the start of subsequent
# turns, replacing the old messages while preserving the last `keep_recent`
# raw messages for immediate context.
#
# `strength` controls which LLM is picked for summary generation via the AUTO
# selector (same strength levels used for agent assignment). Compaction is a
# simple writing task — `low` or `average` is usually sufficient.
# Omit `strength` to use whatever AUTO picks.
#
# When the LLM provider does not report token usage (e.g. some LM Studio
# setups), a rough estimate (total chars / 4) is used as a fallback.
#
# compaction:
# threshold_tokens: 30000 # trigger above this many input tokens
# keep_recent: 6 # raw messages kept outside the summary
# strength: low # LLM strength for summary generation
# ───────────────────────────────────────────────────────────────────────────
# ── TIC background event processor ─────────────────────────────────────────
# TIC runs periodically to process pending MCP events (email, calendar, WhatsApp)
# and decide whether to surface a notification to the user.
#
# interval_secs — how often TIC runs (default: 900 = 15 minutes)
# batch_size — max events processed per tick (default: 50)
#
# tic:
# interval_secs: 900
# batch_size: 50
# ───────────────────────────────────────────────────────────────────────────
# ── Date/time injection ─────────────────────────────────────────────────────
# Controls how the current date/time is injected into each LLM request.
# By default the exact timestamp is used, which changes every second and
# prevents the dynamic tail from being KV-cached across requests.
#
# datetime:
# enabled: true # set to false to disable injection entirely
# round_minutes: 10 # round down to nearest N minutes (e.g. 10:56 → 10:50)
# # keeps the string stable for up to N minutes
# ───────────────────────────────────────────────────────────────────────────
# ── LLM request/response log ────────────────────────────────────────────────
# Logs every chat_with_tools call to the `llm_requests` table.
# Captures the full HTTP request body, response body, headers (api-key redacted),
# token counts, and round-trip duration.
#
# WARNING: disabling `enabled` also disables the home-page LLM statistics.
#
# What to save (all default to true):
# request_payload_save — full request JSON (can be hundreds of KB per call)
# response_payload_save — full response JSON
# request_header_save — HTTP request headers (api-key always redacted)
# response_header_save — HTTP response headers
#
# Cleanup policy (all optional — omit to keep data forever):
# cleanup_request_payload_after — set request_json = '' after N days
# cleanup_response_payload_after — set response_json = NULL after N days
# cleanup_headers_after — null out both header columns after N days
# cleanup_rows_after — physically delete rows after N days
#
# The cleaner runs 1 minute after startup, then every 12 hours.
#
requests_log:
enabled: true
request_payload_save: false
response_payload_save: true
request_header_save: true
response_header_save: true
cleanup_request_payload_after: 7
cleanup_response_payload_after: 14
cleanup_headers_after: 30
cleanup_rows_after: 90
# ───────────────────────────────────────────────────────────────────────────