@sanctuary-framework/mcp-server 1.1.6 → 1.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -11163,7 +11163,7 @@ async function handleRequest(deps, req, res) {
11163
11163
  writeJSON(res, 200, { ok: true, mode: deps.sources.mode });
11164
11164
  return true;
11165
11165
  }
11166
- if (method === "GET" && (path === "/" || path === "/index.html")) {
11166
+ if (method === "GET" && (path === "/v1.0" || path === "/v1.0/" || path === "/v1.0/index.html")) {
11167
11167
  const snapshot = await getProtectionSnapshot(deps.sources);
11168
11168
  const html = renderDashboardHTML({ snapshot, authToken: deps.authToken });
11169
11169
  writeText(res, 200, html, "text/html; charset=utf-8");
@@ -12004,7 +12004,7 @@ function renderMain() {
12004
12004
  const main = document.getElementById("main");
12005
12005
  if (!main) return;
12006
12006
  switch (state.route) {
12007
- case "dashboard": main.innerHTML = renderChatThread(); break;
12007
+ case "dashboard": main.innerHTML = renderDashboardWelcome(); break;
12008
12008
  case "agents": main.innerHTML = renderAgentsList(); break;
12009
12009
  case "agent-detail": main.innerHTML = renderAgentDetail(); break;
12010
12010
  case "policy": main.innerHTML = renderPolicyCenter(); break;
@@ -12016,48 +12016,32 @@ function renderMain() {
12016
12016
  }
12017
12017
  }
12018
12018
 
12019
- // ── Render: chat thread ────────────────────────────────────────────────
12020
- function renderChatThread() {
12021
- const activeId = state.chatActiveAgentId;
12022
- const agent = activeId ? state.agents.find(function (a) { return a.agent_id === activeId; }) : null;
12023
- const header = '<header style="padding:8px 0;border-bottom:1px solid var(--rule);margin-bottom:8px;">' +
12024
- '<strong>' + escHtml(agent ? agent.agent_id : "Concierge") + '</strong>' +
12025
- ' <span class="muted">' + (agent ? "agent" : "Sanctuary advisory only. Operator-agent direct command via chat lands in v1.2.") + '</span>' +
12026
- '</header>';
12027
-
12028
- // Three message kinds. (1) operator (UI-side suggestions, not backend POST).
12029
- // (2) agent-initiated approvals from inbox filtered by agent_id. (3) activity
12030
- // events filtered by agent_id rendered as system-style.
12031
- const msgs = [];
12032
- if (!agent) {
12033
- msgs.push('<div class="chat-msg system"><strong>Concierge:</strong> Pick an agent in the right pane to scope the thread. Tier 1 actions appear here as approve/deny prompts. Free text is advisory only at v1.1.</div>');
12034
- } else {
12035
- const pending = state.inbox.filter(function (i) { return i.kind === "approval_pending" && i.agent_id === activeId && !i.resolved; });
12036
- pending.forEach(function (i) {
12037
- const text = renderTemplate(i.display_template_id, i.display_template_args);
12038
- msgs.push(
12039
- '<div class="chat-msg agent" data-msg-kind="agent-initiated" data-item-id="' + escHtml(i.item_id) + '">' +
12040
- '<div>' + escHtml(text) + '</div>' +
12041
- '<div style="margin-top:6px;display:flex;gap:6px;">' +
12042
- '<button class="btn btn-primary" data-action="inbox-approve" data-item-id="' + escHtml(i.item_id) + '">Approve</button>' +
12043
- '<button class="btn" data-action="inbox-deny" data-item-id="' + escHtml(i.item_id) + '">Deny</button>' +
12044
- '<button class="btn" data-action="show-details" data-item-id="' + escHtml(i.item_id) + '">Show details</button>' +
12045
- '</div>' +
12046
- '</div>'
12047
- );
12048
- });
12049
- const events = state.activity.filter(function (e) { return e.agent_id === activeId; }).slice(0, 20);
12050
- events.forEach(function (e) {
12051
- const text = renderTemplate(e.display_template_id, e.display_template_args);
12052
- msgs.push('<div class="chat-msg system"><span class="muted">' + escHtml(shortTime(e.emitted_at)) + '</span> ' + escHtml(text) + '</div>');
12053
- });
12054
- }
12055
-
12056
- const composer = '<form class="composer" id="chat-composer">' +
12057
- '<input type="text" placeholder="Suggestion to concierge. (Direct commands land in v1.2.)" id="chat-input" />' +
12058
- '<button type="submit" class="btn">Send</button>' +
12059
- '</form>';
12060
- return header + '<div class="chat-thread">' + (msgs.length ? msgs.join("\n") : '<p class="muted">No messages yet.</p>') + '</div>' + composer;
12019
+ // ── Render: dashboard welcome ──────────────────────────────────────────
12020
+ // v1.1.7: replaces the half-built chat surface that v1.1.6 shipped with
12021
+ // a "What you can do today" summary card mapping each nav target to
12022
+ // the operator action it enables. Direct concierge chat is a v1.2 work
12023
+ // package (WP-V1.2-3 + WP-V1.2-4).
12024
+ function renderDashboardWelcome() {
12025
+ return [
12026
+ '<h1>What you can do today</h1>',
12027
+ '<div class="card">',
12028
+ '<dl class="kv">',
12029
+ '<dt><a href="#agents">Agents</a></dt>',
12030
+ '<dd>Pause, resume, restart, lockdown, or unwrap any wrapped harness.</dd>',
12031
+ '<dt><a href="#policy">Policy</a></dt>',
12032
+ '<dd>Review the active policy bound to each agent.</dd>',
12033
+ '<dt><a href="#privacy">Privacy</a></dt>',
12034
+ '<dd>See what context is flowing to which provider per channel.</dd>',
12035
+ '<dt><a href="#coordination">Coordination</a></dt>',
12036
+ '<dd>Inspect intra-fortress agent coordination state.</dd>',
12037
+ '<dt><a href="#health">Health</a></dt>',
12038
+ '<dd>Check fortress posture, cocoon status, and dashboard refresh.</dd>',
12039
+ '<dt><a href="#exit-drill">Exit drill</a></dt>',
12040
+ '<dd>Snapshot, verify, and prepare a portable exit bundle.</dd>',
12041
+ '</dl>',
12042
+ '</div>',
12043
+ '<p class="muted">Direct chat with the concierge ships in v1.2.</p>'
12044
+ ].join("");
12061
12045
  }
12062
12046
 
12063
12047
  // ── Render: agents list / detail ───────────────────────────────────────
@@ -12096,8 +12080,10 @@ function renderAgentDetail() {
12096
12080
  '<dt>Status</dt><dd><span class="glyph ' + map.glyph + '"></span> ' + escHtml(map.label) + '</dd>' +
12097
12081
  '</dl>' +
12098
12082
  '</div>' +
12099
- '<div class="card"><h3>Timeline</h3>' + timeline + '</div>' +
12100
- '<button class="btn" data-action="set-route" data-route="dashboard">Open chat</button>';
12083
+ '<div class="card"><h3>Timeline</h3>' + timeline + '</div>';
12084
+ // v1.1.7: "Open chat" button removed alongside the half-built chat
12085
+ // surface (Finding EE). The agent-detail timeline + capability buttons
12086
+ // are the operator's interaction surface at v1.1; chat ships in v1.2.
12101
12087
  }
12102
12088
 
12103
12089
  // ── Render: privacy ────────────────────────────────────────────────────
@@ -12267,11 +12253,13 @@ function renderFortress() {
12267
12253
  : "This harness does not support " + mi.label.toLowerCase() + ".";
12268
12254
  return '<button class="btn" data-action="agent-' + mi.action + '" data-agent-id="' + escHtml(a.agent_id) + '"' + (mi.enabled ? '' : ' disabled') + ' title="' + escHtml(tip) + '">' + escHtml(mi.label) + '</button>';
12269
12255
  }).join("");
12270
- return '<div class="row" data-agent-row="' + escHtml(a.agent_id) + '">' +
12271
- '<span class="glyph ' + map.glyph + '" title="' + escHtml(REASON_LABELS[a.status_reason_class] || "") + '"></span>' +
12272
- '<div class="grow"><strong>' + escHtml(a.agent_id) + '</strong></div>' +
12273
- '<span class="pill">' + escHtml(map.label) + '</span>' +
12274
- '<div style="display:flex;gap:4px;flex-wrap:wrap;">' + buttons + '</div>' +
12256
+ return '<div class="row agent-row" data-agent-row="' + escHtml(a.agent_id) + '">' +
12257
+ '<div class="agent-row-head">' +
12258
+ '<span class="glyph ' + map.glyph + '" title="' + escHtml(REASON_LABELS[a.status_reason_class] || "") + '"></span>' +
12259
+ '<div class="grow"><strong>' + escHtml(a.agent_id) + '</strong></div>' +
12260
+ '<span class="pill">' + escHtml(map.label) + '</span>' +
12261
+ '</div>' +
12262
+ '<div class="agent-row-actions">' + buttons + '</div>' +
12275
12263
  '</div>';
12276
12264
  }).join("\n")
12277
12265
  : '<p class="muted">No agents wrapped.</p>';
@@ -12515,19 +12503,10 @@ document.addEventListener("click", function (ev) {
12515
12503
  }
12516
12504
  });
12517
12505
 
12518
- document.addEventListener("submit", function (ev) {
12519
- if (ev.target && ev.target.id === "chat-composer") {
12520
- ev.preventDefault();
12521
- const inp = document.getElementById("chat-input");
12522
- if (!inp) return;
12523
- const txt = inp.value.trim();
12524
- inp.value = "";
12525
- if (!txt) return;
12526
- // Concierge suggestion engine, NOT a backend command POST.
12527
- // Operator-typed direct commands land in v1.2.
12528
- toast("Concierge: I cannot run that as a command at v1.1. Use the inbox or the Agents view to take action.");
12529
- }
12530
- });
12506
+ // v1.1.7: chat composer submit handler removed alongside the half-built
12507
+ // chat surface (Finding EE). Direct concierge chat ships in v1.2; until
12508
+ // then the dashboard view renders a static welcome card with no form
12509
+ // inputs that could be confused for a working command surface.
12531
12510
 
12532
12511
  // Theme: system preference only at v1.1.
12533
12512
  const mq = window.matchMedia ? window.matchMedia("(prefers-color-scheme: dark)") : null;
@@ -12665,6 +12644,10 @@ body {
12665
12644
  .row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--rule); }
12666
12645
  .row:last-child { border-bottom: 0; }
12667
12646
  .row .grow { flex: 1; min-width: 0; }
12647
+ .agent-row { flex-direction: column; align-items: stretch; gap: 6px; }
12648
+ .agent-row-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
12649
+ .agent-row-head .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
12650
+ .agent-row-actions { display: flex; flex-wrap: wrap; gap: 4px; }
12668
12651
  .kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; font-size: 12px; }
12669
12652
  .kv dt { color: var(--ink-3); }
12670
12653
  .kv dd { margin: 0; color: var(--ink); }
@@ -12769,12 +12752,8 @@ function renderDashboardV11Html(options = {}) {
12769
12752
 
12770
12753
  // src/dashboard/v1_1/routes.ts
12771
12754
  function handleDashboardV11Route(deps, req, res) {
12772
- const routePath = deps.routePath ?? "/v1.1";
12773
- const host = req.headers.host || "localhost";
12774
- const url = new URL(req.url ?? "/", `http://${host}`);
12775
12755
  const method = (req.method ?? "GET").toUpperCase();
12776
12756
  if (method !== "GET") return false;
12777
- if (url.pathname !== routePath && url.pathname !== `${routePath}/`) return false;
12778
12757
  const html = renderDashboardV11Html(deps);
12779
12758
  res.writeHead(200, {
12780
12759
  "Content-Type": "text/html; charset=utf-8",
@@ -12787,7 +12766,7 @@ function handleDashboardV11Route(deps, req, res) {
12787
12766
  // src/dashboard/v1_1/dispatch.ts
12788
12767
  async function dispatchV11Request(inputs, req, res, url, method) {
12789
12768
  const { bindings, authToken, loopbackAutoAuth } = inputs;
12790
- if (method === "GET" && (url.pathname === "/v1.1" || url.pathname === "/v1.1/")) {
12769
+ if (method === "GET" && (url.pathname === "/" || url.pathname === "/dashboard" || url.pathname === "/v1.1" || url.pathname === "/v1.1/")) {
12791
12770
  return handleDashboardV11Route(
12792
12771
  {
12793
12772
  identityId: bindings.identityId,
@@ -12835,7 +12814,7 @@ var RATE_LIMIT_DECISIONS = 20;
12835
12814
  var MAX_RATE_LIMIT_ENTRIES = 1e4;
12836
12815
  function isDashboardViewRoute(method, path) {
12837
12816
  if (method !== "GET") return false;
12838
- return path === "/" || path === "/dashboard" || path === "/fortress" || path === "/events";
12817
+ return path === "/" || path === "/dashboard" || path === "/v1.0" || path === "/fortress" || path === "/events";
12839
12818
  }
12840
12819
  var DashboardApprovalChannel = class {
12841
12820
  config;
@@ -13339,7 +13318,7 @@ var DashboardApprovalChannel = class {
13339
13318
  }
13340
13319
  return;
13341
13320
  }
13342
- if (method === "GET" && url.pathname === "/" && this.authToken) {
13321
+ if (method === "GET" && url.pathname === "/v1.0" && this.authToken) {
13343
13322
  if (!this.isAuthenticated(req, url)) {
13344
13323
  this.serveLoginPage(res);
13345
13324
  return;
@@ -13352,7 +13331,7 @@ var DashboardApprovalChannel = class {
13352
13331
  try {
13353
13332
  if (method === "GET" && url.pathname === "/fortress") {
13354
13333
  this.serveFortressView(res);
13355
- } else if (method === "GET" && (url.pathname === "/" || url.pathname === "/dashboard")) {
13334
+ } else if (method === "GET" && url.pathname === "/v1.0") {
13356
13335
  if (this.fortressHTML) {
13357
13336
  this.serveFortressView(res);
13358
13337
  } else {