sophos-central-mcp-server 0.5.0 → 0.7.0

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.
Files changed (198) hide show
  1. package/LICENSE +0 -0
  2. package/README.md +143 -18
  3. package/dist/auth/token-manager.d.ts +0 -0
  4. package/dist/auth/token-manager.d.ts.map +0 -0
  5. package/dist/auth/token-manager.js +0 -0
  6. package/dist/auth/token-manager.js.map +0 -0
  7. package/dist/client/fusion-client.d.ts +132 -0
  8. package/dist/client/fusion-client.d.ts.map +1 -0
  9. package/dist/client/fusion-client.js +258 -0
  10. package/dist/client/fusion-client.js.map +1 -0
  11. package/dist/client/sophos-client.d.ts +11 -0
  12. package/dist/client/sophos-client.d.ts.map +1 -1
  13. package/dist/client/sophos-client.js +39 -0
  14. package/dist/client/sophos-client.js.map +1 -1
  15. package/dist/client/tenant-resolver.d.ts +0 -0
  16. package/dist/client/tenant-resolver.d.ts.map +0 -0
  17. package/dist/client/tenant-resolver.js +0 -0
  18. package/dist/client/tenant-resolver.js.map +0 -0
  19. package/dist/config/config.d.ts +22 -0
  20. package/dist/config/config.d.ts.map +1 -1
  21. package/dist/config/config.js +61 -0
  22. package/dist/config/config.js.map +1 -1
  23. package/dist/fusion/case-reference-data.d.ts +34 -0
  24. package/dist/fusion/case-reference-data.d.ts.map +1 -0
  25. package/dist/fusion/case-reference-data.js +97 -0
  26. package/dist/fusion/case-reference-data.js.map +1 -0
  27. package/dist/fusion/cases-ql.d.ts +28 -0
  28. package/dist/fusion/cases-ql.d.ts.map +1 -0
  29. package/dist/fusion/cases-ql.js +77 -0
  30. package/dist/fusion/cases-ql.js.map +1 -0
  31. package/dist/fusion/format.d.ts +95 -0
  32. package/dist/fusion/format.d.ts.map +1 -0
  33. package/dist/fusion/format.js +142 -0
  34. package/dist/fusion/format.js.map +1 -0
  35. package/dist/fusion/migration.d.ts +40 -0
  36. package/dist/fusion/migration.d.ts.map +1 -0
  37. package/dist/fusion/migration.js +76 -0
  38. package/dist/fusion/migration.js.map +1 -0
  39. package/dist/fusion/queries/cases.d.ts +40 -0
  40. package/dist/fusion/queries/cases.d.ts.map +1 -0
  41. package/dist/fusion/queries/cases.js +243 -0
  42. package/dist/fusion/queries/cases.js.map +1 -0
  43. package/dist/fusion/queries/detections.d.ts +21 -0
  44. package/dist/fusion/queries/detections.d.ts.map +1 -0
  45. package/dist/fusion/queries/detections.js +64 -0
  46. package/dist/fusion/queries/detections.js.map +1 -0
  47. package/dist/fusion/types.d.ts +322 -0
  48. package/dist/fusion/types.d.ts.map +1 -0
  49. package/dist/fusion/types.js +7 -0
  50. package/dist/fusion/types.js.map +1 -0
  51. package/dist/http-guard.d.ts +25 -0
  52. package/dist/http-guard.d.ts.map +1 -0
  53. package/dist/http-guard.js +68 -0
  54. package/dist/http-guard.js.map +1 -0
  55. package/dist/index.d.ts +0 -0
  56. package/dist/index.d.ts.map +0 -0
  57. package/dist/index.js +97 -57
  58. package/dist/index.js.map +1 -1
  59. package/dist/tools/accounts.d.ts +0 -0
  60. package/dist/tools/accounts.d.ts.map +0 -0
  61. package/dist/tools/accounts.js +0 -0
  62. package/dist/tools/accounts.js.map +0 -0
  63. package/dist/tools/admin-management.d.ts +0 -0
  64. package/dist/tools/admin-management.d.ts.map +0 -0
  65. package/dist/tools/admin-management.js +0 -0
  66. package/dist/tools/admin-management.js.map +0 -0
  67. package/dist/tools/alerts.d.ts +0 -0
  68. package/dist/tools/alerts.d.ts.map +0 -0
  69. package/dist/tools/alerts.js +0 -0
  70. package/dist/tools/alerts.js.map +0 -0
  71. package/dist/tools/audit-events.d.ts +0 -0
  72. package/dist/tools/audit-events.d.ts.map +0 -0
  73. package/dist/tools/audit-events.js +0 -0
  74. package/dist/tools/audit-events.js.map +0 -0
  75. package/dist/tools/business-automation.d.ts +0 -0
  76. package/dist/tools/business-automation.d.ts.map +0 -0
  77. package/dist/tools/business-automation.js +0 -0
  78. package/dist/tools/business-automation.js.map +0 -0
  79. package/dist/tools/cases.d.ts +2 -1
  80. package/dist/tools/cases.d.ts.map +1 -1
  81. package/dist/tools/cases.js +46 -19
  82. package/dist/tools/cases.js.map +1 -1
  83. package/dist/tools/cloud-security.d.ts +0 -0
  84. package/dist/tools/cloud-security.d.ts.map +0 -0
  85. package/dist/tools/cloud-security.js +0 -0
  86. package/dist/tools/cloud-security.js.map +0 -0
  87. package/dist/tools/detections.d.ts +2 -1
  88. package/dist/tools/detections.d.ts.map +1 -1
  89. package/dist/tools/detections.js +32 -14
  90. package/dist/tools/detections.js.map +1 -1
  91. package/dist/tools/directory.d.ts +0 -0
  92. package/dist/tools/directory.d.ts.map +0 -0
  93. package/dist/tools/directory.js +0 -0
  94. package/dist/tools/directory.js.map +0 -0
  95. package/dist/tools/dns-protection.d.ts +0 -0
  96. package/dist/tools/dns-protection.d.ts.map +0 -0
  97. package/dist/tools/dns-protection.js +0 -0
  98. package/dist/tools/dns-protection.js.map +0 -0
  99. package/dist/tools/email.d.ts +0 -0
  100. package/dist/tools/email.d.ts.map +0 -0
  101. package/dist/tools/email.js +0 -0
  102. package/dist/tools/email.js.map +0 -0
  103. package/dist/tools/endpoint-migrations.d.ts +0 -0
  104. package/dist/tools/endpoint-migrations.d.ts.map +0 -0
  105. package/dist/tools/endpoint-migrations.js +0 -0
  106. package/dist/tools/endpoint-migrations.js.map +0 -0
  107. package/dist/tools/endpoint-settings.d.ts +0 -0
  108. package/dist/tools/endpoint-settings.d.ts.map +0 -0
  109. package/dist/tools/endpoint-settings.js +0 -0
  110. package/dist/tools/endpoint-settings.js.map +0 -0
  111. package/dist/tools/endpoints.d.ts +0 -0
  112. package/dist/tools/endpoints.d.ts.map +0 -0
  113. package/dist/tools/endpoints.js +0 -0
  114. package/dist/tools/endpoints.js.map +0 -0
  115. package/dist/tools/exclusions.d.ts +0 -0
  116. package/dist/tools/exclusions.d.ts.map +0 -0
  117. package/dist/tools/exclusions.js +0 -0
  118. package/dist/tools/exclusions.js.map +0 -0
  119. package/dist/tools/firewall.d.ts +0 -0
  120. package/dist/tools/firewall.d.ts.map +1 -1
  121. package/dist/tools/firewall.js +3 -2
  122. package/dist/tools/firewall.js.map +1 -1
  123. package/dist/tools/fusion-cases.d.ts +50 -0
  124. package/dist/tools/fusion-cases.d.ts.map +1 -0
  125. package/dist/tools/fusion-cases.js +1809 -0
  126. package/dist/tools/fusion-cases.js.map +1 -0
  127. package/dist/tools/fusion-detections.d.ts +14 -0
  128. package/dist/tools/fusion-detections.d.ts.map +1 -0
  129. package/dist/tools/fusion-detections.js +75 -0
  130. package/dist/tools/fusion-detections.js.map +1 -0
  131. package/dist/tools/groups.d.ts +0 -0
  132. package/dist/tools/groups.d.ts.map +0 -0
  133. package/dist/tools/groups.js +0 -0
  134. package/dist/tools/groups.js.map +0 -0
  135. package/dist/tools/health.d.ts +0 -0
  136. package/dist/tools/health.d.ts.map +0 -0
  137. package/dist/tools/health.js +0 -0
  138. package/dist/tools/health.js.map +0 -0
  139. package/dist/tools/helpers.d.ts +7 -0
  140. package/dist/tools/helpers.d.ts.map +1 -1
  141. package/dist/tools/helpers.js +7 -0
  142. package/dist/tools/helpers.js.map +1 -1
  143. package/dist/tools/licensing.d.ts +0 -0
  144. package/dist/tools/licensing.d.ts.map +0 -0
  145. package/dist/tools/licensing.js +0 -0
  146. package/dist/tools/licensing.js.map +0 -0
  147. package/dist/tools/live-discover.d.ts +0 -0
  148. package/dist/tools/live-discover.d.ts.map +0 -0
  149. package/dist/tools/live-discover.js +0 -0
  150. package/dist/tools/live-discover.js.map +0 -0
  151. package/dist/tools/mobile.d.ts +0 -0
  152. package/dist/tools/mobile.d.ts.map +0 -0
  153. package/dist/tools/mobile.js +0 -0
  154. package/dist/tools/mobile.js.map +0 -0
  155. package/dist/tools/partner.d.ts +0 -0
  156. package/dist/tools/partner.d.ts.map +0 -0
  157. package/dist/tools/partner.js +0 -0
  158. package/dist/tools/partner.js.map +0 -0
  159. package/dist/tools/policies.d.ts +0 -0
  160. package/dist/tools/policies.d.ts.map +0 -0
  161. package/dist/tools/policies.js +0 -0
  162. package/dist/tools/policies.js.map +0 -0
  163. package/dist/tools/siem.d.ts +0 -0
  164. package/dist/tools/siem.d.ts.map +0 -0
  165. package/dist/tools/siem.js +0 -0
  166. package/dist/tools/siem.js.map +0 -0
  167. package/dist/tools/switch.d.ts +0 -0
  168. package/dist/tools/switch.d.ts.map +0 -0
  169. package/dist/tools/switch.js +0 -0
  170. package/dist/tools/switch.js.map +0 -0
  171. package/dist/tools/tenants.d.ts +0 -0
  172. package/dist/tools/tenants.d.ts.map +0 -0
  173. package/dist/tools/tenants.js +0 -0
  174. package/dist/tools/tenants.js.map +0 -0
  175. package/dist/tools/user-activity.d.ts +0 -0
  176. package/dist/tools/user-activity.d.ts.map +0 -0
  177. package/dist/tools/user-activity.js +0 -0
  178. package/dist/tools/user-activity.js.map +0 -0
  179. package/dist/tools/web-filtering.d.ts +0 -0
  180. package/dist/tools/web-filtering.d.ts.map +0 -0
  181. package/dist/tools/web-filtering.js +0 -0
  182. package/dist/tools/web-filtering.js.map +0 -0
  183. package/dist/tools/wifi.d.ts +0 -0
  184. package/dist/tools/wifi.d.ts.map +0 -0
  185. package/dist/tools/wifi.js +0 -0
  186. package/dist/tools/wifi.js.map +0 -0
  187. package/dist/tools/xdr.d.ts +0 -0
  188. package/dist/tools/xdr.d.ts.map +0 -0
  189. package/dist/tools/xdr.js +0 -0
  190. package/dist/tools/xdr.js.map +0 -0
  191. package/dist/types/sophos.d.ts +0 -0
  192. package/dist/types/sophos.d.ts.map +0 -0
  193. package/dist/types/sophos.js +0 -0
  194. package/dist/types/sophos.js.map +0 -0
  195. package/docs/screenshots/tenant-health-detail.png +0 -0
  196. package/docs/screenshots/tenant-health-overview.png +0 -0
  197. package/docs/screenshots/tenant-listing.png +0 -0
  198. package/package.json +16 -4
package/LICENSE CHANGED
File without changes
package/README.md CHANGED
@@ -1,6 +1,13 @@
1
- # Sophos Central MCP Server
1
+ # Sophos Fusion MCP Server (formerly Sophos Central)
2
2
 
3
- MCP (Model Context Protocol) server for interacting with Sophos Central APIs. Supports partner, organisation, and single-tenant credential types with automatic region routing. **288 tools** covering 20 Sophos API namespaces. Install it as a Claude Desktop extension (`.mcpb`), run it with npx, or host it yourself over streamable HTTP.
3
+ > **Unofficial project, not from Sophos.** This is a personal project by an individual. It is
4
+ > not an official Sophos product and it is not built, endorsed, supported, or warranted by
5
+ > Sophos. It calls the public Sophos APIs using credentials you supply. Use it at your own
6
+ > risk, and raise problems as issues on this repository rather than with Sophos support.
7
+
8
+ MCP (Model Context Protocol) server for the Sophos Fusion and Sophos Central APIs. Supports partner, organisation, and single-tenant credential types with automatic region routing. **310 tools** covering 22 Sophos API namespaces: the Sophos Central REST APIs plus the Sophos Fusion GraphQL APIs (`sophos_fusion_*`). Install it as a Claude Desktop extension (`.mcpb`), run it with npx, or host it yourself over streamable HTTP.
9
+
10
+ The npm package, the `.mcpb` bundle and the binaries keep the `sophos-central-mcp-server` name so existing installs update in place.
4
11
 
5
12
  ## Prerequisites
6
13
 
@@ -8,7 +15,7 @@ You need these before any of the install options below.
8
15
 
9
16
  ### Sophos Central API credentials
10
17
 
11
- Every install method needs a Client ID and Client Secret. The credential type decides what the server can see:
18
+ Every install method needs a Client ID and Client Secret. The same credential authorises both the Sophos Central REST tools and the Sophos Fusion GraphQL tools; there is no second credential. The credential type decides what the server can see:
12
19
 
13
20
  - **Tenant-level**: In Sophos Central, go to **Settings > API Credentials Management** and create a new credential. The server operates on that one tenant.
14
21
  - **Partner-level**: In the Sophos Partner Dashboard, create API credentials under **Settings > API Credentials**. The server can query every tenant the partner manages.
@@ -32,13 +39,15 @@ Pick one:
32
39
 
33
40
  The `.mcpb` file is an [MCP Bundle](https://github.com/modelcontextprotocol/mcpb): a zip containing the built server, its production dependencies, and a manifest that tells Claude Desktop how to run it and which settings to ask for. No terminal and no config file edits.
34
41
 
35
- 1. Download `sophos-central-mcp-server-<version>.mcpb` from the [latest GitHub release](https://github.com/Aaronjacobs000/sophos-central-mcp/releases/latest).
42
+ 1. Download `sophos-central-mcp-server-<version>.mcpb` from the [latest GitHub release](https://github.com/Aaronjacobs000/sophos-mcp/releases/latest).
36
43
  2. Open the file with Claude Desktop. Double-clicking it works on macOS and Windows. You can also go to **Settings > Extensions > Advanced settings**, find the **Extension Developer** section, click **Install Extension...** and pick the file.
37
44
  3. Claude Desktop shows the extension details and asks for your **Sophos Central Client ID** and **Client Secret**. Both fields are marked sensitive in the manifest, so Claude Desktop keeps them in the operating system's secure storage instead of a config file.
38
45
  4. Click **Install**, make sure the extension is enabled, then start a new chat. The `sophos_*` tools are available straight away.
39
46
 
40
47
  To update, download the newer `.mcpb` and install it the same way. To remove it, open **Settings > Extensions** and uninstall the extension.
41
48
 
49
+ To change the credentials later, open **Settings > Extensions** and click this extension. The **Sophos Central Client ID** and **Client Secret** fields are editable there. They are stored in the operating system's secure storage and show masked, so you replace a value rather than read the old one back. The server reads them at startup, so toggle the extension off and on, or restart Claude Desktop, if a change does not take effect.
50
+
42
51
  The bundle runs the server in stdio mode and sets `TRANSPORT=stdio` for you. Which tools you get depends on the credential type, exactly as with the other install options: partner and organisation credentials unlock the cross-tenant tools, tenant credentials do not.
43
52
 
44
53
  ### Option 2: Claude Code
@@ -78,8 +87,8 @@ npm install -g sophos-central-mcp-server
78
87
  **Or from source:**
79
88
 
80
89
  ```bash
81
- git clone https://github.com/Aaronjacobs000/sophos-central-mcp.git
82
- cd sophos-central-mcp
90
+ git clone https://github.com/Aaronjacobs000/sophos-mcp.git
91
+ cd sophos-mcp
83
92
  npm install
84
93
  npm run build
85
94
  ```
@@ -100,7 +109,7 @@ sophos-central-mcp # global npm install
100
109
  npm start # from a source checkout
101
110
  ```
102
111
 
103
- With `TRANSPORT=http` (the default) the server listens on `http://127.0.0.1:3100/mcp` and answers `GET /health` with `{"status":"ok"}`. The MCP endpoint is stateless: every request gets a fresh transport. Point any streamable HTTP client at it, for example Claude Code:
112
+ With `TRANSPORT=http` (the default) the server listens on `http://127.0.0.1:3100/mcp` (`MCP_HTTP_HOST` and `PORT` change that) and answers `GET /health` with `{"status":"ok","server":"sophos-central-mcp-server"}`. The MCP endpoint is stateless: every request gets a fresh server and transport, so concurrent tool calls work. Point any streamable HTTP client at it, for example Claude Code:
104
113
 
105
114
  ```bash
106
115
  claude mcp add --transport http sophos-central http://127.0.0.1:3100/mcp
@@ -108,7 +117,31 @@ claude mcp add --transport http sophos-central http://127.0.0.1:3100/mcp
108
117
 
109
118
  With `TRANSPORT=stdio` the server speaks MCP over stdin/stdout and is meant to be spawned by the client, which is what Options 1 and 2 do for you.
110
119
 
111
- The HTTP server binds to `127.0.0.1` only and has no authentication of its own. If it needs to be reachable from another host, put it behind something that adds TLS and auth (an SSH tunnel or an authenticating reverse proxy) rather than changing the bind address.
120
+ By default the HTTP server binds to `127.0.0.1` and has no authentication. It refuses any request with a browser `Origin` other than `localhost`, `127.0.0.1`, `[::1]` or one listed in `MCP_ALLOWED_ORIGINS`, so a web page cannot drive it by cross-site POST or DNS rebinding. MCP clients that are not browsers send no `Origin`, so this does not affect them, on this machine or another.
121
+
122
+ ### Using it from other machines
123
+
124
+ To let agents on other machines use the server:
125
+
126
+ 1. Make a token, for example `openssl rand -hex 32`.
127
+ 2. Start the server listening on the network, with the token:
128
+
129
+ ```bash
130
+ MCP_HTTP_HOST=0.0.0.0 MCP_HTTP_TOKEN=<token> TRANSPORT=http npm start
131
+ ```
132
+
133
+ `0.0.0.0` listens on every interface. To listen on one only, use that interface's address, such as a LAN or Tailscale IP.
134
+ 3. Point each client at `http://<server>:3100/mcp` and have it send `Authorization: Bearer <token>`. In Claude Code:
135
+
136
+ ```bash
137
+ claude mcp add --transport http sophos-central http://<server>:3100/mcp --header "Authorization: Bearer <token>"
138
+ ```
139
+
140
+ Every `/mcp` request without the right token gets a 401. `/health` stays open. Without a token, anyone who can reach the port can use every tool with your Sophos credentials, and the server prints a warning at startup saying so.
141
+
142
+ Plain HTTP sends the token and tool results in clear text. On any network you don't fully trust, encrypt it: TLS through a reverse proxy (Caddy or nginx, say), or reach the server over Tailscale.
143
+
144
+ A browser based MCP client on another machine sends an `Origin` and is refused until you add that origin to `MCP_ALLOWED_ORIGINS`. Agents and CLI clients need nothing there.
112
145
 
113
146
  ### Build the .mcpb yourself (maintainers)
114
147
 
@@ -129,6 +162,26 @@ The script:
129
162
 
130
163
  `build/` and `release/` are git-ignored. To inspect a bundle without installing it, `npx mcpb info release/<file>.mcpb` prints its size and signature state, and `npx mcpb unpack release/<file>.mcpb <dir>` extracts it. Signing is optional; `npx mcpb sign --self-signed release/<file>.mcpb` adds a self-signed signature if you want one.
131
164
 
165
+ ### Tests (maintainers)
166
+
167
+ ```bash
168
+ npm test
169
+ ```
170
+
171
+ Builds, then runs the `node:test` suites in `test/` with `fetch` stubbed: the Fusion GraphQL transport (including the HTTP 200 with `errors` case), the QL builder, the reference-data cache, and the path-keyed retry for the intermittent case-write fault, the migration guard, a registration check that lists all 310 tools over an in-memory transport and checks the descriptions for the measured warnings, the `SOPHOS_FUSION_GRAPHQL_URL` check, and the HTTP transport (Origin guard, bearer token, listen address, concurrent calls) run against an in-memory Sophos. Nothing in `npm test` reaches Sophos.
172
+
173
+ To exercise the Fusion tools against a live tenant, put credentials in `.env` (or export them) and run:
174
+
175
+ ```bash
176
+ node scripts/fusion-smoke.mjs # read-only, tenant credential
177
+ node scripts/fusion-smoke.mjs <tenant-id> # read-only, partner or organisation credential
178
+ node scripts/fusion-smoke.mjs --write # plus the Fusion write tools on one new case
179
+ node scripts/fusion-smoke.mjs --write-classic # plus the Classic case tools on one new case
180
+ node scripts/fusion-smoke.mjs --all # everything
181
+ ```
182
+
183
+ It spawns the built server over stdio and calls the tools through an MCP client, so what runs is what a host runs. Read-only mode covers the reference data, the case list with filter and cursor variants, the newest case by short ID, its evidence, summary, comments and files, the detection search, the not-found and legacy-ID refusals, and the Classic side: on a migrated tenant the migration refusal, otherwise the six Classic read tools. `--write` creates one case titled `MCP smoke test <timestamp>` (managed_by CUSTOMER), exercises comment add, edit and delete with the mention read-back, link create, update and delete, tag merge and replace, evidence add and remove_all, file upload, list and soft delete, the verdict clear on reopen, the one way door on new and the closed-case freeze, then closes it with a verdict and archives it (Fusion has no delete). `--write-classic` creates, updates and deletes one Classic case; the Cases API requires an assignee and a detection that still exists, so set `SMOKE_CLASSIC_ASSIGNEE` (a tenant admin email) and, if needed, `SMOKE_CLASSIC_DETECTION_ID` (a recent detection ID). Every write is listed at the end. Existing cases are never modified.
184
+
132
185
  **Cutting a release:** bump `version` in `package.json`, run `npm run build:mcpb`, commit `package.json`, `package-lock.json`, and `manifest.json`, tag, and attach the `.mcpb` from `release/` to the GitHub release. Publish to npm as before so the Claude Code and self-hosted options pick up the same version.
133
186
 
134
187
  ## Features
@@ -141,7 +194,9 @@ The script:
141
194
  - **Rate limit handling**: Retry with backoff on 429 responses
142
195
  - **Dual transport**: stdio (Claude Desktop, Claude Code, and the `.mcpb` bundle) or streamable HTTP (self-hosted)
143
196
  - **One-click install**: Ships as a Claude Desktop extension (`.mcpb`) with credentials held in the OS secure store
144
- - **Full API coverage**: 288 tools across endpoints, alerts, policies, firewalls, web filtering, licensing, audit events, email, mobile, XDR, cases, SIEM, and more
197
+ - **Two API generations**: the Sophos Central REST APIs and the Sophos Fusion GraphQL APIs on one credential, with `sophos_fusion_*` tools for the GraphQL side
198
+ - **Migration aware**: the Classic case and detection tools refuse a tenant that has moved to Sophos Fusion and name the `sophos_fusion_*` tool to use instead
199
+ - **Full API coverage**: 310 tools across endpoints, alerts, policies, firewalls, web filtering, licensing, audit events, email, mobile, XDR, cases, SIEM, and more
145
200
 
146
201
  ## Screenshots
147
202
 
@@ -174,10 +229,26 @@ TRANSPORT=http
174
229
  | `SOPHOS_CLIENT_SECRET` | Yes | - | OAuth2 client secret |
175
230
  | `PORT` | No | 3100 | HTTP server port |
176
231
  | `TRANSPORT` | No | http | `http` for streamable HTTP, `stdio` for subprocess mode |
232
+ | `MCP_HTTP_HOST` | No | 127.0.0.1 | Address the HTTP server binds to. `0.0.0.0` for every interface, or one interface's IP. See [Using it from other machines](#using-it-from-other-machines) |
233
+ | `MCP_HTTP_TOKEN` | No | - | When set, every `/mcp` request needs `Authorization: Bearer <token>`. `/health` stays open. Set it whenever `MCP_HTTP_HOST` is not loopback |
234
+ | `MCP_ALLOWED_ORIGINS` | No | - | Comma separated browser origins (`https://host:port`) allowed besides localhost ones. Only browser based clients need this |
177
235
  | `CHARACTER_LIMIT` | No | 50000 | Maximum characters per tool response before truncation (minimum 10000) |
236
+ | `SOPHOS_FUSION_GRAPHQL_URL` | No | `https://api.taegis.sophos.com/graphql` | Sophos Fusion GraphQL endpoint. Override when the Fusion branded hostnames ship. Must be `https` on a `sophos.com` host, since the bearer token goes to it; the server refuses to start otherwise |
237
+ | `SOPHOS_CLASSIC_MIGRATION_CHECK` | No | on | `off` skips the migration check on the Classic case and detection tools (they then run for every tenant) |
178
238
 
179
239
  ## Tools
180
240
 
241
+ ### Two API generations
242
+
243
+ The server speaks to two Sophos API generations on one credential:
244
+
245
+ - **Sophos Central REST APIs** (retained). Every tool without the `fusion` prefix. Regional hosts, discovered from `/whoami/v1`.
246
+ - **Sophos Fusion GraphQL APIs** (new, 18/09/2026). The `sophos_fusion_*` tools. One endpoint, `https://api.taegis.sophos.com/graphql`, same token, same `X-Tenant-ID` header. Filters are written in Fusion Query Language (QL). Case types, statuses and verdicts are tenant reference data resolved to IDs at runtime, case severity is an integer (2 to 10), and assignees are Subject IDs, not email addresses. A GraphQL failure arrives as HTTP 200 with an `errors` array; the client treats that as an error, and a partial response (data plus errors) is returned with a `warnings` list rather than as a clean result.
247
+
248
+ Sophos is moving tenants to Fusion over the coming months (the [upgrade centre](https://community.sophos.com/sophos-xdr/sophos-xdr-mdr-expansion/upgrade-center) announces each account's slot). This is a point in time change, not a fallback: once a tenant has moved, the Classic Cases and Detections REST APIs reference the pre-migration Sophos Central objects, so their answers are wrong rather than stale. The Classic tools therefore check which world a tenant is in before every call, using the Fusion case reference data (a tenant that has not moved gets an empty case type list), and refuse a migrated tenant with a message naming the `sophos_fusion_*` tool to use. For a tenant that has not moved they stay correct and carry no deprecation label. Fusion holds a separate case set (a UUID plus a `CSE#####` short ID) and neither ID form resolves in the other API. Live Discover and XDR Query are unaffected. Data Lake search over GraphQL has not shipped (Sophos says October 2026), so `sophos_run_xdr_query` stays on the SQL XDR Query API. Fusion tools for events, threat timeline and live endpoint search are planned.
249
+
250
+ Two Fusion case writes, `createCase` and `addEvidenceToCase`, fail 74% of the time with `not allowed` on `partnerPreferences` from `investigations-v2`. It is an intermittent downstream fault, not authorisation: the identical call succeeds on retry, and `updateCase` does not carry the fault at all. Measured on a live tenant 22/09/2026: 111 faults in 150 calls, drifting from 60% to 85% across four samples six minutes apart. The client retries a call whose first error path is `partnerPreferences`, and only that, up to 20 times with a short backoff, which leaves about 1 call in 410 failing at the measured rate and about 1 in 26 at the worst rate observed; an error naming the operation in its path is a real input or permission error and surfaces at once.
251
+
181
252
  ### Partner & Organisation (18 tools)
182
253
 
183
254
  > These tools are only available with **partner or organisation-level** credentials. They operate across all managed tenants.
@@ -369,11 +440,13 @@ TRANSPORT=http
369
440
 
370
441
  ### Cases (9 tools)
371
442
 
443
+ Sophos Central Cases REST API. Correct for a tenant that has not moved to Fusion, and the only way to read its legacy cases (IDs like `1-598868`). Refused for a tenant that has moved, with a pointer to the `sophos_fusion_*` tool to use (see "Two API generations").
444
+
372
445
  | Tool | Description |
373
446
  |------|-------------|
374
447
  | `sophos_list_cases` | List investigation cases |
375
448
  | `sophos_get_case` | Get full case details |
376
- | `sophos_create_case` | Create a new investigation case |
449
+ | `sophos_create_case` | Create a new investigation case (the API requires an assignee and a detection that still exists) |
377
450
  | `sophos_update_case` | Update case status, severity, assignee |
378
451
  | `sophos_delete_case` | Delete a case |
379
452
  | `sophos_list_case_detections` | List detections linked to a case |
@@ -381,9 +454,47 @@ TRANSPORT=http
381
454
  | `sophos_list_case_impacted_entities` | List impacted entities for a case |
382
455
  | `sophos_get_case_mitre_summary` | Get MITRE ATT&CK breakdown for a case |
383
456
 
457
+ ### Fusion Cases (21 tools)
458
+
459
+ Sophos Fusion Cases GraphQL API v2. Case IDs are UUIDs; short IDs (`CSE00001`) are accepted and resolved. Severity is 2 informational, 4 low, 6 medium, 8 high, 10 critical. Detection severity inside the case summary is a 0 to 1 float, a different scale from both the case severity and the Classic REST 0 to 10 detection severity; none of them convert. There is no delete: close the case (with a verdict when its type needs one), then archive it.
460
+
461
+ `managed_by` is required on create and decides who works the case: `PROVIDER` hands it to Sophos MDR, `CUSTOMER` keeps it self managed. It cannot be changed afterwards, and a case created without it is unclaimed, so the tool never omits it. Detection and event IDs on the evidence tools are six section resource names (`alert://priv:event-filter:123456:1789526908712:<uuid>`), which `sophos_fusion_search_detections` returns. Evidence writes are queued jobs that land category by category (an add showed after about 5 seconds, a three category removal took about 25 seconds), so read the evidence back with a poll; adding a detection also attaches its linked asset and events, and removing it does not retract them (`remove_all` does). Comment @mentions (`@authorized_contacts`, `@customer`, `@sophos`) fire wherever they appear, including in prose, and an unrecognised token is dropped silently, so the comment tools read the stored mentions back. Tags are merged on update unless `replace_tags` is set. File deletion is soft. Split and merge are irreversible and need a confirmation argument.
462
+
463
+ | Tool | Description |
464
+ |------|-------------|
465
+ | `sophos_fusion_list_cases` | List cases with QL filters (type, status, verdict resolved to IDs), offset or cursor pagination |
466
+ | `sophos_fusion_get_case` | Full case detail including key findings, verdict, links and processing status |
467
+ | `sophos_fusion_get_case_evidence` | Detection, event, asset and saved-search source IDs attached to a case |
468
+ | `sophos_fusion_get_case_summary` | Case plus its detections resolved in one batched call and a MITRE ATT&CK roll-up |
469
+ | `sophos_fusion_list_case_reference_data` | The tenant's case types, primary statuses and verdicts (15 minute cache) |
470
+ | `sophos_fusion_create_case` | Create a case: required managed_by, type and status by name or ID, integer severity, Markdown key findings, genesis evidence |
471
+ | `sophos_fusion_update_case` | Update fields, merge or replace tags, close with a verdict, reopen (verdict cleared), archive or unarchive; refuses frozen fields on a closed case rather than reopening it |
472
+ | `sophos_fusion_split_case` | Move named evidence into a new case (irreversible, confirm_split) |
473
+ | `sophos_fusion_merge_cases` | Merge source cases into a target and close them (asynchronous, irreversible, confirm_merge) |
474
+ | `sophos_fusion_list_case_comments` | List comments (raw author IDs, resolved mentions, read state) |
475
+ | `sophos_fusion_add_case_comment` | Add a comment and report which @mentions actually fired |
476
+ | `sophos_fusion_update_case_comment` | Edit a comment or mark it read |
477
+ | `sophos_fusion_delete_case_comment` | Delete a comment |
478
+ | `sophos_fusion_add_case_evidence` | Attach detections, events, hosts or saved searches (asynchronous, RNs checked) |
479
+ | `sophos_fusion_remove_case_evidence` | Detach evidence by source ID, or everything with remove_all (asynchronous) |
480
+ | `sophos_fusion_list_case_files` | List a case's files (deleted hidden by default, download URLs on request) |
481
+ | `sophos_fusion_upload_case_file` | Attach a file: register, PUT to the presigned URL, poll to UPLOADED |
482
+ | `sophos_fusion_delete_case_file` | Soft delete a file |
483
+ | `sophos_fusion_create_case_link` | Attach an external link (ServiceNow ticket, report) |
484
+ | `sophos_fusion_update_case_link` | Change a link's URL, title, type or reference |
485
+ | `sophos_fusion_delete_case_link` | Remove a link |
486
+
487
+ ### Fusion Detections (1 tool)
488
+
489
+ Sophos Fusion Detections GraphQL API v2. One QL search replaces the Classic run, poll, results triple. Source keyword `alert`; working example `from alert severity >= 0.1 EARLIEST=-90d`. Severity is a 0 to 1 float.
490
+
491
+ | Tool | Description |
492
+ |------|-------------|
493
+ | `sophos_fusion_search_detections` | Search detections with QL; returns the resource-name IDs the case evidence tools take |
494
+
384
495
  ### Detections (6 tools)
385
496
 
386
- Async API — start a query, poll for completion, then fetch results.
497
+ Sophos Central Detections REST API, async: start a query, poll for completion, then fetch results. Refused for a tenant that has moved to Fusion, with a pointer to `sophos_fusion_search_detections`.
387
498
 
388
499
  | Tool | Description |
389
500
  |------|-------------|
@@ -403,7 +514,7 @@ Async API — start a query, poll for completion, then fetch results.
403
514
 
404
515
  ### XDR Data Lake (9 tools)
405
516
 
406
- Async API — submit SQL queries against historical telemetry.
517
+ Async API: submit SQL queries against historical telemetry.
407
518
 
408
519
  | Tool | Description |
409
520
  |------|-------------|
@@ -419,7 +530,7 @@ Async API — submit SQL queries against historical telemetry.
419
530
 
420
531
  ### Live Discover (4 tools)
421
532
 
422
- Async API — run OSquery SQL on live endpoints. Rate limited to 10 runs/minute, 500/day.
533
+ Async API: run OSquery SQL on live endpoints. Rate limited to 10 runs/minute, 500/day.
423
534
 
424
535
  | Tool | Description |
425
536
  |------|-------------|
@@ -652,27 +763,40 @@ Register tools based on identity type
652
763
  |
653
764
  v
654
765
  Per tool call: resolve tenant -> regional API host -> execute request
766
+ Per sophos_fusion_* call: resolve tenant -> POST api.taegis.sophos.com/graphql -> inspect data and errors
655
767
  ```
656
768
 
657
769
  ### Key decisions
658
770
 
659
771
  - **Dynamic tool registration**: Only tools valid for the caller type are exposed to the LLM
660
772
  - **Explicit tenant context**: Partner/org callers must specify `tenant_id` to prevent cross-tenant accidents
661
- - **Stateless HTTP**: Each MCP request creates a fresh transport instance (no session affinity)
662
- - **Localhost binding**: HTTP server binds to `127.0.0.1` only
773
+ - **Stateless HTTP**: Each MCP request creates a fresh server and transport instance (no session affinity)
774
+ - **Localhost by default**: HTTP server binds to `127.0.0.1` unless `MCP_HTTP_HOST` says otherwise
663
775
 
664
776
  ## Project Structure
665
777
 
666
778
  ```
667
779
  src/
668
780
  ├── index.ts # Entry point, server bootstrap
781
+ ├── http-guard.ts # HTTP transport: refuse foreign browser Origins, optional bearer token
669
782
  ├── config/config.ts # Environment config
670
783
  ├── auth/token-manager.ts # OAuth2 token lifecycle
671
784
  ├── client/
672
- │ ├── sophos-client.ts # HTTP client with region routing
785
+ │ ├── sophos-client.ts # REST client with region routing (Sophos Central)
786
+ │ ├── fusion-client.ts # GraphQL client (Sophos Fusion), 200-with-errors handling, path-keyed retry
673
787
  │ └── tenant-resolver.ts # Whoami + tenant cache
788
+ ├── fusion/
789
+ │ ├── queries/cases.ts # Cases v2 GraphQL documents
790
+ │ ├── queries/detections.ts # Detections v2 documents: the case summary lookup and the QL search
791
+ │ ├── case-reference-data.ts # Per-tenant cache of case types, statuses, verdicts
792
+ │ ├── cases-ql.ts # QL builder for the cases search
793
+ │ ├── format.ts # Severity scales, timestamps, ID checks, mentions, tags, detection rows
794
+ │ ├── migration.ts # Has this tenant moved to Fusion? Gates the Classic case and detection tools
795
+ │ └── types.ts # Fusion response types
674
796
  ├── tools/
675
797
  │ ├── helpers.ts # Shared response formatting
798
+ │ ├── fusion-cases.ts # Sophos Fusion cases (GraphQL)
799
+ │ ├── fusion-detections.ts # Sophos Fusion detection search (GraphQL)
676
800
  │ ├── tenants.ts # Tenant listing (partner/org only)
677
801
  │ ├── partner.ts # Partner admin, roles, billing (partner/org only)
678
802
  │ ├── alerts.ts # Alert list, get, acknowledge, search
@@ -700,15 +824,16 @@ src/
700
824
  └── types/sophos.ts # Sophos API response types
701
825
  ```
702
826
 
703
- Packaging files at the repo root: `manifest.json` (MCPB manifest, regenerated by the build), `scripts/build-mcpb.mjs` (bundle builder), and `.mcpbignore` (extra exclusions applied when packing).
827
+ Packaging files at the repo root: `manifest.json` (MCPB manifest, regenerated by the build), `scripts/build-mcpb.mjs` (bundle builder), and `.mcpbignore` (extra exclusions applied when packing). `schemas/fusion/` holds the five Fusion GraphQL schemas as downloaded from `https://developer.sophos.com/assets/graphql/<api>.graphql` on 21/09/2026, unmodified, for reference and for diffing when Sophos changes them. `test/` holds the `node:test` suites and `scripts/fusion-smoke.mjs` the live check.
704
828
 
705
829
  ## Security
706
830
 
707
831
  - Credentials are read from environment variables only, never logged
708
832
  - JWT tokens are held in memory with automatic refresh
709
- - HTTP server binds to `127.0.0.1` (localhost only)
833
+ - HTTP server binds to `127.0.0.1` by default and refuses requests from a browser `Origin` that is not localhost or listed in `MCP_ALLOWED_ORIGINS`. If `MCP_HTTP_HOST` opens it to the network, set `MCP_HTTP_TOKEN` and put TLS in front (a reverse proxy or Tailscale)
710
834
  - Write actions have `destructiveHint` annotations so clients can warn users
711
835
  - Partner/org callers require explicit `tenant_id` on every call
836
+ - The REST client refuses a request path where an ID argument carries a `.` or `..` segment (encoded too), `?`, `#`, a backslash, an encoded `/` or a control character, so a crafted ID cannot redirect a call to another resource
712
837
  - With the `.mcpb` install, Claude Desktop holds the credentials in the OS secure store (they are `sensitive` in `manifest.json`) and hands them to the server as environment variables when it starts the process
713
838
 
714
839
  ## License
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1,132 @@
1
+ /**
2
+ * GraphQL client for the Sophos Fusion APIs (Cases v2, Detections v2, Threat
3
+ * Timeline v2, Events v1, Live Endpoint Search v1). Sits beside SophosClient,
4
+ * which keeps serving the Sophos Central REST APIs.
5
+ *
6
+ * One endpoint for every tenant, no regional host lookup. Auth is unchanged:
7
+ * the same bearer token from TokenManager and the same X-Tenant-ID header the
8
+ * REST client sends.
9
+ *
10
+ * The rule that shapes this file: a GraphQL-layer failure comes back as HTTP
11
+ * 200 with an `errors` array beside `data`. A 200 is not success until the
12
+ * body has been read. Transport failures (expired token, 429, 5xx) use the
13
+ * usual non-2xx status and the standard Sophos error object, and those are
14
+ * retried the same way SophosClient retries them. GraphQL-layer errors are
15
+ * not retried, with one measured exception: the intermittent
16
+ * partnerPreferences fault on the case write path, which is keyed on the
17
+ * error path and bounded (see FusionGraphQLError.isTransientPartnerPreferences).
18
+ */
19
+ import type { TokenManager } from "../auth/token-manager.js";
20
+ /** One entry of a GraphQL response `errors` array. */
21
+ export interface GraphQLErrorEntry {
22
+ message: string;
23
+ path?: Array<string | number>;
24
+ locations?: Array<{
25
+ line: number;
26
+ column: number;
27
+ }>;
28
+ extensions?: Record<string, unknown>;
29
+ }
30
+ interface GraphQLResponseBody<T> {
31
+ data?: T | null;
32
+ errors?: GraphQLErrorEntry[];
33
+ }
34
+ export interface FusionQueryResult<T> {
35
+ /** The response `data` object. Never null: a response with no usable data throws. */
36
+ data: T;
37
+ /**
38
+ * GraphQL errors that arrived beside usable data (a partial response, for
39
+ * example a federated field that could not be resolved). Empty on a clean
40
+ * response. Tools must surface these; they are not silently dropped.
41
+ */
42
+ warnings: string[];
43
+ }
44
+ export interface FusionClientOptions {
45
+ /** GraphQL endpoint. Defaults to SOPHOS_FUSION_GRAPHQL_URL. */
46
+ url?: string;
47
+ /** Per-attempt timeout. Default 30 s, matching SophosClient. */
48
+ timeoutMs?: number;
49
+ /** Retries after the first attempt for 429, 5xx and network errors. Default 2. */
50
+ retries?: number;
51
+ /** Base for the full-jitter exponential backoff. Default 1000 ms. */
52
+ backoffBaseMs?: number;
53
+ /**
54
+ * Total attempts for a call that hits the transient partnerPreferences
55
+ * fault, which affects createCase and addEvidenceToCase. Measured on a live
56
+ * tenant 22/09/2026: 111 faults in 150 calls, so 74%, and it drifts, with
57
+ * four samples over six minutes running 60%, 85%, 72.5% and 80%. Default 20:
58
+ * about 1 call in 410 fails at the measured 74%, and about 1 in 26 at the
59
+ * worst rate observed. updateCase does not carry the fault at all, 0 in 30
60
+ * in the same minute addEvidenceToCase was 24 in 30, so the defect is in the
61
+ * two resolvers that read partner preferences.
62
+ */
63
+ transientAttempts?: number;
64
+ /** Base for the short full-jitter backoff between those attempts. Default 300 ms, capped at 2 s. */
65
+ transientBackoffMs?: number;
66
+ }
67
+ /** Thrown when the GraphQL layer returns errors and no usable data. */
68
+ export declare class FusionGraphQLError extends Error {
69
+ readonly errors: GraphQLErrorEntry[];
70
+ constructor(message: string, errors: GraphQLErrorEntry[]);
71
+ /**
72
+ * True when every error says the record does not exist. Fusion reports an
73
+ * unknown case ID this way, as HTTP 200 with "record not found" beside a
74
+ * null root field, rather than as a bare null (live tenant, 21/09/2026).
75
+ */
76
+ get notFound(): boolean;
77
+ /**
78
+ * True for the intermittent investigations-v2 fault on the case write
79
+ * path: `errors[0].path[0]` is "partnerPreferences" ("not allowed",
80
+ * DOWNSTREAM_SERVICE_ERROR). It is not an authorisation failure: the
81
+ * identical call with identical input succeeds on retry. Keyed on the path
82
+ * and nothing else, because `extensions.code` is DOWNSTREAM_SERVICE_ERROR
83
+ * for transient faults, not found and malformed queries alike, while a
84
+ * genuine input or permission error carries the operation name in the path
85
+ * (createCase, addEvidenceToCase, tdrusers) with a specific message.
86
+ */
87
+ get isTransientPartnerPreferences(): boolean;
88
+ }
89
+ export declare class FusionClient {
90
+ private tokenManager;
91
+ private readonly url;
92
+ private readonly timeoutMs;
93
+ private readonly retries;
94
+ private readonly backoffBaseMs;
95
+ private readonly transientAttempts;
96
+ private readonly transientBackoffMs;
97
+ constructor(tokenManager: TokenManager, options?: FusionClientOptions);
98
+ /** The endpoint this client posts to. */
99
+ get endpoint(): string;
100
+ /**
101
+ * Run a GraphQL query or mutation for a tenant.
102
+ *
103
+ * Returns the `data` object plus any partial-response warnings. Throws
104
+ * FusionGraphQLError when the response carries errors and no usable data,
105
+ * and a plain Error for transport failures. The transient partnerPreferences
106
+ * fault is retried up to transientAttempts times; every other GraphQL-layer
107
+ * error surfaces at once.
108
+ */
109
+ query<T extends object>(tenantId: string, document: string, variables?: Record<string, unknown>): Promise<FusionQueryResult<T>>;
110
+ /**
111
+ * PUT raw bytes to a presigned upload URL (case files). The signature lives
112
+ * in the URL, so no bearer token is sent, and the Content-Type must match
113
+ * what startCaseFileUpload was told. One attempt, no retry.
114
+ */
115
+ putPresigned(url: string, body: Uint8Array, contentType: string): Promise<void>;
116
+ private executeWithRetry;
117
+ private sleep;
118
+ }
119
+ /**
120
+ * Decide what a 200 response actually means.
121
+ *
122
+ * - errors present, no usable data: throw with every message joined.
123
+ * - errors present beside usable data: return the data with the errors as warnings.
124
+ * - no errors, data present: clean result. A root field that is null with no
125
+ * error (for example `case` for an unknown ID) is legitimate and passes
126
+ * through for the tool to report.
127
+ * - no errors, no data: malformed, throw.
128
+ */
129
+ export declare function interpretGraphQLBody<T extends object>(body: GraphQLResponseBody<T> | null | undefined): FusionQueryResult<T>;
130
+ export declare function formatGraphQLError(error: GraphQLErrorEntry): string;
131
+ export {};
132
+ //# sourceMappingURL=fusion-client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fusion-client.d.ts","sourceRoot":"","sources":["../../src/client/fusion-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAG7D,sDAAsD;AACtD,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IAC9B,SAAS,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACpD,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACtC;AAED,UAAU,mBAAmB,CAAC,CAAC;IAC7B,IAAI,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC;IAChB,MAAM,CAAC,EAAE,iBAAiB,EAAE,CAAC;CAC9B;AAED,MAAM,WAAW,iBAAiB,CAAC,CAAC;IAClC,qFAAqF;IACrF,IAAI,EAAE,CAAC,CAAC;IACR;;;;OAIG;IACH,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,MAAM,WAAW,mBAAmB;IAClC,+DAA+D;IAC/D,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,gEAAgE;IAChE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kFAAkF;IAClF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,qEAAqE;IACrE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;;;;;;OASG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,oGAAoG;IACpG,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAID,uEAAuE;AACvE,qBAAa,kBAAmB,SAAQ,KAAK;IAGzC,QAAQ,CAAC,MAAM,EAAE,iBAAiB,EAAE;gBADpC,OAAO,EAAE,MAAM,EACN,MAAM,EAAE,iBAAiB,EAAE;IAMtC;;;;OAIG;IACH,IAAI,QAAQ,IAAI,OAAO,CAKtB;IAED;;;;;;;;;OASG;IACH,IAAI,6BAA6B,IAAI,OAAO,CAE3C;CACF;AAED,qBAAa,YAAY;IASrB,OAAO,CAAC,YAAY;IARtB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAS;IAC7B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAS;IACvC,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAS;IAC3C,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAS;gBAGlC,YAAY,EAAE,YAAY,EAClC,OAAO,GAAE,mBAAwB;IAUnC,yCAAyC;IACzC,IAAI,QAAQ,IAAI,MAAM,CAErB;IAED;;;;;;;;OAQG;IACG,KAAK,CAAC,CAAC,SAAS,MAAM,EAC1B,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,SAAS,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,GACtC,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC;IAsChC;;;;OAIG;IACG,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;YA2BvE,gBAAgB;IAqF9B,OAAO,CAAC,KAAK;CAGd;AAED;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,MAAM,EACnD,IAAI,EAAE,mBAAmB,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,SAAS,GAC9C,iBAAiB,CAAC,CAAC,CAAC,CAqBtB;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,iBAAiB,GAAG,MAAM,CAUnE"}