{% extends "base.html" %} {% load static %} {% block title %}能力路由接入 - AgomTradePro{% endblock %} {% block extra_css %} {% endblock %} {% block content %} {% if request.user.is_staff or request.user.is_superuser %} {% include "components/classic_tui_migration_banner.html" with screen_key="capability-router.mcp-center" action_key="ops.semantic-governance-overview" %} {% else %} {% include "components/classic_tui_migration_banner.html" with screen_key="capability-router.self-service" action_key="capability-router.mcp-self-status" %} {% endif %}

{{ page_title }}

{{ page_subtitle }}

MCP 接入说明 打开 TUI {% if request.user.is_staff %} MCP 工具治理 {% endif %}
统一入口: 外部 Agent 优先调用 /api/ai-capability/route/。 Capability Router 会根据目录、权限、风险等级和用户上下文选择 MCP 工具、Terminal 指令、内置能力或内部 API。
MCP 最佳实践: 可执行工具以 SDK 代码注册为真源,数据库目录只保存同步快照、路由开关、风险等级和复核状态。 这样可以避免数据库动态注入任意可执行能力,同时保留统一治理、审计和接入发现能力。
{% if new_token_payload %}
新 Token 已生成: {{ new_token_payload.token_name }} / {{ new_token_payload.access_level_label }}
{{ new_token_payload.token }}
{% endif %}
能力总数
{{ catalog_stats.total }}
启用 {{ catalog_stats.enabled }} / 风险停用 {{ catalog_stats.disabled }} / 待人工复核 {{ catalog_stats.manual_governance }}
{% for card in source_cards %}
{{ card.label }}
{{ card.routing_enabled }}/{{ card.total }}
{{ card.status }} 需确认 {{ card.requires_confirmation }}
{% endfor %}
{% if request.user.is_staff and semantic_governance %}

语义键治理

检查缺失、冲突和孤儿覆盖;先预览入口 winner,再应用有理由、可审计的批量修正。

缺失

    {% for capability_key in semantic_governance.missing_capability_keys %}
  • {{ capability_key }}
  • {% empty %}
  • {% endfor %}

冲突

    {% for semantic_key, capability_keys in semantic_governance.conflicts.items %}
  • {{ semantic_key }}:{{ capability_keys|join:", " }}
  • {% empty %}
  • {% endfor %}

孤儿覆盖

    {% for capability_key in semantic_governance.orphaned_override_keys %}
  • {{ capability_key }}
  • {% empty %}
  • {% endfor %}
尚未预览

最近审计

{% for entry in semantic_governance.audit.results %}
{{ entry.capability_key }} / {{ entry.action }}

{{ entry.reason }}

{{ entry.old_effective_value }} → {{ entry.new_effective_value }}
{% empty %}

暂无审计记录。

{% endfor %}
{% endif %}
{% for step in onboarding_steps %} {% endfor %}
{% endblock %}