- thor/web/mcp.py: stateless Streamable HTTP at POST /mcp (JSON-RPC 2.0), RFC 9728 metadata at /.well-known/oauth-protected-resource[/mcp], 401 with resource_metadata. Tokens checked against Authelia's JWKS: RS256, iss, aud (this server), exp, typ at+jwt, client_id thor-mcp, scp array; group admin only; Remote-* headers never trusted; every tool call logged with the user. - Read tools (thor:read): list_incidents, get_incident, what_covers, thor_status, list_known_conditions. Write tools (thor:write): add_known_condition, end_known_condition, attach_ticket, detach_ticket. Tools a token's scopes can't use aren't listed. - Migration 4: incident_links (who attached which ticket to which incident). attach_ticket records an 'attach' action; in shadow nothing is sent, live sends a 'Root cause' comment. - Incident page lists attached tickets. PyJWT[crypto] added. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
81 lines
4.2 KiB
HTML
81 lines
4.2 KiB
HTML
{% extends "base.html" %}
|
|
{% set i = d.incident %}
|
|
{% block title %}{{ i.summary }}{% endblock %}
|
|
{% block content %}
|
|
<section class="t-section" aria-labelledby="inc-title">
|
|
<div class="t-section-header">
|
|
<h1 class="t-section-title" id="inc-title">
|
|
{% if i.ticket %}<span class="t-prio t-prio-{{ i.priority | pclass }}">P{{ i.priority }}</span>{% endif %}
|
|
{{ i.summary }}
|
|
</h1>
|
|
</div>
|
|
<dl class="t-facts">
|
|
<dt>State</dt><dd>{{ i.state }}{% if not i.ticket %} (timeline only, no ticket by design){% endif %}</dd>
|
|
<dt>Ticket</dt><dd>
|
|
{% if i.known_ticket %}known condition: notes go to #{{ i.known_ticket }}{% if d.known_reason %} ({{ d.known_reason }}){% endif %}
|
|
{% elif i.ticket_id %}<a href="https://t.lotusguild.org/ticket/{{ i.ticket_id }}">#{{ i.ticket_id }}</a>
|
|
{% elif i.mode != 'live' %}shadow: recorded below, not sent{% else %}not sent yet{% endif %}</dd>
|
|
<dt>Key</dt><dd><code>{{ i.key }}</code></dd>
|
|
<dt>First seen</dt><dd>{{ i.first_seen | utc }}</dd>
|
|
<dt>Last seen</dt><dd>{{ i.last_seen | utc }}</dd>
|
|
{% if i.cleared_at %}<dt>Cleared</dt><dd>{{ i.cleared_at | utc }}</dd>{% endif %}
|
|
{% for k, v in (d.facts.display or {}).items() %}<dt>{{ k }}</dt><dd>{{ v }}</dd>{% endfor %}
|
|
{% if d.links %}<dt>Attached tickets</dt><dd>{% for l in d.links %}<a href="https://t.lotusguild.org/ticket/{{ l.ticket_id }}">#{{ l.ticket_id }}</a> (by {{ l.added_by }}){% if not loop.last %}, {% endif %}{% endfor %}</dd>{% endif %}
|
|
{% if d.facts.escalation_reason and i.priority and i.priority < 3 %}<dt>Why this priority</dt><dd>{{ d.facts.escalation_reason }}</dd>{% endif %}
|
|
</dl>
|
|
{% if d.seen_after_the_fact %}<p class="t-note">Seen after the fact: Thor was away or blind while this happened and found it when it caught up.</p>{% endif %}
|
|
</section>
|
|
|
|
<div class="t-columns">
|
|
<section class="t-section" aria-labelledby="ev-title">
|
|
<div class="t-section-header"><h2 class="t-section-title" id="ev-title">What happened</h2></div>
|
|
{% if d.events %}
|
|
<ol class="t-timeline">
|
|
{% for e in d.events %}<li><time>{{ e.at | hm }}</time> {{ e.text }}</li>{% endfor %}
|
|
</ol>
|
|
{% else %}<p class="attention-empty">No events recorded.</p>{% endif %}
|
|
</section>
|
|
|
|
<section class="t-section" aria-labelledby="sym-title">
|
|
<div class="t-section-header"><h2 class="t-section-title" id="sym-title">Also seen <span class="attention-count">{{ d.symptoms | length }}</span></h2></div>
|
|
{% if d.symptoms %}
|
|
<ol class="t-timeline">
|
|
{% for s in d.symptoms %}
|
|
<li><time>{{ s.first | hm }}{% if s.last and s.last - s.first >= 60 %} to {{ s.last | hm }}{% endif %}</time> {{ s.summary }}</li>
|
|
{% endfor %}
|
|
</ol>
|
|
{% else %}<p class="attention-empty">Nothing attached.</p>{% endif %}
|
|
</section>
|
|
</div>
|
|
|
|
<section class="t-section" aria-labelledby="act-title">
|
|
<div class="t-section-header"><h2 class="t-section-title" id="act-title">What Thor sent, or would have sent</h2></div>
|
|
{% if d.actions %}
|
|
<div class="lt-table-wrap">
|
|
<table class="lt-table">
|
|
<thead><tr><th>When</th><th>Action</th><th>Mode</th><th>Status</th><th>Detail</th></tr></thead>
|
|
<tbody>
|
|
{% for a in d.actions %}
|
|
<tr>
|
|
<td>{{ a.created_at | utc('%m-%d %H:%M:%S') if a.created_at else (a.created | utc('%m-%d %H:%M:%S')) }}</td>
|
|
<td>{{ a.kind | replace('_', ' ') }}</td>
|
|
<td>{{ a.mode }}</td>
|
|
<td>{{ a.status }}{% if a.ticket_id %} #{{ a.ticket_id }}{% endif %}</td>
|
|
<td>{% if a.payload.priority %}P{{ a.payload.priority }} {% endif %}{{ a.payload.title or a.payload.symptoms | join(', ') if a.payload.symptoms else a.payload.title or '' }}{% if a.error %} <span class="t-err">{{ a.error }}</span>{% endif %}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{% else %}<p class="attention-empty">Nothing yet.</p>{% endif %}
|
|
</section>
|
|
|
|
{% if d.preview %}
|
|
<section class="t-section" aria-labelledby="prev-title">
|
|
<div class="t-section-header"><h2 class="t-section-title" id="prev-title">Ticket text</h2></div>
|
|
<p class="t-preview-title"><code>{{ d.preview.title }}</code></p>
|
|
<pre class="t-preview">{{ d.preview.description }}</pre>
|
|
</section>
|
|
{% endif %}
|
|
{% endblock %}
|