@cyanheads/mcp-ts-core 0.13.9 → 0.13.11

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 (192) hide show
  1. package/AGENTS.md +41 -15
  2. package/CLAUDE.md +41 -15
  3. package/README.md +37 -11
  4. package/biome.json +1 -1
  5. package/changelog/0.13.x/0.13.10.md +118 -0
  6. package/changelog/0.13.x/0.13.11.md +113 -0
  7. package/dist/cli/app-render.d.ts +11 -0
  8. package/dist/cli/app-render.d.ts.map +1 -0
  9. package/dist/cli/app-render.js +150 -0
  10. package/dist/cli/app-render.js.map +1 -0
  11. package/dist/cli/init.d.ts +2 -1
  12. package/dist/cli/init.d.ts.map +1 -1
  13. package/dist/cli/init.js +10 -2
  14. package/dist/cli/init.js.map +1 -1
  15. package/dist/config/index.d.ts +3 -0
  16. package/dist/config/index.d.ts.map +1 -1
  17. package/dist/config/index.js +11 -0
  18. package/dist/config/index.js.map +1 -1
  19. package/dist/core/app.d.ts.map +1 -1
  20. package/dist/core/app.js +15 -1
  21. package/dist/core/app.js.map +1 -1
  22. package/dist/core/context.d.ts +92 -22
  23. package/dist/core/context.d.ts.map +1 -1
  24. package/dist/core/context.js +65 -16
  25. package/dist/core/context.js.map +1 -1
  26. package/dist/core/index.d.ts +1 -1
  27. package/dist/core/index.d.ts.map +1 -1
  28. package/dist/core/index.js.map +1 -1
  29. package/dist/core/worker.d.ts +6 -0
  30. package/dist/core/worker.d.ts.map +1 -1
  31. package/dist/core/worker.js +1 -0
  32. package/dist/core/worker.js.map +1 -1
  33. package/dist/linter/rules/error-contract-rules.d.ts +3 -44
  34. package/dist/linter/rules/error-contract-rules.d.ts.map +1 -1
  35. package/dist/linter/rules/error-contract-rules.js +8 -144
  36. package/dist/linter/rules/error-contract-rules.js.map +1 -1
  37. package/dist/linter/rules/index.d.ts +1 -1
  38. package/dist/linter/rules/index.d.ts.map +1 -1
  39. package/dist/linter/rules/index.js +1 -1
  40. package/dist/linter/rules/index.js.map +1 -1
  41. package/dist/linter/rules/resource-rules.d.ts.map +1 -1
  42. package/dist/linter/rules/resource-rules.js +1 -2
  43. package/dist/linter/rules/resource-rules.js.map +1 -1
  44. package/dist/linter/rules/tool-rules.d.ts.map +1 -1
  45. package/dist/linter/rules/tool-rules.js +1 -2
  46. package/dist/linter/rules/tool-rules.js.map +1 -1
  47. package/dist/mcp-server/handlerContext.d.ts +26 -13
  48. package/dist/mcp-server/handlerContext.d.ts.map +1 -1
  49. package/dist/mcp-server/handlerContext.js +32 -17
  50. package/dist/mcp-server/handlerContext.js.map +1 -1
  51. package/dist/mcp-server/inputRequired.d.ts +120 -8
  52. package/dist/mcp-server/inputRequired.d.ts.map +1 -1
  53. package/dist/mcp-server/inputRequired.js +177 -12
  54. package/dist/mcp-server/inputRequired.js.map +1 -1
  55. package/dist/mcp-server/prompts/prompt-registration.d.ts +10 -2
  56. package/dist/mcp-server/prompts/prompt-registration.d.ts.map +1 -1
  57. package/dist/mcp-server/prompts/prompt-registration.js +49 -11
  58. package/dist/mcp-server/prompts/prompt-registration.js.map +1 -1
  59. package/dist/mcp-server/resources/resource-registration.d.ts +4 -2
  60. package/dist/mcp-server/resources/resource-registration.d.ts.map +1 -1
  61. package/dist/mcp-server/resources/resource-registration.js +6 -4
  62. package/dist/mcp-server/resources/resource-registration.js.map +1 -1
  63. package/dist/mcp-server/resources/utils/resourceHandlerFactory.d.ts +4 -3
  64. package/dist/mcp-server/resources/utils/resourceHandlerFactory.d.ts.map +1 -1
  65. package/dist/mcp-server/resources/utils/resourceHandlerFactory.js +60 -21
  66. package/dist/mcp-server/resources/utils/resourceHandlerFactory.js.map +1 -1
  67. package/dist/mcp-server/server.d.ts +9 -0
  68. package/dist/mcp-server/server.d.ts.map +1 -1
  69. package/dist/mcp-server/server.js +14 -13
  70. package/dist/mcp-server/server.js.map +1 -1
  71. package/dist/mcp-server/tools/tool-registration.d.ts +7 -3
  72. package/dist/mcp-server/tools/tool-registration.d.ts.map +1 -1
  73. package/dist/mcp-server/tools/tool-registration.js +9 -5
  74. package/dist/mcp-server/tools/tool-registration.js.map +1 -1
  75. package/dist/mcp-server/tools/utils/toolHandlerFactory.d.ts +17 -9
  76. package/dist/mcp-server/tools/utils/toolHandlerFactory.d.ts.map +1 -1
  77. package/dist/mcp-server/tools/utils/toolHandlerFactory.js +91 -50
  78. package/dist/mcp-server/tools/utils/toolHandlerFactory.js.map +1 -1
  79. package/dist/mcp-server/transports/http/httpErrorHandler.d.ts.map +1 -1
  80. package/dist/mcp-server/transports/http/httpErrorHandler.js +7 -1
  81. package/dist/mcp-server/transports/http/httpErrorHandler.js.map +1 -1
  82. package/dist/services/mirror/sqlite/handle.d.ts +11 -5
  83. package/dist/services/mirror/sqlite/handle.d.ts.map +1 -1
  84. package/dist/services/mirror/sqlite/handle.js +46 -8
  85. package/dist/services/mirror/sqlite/handle.js.map +1 -1
  86. package/dist/services/mirror/sqlite/sqliteMirrorStore.d.ts +6 -1
  87. package/dist/services/mirror/sqlite/sqliteMirrorStore.d.ts.map +1 -1
  88. package/dist/services/mirror/sqlite/sqliteMirrorStore.js.map +1 -1
  89. package/dist/testing/apps/browser.d.ts +27 -0
  90. package/dist/testing/apps/browser.d.ts.map +1 -0
  91. package/dist/testing/apps/browser.js +162 -0
  92. package/dist/testing/apps/browser.js.map +1 -0
  93. package/dist/testing/apps/cdp-pipe.d.ts +79 -0
  94. package/dist/testing/apps/cdp-pipe.d.ts.map +1 -0
  95. package/dist/testing/apps/cdp-pipe.js +200 -0
  96. package/dist/testing/apps/cdp-pipe.js.map +1 -0
  97. package/dist/testing/apps/csp.d.ts +17 -0
  98. package/dist/testing/apps/csp.d.ts.map +1 -0
  99. package/dist/testing/apps/csp.js +50 -0
  100. package/dist/testing/apps/csp.js.map +1 -0
  101. package/dist/testing/apps/host-pages.d.ts +47 -0
  102. package/dist/testing/apps/host-pages.d.ts.map +1 -0
  103. package/dist/testing/apps/host-pages.js +138 -0
  104. package/dist/testing/apps/host-pages.js.map +1 -0
  105. package/dist/testing/apps/index.d.ts +167 -0
  106. package/dist/testing/apps/index.d.ts.map +1 -0
  107. package/dist/testing/apps/index.js +36 -0
  108. package/dist/testing/apps/index.js.map +1 -0
  109. package/dist/testing/apps/partial-json.d.ts +14 -0
  110. package/dist/testing/apps/partial-json.d.ts.map +1 -0
  111. package/dist/testing/apps/partial-json.js +71 -0
  112. package/dist/testing/apps/partial-json.js.map +1 -0
  113. package/dist/testing/apps/run.d.ts +13 -0
  114. package/dist/testing/apps/run.d.ts.map +1 -0
  115. package/dist/testing/apps/run.js +659 -0
  116. package/dist/testing/apps/run.js.map +1 -0
  117. package/dist/testing/index.d.ts +17 -2
  118. package/dist/testing/index.d.ts.map +1 -1
  119. package/dist/testing/index.js +21 -7
  120. package/dist/testing/index.js.map +1 -1
  121. package/dist/types-global/errors.d.ts +18 -15
  122. package/dist/types-global/errors.d.ts.map +1 -1
  123. package/dist/utils/index.d.ts +1 -1
  124. package/dist/utils/index.d.ts.map +1 -1
  125. package/dist/utils/index.js +1 -1
  126. package/dist/utils/index.js.map +1 -1
  127. package/dist/utils/internal/error-handler/errorHandler.d.ts +5 -4
  128. package/dist/utils/internal/error-handler/errorHandler.d.ts.map +1 -1
  129. package/dist/utils/internal/error-handler/errorHandler.js +9 -7
  130. package/dist/utils/internal/error-handler/errorHandler.js.map +1 -1
  131. package/dist/utils/internal/error-handler/types.d.ts +3 -1
  132. package/dist/utils/internal/error-handler/types.d.ts.map +1 -1
  133. package/dist/utils/internal/logger.d.ts +21 -1
  134. package/dist/utils/internal/logger.d.ts.map +1 -1
  135. package/dist/utils/internal/logger.js +31 -14
  136. package/dist/utils/internal/logger.js.map +1 -1
  137. package/dist/utils/internal/performance.d.ts +7 -3
  138. package/dist/utils/internal/performance.d.ts.map +1 -1
  139. package/dist/utils/internal/performance.js +16 -9
  140. package/dist/utils/internal/performance.js.map +1 -1
  141. package/dist/utils/internal/telemetryMessages.d.ts +0 -1
  142. package/dist/utils/internal/telemetryMessages.d.ts.map +1 -1
  143. package/dist/utils/internal/telemetryMessages.js +0 -1
  144. package/dist/utils/internal/telemetryMessages.js.map +1 -1
  145. package/dist/utils/security/sanitization.d.ts +16 -13
  146. package/dist/utils/security/sanitization.d.ts.map +1 -1
  147. package/dist/utils/security/sanitization.js +74 -33
  148. package/dist/utils/security/sanitization.js.map +1 -1
  149. package/dist/utils/telemetry/attributes.d.ts +12 -5
  150. package/dist/utils/telemetry/attributes.d.ts.map +1 -1
  151. package/dist/utils/telemetry/attributes.js +12 -5
  152. package/dist/utils/telemetry/attributes.js.map +1 -1
  153. package/framework-skills/add-app-tool/SKILL.md +2 -1
  154. package/framework-skills/add-service/SKILL.md +3 -12
  155. package/framework-skills/add-test/SKILL.md +20 -17
  156. package/framework-skills/add-tool/SKILL.md +30 -34
  157. package/framework-skills/api-config/SKILL.md +12 -2
  158. package/framework-skills/api-context/SKILL.md +156 -41
  159. package/framework-skills/api-errors/SKILL.md +43 -47
  160. package/framework-skills/api-linter/SKILL.md +5 -29
  161. package/framework-skills/api-mirror/SKILL.md +4 -3
  162. package/framework-skills/api-telemetry/SKILL.md +16 -10
  163. package/framework-skills/api-testing/SKILL.md +47 -11
  164. package/framework-skills/api-utils/SKILL.md +3 -3
  165. package/framework-skills/api-workers/SKILL.md +3 -1
  166. package/framework-skills/code-simplifier/SKILL.md +2 -2
  167. package/framework-skills/design-mcp-server/SKILL.md +5 -5
  168. package/framework-skills/field-test/SKILL.md +53 -8
  169. package/framework-skills/git-wrapup/SKILL.md +2 -2
  170. package/framework-skills/orchestrations/SKILL.md +1 -1
  171. package/framework-skills/orchestrations/workflows/greenfield-build.md +2 -2
  172. package/framework-skills/polish-docs-meta/SKILL.md +4 -3
  173. package/framework-skills/polish-docs-meta/references/server-json.md +24 -26
  174. package/framework-skills/release-and-publish/SKILL.md +3 -3
  175. package/framework-skills/release-pr-review/SKILL.md +6 -6
  176. package/framework-skills/security-pass/SKILL.md +8 -7
  177. package/framework-skills/setup/SKILL.md +2 -2
  178. package/package.json +38 -22
  179. package/scripts/devcheck.ts +43 -21
  180. package/scripts/install-otel.ts +84 -0
  181. package/scripts/lint-packaging.ts +279 -28
  182. package/scripts/prune-musl-packages.ts +146 -0
  183. package/templates/.env.example +2 -0
  184. package/templates/.github/workflows/codeql.yml +10 -1
  185. package/templates/AGENTS.md +5 -4
  186. package/templates/CLAUDE.md +5 -4
  187. package/templates/Dockerfile +76 -50
  188. package/templates/_.dockerignore +3 -5
  189. package/templates/_.gitignore +4 -4
  190. package/templates/package.json +4 -4
  191. package/templates/server.json +7 -21
  192. package/templates/src/mcp-server/tools/definitions/echo.tool.ts +3 -8
@@ -3,11 +3,12 @@
3
3
  * Constructs Context (with `uri`), checks inline auth, validates params, formats response.
4
4
  * @module src/mcp-server/resources/utils/resourceHandlerFactory
5
5
  */
6
+ import { resolveDeclaredFailure } from '../../../core/context.js';
6
7
  import { buildHandlerContext, handlerParentContext, resolveHandlerRequest, } from '../../handlerContext.js';
7
- import { isInputRequiredSignal } from '../../inputRequired.js';
8
+ import { isInputRequiredSignal, sealThrown, } from '../../inputRequired.js';
8
9
  import { parseOutputContract } from '../../outputContract.js';
9
10
  import { withRequiredScopes } from '../../transports/auth/lib/authUtils.js';
10
- import { McpError } from '../../../types-global/errors.js';
11
+ import { JsonRpcErrorCode, McpError } from '../../../types-global/errors.js';
11
12
  import { asRequestCancelled, ErrorHandler } from '../../../utils/internal/error-handler/errorHandler.js';
12
13
  import { measureResourceExecution } from '../../../utils/internal/performance.js';
13
14
  import { requestContextService } from '../../../utils/internal/requestContext.js';
@@ -38,16 +39,26 @@ export function defaultResponseFormatter(result, meta) {
38
39
  },
39
40
  ];
40
41
  }
41
- /** Strip URL components that commonly carry credentials or caller secrets
42
- * before the URI reaches logs or telemetry. The protocol response still uses
43
- * the original URI; this projection is observability-only. */
42
+ /** The longest URI a read's log records and span carry: 1 KiB, since the projection is ASCII. */
43
+ const OBSERVABLE_URI_MAX_LENGTH = 1024;
44
+ /**
45
+ * The URI a read's log records and span carry: userinfo, query, and fragment
46
+ * stripped — they commonly carry credentials or caller secrets — then cut to
47
+ * its first {@link OBSERVABLE_URI_MAX_LENGTH} characters, since a client sets
48
+ * its length. `uriLength` is the uncut projection's length, present only when
49
+ * the cut removed something. The handler's `ctx.uri` and the response keep the
50
+ * original URI; this projection is observability-only.
51
+ */
44
52
  function observableResourceUri(uri) {
45
53
  const safe = new URL(uri.href);
46
54
  safe.username = '';
47
55
  safe.password = '';
48
56
  safe.search = '';
49
57
  safe.hash = '';
50
- return safe.href;
58
+ const { href } = safe;
59
+ return href.length > OBSERVABLE_URI_MAX_LENGTH
60
+ ? { uri: href.slice(0, OBSERVABLE_URI_MAX_LENGTH), uriLength: href.length }
61
+ : { uri: href };
51
62
  }
52
63
  // ---------------------------------------------------------------------------
53
64
  // Factory
@@ -62,23 +73,25 @@ function observableResourceUri(uri) {
62
73
  * - Checks inline `auth` scopes if defined
63
74
  * - Validates params via Zod schema
64
75
  * - Formats response via `format` or JSON default
65
- * - Catches errors and re-throws for the SDK
76
+ * - Catches errors and re-throws for the SDK, with the declared recovery filled
77
+ * (#579) and the read's request id added (#576)
66
78
  */
67
- export function createResourceHandler(def, services, notifiers, inputGate) {
79
+ export function createResourceHandler(def, services, notifiers, capabilities) {
68
80
  const mimeType = def.mimeType ?? 'application/json';
69
81
  const formatter = def.format ?? defaultResponseFormatter;
70
82
  const resourceName = def.name ?? def.uriTemplate;
71
83
  return async (uri, variables, serverContext) => {
72
84
  const request = resolveHandlerRequest(serverContext, services, notifiers);
73
- const resourceUri = observableResourceUri(uri);
85
+ const observed = observableResourceUri(uri);
74
86
  // The URI template already captures the named segments; anything else is
75
87
  // query-string / caller-supplied and belongs in metrics, not logs.
76
88
  const appContext = requestContextService.createRequestContext({
77
- parentContext: handlerParentContext(request),
89
+ parentContext: handlerParentContext(serverContext),
78
90
  operation: 'HandleResourceRead',
79
91
  additionalContext: {
80
92
  resourceName,
81
- resourceUri,
93
+ resourceUri: observed.uri,
94
+ ...(observed.uriLength !== undefined && { resourceUriLength: observed.uriLength }),
82
95
  resourceHasQuery: uri.search.length > 0,
83
96
  },
84
97
  });
@@ -94,7 +107,7 @@ export function createResourceHandler(def, services, notifiers, inputGate) {
94
107
  // outcome, so a failure in either is a failed read. Closing the span when
95
108
  // the handler returned recorded those as successes (#346).
96
109
  return await measureResourceExecution(async (spanContext, recordOutput) => {
97
- const ctx = buildHandlerContext(request, services, spanContext, def.errors, inputGate, uri);
110
+ const ctx = buildHandlerContext(request, services, spanContext, def.errors, capabilities, uri);
98
111
  try {
99
112
  // Handler may return sync or async.
100
113
  const handlerResult = await def.handler(validatedParams, ctx);
@@ -115,10 +128,12 @@ export function createResourceHandler(def, services, notifiers, inputGate) {
115
128
  catch (error) {
116
129
  // Inside the measurement on purpose: the completion log's
117
130
  // `metrics.errorCode` and the span's error-code attribute are
118
- // derived from what leaves this callback (#421).
119
- throw asRequestCancelled(error, request.signal);
131
+ // derived from what leaves this callback (#421). An input-required
132
+ // signal leaves with its `requestState` sealed when a key is
133
+ // configured, so a sealing failure is a failed read like any other.
134
+ throw asRequestCancelled(await sealThrown(error, services.requestState, serverContext), request.signal);
120
135
  }
121
- }, { ...appContext, resourceName }, { uri: resourceUri, mimeType });
136
+ }, { ...appContext, resourceName }, { ...observed, mimeType });
122
137
  }
123
138
  catch (error) {
124
139
  // `ctx.requestInput(...)` is protocol control flow, not a failure —
@@ -128,13 +143,37 @@ export function createResourceHandler(def, services, notifiers, inputGate) {
128
143
  // an `McpError` carrying the reason and hint (#379).
129
144
  if (isInputRequiredSignal(error))
130
145
  return error.result;
131
- // Classify without logging — the SDK logs when it catches the thrown error.
132
- if (error instanceof McpError) {
133
- throw error;
134
- }
135
- const { code, message, data } = ErrorHandler.classifyOnly(error);
136
- throw new McpError(code, message, data, { cause: error });
146
+ // Classified without logging: the completion record carries the code.
147
+ const { failure } = resolveDeclaredFailure(def.errors, asMcpError(error));
148
+ throw withRequestId(failure, appContext.requestId);
137
149
  }
138
150
  };
139
151
  }
152
+ /** The thrown value as an `McpError`, classified by {@link ErrorHandler.classifyOnly} when it is not one. */
153
+ function asMcpError(error) {
154
+ if (error instanceof McpError)
155
+ return error;
156
+ const { code, message, data } = ErrorHandler.classifyOnly(error);
157
+ return new McpError(code, message, data, { cause: error });
158
+ }
159
+ /**
160
+ * The error the SDK serializes into the read's JSON-RPC `error`, carrying the
161
+ * read's `requestId` as `data.requestId` (#576) — the id its completion record
162
+ * logs — so a failure reported from the client can be matched to that record.
163
+ * Set after the thrown data, so the framework's value replaces a thrown one.
164
+ *
165
+ * A `-32602` whose `data` is exactly `{ uri }` passes through untouched: it is
166
+ * the spec's resource-not-found shape, which clients recognize by that exact
167
+ * `data`.
168
+ */
169
+ function withRequestId(error, requestId) {
170
+ const { data } = error;
171
+ const isResourceNotFound = error.code === JsonRpcErrorCode.InvalidParams &&
172
+ data !== undefined &&
173
+ typeof data.uri === 'string' &&
174
+ Object.keys(data).length === 1;
175
+ if (isResourceNotFound)
176
+ return error;
177
+ return new McpError(error.code, error.message, { ...data, requestId }, { cause: error });
178
+ }
140
179
  //# sourceMappingURL=resourceHandlerFactory.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"resourceHandlerFactory.js","sourceRoot":"","sources":["../../../../src/mcp-server/resources/utils/resourceHandlerFactory.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH,OAAO,EACL,mBAAmB,EAEnB,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAA0B,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAE9F,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAErE,OAAO,EAAE,kBAAkB,EAAE,MAAM,+CAA+C,CAAC;AACnF,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,gDAAgD,CAAC;AAClG,OAAO,EAAE,wBAAw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qDAAqD;YACrD,IAAI,qBAAqB,CAAC,KAAK,CAAC;gBAAE,OAAO,KAAK,CAAC,MAAM,CAAC;YAEtD,4EAA4E;YAC5E,IAAI,KAAK,YAAY,QAAQ,EAAE,CAAC;gBAC9B,MAAM,KAAK,CAAC;YACd,CAAC;YACD,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,YAAY,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;YACjE,MAAM,IAAI,QAAQ,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;QAC5D,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"resourceHandlerFactory.js","sourceRoot":"","sources":["../../../../src/mcp-server/resources/utils/resourceHandlerFactory.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EACL,mBAAmB,EAEnB,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAEL,qBAAqB,EACrB,UAAU,GACX,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAErE,OAAO,EAAE,kBAAkB,EAAE,MAAM,+CAA+C,CAAC;AACnF,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,gDAAgD,CAAC;AAClG,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAC3E,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAU3E,8EAA8E;AAC9E,oBAAoB;AACpB,8EAA8E;AAE9E,SAAS,cAAc,CAAC,QAAgB;IACtC,MAAM,kBAAkB,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG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AAI,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC;IACjC,IAAI,kBAAkB;QAAE,OAAO,KAAK,CAAC;IACrC,OAAO,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,OAAO,EAAE,EAAE,GAAG,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;AAC3F,CAAC"}
@@ -12,6 +12,7 @@
12
12
  import { type Implementation, McpServer, type ServerNotifier } from '@modelcontextprotocol/server';
13
13
  import type { AppConfig } from '../config/index.js';
14
14
  import type { CacheHints } from './cacheHints.js';
15
+ import { type RequestStateSealer } from './inputRequired.js';
15
16
  import type { PromptRegistry } from './prompts/prompt-registration.js';
16
17
  import type { ResourceRegistry } from './resources/resource-registration.js';
17
18
  import type { ToolRegistry } from './tools/tool-registration.js';
@@ -57,6 +58,14 @@ export interface McpServerDeps {
57
58
  */
58
59
  notifier?: ServerNotifier;
59
60
  promptRegistry: PromptRegistry;
61
+ /**
62
+ * The process's `requestState` sealer, built once from
63
+ * `MCP_REQUEST_STATE_KEY`. Its `verify` becomes the instance's
64
+ * `requestState.verify`, so every echoed state is checked before a handler
65
+ * runs, on the 2025-era shim's rounds as on 2026-07-28 retries. Absent when
66
+ * no key is configured, and the SDK then receives no `requestState` option.
67
+ */
68
+ requestState?: RequestStateSealer;
60
69
  resourceRegistry: ResourceRegistry;
61
70
  /**
62
71
  * Human-readable display name forwarded to `new McpServer({ serverInfo })`.
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/mcp-server/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EACL,KAAK,cAAc,EACnB,SAAS,EAET,KAAK,cAAc,EACpB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4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from '@modelcontextprotocol/server';
13
- import { createInputRequiredGate } from './inputRequired.js';
13
+ import { clientCapabilityView } from './inputRequired.js';
14
14
  import { installResourceSubscriptions } from './resources/resourceSubscriptions.js';
15
15
  import { logger } from '../utils/internal/logger.js';
16
16
  import { requestContextService } from '../utils/internal/requestContext.js';
@@ -58,31 +58,32 @@ export async function createMcpServerInstance(deps) {
58
58
  // `elicitation/create` round trips over the live session) on 2025-era
59
59
  // ones, so handlers are written once.
60
60
  inputRequired: { legacyShim: true },
61
+ ...(deps.requestState && { requestState: { verify: deps.requestState.verify } }),
61
62
  });
63
+ const era = deps.era ?? 'legacy';
62
64
  // The `resources/subscribe` registry is a 2025-era mechanism: the method
63
65
  // does not exist on 2026-07-28, where the client opts in through
64
66
  // `subscriptions/listen` and the SDK filters delivery. Installing it on a
65
67
  // modern instance would leave the registry permanently empty and silently
66
68
  // drop every `ctx.notifyResourceUpdated(uri)` — the notifiers read `undefined`
67
69
  // as "no subscription tracking on this connection" and emit unconditionally.
68
- const subscriptions = (deps.era ?? 'legacy') === 'legacy' ? installResourceSubscriptions(server) : undefined;
69
- // The capability gate on `ctx.requestInput(...)` is a 2025-era mechanism too:
70
- // there the refusal comes from the SDK's legacy shim, above the handler
71
- // callback, where a factory can no longer shape it into an error envelope
72
- // (#379). A modern instance is gated by the SDK itself, before any result
73
- // leaves, so it takes no gate.
74
- const inputGate = (deps.era ?? 'legacy') === 'legacy'
75
- ? createInputRequiredGate(() => server.server.getClientCapabilities())
76
- : undefined;
70
+ const subscriptions = era === 'legacy' ? installResourceSubscriptions(server) : undefined;
71
+ // What the client declared, resolved per request from the source this era
72
+ // has (#580): the `initialize` value on a 2025-era instance, the request's
73
+ // envelope on a modern one. One view per instance feeds
74
+ // `ctx.clientCapabilities`, the filter over `ctx.inputs` (#496), and — on
75
+ // the 2025-era arm only, where the SDK's shim refusal cannot be shaped into
76
+ // an error envelope (#379) — the gate `ctx.requestInput` runs.
77
+ const capabilities = clientCapabilityView(era, server);
77
78
  try {
78
79
  logger.debug('Registering all MCP capabilities via registries...', context);
79
80
  // The bus reaches a modern instance only. Passing it to a legacy one would
80
81
  // route `ctx.notify*` away from the live session that can actually deliver
81
82
  // it — the 2025 era has no `subscriptions/listen` stream to publish to.
82
- const bus = (deps.era ?? 'legacy') === 'modern' ? deps.notifier : undefined;
83
+ const bus = era === 'modern' ? deps.notifier : undefined;
83
84
  await Promise.all([
84
- deps.toolRegistry.registerAll(server, subscriptions, bus, inputGate),
85
- deps.resourceRegistry.registerAll(server, subscriptions, bus, inputGate),
85
+ deps.toolRegistry.registerAll(server, subscriptions, bus, capabilities),
86
+ deps.resourceRegistry.registerAll(server, subscriptions, bus, capabilities),
86
87
  deps.promptRegistry.registerAll(server),
87
88
  ]);
88
89
  logger.debug('All MCP capabilities registered successfully', context);
@@ -1 +1 @@
1
- {"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/mcp-server/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAEL,SAAS,GAGV,MAAM,8BAA8B,CAAC;AAItC,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAGxE,OAAO,EAAE,4BAA4B,EAAE,MAAM,iDAAiD,CAAC;AAE/F,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AA2D3E;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAAC,IAAmB;IAC/D,MAAM,OAAO,GAAG,qBAAqB,CAAC,oBAAoB,CAAC;QACzD,SAAS,EAAE,yBAAyB;KACrC,CAAC,CAAC;IACH,MAAM,CAAC,KAAK,CAAC,kCAAkC,EAAE,OAAO,CAAC,CAAC;IAE1D,MAAM,MAAM,GAAG,IAAI,SAAS,CAC1B;QACE,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,aAAa;QAC/B,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC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,EAAE,MAAM,CAAC,CAAC;IAEvD,IAAI,CAAC;QACH,MAAM,CAAC,KAAK,CAAC,oDAAoD,EAAE,OAAO,CAAC,CAAC;QAE5E,2EAA2E;QAC3E,2EAA2E;QAC3E,wEAAwE;QACxE,MAAM,GAAG,GAAG,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC;QAEzD,MAAM,OAAO,CAAC,GAAG,CAAC;YAChB,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,MAAM,EAAE,aAAa,EAAE,GAAG,EAAE,YAAY,CAAC;YACvE,IAAI,CAAC,gBAAgB,CAAC,WAAW,CAAC,MAAM,EAAE,aAAa,EAAE,GAAG,EAAE,YAAY,CAAC;YAC3E,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,MAAM,CAAC;SACxC,CAAC,CAAC;QAEH,MAAM,CAAC,KAAK,CAAC,8CAA8C,EAAE,OAAO,CAAC,CAAC;IACxE,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,CAAC,KAAK,CACV,qCAAqC,EACrC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,EACnD,OAAO,CACR,CAAC;QACF,MAAM,GAAG,CAAC;IACZ,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -3,7 +3,7 @@
3
3
  * @module src/mcp-server/tools/tool-registration
4
4
  */
5
5
  import type { McpServer, ServerNotifier } from '@modelcontextprotocol/server';
6
- import type { InputRequiredGate } from '../inputRequired.js';
6
+ import type { ClientCapabilityView } from '../inputRequired.js';
7
7
  import type { ResourceSubscriptions } from '../notifications.js';
8
8
  import type { AnyToolDefinition } from './utils/toolDefinition.js';
9
9
  import { type HandlerServices } from './utils/toolHandlerFactory.js';
@@ -20,8 +20,12 @@ export declare class ToolRegistry {
20
20
  /** Tracks registered tool names to detect duplicates at startup. */
21
21
  private readonly registeredNames;
22
22
  constructor(toolDefs: AnyToolDef[], services: HandlerServices);
23
- /** Registers all tool definitions with the provided McpServer instance. */
24
- registerAll(server: McpServer, subscriptions?: ResourceSubscriptions, bus?: ServerNotifier, inputGate?: InputRequiredGate): Promise<void>;
23
+ /**
24
+ * Registers all tool definitions with the provided McpServer instance.
25
+ * `capabilities` is the instance's view of what its client declared (#580),
26
+ * which every handler context resolves per request.
27
+ */
28
+ registerAll(server: McpServer, subscriptions?: ResourceSubscriptions, bus?: ServerNotifier, capabilities?: ClientCapabilityView): Promise<void>;
25
29
  /** Throws at startup if a tool with the same name was already registered. */
26
30
  private assertUniqueName;
27
31
  /** Registers a standard tool definition. */
@@ -1 +1 @@
1
- {"version":3,"file":"tool-registration.d.ts","sourceRoot":"","sources":["../../../src/mcp-server/tools/tool-registration.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAgB,MAAM,8BAA8B,CAAC;AAE5F,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAG3E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4CAA4C,CAAC;AACpF,OAAO,EAGL,KAAK,eAAe,EAErB,MAAM,gDAAgD,CAAC;AAMxD;;;;;GAKG;AACH,MAAM,MAAM,UAAU,GAAG,iBAAiB,CAAC;AAU3C,qBAAa,YAAY;IAKrB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAL3B,oEAAoE;IACpE,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAqB;IAErD,YACmB,QAAQ,EAAE,UAAU,EAAE,EACtB,QAAQ,EAAE,eAAe,EACxC;IAEJ,2EAA2E;IAC9D,WAAW,CACtB,MAAM,EAAE,SAAS,EACjB,aAAa,CAAC,EAAE,qBAAqB,EACrC,GAAG,CAAC,EAAE,cAAc,EACpB,SAAS,CAAC,EAAE,iBAAiB,GAC5B,OAAO,CAAC,IAAI,CAAC,CA8Cf;IAED,6EAA6E;IAC7E,OAAO,CAAC,gBAAgB;IAUxB,4CAA4C;YAC9B,YAAY;CAkD3B"}
1
+ {"version":3,"file":"tool-registration.d.ts","sourceRoot":"","sources":["../../../src/mcp-server/tools/tool-registration.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAgB,MAAM,8BAA8B,CAAC;AAE5F,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAG3E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4CAA4C,CAAC;AACpF,OAAO,EAGL,KAAK,eAAe,EAErB,MAAM,gDAAgD,CAAC;AAMxD;;;;;GAKG;AACH,MAAM,MAAM,UAAU,GAAG,iBAAiB,CAAC;AAU3C,qBAAa,YAAY;IAKrB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAL3B,oEAAoE;IACpE,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAqB;IAErD,YACmB,QAAQ,EAAE,UAAU,EAAE,EACtB,QAAQ,EAAE,eAAe,EACxC;IAEJ;;;;OAIG;IACU,WAAW,CACtB,MAAM,EAAE,SAAS,EACjB,aAAa,CAAC,EAAE,qBAAqB,EACrC,GAAG,CAAC,EAAE,cAAc,EACpB,YAAY,CAAC,EAAE,oBAAoB,GAClC,OAAO,CAAC,IAAI,CAAC,CA8Cf;IAED,6EAA6E;IAC7E,OAAO,CAAC,gBAAgB;IAUxB,4CAA4C;YAC9B,YAAY;CAkD3B"}
@@ -21,8 +21,12 @@ export class ToolRegistry {
21
21
  this.toolDefs = toolDefs;
22
22
  this.services = services;
23
23
  }
24
- /** Registers all tool definitions with the provided McpServer instance. */
25
- async registerAll(server, subscriptions, bus, inputGate) {
24
+ /**
25
+ * Registers all tool definitions with the provided McpServer instance.
26
+ * `capabilities` is the instance's view of what its client declared (#580),
27
+ * which every handler context resolves per request.
28
+ */
29
+ async registerAll(server, subscriptions, bus, capabilities) {
26
30
  // Reset per-server uniqueness tracking — registries are shared across
27
31
  // per-request McpServer instances under HTTP serving.
28
32
  this.registeredNames.clear();
@@ -57,7 +61,7 @@ export class ToolRegistry {
57
61
  // `tools` capability, so a server with every tool disabled still answers
58
62
  // `tools/list` with an empty array rather than `-32601`.
59
63
  for (const toolDef of tools) {
60
- await this.registerTool(server, toolDef, notifiers, inputGate);
64
+ await this.registerTool(server, toolDef, notifiers, capabilities);
61
65
  }
62
66
  }
63
67
  /** Throws at startup if a tool with the same name was already registered. */
@@ -69,7 +73,7 @@ export class ToolRegistry {
69
73
  this.registeredNames.add(name);
70
74
  }
71
75
  /** Registers a standard tool definition. */
72
- async registerTool(server, tool, notifiers, inputGate) {
76
+ async registerTool(server, tool, notifiers, capabilities) {
73
77
  const registrationContext = requestContextService.createRequestContext({
74
78
  operation: 'ToolRegistry.registerTool',
75
79
  additionalContext: { toolName: tool.name },
@@ -77,7 +81,7 @@ export class ToolRegistry {
77
81
  logger.debug(`Registering tool: '${tool.name}'`, registrationContext);
78
82
  this.assertUniqueName(tool.name);
79
83
  await ErrorHandler.tryCatch(() => {
80
- const handler = createToolHandler(tool, this.services, notifiers, inputGate);
84
+ const handler = createToolHandler(tool, this.services, notifiers, capabilities);
81
85
  const title = tool.title ?? tool.annotations?.title ?? deriveTitleFromName(tool.name);
82
86
  // Advertised verbatim; the same schema rejects the same arguments one
83
87
  // layer down, where a rejection can carry the framework's structured
@@ -1 +1 @@
1
- {"version":3,"file":"tool-registration.js","sourceRoot":"","sources":["../../../src/mcp-server/tools/tool-registration.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,oBAAoB,EAAE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E,KAAK,IAAI,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAEtF,sEAAsE;YACtE,qEAAqE;YACrE,uEAAuE;YACvE,yDAAyD;YACzD,MAAM,WAAW,GAAG,oBAAoB,CAAC,IAAI,CAAC,KAAK,CAAiC,CAAC;YAErF,sFAAsF;YACtF,MAAM,CAAC,YAAY,CACjB,IAAI,CAAC,IAAI,EACT;gBACE,KAAK;gBACL,WAAW,EAAE,IAAI,CAAC,WAAW;gBAC7B,WAAW;gBACX,YAAY,EAAE,sBAAsB,CAAC,IAAI,CAAC;gBAC1C,GAAG,CAAC,IAAI,CAAC,WAAW,IAAI,EAAE,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,CAAC;gBAC1D,GAAG,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC;aACzC,EACD,OAA0C,CAC3C,CAAC;YAEF,MAAM,CAAC,KAAK,CAAC,SAAS,IAAI,CAAC,IAAI,4BAA4B,EAAE,mBAAmB,CAAC,CAAC;QACpF,CAAC,EACD;YACE,SAAS,EAAE,mBAAmB,IAAI,CAAC,IAAI,EAAE;YACzC,OAAO,EAAE,mBAAmB;YAC5B,SAAS,EAAE,gBAAgB,CAAC,oBAAoB;YAChD,QAAQ,EAAE,IAAI;SACf,CACF,CAAC;IACJ,CAAC;CACF"}
@@ -7,7 +7,7 @@ import type { CallToolResult, ContentBlock, InputRequiredResult, ServerContext }
7
7
  import { ZodError, type ZodObject, type ZodRawShape, z } from 'zod';
8
8
  import type { Context } from '../../../core/context.js';
9
9
  import { type HandlerServices } from '../../handlerContext.js';
10
- import { type InputRequiredGate } from '../../inputRequired.js';
10
+ import { type ClientCapabilityView } from '../../inputRequired.js';
11
11
  import type { NotifierSources } from '../../notifications.js';
12
12
  import { JsonRpcErrorCode } from '../../../types-global/errors.js';
13
13
  import { type RequestContext } from '../../../utils/internal/requestContext.js';
@@ -35,9 +35,9 @@ export declare function renderToolContent(def: AnyToolDefinition, validatedOutpu
35
35
  * - `structuredContent.error` — read by clients like Claude Code (JSON)
36
36
  *
37
37
  * The text carries the message, the `data.recovery.hint` when it adds
38
- * something, and the branchable `reason` / `retryable` terms
39
- * {@link renderBranchableTerms} renders; the numeric `code` and `data.issues`
40
- * stay JSON-only.
38
+ * something, and the `reason` / `retryable` / `request` terms
39
+ * {@link renderBranchableTerms} renders, in that order; the numeric `code` and
40
+ * `data.issues` stay JSON-only.
41
41
  *
42
42
  * The `Recovery:` line is dropped when the message already contains the hint
43
43
  * verbatim (#459) — `buildArgumentRecoveryHint` restates a constraint or
@@ -113,14 +113,22 @@ export declare function parseToolArguments<TDefinition extends AnyToolDefinition
113
113
  * Builds an error `CallToolResult` from a raw thrown value. Classifies via
114
114
  * {@link ErrorHandler.classifyOnly} when the value isn't already an
115
115
  * `McpError`. Only propagates data from `McpError` (its declared `data`) or
116
- * `ZodError` (its `issues`) — other thrown values get a `structuredContent.error`
117
- * with `code` and `message` only, so internal classification context never
118
- * leaks to clients.
116
+ * `ZodError` (its `issues`), so internal classification context never leaks
117
+ * to clients.
118
+ *
119
+ * `requestId`, when given, is set as `data.requestId` on the envelope — after
120
+ * the thrown data, so the framework's value replaces a thrown one, as
121
+ * canonical fields win in log records (#550) — and closes the `content[]`
122
+ * terms line (#576). It is the one request-context field that reaches `data`,
123
+ * added here rather than to the thrown `McpError.data`, so the error the
124
+ * handler threw and the log record's `errorData` stay context-free (#548).
125
+ * `runToolContract` passes none: it has no real request, so a thrown
126
+ * `data.requestId` is dropped rather than rendered as one.
119
127
  *
120
128
  * Use after invoking {@link ErrorHandler.handleError} for OTel/logging side
121
129
  * effects — this helper does not log.
122
130
  */
123
- export declare function classifyAndBuildToolErrorResult(error: unknown): CallToolResult;
131
+ export declare function classifyAndBuildToolErrorResult(error: unknown, requestId?: string): CallToolResult;
124
132
  /**
125
133
  * The schema the framework **parses** a successful result against: the declared
126
134
  * `output`, extended with the `enrichment` block when one is declared. Strict by
@@ -197,5 +205,5 @@ export declare function buildToolSuccessResult(def: AnyToolDefinition, ctx: Cont
197
205
  * - Catches errors and returns `isError: true`, counting one raised before the
198
206
  * measured region (the scope check, argument validation) on `mcp.tool.rejections`
199
207
  */
200
- export declare function createToolHandler(def: AnyToolDefinition, services: HandlerServices, notifiers: NotifierSources, inputGate?: InputRequiredGate): (input: Record<string, unknown>, ctx: ServerContext) => Promise<CallToolResult | InputRequiredResult>;
208
+ export declare function createToolHandler(def: AnyToolDefinition, services: HandlerServices, notifiers: NotifierSources, capabilities?: ClientCapabilityView): (input: Record<string, unknown>, ctx: ServerContext) => Promise<CallToolResult | InputRequiredResult>;
201
209
  //# sourceMappingURL=toolHandlerFactory.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"toolHandlerFactory.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/utils/toolHandlerFactory.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,cAAc,EACd,YAAY,EACZ,mBAAmB,EACnB,aAAa,EACd,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,QAAQ,EAAE,KAAK,SAAS,EAAE,KAAK,WAAW,EAAgB,CAAC,EAAE,MAAM,KAAK,CAAC;AAGlF,OAAO,KAAK,EAAE,OAAO,EAAmB,MAAM,mBAAmB,CAAC;AAElE,OAAO,EAEL,KAAK,eAAe,EAGrB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,KAAK,iBAAiB,EAAyB,MAAM,+BAA+B,CAAC;AAC9F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAGrE,OAAO,EAGL,gBAAgB,EAEjB,MAAM,0BAA0B,CAAC;AAIlC,OAAO,EACL,KAAK,cAAc,EAGpB,MAAM,oCAAoC,CAAC;AAG5C,OAAO,EAGL,KAAK,oBAAoB,EAO1B,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qB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