@aexol/spectral 0.9.263 → 0.9.264

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.
@@ -14,6 +14,7 @@
14
14
  * resource handlers) the status snapshot does not need.
15
15
  */
16
16
  import { supportsOAuth } from "../../mcp/mcp-auth-flow.js";
17
+ import { getMcpStateForSession, listMcpStates } from "../../mcp/state-getter.js";
17
18
  /** Maximum age (ms) of a failure entry before we treat it as stale. */
18
19
  const FAILURE_BACKOFF_MS = 60_000;
19
20
  export function handleListMcpStatus(state) {
@@ -62,3 +63,33 @@ function getFailureAgeSeconds(state, serverName) {
62
63
  return null;
63
64
  return Math.round(ageMs / 1000);
64
65
  }
66
+ /**
67
+ * Session-scoped variant of `GET /api/mcp-status`.
68
+ *
69
+ * - With `sessionId`: returns that session's own live state (empty array
70
+ * when the session has no registered state — never another session's).
71
+ * - Without: returns the UNION of all registered live states, deduplicated
72
+ * by server name with the FIRST occurrence winning (same aggregation as
73
+ * the reload handler).
74
+ *
75
+ * Response shape is identical to `handleListMcpStatus` — a plain
76
+ * `McpServerStatus[]` — so landing's `listMachineMcpStatus()` contract is
77
+ * unchanged.
78
+ */
79
+ export function handleListMcpStatusSessioned(sessionId) {
80
+ if (sessionId) {
81
+ const state = getMcpStateForSession(sessionId);
82
+ return state ? handleListMcpStatus(state) : [];
83
+ }
84
+ const seen = new Set();
85
+ const result = [];
86
+ for (const { state } of listMcpStates()) {
87
+ for (const server of handleListMcpStatus(state)) {
88
+ if (!seen.has(server.name)) {
89
+ seen.add(server.name);
90
+ result.push(server);
91
+ }
92
+ }
93
+ }
94
+ return result;
95
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aexol/spectral",
3
- "version": "0.9.263",
3
+ "version": "0.9.264",
4
4
  "description": "AI coding agent for Aexol with relay-based browser access.",
5
5
  "type": "module",
6
6
  "private": false,